Subscript out of range?

From: Song Feng (songfeng AT XXXXXX)
Date: Tue Jan 08 2002 - 13:03:19 MST


Hi All:

I try to calculate the MJJ average based on daily data. I use the following code:
 
uups = u(level|:,lat|:,lon|:,time|0) ; transfer meta data
uups = dim_avg(u(level|:,lat|:,lon|:,{time|120:212})) ; leap year, the MJJ is Julian day 121-213

And I get to following error:
fatal:Subscript out of range, error in subscript #3
fatal:An error occurred reading u
fatal:Execute: Error occurred at or near line 26

The I change my code in the following:
 x = u({120:212},:,:,:) ; the dimension order of "u" is time(366) X level (17) X lat (73) X lon(144)
 uups = dim_avg(x(level|:,lat|:,lon|:, time|:)) ; leap year

The problem still exist. It seems that the time dimension is not correctly selected in my code. What my problem? The following is some information for "time" dimension:

Variable: time
Type: double
Total Size: 2928 bytes
            366 values
Number of Dimensions: 1
Dimensions and sizes: [time | 366]
Coordinates:
            time: [17417712..17426472]
Number Of Attributes: 5
  units : hours since 1-1-1 00:00:0.0
  long_name : Time
  actual_range : <ARRAY>
  delta_t : 0000-00-01 00:00:00
  avg_period : 0000-00-01 00:00:00



This archive was generated by hypermail 2b29 : Tue Jan 08 2002 - 13:39:55 MST