Next: , Previous: NF_DEF_VAR_DEFLATE, Up: Variables


6.11 Learn About Deflate Parameters for a Variable: NF_INQ_VAR_DEFLATE

The function NF_INQ_VAR_DEFLATE returns the deflate settings for a variable in a netCDF-4 file.

It is not necessary to know the deflate settings to read the variable. (Deflate is completely transparent to readers of the data).

Usage

     NF_INQ_VAR_DEFLATE(INTEGER NCID, INTEGER VARID, INTEGER SHUFFLE,
                        INTEGER DEFLATE, INTEGER DEFLATE_LEVEL);
NCID
NetCDF ID, from a previous call to NF_OPEN or NF_CREATE.
VARID
Variable ID.
SHUFFLE
NF_INQ_VAR_DEFLATE will set this to a 1 if the shuffle filter is turned on for this variable, and a 0 otherwise.
DEFLATE
NF_INQ_VAR_DEFLATE will set this to a 1 if the deflate filter is turned on for this variable, and a 0 otherwise.
DEFLATE_LEVEL
NF_INQ_VAR_DEFLATE function will write the deflate_level here, if deflate is in use.

Errors

NF_INQ_VAR_DEFLATE returns the value NF_NOERR if no errors occurred. Otherwise, the returned status indicates an error.

Possible return codes include:

NF_NOERR
No error.
NF_BADID
Bad ncid.
NF_ENOTNC4
Not a netCDF-4 file.
NF_ENOTVAR
Can't find this variable.

Example

In this example code from nf_test/ftst_vars.F, a file with a variable using deflate is opened, and the deflate level checked.

     C     Is everything set that is supposed to be?
           retval = nf_inq_var_deflate(ncid, varid, shuffle, deflate,
          +     deflate_level)
           if (retval .ne. nf_noerr) call handle_err(retval)
           if (shuffle .ne. 0 .or. deflate .ne. 1 .or.
          +     deflate_level .ne. 4) stop 2