Skip to content

Unable to write unsigned int8 variable in netcdf4 file (non-netcdf3 type) #481

@durack1

Description

@durack1

It appears that something is going awry with writing netcdf4 data types. When I try to write a byte (uint8) variable to a file, I get the standard netcdf library error:
'cdunif: NetCDF: Attempting netcdf-4 operation on strict nc3 netcdf-4 file'

I'm wondering if this has any relationship with #406

If the write statement is dropped into a try Write: except Pass block it seems to write at the second attempt, placed after this try/except block.

The written file looks something like below:

      [durack1@oceanonly WOD13]$ ncdump -h WOD13_masks.nc
      netcdf WOD13_masks {
      dimensions:
              depth = 102 ;
              bound = 2 ;
              latitude = 180 ;
              longitude = 360 ;
      variables:
              float depth(depth) ;
                      depth:bounds = "bounds_depth" ;
              double bounds_depth(depth, bound) ;
              float latitude(latitude) ;
                      latitude:bounds = "bounds_latitude" ;
                      latitude:axis = "Y" ;
              double bounds_latitude(latitude, bound) ;
              float longitude(longitude) ;
                      longitude:bounds = "bounds_longitude" ;
                      longitude:axis = "X" ;
                      longitude:modulo = 360. ;
                      longitude:topology = "circular" ;
              double bounds_longitude(longitude, bound) ;
              byte basinmask(depth, latitude, longitude) ;
                      basinmask:missing_value = 125b ;

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions