This function gets the current chunk cache settings for a variable in a netCDF-4/HDF5 file.
For more information, see the documentation for the H5Pget_cache() function in the HDF5 library at the HDF5 website: http://hdfgroup.org/HDF5/.
int nc_get_var_chunk_cache(int ncid, int varid, size_t *sizep, size_t *nelemsp, float *preemptionp);
ncid
varid
sizep
nelemsp
preemptionp
NC_NOERR
This example is from libsrc4/tst_vars2.c:
#include <netcdf.h> ... /* Create a netcdf-4 file with one dim and one var. */ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR; if (nc_def_dim(ncid, DIM5_NAME, DIM5_LEN, &dimids[0])) ERR; if (nc_def_var(ncid, VAR_NAME5, NC_INT, NDIMS5, dimids, &varid)) ERR; if (nc_def_var_chunking(ncid, varid, NC_CHUNKED, chunksize)) ERR; if (nc_set_var_chunk_cache(ncid, varid, CACHE_SIZE, CACHE_NELEMS, CACHE_PREEMPTION)) ERR; ... if (nc_get_var_chunk_cache(ncid, varid, &cache_size_in, &cache_nelems_in, &cache_preemption_in)) ERR; if (cache_size_in != CACHE_SIZE || cache_nelems_in != CACHE_NELEMS || cache_preemption_in != CACHE_PREEMPTION) ERR; ...