Closed Alexander-Barth closed 2 years ago
It was a typo. I will put up a fix shortly, but you can test it by:
if (fletcher32 && fletcher32) {
to
if (fletcher32 && *fletcher32) {
Thanks, indeed! Now it works.
$ LD_LIBRARY_PATH=/home/abarth/opt/netcdf-4.9.0/lib ./a.out
mode 0
expected mode 0
*** SUCCESS writing example file simple_xy.nc!
Thanks a lot for implementing this fix!
On Linux, when I call
nc_def_var_fletcher32(ncid, varid, NC_NOCHECKSUM)
, a subsequent call tonc_inq_var_fletcher32
returnsNC_FLETCHER32
. Apparently check summing is activated. Under NetCDF 4.8.1,nc_inq_var_fletcher32
returnsNC_NOCHECKSUM
as expected. This causes some test failures in my Julia package.NetCDF 4.9.0
Ubuntu 18.04, gcc 7.5.0 with system HDF5 ( libhdf5-serial-dev ,1.10.0)
The program test_fletcher32.c (apated from examples/C/simple_xy_wr.c) shows this behavior:
Test program test_fletcher32.c
```c /*! \file An example program demonstrating a simple 2D write. Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 University Corporation for Atmospheric Research/Unidata. See netcdf-c/COPYRIGHT file for more info. */ #includeoutput of `ncdump -s` of the file generated by NetCDF 4.9.0
``` netcdf simple_xy { dimensions: x = 6 ; y = 12 ; variables: int data(x, y) ; data:_Storage = "chunked" ; data:_ChunkSizes = 6, 12 ; data:_Fletcher32 = "true" ; data:_Endianness = "little" ; // global attributes: :_NCProperties = "version=2,netcdf=4.9.0,hdf5=1.10.0" ; :_SuperblockVersion = 0 ; :_IsNetcdf4 = 1 ; :_Format = "netCDF-4" ; data: data = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71 ; } ```