<div dir="ltr">This isn't going to be a solution and one of the devs who knows about the internals of the cd_ routines may have a better answer. <div>That said, have you tried reading in the times first, then passing the array to cd_calendar. e.g.</div><div><br></div><div>fin_time = fin[:]->time</div><div>mtime := cd_calendar(fin_time, -1)</div><div><br></div><div>It shouldn't really make a difference, but when I've had weird quirks like this it's occasionally on the netcdf side of things. </div><div><br></div><div>If that still fails, it may help if you then save that time array to a new netcdf and send it to the list so devs can recreate the problem and diagnose. </div><div><br></div><div><br></div><div>Alan. </div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, 14 Jul 2015 at 15:01 Daniel Barandiaran <<a href="mailto:dbarandiaran@gmail.com">dbarandiaran@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>