<div dir="ltr"><div><div><div>THX to Gus.<br><br>===<br></div>His response is the correct one.<br>===<br></div>To be explicit, NCL does not have 'exception handling.'<br><br></div>D<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jun 2, 2018 at 10:22 PM, Gustavo Correa <span dir="ltr"><<a href="mailto:gus@ldeo.columbia.edu" target="_blank">gus@ldeo.columbia.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Fangda<br>
<br>
You could use the "isfilevar" function to check if the variable is in the file,<br>
before you try to read it. <br>
<br>
<a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/isfilevar.shtml" rel="noreferrer" target="_blank">https://www.ncl.ucar.edu/<wbr>Document/Functions/Built-in/<wbr>isfilevar.shtml</a><br>
<br>
Strictly speaking, this is not exception handling, <br>
but prevents the exception from happening.<br>
<br>
I hope this helps,<br>
Gus Correa<br>
<div><div class="h5"><br>
> On Jun 2, 2018, at 22:31, Kunal Bali <<a href="mailto:kunal.bali9@gmail.com">kunal.bali9@gmail.com</a>> wrote:<br>
> <br>
> Could you please provide the script so that everyone can understand the exact error.<br>
> <br>
> <br>
> From: Fangda<br>
> Sent: Sunday 3 June 2018 07:57<br>
> To: NCL<br>
> Subject: [ncl-talk] Exception handling<br>
> <br>
> Hello Everyone,<br>
> <br>
> When I read variable in file I meet an error because it is not in file,  so Is there any expection handling syntax in NCL to deal with this problem?<br>
> <br>
> Fangda<br>
> <br>
</div></div>> ______________________________<wbr>_________________<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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br>
______________________________<wbr>_________________<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/<wbr>mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br></div>