Extracting Variables Using Wgrib

Diane Stokes Diane.Stokes at NOAA.GOV
Fri Jan 27 16:26:15 EST 2006


Scott,

If you look for kpds6=100, you'll get only the level data.   The "-s"
option of wgrib won't give you that info.  Does the following do what
you need?

wgrib grib_file | egrep "(:UGRD:|:VGRD:)" | grep ":kpds6=100:" | \
           wgrib -i -grib grib_file -o new_grib_file

    Diane


Eric DeWeaver wrote:

> Hi Scott,
>
> I've done this using :UGRD:500:|:VGRD:500:
> I did each pressure level separately, not sure if
> you can get multiple levels at once.
>
> -Eric
>
> On Fri, 27 Jan 2006, Kristian Nilssen wrote:
>
>
>>can you not do something like...
>>wgrib -s grib_file | egrep "(:UGRD:SEA:|:VGRD:SEA:)" | wgrib -i -grib \
>>          grib_file -o new_grib_file
>>
>>...just include the level in other words.
>>
>>Kristian.
>>
>>
>>Scott Weaver wrote:
>>
>>>Hello everyone,
>>>
>>>I am trying to extract a subset of variables from a grib file.  For
>>>instance U and V winds.  The original file has pressure level U and V
>>>winds which I am interested in.  These are called UGRDprs and VGRDprs.
>>>The file also has several other types of U and V winds which I am
>>>not interested in.  (UGRD10m, UGRDhbl etc.)  when I scan the grib file
>>>anything that is U or V wind is always referred to as just UGRD and VGRD
>>>and not the more specific variable name.  When I do:
>>>
>>>wgrib -s grib_file | egrep "(:UGRD:|:VGRD:)" | wgrib -i -grib \
>>>          grib_file -o new_grib_file
>>>
>>>It extracts all types of U and V winds.  My question is:
>>>
>>>Is there a way to further refine the selection so that only the pressure
>>>level U and V winds are extracted.  Thank you for your suggestions.
>>>
>>>Regards,
>>>
>>>Scott
>>>
>>>______________________________________________
>>>Scott J. Weaver
>>>PhD Candidate
>>>Graduate Research Assistant
>>>Department of Atmospheric and Oceanic Science
>>>University of Maryland
>>>College Park, MD 20742
>>>301-785-7201
>>>sweaver at atmos.umd.edu
>>
>

--
Diane Stokes
Environmental Modeling Center
National Weather Service/NOAA



More information about the gradsusr mailing list