<div dir="ltr"><div>I have daily sea-level-pressure files spanning:</div><div><br></div><div>(0) SLP/<a href="http://slp.1995.nc">slp.1995.nc</a><br>(1) SLP/<a href="http://slp.1996.nc">slp.1996.nc</a><br>(2) SLP/<a href="http://slp.1997.nc">slp.1997.nc</a><br>(3) SLP/<a href="http://slp.1998.nc">slp.1998.nc</a><br>(4) SLP/<a href="http://slp.1999.nc">slp.1999.nc</a><br>(5) SLP/<a href="http://slp.2000.nc">slp.2000.nc</a><br>(6) SLP/<a href="http://slp.2001.nc">slp.2001.nc</a><br>(7) SLP/<a href="http://slp.2002.nc">slp.2002.nc</a><br>(8) SLP/<a href="http://slp.2003.nc">slp.2003.nc</a><br>(9) SLP/<a href="http://slp.2004.nc">slp.2004.nc</a><br>(10) SLP/<a href="http://slp.2005.nc">slp.2005.nc</a><br>(11) SLP/<a href="http://slp.2006.nc">slp.2006.nc</a><br>(12) SLP/<a href="http://slp.2007.nc">slp.2007.nc</a><br>(13) SLP/<a href="http://slp.2008.nc">slp.2008.nc</a><br>(14) SLP/<a href="http://slp.2009.nc">slp.2009.nc</a><br>(15) SLP/<a href="http://slp.2010.nc">slp.2010.nc</a><br>(16) SLP/<a href="http://slp.2011.nc">slp.2011.nc</a><br>(17) SLP/<a href="http://slp.2012.nc">slp.2012.nc</a><br>(18) SLP/<a href="http://slp.2013.nc">slp.2013.nc</a><br>(19) SLP/<a href="http://slp.2014.nc">slp.2014.nc</a></div><div><br></div><div>Variable: <b>yyyyddd</b><br>Type: integer<br>Total Size: 29220 bytes<br> 7305 values<br>Number of Dimensions: 1<br>Dimensions and sizes:<b> [7305]</b><br>Coordinates: <br>Number Of Attributes: 1<br> calendar : standard<br><br>Variable: <b>slp</b><br>Type: float<br>Total Size: 307160640 bytes<br> 76790160 values<br>Number of Dimensions: 3<br>Dimensions and sizes: <b>[time | 7305] x [lat | 73] x [lon | 144] <=== 3D</b><br>Coordinates: <br> <b>time: [1709328..1884624]<br> lat: [90..-90]<br> lon: [ 0..357.5]</b><br>Number Of Attributes: 15<br> long_name : mean Daily Sea Level Pressure<br> units : Pascals<br> precision : 0<br> least_significant_digit : -1<br> GRIB_id : 2<br> GRIB_name : PRMSL<br> var_desc : Sea Level Pressure<br> dataset : NCEP Reanalysis Daily Averages<br> level_desc : Sea Level<br> statistic : Mean<br> parent_stat : Individual Obs<br> missing_value : -9.96921e+36<br> actual_range : ( 93510, 110860 )<br> valid_range : ( 87000, 115000 )<br> _FillValue : -9.96921e+36<br><br>Variable: <b>climatology</b><br>Type: float<br>Total Size: 15389568 bytes<br> 3847392 values<br>Number of Dimensions: 3<br>Dimensions and sizes: <b>[year_day | 366] x [lat | 73] x [lon | 144]</b><br><b>Coordinates: <br> year_day: [1..366]<br> lat: [90..-90]<br> lon: [ 0..357.5]</b><br>Number Of Attributes: 5<br> long_name : Daily Climatology: mean Daily Sea Level Pressure<br> units : Pascals<br> information : Raw daily averages across all years<br> smoothing : None<br> calendar : standard</div><div><br></div><div>================================================<br></div><div>SInce, slp is three-dimensional (time,lat,lon), I used</div><div><br></div><div><br>climatology=<b>clmDayTLL</b>(slp, yyyyddd) ; 3D</div><div>=======================================</div><div><br></div><div>I created a 4D (time,level,lat,lon) and ran it also. I had no problems.<br></div><div><br></div><div>Variable: climatology<br>Type: float<br>Total Size: 261622656 bytes<br> 65405664 values<br><b>Number of Dimensions: 4<br>Dimensions and sizes: [year_day | 366] x [plevel | 17] x [lat | 73] x [lon | 144]</b></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 23, 2020 at 9:24 PM 아나 유즈바시츠 <<a href="mailto:ajuzbasic@pusan.ac.kr">ajuzbasic@pusan.ac.kr</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"><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-wrap"> </span>2018 12 26 360 2018360</p><p>(14605)<span style="white-space:pre-wrap"> </span>2018 12 27 361 2018361</p><p>(14606)<span style="white-space:pre-wrap"> </span>2018 12 28 362 2018362</p><p>(14607)<span style="white-space:pre-wrap"> </span>2018 12 29 363 2018363</p><p>(14608)<span style="white-space:pre-wrap"> </span>2018 12 30 364 2018364</p><p>(14609)<span style="white-space:pre-wrap"> </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-wrap"> </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-wrap"> </span>Daily Geopotential Heights on Pressure Levels</p><p> units :<span style="white-space:pre-wrap"> </span>m</p><p> precision :<span style="white-space:pre-wrap"> </span>0</p><p> least_significant_digit :<span style="white-space:pre-wrap"> </span>0</p><p> GRIB_id :<span style="white-space:pre-wrap"> </span>7</p><p> GRIB_name :<span style="white-space:pre-wrap"> </span>HGT</p><p> var_desc :<span style="white-space:pre-wrap"> </span>Geopotential height</p><p> dataset :<span style="white-space:pre-wrap"> </span>NCEP/DOE AMIP-II Reanalysis (Reanalysis-2) Daily Averages</p><p> level_desc :<span style="white-space:pre-wrap"> </span>Pressure Levels</p><p> statistic :<span style="white-space:pre-wrap"> </span>Mean</p><p> parent_stat :<span style="white-space:pre-wrap"> </span>Individual Obs</p><p> standard_name :<span style="white-space:pre-wrap"> </span>geopotential_height</p><p> cell_methods :<span style="white-space:pre-wrap"> </span>time: mean (of 4 6-hourly values in one day)</p><p> missing_value :<span style="white-space:pre-wrap"> </span>-9.96921e+36</p><p> actual_range :<span style="white-space:pre-wrap"> </span>( -530, 32289 )</p><p> valid_range :<span style="white-space:pre-wrap"> </span>( -1500, 35800 )</p><p> _FillValue :<span style="white-space:pre-wrap"> </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-wrap"> </span>[14610]</p><p>Coordinates: </p><p>Number Of Attributes: 1</p><p> calendar :<span style="white-space:pre-wrap"> </span>standard</p><p>(0)<span style="white-space:pre-wrap"> </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 <<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>><br>To : "Ana Juzbasic" <<a href="mailto:ajuzbasic@pusan.ac.kr" target="_blank">ajuzbasic@pusan.ac.kr</a>><br>Cc : "Ncl-talk" <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>><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 href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">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 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></div><img src="http://webmail.pusan.ac.kr/api/notify.php?home=MjAyMDA2MjQxMjI0Mzl8c2hlYUB1Y2FyLmVkdXxhanV6YmFzaWNAcHVzYW4uYWMua3I="></blockquote></div>