Project

General

Profile

"Unsupported netCDF4 structure"

Added by Clement Tisseuil over 13 years ago

Dear all,

I am trying to read a NetCDF4 file using CDO, which has been previously built using another software (package ncdf4 for R statistical software). It seems that CDO cannot read this file because of "Unsupported netCDF4 structure".

When using ncdump, the file structure looks like :

ncdump -h writevals.nc
netcdf writevals {
dimensions:
X = 5 ;
Y = 10 ;
Time = UNLIMITED ; // (100 currently)
variables:
int X(X) ;
X:units = "meters" ;
X:long_name = "X" ;
int Y(Y) ;
Y:units = "meters" ;
Y:long_name = "Y" ;
int Time(Time) ;
Time:units = "seconds" ;
Time:long_name = "Time" ;
Time:calendar = "gregorian" ;
float var3d(Time, Y, X) ;
var3d:units = "units" ;
var3d:missing_value = 1.e+30f ;
}

Do you have any ideas which could make my file readable by CDO ?

Thanks in advance

Cheers

Clement


Replies (6)

RE: "Unsupported netCDF4 structure" - Added by Clement Tisseuil over 13 years ago

Sorry for the ncdump output... Should be better like this:

ncdump -h writevals.nc
netcdf writevals {
dimensions:
X = 5 ;
Y = 10 ;
Time = UNLIMITED ; // (100 currently)
variables:
int X(X) ;
X:units = "meters" ;
X:long_name = "X" ;
int Y(Y) ;
Y:units = "meters" ;
Y:long_name = "Y" ;
int Time(Time) ;
Time:units = "seconds" ;
Time:long_name = "Time" ;
Time:calendar = "gregorian" ;
float var3d(Time, Y, X) ;
var3d:units = "units" ;
var3d:missing_value = 1.e+30f ;
}

Clement Tisseuil wrote:

Dear all,

I am trying to read a NetCDF4 file using CDO, which has been previously built using another software (package ncdf4 for R statistical software). It seems that CDO cannot read this file because of "Unsupported netCDF4 structure".

When using ncdump, the file structure looks like :

ncdump -h writevals.nc
netcdf writevals {
dimensions:
X = 5 ;
Y = 10 ;
Time = UNLIMITED ; // (100 currently)
variables:
int X(X) ;
X:units = "meters" ;
X:long_name = "X" ;
int Y(Y) ;
Y:units = "meters" ;
Y:long_name = "Y" ;
int Time(Time) ;
Time:units = "seconds" ;
Time:long_name = "Time" ;
Time:calendar = "gregorian" ;
float var3d(Time, Y, X) ;
var3d:units = "units" ;
var3d:missing_value = 1.e+30f ;
}

Do you have any ideas which could make my file readable by CDO ?

Thanks in advance

Cheers

Clement

RE: "Unsupported netCDF4 structure" - Added by Uwe Schulzweida over 13 years ago

Hi Clement,

CDO supports only netCDF4 files with the classic netCDF data model. To make sure that the netCDF file follow this data model you have to set the NC_NETCDF4 and the NC_CLASSIC_MODEL mode during the creation of a netCDF4 file. Your netCDF4 file was not created with the NC_CLASSIC_MODEL mode flag. Here is the description of this flag:

Setting NC_CLASSIC_MODEL causes netCDF to enforce the classic data model in this file. (This only has effect for netCDF-4/HDF5 files, as classic and 64-bit offset files always use the classic model.) When used with NC_NETCDF4, this flag ensures that the resulting netCDF-4/HDF5 file may never contain any new constructs from the enhanced data model. That is, it cannot contain groups, user defined types, multiple unlimited dimensions, or new atomic types. The advantage of this restriction is that such files are guaranteed to work with existing netCDF software.

The next CDO release will not have this restriction. If you like you can test it with the attached CDO version.

Best regards,
Uwe

RE: "Unsupported netCDF4 structure" - Added by Clement Tisseuil over 13 years ago

Excellent this new version work perfectly !

Thank you very much.

Cheers

RE: "Unsupported netCDF4 structure" - Added by Oliver Angelil about 7 years ago

I know CDO now supports netcdf4, but can it also deal with groups with a netcdf4 file?

Thanks.

RE: "Unsupported netCDF4 structure" - Added by Oliver Angelil about 7 years ago

Specifically, is it possible to select a variable after selecting its group, and apply an operation to it? Something like:

cdo output -selvar,var_name -selgrp,grp_name file.nc

RE: "Unsupported netCDF4 structure" - Added by Uwe Schulzweida about 7 years ago

CDO supports only the NetCDF classic data model, groups are not supported yet.

    (1-6/6)