[gradsusr] g2grb subregion

Mike Manning michael at bsch.au.com
Fri May 18 03:19:50 EDT 2012


Hi all,

I've got data downloaded from an archive now however I'd like to extract 
a subregion from the grib2 files using g2grb.  I've created a test.ctl 
files as follows:

'open gfs.00z.ctl'
'set lat -55 0'
'set lon 100 170'
'g2grb LFTXsfc extrap.grb UGRD:1000 mb:anl:packing=j:center=7'
#'g2grb h(lev=925) +extrap.grb HGT:925 mb:anl:packing=j:center=7'
#'g2grb h(lev=850) +extrap.grb HGT:850 mb:anl:packing=j:center=7'
#'g2grb h(lev=700) +extrap.grb HGT:700 mb:anl:packing=j:center=7'
#'g2grb h(lev=600) +extrap.grb HGT:600 mb:anl:packing=j:center=7'
#'g2grb h(lev=500) +extrap.grb HGT:500 mb:anl:packing=j:center=7'
quit


I run it using grads -blc however it's throwing up some errors:
Starting "/grads2/Linux/Versions/2.0.a9.oga.1/i686/grads   -blc test.ctl 
" ...


Grid Analysis and Display System (GrADS) Version 2.0.a9.oga.1
Copyright (c) 1988-2010 by Brian Doty and the
Institute for Global Environment and Society (IGES)
GrADS comes with ABSOLUTELY NO WARRANTY
See file COPYRIGHT for more information

Config: v2.0.a9.oga.1 little-endian readline printim grib2 netcdf 
hdf4-sds hdf5 opendap-grids,stn athena geotiff shapefile
Issue 'q config' command for more detailed configuration information
Loading User Defined Extensions table 
</grads2/Linux/Versions/2.0.a9.oga.1/i686/gex/udxt> ... ok.
GX Package Initialization: Size = 11 8.5
Running in Batch mode
dlon=1 nx = 71 lon0 = 100
Y is varying   Lat = -55 to 0   Y = 36 to 91
dlat=1 ny = 56 lat0 = -55
need to generate date
new inv=d=2011121000:UGRD:1000 mb:anl:packing=j:center=7
new grads found undef=-999000000.000000
making template file
! /grads2/wgrib2 $GADDIR/template.grb2 -d 1 -lola 100:71:1 -55:56:1 
extrap.grb.template grib
argument: -lola ????
argument: 100:71:1 ????
argument: -55:56:1 ????
argument: extrap.grb.template ????
argument: grib ????
missing GRIB record(s)
opening fwrite extrap.grb.tmp
going to display LFTXsfc
result is Wrote 3976 of 3976 elements to extrap.grb.tmp as Sequential 
Big_Endian

metadata = 1:0:d=2011121000:UGRD:1000 mb:anl:packing=j:center=7:
! /grads2/wgrib2  extrap.grb.template -import_ieee extrap.grb.tmp 
-set_metadata extrap.grb.inv -undefine_val -999000000.000000 -grib_out 
extrap.grb
argument: -import_ieee ????
argument: extrap.grb.tmp ????
argument: -set_grib_type ????
argument: c3 ????
argument: -set_metadata ????
argument: extrap.grb.inv ????
argument: -undefine_val ????
argument: -999000000.000000 ????
argument: -grib_out ????
argument: extrap.grb ????
could not open file: extrap.grb.template

!rm extrap.grb.tmp extrap.grb.inv extrap.grb.template
rm: cannot remove `extrap.grb.template': No such file or directory


I'm not sure why it's not working :( All I'd like to do is extract the 
subregion from lat -55 to 0 and lon 100 to 170 for all variables in the 
grib data files I've downloaded.

Cheers, Mike


More information about the gradsusr mailing list