mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-12-21 08:39:46 +08:00
2f0a6d22e9
re: Github Issue https://github.com/Unidata/netcdf-c/issues/1826 It turns out that the common get code (NC4_get_vars) in libhdf5 (and libnczarr) has an optimization where it does not attempt to read from the file if the file is all fill values. Rather it just fills the output buffer with the fill value. The problem is that -- in that case -- it forgets that conversion might still be needed. So the conversion never occurs and the raw bits of the fill data are stored directly into the memory space. Solution: move some code around to properly do the conversion no matter how the data was obtained. Added a test cases nc_test4/test_fillonly.sh and nczarr_test/test_fillonlyz.sh
21 lines
389 B
Plaintext
21 lines
389 B
Plaintext
netcdf ref_fillonly {
|
|
dimensions:
|
|
// When UNLIMITED is implemented, then use this value for x
|
|
// x = UNLIMITED ; // (6 currently)
|
|
x = 6;
|
|
variables:
|
|
int i(x) ;
|
|
i:_Storage = "chunked" ;
|
|
i:_ChunkSizes = 6 ;
|
|
float f(x) ;
|
|
f:_FillValue = -9999.f ;
|
|
f:_Storage = "chunked" ;
|
|
f:_ChunkSizes = 6 ;
|
|
|
|
// global attributes:
|
|
:_Format = "netCDF-4" ;
|
|
data:
|
|
|
|
i = 1, 2, 3, 4, 5, 6 ;
|
|
}
|