Utilities
Utilities.PlusHalf
ClimaCore.Utilities.PlusHalf — Type
PlusHalf(i)Number representing i + 1/2, stored internally as the integer i. Used for indexing into staggered finite difference meshes: by convention, half-integer indices refer to cell faces and integer indices refer to cell centers.
Supports +, -, min, max, and inequalities.
See also half.
ClimaCore.Utilities.half — Constant
halfThe constant PlusHalf(0), representing the index 1/2; i + half is the PlusHalf index i + 1/2.
Utilities.Cache
ClimaCore.Utilities.Cache — Module
Utilities.CacheModule that maintains ClimaCore's internal cache of topology and grid objects. When a constructor is invoked again with the same arguments (e.g., when reading from a file), the cached object is returned (memoization). This has two advantages:
- Topology and metric information is reused, reducing memory usage.
- Two fields can be checked to live on the same grid by comparing the underlying grid objects with
===, rather than comparing all of their fields with==.
Objects in the cache are never garbage collected, so the module provides clean_cache! to remove them.
ClimaCore.Utilities.Cache.cached_objects — Function
cached_objects()Return a vector of all currently cached objects, without duplicates.
ClimaCore.Utilities.Cache.clean_cache! — Function
clean_cache!(object)Remove object from the cache of created objects and return nothing.
This function only needs to be called when constructing many grid objects, for example during a sweep over grid parameters.
clean_cache!()Remove all objects from the cache of created objects and return nothing.
This function only needs to be called when constructing many grid objects, for example during a sweep over grid parameters.