GPU-capable dynamical core for the CliMA Earth System Model: spectral-element and finite-difference discretization tools
117
stars
3,569
commits
Julia
primary language
Sep 11, 2026
updated
The dynamical core (dycore) of the CliMA Earth System Model: composable, GPU-capable tools for discretizing and solving partial differential equations on the sphere and in Cartesian domains.
ClimaCore.jl provides the spatial discretization building blocks for the Climate Modeling Alliance (CliMA) Earth System Model, which is written entirely in Julia. It pairs a high-level API for composing differential operators and defining flexible discretizations with low-level APIs for data layouts, specialized implementations, and threading — targeting both CPU and GPU architectures from a single codebase.
Field abstraction: scalar-, vector-, or struct-valued fields carrying values, geometry, and mesh information, with flexible memory layouts (AoS, SoA, AoSoA) and useful overloads (sum, norm, ...).grad, div, interpolate, ...) act like functions when broadcast over a Field, fusing operators and function calls into a single pass.Fields and FieldVectors act as the state vector for ClimaTimeSteppers, which the tests and examples here time-step with.import ClimaComms
ClimaComms.@import_required_backends
import ClimaCore: Domains, Meshes, Spaces, Fields, Geometry, Operators
FT = Float64
# Build a 1D column: interval domain -> mesh -> finite-difference space
domain = Domains.IntervalDomain(
Geometry.ZPoint{FT}(0),
Geometry.ZPoint{FT}(2π),
boundary_names = (:bottom, :top),
)
mesh = Meshes.IntervalMesh(domain; nelems = 128)
space = Spaces.CenterFiniteDifferenceSpace(ClimaComms.device(), mesh)
# Define a field over the space and differentiate it with a composed operator
z = Fields.coordinate_field(space).z
θ = sin.(z)
grad = Operators.GradientC2F(
bottom = Operators.SetValue(FT(0)),
top = Operators.SetValue(FT(0)),
)
∂θ = @. Geometry.WVector(grad(θ)) # face-valued vertical gradient (≈ cos(z))
More runnable examples (column, plane, and sphere configurations) are in the examples/ directory.
examples/ — runnable examples across geometriesClimaCore.jl is the dynamical core used throughout the CliMA ecosystem, including:
Contributors should follow the shared CliMA engineering standards in docs/dev-guides/, which cover architecture, performance, code quality, documentation, and workflows. These are vendored from CliMA/DeveloperGuides. The repo's AGENTS.md is a starting point for AI agents with repo-specific guidance.
(top 30 of 42)
Julia
99.8%
GPU-capable dynamical core for the CliMA Earth System Model: spectral-element and finite-difference discretization tools
117
stars
3,569
commits
Julia
primary language
Sep 11, 2026
updated
The dynamical core (dycore) of the CliMA Earth System Model: composable, GPU-capable tools for discretizing and solving partial differential equations on the sphere and in Cartesian domains.
ClimaCore.jl provides the spatial discretization building blocks for the Climate Modeling Alliance (CliMA) Earth System Model, which is written entirely in Julia. It pairs a high-level API for composing differential operators and defining flexible discretizations with low-level APIs for data layouts, specialized implementations, and threading — targeting both CPU and GPU architectures from a single codebase.
Field abstraction: scalar-, vector-, or struct-valued fields carrying values, geometry, and mesh information, with flexible memory layouts (AoS, SoA, AoSoA) and useful overloads (sum, norm, ...).grad, div, interpolate, ...) act like functions when broadcast over a Field, fusing operators and function calls into a single pass.Fields and FieldVectors act as the state vector for ClimaTimeSteppers, which the tests and examples here time-step with.import ClimaComms
ClimaComms.@import_required_backends
import ClimaCore: Domains, Meshes, Spaces, Fields, Geometry, Operators
FT = Float64
# Build a 1D column: interval domain -> mesh -> finite-difference space
domain = Domains.IntervalDomain(
Geometry.ZPoint{FT}(0),
Geometry.ZPoint{FT}(2π),
boundary_names = (:bottom, :top),
)
mesh = Meshes.IntervalMesh(domain; nelems = 128)
space = Spaces.CenterFiniteDifferenceSpace(ClimaComms.device(), mesh)
# Define a field over the space and differentiate it with a composed operator
z = Fields.coordinate_field(space).z
θ = sin.(z)
grad = Operators.GradientC2F(
bottom = Operators.SetValue(FT(0)),
top = Operators.SetValue(FT(0)),
)
∂θ = @. Geometry.WVector(grad(θ)) # face-valued vertical gradient (≈ cos(z))
More runnable examples (column, plane, and sphere configurations) are in the examples/ directory.
examples/ — runnable examples across geometriesClimaCore.jl is the dynamical core used throughout the CliMA ecosystem, including:
Contributors should follow the shared CliMA engineering standards in docs/dev-guides/, which cover architecture, performance, code quality, documentation, and workflows. These are vendored from CliMA/DeveloperGuides. The repo's AGENTS.md is a starting point for AI agents with repo-specific guidance.
(top 30 of 42)
Julia
99.8%