Hey NCLers,
I tried to send this previously, but I think there was an email glitch on my end. Apologies if you've actually seen this before though.
I frequently use cd_calendar to more intuitively deal with time series. Today I'm looking at a model data set that uses the "360_day" calendar, and I noticed what I suspect is a bug.
In the "360_day" calendar, all months have 30 days, but when I use cd_calendar(time, 4) to get YYYY.fraction output, it gives a warning:
>tcal = cd_calendar(time, 4)
day_of_year: illegal arguments, year = 0, month = 2, day = 30
Worse than the warning, I also see that it sets the output to the current year with no fractional amount at month=2, day=30.
Here's the example script:
time = ispan( 1, 360, 1)
time@calendar = "360_day"
time@units = "days since 0-01-01 00:00:00"
tcal = cd_calendar(time, 4)
print(tcal(57:59))
I've checked this on NCL 6.0.0 and 6.1.0-beta (using mirage and my Mac, respectively).
** I also noted that if I change the year in the units attribute to a non-leap year, it also gives the same warning for month=2 day=29.
If I'm misunderstanding this behavior, please let me know.
.brian
_______________
Brian Medeiros
Project Scientist
NCAR/NESL/CGD/AMP
brianpm@ucar.edu
http://www.cgd.ucar.edu/~brianpm
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jul 5 11:24:51 2012
This archive was generated by hypermail 2.1.8 : Mon Jul 09 2012 - 10:45:32 MDT