CliMA/ClimaCore.jl

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

clima.github.io/ClimaCore.jl/dev
climate-modeling
dynamical-core
earth-system-model
finite-difference
gpu
high-performance-computing
julia
numerical-methods
pde
scientific-computing
spectral-elements

README

ClimaCore.jl Logo

ClimaCore.jl

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.

Documentationstable dev
Versionversion
Licenselicense
Testsgha ci buildkite
Code Coveragecodecov
DownloadsDownloads
DOIzenodo

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.

Features

  • Spectral-element horizontal discretizations: continuous (CG) and discontinuous (DG) Galerkin spectral elements.
  • Flexible vertical discretization: staggered finite differences on center/face grids.
  • Multiple geometries: Cartesian and spherical domains, with governing equations expressed in covariant vectors for curvilinear systems and Cartesian vectors for Euclidean spaces.
  • 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, ...).
  • Composable operators via broadcasting: differential operators (grad, div, interpolate, ...) act like functions when broadcast over a Field, fusing operators and function calls into a single pass.
  • GPU acceleration: broadcast expressions compile to custom CUDA kernels, with specialization on polynomial degree for kernel performance.
  • Time-stepper compatible: Fields and FieldVectors act as the state vector for ClimaTimeSteppers, which the tests and examples here time-step with.

Quick Example

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.

Documentation

  • Stable docs — installation, introduction, mathematical framework, and API reference
  • Dev docs — latest development version
  • examples/ — runnable examples across geometries

Integration with CliMA models

ClimaCore.jl is the dynamical core used throughout the CliMA ecosystem, including:

Contributing

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.

Contributors

(top 30 of 42)

charleskawczynski

1,088 commits

bors[bot]

834 commits

simonbyrne

493 commits

Sbozzolo

185 commits

CliMA/ClimaCore.jl

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

clima.github.io/ClimaCore.jl/dev
climate-modeling
dynamical-core
earth-system-model
finite-difference
gpu
high-performance-computing
julia
numerical-methods
pde
scientific-computing
spectral-elements

README

ClimaCore.jl Logo

ClimaCore.jl

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.

Documentationstable dev
Versionversion
Licenselicense
Testsgha ci buildkite
Code Coveragecodecov
DownloadsDownloads
DOIzenodo

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.

Features

  • Spectral-element horizontal discretizations: continuous (CG) and discontinuous (DG) Galerkin spectral elements.
  • Flexible vertical discretization: staggered finite differences on center/face grids.
  • Multiple geometries: Cartesian and spherical domains, with governing equations expressed in covariant vectors for curvilinear systems and Cartesian vectors for Euclidean spaces.
  • 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, ...).
  • Composable operators via broadcasting: differential operators (grad, div, interpolate, ...) act like functions when broadcast over a Field, fusing operators and function calls into a single pass.
  • GPU acceleration: broadcast expressions compile to custom CUDA kernels, with specialization on polynomial degree for kernel performance.
  • Time-stepper compatible: Fields and FieldVectors act as the state vector for ClimaTimeSteppers, which the tests and examples here time-step with.

Quick Example

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.

Documentation

  • Stable docs — installation, introduction, mathematical framework, and API reference
  • Dev docs — latest development version
  • examples/ — runnable examples across geometries

Integration with CliMA models

ClimaCore.jl is the dynamical core used throughout the CliMA ecosystem, including:

Contributing

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.

Contributors

(top 30 of 42)

charleskawczynski

1,088 commits

bors[bot]

834 commits

simonbyrne

493 commits

Sbozzolo

185 commits

Languages

Julia

99.8%