[ncl-talk] strange and intermittent error when processing CMIP5 data
Daniel Barandiaran
dbarandiaran at gmail.com
Tue Jul 14 13:00:48 MDT 2015
Hi all,
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:
CDMS error: Error on character time conversion: invalid hour = 80
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:
flist := systemfunc("ls " + diri + model(m) + "/" + dirlist(d) +
"/pr*_r" + r + "i" + i + "*.nc")
if (.not.any(ismissing(flist))) then
nfiles := dimsizes(flist)
fin := addfiles(flist,"r")
ListSetType(fin,"cat")
mtime := cd_calendar(fin[:]->time,-1)
mntime = dimsizes(mtime)
tind = ind(TIME.ge.mtime(0) .and. TIME.le.mtime(mntime-1))
mind := ind(mtime.le.max(TIME))
mpreU(r,tind) =
dim_avg_n(fin[:]->pr(mind,{Uminlat:Umaxlat},{Uminlon:Umaxlon}),(/1,2/))
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...
--
Danny Barandiaran
Ph.D. Candidate
Department of Plants, Soils, and Climate
Utah State University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150714/382f9c27/attachment.html
More information about the ncl-talk
mailing list