Re: time

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Wed Jul 31 2013 - 13:59:17 MDT

Consider:

dimensions:
         time = UNLIMITED ; // (336 currently)
[snip]
         double time(time) ;
                 time:units = "hours since 1800-1-1 00:00:0.0" ;
[snip]

=========
; Please read
; http://www.ncl.ucar.edu/Document/Functions/Built-in/cd_calendar.shtml

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

     f = addfile("..."."r")
     time = f->time
     ymdhms = cd_calendar(fime,0) ; (336,6) type *float*
     printVarSummary(ymdhms)

     yyyymm_i = cd_calendar(time, -1) ; (336) type *integer*
     printVarummary(yyyymm_i)

     yyyymm_d = cd_calendar(time, 1) ; (336) type *double*
     printVarSummary(yyyymm_d)

     print(yyyymm_i) ; 197901, 197902,......

     yyyymm_s = tostring(yyyymm_i) ; (336) type "string"
     printVarSummary(yyyymm_s)
=========
     ntim = dimsizes(time)

     year = yyyymm_i/100 ; year(336) is type integer
     firstyr = year(0)
     lastyr = year(ntim-1)
     nyear = lastyr-firstyr+1
     YYYYMM = yyyymm_time(firstyr,lastyr , "string")

===========

On 7/31/13 12:38 PM, Setareh Rahimi wrote:
> Type of time is double, I repllaced the type of time with double, but got
> the same error again!!!
>
>
>
>
> _______________________________________________
> 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 Jul 31 13:59:20 2013

This archive was generated by hypermail 2.1.8 : Thu Aug 01 2013 - 15:55:03 MDT