<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">1 month since 2006-01 is 2006-02</div><div class=""><br class=""></div><div class="">0 month since 2006-01 would be 2006-01</div><div class=""><br class=""></div><div class="">If the time value starts at 1 then cd_calendar is correct and your problem lies with the file or the expectation from the file. </div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">e.g.</div><div class=""><div class=""><br class=""></div><div class="">time = 0</div><div class="">time@units = "month since 2006-01"</div><div class="">print(cd_calendar(time, -1))</div><div class=""><br class=""></div><div class="">Variable: unnamed (return)</div><div class="">Type: integer</div><div class="">Total Size: 4 bytes</div><div class=""> 1 values</div><div class="">Number of Dimensions: 1</div><div class="">Dimensions and sizes:<span class="Apple-tab-span" style="white-space:pre">        </span>[1]</div><div class="">Coordinates:</div><div class="">Number Of Attributes: 1</div><div class=""> calendar :<span class="Apple-tab-span" style="white-space:pre">        </span>standard</div><div class="">(0)<span class="Apple-tab-span" style="white-space:pre">        </span>200601</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Good luck, </div><div class="">Alan </div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; line-height: normal; border-spacing: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">##############################<br class="">Alan Brammer,<div class="">Post-Doc Researcher</div><div class=""><br class=""></div><div class="">Department of Atmospheric and Environmental Sciences,<br class="">University at Albany, State University of New York, Albany, NY, 12222<div class=""><a href="mailto:abrammer@albany.edu" class="">abrammer@albany.edu</a><br class="">##############################</div></div></div></span></div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 17 Feb 2016, at 16:55, Sitan Heyl <<a href="mailto:heylsitan@gmail.com" class="">heylsitan@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi,<div class=""> 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. </div><div class=""><br class=""></div><div class="">Best,</div><div class="">Yongli</div><div class=""><br class=""></div><div class="">
f=addfile("rcp45/BCC-CSM1.1/tas_Amon_bcc-csm1-1_rcp45_r1i1p1_200601_210012.nc","r")<br class="">time=f->time</div><div class="">yyyy=cd_calendar(time,-1)<br class="">print(yyyy(0:13))<br class=""><br class="">====================<br class="">Variable: yyyy (subsection)<br class=""><br class="">Type: integer<br class="">Total Size: 56 bytes<br class=""> 14 values<br class="">Number of Dimensions: 1<br class="">Dimensions and sizes: [14]<br class="">Coordinates: <br class="">Number Of Attributes: 1<br class=""> calendar : noleap<br class="">(0) 200602<br class="">(1) 200603<br class="">(2) 200604<br class="">(3) 200605<br class="">(4) 200606<br class="">(5) 200607<br class="">(6) 200608<br class="">(7) 200609<br class="">(8) 200610<br class="">(9) 200611<br class="">(10) 200612<br class="">(11) 200701<br class="">(12) 200702<br class="">(13) 200703<br class=""></div><div class=""><br class=""></div>the time variable in file is as below:<div class=""><br class="">float time ( time )<br class=""> units : month since 2006-01<br class=""> calendar : noleap<br class=""> axis : T<br class=""> long_name : time<br class=""> standard_name : time</div></div>
_______________________________________________<br class="">ncl-talk mailing list<br class=""><a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a><br class="">List instructions, subscriber options, unsubscribe:<br class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk<br class=""></div></blockquote></div><br class=""></div></body></html>