fwrite a grib data file from nc data
Emily
yi_zhou01 at YAHOO.CA
Wed Sep 30 16:02:13 EDT 2009
Hi group memeber,
I write a gs file to create a data set which is time series changing with height.
My original data is NARR netCDF data sets (8 times per day)
The ddf file as below:
==========
DSET d:\gradsfile\ncdata\uwnd.200812.nc
DTYPE netcdf
TITLE NARR 4D field Lambert Conformal Conic projection
UNDEF 32766 missing_value
UNPACK scale_factor=0.01f add_offset=47.66f
PDEF 349 277 lcc 1 -145.5 1 1 50 50 -107 32463.41 32463.41
XDEF 615 linear 150 0.3333
YDEF 255 linear 2 0.3333
ZDEF 29 levels 1000, 975, 950, 925, 900, 875, 850, 825, 800, 775, 750, 725, 700,
650, 600, 550, 500, 450, 400, 350, 300, 275, 250, 225, 200, 175, 150, 125, 100
tdef 248 linear 00:00z01dec2008 3hr
vars 3
uwnd 29 t,z,y,x grid_eastward_wind
lat=>glat 0 y,x Latitude
lon=>glon 0 y,x
Longitude
endvars
===============
vwnd200812.ddf is simillar with above.
My gs file as below:
=============
'reinit'
'open d:\gradsfile\ncdata\uwnd200812.ddf'
'open d:\gradsfile\ncdata\vwnd200812.ddf'
*'set grads off'
*'set grid off'
'set gxout fwrite'
'set fwrite d:\gradsfile\ncdata\wind-height09z28dec2008.grd'
'set dfile 1'
'set lon 283.3'
'set lat 43.66'
*'set time 09z28dec2008'
'set dfile 2'
'set lon 283.3'
'set lat 43.66'
*'set time 09z28dec2008'
h=1000
t0=218
while(t0<222)
'set t 't0''
while(h>850)
'set lev 'h''
'u=0.01*uwnd.1+47.66'
'v=0.01*vwnd.2+47.66'
'wind=mag(u,v)'
'd wind'
h=h-25
endwhile
t0=t0+1
endwhile
say 'ok'
===============
My ctl file is as below:
==========
DSET d:\gradsfile\ncdata\wind-height09z28dec2008.grd'
DTYPE grib
TITLE Wind-Height 09z12dec2008
UNDEF 32766 missing_value
XDEF 1 linear 1
1
YDEF 1 linear 1 1
ZDEF 7 levels 1000, 975, 950, 925, 900, 875, 850
tdef 5 linear 03z28dec2008 3hr
vars 1
wind 7 99 wind_height
endvars
=========
When I open the ctl file from Grads, it shows:
can not open station/index map file (null)
the data file was not open.
I don't know what's wrong with it. Is there any one can tell me the reason? Thanks.
Regards
Emily
York University, Toronto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20090930/5e5b11ae/attachment.html
More information about the gradsusr
mailing list