[ncl-talk] [RE]Re: Problem with ClmDayTLLL - "Variable (yyyy) is stillundefined, unable to reference attribute calendar"
아나 유즈바시츠
ajuzbasic at pusan.ac.kr
Tue Jun 23 21:24:39 MDT 2020
Thank you for all the suggestions. I tried all You suggested, but everything looks fine to me ?last few lines fromprint(year+" "+month+" "+day+" "+ddd+" "+yyyyddd)(14604) 2018 12 26 360 2018360(14605) 2018 12 27 361 2018361(14606) 2018 12 28 362 2018362(14607) 2018 12 29 363 2018363(14608) 2018 12 30 364 2018364(14609) 2018 12 31 365 2018365Variable: hgtType: floatTotal Size: 10443461760 bytes 2610865440 valuesNumber of Dimensions: 4Dimensions and sizes: [time | 14610] x [level | 17] x [lat | 73] x [lon | 144]Coordinates: time: [1569072..1919688] level: [1000..10] lat: [90..-90] lon: [ 0..357.5]Number Of Attributes: 17 long_name : Daily Geopotential Heights on Pressure Levels units : m precision : 0 least_significant_digit : 0 GRIB_id : 7 GRIB_name : HGT var_desc : Geopotential height dataset : NCEP/DOE AMIP-II Reanalysis (Reanalysis-2) Daily Averages level_desc : Pressure Levels statistic : Mean parent_stat : Individual Obs standard_name : geopotential_height cell_methods : time: mean (of 4 6-hourly values in one day) missing_value : -9.96921e+36 actual_range : ( -530, 32289 ) valid_range : ( -1500, 35800 ) _FillValue : -9.96921e+36Variable: yyyydddType: integerTotal Size: 58440 bytes 14610 valuesNumber of Dimensions: 1Dimensions and sizes: [14610]Coordinates:Number Of Attributes: 1 calendar : standard(0) min=1979001 max=2018365----- Original Message -----From : Dennis Shea <shea at ucar.edu>To : "Ana Juzbasic" <ajuzbasic at pusan.ac.kr>Cc : "Ncl-talk" <ncl-talk at ucar.edu>Sent : 2020-06-23 22:31:32Subject : Re: [ncl-talk] Problem with ClmDayTLLL - "Variable (yyyy) is stillundefined, unable to reference attribute calendar"As a 1st debug step, you could do:printVarSummary(yyyyddd)printMinMax(yyyyddd,0)print("=========")Maybe look at all the 'date' valuesprint(year+" "+month+" "+day+" "+ddd+" "+yyyyddd)Also, include the output from:printVarSummary(hgt)On Tue, Jun 23, 2020 at 4:48 AM Ana Juzbasic via ncl-talk <ncl-talk at mailman.ucar.edu> wrote: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_______________________________________________
ncl-talk mailing list
ncl-talk at mailman.ucar.edu
List instructions, subscriber options, unsubscribe:
https://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200624/690ae021/attachment.html>
More information about the ncl-talk
mailing list