Operatinal NCEP grib files often have the U and corresponding V fields in the same grib message.
(U and V are submessages.) Typically wgrib2 converts all the submessages into individual messages.
In order to combine the U and V fields together, you replace the -grib option
with -ncep_uv. Options like
-grib_out and -new_grid do not have the capability
to combine the U and V fields. For theses cases, you run the output through wgrib2.
Note that -ncep_uv is more like -grib than
-grib_out. The option
-ncep_uv uses the compressed grid point values from the original file.
Neither the grid point values nor the packing is changed.
$ wgrib2 test.grb2 -match ":500 mb:" -ncep_uv output.grb
$ wgrib2 test.grb2 -inv /dev/null -new_grid_winds earth -new_grid ncep grid 221 - | wgrib2 - -ncep_uv output.grb
In the above example, the first wgrib2 regrids the file and writes it into stdout.
The second wgrib2 reads the new grib file from stdout and combines the U and V
records together into one message.