[ncl-talk] incorrect date using cd_calendar (and cd_string)?

Denise Worthen - NOAA Affiliate denise.worthen at noaa.gov
Wed Nov 15 13:00:09 MST 2017


Hi,

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.

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.

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.

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.

What have I got wrong?
Denise.


load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/cd_string.ncl"

begin

f=addfile("timetest.nc","r")
timeval=f->time
timeUnits = f->time at units
timeCalendar = f->time at calendar
print(cd_calendar(timeval,0))
end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171115/3f55a795/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: timetest.nc
Type: application/x-netcdf
Size: 6144 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171115/3f55a795/attachment.nc>


More information about the ncl-talk mailing list