Sorry, I was in such a hurry that I did not
follow my own advice and carefully look at the code.
You do have
hm = floattoshort(H)
then you add the meta data. However, you did not add enough meta data.
To my knowledge, the COARDS convention which GrADS 'understands'
requires two attributes when importing data of type 'short':
"scale_factor" and "add_offset".
Not sure why you get Tsize=1
Xsize = 144 Ysize = 73 Zsize = 17 Tsize = 1
Perhaps, the units on "time" are not what GrADS wants?
==============
I did download the hgt files for 1998-2007. I created a packed
[short] variable via
http://www.ncl.ucar.edu/Document/Functions/Contributed/pack_values.shtml
The resulting netCDF and script are at:
ftp ftp.cgd.ucar.edu
anonymous
Use your email address for the password
cd /ftp/pub/shea/HGT
get test_1464.ncl
get HGT_6HR_CLIM.nc
quit
523271072 Jan 6 16:42 HGT_6HR_CLIM.nc
4745 Jan 6 16:41 test_1464.ncl
Good luck
On 01/06/2011 07:49 AM, Guangtao dong wrote:
> Hello,everyone
> I want to use ncl to generate an 10 years averaged nc data from
> follow input data :
> hgt.yyyy.nc <http://hgt.yyyy.nc/> ( yyyy are years number from 1998 to
> 2007) in which hgt.2000.nc <http://hgt.2000.nc/> and hgt.2004.nc
> <http://hgt.2004.nc/> have 1464 times and the other have 1460 times
> And i want a output file have 1464 times . And i write a ncl script to
> do it , the script are attached as accessories . output file "
> hgt.mean.nc <http://hgt.mean.nc/>" have 1464 times , when i use
> " ncdump -h hgt.mean.nc <http://hgt.mean.nc/>",it shows as follow:
> dimensions:
> time = UNLIMITED ; // (1464 currently)
> level = 17 ;
> lat = 73 ;
> lon = 144 ;
> variables:
> double Time(time) ;
> Time:units = "hours since 1800-1-1 00:00:0.0" ;
> Time:long_name = "Time" ;
> Time:_FillValue = -9999. ;
> int time(time) ;
> short hgt(time, level, lat, lon) ;
> hgt:units = "m" ;
> hgt:long_name = "Geopotential height" ;
> hgt:_FillValue = -999s ;
> float level(level) ;
> level:coordinate_defines = "point" ;
> level:axis = "z" ;
> level:GRIB_name = "hPa" ;
> level:GRIB_id = 100s ;
> level:positive = "down" ;
> level:long_name = "Level" ;
> level:actual_range = 1000.f, 10.f ;
> level:units = "millibar" ;
> float lat(lat) ;
> lat:coordinate_defines = "point" ;
> lat:axis = "y" ;
> lat:standard_name = "latitude_north" ;
> lat:long_name = "Latitude" ;
> lat:actual_range = 90.f, -90.f ;
> lat:units = "degrees_north" ;
> float lon(lon) ;
> lon:coordinate_defines = "point" ;
> lon:axis = "x" ;
> lon:standard_name = "longitude_east" ;
> lon:actual_range = 0.f, 357.5f ;
> lon:long_name = "Longitude" ;
> lon:units = "degrees_east" ;
> }
> but when i open hgt.mean.nc <http://hgt.mean.nc/> by Grads, and use " q
> file " , it shows as follow:
> File 1 :
> Descriptor: hgt.mean.nc <http://hgt.mean.nc/>
> Binary: hgt.mean.nc <http://hgt.mean.nc/>
> Type = Gridded
> Xsize = 144 Ysize = 73 Zsize = 17 Tsize = 1
> Number of Variables = 1
> hgt 17 -999 Geopotential height
> How can i make the file "hgt.mean.nc <http://hgt.mean.nc/>" as NNRP2
> file such as hgt.2000.nc <http://hgt.2000.nc/>. especially how can i
> define time when i generate
> the nc file "hgt.mean.nc <http://hgt.mean.nc/>" ?
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-- ====================================================== Dennis J. Shea tel: 303-497-1361 | P.O. Box 3000 fax: 303-497-1333 | Climate Analysis Section | Climate & Global Dynamics Div. | National Center for Atmospheric Research | Boulder, CO 80307 | USA email: shea 'at' ucar.edu | ====================================================== _______________________________________________ ncl-talk mailing list List instructions, subscriber options, unsubscribe: http://mailman.ucar.edu/mailman/listinfo/ncl-talkReceived on Thu Jan 6 16:46:48 2011
This archive was generated by hypermail 2.1.8 : Thu Jan 13 2011 - 09:24:21 MST