Skip to content

Nccopy ignores chunk spec when input is netcdf-4 contiguous #725

@Dave-Allured

Description

@Dave-Allured

Environment

Linux and Mac, 64-bit
Version tested: nccopy with netcdf-C 4.4.1.1, hdf5-1.10.1

Summary

When using nccopy to convert a netcdf-4 file from contiguous to chunked, the chunk spec on the command line is ignored, and the output file contains invented chunk sizes. IMO, nccopy is not working as advertised in this case.

Remarkably, when the input file is chunked rather than contiguous, the command line chunk spec is respected. (Example not shown.)

Steps to reproduce

Test input file, 5.2 Mbytes: test31.contig.nc.gz

Run this command:

nccopy -d1 -c time/1,lat/180,lon/180 test31.contig.nc test33.chunked.nc

Input file header:

netcdf test31.contig {
dimensions:
	time = 40 ;
	lat = 180 ;
	lon = 180 ;
variables:
	float x(time, lat, lon) ;
		x:_Storage = "contiguous" ;
		x:_Endianness = "little" ;

// global attributes:
		:_NCProperties = "version=1|netcdflibversion=4.4.1.1|hdf5libversion=1.10.1" ;
		:_SuperblockVersion = 0 ;
		:_IsNetcdf4 = 1 ;
		:_Format = "netCDF-4" ;
}

Expected output chunk sizes:

		x:_ChunkSizes = 1, 180, 180 ;

Actual result with unexpected chunk sizes:

dimensions:
	time = 40 ;
	lat = 180 ;
	lon = 180 ;
variables:
	float x(time, lat, lon) ;
		x:_Storage = "chunked" ;
		x:_ChunkSizes = 20, 90, 90 ;
		x:_DeflateLevel = 1 ;
		x:_Endianness = "little" ;

// global attributes:
		:_NCProperties = "version=1|netcdflibversion=4.4.1.1|hdf5libversion=1.10.1" ;
		:_SuperblockVersion = 0 ;
		:_IsNetcdf4 = 1 ;
		:_Format = "netCDF-4" ;
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions