Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

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 CONTIGUOUS, INTEGER CHUNKSIZES);
NCID
NetCDF ID, from a previous call to NF_OPEN or NF_CREATE.
VARID
Variable ID.
VARID
Set to 1 if this variable uses contiguous storage, 0 if it used 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 check 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, contiguous, chunks_in)
           if (retval .ne. nf_noerr) call handle_err(retval)
           if (contiguous .ne. 0) stop 2
           if (chunks(1) .ne. chunks_in(1)) stop 2
           if (chunks(2) .ne. chunks_in(2)) stop 2
 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Office of Programs University Corporation for Atmospheric Research (UCAR)   Unidata is a member of the UCAR Office of Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690