Re: Specifying new time format when changing units

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Jul 01 2013 - 11:16:18 MDT

If you read the documentation for time_to_newtime:

http://www.ncl.ucar.edu/Document/Functions/Contributed/time_to_newtime.shtml

you will see that the second argument needs to be a time unit that is recognized by ut_calendar.
"calendar_year month day" and "yyyymmdd" are not valid formats.

I think what you want is "cd_calendar" and option 2 or -2:

http://www.ncl.ucar.edu/Document/Functions/Built-in/cd_calendar.shtml

--Mary

On Jun 30, 2013, at 6:40 PM, wanda7@tpg.com.au wrote:

> Hi,
>
> I want to change the units of the time variable in a time,lev,lat,lon
> variable (relative humidity) from
>
> "days since 1800-01-01 00:00:0.0"
>
> to YYYYMMDD (and then after subsetting 1 year from a 200 year dataset I want
> to change time format to day-of-year number)
>
> I've tried using
>
> time1 = time_to_newtime(time,"calendar_year month day")
> and
> time1 = time_to_newtime(time,"yyyymmdd")
>
> but keep getting an error message when I try to run the script:
>
> fatal:ut_inv_calendar: Invalid specification string
> fatal:Execute: Error occurred at or near line 12169 in file
> $NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl
>
> I realise that the new_time_unit string has to be a "udunits" recognized
> string indicating the unit of the new time variable. But I've looked for a
> list of recognised strings to choose from and can't find any.
>
> Can anyone tell me how to specify that I want the new format to be
> year-month-day? (and then day of year)
>
> Thank you for your advice.
>
> Wanda
> _______________________________________________
> 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 Mon Jul 1 11:16:28 2013

This archive was generated by hypermail 2.1.8 : Mon Jul 01 2013 - 12:35:42 MDT