Project

General

Profile

error creating nc4 w/zip compression, due to bug in dimension error checking

Added by Etienne Tourigny about 13 years ago

Greetings,

when trying to create a NC4 zip compressed file, I get the following error:

Warning (cdfDefVar) : Deflate compression is only available for netCDF4!

I traced the error to the following line in libcdi/src/stream_cdf.c

if ( streamptr->comptype == COMPRESS_ZIP )
    {
      if ( lchunk && (streamptr->filetype == FILETYPE_NC4 || streamptr->filetype == FILETYPE_NC4C) )

The problem is that lchunk is set to FALSE in the following statement (dimension checking).

By commenting this line, I am able to create a compressed file that seems valid, so what is the deal?

  if ( dimorder[0] == 3 ) lchunk = FALSE; /\* ZYX and ZXY *\

The file (created by cdo) has dimensions (time,latitude,longitude), and the computed dimorder values are [3,2,1].

I can create the file as type NC or type NC4 (uncompressed) without any problems.

netcdf trmm-nc {
dimensions:
    longitude = 40 ;
    latitude = 40 ;
    time = UNLIMITED ; // (1 currently)
variables:
    double longitude(longitude) ;
        longitude:standard_name = "longitude" ;
        longitude:long_name = "Longitude" ;
        longitude:units = "degrees_east" ;
        longitude:axis = "X" ;
    double latitude(latitude) ;
        latitude:standard_name = "latitude" ;
        latitude:long_name = "Latitude" ;
        latitude:units = "degrees_north" ;
        latitude:axis = "Y" ;
    double time(time) ;
        time:standard_name = "time" ;
        time:units = "hours since 2011-01-01 00:00:00" ;
        time:calendar = "standard" ;
    float pcp(time, latitude, longitude) ;
..

Regards,
Etienne

trmm.nc (8.75 KB) trmm.nc original file
trmm-nc4-zip.nc (18.8 KB) trmm-nc4-zip.nc file created after the fix
trmm-nc4-nozip.nc (20.2 KB) trmm-nc4-nozip.nc file created before the fix (with warning)

Replies (2)

RE: error creating nc4 w/zip compression, due to bug in dimension error checking - Added by Uwe Schulzweida about 13 years ago

Hi Etienne,

thanks for this report! This bug was introduced in CDO version 1.5.2 and is already fixed (#1497) for the next release.

Best regards,
Uwe

RE: error creating nc4 w/zip compression, due to bug in dimension error checking - Added by Etienne Tourigny about 13 years ago

Uwe,

sorry I missed the bug report and thanks for fixing it!
Etienne

    (1-2/2)