cd_calendar returns 12 values instead of 1

From: Almami Johnson <almamij_at_nyahnyahspammersnyahnyah>
Date: Mon Oct 01 2012 - 01:03:07 MDT

Dear all,

Trying to get some daily data over a specific time period. After applying
cd_calendar, it returns 12 values instead one 1 for iStrt and for iLast. Of
course, I got an error like this:

(0) 730 4383
(1) 761 4414
(2) 790 4442
(3) 821 4473
(4) 851 4503
(5) 882 4534
(6) 912 4564
(7) 943 4595
(8) 974 4626
(9) 1004 4656
(10) 1035 4687
(11) 1065 4717
fatal:Illegal Subscript. Only scalar values are allowed in subscript ranges.

Here is the portion of the code. Could you please help me on this? Thanks.

   undef("getPrecip")
   function getPrecip(fname[1]:string,ymStrt[1]:integer,ymLast[1]:integer,
vname[1]:string)
   local TIME, YYYYMM, iStrt, iLast, x

   begin
     f = addfile(fname, "r")
     TIME = f->time
     YYYYMMDD = cd_calendar(TIME, -2) ; convert
     iStrt = ind(ymStrt.eq.YYYYMMDD) ; index of start time
     iLast = ind(ymLast.eq.YYYYMMDD) ; last time

     print(" " + iStrt + " " + iLast)

     x = f->$vname$(iStrt:iLast,{-5:25},{-10:10}) ; read specified
time period

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Oct 1 09:03:18 2012

This archive was generated by hypermail 2.1.8 : Tue Oct 02 2012 - 13:38:41 MDT