addfile question

From: Matt Fearon <matt_at_nyahnyahspammersnyahnyah>
Date: Fri, 1 Jun 2007 13:22:18 -0400 (EDT)

Dear NCL Users:

When I use addfile on a particular grib file, ie, f=addfile(test.grb,"r"),
I receive the following error message:

fatal:Premature end-of-file, file appears to be truncated

I realize this is a problem with the file. However, is there an easy
method to check for this error so my script
will not crash. I would like to be able to skip such files. I have tried
the following, but have been
unsuccessful;

if (any(f.eq."fatal")) then
    print("file truncated, skip to next file")
end if

Any suggestions would be greatly appreciated.
thanks,
Matt

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jun 01 2007 - 11:22:18 MDT

This archive was generated by hypermail 2.2.0 : Tue Jun 05 2007 - 16:18:21 MDT