Utilities
ClimaCore.Utilities.PlusHalf — Type
ClimaCore.Utilities.half — Constant
const half = PlusHalf(0)sourceUtilities.Cache
ClimaCore.Utilities.Cache — Module
Utilities.Cache
ClimaCore maintains an internal cache of topology and grid objects: this ensures that if the constructor with the same arguments is invoked again (e.g. by reading from a file), the cached object will be returned (also known as memoization). This has two main advantages:
topology and metric information can be reused, reducing memory usage.
it is easy to check if two fields live on the same grid: we can just check if the underlying grid objects are the same (
===), rather than checking all the fields are equal (via==).
However this means that objects in the cache will not be removed from the garbage collector, so we provide an interface to remove these.
sourceClimaCore.Utilities.Cache.cached_objects — Function
ClimaCore.Utilities.Cache.clean_cache! — Function
Utilities.Cache.clean_cache!(object)Remove object from the cache of created objects.
In most cases, this function should not need to be called, unless you are constructing many grid objects, for example when doing a sweep over grid paramaters.
sourceUtilities.Cache.clean_cache!()Remove all objects from the cache of created objects.
In most cases, this function should not need to be called, unless you are constructing many grid objects, for example when doing a sweep over grid paramaters.
source