<div dir="ltr">Denise,<div><br></div><div>Your sample file uses the Julian calendar.  In my experience the Julian calendar is rarely used in climate sciences, and software implementations are not well vetted.  The best long term solution might be to switch to the Gregorian calendar, if that is not contrary to your current application.</div><div><br></div><div>Also your time base is "hours since 0001-01-01 00:00:00".  Using a base date before the Julian to Gregorian change in year 1582 exposes you to a particular kind of software problem.  You might get better results if you can switch to a base date in the near past, such as 1900-1-1 or 2000-1-1, regardless of which calendar system is selected.</div><div><br></div><div>For what it's worth, my hand calculation for Julian 17657580 hours since 1-1-1 0:0:0 gets 2015 April 30 12:00.  This agrees with your ferret result.</div><div><br></div><div>--Dave</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 15, 2017 at 1:00 PM, Denise Worthen - NOAA Affiliate <span dir="ltr"><<a href="mailto:denise.worthen@noaa.gov" target="_blank">denise.worthen@noaa.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-family:verdana,sans-serif">Hi,</div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif">I've used ncra to 'record average' a set of netcdf files. When I look at the file using ferret, the date in each file is correctly interpreted. </div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif">When I use ncl, the dates in the file are interpreted incorrectly, either as a label (using cd_string) or just printing the value using cd_calendar.</div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif">I've extracted out the time axis for a single timestep and attached it here. The correct value in this case should be april 30 2015.</div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif">Using the following commands, it shows the date as 5-13-2015. This is also the label I get when using cd_string to label a plot in the original file. </div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif">What have I got wrong?</div><div style="font-family:verdana,sans-serif">Denise.</div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif"><br></div>load "$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/contrib/cd_string.ncl"<br><br>begin<br><br>f=addfile("<a href="http://timetest.nc" target="_blank">timetest.nc</a>","r")<br>timeval=f->time<br>timeUnits = f->time@units<br>timeCalendar = f->time@calendar<br>print(cd_calendar(timeval,0))<br>end</div></blockquote></div></div></div>