<div dir="ltr"><div><div><div>Hi, I just found a bug in cd_inv_calendar. I'm using NCL v6.3.0 on Yellowstone.<br><br>I have discovered that if the 'seconds' 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 ('years', 'months', 'days', 'hours', and 'minutes') can all have @_FillValue attributes (or not have them) and the function will work properly, also. It's only the 'seconds' input variable that apparently cannot have that attribute. Below I'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 "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/cd_string.ncl"<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 = "hours since 2006-01-01 00:00:00"<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 < 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/">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>***************<br><br></div>Jared<br clear="all"><div><div><div><div><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div><div><div><div><font face="courier new, monospace">===============================<br>Jared A. Lee, Ph.D.<br></font></div><font face="courier new, monospace">Project Scientist I<br></font></div><font face="courier new, monospace">Research Applications Laboratory<br></font></div><font face="courier new, monospace">National Center for Atmospheric Research<br>Boulder, Colorado, USA<br><br></font></div><font face="courier new, monospace">Email: <a href="mailto:jaredlee@ucar.edu" target="_blank">jaredlee@ucar.edu</a> (w)<br></font></div><font face="courier new, monospace">Phone: 303.497.8485 (w)</font><div><font face="courier new, monospace">Web: <a href="https://staff.ucar.edu/users/jaredlee" target="_blank">https://staff.ucar.edu/users/jaredlee</a><br>===============================</font><br></div></div></div>
</div></div></div></div></div>