Failed reading ERA Data

From: Xi Chang <xi.chang01_at_nyahnyahspammersnyahnyah>
Date: Tue Jul 16 2013 - 11:05:36 MDT

Hi All,

I found a strange behavior to read the era40 data via subscripting method,
Here is a simple code:

begin

ufile = addfile("uwnd.2000.nc","r")
time = ufile->time

tstart = ut_inv_calendar(2000,1,1,00,0,0,time@units,0)
tlast = ut_inv_calendar(2000,1,1,00,0,0,time@units,0)

print(tstart)
print(tlast)

U = short2flt(ufile->uwnd({tstart:tlast},:,:,:))
printVarSummary (U)

end

However, I got this error:
*fatal:Coordinate subscript type mismatch. Subscript (0) can not be coerced
to type of coordinate variable, subscript (0)*

It is so strange for me, since I have checked eveything was ok.

Here is the detail of the input data:

dimensions:
lon = 144 ;
lat = 73 ;
lev = 23 ;
time = UNLIMITED ; // (366 currently)
variables:
*float* lon(lon) ;
lon:units = "degrees_east" ;
lon:long_name = "longitude" ;
*float *lat(lat) ;
lat:units = "degrees_north" ;
lat:long_name = "latitude" ;
int lev(lev) ;
lev:units = "millibars" ;
lev:long_name = "pressure_level" ;
*int* time(time) ;
time:units = "hours since 1900-01-01 00:00:0.0" ;
time:long_name = "time" ;
*short* uwnd(time, lev, lat, lon) ;
uwnd:scale_factor = 0.00611294863578099 ;
uwnd:add_offset = -0.00708951113578099 ;
uwnd:_FillValue = -32767s ;
uwnd:missing_value = -32767s ;
uwnd:units = "m s**-1" ;
uwnd:long_name = "U velocity" ;

thank you for a quick view for this email.

-- Xi

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jul 16 11:05:49 2013

This archive was generated by hypermail 2.1.8 : Tue Jul 16 2013 - 13:21:17 MDT