API overview

ClimaCore is organized as one module per subsystem. A model is assembled from the bottom of this table up: a domain is meshed, the mesh gets a topology, the topology and a quadrature rule give a grid, a grid and a staggering give a space, and fields live on spaces.

ModuleProvides
DomainsThe continuous domain: intervals, rectangles, the sphere
MeshesElement meshes: intervals, rectilinear planes, the equiangular cubed sphere
TopologiesElement connectivity, including distributed (MPI) topologies
GeometryCoordinates, local geometry, covariant/contravariant/Cartesian vectors
QuadraturesGauss–Lobatto–Legendre and Gauss–Legendre nodes and weights
GridsSpectral-element, finite-difference, and extruded grids; the CG/DG switch
CommonGridsConvenience constructors for the standard grids
SpacesFunction spaces on grids; center/face staggering; DSS
CommonSpacesConvenience constructors for the standard spaces
FieldsField and FieldVector, the data containers and state vectors
DataLayoutsThe memory layouts behind fields
OperatorsSpectral-element, finite-difference, and DG operators; tendency completion
LimitersQuasi-monotone and mass-borrowing limiters
HypsographyTerrain-following vertical coordinates
MatrixFieldsBanded matrix fields and solvers for implicit vertical problems
RemappingInterpolation between spaces and to latitude–longitude grids
InputOutputHDF5 checkpoint writers and readers
UtilitiesHalf-integer indexing, caches, and other shared helpers
DebugOnlyHooks for locating NaNs and mismatched spaces

Export conventions

Only Domains, Meshes, Geometry, Quadratures, DataLayouts, Limiters, MatrixFields, Remapping, CommonGrids, and CommonSpaces export names. Everything in Spaces, Grids, Operators, Fields, Topologies, Hypsography, and InputOutput is called with its module qualifier, as in Spaces.SpectralElementSpace2D or Operators.GradientC2F. The usual import line is

import ClimaCore: Domains, Meshes, Topologies, Spaces, Fields, Geometry, Operators

Naming conventions

  • Finite-difference operators name the staggering they map between: C2F from cell centers to faces, F2C from faces to centers.
  • Spectral-element operators take a form-type parameter: Divergence() is the strong form and Divergence{WeakForm}() the weak form, and likewise for Gradient and Curl.
  • A trailing ! marks a function that mutates its first argument.
  • The Galerkin discretization of a spectral-element grid is Grids.CG() or Grids.DG(); Spaces.discretization(space) reads it back.