/* Pick a chunk length for each dimension. */ for (d = 0; d < var->ndims; d++) if (var->dim[d]->unlimited) var->chunksizes[d] = 1; else { var->chunksizes[d] = (pow((double)DEFAULT_CHUNK_SIZE/(num_values * type_size), 1/(double)(var->ndims - num_unlim)) * var->dim[d]->len + .5); if (var->chunksizes[d] > var->dim[d]->len) var->chunksizes[d] = var->dim[d]->len; }
/* 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 *chunkalgp, int *chunksizesp, int *extend_incrementsp); /* Inq chunking stuff for a var. */ EXTERNL int nc_inq_var_chunking(int ncid, int varid, int *chunkalgp, int *chunksizesp, int *extend_incrementsp);