<div dir="ltr">Yes, it's a seg fault, but it's quite simple to avoid. Trying to manually read a variable's attribute from a file, and it turns out that this attribute doesn't exist, results in a seg fault.<div>Lesson learned: don't read a variable's attribute if it doesn't exist.</div><div>Also, should specify that this is a true netCDF4 file. The same problem doesn't occur with a smaller netCDF file. Both code segments are from NCL6.3.0.</div><div><br></div><div><br></div><div>Kyle</div><div><br></div><div><br></div><div>netCDF4:<br><div><br></div><div>
<p class=""><span class=""><font face="monospace, monospace">ncl 0> a=addfile("TEST_dp_stddev_0101.nc","r")</font></span></p>
<p class=""><span class=""><font face="monospace, monospace">ncl 1> time=a->time</font></span></p>
<p class=""><span class=""><font face="monospace, monospace">ncl 2> printVarSummary(time)</font></span></p>
<p class=""><font face="monospace, monospace"><span class=""></span><br></font></p>
<p class=""><span class=""><font face="monospace, monospace">Variable: time</font></span></p>
<p class=""><span class=""><font face="monospace, monospace">Type: double</font></span></p>
<p class=""><span class=""><font face="monospace, monospace">Total Size: 992 bytes</font></span></p>
<p class=""><span class=""><font face="monospace, monospace"> 124 values</font></span></p>
<p class=""><span class=""><font face="monospace, monospace">Number of Dimensions: 1</font></span></p>
<p class=""><span class=""><font face="monospace, monospace">Dimensions and sizes:<span class="">        </span>[time | 124]</font></span></p>
<p class=""><span class=""><font face="monospace, monospace">Coordinates: </font></span></p>
<p class=""><span class=""><font face="monospace, monospace"> time: [1262256..1262994]</font></span></p>
<p class=""><span class=""><font face="monospace, monospace">ncl 3> time@units = a->time@units</font></span></p>
<p class=""><span class=""><font face="monospace, monospace">Segmentation fault (core dumped)</font></span></p><p class=""><span class=""><font face="monospace, monospace"><br></font></span></p><p class=""><span class=""><font face="arial, helvetica, sans-serif">netCDF3:</font></span></p><p class=""><br></p><p class=""><span class=""><font face="monospace, monospace">ncl 0> a=addfile("<a href="http://dp_climo_01.nc">dp_climo_01.nc</a>","r")</font></span></p><p class=""><span class=""><font face="monospace, monospace">ncl 1> time=a->time</font></span></p><p class=""><span class=""><font face="monospace, monospace">ncl 2> printVarSummary(time)</font></span></p><p class=""><font face="monospace, monospace"><span class=""></span><br></font></p><p class=""><span class=""><font face="monospace, monospace">Variable: time</font></span></p><p class=""><span class=""><font face="monospace, monospace">Type: double</font></span></p><p class=""><span class=""><font face="monospace, monospace">Total Size: 992 bytes</font></span></p><p class=""><span class=""><font face="monospace, monospace"> 124 values</font></span></p><p class=""><span class=""><font face="monospace, monospace">Number of Dimensions: 1</font></span></p><p class=""><span class=""><font face="monospace, monospace">Dimensions and sizes:<span class="">        </span>[time | 124]</font></span></p><p class=""><span class=""><font face="monospace, monospace">Coordinates: </font></span></p><p class=""><span class=""><font face="monospace, monospace"> time: [1262256..1262994]</font></span></p><p class=""><span class=""><font face="monospace, monospace">Number Of Attributes: 1</font></span></p><p class=""><span class=""><font face="monospace, monospace"> units :<span class="">        </span>hours since 1800-01-01 00:00:00.0</font></span></p><p class=""><span class=""><font face="monospace, monospace">ncl 3> time@units = a->time@blahblah</font></span></p><p class=""><span class=""><font face="monospace, monospace">
</font></span></p><p class=""><span class=""><font face="monospace, monospace">warning:FileReadVarAtt: (blahblah) is not an attribute of (time)</font></span></p><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr">----------------------------------------<div>Kyle S. Griffin</div><div>Department of Atmospheric and Oceanic Sciences</div><div>University of Wisconsin - Madison</div><div>Room 1407</div><div>1225 W Dayton St, Madison, WI 53706</div><div>Email: <a href="mailto:ksgriffin2@wisc.edu" target="_blank">ksgriffin2@wisc.edu</a></div></div></div></div></div></div>
</div></div></div>