<div dir="ltr">Jared,<div><br></div><div>Out of curiosity I tried this.  I can not reproduce the bug with <span style="font-size:14px">NCL 6.2.1 or 6.3.0 on Mac OS 10.10.2, or NCL 6.2.1 on Redhat Linux 6.6.  I get the expected result of 0, 0, 0 in all cases.  More data points for debugging.</span></div><div><span style="font-size:14px"><br></span></div><div><span style="font-size:14px">--Dave</span></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 7, 2015 at 4:42 PM, Jared Lee <span dir="ltr">&lt;<a href="mailto:jaredlee@ucar.edu" target="_blank">jaredlee@ucar.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi, I just found a bug in cd_inv_calendar. I&#39;m using NCL v6.3.0 on Yellowstone.<br><br>I have discovered that if the &#39;seconds&#39; variable has a @_FillValue attribute, then the cd_inv_calendar function will return missing values. If that attribute is not present, then the function works properly. The other variables (&#39;years&#39;, &#39;months&#39;, &#39;days&#39;, &#39;hours&#39;, and &#39;minutes&#39;) can all have @_FillValue attributes (or not have them) and the function will work properly, also. It&#39;s only the &#39;seconds&#39; input variable that apparently cannot have that attribute. Below I&#39;ve included a simple code and output to demonstrate the bug.<br><br></div>Sample code (bug_cd_inv_calendar.ncl):<br><br>************<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/contrib/cd_string.ncl&quot;<br><br>begin<br><br>yr = 2006<br>mo = 01<br>dy = 01<br>hr = 00<br>mn = 00<br>sc = 00<br><br>time_units = &quot;hours since 2006-01-01 00:00:00&quot;<br><br>time1 = cd_inv_calendar(yr, mo, dy, hr, mn, sc, time_units, 0)<br>print(time1)<br><br>sc@_FillValue = -999<br>time2 = cd_inv_calendar(yr, mo, dy, hr, mn, sc, time_units, 0)<br>print(time2)<br><br>yr@_FillValue = -999<br>mo@_FillValue = -999<br>dy@_FillValue = -999<br>hr@_FillValue = -999<br>mn@_FillValue = -999<br>delete(sc@_FillValue)<br>time3 = cd_inv_calendar(yr, mo, dy, hr, mn, sc, time_units, 0)<br>print(time3)<br><br>end<br>************<br><br></div>And here is the output from that sample code:<br><br>************<br>-bash-4.1$ ncl &lt; bug_cd_inv_calendar.ncl <br> Copyright (C) 1995-2015 - All Rights Reserved<br> University Corporation for Atmospheric Research<br> NCAR Command Language Version 6.3.0<br> The use of this software is governed by a License Agreement.<br> See <a href="http://www.ncl.ucar.edu/" target="_blank">http://www.ncl.ucar.edu/</a> for more details.<br><br><br>Variable: time1<br>Type: double<br>Total Size: 8 bytes<br>            1 values<br>Number of Dimensions: 1<br>Dimensions and sizes:   [1]<br>Coordinates: <br>Number Of Attributes: 2<br>  calendar :    standard<br>  units :       hours since 2006-01-01 00:00:00<br>(0)        0<br><br><br>Variable: time2<br>Type: double<br>Total Size: 8 bytes<br>            1 values<br>Number of Dimensions: 1<br>Dimensions and sizes:   [1]<br>Coordinates: <br>Number Of Attributes: 3<br>  _FillValue :  9.969209968386869e+36<br>  calendar :    standard<br>  units :       hours since 2006-01-01 00:00:00<br>(0)     9.969209968386869e+36<br><br><br>Variable: time3<br>Type: double<br>Total Size: 8 bytes<br>            1 values<br>Number of Dimensions: 1<br>Dimensions and sizes:   [1]<br>Coordinates: <br>Number Of Attributes: 3<br>  _FillValue :  9.969209968386869e+36<br>  calendar :    standard<br>  units :       hours since 2006-01-01 00:00:00<br>(0)        0<br>***************<span><font color="#888888"><br><br></font></span></div><span><font color="#888888">Jared</font></span></div></blockquote></div></div></div>