Re: cd_calendar problem

From: JiangZiqiang <zqjiang86_at_nyahnyahspammersnyahnyah>
Date: Sat Nov 05 2011 - 10:26:14 MDT

Dave, Now, I understand that Base units of "years" and "months" are dangerous.And I don't understand that "This function does not return the correct minutes
and seconds if the reference time doesn't start at minute=0, second=0." can you give me an example? thanks you
Ziqiang > Date: Sat, 5 Nov 2011 00:25:51 -0600
> From: dave.allured@noaa.gov
> Subject: Re: cd_calendar problem
> To: zqjiang86@hotmail.com
> CC: ncl-talk@ucar.edu
>
> Two problems.
>
> (1) Read in description of this function, under "Caveats":
>
> "This function does not return the correct minutes
> and seconds if the reference time doesn't start at
> minute=0, second=0."
>
> (2) Base units of "years" and "months" are dangerous with real time
> calendars. Both are variable length. Years can be 365 or 366 days.
> Months can be 28, 29, 30, or 31 days. Some software defines
> "years" and "months" as long term averages. Results are
> inconsistent between different calendar dates, and between software
> packages.
>
> For best results, always use constant time base units of days,
> hours, minutes, or seconds. For example:
>
> x = 365 * 3 + 366 * 2
> x@units = "days since 2011-12-31 12:00:00"
> print(cd_calendar(x,0))
>
> x = 24 * (31 + 29 + 31 + 30 + 31)
> x@units = "hours since 2011-12-31 12:00:00"
> print(cd_calendar(x,0))
>
> --Dave
>
> On 11/4/2011 11:02 PM, JiangZiqiang wrote:
> > Hello,
> >
> > when I used function "cd_calendar", right result was not got. why?
> > x = 5
> > x@units <mailto:x@units> = "years since 2011-12-31 12:56:58"
> > print(cd_calendar(x,0))
> > x = 5
> > x@units <mailto:x@units> = "months since 2011-12-31 12:56:58"
> > print(cd_calendar(x,0))
> >
> > Thanks for your help

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Nov 5 10:26:23 2011

This archive was generated by hypermail 2.1.8 : Tue Nov 08 2011 - 15:54:50 MST