Re: use cd_calendar when it is necessary to read an variable from many directories

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Wed Nov 06 2013 - 06:40:20 MST

Your 'xx' is a standard variable. It is not a 'time' variable as
required by the 'cd_calendar' function:
   http://www.ncl.ucar.edu/Document/Functions/Built-in/cd_calendar.shtml

The documentation states that the 'time' variable

    "Must have a "units" attribute string in the format
    "units since basetime", for example, "days since 1971-1-1"

Hence, your usage
    YMDHMS = cd_calendar(xx, 1)
is not correct.

You should do a printVarSummary(xx)

Is there coordinate information for the named dimensions 'year'
and 'month'? If there is no information, you must create.

On 11/5/13 11:46 PM, Yi-Chih Huang wrote:
> Hello,
>
> I read one variable xx from 30 directories for 30 years. The dimension
> of the variable xx is (year,month,lat,lon). I am trying to use cd_calendar
> to get the information of year and month. However, every element of YMDHMS
> is 9.969209968386869e+36. In addition, the error below occurred when the
> command "iYear = ind(YMDHMS(:,0).ge.yrStrt .and.
> YMDHMS(:,0).le.yrLast)" was executed. What is the right way to use
> cd_calendar when it is necessary to read an variable from many directories?
>
> YMDHMS = cd_calendar(xx, 1)
>
> (29,11,20,320) 9.969209968386869e+36
> fatal:Number of subscripts do not match number of dimensions of
> variable,(2) Subscripts used, (4) Subscripts expected
> ^Mfatal:["Execute.c":8128]:Execute: Error occurred at or near line 51 in
> file sstTime.ncl
>
> Thanks much,
>
> Yi-Chih
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Nov 6 06:40:21 2013

This archive was generated by hypermail 2.1.8 : Mon Nov 11 2013 - 09:45:33 MST