Dear All ncl users,
I need your help for subscripting the time coordinate of OLR data. For example, I want to subscript the following time:
timeUnits = "days since 1800-01-01 00:00:00"
inStart = ut_inv_calendar( 1980, 01, 01, 00, 0, 0, timeUnits, 0 )
inEnd = ut_inv_calendar( 2000, 12, 31, 00, 0, 0, timeUnits, 0 )
varName = "olr"
pathIn = "olr.day.mean.nc"
;; Open the input files
fin = addfile( pathIn, "r" )
time = fin->time({inStart:inEnd})
lat = fin->lat
lon = fin->lon
data = short2flt(fin->$varName$({inStart:inEnd},:,:))
-----------------
With this subscripting technique, I got error "subcript out of range. The error is due to value of inStart and inEnd being not the same as one of value of time. I try to use another timeunits for example, timeUnits = "hours since 1-1-1 00:00:0.0", I can read the data but when making another process for example:
maxDate =inEnd
minDate =inStart
nx = 144
nt = 1 + round( maxDate - minDate, 3 )
nVar = 1; suppose only 1
datax = new( (/ nVar, nt, nx /), float )
datax!0 = "var"
datax!1 = "time"
datax!2 = "lon"
datax(0,:,:) = dim_avg_n(data, 1 )
I got error again because number of row of datax and data is not the same in which value of maxDate - minDate with timeUnits = "hours since 1-1-1 00:00:0.0" is much bigger than total number of row of OLR data. THUS, how to subscript the time coordinate of OLR data ? What time unit must be used ?
Thanks for help,
Regards,
Jouky
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jun 25 01:21:46 2012
This archive was generated by hypermail 2.1.8 : Mon Jun 25 2012 - 09:57:23 MDT