<div dir="ltr"><div>As a 1st debug step, you could do:</div><div><br></div><div>printVarSummary(yyyyddd)</div><div>printMinMax(yyyyddd,0)</div><div>print("=========")</div><div><br></div><div>Maybe look at all the 'date' values</div><div><br></div><div>print(year+" "+month+" "+day+" "+ddd+" "+yyyyddd)</div><div><br></div><div>Also, include the output from:</div><div><br></div><div>printVarSummary(hgt)</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 23, 2020 at 4:48 AM Ana Juzbasic via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu">ncl-talk@mailman.ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div name="mp-default" style="font-family:돋움,Dotum;font-size:10pt"><u></u><u></u><u></u><u></u><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><u></u><u></u></div></div><img src="http://webmail.pusan.ac.kr/api/notify.php?home=MjAyMDA2MjMxOTQ3NTZ8bmNsLXRhbGtAdWNhci5lZHV8YWp1emJhc2ljQHB1c2FuLmFjLmty">_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>