[gradsusr] help displaying from netcdf file

Eric Altshuler ela at cola.iges.org
Mon Jun 18 23:24:31 EDT 2012


Jeff,

For netcdf data, the 'byteswapped' and 'headerbytes' options are meaningless. The netcdf format is independent of byte ordering and there are always some extra bytes for the metadata. Try removing the byteswapped option and the headerbytes entry.

Best regards,

Eric L. Altshuler
Assistant Research Scientist
Center for Ocean-Land-Atmosphere Studies
4041 Powder Mill Road, Suite 302
Calverton, MD 20705-3106
USA

E-mail: ela at cola.iges.org
Phone: (301) 902-1257
Fax: (301) 595-9793

----- Original Message -----
From: "Jeff Duda" <jeffduda319 at gmail.com>
To: "GrADS Users Forum" <gradsusr at gradsusr.org>
Sent: Monday, June 18, 2012 3:22:33 PM
Subject: [gradsusr] help displaying from netcdf file


I'm trying to use Grads to display data from a netCDF file. The result of ncdump for that file is 

ncdump -h ARW_cn_20110427.nettemp2m079200 
netcdf ARW_cn_20110427 { 
dimensions: 
x = 1163 ; 
y = 723 ; 
z = 1 ; 
variables: 
float temp2m(z, y, x) ; 
temp2m:standard_name = "temp2m" ; 
temp2m:long_name = "temp2m" ; 
temp2m:units = "F" ; 
} 

The file size is 3363608 bytes. Given the data are floating point and single precision, the size of the data alone are 1163*723*4 = 3363396, for a difference of 212 bytes 

I made a control file designed to open several hundred individual files to display the variable temp2m: 
dset s4%e_arw/ARW_%e_20110427.nettemp2m%ch 
chsub 1 1 003600 
chsub 2 2 007200 
chsub 3 3 010800 
chsub 4 4 014400 
chsub 5 5 018000 
chsub 6 6 021600 
chsub 7 7 025200 
chsub 8 8 028800 
chsub 9 9 032400 
chsub 10 10 036000 
chsub 11 11 039600 
chsub 12 12 043200 
chsub 13 13 046800 
chsub 14 14 050400 
chsub 15 15 054000 
chsub 16 16 057600 
chsub 17 17 061200 
chsub 18 18 064800 
chsub 19 19 068400 
chsub 20 20 072000 
chsub 21 21 075600 
chsub 22 22 079200 
chsub 23 23 082800 
chsub 24 24 086400 
chsub 25 25 090000 
chsub 26 26 093600 
chsub 27 27 097200 
chsub 28 28 100800 
chsub 29 29 104400 
chsub 30 30 108000 
chsub 31 31 111600 
chsub 32 32 115200 
chsub 33 33 118800 
chsub 34 34 122400 
chsub 35 35 126000 
chsub 36 36 129600 
options template byteswapped 
undef -9999.0 
dtype netcdf 
pdef 1163 723 lcc 23.2231 -119.145 1.0 1.0 38.5 38.5 -97.0000 4000.000 4000.000 
xdef 1163 linear -128.1065 0.053758 
ydef 723 linear 23.2231 0.040388 
zdef 1 linear 1.0 1.0 
tdef 36 linear 01Z27APR2011 1HR 
edef 10 NAMES cn m21 m23 m24 m25 m26 m27 m28 m29 m30 
VARS 1 
temp2m 1 y,x 2-m temperature (F) 
ENDVARS 
headerbytes 212 

When attempting to display the variable in Grads, I get this output: 
ga-> open SSEF_ens_temp2m_20110427_net.ctl 
Scanning description file: SSEF_ens_temp2m_20110427_net.ctl 
Data file s4%e_arw/ARW_%e_20110427.nettemp2m%ch is open as file 1 
LON set to -128.107 -65.6397 
LAT set to 23.2231 52.3832 
LEV set to 1 1 
Time values set: 2011:4:27:1 2011:4:27:1 
E set to 1 1 
Notice: Implied interpolation for file SSEF_ens_temp2m_20110427_net.ctl 
Interpolation will be performed on any data displayed from this file 
ga-> d temp2m 
Notice: Automatic Grid Interpolation Taking Place 
NetCDF Error (gancrow, nc_get_vara_double): NetCDF: Index exceeds dimension bound 
Data Request Error: Error for variable 'temp2m' 
Error ocurred at column 1 
DISPLAY error: Invalid expression 
Expression = temp2m 

I have also tried altering the line 
temp2m 1 y,x 2-m temperature (F) 
by the line 
temp2m 1 z,y,x 2-m temperature (F) 
in accordance with the output from ncdump. No avail. 

Please help me determine the reason for this error and how to fix it. Thanks. 

Jeff Duda 
-- 
Jeff Duda 
Graduate research assistant 
University of Oklahoma School of Meteorology 
Center for Analysis and Prediction of Storms 


_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org
http://gradsusr.org/mailman/listinfo/gradsusr



More information about the gradsusr mailing list