<div dir="ltr">David<div><br></div><div>Looks like it may not have been fixed quite yet. Mary sent me a version and I finally fooled the system into working today, when testing began. The short script included, inline below, can be run against the netcdf (wrfout) I uploaded recently (advise if I need to upload it again), results in a seg fault.</div><div><br></div><div><br></div><div><div>;=============</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"</div></div><div><div>;=============</div><div>begin</div><div><br></div><div>dimx = 225</div><div>dimy = 225</div><div>dimz = 55</div><div><br></div><div>a = addfile("<a href="http://wrfinput_d02.nc">wrfinput_d02.nc</a>", "w")</div><div>var_orig=a->QRAIN</div><div>var_mod = new((/1,dimz,dimy,dimx/),"float")</div><div>var_mod = 5.</div><div><br></div><div>print(dimsizes(var_orig))</div><div>print(dimsizes(var_mod))</div><div><br></div><div>a->QRAIN = (/var_mod/)</div><div><br></div><div>end</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 8, 2015 at 9:00 PM, David Brown <span dir="ltr"><<a href="mailto:dbrown@ucar.edu" target="_blank">dbrown@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dustan and Gerry,<br>
This issue relating to writing a variable with chunking in an existing<br>
NetCDF4 file has been fixed. Also a secondary issue involving<br>
re-writing existing variable attributes has been addressed as well.<br>
Let us know if you need a version with these fixes and we will try to<br>
accommodate you as soon as possible.<br>
Thanks for letting us know of this problem.<br>
-dave<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On Wed, Jun 3, 2015 at 8:50 AM, David Brown <<a href="mailto:dbrown@ucar.edu">dbrown@ucar.edu</a>> wrote:<br>
> Hi Dustin and Gerry,<br>
> I have confirmed there is a problem. It has been partially but not<br>
> completely fixed in the development version of the code. I am looking<br>
> into the remaining issue and will let you know when it has been fixed.<br>
> -dave<br>
><br>
> On Tue, Jun 2, 2015 at 10:34 AM, Gerry Creager - NOAA Affiliate<br>
> <<a href="mailto:gerry.creager@noaa.gov">gerry.creager@noaa.gov</a>> wrote:<br>
>> Additional information: If we do an addfile("<filename>","r"), we can open<br>
>> and read the file. If we use "w", well, we can open the file but assigning<br>
>> an existing variable to an internal variable fails on the assign (var =<br>
>> a->QRAIN). Of course, because it fails there, we can't see if it'd also fail<br>
>> on write.<br>
>><br>
>> Thanks<br>
>> Gerry<br>
>><br>
>> On Mon, Jun 1, 2015 at 7:15 PM, Gerry Creager - NOAA Affiliate<br>
>> <<a href="mailto:gerry.creager@noaa.gov">gerry.creager@noaa.gov</a>> wrote:<br>
>>><br>
>>> I've started looking at this with Dusty. Appreciate any thought you might<br>
>>> have as to why we're failing.<br>
>>><br>
>>> I've uploaded the input file (wrfinput_d02) to the FTP incoming site. I'm<br>
>>> testing with the script:<br>
>>><br>
>>> var = "QRAIN"<br>
>>> print(var)<br>
>>> a=addfile("<a href="http://wrfinput_d02.nc" rel="noreferrer" target="_blank">wrfinput_d02.nc</a>", "w")<br>
>>> var_orig=a->QRAIN<br>
>>> print(var_orig)<br>
>>><br>
>>><br>
>>> The result looks like:gerry@loki:~/NEWSe/NCL> ncl test.ncl<br>
>>> Copyright (C) 1995-2015 - All Rights Reserved<br>
>>> University Corporation for Atmospheric Research<br>
>>> NCAR Command Language Version 6.3.0<br>
>>> The use of this software is governed by a License Agreement.<br>
>>> See <a href="http://www.ncl.ucar.edu/" rel="noreferrer" target="_blank">http://www.ncl.ucar.edu/</a> for more details.<br>
>>><br>
>>><br>
>>> Variable: var<br>
>>> Type: string<br>
>>> Total Size: 8 bytes<br>
>>> 1 values<br>
>>> Number of Dimensions: 1<br>
>>> Dimensions and sizes: [1]<br>
>>> Coordinates:<br>
>>> (0) QRAIN<br>
>>> fatal:["NclNetCDF4.c":3073]:NclNetCDF4.c: Error in nc_def_var_chunking in<br>
>>> file (<a href="http://wrfinput_d02.nc" rel="noreferrer" target="_blank">wrfinput_d02.nc</a>) for writing, at line: 3073<br>
>>><br>
>>> line 3074 of NclNetCDF4.c: NetCDF: Attempt to define var properties, like<br>
>>> deflate, after enddef.<br>
>>><br>
>>><br>
>>> On Fri, May 29, 2015 at 8:54 PM, Dustan Wheatley - NOAA Affiliate<br>
>>> <<a href="mailto:dustan.wheatley@noaa.gov">dustan.wheatley@noaa.gov</a>> wrote:<br>
>>>><br>
>>>> I am trying to overwrite a netcdf4 file analogous to what is shown at<br>
>>>> <a href="http://www.ncl.ucar.edu/Applications/change_netCDF.shtml" rel="noreferrer" target="_blank">http://www.ncl.ucar.edu/Applications/change_netCDF.shtml</a>. In the attached<br>
>>>> ncl script, I open the file to be modified at line 35 and attempt the<br>
>>>> modification at line 73 (with a lot of calculations in between). While I<br>
>>>> have double-checked that the modified field (var_mod) has the same<br>
>>>> dimensionality as the original variable (QRAIN), I am still get a<br>
>>>> segmentation fault/core dump. Never had this problem when I tried to<br>
>>>> manipulate netcdf3 files. Could it possibly be related to the netcdf4<br>
>>>> compression? It’s possible I may be trying to do something that’s no longer<br>
>>>> possible.<br>
>>>><br>
>>>> Thanks in advance for any suggestions.<br>
>>>><br>
>>>> -Dusty Wheatley<br>
>>>><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>
>>><br>
>>><br>
>>><br>
>>> --<br>
>>> Gerry Creager<br>
>>> NSSL/CIMMS<br>
>>> <a href="tel:405.325.6371" value="+14053256371">405.325.6371</a><br>
>>> ++++++++++++++++++++++<br>
>>> “Big whorls have little whorls,<br>
>>> That feed on their velocity;<br>
>>> And little whorls have lesser whorls,<br>
>>> And so on to viscosity.”<br>
>>> Lewis Fry Richardson (1881-1953)<br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>> Gerry Creager<br>
>> NSSL/CIMMS<br>
>> <a href="tel:405.325.6371" value="+14053256371">405.325.6371</a><br>
>> ++++++++++++++++++++++<br>
>> “Big whorls have little whorls,<br>
>> That feed on their velocity;<br>
>> And little whorls have lesser whorls,<br>
>> And so on to viscosity.”<br>
>> Lewis Fry Richardson (1881-1953)<br>
>><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>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Gerry Creager<div>NSSL/CIMMS</div><div>405.325.6371</div><div>++++++++++++++++++++++</div><div><div>“Big whorls have little whorls,</div><div>That feed on their velocity; </div><div>And little whorls have lesser whorls, </div><div>And so on to viscosity.” </div><div>Lewis Fry Richardson (1881-1953)</div></div></div></div>
</div>