Utilities

Utilities.PlusHalf

ClimaCore.Utilities.PlusHalfType
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.

source

Utilities.Cache

ClimaCore.Utilities.CacheModule
Utilities.Cache

Module 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:

  1. Topology and metric information is reused, reducing memory usage.
  2. 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.

source
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.

source
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.

source