Skip to content

Issue creating zarr from datasets with string variables #2259

@malmans2

Description

@malmans2

I'm having troubles creating a NCZarr from datasets with string variables.

Here is the test dataset: test_string_dim.nc.zip
Here are the commands that illustrate the problem:

>> nc-config --version
netCDF 4.8.1

>> ncdump -h test_string_dim.nc
netcdf test_string_dim {
dimensions:
	dim2 = 9 ;
	dim3 = 10 ;
	time = 20 ;
	dim1 = 8 ;
variables:
	double dim2(dim2) ;
		dim2:_FillValue = NaN ;
	string dim3(dim3) ;
	int64 time(time) ;
		time:units = "days since 2000-01-01 00:00:00" ;
		time:calendar = "proleptic_gregorian" ;
	double var1(dim1, dim2) ;
		var1:_FillValue = NaN ;
		var1:foo = "variable" ;
	double var2(dim1, dim2) ;
		var2:_FillValue = NaN ;
		var2:foo = "variable" ;
	double var3(dim3, dim1) ;
		var3:_FillValue = NaN ;
		var3:foo = "variable" ;
		var3:coordinates = "numbers" ;
	int64 numbers(dim3) ;
}

# Error
>> nccopy test_string_dim.nc file://test_string_dim.zarr#mode=nczarr
NetCDF: Invalid argument
Location: file ; line 2121

# Bypass error dropping dim3 variable
>> nccopy -V var1,var2,var3,time,dim2 test_string_dim.nc file://test_string_dim_no_dim3.zarr#mode=nczarr
>> ncdump -h file://test_string_dim_no_dim3.zarr#mode=nczarr
netcdf test_string_dim_no_dim3 {
dimensions:
	dim2 = 9 ;
	dim3 = 10 ;
	time = 20 ;
	dim1 = 8 ;
variables:
	double dim2(dim2) ;
		dim2:_FillValue = NaN ;
	int64 time(time) ;
		time:units = "days since 2000-01-01 00:00:00" ;
		time:calendar = "proleptic_gregorian" ;
	double var1(dim1, dim2) ;
		var1:_FillValue = NaN ;
		var1:foo = "variable" ;
	double var2(dim1, dim2) ;
		var2:_FillValue = NaN ;
		var2:foo = "variable" ;
	double var3(dim3, dim1) ;
		var3:_FillValue = NaN ;
		var3:foo = "variable" ;
		var3:coordinates = "numbers" ;
	int64 numbers(dim3) ;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions