Grids

ClimaAtmos.jl provides several grid constructors that set up the domain layout for a simulation. They create the underlying ClimaCore meshes, topologies, and spaces, including optional topography.

Available grids

SphereGrid

The SphereGrid creates a grid on a cubed-sphere domain, suitable for global atmospheric simulations.

using ClimaAtmos
grid = SphereGrid(
    Float64;
    z_elem = 10,
    radius = 6.371229e6,
    h_elem = 6,
)
ExtrudedFiniteDifferenceGrid:
  horizontal:
    context: SingletonCommsContext using CPUSingleThreaded
    mesh: 6×6×6-element EquiangularCubedSphere of SphereDomain: radius = 6.371229e6
    quadrature: 4-point Gauss-Legendre-Lobatto quadrature
  vertical:
    mesh: 10-element IntervalMesh of IntervalDomain: z ∈ [0.0,30000.0] (:bottom, :top)

BoxGrid

The BoxGrid creates a 3D Cartesian box grid.

grid = BoxGrid(
    Float64;
    x_elem = 6,
    x_max = 300000.0,
    y_elem = 6,
    y_max = 300000.0,
    z_elem = 10,
    z_max = 30000.0,
)
ExtrudedFiniteDifferenceGrid:
  horizontal:
    context: SingletonCommsContext using CPUSingleThreaded
    mesh: 6×6-element RectilinearMesh of RectangleDomain: x ∈ [0.0,300000.0] (periodic) × y ∈ [0.0,300000.0] (periodic)
    quadrature: 4-point Gauss-Legendre-Lobatto quadrature
  vertical:
    mesh: 10-element IntervalMesh of IntervalDomain: z ∈ [0.0,30000.0] (:bottom, :top)

ColumnGrid

The ColumnGrid creates a single-column grid, used for single-column models (SCM).

grid = ColumnGrid(
    Float64;
    z_elem = 10,
    z_max = 30000.0,
)
FiniteDifferenceGrid:
  vertical:
    mesh: 10-element IntervalMesh of IntervalDomain: z ∈ [0.0,30000.0] (:bottom, :top)

PlaneGrid

The PlaneGrid creates a 2D (x-z) plane grid.

grid = PlaneGrid(
    Float64;
    x_elem = 6,
    x_max = 300000.0,
    z_elem = 10,
    z_max = 30000.0,
)
ExtrudedFiniteDifferenceGrid:
  horizontal:
    context: SingletonCommsContext using CPUSingleThreaded
    mesh: 6-element IntervalMesh of IntervalDomain: x ∈ [0.0,300000.0] (periodic)
    quadrature: 4-point Gauss-Legendre-Lobatto quadrature
  vertical:
    mesh: 10-element IntervalMesh of IntervalDomain: z ∈ [0.0,30000.0] (:bottom, :top)

Mesh ordering

Elements are numbered along a space-filling curve so that spatial neighbors are memory neighbors and each MPI rank owns a compact patch; ClimaCore's Run distributed with MPI shows the curve and how it is cut across ranks.