Next: , Previous: NF_DEF_VAR_CHUNKING, Up: Variables


6.5 Learn About Chunking Parameters for a Variable: NF_INQ_VAR_CHUNKING

The function NF_INQ_VAR_CHUNKING returns the chunking settings for a variable in a netCDF-4 file.

Usage

     NF_INQ_VAR_CHUNKING(INTEGER NCID, INTEGER VARID, INTEGER STORAGE, INTEGER CHUNKSIZES);
NCID
NetCDF ID, from a previous call to NF_OPEN or NF_CREATE.
VARID
Variable ID.
STORAGE
On return, set to NF_CONTIGUOUS if this variable uses contiguous storage, NF_CHUNKED if it uses chunked storage.
CHUNKSIZES
An array of chunk sizes. The length of CHUNKSIZES must be the same as the number of dimensions of the variable.

Errors

NF_INQ_VAR_CHUNKING 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 from nf_test/ftst_vars.F, a variable with chunked storage is checked to ensure that the chunksizes are set to expected values.

     C     Is everything set that is supposed to be?
           retval = nf_inq_var_chunking(ncid, varid, storage, chunks_in)
           if (retval .ne. nf_noerr) call handle_err(retval)
           if (storage .ne. NF_CHUNKED) stop 2
           if (chunks(1) .ne. chunks_in(1)) stop 2
           if (chunks(2) .ne. chunks_in(2)) stop 2