<html><head><style>p{margin-top:0px;margin-bottom:0px;}</style></head><body><div name='mp-default' style='font-family:돋움,Dotum;font-size:10pt;'><mailplughtml><mailplughead></mailplughead><mailplugbody><div name="mp-default" style="font-family:돋움,Dotum;font-size:10pt;"><p>Hello all,<br><br>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.<span style="font-size: 10pt;"><br>yyyyddd is calculated correctly, but I get following error when I try to run ClmDayTLL:</span></p><p><br></p><p>fatal:Variable (yyyy) is still undefined, unable to reference attribute calendar</p><p>fatal:["Execute.c":8640]:Execute: Error occurred at or near line 4394 in file /usr/local/ncl/lib/ncarg/nclscripts/csm/contributed.ncl<br><br>Tried 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? <br><br>Here's the full script:<br></p><p><br></p><p>begin</p><p><br></p><p>dir            ="./daily/"</p><p> hgtlist        =systemfunc("ls "+dir+"hgt/hgt"+"*.nc")</p><p> hgtfile        = addfiles(hgtlist,"r")</p><p> time           =hgtfile[:]->time</p><p><br></p><p>   TIME    = cd_calendar(time, 0)             ; type float </p><p>   year    = toint( TIME(:,0) )               ; toint strips meta data</p><p>   month   = toint( TIME(:,1) )</p><p>   day     = toint( TIME(:,2) ) </p><p>                                                                 ; check for calendar attribute</p><p>   if (isatt(TIME,"calendar")) then           ; default is gregorian</p><p>       year@calendar = TIME@calendar         </p><p>   end if</p><p><br></p><p>   ddd     = day_of_year(year, month, day) </p><p>   if (isatt(year,"calendar")) then           ; default is gregorian</p><p>       ddd@calendar = year@calendar  </p><p>   end if</p><p><br></p><p>   yyyyddd = year*1000 + ddd                                    ; needed for input</p><p>   if (isatt(ddd,"calendar")) then           ; default is gregorian</p><p>       yyyyddd@calendar = ddd@calendar  </p><p>  end if</p><p>printVarSummary(yyyyddd)</p><p><br></p><p>hgt=hgtfile[:]->hgt</p><p><br></p><p>printVarSummary(hgt)</p><p>climatology=clmDayTLLL(hgt, yyyyddd)</p><p>printVarSummary(climatology)</p><p><br></p><p><br></p><p>end</p><p><br>Best regards,<br><br>Ana </p></div></mailplugbody></mailplughtml></div></body></html><img src="http://webmail.pusan.ac.kr/api/notify.php?home=MjAyMDA2MjMxOTQ3NTZ8bmNsLXRhbGtAdWNhci5lZHV8YWp1emJhc2ljQHB1c2FuLmFjLmty">