[ncl-talk] How to Make NCL throw an error?

Walter Hannah walter at hannahlab.org
Tue Jul 14 09:35:40 MDT 2015


I write a lot of my own custom functions in NCL. I always put in various
checks that will print an error message and exit. But when I encounter
this, I never know which line is causing the problem.

For example, I might have a block of code like:

...
09
10  y = some_function (x)
11

12  a = some_function (b)
13
...


and when I run the script I get something like:

ERROR: "some_function" doesn't like your input!


But I would like more information, like a typical NCL error message:

fatal:Execute: Error occurred at or near line 3 in file ...


So, how can I get NCL to throw an error that will mention the line where
the function was called?

Thanks,
Walter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150714/52ee328d/attachment.html 


More information about the ncl-talk mailing list