<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Walter,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Sorry if somebody already responded to this.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">In general, NCL is supposed to give you a line number where it fails.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Can you be more specific about what the error message is? Perhaps there's a way we can improve it.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">There is one particular warning that shows up now and then, that I find frustrating because it doesn't give you a line number:</div><div class="gmail_default" style="font-size:small">
<p class="p1"> Argument N of the current function or procedure was coerced to the appropriate<br> type and thus will not change if the function or procedure modifies its value</p><p class="p1">In this case, I will comment out the "begin" and "end" statements, if any, and rerun the script with "ncl -x". This causes every line to be echoed to standard out as you execute it, and hence you can see where the warning occurs.</p><p class="p1">--Mary</p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 14, 2015 at 9:35 AM, Walter Hannah <span dir="ltr"><<a href="mailto:walter@hannahlab.org" target="_blank">walter@hannahlab.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">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.<div><br></div><div>For example, I might have a block of code like:</div><div><br></div><div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><font face="monospace, monospace">...</font></div><div><font face="monospace, monospace">09</font></div><div><font face="monospace, monospace">10 y = some_function (x)</font></div><div><font face="monospace, monospace">11</font></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><font face="monospace, monospace">12 a = some_function (b)</font></div><div><font face="monospace, monospace">13 </font></div><div><font face="monospace, monospace">...</font></div></blockquote></div><div><br></div><div>and when I run the script I get something like:</div><div><br></div><div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><font face="monospace, monospace">ERROR: "some_function" doesn't like your input!</font></div></blockquote></div><div><br></div><div>But I would like more information, like a typical NCL error message:</div><div><br></div><div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><font face="monospace, monospace">fatal:Execute: Error occurred at or near line 3 in file ...</font><br></div></blockquote></div><div><br></div><div>So, how can I get NCL to throw an error that will mention the line where the function was called?</div><div><br></div><div>Thanks,</div><div>Walter</div></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">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>
<br></blockquote></div><br></div>