2011 Unidata NetCDF Workshop > Chunking and Deflating Data with NetCDF-4
14.11 Using Contiguous Variables
Use the nc_def_var_chunking function to make a variable contiguous.
- Turn this on with def_var_chunking. Set the third parameter
(contiguous) to a non-zero value to turn on contintigous storage for
this variable. (Pass NULL for the chunksizes.)
- This capability is provided for completeness - there is no need to
set contiguous storage, since it is the default choice for
fixed-sized variables without filters, and is not allowed for any
other variable.
- You must do this before the first enddef on the file (even an
implied one, for example when you write some data.)
/* Define chunking for a variable. This must be done after nc_def_var
and before nc_enddef. */
EXTERNL int
nc_def_var_chunking(int ncid, int varid, int contiguous, int
*chunksizesp);
- Matching inquiry function is use to retrieve current setting,
though it is transparent to readers of the data.
/* Inq chunking stuff for a var. */
EXTERNL int
nc_inq_var_chunking(int ncid, int varid, int *contiguousp, int *chunksizesp);
2011 Unidata NetCDF Workshop > Chunking and Deflating Data with NetCDF-4