I believe the units of time on the file are incorrect.
float t(t) ;
t:units = "days since 1850-01-00 00:00:00" ;
t:time_origin = "00-JAN-1850:00:00:00" ;
---
Use of the 00 for the day is rather unusual.
It would result in a date of 1849-12-31-00 which is what
is being returned by cd_calendar. I sent an email to CRU
regarding this issue.
I think the units should be
t:units = "days since 1850-01-01 00:00:00" ;
t:time_origin = "01-JAN-1850:00:00:00" ;
---
You can use the ncatted operator to change the units attributes
on the file or you can do the following in NCL:
t = f->t
t@units = "days since 1850-01-01 00:00:00"
t@time_origin = "01-JAN-1850:00:00:00"
date = cd_calendar(t, -1)
Good luck
On 4/8/12 1:10 AM, apple wrote:
> Hi, all
>
> Now I use NCL 6.0 on a macbook (X-Lion 10.7), and "cd_calendar" is a new function in NCL6.0.
>
> I download two NC files (HadSST2_1850on.nc and CRUTEM4.nc) from the CRU
>
> (http://www.cru.uea.ac.uk/cru/data/temperature/ ). When I do as follow
>
> " f1 = addfile (" HadSST2_1850on.nc","r")
> f2 = addfile("CRUTEM4.nc',"r")
>
> t1 = f1->time
> t2 = f2->t
>
> yyyymm1 = ut_calendar(t1,-1)
> yyyymm2 = ut_calendar(t2,-1) "
>
> I get
> " warning:ut_calendar: Invalid specification string. Missing values will be returned.
> (0) HadSST2 : from 185001 to 201202
> (0) CRUTEM4 : from -2147483647 to -2147483647
>
> However, When I use the " cd_calendar" to replace the " ut_calendar" , as the following
>
> " yyyymm1 = cd_calendar(t1,-1)
> yyyymm2 = cd_calendar(t2,-1) "
>
> I get
> (0) HadSST2 : from 185001 to 201202
> (0) CRUTEM4 : from 184912 to 201011
>
> We can see one month lag at the beginning between two data , which is inconsistent with the instruction
> on the webpage http://www.cru.uea.ac.uk/cru/data/temperature/ . According to the webpage, both data should
> start at the same time,
>
>
> Thanks!
>
>
>
> Lin
>
>
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun Apr 8 08:56:11 2012
This archive was generated by hypermail 2.1.8 : Mon Apr 09 2012 - 13:43:03 MDT