<div dir="ltr">Sitan,<div><br></div><div>No, your time values are wrong. They should start at zero, not 1, for what you want.</div><div><br></div><div>Also please note, a unit string of "months since" is bad practice because "months" is variable length in the noleap calendar, ranging from 28 to 31 days. This usage is known to produce inconsistent results between different calendar libraries. </div><div><br></div><div>This might not matter while you are working exclusively inside NCL. But it will matter as soon as you start trading data between applications or other people.</div><div><br></div><div>Just use a fixed base unit of time, such as "days since" or "hours since". Use a calendar routine such as cd_inv_calendar to compute the correct offsets for the time variable.</div><div><br></div><div>--Dave</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 17, 2016 at 2:55 PM, Sitan Heyl <span dir="ltr"><<a href="mailto:heylsitan@gmail.com" target="_blank">heylsitan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi,<div> 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><br></div><div>Best,</div><div>Yongli</div><div><br></div><div>
f=addfile("rcp45/BCC-CSM1.1/tas_Amon_bcc-csm1-1_rcp45_r1i1p1_200601_210012.nc","r")<br>time=f->time</div><div>yyyy=cd_calendar(time,-1)<br>print(yyyy(0:13))<br><br>====================<br>Variable: yyyy (subsection)<br><br>Type: integer<br>Total Size: 56 bytes<br> 14 values<br>Number of Dimensions: 1<br>Dimensions and sizes: [14]<br>Coordinates: <br>Number Of Attributes: 1<br> calendar : noleap<br>(0) 200602<br>(1) 200603<br>(2) 200604<br>(3) 200605<br>(4) 200606<br>(5) 200607<br>(6) 200608<br>(7) 200609<br>(8) 200610<br>(9) 200611<br>(10) 200612<br>(11) 200701<br>(12) 200702<br>(13) 200703<br></div><div><br></div>the time variable in file is as below:<div><br>float time ( time )<br> units : month since 2006-01<br> calendar : noleap<br> axis : T<br> long_name : time<br> standard_name : time</div></div></blockquote></div></div></div>