[ncl-talk] error using yyyymmdd_to_yyyyfrac() NCL 6.1.2
Alan Brammer
abrammer at albany.edu
Tue Feb 24 08:13:42 MST 2015
Erik,
I don't have a real solution (just a simple workaround).
yyyymm_to_yyyyfrac utilises the function day_of_year()
<https://www.ncl.ucar.edu/Document/Functions/Built-in/day_of_year.shtml>
internally. day_of_year
<https://www.ncl.ucar.edu/Document/Functions/Built-in/day_of_year.shtml> as
you'll see on the documentation page doesn't support the
proleptic_gregorian calendar.
My suggestion for you for now would be to convert the time units to a
calendar that is supported by day_of_year, and then continue. cd_convert
will currently by default convert to a "standard" calendar this should then
work in yyyymm_to_yyyyfrac
Just need to add 1 line and edit the next. see below.
standard_time = cd_convert(eof_ts&time, eof_ts&time at units)
timeRec= cd_calendar(standard_time,2)
~Alan.
On Mon, Feb 23, 2015 at 8:43 PM, Erik Jan Schaffernicht <
eschaffe at uni-koeln.de> wrote:
> Additional remark: I updated now to most recent NCL,i.e. version 6.2.1
> but I still have the same error and problem.
>
>
> I am using these functions:
> eof_ts() runs successful on a climate model output.
> Then I take
> timeRec= cd_calendar(eof_ts&time,2)
> and
> printVarSummary(timeRec) gives me:
> Variable: timeRec
> Type: double
> Total Size: 292192 bytes
> 36524 values
> Number of Dimensions: 1
> Dimensions and sizes: [36524]
> Coordinates:
> Number Of Attributes: 1
> calendar : proleptic_gregorian
>
> Then I like to plot the time series (~36500 days = ~100years) so I like to
> convert the time from YYYYMMDD to YYYY.fraction
> yearFrac= yyyymmdd_to_yyyyfrac(timeRec,0.)
>
> This last step causes these errors: Any idea/help/solution?
>
> [... many more of these illegal calendar errors lines, I did not copy all
> due to redundancy ...]
> day_of_year: illegal calendar = 'proleptic_gregorian'
> day_of_year: illegal calendar = 'proleptic_gregorian'
> day_of_year: illegal calendar = 'proleptic_gregorian'
> day_of_year: illegal calendar = 'proleptic_gregorian'
> day_of_year: illegal calendar = 'proleptic_gregorian'
> isleapyear: illegal calendar = 'proleptic_gregorian'
> fatal:Undefined identifier: (con) is undefined, can't continue
> fatal:["Execute.c":8567]:Execute: Error occurred at or near line 7801 in
> file $NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl
>
>
> A few minutes before I used yyyymm_to_yyyyfrac( ) on a similar file
> that is monthly averaged. There, using the yyyymm_to_...(), this function
> does not cause any error.
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150224/1987e8a8/attachment.html
More information about the ncl-talk
mailing list