[gradsusr] regridding issues with lats4d

Lee Byerle lbyerle at yahoo.com
Thu Nov 29 22:53:12 EST 2012


Greg,

Assuming lats4d is reading the file correctly, you should also include the regrid function to interpolate.  Below is an example for re-gridding to uniform 1-deg globally (with -format grads_grib )

lats4d.sh -i cfs.snow.grib2.ctl -vars snodsfc -func 're(@,360,linear,0,1,181,linear,-90,1.,bl)' -de gfs.snow.grib2.ctl -o -format grads_grib cfs.snow.newgrid.grib2

lats4d may not work properly for grib2 files. You may also consider using wgrib2.  An example is: 

wgrib2 ens_all_old.grb2  -new_grid_winds earth -new_grid_interpolation bilinear -new_grid latlon 0:360:1 90:181:-1 ens_all_new.grb2

Web pages for reference:
http://www.cpc.ncep.noaa.gov/products/wesley/wgrib2/
http://opengrads.org/doc/scripts/lats4d/

good luck,
Lee




On Nov 29, 2012, at 7:03 PM, Fishel, Greg wrote:

> I am extremely new to Grads, so I apologize in advance if this question
> seems too basic. I work for a television station, and am always
> experimenting with getting different datasets on the air. Unfortunately,
> our graphics system does not care for the gaussian grids. So I am
> attempting to use lats4d to interpolate some of the cfs products onto a
> standard gfs grid. My script is not giving me any error messages but the
> grib file being written is empty. Below is my bash script. The data
> downloads fine, and control and index files are created for both the cfs
> and gfs without any issues. Any help would be much appreciated. Thanks!
> 
> cd $MODEL/gfs
> 
> #----------------------------------------------DOWNLOAD CFS AND GFS SNOW
> DEPTH FORECASTS FOR A SINGLE TIME--------------------------------------
> 
> wget -O gfs.snow.grib2
> "http://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_hd.pl?file=gfs.t12z.masterg
> rb2f00&lev_surface=on&\
> var_SNOD=on&leftlon=0&rightlon=360&toplat=90&bottomlat=-90&dir=%2Fgfs.20121
> 12912%2Fmaster"
> 
> MOD_URL="http://nomads.ncep.noaa.gov/pub/data/nccf/com/cfs/prod/cfs/cfs.201
> 21129/12/6hrly_grib_01/ocnf2012121100.01.2012112912.grb2"
> MOD_URL_IDX="http://nomads.ncep.noaa.gov/pub/data/nccf/com/cfs/prod/cfs/cfs
> .20121129/12/6hrly_grib_01/ocnf2012121100.01.2012112912.grb2.idx"
> 
> get_inv.pl $MOD_URL_IDX | grep ":SNOD:surface" | get_grib.pl $MOD_URL
> cfs.snow.grib2
> 
> 
> #-------------------------CREATE CONTROL AND INDEX FILES FOR CFS AND GFS
> DATA-----------------------------------------------------------------------
> ----
> 
> 
> g2ctl gfs.snow.grib2 > gfs.snow.grib2.ctl
> gribmap -v -i gfs.snow.grib2.ctl
> 
> #-----------------CREATE GRADS
> FILES----------------------------------------------------------------------
> -----------------------------------------
> 
> g2ctl cfs.snow.grib2 > cfs.snow.grib2.ctl
> gribmap -v -i cfs.snow.grib2.ctl
> 
> 
> #---------------------------INTERPOLATE CFS DATA ONTO GFS
> GRID-----------------------------------------------------------------------
> --------
> 
> 
> 
> 
> lats4d.sh -i cfs.snow.grib2.ctl -vars snodsfc -o cfs.snow.newgrid.grib2
> -format grib -de gfs.snow.grib2.ctl
> 
> 
> 
> 
> 
> 
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr





More information about the gradsusr mailing list