diff --git a/ChangeLog b/ChangeLog index 4f20705eb15fa9c088073214c365aba40ca334df..a0f138e77dddff1e156d28a3e713937f5212efc2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2022-10-16 Uwe Schulzweida * Added environment variable CDI_CHUNK_CACHE to set the NetCDF4 chunk cache size + * Added environment variable CDI_CHUNK_CACHE_MAX to set the maximum chunk cache size 2022-10-14 Uwe Schulzweida diff --git a/doc/tex/environment.tex b/doc/tex/environment.tex index a2b98254b3b465368f4be6066d502b59e71d4220..d5140a13c0c20fef56d9c4a9ac6890846f67224b 100644 --- a/doc/tex/environment.tex +++ b/doc/tex/environment.tex @@ -12,6 +12,7 @@ The following table describes the environment variables that affect {\CDI}. {\bfseries Variable name} & {\bfseries Default} & {\bfseries Description} \\ \hline CDI\_CONVERT\_CUBESPHERE & 1 & Convert cubed-sphere data to unstructured grid. \\ CDI\_CHUNK\_CACHE & 0 & Set the NetCDF4 chunk cache size. \\ +CDI\_CHUNK\_CACHE\_MAX & 0 & Set maximum chunk cache size. \\ CDI\_GRIB1\_TEMPLATE & None & Path to a GRIB1 template file for GRIB\_API. \\ CDI\_GRIB2\_TEMPLATE & None & Path to a GRIB2 template file for GRIB\_API. \\ CDI\_INVENTORY\_MODE & None & Set to time to skip double variable entries. \\ diff --git a/src/cdi_int.c b/src/cdi_int.c index 683373c8805478d30422b8d71949a6cf08fbb371..16cc2b97f519a166d264fcd788eafb6b2e723e83 100644 --- a/src/cdi_int.c +++ b/src/cdi_int.c @@ -40,6 +40,7 @@ int CDI_CMOR_Mode = 0; int CDI_Reduce_Dim = 0; size_t CDI_Netcdf_Hdr_Pad = 0UL; size_t CDI_Chunk_Cache = 0UL; +size_t CDI_Chunk_Cache_Max = 0UL; bool CDI_Netcdf_Lazy_Grid_Load = false; char *cdiPartabPath = NULL; @@ -367,6 +368,9 @@ cdiInitialize(void) value = cdi_getenv_int("CDI_CHUNK_CACHE"); if (value >= 0) CDI_Chunk_Cache = (size_t) value; + value = cdi_getenv_int("CDI_CHUNK_CACHE_MAX"); + if (value >= 0) CDI_Chunk_Cache_Max = (size_t) value; + envstr = getenv("CDI_GRIB1_TEMPLATE"); if (envstr) CDI_GRIB1_Template = envstr; diff --git a/src/cdi_int.h b/src/cdi_int.h index 9767ae25dfd5e9f533cc74c149b599b25ca08340..be23d8b5888d3f13e4d013128d8ff727a4dd9303 100644 --- a/src/cdi_int.h +++ b/src/cdi_int.h @@ -379,6 +379,7 @@ extern int CDI_CMOR_Mode; extern int CDI_Reduce_Dim; extern size_t CDI_Netcdf_Hdr_Pad; extern size_t CDI_Chunk_Cache; +extern size_t CDI_Chunk_Cache_Max; extern bool CDI_Netcdf_Lazy_Grid_Load; extern int STREAM_Debug;