[ncl-talk] FillValue problems with Netcdf-4
Wei Huang
huangwei at ucar.edu
Wed Apr 8 08:53:14 MDT 2015
Dave,
I can reproduce this problem, and I have create a JIRA ticket 2196 to track
this issue.
This is a very interested issue. Think of
1. over-write to classic netcdf file is trivia.
not a problem to overwrite a single point of a variable as well.
2. With chunked netcdf4classic, there has some issues.
At least it need to figure out which chunk to overwrite.
if the variable is compressed, then the new value may change the
compress scheme, so it is not as simple as just replace a single value
on the disk.
I'll dig deeper to see how to fix this issue.
Thanks,
Wei
================================================
1850 Table Mesa Dr.
Boulder, CO 80307
Phone: 303-497-8924
On Tue, Apr 7, 2015 at 5:17 PM, Dave Allured - NOAA Affiliate <
dave.allured at noaa.gov> wrote:
> NCL team,
>
> 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.
>
> mac56> ncdump -s data.nc
> netcdf data {
> dimensions:
> t = 3 ;
> variables:
> float dat(t) ;
> dat:_Storage = "chunked" ;
> dat:_ChunkSizes = 3 ;
> dat:_DeflateLevel = 0 ;
> dat:_Shuffle = "true" ;
>
> // global attributes:
> :_Format = "netCDF-4 classic model" ;
> data:
>
> dat = 10, 20, 30 ;
> }
> -------------------------------------------------
> begin
> outfile = "data.nc"
> print ("Open test file in write mode: " + outfile)
> out = addfile (outfile, "w") ; open as read/write, for updating
>
> dims = (/ 3, 5 /) ; create dummy array
> avs = new (dims, float)
> avs = 99.0
>
> vmin = new (3, float, "No_FillValue")
> vmin(:) = dim_min_n (avs, 1)
> ;; vmin(:) = min (avs)
>
> printFileVarSummary (out, "dat")
> print (vmin)
>
> print ("Write single value to file variable 'dat'.")
> out->dat(0) = (/ vmin(0) /)
> print ("Test complete.")
> end
> -------------------------------------------------
> mac56> ncl test6.ncl
> Copyright (C) 1995-2015 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 6.3.0
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
> (0) Open empty file in write mode: data.nc
>
> Variable: dat
> Type: float
> Total Size: 12 bytes
> 3 values
> Number of Dimensions: 1
> Dimensions and sizes: [t | 3]
> Coordinates:
> t: not a coordinate variable
> Number of Attributes: 0
>
> Variable: vmin
> Type: float
> Total Size: 12 bytes
> 3 values
> Number of Dimensions: 1
> Dimensions and sizes: [3]
> Coordinates:
> (0) 99
> (1) 99
> (2) 99
> (0) Write single value to file variable 'dat'.
> /Users/dallured/bin/ncl: line 6: 61511 Segmentation fault: 11
> /usr/local/ncl/bin/ncl "$@"
>
> 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.
>
> 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.
>
> --Dave
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150408/7fa2041d/attachment.html
More information about the ncl-talk
mailing list