The -d N option specifies the grib message number (N) to
(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.
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.