calendar attribute on option for cd_calendar

From: Keith Lindsay <klindsay_at_nyahnyahspammersnyahnyah>
Date: Thu Dec 01 2011 - 13:24:45 MST


The docs for cd_calendar state:

The default is to use the mixed Julian/Gregorian calendar. To change the
calendar, you can set /option/@calendar to ...

This is not working for me as I would expect it to.
Consider the following sequence of ncl commands:

time = 36500.0
time@units = "days since 0000-01-01 00:00:00"
option = -2
option@calendar = "noleap"
print(cd_calendar(time, option))

The generated output is:
Variable: unnamed (return)
Type: integer
Total Size: 4 bytes
             1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Number Of Attributes: 1
   calendar : standard
(0) 991207

It looks like the calendar attribute for the option argument is ignored.

If I put the calendar attribute on the time variable, the last two lines
of the output are

   calendar : noleap
(0) 1000101

which is what I expect. So it seems that the docs and the code don't agree.

This is all with version 6.0.0.

Is this a mistake in the docs or the code?

Thanks, Keith

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Thu Dec 1 13:24:55 2011

This archive was generated by hypermail 2.1.8 : Fri Dec 02 2011 - 16:10:18 MST