Skip to content

new ncdump failure to print NCZarr variable #2494

@czender

Description

@czender

Hi, After building today's netcdf-c snapshot that includes PR #2492, I noticed that ncdump and ncks now fail to print some NCZarr variables that they previously worked well with. Here is the symptom:

zender@spectral:~/nco/data$ ncgen -k netCDF-4 -b -o in_zarr4.nc in_zarr4.cdl
zender@spectral:~/nco/data$ ncgen -k netCDF-4 -lb -o "file://in_zarr4#mode=nczarr,file" in_zarr4.cdl 
zender@spectral:~/nco/data$ ncdump "file://in_zarr4#mode=nczarr,file"
....
normal output
....
	float ppc_bgr(time) ;
		ppc_bgr:long_name = "Precision-Preserving Compression, bigger numbers" ;
		ppc_bgr:purpose = "test --ppc switches" ;
		ppc_bgr:original_values = "1234567890e20,1234567890e19,1234567890e18,1234567890e17,1234567890e16,1234567890e15,1234567890e14,1234567890e13,1234567890e12,1234567890e11" ;
NetCDF: Invalid argument
Location: file ncdump.c; line 1762
zender@spectral:~/nco/data$ 

Note that ncdump and ncks continue to print the in_zarr4.nc file correctly.
The problem can be demonstrated by trying to dump the NCZarr version of the attached in_zarr4.cdl.txt

FYI, ncks fails to dump the Zarr file with this error:
zender@spectral:~/nco/data$ ncks "file://in_zarr4#mode=nczarr,file"

ERROR: nco_inq_var() fails for variable "ppc_bgr"
ERROR NC_EINVAL Invalid argument
HINT: NC_EINVAL errors can occur for many reasons. Three common ones are described here. 1. When invalid chunking directives are given, e.g., to unchunk a record variable or to chunk a variable with an invalid size (such as zero or larger than a fixed dimension). This is the most frequent/likely cause in our experience. 2. When HDF4-enabled NCO attempts to directly write to an HDF4 (not HDF5) file. Not all HDF5 calls are available with HDF4, and the operators ncrename and ncatted are liklier to trigger this problem. We are working to solve this (fxm TODO nco1104). Please let us know if it affects you. For now the workaround is to convert the HDF4 file to netCDF4 first (e.g., with ncks -4 in.hdf out.nc), then use ncrename or ncatted. 3. When NCO operators attempt to open netCDF4 files using the diskless option, usually invoked with --diskless_all, --ram_all, or --open_ram. Is your input file netCDF4 format?  (http://nco.sf.net/nco.html#fmt_inq shows how to tell.) If so then omitting the diskless option may solve this problem. 4. When floating-point quantization algorithms (e.g., BitGroom) are applied to integer-containing variables.
nco_err_exit(): ERROR Short NCO-generated message (usually name of function that triggered error): nco_inq_var()
nco_err_exit(): ERROR Error code is -36. Translation into English with nc_strerror(-36) is "NetCDF: Invalid argument"
nco_err_exit(): ERROR NCO will now exit with system call abort()
Abort trap: 6
zender@spectral:~/nco/data$ 

Metadata

Metadata

Assignees

Labels

area/nczarrnczarr related topics.

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions