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-d

wgrib2: -d


The -d N option specifies the grib message number (N) to process. (The -d N option comes from wgrib where "d" stood fom "dump".) For messages with submessages, the argument is of the form N.M where N is the message number and M is the submessage number. If M is missing, only the first submessage is processed.

If there are more than one -d on a command line, only the last one is used.

The form, -d all, is not valid in wgrib2. This is the default action.

The -d should be used with caution. The order of messages records within grib files can change without notice (ex. today's forecast may have a different order from tomorrow's forecast). I use -d interactively but this option should not be used in scripts unless you are 100% certain of the order of the records.


-d N
-d N.M

where N and M are integers.


$ wgrib2 test.grb2 -s -d 1 -bin data.bin
1:0:d=2005090200:HGT:1000 mb:60 hour fcst
The above command writes the first record to a binary file data.bin
$ wgrib2 test.grb2 -s -d 287.2 -bin data.bin
287.2:37032193:d=2005090200:VGRD:10 m above ground:60 hour fcst
The above command dumps the second submessage of record 287.

See also: -for, -i,

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: Aug 27, 2014
Disclaimer Privacy Policy