Skip Navigation Links 
NOAA logo - Click to go to the NOAA home page National Weather Service   NWS logo - Click to go to the NWS home page
Climate Prediction Center

About Us
   Our Mission
   Who We Are

Contact Us
   CPC Information
   CPC Web Team

HOME > Monitoring_and_Data > Oceanic and Atmospheric Data > Reanalysis: Atmospheric Data > wgrib2-match_inv

wgrib2: -match_inv


The -match_inv option prints out the inventory which is used by the -match, -not, -if, -not_if -match_fs, -not_fs, -if_fs and -not_if_fs options.

-sh-2.05b$ wgrib2 new.grb2 -match_inv
1:0:d=2007032600:HGT:1000 mb:anl:vt=2007032600
2:125535:d=2007032600:HGT:1000 mb:3 hour fcst:vt=2007032603




The format of the "match inventory" has evolved and will continue to evolve. The rule for future changes is that new items in the "match inventory" will be added as the second last item. Consequently the last item in the inventory will always be ":vt=YYYYMMDDHH:". In order to future proof your -match, and -not selections, you must not include any item before the ":vt=YYYYMMDD:" field.

    -match ":vt=2011111500:"                  good
    -not ":vt=2011111500:$"                   good (dollar sign matches the end of the line)
    -not ":n=10:vt=2011111500:"               bad (item before :vt=)
    -match ":RH:975 mb:anl::vt=2010050806:"   bad (item before :vt=)
Some recent changes (as of Nov 2011) to the match inventory include:
  • adding the "extended name of the variable", ex. TMP.prob_<273
  • adding the inventory number, ex. n=10
  • adding ensemble/chemical/probability information (-misc)

Changes: wgrib2 v2.0.5

For all versions of wgrib2 up to v2.0.4, the match inventory was dependent on the verbosity mode (0,1,2). As a results, -match ":HGT:10 mb:" would work in default mode but would not work in the -v1 and v2 modes. With wgrib2 v2.0.5, the match inventory is generated with default verbosity mode (-v0). It is possible that this break a few pieces of code. However, I think that the match facility shouldn't be dependent on the verbosity mode.

See also: -if, -if_fs, -match, -Match_inv, -match_fs, -not, -not_fs, -not_if, -not_if_fs, -set_regex.

NOAA/ National Weather Service
National Centers for Environmental Prediction
Climate Prediction Center
5830 University Research Court
College Park, Maryland 20740
Climate Prediction Center Web Team
Page last modified: March 1, 2016
Disclaimer Privacy Policy