<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">Dave,</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">I can reproduce this problem, and I have create a JIRA ticket 2196 to track this issue.</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">This is a very interested issue. Think of</div><div class="gmail_default" style="font-family:verdana,sans-serif">1. over-write to classic netcdf file is trivia.</div><div class="gmail_default" style="font-family:verdana,sans-serif"> not a problem to overwrite a single point of a variable as well.</div><div class="gmail_default" style="font-family:verdana,sans-serif">2. With chunked netcdf4classic, there has some issues.</div><div class="gmail_default" style="font-family:verdana,sans-serif"> At least it need to figure out which chunk to overwrite.</div><div class="gmail_default" style="font-family:verdana,sans-serif"> if the variable is compressed, then the new value may change the</div><div class="gmail_default" style="font-family:verdana,sans-serif"> compress scheme, so it is not as simple as just replace a single value on the disk.</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">I'll dig deeper to see how to fix this issue.</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Thanks,</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Wei</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><font face="tahoma, sans-serif">================================================</font><div><font face="tahoma, sans-serif">1850 Table Mesa Dr.</font></div><div><font face="tahoma, sans-serif">Boulder, CO 80307</font></div><div><font face="tahoma, sans-serif">Phone: 303-497-8924</font></div></div></div></div>
<br><div class="gmail_quote">On Tue, Apr 7, 2015 at 5:17 PM, Dave Allured - NOAA Affiliate <span dir="ltr"><<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</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">NCL team,<div><br></div><div>This program gets a segmentation fault when writing a single value to a Netcdf-4 classic test file. I get the same behavior with NCL 6.2.1 and 6.3.0 on Mac OS 10.10.2, also NCL 6.2.1 on Redhat Linux 6.6.</div><div><br></div><div><div>mac56> ncdump -s <a href="http://data.nc" target="_blank">data.nc</a></div><div>netcdf data {</div><div>dimensions:</div><div> t = 3 ;</div><div>variables:</div><div> float dat(t) ;</div><div> dat:_Storage = "chunked" ;</div><div> dat:_ChunkSizes = 3 ;</div><div> dat:_DeflateLevel = 0 ;</div><div> dat:_Shuffle = "true" ;</div><div><br></div><div>// global attributes:</div><div> :_Format = "netCDF-4 classic model" ;</div><div>data:</div><div><br></div><div> dat = 10, 20, 30 ;</div><div>}</div><div>-------------------------------------------------<br></div></div><div>begin<br></div><div><div> outfile = "<a href="http://data.nc" target="_blank">data.nc</a>"</div><div> print ("Open test file in write mode: " + outfile)<br></div><div> out = addfile (outfile, "w") ; open as read/write, for updating</div><div><br></div><div> dims = (/ 3, 5 /)<span style="white-space:pre-wrap">                </span>; create dummy array</div><div> avs = new (dims, float)</div><div> avs = 99.0</div><div><br></div><div> vmin = new (3, float, "No_FillValue")</div><div> vmin(:) = dim_min_n (avs, 1)</div><div>;; vmin(:) = min (avs)</div><div><br></div><div> printFileVarSummary (out, "dat")</div><div> print (vmin)</div><div><br></div><div> print ("Write single value to file variable 'dat'.")</div><div> out->dat(0) = (/ vmin(0) /)</div><div> print ("Test complete.")<br></div><div>end</div></div><div>-------------------------------------------------<br></div><div>mac56> ncl test6.ncl <br></div><div><div> Copyright (C) 1995-2015 - All Rights Reserved</div><div> University Corporation for Atmospheric Research</div><div> NCAR Command Language Version 6.3.0</div><div> The use of this software is governed by a License Agreement.</div><div> See <a href="http://www.ncl.ucar.edu/" target="_blank">http://www.ncl.ucar.edu/</a> for more details.</div><div>(0)<span style="white-space:pre-wrap">        </span>Open empty file in write mode: <a href="http://data.nc" target="_blank">data.nc</a></div><div><br></div><div>Variable: dat</div><div>Type: float</div><div>Total Size: 12 bytes</div><div> 3 values</div><div>Number of Dimensions: 1</div><div>Dimensions and sizes:<span style="white-space:pre-wrap">        </span>[t | 3]</div><div>Coordinates: </div><div> t: not a coordinate variable</div><div>Number of Attributes: 0</div><div><br></div><div>Variable: vmin</div><div>Type: float</div><div>Total Size: 12 bytes</div><div> 3 values</div><div>Number of Dimensions: 1</div><div>Dimensions and sizes:<span style="white-space:pre-wrap">        </span>[3]</div><div>Coordinates: </div><div>(0)<span style="white-space:pre-wrap">        </span>99</div><div>(1)<span style="white-space:pre-wrap">        </span>99</div><div>(2)<span style="white-space:pre-wrap">        </span>99</div><div>(0)<span style="white-space:pre-wrap">        </span>Write single value to file variable 'dat'.</div><div>/Users/dallured/bin/ncl: line 6: 61511 Segmentation fault: 11 /usr/local/ncl/bin/ncl "$@"</div></div><div><br></div><div>I see the possible combination of two bugs combined. vmin should have received a _FillValue attribute from the dim_min_n function, and NCL should print a rational error message rather than seg fault. Let me know if I am misunderstanding something.</div><div><br></div><div>This is a low priority request, I have my own workaround. Could you please fix one or both of these conditions for a future release. Thank you for taking a look at this.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>--Dave</div></font></span></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>