[gradsusr] regridding issues with lats4d

Lee Byerle lbyerle at yahoo.com
Mon Dec 3 16:42:54 EST 2012


Greg,
Attached is a sample parameter file you can edit to control the output naming.  For example, edit the section where you see the variable sfcpres (Surface pressure).  Something similar can be added for your variable snodsfc.  Try an ID of 66:

snodsfc | 66  | Snow depth                                                      | m    | float | sfc | -999 | 16 |   |   |

Add the option:  -table default.grads.lats.table.txt  to the lats4d.sh command.
To get forecast specified, it should work if you consider using the option -time t1 t2 tincr in the lats command (tincr defaults to one), e.g.,

-time 00z03Dec2012 00z08Dec2012

retrieves every output time from 00z 3 Dec to 00z 8 Dec.

good luck,
Lee


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: default.grads.lats.table.txt
Url: http://gradsusr.org/pipermail/gradsusr/attachments/20121203/2044bc7c/attachment-0003.txt 
-------------- next part --------------

On Dec 2, 2012, at 7:56 PM, Fishel, Greg wrote:

> Well, I now have a grib file, but the time (48 hour fcst) has been changed
> to analysis, and the variable has been changed from snodsfc (snow depth
> surface) to PRES. I must confess I do not understand this lats parameter
> table. How do I know what the contents of this table are, and is there a
> chance that snodsfc is missing from that table?
> 
> Greg
> 
> On 11/29/12 10:53 PM, "Lee Byerle" <lbyerle at yahoo.com> wrote:
> 
>> 
>> 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.maste
>>> rg
>>> rb2f00&lev_surface=on&\
>>> 
>>> var_SNOD=on&leftlon=0&rightlon=360&toplat=90&bottomlat=-90&dir=%2Fgfs.201
>>> 21
>>> 12912%2Fmaster"
>>> 
>>> 
>>> MOD_URL="http://nomads.ncep.noaa.gov/pub/data/nccf/com/cfs/prod/cfs/cfs.2
>>> 01
>>> 21129/12/6hrly_grib_01/ocnf2012121100.01.2012112912.grb2"
>>> 
>>> MOD_URL_IDX="http://nomads.ncep.noaa.gov/pub/data/nccf/com/cfs/prod/cfs/c
>>> fs
>>> .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
>> 
>> 
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
> 
> 
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr



More information about the gradsusr mailing list