[ncl-talk] Skipping Missing Files

Guido Cioni guidocioni at gmail.com
Sat Dec 17 10:05:16 MST 2016


Hey Barry,
An easy way of doing it would be to encapsulate all the file operations
into an IF statement which uses either the isfilevar (
http://www.ncl.ucar.edu/Document/Functions/Built-in/isfilevar.shtml)
function or the isfilepresent (
http://www.ncl.ucar.edu/Document/Functions/Built-in/isfilepresent.shtml)
function to check the existence of either variable in a file or the file
itself. You just have to put an OR so that the operations are skipped, but
the script is not interrupted, if either the variable or the file are not
found.
Cheers

Il 17 dic 2016 5:29 PM, "Barry Lynn" <barry.h.lynn at gmail.com> ha scritto:

> Hi:
>
> I am downloading a lot of data and processing it, file by file.
>
> It happens that sometimes a file is missing, or a even a variable within
> the file is missing.
>
> How can I tell NCL to skip the read, instead of a returning an error and
> ending the program.
>
> Basically, I want NCL to note errors, and bypass them, instead of
> terminating.
>
> Barry
>
> --
> Barry H. Lynn, Ph.D
> Senior Lecturer,
> The Institute of the Earth Science,
> The Hebrew University of Jerusalem,
> Givat Ram, Jerusalem 91904, Israel
> Tel: 972 547 231 170
> Fax: (972)-25662581
>
> C.E.O, Weather It Is, LTD
> Weather and Climate Focus
> http://weather-it-is.com
> Jerusalem, Israel
> Local: 02 930 9525
> Cell: 054 7 231 170
> Int-IS: x972 2 930 9525
> US 914 432 3108
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161217/ddde7d6c/attachment.html 


More information about the ncl-talk mailing list