<div dir="ltr">


















<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:12pt"><span style="font-family:times new roman,serif"><span style="font-size:11pt;color:black"><font size="2">I'm running a script that opens a NARR GRIB file, reads data, and writes a .csv file. It seems to work fine if the data is valid, but sometimes the GRIB file is bad. I would like to trap this and handle it gracefully but I can't figure out how to do this. When I call addfile I get this warning:</font><br></span></span></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-family:"Times New Roman",serif"><font size="1"><span style="font-family:Menlo;color:black">warning:_NclOpenFile: Can not open file
<NARR3D_201811_0103.subset>; file format
not supported or file is corrupted</span></font></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-family:"Times New Roman",serif"><font size="2">Despite this warning, the function isfile returns true. Later when I try to access a variable in the file I get these errors:</font><br></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-family:"Times New Roman",serif"><font size="1"><span style="font-family:Menlo;color:black"><span></span></span></font></p><font size="1">

</font><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-family:"Times New Roman",serif"><font size="1"><span style="font-family:Menlo;color:black">fatal:file (g3d) isn't defined<span></span></span></font></p><font size="1">

</font><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"Times New Roman",serif"><span style="font-size:11pt;font-family:Menlo;color:black"><font size="1">fatal:["Execute.c":8637]:Execute: Error
occurred at or near line 35 in file read3D.ncl</font></span></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"Times New Roman",serif"><font size="2">What I'd like to do is just quit the script if I get that initial warning. What is the best way to handle this?</font></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"Times New Roman",serif"><font size="2">Thanks,</font></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"Times New Roman",serif"><font size="2">Jennifer</font><br></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"Times New Roman",serif"><span style="font-size:11pt;font-family:Menlo;color:black"><font size="1"></font><span></span></span></p>





</div>