[ncl-talk] Problem with ClmDayTLLL - "Variable (yyyy) is still undefined, unable to reference attribute calendar"

Ana Juzbasic ajuzbasic at pusan.ac.kr
Tue Jun 23 04:47:56 MDT 2020


<mailplughead>Hello all,I am trying to use ClmDayTLLL to calculate daily geopotential height climatology. I'm using data from NCEP NCAR reanalyis 2,daily means for period 1979 to 1918.yyyyddd is calculated correctly, but I get following error when I try to run ClmDayTLL:fatal:Variable (yyyy) is still undefined, unable to reference attribute calendarfatal:["Execute.c":8640]:Execute: Error occurred at or near line 4394 in file /usr/local/ncl/lib/ncarg/nclscripts/csm/contributed.nclTried on ncl 6.3.0 and ncl 6.4.0, same error. I also tried adding "yyyy= year" line, but it didn't change anything. Any suggestions on what I'm doing wrong?Here's the full script:begindir      ="./daily/"hgtlist    =systemfunc("ls "+dir+"hgt/hgt"+"*.nc")hgtfile    = addfiles(hgtlist,"r")time     =hgtfile[:]->time TIME  = cd_calendar(time, 0)      ; type float year  = toint( TIME(:,0) )       ; toint strips meta data month = toint( TIME(:,1) ) day  = toint( TIME(:,2) )                                ; check for calendar attribute if (isatt(TIME,"calendar")) then     ; default is gregorian   year at calendar = TIME at calendar     end if ddd  = day_of_year(year, month, day) if (isatt(year,"calendar")) then     ; default is gregorian   ddd at calendar = year at calendar end if yyyyddd = year*1000 + ddd                  ; needed for input if (isatt(ddd,"calendar")) then     ; default is gregorian   yyyyddd at calendar = ddd at calendar end ifprintVarSummary(yyyyddd)hgt=hgtfile[:]->hgtprintVarSummary(hgt)climatology=clmDayTLLL(hgt, yyyyddd)printVarSummary(climatology)endBest regards,Ana</mailplughtml>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200623/f90666cb/attachment.html>


More information about the ncl-talk mailing list