[ncl-talk] cd_calendar bug

Sitan Heyl heylsitan at gmail.com
Wed Feb 17 14:55:14 MST 2016


Hi,
   when I use below code, I found the return yyyy is wrong. the time value
is 1, 2, 3... its unit is month since 2006-01, but the return value from
cd_calendar is 200602, not 200601. Please check cd_calendar function.

Best,
Yongli

f=addfile("rcp45/BCC-CSM1.1/tas_Amon_bcc-csm1-1_rcp45_r1i1p1_200601_210012.nc","r")
time=f->time
yyyy=cd_calendar(time,-1)
print(yyyy(0:13))

====================
Variable: yyyy (subsection)

Type: integer
Total Size: 56 bytes
            14 values
Number of Dimensions: 1
Dimensions and sizes:   [14]
Coordinates:
Number Of Attributes: 1
  calendar :    noleap
(0)     200602
(1)     200603
(2)     200604
(3)     200605
(4)     200606
(5)     200607
(6)     200608
(7)     200609
(8)     200610
(9)     200611
(10)    200612
(11)    200701
(12)    200702
(13)    200703

the time variable in file is as below:

float time ( time )
         units :        month since 2006-01
         calendar :     noleap
         axis : T
         long_name :    time
         standard_name :        time
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160217/50349b05/attachment.html 


More information about the ncl-talk mailing list