<div dir="ltr"><div><div><div>Hi all,<br><br></div>I have an unusual problem, which I believe is happening when I call the cd_calendar function. What is particularly strange is that the error does not always happen, but it occurs quite frequently, which requires me to run my script many times to get a successful run. The error code I get is:<br><br>CDMS error: Error on character time conversion: invalid hour = 80<br><br></div>The invalid hour changes from time to time, and the file that causes it to trip up changes from run to run as well, although there do seem to be a few files that cause the trip-up more frequently. Here is a code snippet of my usage:<br><br> flist := systemfunc("ls " + diri + model(m) + "/" + dirlist(d) + "/pr*_r" + r + "i" + i + "*.nc")<br> if (.not.any(ismissing(flist))) then<br><br> nfiles := dimsizes(flist)<br> fin := addfiles(flist,"r")<br> ListSetType(fin,"cat")<br> mtime := cd_calendar(fin[:]->time,-1)<br> mntime = dimsizes(mtime)<br> tind = ind(TIME.ge.mtime(0) .and. TIME.le.mtime(mntime-1))<br> mind := ind(mtime.le.max(TIME))<br> mpreU(r,tind) = dim_avg_n(fin[:]->pr(mind,{Uminlat:Umaxlat},{Uminlon:Umaxlon}),(/1,2/))<br><br></div>I realize that my usage might be a little weird, but the CMIP5 data files have such variation on dimension sizes, particularly in the time dimension, so I have to make this funky code to get it to be generic enough, and read in file contents to predefined arrays. This code chunk resides within three nested loops (m,d,i), which perhaps is causing this problem, but I don't know how else to tackle what I am trying to do. I would offer the files that the script reads but it is way too much...<br><div><br clear="all"><div><div><div><br>-- <br><div><div dir="ltr"><div>Danny Barandiaran<br></div><div>Ph.D. Candidate<br></div><div><div>Department of Plants, Soils, and Climate</div><div>Utah State University</div><div><br><div><br></div></div></div></div></div>
</div></div></div></div></div>