Go to the documentation of this file.
8 #define DEFAULT_CHUNK_SIZE 1000
10 #define NEW_CACHE_SIZE 16000000
11 #define NEW_CACHE_NELEMS 2003
12 #define NEW_CACHE_PREEMPTION .75
18 fprintf(
stderr,
"-E- %s line %d: Could not set NetCDF4 cache size.\n", __FILE__, __LINE__);
38 size_t *chunksize,
int deflate_level) {
42 if (deflate_level < 1)
47 printf(
"Whoops! Refusing to chunk/compress more than 3 dimensions");
50 size_t suggested_size[3] = {32,256,40};
52 suggested_size[0] = 256;
53 suggested_size[1] = 2048;
57 if (chunksize==
NULL || chunksize[
i]==0) {
58 chunksize[
i] = suggested_size[
i];
60 status = nc_inq_dimlen(nc_id, dimids[
i], &dimlength);
62 fprintf(
stderr,
"-E- %s line %d: Could not read size of dimension.\n", __FILE__, __LINE__);
65 if(chunksize[
i] > dimlength)
66 chunksize[
i] = dimlength;
71 status = nc_def_var_chunking(nc_id, var_id, NC_CHUNKED, chunksize);
73 printf(
"-E- %s %d: %s \n", __FILE__, __LINE__,
78 status = nc_def_var_deflate(nc_id, var_id, NC_SHUFFLE, 9,
81 printf(
"-E- %s %d: %s \n", __FILE__, __LINE__,
93 for (d = 0; d < ndims; d++) {
94 if (chunksizes[d] < 1)
96 dprod *= (
double) chunksizes[d];
99 if (dprod > (
double) NC_MAX_UINT)
void nc_init_compress(int32_t nc_id, int32_t var_id, int32_t *dimids, int32_t rank, size_t *chunksize, int deflate_level)
#define NEW_CACHE_PREEMPTION
int check_chunksizes(size_t type_len, int32_t ndims, const size_t *chunksizes)
integer, parameter double
Extra metadata that will be written to the HDF4 file l2prod rank
void nc_init_chunk_cache()