Next: , Previous: NF90_INQ_VAR_CHUNKING, Up: Variables



6.6 Define Compression Parameters for a Variable: NF90_DEF_VAR_DEFLATE

The function NF90_DEF_VAR_DEFLATE sets the deflate parameters for a variable in a netCDF-4 file.

This function must be called after the variable is defined, but before NC_ENDDEF is called.

Usage

       function nf90_def_var_deflate(ncid, varid, shuffle, deflate, deflate_level)
         integer, intent(in) :: ncid
         integer, intent(in) :: varid
         integer, intent(in) :: shuffle
         integer, intent(in) :: deflate
         integer, intent(in) :: deflate_level
         integer :: nf90_def_var_deflate
NCID
NetCDF ID, from a previous call to NF90_OPEN or NF90_CREATE.
VARID
Variable ID.
SHUFFLE
If non-zero, turn on the shuffle filter.
DEFLATE
If non-zero, turn on the deflate filter at the level specified by the deflate_level parameter.
DEFLATE_LEVEL
If the deflate parameter is non-zero, set the deflate level to this value. Must be between 0 and 9.

Errors

NF90_DEF_VAR_DEFLATE returns the value NF90_NOERR if no errors occurred. Otherwise, the returned status indicates an error.

Possible return codes include:

NF90_NOERR
No error.
NF90_BADID
Bad ncid.
NF90_ENOTNC4
Not a netCDF-4 file.
NF90_ENOTVAR
Can't find this variable.
NF90_ELATEDEF
This variable has already been the subject of a NC_ENDDEF call. In netCDF-4 files NC_ENDDEF will be called automatically for any data read or write. Once enddef has been called, it is impossible to set the deflate for a variable.
NF90_ENOTINDEFINE
Not in define mode. This is returned for netCDF classic or 64-bit offset files, or for netCDF-4 files, when they were been created with NF90_STRICT_NC3 flag. (see NF90_CREATE).
NF90_EPERM
Attempt to create object in read-only file.
NF90_EINVAL
Invalid deflate_level. The deflate level must be between 0 and 9, inclusive.

Example