[ncl-talk] day_of_year: illegal calendar = 'proleptic_gregorian' isleapyear: illegal calendar = 'proleptic_gregorian'

Dennis Shea shea at ucar.edu
Sun May 3 21:32:26 MDT 2015


What version of NCL do you have?

%> ncl -V

The 6.3.0 version has:

undef("yyyymmdd_to_yyyyddd")
function yyyymmdd_to_yyyyddd (yyyymmdd[*]:integer)
local ntim, yyyy, mmdd, mm, dd, yyyyddd
begin
  ntim = dimsizes(yyyymmdd)

;;if (isatt(yyyymmdd,"calendar") .and.
yyyymmdd at calendar.eq."proleptic_gregorian")
then
;;    print("yyyymmdd_to_yyyyddd:  proleptic_gregorian calendar not
supported")
;;    yyyyddd = new(ntim, "integer", -9999)
;;    yyyyddd at long_name = "yyyymmdd_to_yyyyddd:  proleptic_gregorian
calendar not supported"
;;    return(yyyyddd)
;;end if

  yyyy = yyyymmdd/10000
  mmdd = yyyymmdd - (yyyy*10000)
  mm   = mmdd/100
  dd   = mmdd - (mm*100)

  if (isatt(yyyymmdd,"calendar")) then     ; needed for day_of_year
      yyyy at calendar = yyyymmdd at calendar
  end if

  yyyyddd  = yyyy*1000 +day_of_year(yyyy, mm, dd)
  copy_VarMeta(yyyymmdd, yyyyddd)
  yyyyddd at long_name = "yyyy and day_of_year"
  yyyyddd at units = "yyyyddd"

  return(yyyyddd)
end




On Fri, May 1, 2015 at 11:04 AM, Xi Chang <xi.chang01 at gmail.com> wrote:

> Hallo,
>
> Could you please let me know how to get rid off this error:
>
> day_of_year: illegal calendar = 'proleptic_gregorian'
> isleapyear: illegal calendar = 'proleptic_gregorian'
>
> the errors came from:
>
>  *m = yyyymmdd_to_yyyyddd(cd_n) *
>
> any solution to use this function for proleptic gregorian calender?
>
> Thanks.
>
> _______________________________________________
> 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/20150503/7430973a/attachment.html 


More information about the ncl-talk mailing list