<html><head><style>p{margin-top:0px;margin-bottom:0px;}</style></head><body><div name='mp-default' style='font-family:돋움,Dotum;font-size:10pt;'><p>Thank you for all the suggestions. I tried all You suggested, but everything looks fine to me ?<br><br>last few lines from <span style="font-size: 13.3333px;">print(year+" "+month+" "+day+" "+ddd+" "+yyyyddd)</span><br></p><p>(14604)<span style="white-space:pre"> </span>2018 12 26 360 2018360</p><p>(14605)<span style="white-space:pre"> </span>2018 12 27 361 2018361</p><p>(14606)<span style="white-space:pre"> </span>2018 12 28 362 2018362</p><p>(14607)<span style="white-space:pre"> </span>2018 12 29 363 2018363</p><p>(14608)<span style="white-space:pre"> </span>2018 12 30 364 2018364</p><p>(14609)<span style="white-space:pre"> </span>2018 12 31 365 2018365</p><p><br></p><p>Variable: hgt</p><p>Type: float</p><p>Total Size: 10443461760 bytes</p><p> 2610865440 values</p><p>Number of Dimensions: 4</p><p>Dimensions and sizes:<span style="white-space:pre"> </span>[time | 14610] x [level | 17] x [lat | 73] x [lon | 144]</p><p>Coordinates: </p><p> time: [1569072..1919688]</p><p> level: [1000..10]</p><p> lat: [90..-90]</p><p> lon: [ 0..357.5]</p><p>Number Of Attributes: 17</p><p> long_name :<span style="white-space:pre"> </span>Daily Geopotential Heights on Pressure Levels</p><p> units :<span style="white-space:pre"> </span>m</p><p> precision :<span style="white-space:pre"> </span>0</p><p> least_significant_digit :<span style="white-space:pre"> </span>0</p><p> GRIB_id :<span style="white-space:pre"> </span>7</p><p> GRIB_name :<span style="white-space:pre"> </span>HGT</p><p> var_desc :<span style="white-space:pre"> </span>Geopotential height</p><p> dataset :<span style="white-space:pre"> </span>NCEP/DOE AMIP-II Reanalysis (Reanalysis-2) Daily Averages</p><p> level_desc :<span style="white-space:pre"> </span>Pressure Levels</p><p> statistic :<span style="white-space:pre"> </span>Mean</p><p> parent_stat :<span style="white-space:pre"> </span>Individual Obs</p><p> standard_name :<span style="white-space:pre"> </span>geopotential_height</p><p> cell_methods :<span style="white-space:pre"> </span>time: mean (of 4 6-hourly values in one day)</p><p> missing_value :<span style="white-space:pre"> </span>-9.96921e+36</p><p> actual_range :<span style="white-space:pre"> </span>( -530, 32289 )</p><p> valid_range :<span style="white-space:pre"> </span>( -1500, 35800 )</p><p> _FillValue :<span style="white-space:pre"> </span>-9.96921e+36</p><p><br></p><p>Variable: yyyyddd</p><p>Type: integer</p><p>Total Size: 58440 bytes</p><p> 14610 values</p><p>Number of Dimensions: 1</p><p>Dimensions and sizes:<span style="white-space:pre"> </span>[14610]</p><p>Coordinates: </p><p>Number Of Attributes: 1</p><p> calendar :<span style="white-space:pre"> </span>standard</p><p>(0)<span style="white-space:pre"> </span>min=1979001 max=2018365</p><p><br></p><br></div><font style="font-family:돋움,Dotum;font-size:10pt;">----- Original Message -----<br>From : Dennis Shea <shea@ucar.edu><br>To : "Ana Juzbasic" <ajuzbasic@pusan.ac.kr><br>Cc : "Ncl-talk" <ncl-talk@ucar.edu><br>Sent : 2020-06-23 22:31:32<br>Subject : Re: [ncl-talk] Problem with ClmDayTLLL - "Variable (yyyy) is stillundefined, unable to reference attribute calendar"<br><br><br></font><div dir="ltr"><div>As a 1st debug step, you could do:</div><br><div>printVarSummary(yyyyddd)</div><div>printMinMax(yyyyddd,0)</div><div>print("=========")</div><br><div>Maybe look at all the 'date' values</div><br><div>print(year+" "+month+" "+day+" "+ddd+" "+yyyyddd)</div><br><div>Also, include the output from:</div><br><div>printVarSummary(hgt)</div><br></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 target="_blank" 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>_______________________________________________<br>
ncl-talk mailing list<br>
<a target="_blank" href="mailto:ncl-talk@mailman.ucar.edu">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a target="_blank" href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div></body></html><img src="http://webmail.pusan.ac.kr/api/notify.php?home=MjAyMDA2MjQxMjI0Mzl8bmNsLXRhbGtAdWNhci5lZHV8YWp1emJhc2ljQHB1c2FuLmFjLmty">