The -d N option specifies the record number (N) to "dump"
or "decode". For messages with submessages, the arguemnt 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 decoded.
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 if there is no -i option.
The -d should be used with caution. The order of
records within grib files can change without notice (ex. today's forecast
may have a different order from tomorrow's forecast). All scripts should
use the -i option unless you are 100% certain of the
order of the records. The -d option mainly used
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.