Passive Tracers

ClimaAtmos provides automatic treatment of conserved scalar tracers at two levels: grid-scale (resolved) and sub-grid scale (SGS, inside PROPHET updrafts). Both levels use an auto-discovery mechanism: any field that follows the naming convention is automatically picked up for transport, diffusion, and other generic operations; no additional code changes are required.

Grid-Scale Tracers

Grid-scale tracers are density-weighted scalars $\rho \chi$ stored at cell centers in the prognostic state Y.c.

Naming convention

A grid-scale tracer is identified by a name that starts with ρ followed by the scalar name, e.g. ρq_tot, ρq_lcl, ρn_rai. The utility function gs_tracer_names(Y) discovers all such tracers automatically by keeping only top-level ρ-prefixed names in Y.c (the is_ρ_weighted_name predicate, which already excludes uₕ and sgsʲs) and then excluding ρ, ρe_tot, and ρtke.

Automatically handled operations

OperationDescription
Horizontal advectionFlux-form divergence of $\rho \chi \boldsymbol{u}_h$
Vertical advectionUpwinded vertical transport
Vertical diffusionEddy-diffusivity-based mixing
Hyperdiffusion4th-order $\nabla^4$ stabilization with DSS

The iteration utility foreach_gs_tracer(f, Y...) applies a function f to each discovered tracer.

SGS Tracers (PROPHET)

When PROPHET (prognostic EDMF) is enabled, each updraft carries its own set of scalar fields inside Y.c.sgsʲs.:(j). The utility function sgs_tracer_names(Y) discovers all scalars in the first updraft (Y.c.sgsʲs.:(1)) and excludes the core PROPHET variables ρa, mse, and q_tot, which receive physics-specific treatment.

Naming convention

An SGS tracer χ in Y.c.sgsʲs.:(j) maps to a grid-scale density-weighted counterpart ρχ in Y.c. For example:

SGS field (in sgsʲs.:(j))Grid-scale field (in Y.c)
q_lclρq_lcl
q_raiρq_rai
n_raiρn_rai
A (user-defined)ρA

This pairing is enforced by get_ρχ_name(χ_name), which constructs ρχ from χ.

Automatically handled operations

The following operations are auto-discovered for all SGS tracers. No code changes are needed when adding a new tracer:

OperationFilePattern
Horizontal advectionadvection.jlfor χ_name in sgs_tracer_names(Y)
Vertical advection (advective form)advection.jlfor χ_name in sgs_tracer_names(Y)
Entrainment/detrainment mixingedmfx_entr_detr.jlfor χ_name in sgs_tracer_names(Y)
SGS mass flux (draft + environment → grid mean)edmfx_sgs_flux.jlfor χ_name in sgs_tracer_names(Y)
SGS diffusive flux (grid mean)edmfx_sgs_flux.jlforeach_gs_tracer(Yₜ, Y)
SGS hyperdiffusionhyperdiffusion.jlfor χ_name in sgs_tracer_names(Y)
Updraft constraint enforcementmass_flux_closures.jlfor χ_name in sgs_tracer_names(Y)
Rayleigh sponge dampingremaining_tendency.jlfor χ_name in sgs_tracer_names(Y)

Sedimenting microphysics species are diffused with the reduced coefficient α_vert_diff_microphysics * K_h; passive tracers use the unscaled K_h.

Adding a new passive tracer

Adding a tracer is developer territory; see Adding a Passive Tracer in the Developer Guide.