[gradsusr] Lats4d Changing Variable and Time

Fishel, Greg gfishel at wral.com
Tue Dec 4 12:05:47 EST 2012


OK, I have a cfs grib2 file, as evidenced by the following inventory
produced by wgrib2:

1:0:d=2012120312:SNOD:surface:6 hour fcst:
2:33208:d=2012120312:SNOD:surface:12 hour fcst:
3:66380:d=2012120312:SNOD:surface:18 hour fcst:
4:99643:d=2012120312:SNOD:surface:24 hour fcst:
5:132801:d=2012120312:SNOD:surface:30 hour fcst:
6:165539:d=2012120312:SNOD:surface:36 hour fcst:
7:198305:d=2012120312:SNOD:surface:42 hour fcst:
8:231208:d=2012120312:SNOD:surface:48 hour fcst:

---------------------------------------------------------------------------
---------------------------------------------------------------------------
--------

The data is on a gaussian grid, again as shown by  wgrib2:

1:0:vt=2012120318:surface:6 hour fcst:SNOD Snow Depth [m]:
    ndata=72960:undef=48334:mean=0.442751:min=0:max=1.99616
    grid_template=40:winds(N/S):
	Gaussian grid: (384 x 190) units 1e-06 input WE:NS output WE:SN
	number of latitudes between pole-equator=95 #points=72960
	lat 89.277000 to -89.277000
	lon 0.000000 to 359.062000 by 0.938000

---------------------------------------------------------------------------
---------------------------------------------------------------------------
--------

I then create a control file for the gfs file:


dset ^gfs.snow.grib2
index ^gfs.snow.grib2.idx
undef 9.999E+20
title gfs.snow.grib2
* produced by g2ctl v0.0.8.8
* command line options: -verf gfs.snow.grib2
* griddef=1:0:(720 x 361):grid_template=0:winds(N/S): lat-lon grid:(720 x
361) units 1e-06 input WE:NS output WE:SN res 48 lat 90.000000 to
-90.000000 by 0.500000 lon 0.000000 to 359.500000 by 0.500000
#points=259920:winds(N/S)
dtype grib2
ydef 361 linear -90.000000 0.5
xdef 720 linear 0.000000 0.500000
tdef 8 linear 18Z03dec2012 6hr
zdef 1 linear 1 1
vars 1
SNODsfc   0,1,0   0,1,11 ** surface Snow Depth [m]
ENDVARS

---------------------------------------------------------------------------
---------------------------------------------------------------------------
--------

And then a control file for the cfs file

dset ^cfs.snow.grib2


index ^cfs.snow.grib2.idx
undef 9.999E+20
title cfs.snow.grib2
* produced by g2ctl v0.0.8.8
* command line options: -verf cfs.snow.grib2
* griddef=1:0:(384 x 190):grid_template=40:winds(N/S): Gaussian grid: (384
x 190) units 1e-06 input WE:NS output WE:SN number of latitudes between
pole-equator=95 #points=72960 lat 89.277000 to -89.277000 lon 0.000000 to
359.062000 by 0.938000:winds(
dtype grib2
* ny=190 nlat=190 lat0=-89.277000 lat1=89.277000
xdef 384 linear 0.000000 0.937498694516971
ydef 190 levels
 -89.277 -88.340 -87.397 -86.454 -85.509 -84.565 -83.620 -82.676 -81.731
-80.786 -79.841 -78.897 -77.952 -77.007
 -76.062 -75.117 -74.173 -73.228 -72.283 -71.338 -70.393 -69.448 -68.503
-67.559 -66.614 -65.669 -64.724 -63.779
 -62.834 -61.889 -60.945 -60.000 -59.055 -58.110 -57.165 -56.220 -55.275
-54.330 -53.386 -52.441 -51.496 -50.551
 -49.606 -48.661 -47.716 -46.771 -45.827 -44.882 -43.937 -42.992 -42.047
-41.102 -40.157 -39.212 -38.268 -37.323
 -36.378 -35.433 -34.488 -33.543 -32.598 -31.653 -30.709 -29.764 -28.819
-27.874 -26.929 -25.984 -25.039 -24.094
 -23.150 -22.205 -21.260 -20.315 -19.370 -18.425 -17.480 -16.535 -15.590
-14.646 -13.701 -12.756 -11.811 -10.866
  -9.921  -8.976  -8.031  -7.087  -6.142  -5.197  -4.252  -3.307  -2.362
-1.417  -0.472   0.472   1.417   2.362
   3.307   4.252   5.197   6.142   7.087   8.031   8.976   9.921  10.866
11.811  12.756  13.701  14.646  15.590
  16.535  17.480  18.425  19.370  20.315  21.260  22.205  23.150  24.094
25.039  25.984  26.929  27.874  28.819
  29.764  30.709  31.653  32.598  33.543  34.488  35.433  36.378  37.323
38.268  39.212  40.157  41.102  42.047
  42.992  43.937  44.882  45.827  46.771  47.716  48.661  49.606  50.551
51.496  52.441  53.386  54.330  55.275
  56.220  57.165  58.110  59.055  60.000  60.945  61.889  62.834  63.779
64.724  65.669  66.614  67.559  68.503
  69.448  70.393  71.338  72.283  73.228  74.173  75.117  76.062  77.007
77.952  78.897  79.841  80.786  81.731
  82.676  83.620  84.565  85.509  86.454  87.397  88.340  89.277
tdef 8 linear 18Z03dec2012 6hr
zdef 1 linear 1 1
vars 1
SNODsfc   0,1,0   0,1,11 ** surface Snow Depth [m]
ENDVARS

---------------------------------------------------------------------------
---------------------------------------------------------------------------
--------

I want to convert this to a standard GFS .5 degree grid. I use the
following lats4d command:



lats4d.sh -i cfs.snow.grib2.ctl -precision 16 -vars snodsfc -center NCEP
-time 18z3dec12 12z5dec12 1 -func
're(@,720,linear,0,.5,361,linear,-90,.5,bl)' -de gfs.snow.grib2.ctl
-format grads_grib -o cfs.snow.newgrid.grib2

The grib file is created but the inventory indicates the parameter has
changed from snodsfc to pres and all times are analyses, as shown by wgrib:

1:0:d=12120318:PRES:sfc:anl:NAve=0
2:189878:d=12120400:PRES:sfc:anl:NAve=0
3:379756:d=12120406:PRES:sfc:anl:NAve=0
4:569634:d=12120412:PRES:sfc:anl:NAve=0
5:759512:d=12120418:PRES:sfc:anl:NAve=0
6:949390:d=12120500:PRES:sfc:anl:NAve=0
7:1139268:d=12120506:PRES:sfc:anl:NAve=0
8:1329146:d=12120512:PRES:sfc:anl:NAve=0

I have googled until I'm blue in the face. Any suggestions would be
extremely welcome!














More information about the gradsusr mailing list