cd_calendar minutes:seconds

From: Joe Grim <grim_at_nyahnyahspammersnyahnyah>
Date: Fri Nov 01 2013 - 16:06:33 MDT

Hi,

I'm using NCL v6.1.2. I've discovered with cd_calendar, when I output
the years, months, days, hours, seconds (argument 2, options 5 or -5),
that I sometimes get "60" for the seconds value and m-1 for the minutes
value (where "m" is the minute value I am expecting.

Here's an example script:
  time_units = "seconds since 2013-11-01 00:00:0.0"
  time_jul = 300
  time_jul@units = time_units
  time_greg = cd_calendar(time_jul,5)
  print(time_greg)

I expect the result to be:
(0,0) 2013
(0,1) 11
(0,2) 1
(0,3) 0
(0,4) 5
(0,5) 0

but instead it's:
(0,0) 2013
(0,1) 11
(0,2) 1
(0,3) 0
(0,4) 4
(0,5) 60

I get this error when time_jul is 300, 1200, 2100, 3000, 3300, 3900 and
many other multiples of 300 (though not all multiples of 300.) Am I
missing something, or is there a slight rounding error or something
going on inside the cd_calendar function?

By the way, the old ut_calendar function works correctly, so I am using
that instead for now, though it's a lot slower than cd_calendar.

Thanks.

Joe Grim

-- 
NCAR - RAL
FL2 Rm 2068
(303) 497-8397
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Nov 1 16:06:42 2013

This archive was generated by hypermail 2.1.8 : Fri Nov 22 2013 - 09:36:32 MST