API Documentation
Public API
Breeze.Breeze — Module
Julia package for finite-volume GPU and CPU large eddy simulations (LES) of atmospheric flows. The abstractions, design, and finite-volume engine are based on Oceananigans.
Advection
AnelasticEquations
Breeze.AnelasticEquations — Module
AnelasticEquationsModule implementing anelastic dynamics for atmosphere models.
The anelastic approximation filters acoustic waves by assuming density and pressure are small perturbations from a dry, hydrostatic, adiabatic reference state. The key constraint is that mass flux divergence vanishes:
\[\boldsymbol{\nabla} ⋅ (ρᵣ \boldsymbol{u}) = 0\]
Breeze.AnelasticEquations.AnelasticDynamics — Method
AnelasticDynamics(
reference_state
) -> AnelasticDynamics{_A, Nothing} where _A
Return AnelasticDynamics representing incompressible fluid dynamics expanded about reference_state.
AtmosphereModels
Breeze.AtmosphereModels.AbstractMicrophysicalState — Type
AbstractMicrophysicalState{FT}Abstract supertype for microphysical state structs.
Microphysical states encapsulate the local microphysical variables (e.g., cloud liquid, rain, droplet number) needed to compute tendencies. This abstraction enables the same tendency functions to work for both grid-based LES and Lagrangian parcel models.
Concrete subtypes should be immutable structs containing the relevant mixing ratios and number concentrations for a given microphysics scheme.
For example, a warm-phase one-moment scheme might define a state with cloud liquid and rain mixing ratios (qᶜˡ, qʳ).
See also microphysical_state, microphysical_tendency.
Breeze.AtmosphereModels.AbstractNegativeMoistureCorrection — Type
abstract type AbstractNegativeMoistureCorrectionAbstract supertype for negative moisture correction schemes.
See fix_negative_moisture! for details.
Breeze.AtmosphereModels.AbstractNumberConcentrationCategories — Type
abstract type AbstractNumberConcentrationCategoriesAbstract supertype for microphysics categories that track number concentrations (e.g. two-moment schemes, aerosol-aware schemes).
Subtypes opt in to number concentration corrections (orphan zeroing and clamping) in the negative moisture correction. Schemes should extend correction_number_mass_pairs and correction_number_fields for their specific prognostic number fields.
Breeze.AtmosphereModels.AbstractSolarPosition — Type
abstract type AbstractSolarPositionAbstract supertype for solar-position specifications passed to RadiativeTransferModel. Concrete subtypes determine how cos(θ_z) is computed on each radiation update:
ApparentSolarPosition— real-Earth time-varying, computed from the model clock and grid (or explicit) longitude/latitude.DiurnalSolarPosition— idealized diurnal cycle at a fixed latitude and declination, no calendar dependence.FixedCosineZenith— constant cos(θ_z), clock-independent.
Breeze.AtmosphereModels.AdiabaticBalancer — Type
struct AdiabaticBalancer{T, S}Configuration for adiabatic (FV3 na_init) initialization, applied with balance_adiabatically!(model, balancer) or set!(model; balancer = AdiabaticBalancer(...)). Works for both CompressibleDynamics and AnelasticDynamics.
Keyword arguments
time_stepping: the time discretization used for the balance excursion (the sponge is always stripped — it is irreversible).CompressibleDynamicsonly; ignored forAnelasticDynamics(which has a single projection-based scheme). Options:- default (
DefaultTimeStepping()) — fully-explicit stepping. Memory-minimal (no acoustic substepper; only the aliasedGⁿ/U⁰tendency storage) and cleanly reversible, butΔtis bounded by the vertical acoustic CFL. nothing— reuse the model's native scheme (e.g. split-explicit), at the cost of rebuilding the acoustic substepper's scratch fields.- any time-discretization object — swapped in as-is.
- default (
Δt: forward/backward step size.nothing(default) auto-derives the vertical-acoustic-CFL stepacoustic_cfl_safety · Δz_min / cfrom the grid and analysis sound speed; pass a number to override.cycles: number of balance cycles (default1).weight: nudging weight toward the analysis snapshot (default2→ ⅓ dynamics + ⅔ analysis).with_moisture: iftrue(default) the moisture densityρqᵉrelaxes with the other prognostics. Iffalse,ρqᵉis snapshotted before the balance and restored after, so it is preserved exactly — reproducing a graft that returns only(ρ, ρu, ρv, ρw, ρθ).
Breeze.AtmosphereModels.AllSkyOptics — Type
struct AllSkyOptics <: Breeze.AtmosphereModels.AbstractOpticsType representing full-spectrum all-sky (cloudy) radiation using RRTMGP gas and cloud optics, can be used as optics argument in RadiativeTransferModel.
All-sky radiation includes scattering by cloud liquid and ice particles, requiring cloud water path, cloud fraction, and effective radius inputs from the microphysics scheme.
Breeze.AtmosphereModels.ApparentSolarPosition — Type
struct ApparentSolarPosition{C, E} <: AbstractSolarPositionTime-varying apparent solar position. The cosine of the solar zenith angle is recomputed on each radiation update from the model clock and either the grid's $(λ, φ)$ coordinates (when coordinate === nothing, the default) or an explicit (longitude, latitude) tuple stored in coordinate.
When the model clock holds a floating-point time (in seconds), epoch::DateTime provides the absolute reference against which clock.time is resolved. With a DateTime clock, epoch is ignored.
Fields
coordinate::Any: Observer longitude/latitude. Eithernothing(use grid coordinates) or a(longitude, latitude)tuple in degrees.epoch::Any: DateTime anchor for floating-point clocks. Eithernothing(requires a DateTime clock) or aDateTime.
Breeze.AtmosphereModels.ApparentSolarPosition — Method
ApparentSolarPosition(
;
coordinate,
epoch
) -> ApparentSolarPosition{Nothing, Nothing}
Construct an ApparentSolarPosition with optional coordinate and epoch.
julia> using Breeze, Datesjulia> ApparentSolarPosition()ApparentSolarPosition(coordinate=<from grid>, epoch=<from clock>)julia> ApparentSolarPosition(coordinate = (-70.9, 42.5))ApparentSolarPosition(coordinate=(-70.9, 42.5), epoch=<from clock>)julia> ApparentSolarPosition(epoch = DateTime(2024, 1, 1))ApparentSolarPosition(coordinate=<from grid>, epoch=2024-01-01T00:00:00)Breeze.AtmosphereModels.AtmosphereModel — Method
AtmosphereModel(
grid;
clock,
thermodynamic_constants,
formulation,
dynamics,
velocities,
moisture_density,
tracers,
coriolis,
boundary_conditions,
forcing,
advection,
momentum_advection,
scalar_advection,
closure,
microphysics,
timestepper,
timestepper_kwargs,
radiation
) -> AtmosphereModel{Dyn, Frm, Arc, Tst, Grd, Clk, Thm, Mom, Moi, Nothing, Tmp, Sol, Vel, Trc, Adv, Nothing, Frc, Nothing, Cnd, Nothing, Nothing, Nothing} where {Dyn, Frm, Arc, Tst, Grd, Clk, Thm, Mom, Moi, Tmp, Sol, Vel, Trc, Adv, Frc, Cnd}
Return an AtmosphereModel that uses the anelastic approximation following Pauluis (2008).
Arguments
The default
dynamicsisAnelasticDynamics.The default
formulationis:LiquidIcePotentialTemperature.The default
advectionscheme isCentered(order=2)for both momentum and scalars. If a singleadvectionis provided, it is used for both momentum and scalars.Alternatively, specific
momentum_advectionandscalar_advectionschemes may be provided.scalar_advectionmay be aNamedTuplewith a different scheme for each respective scalar, identified by name.
Example
julia> using Breezejulia> grid = RectilinearGrid(size=(8, 8, 8), extent=(1, 2, 3));julia> model = AtmosphereModel(grid)AtmosphereModel{CPU, RectilinearGrid}(time = 0 seconds, iteration = 0)├── grid: 8×8×8 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 3×3×3 halo├── dynamics: AnelasticDynamics(p₀=101325.0, θ₀=288.0)├── formulation: LiquidIcePotentialTemperatureFormulation├── thermodynamic_constants: ThermodynamicConstants{Float64}├── timestepper: SSPRungeKutta3├── advection scheme:│ ├── momentum: Centered(order=2)│ ├── ρθ: Centered(order=2)│ └── ρqᵛ: Centered(order=2)├── forcing: @NamedTuple{ρu::Returns{Float64}, ρv::Returns{Float64}, ρw::Returns{Float64}, ρθ::Returns{Float64}, ρqᵛ::Returns{Float64}, ρe::Returns{Float64}}├── tracers: ()├── coriolis: Nothing└── microphysics: NothingReferences
Pauluis, O. (2008). Thermodynamic consistency of the anelastic approximation for a moist atmosphere. Journal of the Atmospheric Sciences 65, 2719–2729.
Breeze.AtmosphereModels.AtmosphereModelBuoyancy — Type
struct AtmosphereModelBuoyancy{D, F, T}Wrapper struct for computing buoyancy for AtmosphereModel in the context of a turbulence closure. Used to interface with Oceananigans turbulence closures that require buoyancy gradients.
Breeze.AtmosphereModels.BackgroundAtmosphere — Type
struct BackgroundAtmosphere{N2, O2, CO2, CH4, N2O, CO, NO2, O3, CFC11, CFC12, CFC22, CCL4, CF4, HFC125, HFC134A, HFC143A, HFC23, HFC32}Volume mixing ratios (VMR) for radiatively active gases. All values are dimensionless molar fractions.
RRTMGP supports spatially-varying VMR only for H₂O (computed from model moisture) and O₃. All other gases use global mean values.
Fields
- Constant gases (global mean only):
N₂,O₂,CO₂,CH₄,N₂O,CO,NO₂ - Halocarbons:
CFC₁₁,CFC₁₂,CFC₂₂,CCl₄,CF₄ - Hydrofluorocarbons:
HFC₁₂₅,HFC₁₃₄ₐ,HFC₁₄₃ₐ,HFC₂₃,HFC₃₂ - Spatially-varying:
O₃- can be a constant or a function for height-dependent profiles
Defaults are approximate modern atmospheric values for major gases; halocarbons default to zero.
Note: H₂O is computed from the model's prognostic moisture field, not specified here.
The BackgroundAtmosphere constructor does not require a grid. When passed to RadiativeTransferModel, the O₃ field is materialized using the grid. This allows users to seamlessly switch between constant and function-based concentrations.
Breeze.AtmosphereModels.BackgroundAtmosphere — Method
BackgroundAtmosphere(
;
N₂,
O₂,
CO₂,
CH₄,
N₂O,
CO,
NO₂,
O₃,
CFC₁₁,
CFC₁₂,
CFC₂₂,
CCl₄,
CF₄,
HFC₁₂₅,
HFC₁₃₄ₐ,
HFC₁₄₃ₐ,
HFC₂₃,
HFC₃₂
) -> BackgroundAtmosphere{Float64, Float64, Float64, Float64, Float64, Float64, Float64, typeof(standard_ozone_profile), Float64, Float64, Float64, Float64, Float64, Float64, Float64, Float64, Float64, Float64}
Construct a BackgroundAtmosphere with volume mixing ratios for radiatively active gases. All values are dimensionless molar fractions.
RRTMGP supports spatially-varying VMR only for H₂O and O₃. Other gases use global means.
- Constant gases: Specify as numbers
- O₃: Can be a Number or Function for height-dependent profiles
Keyword Arguments
- Constant gases:
N₂,O₂,CO₂,CH₄,N₂O,CO,NO₂ - Halocarbons:
CFC₁₁,CFC₁₂,CFC₂₂,CCl₄,CF₄ - Hydrofluorocarbons:
HFC₁₂₅,HFC₁₃₄ₐ,HFC₁₄₃ₐ,HFC₂₃,HFC₃₂ - Spatially-varying:
O₃(can be Number or Function)
Defaults are approximate modern atmospheric values; halocarbons default to zero, and ozone defaults to standard_ozone_profile (pass O₃ = 0 for an ozone-free atmosphere). Note: H₂O is computed from the model's prognostic moisture field.
Example
julia> using Breezejulia> background = BackgroundAtmosphere(CO₂ = 400e-6)BackgroundAtmosphere with 6 active gases: N₂ = 0.78084 O₂ = 0.20946 CO₂ = 400.0 ppm CH₄ = 1.8 ppm N₂O = 330.0 ppb O₃ = standard_ozone_profile (generic function with 1 method)julia> tropical_ozone(z) = 30e-9 * (1 + z / 10000);julia> background = BackgroundAtmosphere(CO₂ = 400e-6, O₃ = tropical_ozone)BackgroundAtmosphere with 6 active gases: N₂ = 0.78084 O₂ = 0.20946 CO₂ = 400.0 ppm CH₄ = 1.8 ppm N₂O = 330.0 ppb O₃ = tropical_ozone (generic function with 1 method)Breeze.AtmosphereModels.CellAdvectionTimescale — Type
A callable that returns the advective timescale of a model restricted to the directions of formulation: HorizontalFormulation() counts only the horizontal advective CFL (dropping the vertical term), ThreeDimensionalFormulation() counts all three directions. Pass it to the cell_advection_timescale keyword of TimeStepWizard / conjure_time_step_wizard!, or as the timescale argument of CFL (CFL(Δt, CellAdvectionTimescale(...))), to control or monitor which directions bind the time step.
Breeze.AtmosphereModels.ClearSkyOptics — Type
struct ClearSkyOptics <: Breeze.AtmosphereModels.AbstractOpticsType representing full-spectrum clear-sky radiation using RRTMGP gas optics, can be used as optics argument in RadiativeTransferModel.
Breeze.AtmosphereModels.ConstantRadiusParticles — Type
struct ConstantRadiusParticles{FT}radius::Any: Effective radius [m]
Represents cloud particles with a constant effective radius in meters.
Breeze.AtmosphereModels.DefaultTemperatureSolver — Type
struct DefaultTemperatureSolverSentinel indicating that a formulation's temperature solver should be chosen by the dynamics: materialize_formulation replaces it with default_temperature_solver(dynamics).
Breeze.AtmosphereModels.DiurnalSolarPosition — Type
DiurnalSolarPosition(; ...)
DiurnalSolarPosition(
FT::DataType;
latitude,
declination,
day_length,
noon_offset
)
Construct a DiurnalSolarPosition with sensible defaults: perpetual equinox (declination = 0), 24-hour day (day_length = 86400 s), and noon at the start of the simulation (noon_offset = 0).
The positional argument FT controls the precision of the stored fields and defaults to Oceananigans.defaults.FloatType. Pass FT = Float32 (or set Oceananigans.defaults.FloatType = Float32) to run in Float32:
DiurnalSolarPosition(Float32, latitude = 30)Breeze.AtmosphereModels.DiurnalSolarPosition — Type
struct DiurnalSolarPosition{FT} <: AbstractSolarPositionIdealized diurnal cycle with no annual variation and no calendar dependence. cos(θ_z) is computed analytically on each radiation update from the model clock (which must be numeric — seconds since the start of the run) as
\[\cos(θ_z) = \sin(φ) \sin(δ) + \cos(φ) \cos(δ) \cos(ω), \qquad ω = \frac{2π}{T_d} (t - t_{\text{noon}})\]
where $φ$ is the (fixed) observer latitude, $δ$ is the (fixed) solar declination, $T_d$ is the day length, and $t_{\text{noon}}$ is the simulation time at which local noon occurs. $ω = 0$ at noon and $ω = ±π$ at local midnight. The result is clamped to be non-negative.
Fields
latitude::Any: Observer latitude (degrees).declination::Any: Solar declination (degrees). Zero is perpetual equinox; ±23.5 is perpetual solstice.day_length::Any: Rotation period (seconds). Default86400is the Earth day.noon_offset::Any: Simulation time (seconds) at which local noon occurs. Default0.
Examples
Perpetual equinox at 30°N (default: 24-hour day, noon at $t = 0$):
julia> using Breezejulia> DiurnalSolarPosition(latitude = 30)DiurnalSolarPosition(latitude = 30.0°, declination = 0.0°, day_length = 86400.0 s, noon_offset = 0.0 s)Perpetual June solstice at 45°N:
julia> using Breezejulia> DiurnalSolarPosition(latitude = 45, declination = 23.5)DiurnalSolarPosition(latitude = 45.0°, declination = 23.5°, day_length = 86400.0 s, noon_offset = 0.0 s)Fast rotator with a 10-hour day, sun overhead, starting at sunrise:
julia> using Breezejulia> DiurnalSolarPosition(latitude = 0, day_length = 10 * 3600, noon_offset = 5 * 3600)DiurnalSolarPosition(latitude = 0.0°, declination = 0.0°, day_length = 36000.0 s, noon_offset = 18000.0 s)Breeze.AtmosphereModels.FixedCosineZenith — Type
struct FixedCosineZenith{FT} <: AbstractSolarPositionConstant cosine of the solar zenith angle. The model clock has no effect on the sun position; the shortwave path length is fixed at $1 / \cos(θ_z)$ and the top-of-atmosphere downward shortwave flux is solar_constant * cos_zenith.
This is the appropriate choice for idealized studies (radiative-convective equilibrium, RCE intercomparisons) where a diurnal or annual mean is desired. Common values: $\cos(θ_z) = 0.5$ for diurnal mean at mid-latitudes, $\cos(θ_z) ≈ 0.41$ for the global annual mean.
Fields
cos_zenith::Any: Cosine of the solar zenith angle. Should satisfy $0 ≤ \cos(θ_z) ≤ 1$ for the sun above the horizon.
Example
julia> using Breezejulia> FixedCosineZenith(0.5)FixedCosineZenith(cos_zenith = 0.5)Breeze.AtmosphereModels.GrayOptics — Type
struct GrayOptics <: Breeze.AtmosphereModels.AbstractOpticsType representing gray atmosphere radiation (O'Gorman & Schneider 2008), can be used as optics argument in RadiativeTransferModel.
References
- O'Gorman, P. A. and Schneider, T. (2008). The hydrological cycle over a wide range of climates simulated with an idealized GCM. Journal of Climate, 21, 3815–3832.
Breeze.AtmosphereModels.HorizontalSlowMode — Type
struct HorizontalSlowMode{D}Wrapper type indicating that vertical "fast" terms should be excluded from tendencies.
When computing momentum tendencies with a HorizontalSlowMode-wrapped dynamics, the horizontal pressure gradient is computed normally, but the vertical pressure gradient and buoyancy return zero. These vertical fast terms are handled by the acoustic substep loop through perturbation variables $-ψ ∂ρ''/∂z - g ρ''$.
Including the full vertical PG and buoyancy in the slow tendency introduces a hydrostatic truncation error $O(Δz^2)$ that drives spurious acoustic modes. The horizontal PG does not suffer from this issue and can safely be included.
Breeze.AtmosphereModels.HydrostaticallyBalancedDensity — Type
HydrostaticallyBalancedDensity(; surface_pressure = nothing)Marker passed as the ρ value to set! to set the density in discrete moist hydrostatic balance with the just-set θˡⁱ/qᵛ, by per-column integration of the hydrostatic equation upward from surface_pressure (a scalar; defaults to the dynamics' mean surface pressure). For CompressibleDynamics.
Unlike supplying a density field, this guarantees the initial column satisfies the discrete hydrostatic balance (pᵏ − pᵏ⁻¹)/Δz + g(ρᵏ + ρᵏ⁻¹)/2 = 0, so the cold start carries no spurious vertical pressure-gradient force. Combine with compute_reference_state = true (perturbation-form base state) and balancer (nonhydrostatic ρw spin-up) for a full one-call initialization.
Breeze.AtmosphereModels.NothingMicrophysicalState — Type
NothingMicrophysicalState{FT}A microphysical state with no prognostic variables.
Used for Nothing microphysics and SaturationAdjustment schemes where cloud condensate is diagnosed from the thermodynamic state rather than being prognostic.
Breeze.AtmosphereModels.RadiativeTransferModel — Method
RadiativeTransferModel(
grid::Oceananigans.Grids.AbstractGrid,
optics,
args...;
kw...
)
Construct a RadiativeTransferModel on grid using the specified optics.
Valid optics types are:
GrayOptics()- Gray atmosphere radiation (O'Gorman & Schneider 2008)ClearSkyOptics()- Full-spectrum clear-sky radiation using RRTMGP gas opticsAllSkyOptics()- Full-spectrum all-sky (cloudy) radiation using RRTMGP gas and cloud optics
The constants argument provides physical constants for the radiative transfer solver.
Solar position
The solar_position keyword controls how the cosine of the solar zenith angle is obtained on each radiation update. See AbstractSolarPosition and its subtypes:
ApparentSolarPosition(default) — time-varying, computed from the model clock and grid (or explicit) longitude/latitude. SupportsDateTimeclocks and floating-point clocks resolved against anepoch.FixedCosineZenith— constant cos(θ_z), clock-independent. Appropriate for idealized radiative-convective equilibrium studies.
Example
julia> using Breeze, Oceananigans.Units, RRTMGP, NCDatasetsjulia> grid = RectilinearGrid(; size=16, x=0, y=45, z=(0, 10kilometers), topology=(Flat, Flat, Bounded));julia> RadiativeTransferModel(grid, GrayOptics(), ThermodynamicConstants(); surface_temperature = 300, surface_albedo = 0.1)RadiativeTransferModel├── solar_constant: 1361.0 W m⁻²├── solar_position: ApparentSolarPosition(coordinate=(0.0, 45.0), epoch=<from clock>)├── surface_temperature: ConstantField(300.0) K├── surface_emissivity: ConstantField(0.98)├── direct_surface_albedo: ConstantField(0.1)└── diffuse_surface_albedo: ConstantField(0.1)julia> RadiativeTransferModel(grid, GrayOptics(), ThermodynamicConstants(); surface_temperature = 300, surface_albedo = 0.1, solar_position = FixedCosineZenith(0.5))RadiativeTransferModel├── solar_constant: 1361.0 W m⁻²├── solar_position: FixedCosineZenith(cos_zenith = 0.5)├── surface_temperature: ConstantField(300.0) K├── surface_emissivity: ConstantField(0.98)├── direct_surface_albedo: ConstantField(0.1)└── diffuse_surface_albedo: ConstantField(0.1)julia> RadiativeTransferModel(grid, ClearSkyOptics(), ThermodynamicConstants(); surface_temperature = 300, surface_albedo = 0.1, background_atmosphere = BackgroundAtmosphere(CO₂ = 400e-6))RadiativeTransferModel├── solar_constant: 1361.0 W m⁻²├── solar_position: ApparentSolarPosition(coordinate=(0.0, 45.0), epoch=<from clock>)├── surface_temperature: ConstantField(300.0) K├── surface_emissivity: ConstantField(0.98)├── direct_surface_albedo: ConstantField(0.1)└── diffuse_surface_albedo: ConstantField(0.1)References
- O'Gorman, P. A. and Schneider, T. (2008). The hydrological cycle over a wide range of climates simulated with an idealized GCM. Journal of Climate, 21, 3815–3832.
Breeze.AtmosphereModels.SlowTendencyMode — Type
struct SlowTendencyMode{D}Wrapper type indicating that only "slow" tendencies should be computed.
When computing momentum tendencies with a SlowTendencyMode-wrapped dynamics, the "fast" terms (pressure gradient and buoyancy) return zero. This is used for split-explicit time-stepping where fast terms are handled separately in an acoustic substep loop.
See also SplitExplicitTimeDiscretization.
Breeze.AtmosphereModels.SpeciesBorrowing — Type
struct SpeciesBorrowing{VB} <: Breeze.AtmosphereModels.AbstractNegativeMoistureCorrectionCorrect negative moisture produced by advection via same-level species borrowing.
At each grid cell, negative hydrometeors borrow from lighter species in the chain (e.g. rain <- cloud liquid <- vapor). Vertical redistribution of any remaining negative vapor is performed when vertical_borrowing is set to VerticalBorrowing.
For microphysics with number concentrations (categories that subtype AbstractNumberConcentrationCategories), orphaned number concentrations are zeroed and negative number concentrations are clamped after mass borrowing.
See fix_negative_moisture! for details.
Fields
vertical_borrowing:nothing(default) orVerticalBorrowing()to enable vertical redistribution
Breeze.AtmosphereModels.VerticalBorrowing — Type
struct VerticalBorrowing <: Breeze.AtmosphereModels.AbstractNegativeMoistureCorrectionRedistribute negative vapor vertically within each column via a top-to-bottom sweep that pushes deficits downward, followed by one bottom-to-top borrowing step if the bottom level is still negative.
This scheme can be used on its own to correct the moisture prognostic, or as the second phase of SpeciesBorrowing to clean up any vapor deficit that remains after same-level species borrowing.
Column-integrated moisture is conserved ($Δz$-weighted).
Breeze.AtmosphereModels.WarmRainState — Type
WarmRainState{FT} <: AbstractMicrophysicalState{FT}A simple microphysical state for warm-rain schemes with cloud liquid and rain.
Fields
qᶜˡ::Any: Specific cloud liquid water content [kg/kg]qʳ::Any: Specific rain water content [kg/kg]
Breeze.AtmosphereModels.advecting_momentum — Method
advecting_momentum(
model
) -> NamedTuple{(:ρu, :ρv, :ρw), <:Tuple{Any, Any, Any}}
Return the momentum tuple used for momentum advection transport and the continuity equation divergence.
For standard (non-terrain) models, this is model.momentum. For terrain-following coordinates, the vertical component ρw is replaced by the contravariant vertical momentum $\rho \tilde{w}$.
Breeze.AtmosphereModels.balance_adiabatically! — Method
balance_adiabatically!(
model::AtmosphereModel,
balancer::AdiabaticBalancer
) -> AtmosphereModel
Run adiabatic (FV3 na_init) initialization on model in place: spin the nonhydrostatic state (ρw and the pressure balance) into balance with the analysis fields. balancer is an AdiabaticBalancer (or true for the defaults / false for a no-op). Builds a stripped, memory-sharing twin via adiabatic_balance_twin and runs the low-level balance_adiabatically!(model; Δt, cycles, weight) on it, so the balanced state lands directly in model — no graft, no second field set.
Breeze.AtmosphereModels.balance_adiabatically! — Method
balance_adiabatically!(
model::AtmosphereModel;
Δt,
cycles,
weight
)
Spin up a balanced vertical momentum ρw (and the nonhydrostatic pressure balance) consistent with model's initial (analysis) state, via FV3 adiabatic initialization (na_init).
Analyses (ERA5, GFS, …) supply the density, momentum, and thermodynamic state but cold-start the vertical velocity w at zero (hydrostatic), so the nonhydrostatic state is out of balance with the rest. Each of cycles cycles entails two symmetric forward/backward dynamics excursions at the same Δt. After each excursion — which lets ρw develop — the initial fields (every prognostic except ρw) are nudged back toward their t = 0 snapshot by the weighted mean
x ← (x + weight·x₀) / (1 + weight)(default weight = 2 → ⅓ dynamics + ⅔ snapshot). ρw is never snapshotted or nudged, so the balance the excursion imprints on it is exactly what is kept. update_state! after each nudge rebuilds the diagnostics; the clock is reset to t = 0 on exit.
balance_adiabatically! performs adiabatic dynamics only. The caller must pass a model built without physics (microphysics = nothing), without an upper sponge, and without forcing — these run inside update_state!/time_step! and would corrupt the spin-up. Boundary conditions are not modified; pass a model whose boundaries are time-invariant so the symmetric excursion stays nearly reversible. The two-argument balance_adiabatically!(model, balancer) constructs such a model automatically.
Breeze.AtmosphereModels.buoyancy_forceᶜᶜᶜ — Function
buoyancy_forceᶜᶜᶜ(i, j, k, grid, dynamics, temperature,
specific_prognostic_moisture, microphysics, microphysical_fields, constants)Compute the buoyancy force density $ρ b$ at cell center (i, j, k).
This function is used in the vertical momentum equation to compute the gravitational forcing term.
Breeze.AtmosphereModels.compute_forcing! — Method
compute_forcing!(forcing)
Compute any fields or quantities needed by a forcing before it is applied. This function is extended by the Forcings module for forcing types that require pre-computation (e.g., SubsidenceForcing which computes horizontal averages).
Breeze.AtmosphereModels.compute_microphysical_tendencies! — Method
compute_microphysical_tendencies!(model) -> Any
Add microphysics tendency contributions to the model's Gⁿ fields.
This is the only entry point through which compute_tendencies! invokes microphysics. Concrete implementations add methods on the two-argument helper compute_microphysical_tendencies!(microphysics, model).
The default implementation launches a single fused kernel that builds the microphysical state ℳ and thermodynamic state 𝒰 once per cell, then +=s the result of microphysical_tendency for each prognostic name into the corresponding G field. Schemes whose tendencies factor naturally per-name only need to extend microphysical_tendency.
Schemes whose tendencies bundle many process rates feeding multiple prognostics (e.g. mixed-phase non-equilibrium 1M, where ~14 process rates feed 5 prognostic tendencies) override this method directly to compute the bundle once per cell.
Breeze.AtmosphereModels.compute_pressure_correction! — Method
compute_pressure_correction!(model, Δt)
Compute the pressure correction for the given model. Default: no-op. For anelastic dynamics, solves the pressure Poisson equation.
Breeze.AtmosphereModels.default_temperature_solver — Method
default_temperature_solver(dynamics)Return the default solver for a formulation's temperature inversion given dynamics.
The need for an iterative inversion is dictated by the intersection of the dynamics and the thermodynamic formulation: the fallback returns nothing (closed-form, no iteration), and dynamics whose prognostic closure makes the inversion implicit (e.g. CompressibleDynamics with LiquidIcePotentialTemperatureFormulation, where temperature solves T = (ρRᵐT/pˢᵗ)^κ θ + ΔL/cᵖᵐ) extend this function to return an iterative solver.
Breeze.AtmosphereModels.dynamics_density — Function
dynamics_density(dynamics)Return the coupling density — the density weighting the momentum (ρu = ρᵈ u) and the thermodynamic flux variable (ρθ = ρᵈ θ), and the divisor for diagnosing velocity (u = ρu/ρᵈ) and potential temperature (θ = ρθ/ρᵈ). It is the prognostic mass variable advanced by continuity.
AnelasticDynamics: the time-independent reference densityρᵣ.CompressibleDynamics: the prognostic dry-air densityρᵈ.
The total air density ρ = ρᵈ + Σ ρˣ (dry air plus every water species) is a separate, diagnosed quantity — see total_density — used wherever total mass enters the physics: the moisture mass-fraction recovery (qˣ = ρˣ/ρ, so the thermodynamics stays in mass fractions), scalar and water advection, the equation of state, and buoyancy. The water densities (ρqᵛ, ρqˡ, …) are stored as partial densities (mass per volume), not coupling-weighted. On the anelastic core the two densities coincide (total_density === dynamics_density).
Breeze.AtmosphereModels.dynamics_pressure — Function
dynamics_pressure(dynamics)Return the pressure field appropriate to the dynamical formulation, in Pa — the pressure entering the equation of state, buoyancy, and the thermodynamic tendencies.
For anelastic dynamics, this is the time-independent hydrostatic reference pressure $pᵣ(z)$. For compressible dynamics, this is the prognostic pressure field. The anomaly and total-pressure counterparts are pressure_anomaly and total_pressure.
Breeze.AtmosphereModels.grid_moisture_fractions — Method
grid_moisture_fractions(
i,
j,
k,
grid,
microphysics,
ρ,
qᵛ,
μ_fields
) -> Breeze.Thermodynamics.MoistureMassFractions
Grid-indexed version of moisture_fractions.
This is the generic wrapper that:
- Extracts prognostic values from
μ_fieldsviaextract_microphysical_prognostics - Builds the microphysical state via
microphysical_statewith𝒰 = nothing - Calls
moisture_fractions
This works for non-equilibrium schemes where cloud condensate is prognostic. Non-equilibrium schemes don't need 𝒰 to build their state (they use prognostic fields).
Saturation adjustment schemes should override this to read from diagnostic fields.
Breeze.AtmosphereModels.initial_aerosol_number — Method
initial_aerosol_number(microphysics) -> Any
Return the total initial aerosol number concentration [m⁻³] for a microphysics scheme.
This is used by initialize_model_microphysical_fields! and parcel model construction to set a physically meaningful default for the prognostic aerosol number density ρnᵃ. The value is derived from the aerosol size distribution stored in the microphysics scheme, so it stays consistent with the activation parameters.
Returns 0 by default; extensions override this for schemes with prognostic aerosol.
Breeze.AtmosphereModels.is_density_tendency_forcing — Method
is_density_tendency_forcing(_) -> Bool
Return true if forcing produces a density-weighted tendency F_{ρϕ} directly (i.e., already includes the multiplication by ρ).
Forcings that return density tendencies must be supplied under their density-weighted key (e.g., ρθ, ρu) rather than the corresponding specific key (θ, u), because the specific-key dispatch wraps user values in SpecificForcing, which would multiply by ρ a second time. This trait is used by atmosphere_model_forcing to reject such misuses with a clear error.
Defaults to false. Extended for SubsidenceForcing and GeostrophicForcing in the Forcings module.
Breeze.AtmosphereModels.liquid_ice_potential_temperature — Function
liquid_ice_potential_temperature(model)Return the liquid-ice potential temperature field for the given model.
Breeze.AtmosphereModels.liquid_ice_potential_temperature_density — Function
liquid_ice_potential_temperature_density(model)Return the liquid-ice potential temperature density field for the given model.
Breeze.AtmosphereModels.make_pressure_correction! — Method
make_pressure_correction!(model, Δt)
Apply the pressure correction to the momentum fields. Default: no-op. For anelastic dynamics, projects momentum to enforce the divergence constraint.
Breeze.AtmosphereModels.materialize_atmosphere_model_boundary_conditions — Function
materialize_atmosphere_model_boundary_conditions(boundary_conditions, grid, formulation,
dynamics, microphysics, surface_pressure, thermodynamic_constants,
microphysical_fields, specific_prognostic_moisture, temperature)Regularize boundary conditions for an AtmosphereModel. This function is extended by the BoundaryConditions module to provide atmosphere-specific boundary condition handling.
If formulation is :LiquidIcePotentialTemperature and ρe boundary conditions are provided, they are automatically converted to ρθ boundary conditions by wrapping flux BCs in EnergyFluxBoundaryCondition, which divides by the local mixture heat capacity.
The dynamics argument provides access to the reference state for boundary conditions that require it, such as VirtualPotentialTemperature diagnostics.
The microphysics argument specifies the microphysics scheme used to compute moisture fractions for mixture heat capacity and virtual potential temperature calculations.
The microphysical_fields, specific_prognostic_moisture, and temperature arguments are pre-created fields used to construct the VirtualPotentialTemperature diagnostic for stability-dependent boundary conditions.
Breeze.AtmosphereModels.materialize_atmosphere_model_forcing — Function
materialize_atmosphere_model_forcing(forcing, field, name, model_field_names, context)Materialize a forcing for an AtmosphereModel field. This function is extended by the Forcings module to handle atmosphere-specific forcing types like subsidence and geostrophic forcings.
The context argument provides additional information needed for materialization, such as grid, reference state, and thermodynamic constants.
Breeze.AtmosphereModels.materialize_background_atmosphere — Method
materialize_background_atmosphere(
atm::BackgroundAtmosphere,
grid
) -> BackgroundAtmosphere
Materialize a BackgroundAtmosphere by converting O₃ functions to fields and converting constant gases to the grid's float type.
This is called internally by RadiativeTransferModel constructors.
Breeze.AtmosphereModels.materialize_surface_property — Method
materialize_surface_property(x, grid [, solar_position])Convert a surface property (albedo, emissivity) to the form the radiative-transfer solver stores: a Number becomes a grid-eltype scalar and a Field passes through. Extend the three-argument form for property sources that must be resolved against the grid and the solar epoch (e.g. an observed-albedo dataset); it falls back to the two-argument form.
Breeze.AtmosphereModels.microphysical_state — Method
microphysical_state(microphysics, ρ, μ, 𝒰, velocities)Build an AbstractMicrophysicalState (ℳ) from density-weighted prognostic microphysical variables μ, density ρ, and thermodynamic state 𝒰.
This is the primary interface that microphysics schemes must implement. It converts density-weighted prognostics to the scheme-specific AbstractMicrophysicalState type.
For non-equilibrium schemes, cloud condensate comes from μ (prognostic fields). For saturation adjustment schemes, cloud condensate comes from 𝒰.moisture_mass_fractions, while precipitation (rain, snow) still comes from μ.
Arguments
microphysics: The microphysics schemeρ: Local density (scalar)μ: NamedTuple of density-weighted prognostic variables (e.g.,(ρqᶜˡ=..., ρqʳ=...))𝒰: Thermodynamic statevelocities: NamedTuple of velocity components(; u, v, w)[m/s].
Returns
An AbstractMicrophysicalState subtype containing the local specific microphysical variables.
See also microphysical_tendency, AbstractMicrophysicalState.
Breeze.AtmosphereModels.microphysical_tendency — Method
microphysical_tendency(microphysics, name, ρ, ℳ, 𝒰, constants)Compute the tendency for microphysical variable name from the microphysical state ℳ and thermodynamic state 𝒰.
This is the state-based tendency interface that operates on scalar states without grid indexing. It works identically for grid-based LES and parcel models.
Arguments
microphysics: The microphysics schemename: Variable name asVal(:name)(e.g.,Val(:ρqᶜˡ))ρ: Local density (scalar)ℳ: Microphysical state (e.g.,WarmPhaseOneMomentState)𝒰: Thermodynamic stateconstants: Thermodynamic constants
Returns
The tendency value (scalar, units depend on variable).
See also microphysical_state, AbstractMicrophysicalState.
Breeze.AtmosphereModels.moisture_fractions — Method
moisture_fractions(
_::Nothing,
ℳ,
qᵛ
) -> Breeze.Thermodynamics.MoistureMassFractions
Compute MoistureMassFractions from a microphysical state ℳ and scheme-dependent specific moisture $qᵛᵉ$.
The input $qᵛᵉ$ is the scheme-dependent specific moisture: vapor for non-equilibrium schemes, or equilibrium moisture ($qᵉ = qᵛ + qᶜˡ$) for saturation adjustment schemes.
This is the state-based (gridless) interface for computing moisture fractions. Microphysics schemes should extend this method to partition moisture based on their prognostic variables.
The default implementation for Nothing microphysics assumes all moisture is vapor.
Breeze.AtmosphereModels.moisture_prognostic_name — Method
moisture_prognostic_name(_::Nothing) -> Symbol
Return the prognostic moisture field name as a Symbol for the given microphysics scheme.
The physical meaning of the prognostic moisture field depends on the scheme:
Nothing/ non-equilibrium::ρqᵛ(true vapor density)SaturationAdjustment::ρqᵉ(equilibrium moisture density, diagnostically partitioned)
Breeze.AtmosphereModels.moisture_specific_name — Method
moisture_specific_name(microphysics) -> Symbol
Return the specific (per-mass) moisture field name by stripping the ρ prefix from moisture_prognostic_name.
Breeze.AtmosphereModels.precipitation_rate — Function
precipitation_rate(model, phase=:liquid)Return a KernelFunctionOperation representing the precipitation rate for the given phase.
The precipitation rate is the rate at which moisture is removed from the atmosphere by precipitation processes.
Arguments:
model: AnAtmosphereModelwith a microphysics schemephase: Either:liquid(rain) or:ice(snow). Default is:liquid.
Returns a Field or KernelFunctionOperation that can be computed and visualized. Specific microphysics schemes must extend this function.
Breeze.AtmosphereModels.pressure_anomaly — Function
pressure_anomaly(dynamics)Return the pressure anomaly (deviation from mean) in Pa.
Breeze.AtmosphereModels.set_to_mean! — Method
set_to_mean!(ref::ExnerReferenceState, model)Exner analogue of the ReferenceState method, for split-explicit CompressibleDynamics. Recompute the base exner_function/pressure/density by re-running the same discrete Exner column integration the constructor uses, with the horizontal-mean liquid-ice potential temperature and vapor mass fraction of the current model state. The recomputed reference is horizontally uniform (a single column). (Assumes a 1-D column reference, the form built from a constant or z-dependent θ₀.)
Unlike the anelastic ReferenceState method there is no rescale_densities option: the Exner reference is only the perturbation-form base state, not the prognostic density (ρᵈ), so changing it does not require rescaling the density-weighted prognostics.
Breeze.AtmosphereModels.set_to_mean! — Method
set_to_mean!(reference_state, model; rescale_densities=false)Recompute the reference pressure and density profiles from horizontally-averaged temperature and moisture mass fractions of the current model state.
When rescale_densities=true, density-weighted prognostic fields (ρe, ρqᵗ, ρu, etc.) are rescaled by ρᵣ_new / ρᵣ_old so that the specific quantities (e, qᵗ, u, etc.) are unchanged. When false (default), the density-weighted fields are left as-is and only diagnostics are recomputed.
Breeze.AtmosphereModels.specific_humidity — Method
specific_humidity(model) -> Any
Return the specific humidity (vapor mass fraction) field for the given model.
This always returns the actual vapor field $qᵛ$ from the microphysical fields, regardless of microphysics scheme.
Breeze.AtmosphereModels.specific_prognostic_moisture — Method
specific_prognostic_moisture(model) -> Any
Return the prognostic specific moisture field for model.
This is $qᵛ$ for non-equilibrium schemes or $qᵉ$ for saturation adjustment schemes.
Breeze.AtmosphereModels.specific_prognostic_moisture_from_total — Method
specific_prognostic_moisture_from_total(
_::Nothing,
qᵗ,
ℳ
) -> Any
Convert total specific moisture $qᵗ$ to the scheme-dependent specific moisture $qᵛᵉ$ by subtracting the appropriate condensate from the microphysical state $ℳ$.
For non-equilibrium schemes, $qᵛᵉ = qᵛ = qᵗ - qˡ$ (subtract all condensate). For saturation adjustment schemes, $qᵛᵉ = qᵉ = qᵗ - qʳ$ (subtract only precipitation). For Nothing microphysics, $qᵛᵉ = qᵗ$ (all moisture is vapor).
This is used by parcel models that store total moisture $qᵗ$ as the prognostic variable, to produce the correct input for moisture_fractions.
Breeze.AtmosphereModels.standard_ozone_profile — Method
standard_ozone_profile(z) -> Any
An idealized climatological ozone volume mixing ratio (mol/mol) as a function of height z (m): a weak tropospheric background increasing toward the tropopause, blended into a Gaussian stratospheric layer peaking near 25 km. Keeps the stratospheric column near radiative balance in deep-column simulations — without ozone the upper column is far from radiative equilibrium and destabilizes when the spectral fluxes recompute. Not a substitute for an observed or model ozone climatology.
Breeze.AtmosphereModels.static_energy — Function
static_energy(model)Return the specific static energy field for the given model.
Breeze.AtmosphereModels.static_energy_density — Function
static_energy_density(model)Return the static energy density field for the given model.
For LiquidIcePotentialTemperatureFormulation, returns a Field with boundary conditions that convert potential temperature fluxes to energy fluxes. This allows users to use BoundaryConditionOperation to extract energy flux values from the model.
For StaticEnergyFormulation, returns the prognostic energy density field directly.
Breeze.AtmosphereModels.surface_precipitation_flux — Method
surface_precipitation_flux(model) -> Any
Return a 2D Field representing the flux of precipitating moisture at the bottom boundary.
The surface precipitation flux is $wʳ ρqʳ$ at the bottom face (k = 1), representing the rate at which rain mass leaves the domain through the bottom boundary.
Units: kg/m²/s (positive = downward flux out of domain)
Arguments:
model: AnAtmosphereModelwith a microphysics scheme
Returns a 2D Field that can be computed and visualized. Specific microphysics schemes must extend this function.
Breeze.AtmosphereModels.thermodynamic_density — Function
thermodynamic_density(formulation)Return the thermodynamic density field for the given formulation — the prognostic thermodynamic variable in coupling-density-weighted ("flux") form (ρθ, ρe, ρE).
The weighting density is the dynamics' coupling density (see dynamics_density): the reference density ρᵣ on the anelastic core and the prognostic dry-air density ρᵈ on the compressible core. The generic name (ρθ) is therefore ρᵈθ on CompressibleDynamics; the intensive variable is recovered as θ = ρθ / dynamics_density(dynamics).
Breeze.AtmosphereModels.thermodynamic_density_name — Function
thermodynamic_density_name(formulation)Return the name of the thermodynamic density field (e.g., :ρθ, :ρe, :ρE). Accepts a Symbol, Val(Symbol), or formulation struct.
Breeze.AtmosphereModels.total_pressure — Function
total_pressure(dynamics)Return the total pressure (mean + anomaly) in Pa.
Breeze.AtmosphereModels.transport_velocities — Method
transport_velocities(
model
) -> NamedTuple{(:u, :v, :w), <:Tuple{Any, Any, Any}}
Return the velocity tuple used for scalar advection transport.
For standard (non-terrain) models, this is model.velocities. For terrain-following coordinates, the vertical component is replaced by the contravariant vertical velocity $\tilde{w}$.
Breeze.AtmosphereModels.update_microphysical_auxiliaries! — Function
Update auxiliary microphysical fields at grid point (i, j, k).
This is the single interface function for updating all auxiliary (non-prognostic) microphysical fields. Microphysics schemes should extend this function.
The function receives:
μ: NamedTuple of microphysical fields (mutated)i, j, k: Grid indices (afterμsince this is a mutating function)microphysics: The microphysics schemeℳ: The microphysical state at this pointρ: Local density𝒰: Thermodynamic stateconstants: Thermodynamic constants
Why i, j, k is needed
Grid indices cannot be eliminated because:
- Fields must be written at specific grid points
- Some schemes need grid-dependent logic (e.g.,
k == 1for bottom boundary conditions in sedimentation schemes)
What to implement
Schemes should write all auxiliary fields in one function. This includes:
- Specific moisture fractions (
qᶜˡ,qʳ, etc.) from the microphysical state - Derived quantities (
qˡ = qᶜˡ + qʳ,qⁱ = qᶜⁱ + qˢ) - Vapor mass fraction
qᵛfrom the thermodynamic state - Terminal velocities for sedimentation
See WarmRainState implementation below for an example.
Breeze.AtmosphereModels.update_microphysical_fields! — Method
update_microphysical_fields!(
μ,
i,
j,
k,
grid,
microphysics::Nothing,
ρ,
𝒰,
constants
)
Update all microphysical fields at grid point (i, j, k).
This orchestrating function:
- Builds the microphysical state ℳ via
microphysical_state - Calls
update_microphysical_auxiliaries!to write auxiliary fields
Schemes should implement update_microphysical_auxiliaries!, not this function.
AtmosphereModels.Diagnostics
Breeze.AtmosphereModels.Diagnostics.DewpointTemperature — Method
DewpointTemperature(
model;
solver
) -> KernelFunctionOperation{_A, _B, _C, _D, T, K, D} where {_A, _B, _C, _D, T, K<:Breeze.AtmosphereModels.Diagnostics.DewpointTemperatureKernelFunction, D<:Tuple}
Return a KernelFunctionOperation representing the dewpoint temperature $T⁺$.
The dewpoint temperature is the temperature at which the air would become saturated at its current vapor pressure. It is computed by solving the implicit equation:
\[pᵛ⁺(T⁺) = pᵛ\]
using secant iteration, where $pᵛ$ is the actual vapor pressure and $pᵛ⁺$ is the saturation vapor pressure.
For saturated air, the dewpoint temperature equals the actual temperature.
The solver keyword argument (default SecantSolver(reltol=1e-4, abstol=0, maxiter=10)) controls the secant iteration; its convergence criterion compares the vapor pressure residual against the actual vapor pressure $pᵛ$.
Example
using Breezegrid = RectilinearGrid(size=(1, 1, 8), extent=(1, 1, 1e3))model = AtmosphereModel(grid; microphysics=SaturationAdjustment())set!(model, θ=300, qᵗ=0.01)T⁺ = DewpointTemperature(model)# outputKernelFunctionOperation at (Center, Center, Center)├── grid: 1×1×8 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 1×1×3 halo├── kernel_function: DewpointTemperatureKernelFunction└── arguments: ()The result may be wrapped in a Field to store the computed values:
T⁺_field = Field(T⁺)# output1×1×8 Field{Center, Center, Center} on RectilinearGrid on CPU├── grid: 1×1×8 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 1×1×3 halo├── boundary conditions: FieldBoundaryConditions│ └── west: Periodic, east: Periodic, south: Periodic, north: Periodic, bottom: ZeroFlux, top: ZeroFlux, immersed: Nothing├── operand: KernelFunctionOperation at (Center, Center, Center)├── status: time=0.0└── data: 3×3×14 OffsetArray(::Array{Float64, 3}, 0:2, 0:2, -2:11) with eltype Float64 with indices 0:2×0:2×-2:11 └── max=289.056, min=287.474, mean=288.266Breeze.AtmosphereModels.Diagnostics.EquivalentPotentialTemperature — Type
EquivalentPotentialTemperature(model, flavor=:specific)Return a KernelFunctionOperation representing equivalent potential temperature $θᵉ$.
Equivalent potential temperature is conserved during moist adiabatic processes (including condensation and evaporation) and is useful for identifying air masses and tracking convective processes. Following Emanuel1994 equation 4.5.11:
\[θᵉ = T \left(\frac{p₀}{p}\right)^{Rᵈ/cᵖᵐ} \exp\left(\frac{ℒˡ qᵛ}{cᵖᵐ T}\right) ℋ^γ\]
where $ℒˡ$ is the latent heat of vaporization, $qᵛ$ is the vapor mass fraction, $ℋ$ is the relative humidity, and $γ = -Rᵛ qᵛ / cᵖᵐ$.
Arguments
model: AnAtmosphereModelinstance.flavor: Either:specific(default) to return $θᵉ$, or:densityto return $ρ θᵉ$.
Examples
using Breezegrid = RectilinearGrid(size=(1, 1, 8), extent=(1, 1, 1e3))model = AtmosphereModel(grid)set!(model, θ=300, qᵗ=0.01)θᵉ = EquivalentPotentialTemperature(model)Field(θᵉ)# output1×1×8 Field{Center, Center, Center} on RectilinearGrid on CPU├── grid: 1×1×8 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 1×1×3 halo├── boundary conditions: FieldBoundaryConditions│ └── west: Periodic, east: Periodic, south: Periodic, north: Periodic, bottom: ZeroFlux, top: ZeroFlux, immersed: Nothing├── operand: KernelFunctionOperation at (Center, Center, Center)├── status: time=0.0└── data: 3×3×14 OffsetArray(::Array{Float64, 3}, 0:2, 0:2, -2:11) with eltype Float64 with indices 0:2×0:2×-2:11 └── max=326.162, min=325.851, mean=326.006References
- Emanuel, K. A. (1994). Atmospheric Convection. Oxford University Press.
Breeze.AtmosphereModels.Diagnostics.LiquidIcePotentialTemperature — Type
LiquidIcePotentialTemperature(model, flavor=:specific)Return a KernelFunctionOperation representing liquid-ice potential temperature $θˡⁱ$.
Liquid-ice potential temperature is a conserved quantity under moist adiabatic processes that accounts for the latent heat associated with liquid water and ice:
\[θˡⁱ = θ \left(1 - \frac{ℒˡᵣ qˡ + ℒⁱᵣ qⁱ}{cᵖᵐ T}\right)\]
where $θ$ is the mixture potential temperature, $ℒˡᵣ$ and $ℒⁱᵣ$ are the reference latent heats for liquid and ice, and $qˡ$, $qⁱ$ are the liquid and ice mass fractions.
Arguments
model: AnAtmosphereModelinstance.flavor: Either:specific(default) to return $θˡⁱ$, or:densityto return $ρ θˡⁱ$.
Examples
using Breezegrid = RectilinearGrid(size=(1, 1, 8), extent=(1, 1, 1e3))model = AtmosphereModel(grid)set!(model, θ=300, qᵗ=0.01)θˡⁱ = LiquidIcePotentialTemperature(model)Field(θˡⁱ)# output1×1×8 Field{Center, Center, Center} on RectilinearGrid on CPU├── grid: 1×1×8 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 1×1×3 halo├── boundary conditions: FieldBoundaryConditions│ └── west: Periodic, east: Periodic, south: Periodic, north: Periodic, bottom: ZeroFlux, top: ZeroFlux, immersed: Nothing├── operand: KernelFunctionOperation at (Center, Center, Center)├── status: time=0.0└── data: 3×3×14 OffsetArray(::Array{Float64, 3}, 0:2, 0:2, -2:11) with eltype Float64 with indices 0:2×0:2×-2:11 └── max=300.0, min=300.0, mean=300.0Breeze.AtmosphereModels.Diagnostics.PotentialTemperature — Type
PotentialTemperature(model, flavor=:specific)Return a KernelFunctionOperation representing the (mixture) potential temperature $θ$.
The potential temperature is defined as the temperature a parcel would have if adiabatically brought to a reference pressure $p₀$:
\[θ = \frac{T}{Π}\]
where $T$ is temperature and $Π = (p/p₀)^{Rᵐ/cᵖᵐ}$ is the mixture Exner function, computed using the moist air gas constant $Rᵐ$ and heat capacity $cᵖᵐ$.
Arguments
model: AnAtmosphereModelinstance.flavor: Either:specific(default) to return $θ$, or:densityto return $ρ θ$.
Examples
using Breezegrid = RectilinearGrid(size=(1, 1, 8), extent=(1, 1, 1e3))model = AtmosphereModel(grid)set!(model, θ=300, qᵗ=0.01)θ = PotentialTemperature(model)Field(θ)# output1×1×8 Field{Center, Center, Center} on RectilinearGrid on CPU├── grid: 1×1×8 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 1×1×3 halo├── boundary conditions: FieldBoundaryConditions│ └── west: Periodic, east: Periodic, south: Periodic, north: Periodic, bottom: ZeroFlux, top: ZeroFlux, immersed: Nothing├── operand: KernelFunctionOperation at (Center, Center, Center)├── status: time=0.0└── data: 3×3×14 OffsetArray(::Array{Float64, 3}, 0:2, 0:2, -2:11) with eltype Float64 with indices 0:2×0:2×-2:11 └── max=300.0, min=300.0, mean=300.0Breeze.AtmosphereModels.Diagnostics.SaturationSpecificHumidity — Type
SaturationSpecificHumidity(
model
) -> KernelFunctionOperation{_A, _B, _C, _D, T, K, D} where {_A, _B, _C, _D, T, K<:Breeze.AtmosphereModels.Diagnostics.SaturationSpecificHumidityKernelFunction, D<:Tuple}
SaturationSpecificHumidity(
model,
flavor_symbol
) -> KernelFunctionOperation{_A, _B, _C, _D, T, K, D} where {_A, _B, _C, _D, T, K<:Breeze.AtmosphereModels.Diagnostics.SaturationSpecificHumidityKernelFunction, D<:Tuple}
Return a KernelFunctionOperation representing the specified flavor of saturation specific humidity $qᵛ⁺$.
Flavor options
:prognosticReturn the saturation specific humidity corresponding to the
model's prognostic state. This is the same as the equilibrium saturation specific humidity for saturated conditions and a model that uses saturation adjustment microphysics.:equilibriumReturn the saturation specific humidity in potentially-saturated conditions, using the model's specific moisture field. This is equivalent to the
:total_moistureflavor under saturated conditions with no condensate; or in other words, if the specific moisture happens to be equal to the saturation specific humidity.:total_moistureReturn saturation specific humidity in the case that the total specific moisture is equal to the saturation specific humidity and there is no condensate. This is useful for manufacturing perfectly saturated initial conditions.
Breeze.AtmosphereModels.Diagnostics.StabilityEquivalentPotentialTemperature — Type
StabilityEquivalentPotentialTemperature(model, flavor=:specific)Return a KernelFunctionOperation representing stability-equivalent potential temperature $θᵇ$.
Stability-equivalent potential temperature is a moist-conservative variable suitable for computing the moist Brunt-Väisälä frequency. It follows from the derivation in the paper by Durran and Klemp (1982), who show that the moist Brunt-Väisälä frequency $Nᵐ$ is correctly expressed in terms of the vertical gradient of a moist-conservative variable.
The formulation is based on equation (17) by Durran and Klemp (1982):
\[θᵇ = θᵉ \left( \frac{T}{Tᵣ} \right)^{cˡ qˡ / cᵖᵐ}\]
where $θᵉ$ is the equivalent potential temperature, $T$ is temperature, $Tᵣ$ is the energy reference temperature, $cˡ$ is the heat capacity of liquid water, $qᵗ$ is the total moisture specific humidity, and $cᵖᵐ$ is the moist air heat capacity.
This quantity is conserved along moist adiabats and is appropriate for use in stability calculations in saturated atmospheres.
Arguments
model: AnAtmosphereModelinstance.flavor: Either:specific(default) to return $θᵇ$, or:densityto return $ρ θᵇ$.
Examples
using Breezegrid = RectilinearGrid(size=(1, 1, 8), extent=(1, 1, 1e3))model = AtmosphereModel(grid)set!(model, θ=300, qᵗ=0.01)θᵇ = StabilityEquivalentPotentialTemperature(model)Field(θᵇ)# output1×1×8 Field{Center, Center, Center} on RectilinearGrid on CPU├── grid: 1×1×8 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 1×1×3 halo├── boundary conditions: FieldBoundaryConditions│ └── west: Periodic, east: Periodic, south: Periodic, north: Periodic, bottom: ZeroFlux, top: ZeroFlux, immersed: Nothing├── operand: KernelFunctionOperation at (Center, Center, Center)├── status: time=0.0└── data: 3×3×14 OffsetArray(::Array{Float64, 3}, 0:2, 0:2, -2:11) with eltype Float64 with indices 0:2×0:2×-2:11 └── max=326.162, min=325.851, mean=326.006References
- Durran, D. R. and Klemp, J. B. (1982). On the effects of moisture on the Brunt-Väisälä frequency. Journal of the Atmospheric Sciences 39, 2152–2158.
Breeze.AtmosphereModels.Diagnostics.StaticEnergy — Type
StaticEnergy(model, flavor=:specific)Return a KernelFunctionOperation representing moist static energy $e$.
Moist static energy is a conserved quantity in adiabatic, frictionless flow that combines sensible heat, gravitational potential energy, and latent heat:
\[e = cᵖᵐ T + g z - ℒˡᵣ qˡ - ℒⁱᵣ qⁱ\]
where $cᵖᵐ$ is the moist air heat capacity, $T$ is temperature, $g$ is gravitational acceleration, $z$ is height, and $ℒˡᵣ qˡ + ℒⁱᵣ qⁱ$ is the latent heat content of condensate.
This is the prognostic thermodynamic variable used in StaticEnergyThermodynamics.
Arguments
model: AnAtmosphereModelinstance.flavor: Either:specific(default) to return $e$, or:densityto return $ρ e$.
Examples
using Breezegrid = RectilinearGrid(size=(1, 1, 8), extent=(1, 1, 1e3))model = AtmosphereModel(grid)set!(model, θ=300)e = StaticEnergy(model)Field(e)# output1×1×8 Field{Center, Center, Center} on RectilinearGrid on CPU├── grid: 1×1×8 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 1×1×3 halo├── boundary conditions: FieldBoundaryConditions│ └── west: Periodic, east: Periodic, south: Periodic, north: Periodic, bottom: ZeroFlux, top: ZeroFlux, immersed: Nothing├── operand: KernelFunctionOperation at (Center, Center, Center)├── status: time=0.0└── data: 3×3×14 OffsetArray(::Array{Float64, 3}, 0:2, 0:2, -2:11) with eltype Float64 with indices 0:2×0:2×-2:11 └── max=3.03019e5, min=302661.0, mean=3.0284e5Breeze.AtmosphereModels.Diagnostics.VirtualPotentialTemperature — Type
VirtualPotentialTemperature(model, flavor=:specific)Return a KernelFunctionOperation representing virtual potential temperature $θᵛ$.
Virtual potential temperature is the temperature that dry air would need to have in order to have the same density as moist air at the same pressure. To define virtual potential temperature, we first note the definition of virtual temperature:
\[Tᵛ = T \left( 1 + δᵛ qᵛ - qˡ - qⁱ \right)\]
where $δᵛ ≡ Rᵛ / Rᵈ - 1$. This follows from the ideal gas law for a mixture, $p = ρ Rᵐ T$, the mixture gas constant $Rᵐ = qᵈ Rᵈ + qᵛ Rᵛ = Rᵈ \left( 1 + δᵛ qᵛ - qˡ - qⁱ \right)$, and the definition of virtual temperature, $p = ρ Rᵈ Tᵛ$, which leads to
\[Tᵛ = T \frac{Rᵐ}{Rᵈ} = T \left( 1 + δᵛ qᵛ - qˡ - qⁱ \right)\]
The virtual potential temperature is defined analogously,
\[θᵛ = T \left( \frac{pˢᵗ}{p} \right)^{Rᵈ/cᵖᵈ} \left( 1 + δᵛ qᵛ - qˡ - qⁱ \right) .\]
Note that $Rᵛ / Rᵈ ≈ 1.608$ for water vapor and a dry air mixture typical to Earth's atmosphere, and that $δᵛ ≈ 0.608$.
using Breezegrid = RectilinearGrid(size=(1, 1, 8), extent=(1, 1, 1e3))model = AtmosphereModel(grid)set!(model, θ=300, qᵗ=0.01)θᵛ = VirtualPotentialTemperature(model)Field(θᵛ)# output1×1×8 Field{Center, Center, Center} on RectilinearGrid on CPU├── grid: 1×1×8 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 1×1×3 halo├── boundary conditions: FieldBoundaryConditions│ └── west: Periodic, east: Periodic, south: Periodic, north: Periodic, bottom: ZeroFlux, top: ZeroFlux, immersed: Nothing├── operand: KernelFunctionOperation at (Center, Center, Center)├── status: time=0.0└── data: 3×3×14 OffsetArray(::Array{Float64, 3}, 0:2, 0:2, -2:11) with eltype Float64 with indices 0:2×0:2×-2:11 └── max=301.82, min=301.8, mean=301.81Breeze.AtmosphereModels.Diagnostics.azimuthal_mean! — Method
azimuthal_mean!(profile, field; center, m) -> Any
Remap field (on an $(x, y, z)$ grid) onto the radial rings of profile (on an $(r, z)$ grid) about center, in place, by area-weighted binning of m × m sub-cells per Cartesian cell. profile and field must share their vertical grid; the radial rings are profile's uniform x-cells.
Breeze.AtmosphereModels.Diagnostics.azimuthal_mean — Method
azimuthal_mean(field; radius, Nr, center, m)
Azimuthally average field into radial rings about center = (xc, yc), returning a Field on a one-dimensional-in-radius grid — Bounded in radius, Flat in azimuth, and Bounded in z — with Nr uniform rings spanning $[0, \texttt{radius}]$ and the same vertical grid as field.
Each Cartesian cell is split into an m × m block of sub-cells that are binned by radius, so a cell contributes to every ring it overlaps — uniform sub-sampling is area-weighting, which makes this a first-order conservative remap onto the radial rings (a pragmatic stand-in for a reduction on a true cylindrical grid). The kernel runs on the CPU and the GPU. Larger m resolves the rings more finely and keeps near-center rings populated; any ring that still catches nothing (only when $\texttt{radius}/N_r$ is finer than a sub-cell) is filled with NaN, not zero, so it reads as "no data" and doesn't bias a subsequent radial average.
using Oceananigans, Breezegrid = RectilinearGrid(size=(64, 64, 4), x=(-1, 1), y=(-1, 1), z=(0, 1), topology=(Periodic, Periodic, Bounded))c = CenterField(grid)set!(c, (x, y, z) -> 5) # a constant fieldc̄ = azimuthal_mean(c; radius=1, Nr=8)maximum(c̄) # the azimuthal mean of a constant is that constant# output5.0BoundaryConditions
Breeze.BoundaryConditions.BulkDragFunction — Method
BulkDragFunction(; direction=nothing, coefficient=1e-3, gustiness=0,
surface_temperature=nothing, filtered_velocities=nothing)Create a bulk drag function for computing surface momentum fluxes using bulk aerodynamic formulas. The momentum flux is computed in the same form as the scalar bulk fluxes,
\[Jᵘ = - ρ₀ Cᴰ |U| u\]
where Cᴰ is the drag coefficient, |U| = √(u² + v² + gustiness²) is the wind speed (with gustiness to prevent singularities at low wind), u is the velocity component at the first cell face, and ρ₀ is the surface density computed from the surface pressure and surface temperature. Monin–Obukhov similarity is a profile law for u (not ρu), so using u here keeps the formulation consistent with the similarity theory underlying Cᴰ.
When a FilteredSurfaceVelocities is supplied via filtered_velocities, every field entering the formula — the wind speed |U|, the velocity u, and the virtual potential temperature θᵥ used in stability — is read from the filtered state. The surface density ρ₀ is computed from the (slowly varying) surface temperature and pressure and is not filtered. Temporal filtering of the matching velocity is used to mitigate log-layer mismatch in wall-modeled large-eddy simulations, where the spurious correlation between the instantaneous friction velocity and matching-velocity fluctuations otherwise biases the surface stress (Nishizawa & Kitamura (2018); Shin, Yang & Howland (2025)).
Monin–Obukhov consistency
ρ₀ is computed from surface quantities (surface_pressure and surface_temperature) via the ideal gas law, so it is a true surface density — independent of the vertical grid resolution. Using the prognostic density at the first cell would introduce a grid-dependent ρ₀ (the first-cell height ½Δz shifts the value as the grid is refined), which is inconsistent with the bulk-flux closure derived from Monin–Obukhov similarity.
Default surface temperature
If the user does not supply surface_temperature, materialization calls default_drag_surface_temperature(dynamics, …). The default exists for AnelasticDynamics (recovered from the reference state via Exner) but raises for CompressibleDynamics, which has no equivalent reference profile — pass surface_temperature explicitly in that case.
Keyword Arguments
direction: The direction of the momentum component (XDirection()orYDirection()). Ifnothing, the direction is inferred from the field location during boundary condition regularization.coefficient: The drag coefficient (default:1e-3). Can be a constant or aPolynomialCoefficientfor wind and stability-dependent transfer coefficients.gustiness: Minimum wind speed to prevent singularities when winds are calm (default:0)surface_temperature: Surface temperature, used to computeρ₀and required when usingPolynomialCoefficientwith stability correction. Can be aField,Function, orNumber. (default:nothing)filtered_velocities: AFilteredSurfaceVelocitiesfor temporally filtered wind speed, near-surface velocity, andθᵥin the bulk formula. Ifnothing(default), instantaneous fields are used.
Breeze.BoundaryConditions.BulkSensibleHeatFluxFunction — Method
BulkSensibleHeatFluxFunction(
;
coefficient,
gustiness,
surface_temperature,
filtered_velocities
)
A bulk sensible heat flux function. The flux is computed as:
\[J = - ρ₀ Cᵀ |U| Δϕ\]
where $Cᵀ$ is the transfer coefficient, $|U|$ is the wind speed, and $Δϕ$ is the difference between the near-surface atmospheric value and the surface value of the thermodynamic variable appropriate to the formulation:
- For
LiquidIcePotentialTemperatureFormulation: $Δϕ = θ - θ₀$, where $θ₀ = T₀ / Π₀$ and $Π₀ = (p₀ / pˢᵗ)^{Rᵈ / cᵖᵈ}$ (potential temperature flux) - For
StaticEnergyFormulation: $Δϕ = e - cᵖᵈ T₀$ (static energy flux)
Here $p₀$ is the actual surface pressure, while $pˢᵗ$ is the fixed reference pressure used to define potential temperature.
The formulation is set automatically during model construction based on the thermodynamic formulation.
Keyword Arguments
coefficient: The sensible heat transfer coefficient.gustiness: Minimum wind speed to prevent singularities (default:0).surface_temperature: The surface temperature. Can be aField, aFunction, or aNumber. Functions are converted to Fields during model construction.filtered_velocities: Eithernothing(default) orFilteredSurfaceVelocities. Note that whenfiltered_velocitiesis notnothing, then automatically there is filtering in the scalar fields viaFilteredSurfaceScalarwith the same parameters (e.g.,height,timescale) asfiltered_velocities.
Breeze.BoundaryConditions.BulkVaporFluxFunction — Method
BulkVaporFluxFunction(; coefficient, gustiness=0, surface_temperature, filtered_velocities=nothing)Create a bulk vapor flux function for computing surface moisture fluxes. The flux is computed as:
\[Jᵛ = - ρ₀ Cᵛ |U| (qᵗ - qᵛ₀)\]
where $Cᵛ$ is the transfer coefficient, $|U|$ is the wind speed, $qᵗ$ is the atmospheric specific humidity, and $qᵛ₀$ is the saturation specific humidity at the surface.
Keyword Arguments
coefficient: The vapor transfer coefficient.gustiness: Minimum wind speed to prevent singularities (default:0).surface_temperature: The surface temperature. Can be aField, aFunction, or aNumber. Used to compute saturation specific humidity at the surface.filtered_velocities: Eithernothing(default) orFilteredSurfaceVelocities. Note that whenfiltered_velocitiesis notnothing, then automatically there is filtering in the scalar fields viaFilteredSurfaceScalarwith the same parameters (e.g.,height,timescale) asfiltered_velocities.
Breeze.BoundaryConditions.EnergyFluxBoundaryConditionFunction — Type
EnergyFluxBoundaryConditionFunctionA wrapper for boundary conditions that converts energy flux to potential temperature flux.
When using LiquidIcePotentialTemperatureFormulation, the prognostic thermodynamic variable is $ρθ$ (potential temperature density). This wrapper allows users to specify energy fluxes (e.g., sensible heat flux in W/m²) which are converted to potential temperature fluxes by dividing by the local mixture heat capacity $cᵖᵐ$.
The relationship is:
\[Jᶿ = 𝒬 / cᵖᵐ\]
where $𝒬$ is the energy flux and $Jᶿ$ is the potential temperature flux.
The mixture heat capacity is computed using moisture fractions from the microphysics scheme, which correctly accounts for liquid and ice condensate when present.
Breeze.BoundaryConditions.FilteredSurfaceScalar — Method
FilteredSurfaceScalar(grid; height=nothing, filter_timescale=Inf)A two-dimensional field storing a temporally filtered near-surface scalar for use in bulk flux boundary conditions.
The filter update is the same exponential form as FilteredSurfaceVelocities.
Keyword Arguments
height: Reference height (m) for scalar evaluation. Ifnothing, the first grid cell center value is used.filter_timescale: Filter time scaleτin seconds (default:Inf).
Breeze.BoundaryConditions.FilteredSurfaceVelocities — Method
FilteredSurfaceVelocities(grid; height=nothing, filter_timescale=Inf)Two-dimensional fields storing temporally filtered near-surface velocities and virtual potential temperature for use in bulk flux boundary conditions. Filtering the matching velocity mitigates log-layer mismatch in wall-modeled large-eddy simulations by removing the spurious correlation between the instantaneous friction velocity and matching-velocity fluctuations (Nishizawa & Kitamura (2018); Shin, Yang & Howland (2025)).
The filtered velocities ū, v̄ (and θ̄ᵥ when a stability-dependent bulk coefficient is attached) are updated each time step via an exponential (first-order) filter:
ū ← (ū + ϵ u_new) / (1 + ϵ), ϵ = Δt / τwhere τ is the filter_timescale.
θ̄ᵥ is updated from the virtual-potential-temperature diagnostic owned by any attached PolynomialCoefficient; when the bulk coefficient is a plain Number (no stability correction) the θ̄ᵥ field is allocated but unused.
Keyword Arguments
height: Reference height (m) for velocity evaluation. Ifnothing(default), the first grid cell center value is used. If a number, velocity is linearly interpolated to that height. (θ̄ᵥis always read at the first cell center, matching the height at whichbulk_coefficientevaluates stability.)filter_timescale: Filter time scaleτin seconds (default:Inf, no filtering).
Breeze.BoundaryConditions.FittedStabilityFunction — Method
FittedStabilityFunction(scalar_roughness_length;
richardson_number_mapping = RichardsonNumberMapping(typeof(scalar_roughness_length)),
stability_function_parameters = StabilityFunctionParameters(typeof(scalar_roughness_length)))Stability correction based on Monin-Obukhov similarity theory using the Li et al. (2010) analytical mapping from bulk Richardson number to the stability parameter $ζ = z/L$.
Uses Hogström (1996) integrated stability functions for unstable conditions and Beljaars & Holtslag (1991) for stable conditions.
Applies structurally correct (and different) corrections for momentum vs scalar transfer:
- Momentum: $Cᴰ = Cᴰ_N [α / (α - Ψᴰ)]²$
- Scalar: $Cᵀ = Cᵀ_N [α / (α - Ψᴰ)] [β_h / (β_h - Ψᵀ)]$
where $α = \ln(z/ℓ)$, $β_h = \ln(z/ℓ_h)$.
FittedStabilityFunction is callable: sf(Riᴮ, α, β) returns the momentum stability correction factor, and sf(Riᴮ, α, β, Val(:scalar)) returns the scalar correction factor.
Arguments
scalar_roughness_length: Roughness length for heat/moisture $ℓ_h$ (m).
Keyword Arguments
richardson_number_mapping:RichardsonNumberMappingcoefficients (default: Li et al. (2010)).stability_function_parameters:StabilityFunctionParameters(default: Hogström (1996) / Beljaars & Holtslag (1991)).
References
- Beljaars, A. C. M., & Holtslag, A. A. M. (1991). Flux parameterization over land surfaces for atmospheric models. Journal of Applied Meteorology, 30, 327-341.
- Hogström, U. L. F. (1996). Review of some basic characteristics of the atmospheric surface layer. Boundary-Layer Meteorology, 78, 215-246.
- Li, Y., Gao, Z., Lenschow, D. H., & Chen, F. (2010). An improved approach for parameterizing surface-layer turbulent transfer coefficients in numerical models. Boundary-Layer Meteorology, 137, 153-165.
Breeze.BoundaryConditions.PolynomialCoefficient — Type
PolynomialCoefficient(
;
...
) -> PolynomialCoefficient{_A, Nothing, SF, PlanarLiquidSurface, Nothing, Nothing, Nothing, Nothing} where {_A, SF<:(FittedStabilityFunction{_A, RM, SP} where {_A, RM<:Breeze.BoundaryConditions.RichardsonNumberMapping, SP<:Breeze.BoundaryConditions.StabilityFunctionParameters})}
PolynomialCoefficient(
FT;
polynomial,
roughness_length,
minimum_wind_speed,
stability_function,
surface,
transfer_type
) -> PolynomialCoefficient{_A, Nothing, SF, PlanarLiquidSurface, Nothing, Nothing, Nothing, Nothing} where {_A, SF<:(FittedStabilityFunction{_A, RM, SP} where {_A, RM<:Breeze.BoundaryConditions.RichardsonNumberMapping, SP<:Breeze.BoundaryConditions.StabilityFunctionParameters})}
A bulk transfer coefficient that depends on wind speed and atmospheric stability, following Large and Yeager (2009).
The neutral transfer coefficient at 10 m follows the Large and Yeager (2009) form:
\[C^N_{10}(U_h) = (a_0 + a_1 U_h + a_2 / U_h) × 10^{-3}\]
where $U_h$ is the wind speed at measurement height $h$.
The coefficient is adjusted for measurement height using logarithmic profile theory, and stability correction is applied based on the bulk Richardson number.
When polynomial is nothing, the appropriate Large and Yeager (2009) polynomial will be automatically selected based on the boundary condition type:
BulkDrag:default_neutral_drag_polynomial=(0.142, 0.076, 2.7)for momentumBulkSensibleHeatFlux:default_neutral_sensible_heat_polynomial=(0.128, 0.068, 2.43)for sensible heatBulkVaporFlux:default_neutral_latent_heat_polynomial=(0.120, 0.070, 2.55)for latent heat
Keyword Arguments
polynomial: Tuple(a₀, a₁, a₂)for the polynomial. Ifnothing, the polynomial is automatically selected by the boundary condition constructor.roughness_length: Surface roughnessℓin meters (default: 1.5e-4, typical for ocean)minimum_wind_speed: Minimum wind speed to avoid singularity in a₂/U term (default: 0.1 m/s)stability_function: Stability correction strategy. Default isFittedStabilityFunctionusing Li et al. (2010) $Riᴮ → ζ$ mapping with Hogström (1996) / Beljaars & Holtslag (1991) MOST stability functions. The scalar roughness length defaults toroughness_length / 7.3(typical ocean value). Usenothingto disable stability correction.surface: Surface type for computing saturation specific humidity in the stability correction. Default isPlanarLiquidSurface(). UsePlanarIceSurface()for ice surfaces.
The measurement height is automatically determined from the grid as the height of the first cell center above the surface.
Examples
using Breeze.BoundaryConditions: PolynomialCoefficient# Polynomial coefficient with default settingscoef = PolynomialCoefficient()# outputPolynomialCoefficient{Float64}├── polynomial: nothing├── roughness_length: 0.00015 m├── minimum_wind_speed: 0.1 m/s├── surface: PlanarLiquidSurface└── stability_function: FittedStabilityFunction (Li et al. 2010)using Breeze.BoundaryConditions: PolynomialCoefficient# With explicit polynomialcoef = PolynomialCoefficient(polynomial = (0.142, 0.076, 2.7))# outputPolynomialCoefficient{Float64}├── polynomial: (0.142, 0.076, 2.7)├── roughness_length: 0.00015 m├── minimum_wind_speed: 0.1 m/s├── surface: PlanarLiquidSurface└── stability_function: FittedStabilityFunction (Li et al. 2010)using Breeze.BoundaryConditions: PolynomialCoefficient# No stability correctioncoef = PolynomialCoefficient(stability_function = nothing)# outputPolynomialCoefficient{Float64}├── polynomial: nothing├── roughness_length: 0.00015 m├── minimum_wind_speed: 0.1 m/s├── surface: PlanarLiquidSurface└── stability_function: NothingReferences
- Beljaars, A. C. M., & Holtslag, A. A. M. (1991). Flux parameterization over land surfaces for atmospheric models. Journal of Applied Meteorology, 30, 327-341.
- Hogström, U. L. F. (1996). Review of some basic characteristics of the atmospheric surface layer. Boundary-Layer Meteorology, 78, 215-246.
- Large, W., & Yeager, S. G. (2009). The global climatology of an interannually varying air–sea flux data set. Climate dynamics, 33(2), 341-364.
- Li, Y., Gao, Z., Lenschow, D. H., & Chen, F. (2010). An improved approach for parameterizing surface-layer turbulent transfer coefficients in numerical models. Boundary-Layer Meteorology, 137, 153-165.
Breeze.BoundaryConditions.RichardsonNumberMapping — Type
RichardsonNumberMapping(FT = Oceananigans.defaults.FloatType;
stable_unstable_transition = 0,
strongly_stable_transition = 0.2,
aᵘ₁₁ = 0.0450, bᵘ₁₁ = 0.0030, bᵘ₁₂ = 0.0059,
aᵘ₂₁ = -0.0828, aᵘ₂₂ = 0.8845,
bᵘ₃₁ = 0.1739, bᵘ₃₂ = -0.9213, bᵘ₃₃ = -0.1057,
aʷ₁₁ = 0.5738, aʷ₁₂ = -0.4399,
aʷ₂₁ = -4.901, aʷ₂₂ = 52.50,
bʷ₁₁ = -0.0539, bʷ₁₂ = 1.540,
bʷ₂₁ = -0.6690, bʷ₂₂ = -3.282,
aˢ₁₁ = 0.7529, aˢ₂₁ = 14.94,
bˢ₁₁ = 0.1569, bˢ₂₁ = -0.3091, bˢ₂₂ = -1.303)Regression coefficients for the non-iterative mapping from bulk Richardson number $Riᴮ$ to the Monin-Obukhov stability parameter $ζ = z/L$, following Li et al. (2010).
The superscripts u, w, s denote unstable, weakly stable, and strongly stable regimes respectively. Subscript indices follow the original paper.
Three regimes:
- Unstable ($Riᴮ <$
stable_unstable_transition): Eq. (12) - Weakly stable (
stable_unstable_transition$≤ Riᴮ ≤$strongly_stable_transition): Eq. (14) - Strongly stable ($Riᴮ >$
strongly_stable_transition): Eq. (16)
References
- Li, Y., Gao, Z., Lenschow, D. H., & Chen, F. (2010). An improved approach for parameterizing surface-layer turbulent transfer coefficients in numerical models. Boundary-Layer Meteorology, 137, 153-165.
Breeze.BoundaryConditions.StabilityFunctionParameters — Type
StabilityFunctionParameters(FT = Oceananigans.defaults.FloatType;
γᴰ = 19.3,
γᵀ = 11.6,
a = 1,
b = 2/3,
c = 5,
d = 0.35)Parameters for the integrated Monin-Obukhov stability functions $Ψ^D(ζ)$ and $Ψ^T(ζ)$.
Note: we use superscript D (drag/momentum) and T (temperature/scalar) to match the transfer coefficient notation $Cᴰ$, $Cᵀ$ established in notation.md. In the literature these are commonly written $Ψ_m$ and $Ψ_h$.
For unstable conditions ($ζ < 0$), uses Hogström (1996):
- $φ^D = (1 - γ^D ζ)^{-1/4}$
- $φ^T = 0.95(1 - γ^T ζ)^{-1/2}$
For stable conditions ($ζ ≥ 0$), uses Beljaars & Holtslag (1991):
- $Ψ^D = -[a ζ + b (ζ - c/d) e^{-dζ} + bc/d]$
- $Ψ^T = -[(1 + 2aζ/3)^{3/2} + b (ζ - c/d) e^{-dζ} + bc/d - 1]$
References
- Beljaars, A. C. M., & Holtslag, A. A. M. (1991). Flux parameterization over land surfaces for atmospheric models. Journal of Applied Meteorology, 30, 327-341.
- Hogström, U. L. F. (1996). Review of some basic characteristics of the atmospheric surface layer. Boundary-Layer Meteorology, 78, 215-246.
Breeze.BoundaryConditions.ThetaFluxBoundaryConditionFunction — Type
ThetaFluxBoundaryConditionFunctionA wrapper for boundary conditions that converts potential temperature flux to energy flux.
When building a diagnostic energy_density field from a PotentialTemperatureFormulation, the boundary conditions on ρθ (potential temperature density) must be converted to energy flux boundary conditions by multiplying by the local mixture heat capacity $cᵖᵐ$.
The relationship is:
\[𝒬 = Jᶿ cᵖᵐ\]
where $𝒬$ is the energy flux and $Jᶿ$ is the potential temperature flux.
Breeze.BoundaryConditions.BulkDrag — Method
BulkDrag(; direction=nothing, coefficient=1e-3, gustiness=0, surface_temperature=nothing)Create a FluxBoundaryCondition for surface momentum drag.
See BulkDragFunction for details.
Examples
using Breezedrag = BulkDrag(coefficient=1e-3, gustiness=0.1)# outputFluxBoundaryCondition: BulkDragFunction(direction=Nothing, coefficient=0.001, gustiness=0.1)Or with explicit direction, e.g., XDirection() for u:
using Oceananigans.Grids: XDirectionu_drag = BulkDrag(direction=XDirection(), coefficient=1e-3)ρu_bcs = FieldBoundaryConditions(bottom=u_drag)# outputOceananigans.FieldBoundaryConditions, with boundary conditions├── west: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing)├── east: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing)├── south: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing)├── north: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing)├── bottom: FluxBoundaryCondition: BulkDragFunction(direction=XDirection(), coefficient=0.001, gustiness=0)├── top: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing)└── immersed: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing)and similarly for YDirection for v.
Breeze.BoundaryConditions.BulkSensibleHeatFlux — Method
BulkSensibleHeatFlux(; coefficient, gustiness=0, surface_temperature)Create a FluxBoundaryCondition for surface sensible heat flux.
The bulk formula computes
\[J = -ρ₀ Cᵀ |U| Δϕ\]
where $Δϕ$ depends on the thermodynamic formulation: $Δθ$ for potential temperature or $Δe$ for static energy. The formulation is set automatically during model construction.
See BulkSensibleHeatFluxFunction for details.
Example
using BreezeT₀(x, y) = 290 + 2 * sign(cos(2π * x / 20e3))ρe_bc = BulkSensibleHeatFlux(coefficient = 1e-3, gustiness = 0.1, surface_temperature = T₀)# outputFluxBoundaryCondition: BulkSensibleHeatFluxFunction(coefficient=0.001, gustiness=0.1)Breeze.BoundaryConditions.BulkVaporFlux — Method
BulkVaporFlux(; coefficient, surface_temperature, gustiness=0)Create a FluxBoundaryCondition for surface moisture flux.
The saturation specific humidity at the surface is automatically computed from surface_temperature.
See BulkVaporFluxFunction for details.
Example
using BreezeT₀(x, y) = 290 + 2 * sign(cos(2π * x / 20e3))moisture_bc = BulkVaporFlux(coefficient = 1e-3, gustiness = 0.1, surface_temperature = T₀)# outputFluxBoundaryCondition: BulkVaporFluxFunction(coefficient=0.001, gustiness=0.1)Breeze.BoundaryConditions.EnergyFluxBoundaryCondition — Method
EnergyFluxBoundaryCondition(flux)Create a boundary condition that wraps an energy flux and converts it to a potential temperature flux for use with LiquidIcePotentialTemperatureFormulation.
The energy flux is divided by the local mixture heat capacity $cᵖᵐ$ to obtain the potential temperature flux: $Jᶿ = 𝒬 / cᵖᵐ$.
Breeze.BoundaryConditions.ThetaFluxBoundaryCondition — Method
ThetaFluxBoundaryCondition(flux)Create a boundary condition that wraps a potential temperature flux and converts it to an energy flux for use with diagnostic energy density fields.
The potential temperature flux is multiplied by the local mixture heat capacity $cᵖᵐ$ to obtain the energy flux: $𝒬 = Jᶿ cᵖᵐ$.
CelestialMechanics
Breeze.CelestialMechanics.cos_solar_zenith_angle — Method
cos_solar_zenith_angle(
i,
j,
grid::RectilinearGrid{<:Any, <:Flat, <:Flat, <:Bounded},
datetime::Dates.DateTime
) -> Any
Compute the cosine of the solar zenith angle for the grid's location.
For single-column grids with Flat horizontal topology, extracts latitude from the y-coordinate and longitude from the x-coordinate.
Breeze.CelestialMechanics.cos_solar_zenith_angle — Method
cos_solar_zenith_angle(
datetime::Dates.DateTime,
longitude,
latitude
) -> Any
Compute the cosine of the solar zenith angle for a given datetime and location.
The solar zenith angle $θ_z$ satisfies:
\[\cos(θ_z) = \sin(φ) \sin(δ) + \cos(φ) \cos(δ) \cos(ω)\]
where:
- $φ$ is the latitude
- $δ$ is the solar declination
- $ω$ is the hour angle
Arguments
datetime: UTC datetimelatitude: latitude in degrees (positive North)longitude: longitude in degrees (positive East)
Returns
A value between -1 and 1. Negative values indicate the sun is below the horizon.
Breeze.CelestialMechanics.day_of_year — Method
day_of_year(dt::Dates.DateTime) -> Int64
Return the day of year (1-365/366) for a given DateTime.
Breeze.CelestialMechanics.equation_of_time — Method
equation_of_time(day_of_year) -> Any
Compute the equation of time (in minutes) for a given day of year.
This accounts for the difference between mean solar time and apparent solar time due to the eccentricity of Earth's orbit and the obliquity of the ecliptic.
Uses the approximation by Spencer (1971); see solar_declination.
References
- Spencer, J. W. (1971) Fourier series representation of the position of the sun. Search, 2, 162-172.
Breeze.CelestialMechanics.hour_angle — Method
hour_angle(datetime::Dates.DateTime, longitude) -> Any
Compute the hour angle (in radians) for a given datetime and longitude.
The hour angle $ω$ is zero at solar noon and increases by 15° per hour (Earth rotates 360°/24h = 15°/h).
Arguments
datetime: UTC datetimelongitude: longitude in degrees (positive East)
Breeze.CelestialMechanics.solar_declination — Method
solar_declination(day_of_year) -> Any
Compute the solar declination angle (in radians) for a given day of year.
Uses the approximation by Spencer (1971):
\[δ = 0.006918 - 0.399912 \cos(γ) + 0.070257 \sin(γ) - 0.006758 \cos(2γ) + 0.000907 \sin(2γ) - 0.002697 \cos(3γ) + 0.00148 \sin(3γ)\]
where $γ = 2π (d - 1) / 365$ is the fractional year in radians and $d$ is the day of year.
References
- Spencer, J. W. (1971) Fourier series representation of the position of the sun. Search, 2, 162-172.
CompressibleEquations
Breeze.CompressibleEquations — Module
CompressibleEquationsModule implementing fully compressible dynamics for atmosphere models.
The compressible formulation directly time-steps density as a prognostic variable and computes pressure from the ideal gas law. This formulation does not filter acoustic waves, so explicit time-stepping with small time steps (or acoustic substepping) is required.
The fully compressible Euler equations in conservation form are:
\[\begin{aligned} &\text{Mass:} && \partial_t \rho + \boldsymbol{\nabla \cdot} (\rho \boldsymbol{u}) = 0 \\ &\text{Momentum:} && \partial_t (\rho \boldsymbol{u}) + \boldsymbol{\nabla \cdot} (\rho \boldsymbol{u} \boldsymbol{u}) + \boldsymbol{\nabla} p = -\rho g \hat{\boldsymbol{z}} + \rho \boldsymbol{f} + \boldsymbol{\nabla \cdot \mathcal{T}} \end{aligned}\]
Pressure is computed from the ideal gas law:
\[p = \rho R^m T\]
where $R^m$ is the mixture gas constant.
Breeze.CompressibleEquations.AbstractRamp — Type
Abstract supertype for upper-sponge ramp shapes. A concrete AbstractRamp is callable as (ramp)(z, sponge_top, depth) and returns a value in $[0, 1]$: zero below $z_{\rm sponge\_top} - \text{depth}$, rising to one at the lid $z = z_{\rm sponge\_top}$.
Breeze.CompressibleEquations.AcousticDampingStrategy — Type
abstract type AcousticDampingStrategyAbstract supertype for divergence damping applied inside the substep loop.
Concrete subtypes:
NoDivergenceDamping— no damping.ThermalDivergenceDamping— Klemp, Skamarock & Ha (2018) momentum correction using the discrete $δ_τ(ρθ)$ tendency as the divergence proxy. This is the default used bySplitExplicitTimeDiscretization.
Breeze.CompressibleEquations.AcousticOuterScheme — Type
abstract type AcousticOuterSchemeAbstract supertype for the outer Runge–Kutta scheme that drives the acoustic substep loop. The current implementation supports a single concrete subtype:
WickerSkamarock3— three-stage Wicker–Skamarock RK3 with stage fractions $β = (1/3, 1/2, 1)$. This is the only outer scheme supported today and the default forSplitExplicitTimeDiscretization.
The interface exists to make the outer-scheme commitment explicit in the type system and to provide a clean extension point for a future Multirate Infinitesimal Step (MIS) outer scheme. A concrete subtype is expected to provide a stage_fractions method returning its stage-fraction tuple.
Breeze.CompressibleEquations.AcousticSubstepDistribution — Type
abstract type AcousticSubstepDistributionAbstract supertype for the choice of how acoustic substeps are distributed across the three Wicker–Skamarock RK3 stages.
Concrete subtypes:
ProportionalSubsteps— each stage independently covers its own interval $β Δt$ with $Nτ = ⌈β N⌉$ substeps of size $Δτ = β Δt / Nτ$ (count proportional to the stage fraction; size fitted so the substeps exactly tile $β Δt$). This is the default.ConstantSubstepSize— every stage uses the same substep size $Δτ = Δt/N$ ($N$ rounded up to a multiple of 6 so $β N$ is integral), with stage-dependent counts $Nτ = β N$.MonolithicFirstStage— stage 1 collapses to a single substep of size $Δt/3$; stages 2 and 3 are the same asConstantSubstepSize.
Breeze.CompressibleEquations.AcousticSubstepper — Type
struct AcousticSubstepper{N, FT, D, AD, US, CF, MP, TAV, GT, TS}Storage and parameters for the split-explicit acoustic substepper (scheme described in the module header). Πᴸ=(pᴸ/pˢᵗ)^κ, θᴸ=ρθᴸ/ρᴸ, γᵐRᵐᴸ are cached once per stage (recomputing inline per call is much slower on H100); ρᴸ, ρθᴸ, pᴸ and the stage-entry momenta are read live from model.dynamics.* / model.momentum.* (untouched by the loop) and are the recovery base for _recover_full_state! — no snapshot fields. The vertical solve is a (possibly off-centered) Crank-Nicolson tridiagonal Schur system for (ρw)′.
Fields:
substeps: acoustic substeps N per Δt (nothing⇒ adaptive viaacoustic_cfl).acoustic_cfl: target horizontal acoustic Courant number for the adaptive count (default 0.5).forward_weight: CN off-centering ω (0.5 = centered; default 0.65).damping,substep_distribution: divergence-damping strategy; substep allocation across WS-RK3 stages.linearization_exner(Πᴸ),linearization_potential_temperature(θᴸ),linearization_gamma_R_mixture(γᵐRᵐᴸ, the moist PGF coefficient): per-stage caches.density_perturbation(ρ′),density_potential_temperature_perturbation((ρθ)′),momentum_perturbation((ρu/v/w)′ as.u/.v/.w): perturbation prognostics advanced in the loop.density_predictor,density_potential_temperature_predictor: explicit predictors before the vertical solve.previous_density_potential_temperature_perturbation: prior-substep (ρθ)′, for Klemp 2018 damping.time_averaged_velocities: acoustic-mean velocity for non-acoustic scalar transport (moisture/tracers/ chemistry/TKE); the slow ρθ tendency uses the current RK predictor velocity instead, not this cache.slow_vertical_momentum_tendency(Gˢρw, z-faces): advection+Coriolis+closure+forcing (PGF/buoyancy excluded — those are in the fast operator).vertical_solver:BatchedTridiagonalSolverfor the implicit (ρw)′ update.
Breeze.CompressibleEquations.AcousticSubstepper — Method
AcousticSubstepper(
grid,
split_explicit::SplitExplicitTimeDiscretization;
prognostic_momentum,
substep_floattype
) -> AcousticSubstepper{_A, _B, _C, AD, _D, CF, MP, TAV, GT, TS} where {_A, _B, _C, AD<:AcousticSubstepDistribution, _D, CF<:(Field{Center, Center, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}), MP<:(NamedTuple{(:u, :v, :w), <:Tuple{Field{Face, Center, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}, Field{Center, Face, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}, Field{Center, Center, Face, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}}}), TAV<:(NamedTuple{(:u, :v, :w), <:Tuple{Field{Face, Center, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}, Field{Center, Face, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}, Field{Center, Center, Face, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}}}), GT<:(Field{Center, Center, Face, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}), TS<:(Oceananigans.Solvers.BatchedTridiagonalSolver{Breeze.CompressibleEquations.AcousticTridiagLower, Breeze.CompressibleEquations.AcousticTridiagDiagonal, Breeze.CompressibleEquations.AcousticTridiagUpper, _A, G, Nothing, Oceananigans.Grids.ZDirection} where {_A, G<:Oceananigans.Grids.AbstractGrid})}
Construct an AcousticSubstepper. The perturbation face fields $(ρu)′, (ρv)′, (ρw)′$ and the scalar-transport velocities use topology-derived BCs (periodic wrap / impenetrability), not the prognostic momentum's BCs: inheriting them would imprint the full-state wall target onto the perturbation halo for a nonzero NormalFlowBoundaryCondition (issue #716) and apply momentum BCs to velocity fields. The wall target re-enters via the prognostic momentum's own BC after each substep's momentum update. The prognostic_momentum kwarg is retained for backwards compatibility but no longer consulted.
Breeze.CompressibleEquations.CompressibleDynamics — Type
struct CompressibleDynamics{TD, D, DT, P, FT, RS, TM, CV, CM}Fully compressible dynamics with prognostic density and diagnostic pressure.
Fields
dry_density: Prognostic dry-air density field ρᵈtotal_density: Diagnosed total air density ρ = ρᵈ + Σρˣ (used for thermodynamics, scalar advection, EOS, buoyancy)pressure: Diagnostic pressure field p = ρ Rᵐ Tstandard_pressure: Reference pressure pˢᵗ for potential temperature (default 10⁵ Pa)surface_pressure: Mean pressure at the bottom of the atmosphere p₀time_discretization: Time discretization scheme (SplitExplicitTimeDiscretizationorExplicitTimeStepping)reference_state: The single fixed hydrostatically-balanced reference state for base-state pressure/buoyancy correction (perturbation-form PGF), ornothingwhen disabled. AnExnerReferenceStatewhose fields are grid-polymorphic: a 1D column on height-coordinate grids, and horizontally-varying 3D fields on terrain-following grids (where a single column is not hydrostatically consistent per terrain column).terrain_metrics:TerrainMetricsfor terrain-following coordinates (ornothing). This — notreference_state— is the sole "is this a terrain grid?" signal.w̃,ρw̃: contravariant vertical velocity / momentum diagnostic fields (ornothingwhen no terrain metrics)
The time_discretization determines how tendencies are computed and which time-stepper is used:
SplitExplicitTimeDiscretization: Acoustic substepping with separate slow/fast tendenciesExplicitTimeStepping: All tendencies computed together (small Δt required)
The moist equation-of-state θˡⁱ→T temperature inversion is controlled by the thermodynamic formulation, not the dynamics: see temperature_solver on LiquidIcePotentialTemperatureFormulation.
Breeze.CompressibleEquations.CompressibleDynamics — Method
CompressibleDynamics(
;
...
) -> CompressibleDynamics{ExplicitTimeStepping, Nothing, Nothing, Nothing, Float64, Breeze.CompressibleEquations.AutoReference, SlopeOutsideInterpolation, Nothing, Nothing}
CompressibleDynamics(
time_discretization;
standard_pressure,
surface_pressure,
reference_potential_temperature,
reference_temperature,
reference_vapor_mass_fraction,
slope_stencil,
terrain_metrics,
reference_state,
temperature_tolerance,
temperature_maxiter
) -> CompressibleDynamics{_A, Nothing, Nothing, Nothing, Float64, Breeze.CompressibleEquations.AutoReference, SlopeOutsideInterpolation, Nothing, Nothing} where _A
Construct CompressibleDynamics. The density and pressure fields are materialized later in the model constructor.
Positional Arguments
time_discretization: Time discretization scheme. Default:ExplicitTimeStepping. UseSplitExplicitTimeDiscretizationfor acoustic substepping.
Keyword Arguments
standard_pressure: Reference pressure for potential temperature (default: 10⁵ Pa)surface_pressure: Mean surface pressure (default: 101325.0 Pa)reference_potential_temperature: Potential temperature for building a fixed hydrostatically-balanced reference state used in base-state subtraction. Can be a constantθ₀or a functionθ(z). Default:nothing, which uses the automaticθᵣ = 288K profile whenreference_state = :auto. When provided, this profile replaces the automatic profile when building theExnerReferenceState.reference_vapor_mass_fraction: Optional vapor mass fraction for building a moist compressible reference state. Can be a constantqᵛ, functionqᵛ(z), or field, and is used withreference_potential_temperature.slope_stencil: Pressure-gradient slope-interpolation stencil for terrain-following grids. Default:SlopeOutsideInterpolation. Ignored on non-terrain-following grids.terrain_metrics: Escape hatch — pass a pre-builtTerrainMetricsto bypass the automatic build. Default:nothing(auto-build from the grid usingslope_stencil).reference_state: Whether to carry the single hydrostatic reference state used for the perturbation-form pressure-gradient force and buoyancy. Default::auto— on a bounded vertical grid, build a standard-atmosphere (θᵣ = 288K) hydrostatic reference: a 1D column on height-coordinate grids, 3D fields on terrain-following grids. Periodic and flat vertical topologies carry no automatic reference because a nontrivial hydrostatic atmosphere is incompatible with periodicity and unnecessary without a vertical dimension. Passreference_state = nothingto disable it entirely — the PGF and buoyancy then difference the full pressure, reproducing the un-corrected behavior (useful for testing). Disabling is mutually exclusive with an explicit reference profile. To replace the reference with one deduced from an initial state's horizontal mean, callset!(model; …, compute_reference_state=true).Deep near-isentropic reference profiles The reference integrates the hydrostatic equation up each column using
θᵣ(z). A (nearly) constant-θcolumn is isentropic and its hydrostatic pressure reaches zero at a finite height (≈cᵖ θ / g, about 29 km for the defaultθᵣ = 288K); if the domain top exceeds that height the integration has no positive-pressure solution and the reference fills withNaN. Physical, stably-stratified profiles are unaffected. For such a deep, near-isentropic setup pass either a stratifiedreference_potential_temperatureorreference_state = nothing(full-pressure form).
Breeze.CompressibleEquations.ConstantSubstepSize — Type
struct ConstantSubstepSize <: AcousticSubstepDistributionAcoustic substep distribution where every stage uses the same substep size $Δτ = Δt/N$. $N$ is rounded up to a multiple of 6 (= LCM of the WS-RK3 stage denominators 2 and 3) so the per-stage count $Nτ = β_\mathrm{stage} N$ is an exact integer and each stage covers exactly $β Δt$ — uniform Δτ, at the cost of over-resolving (substep count is the next multiple of 6 ≥ the CFL minimum).
Breeze.CompressibleEquations.CubicRamp — Type
struct CubicRamp <: AbstractRampHermite cubic "smoothstep" sponge ramp. $s² (3 − 2s)$ where $s = \text{clamp}((z − (H − \text{depth}))/\text{depth}, 0, 1)$.
Has zero derivative at both the layer base and the lid, so absorbs upgoing waves smoothly without the reflective kink of LinearRamp. Functionally equivalent to Sin2Ramp but ~5–10× cheaper inside the GPU kernel (no transcendental). Recommended default.
Breeze.CompressibleEquations.DirectDivergenceDamping — Type
struct DirectDivergenceDamping{FT} <: AcousticDampingStrategyAcoustic divergence damping that forms the horizontal θ-flux divergence $δ = ∂ₓ(θᴸ(ρu)′) + ∂_y(θᴸ(ρv)′)$ directly from the perturbation momentum, rather than approximating it through the $(ρθ)′$ substep tendency the way ThermalDivergenceDamping does (Klemp, Skamarock & Ha 2018, their eq. 36). After each acoustic substep the horizontal perturbation momentum receives the correction
\[Δ(ρu)′ = α\, Δx²\, ∂ₓ δ / θᴸ, \qquad Δ(ρv)′ = α\, Δy²\, ∂_y δ / θᴸ,\]
with the single dimensionless coefficient α (MPAS config_smdiv, default 0.1; the Laplacian-diffusion stability bound is α ≲ 0.2). The divergence is horizontal only: the damped quantity must match the divergence in the $Θ = ρθ$ equation, and folding in the vertical θ-flux divergence damps the resolved vertical flux and destabilizes the flow. Differencing the velocity field directly (rather than the $(ρθ)′$ tendency) carries no $1/Δτ$ in the diffusivity, which also avoids the thermal proxy's cold-start $∝ α/Δτ$ spurious force (cf. PR #794).
Breeze.CompressibleEquations.ExplicitTimeStepping — Type
struct ExplicitTimeSteppingStandard explicit time discretization for compressible dynamics.
All tendencies (including pressure gradient and acoustic modes) are computed together and time-stepped explicitly. This requires small time steps limited by the acoustic CFL condition (sound speed ~340 m/s).
Use SplitExplicitTimeDiscretization for more efficient time-stepping with larger Δt.
Breeze.CompressibleEquations.LinearRamp — Type
struct LinearRamp <: AbstractRampLinear sponge ramp. Cheap but introduces a kink at the bottom of the sponge layer (nonzero slope at $z = H − \text{depth}$), which can cause small partial reflection of upgoing waves in idealised tests. WRF's older damp_opt = 2 form uses this.
Breeze.CompressibleEquations.MonolithicFirstStage — Type
struct MonolithicFirstStage <: AcousticSubstepDistributionAcoustic substep distribution where stage 1 collapses to a single substep of size $Δt/3$; stages 2 and 3 are the same as ConstantSubstepSize ($N/2$ and $N$ substeps of size $Δτ = Δt/N$).
Breeze.CompressibleEquations.NoDivergenceDamping — Type
struct NoDivergenceDamping <: AcousticDampingStrategyNo acoustic divergence damping. The substep loop advances perturbation fields without applying any post-substep momentum correction.
Breeze.CompressibleEquations.ProportionalSubsteps — Type
struct ProportionalSubsteps <: AcousticSubstepDistributionAcoustic substep distribution where each WS-RK3 stage independently covers its interval $β_\mathrm{stage} Δt$ with $Nτ = ⌈β_\mathrm{stage} N⌉$ substeps of size $Δτ = β_\mathrm{stage} Δt / Nτ$. The count is proportional to the stage fraction and the size is fitted so the substeps exactly tile each stage — exact coverage at the minimum substep count (no global quantization; Δτ may differ slightly by stage).
This is the default.
Breeze.CompressibleEquations.Sin2Ramp — Type
struct Sin2Ramp <: AbstractRamp$\sin^2$ sponge ramp from Klemp, Dudhia & Hassiotis (2008). Same zero-derivative-at-both-ends behaviour as CubicRamp, but with a transcendental call. Provided for parity with WRF (damp_opt = 3) / MPAS-Atmosphere; prefer CubicRamp for performance in new code.
Breeze.CompressibleEquations.SplitExplicitTimeDiscretization — Type
struct SplitExplicitTimeDiscretization{N, FT, D, US, AD<:AcousticSubstepDistribution}Time discretization for fully compressible dynamics that integrates slow terms with a Wicker-Skamarock RK3 outer loop and acoustic terms with split-explicit inner substeps.
The constructor accepts substeps or an acoustic_cfl for choosing the number of acoustic substeps, a forward_weight for off-centering the acoustic solve, an acoustic damping strategy such as ThermalDivergenceDamping, an optional UpperSponge, and a substep_distribution such as ProportionalSubsteps.
Backward integration (time_step!(model, Δt) with Δt < 0) is supported for the linearized acoustic substep loop. See the field-documentation docstring for the A-stability argument, sign-handling of the adaptive substep count, and the irreversibility caveat for the optional UpperSponge.
Breeze.CompressibleEquations.ThermalDivergenceDamping — Type
struct ThermalDivergenceDamping{FT, LS} <: AcousticDampingStrategyAcoustic divergence damping that uses the (ρθ)′ tendency as a discrete proxy for the momentum divergence. From the linearized ρθ-continuity equation $\partial_t (ρθ)' + \nabla\cdot(ρθ^L u') = 0$, the per-substep quantity
\[D \equiv \frac{(ρθ)' - (ρθ)'_\mathrm{old}}{θ^L} \approx -Δτ \, \nabla\cdot(ρu)'\]
is what would otherwise require an extra divergence operator and an extra kernel pass. Building the correction from D reuses the substep's already-resident (ρθ)′ snapshots — that's the algorithmic choice this damping is named for.
Used by Klemp, Skamarock & Ha (2018) / Skamarock & Klemp (1992) / Baldauf (2010). After each acoustic substep, the horizontal momentum perturbation components $(ρu)′$ and $(ρv)′$ pick up an explicit correction proportional to the horizontal gradient of $D$. If damp_vertical = true, the vertical component is folded implicitly into the column tridiag as a Laplacian on the acoustic vertical momentum perturbation: $(ρw)′$ for height-coordinate dynamics and $(ρ ilde{w})′$ for terrain-following dynamics. By default, damp_vertical = false and vertical acoustic damping comes from the off-centered implicit solve.
Per-substep momentum correction (Klemp, Skamarock & Ha 2018 eq. 36, MPAS form):
\[Δ(ρu)′ = -γ · ∂_x D , \quad Δ(ρv)′ = -γ · ∂_y D .\]
with local per-direction horizontal diffusivities. On a uniform square grid this is the finite-difference analogue of MPAS's coef_divdamp = 2·smdiv·config_len_disp/Δτ:
\[γ_x = α \, Δx^2 / Δτ , \qquad γ_y = α \, Δy^2 / Δτ .\]
On anisotropic or latitude-longitude grids, using the local per-direction spacing keeps the nondimensional explicit damping strength approximately uniform across the mesh. Pass length_scale = ℓ to override the automatic local scale with the fixed diffusivity $γ = α ℓ^2 / Δτ$ when a nominal mesh length is more appropriate. The optional vertical tridiag contribution uses $γ_z = α Δz² / Δτ$ when damp_vertical = true.
$α$ is the dimensionless Klemp 2018 coefficient (= MPAS config_smdiv, default 0.1). The combined 2-D horizontal explicit-time stability bound is $8α ≤ 2 → α ≤ 0.25$; the default sits well below it. Combined with the SplitExplicitTimeDiscretization default $\omega = 0.65$, this preserves the exact discrete rest atmosphere at Δt = 20 s and damps divergent acoustic noise in production runs. It should not be read as a guarantee that every grid-scale balanced-mode growth diagnostic is physically correct.
Fields
coefficient: Dimensionless damping coefficient $α$ (Klemp 2018 / MPASconfig_smdiv). Default0.1. The horizontal part is explicit and obeys the usual8α ≤ 22-D combined CFL. Whendamp_vertical = true, the vertical contribution is implicit and is folded into the column tridiag.length_scale: Optional override for the dispersion length $d$. Defaultnothing(auto: local $γ_x = α Δx^2 / Δτ$ and $γ_y = α Δy^2 / Δτ$). Settinglength_scale = ℓforces a fixed $γ = α \, ℓ² / Δτ$ in both horizontal directions.damp_vertical: Iftrue, the vertical part of the divergence damping is folded into the column tridiag (a Laplacian on(ρw)′in height coordinates or(ρw̃)′in terrain-following coordinates). Iffalse(default), no extra vertical damping is applied — the vertical acoustic modes are damped solely by the off-centering of the implicit pressure-gradient solve ($\omega > 0.5$), which Klemp et al. 2018 eq. (32) shows is algebraically equivalent to a vertical divergence damping with diffusivity $γ_z = c² Δτ s/2$ where $s = 2\omega - 1$.
Breeze.CompressibleEquations.UpperSponge — Type
struct UpperSponge{FT, R<:AbstractRamp}Implicit upper Rayleigh sponge for the substepper inner loop. Damps the acoustic vertical momentum perturbation toward zero inside a layer of thickness depth below the model lid, with peak damping rate damping_rate (in 1/s) at the lid scaled by ramp(z). The damped variable is $(ρw)′$ for height-coordinate dynamics and $(ρ ilde{w})′$ for terrain-following dynamics.
The damping is applied inside the column tridiag as a CN-weighted contribution (paralleling the existing implicit divergence-damping treatment): $δτᵐ⁺ × \text{rate} × \text{ramp}(z)$ on the LHS diagonal, $δτˢ⁻ × \text{rate} × \text{ramp}(z)$ on the explicit-half RHS. This matches the Rayleigh-layer form of the Klemp, Dudhia & Hassiotis (2008) absorbing treatment used in WRF (damp_opt=3) and MPAS-Atmosphere. The profile shape is controlled by ramp; use Sin2Ramp for the classic $\sin^2$ profile.
Keyword arguments
damping_rate: peak damping rate at the lid, in 1/s. Default0.2.Because the damping is fully implicit in the inner-loop tridiag, it is unconditionally stable for any positive value, so the choice is guided by physics rather than CFL. Typical guidance:
- $\text{rate} ≳ N$ (Brunt–Väisälä frequency, ~0.01 /s in the stratosphere) is the lower bound at which gravity waves are absorbed rather than reflected within the layer crossing time.
- WRF's
dampcoefdefault and Klemp et al.'s recommendation is0.2(i.e. τ ≈ 5 s at the lid) — comfortably above $N$ and aggressive enough to absorb in one or two crossings. - Larger values are fine numerically but produce a sharper "cap" near the lid; if the application cares about resolved dynamics just below the sponge, prefer $\text{rate} ≈ 0.1$ and a deeper layer.
depth: sponge-layer thickness below the lid, in metres along the reference vertical coordinate. Default5e3.Should span at least ~10 grid cells in the vertical to give the smooth profile room to absorb without aliasing; for $Δz ≈ 1\,\text{km}$ the default of 5 km gives 5 cells (marginal — bump to 10 km if w-spectrum has structure right below the lid).
ramp: anAbstractRampcontrolling the profile shape. DefaultCubicRamp(). Other built-ins:Sin2Ramp(),LinearRamp(). Custom shapes are supported by subtypingAbstractRampand defining(::MyRamp)(z, sponge_top, depth).
The ramp depends only on the reference vertical coordinate (no horizontal variation), so the sponge does not break zonal symmetry and remains uniform over terrain-following grids.
Breeze.CompressibleEquations.WickerSkamarock3 — Type
struct WickerSkamarock3 <: AcousticOuterSchemeThree-stage Wicker–Skamarock RK3 outer scheme (Wicker and Skamarock 2002) with canonical stage fractions $β = (1/3, 1/2, 1)$. Each stage resets the prognostic state to $U^n$ and applies a fraction $β_k Δt$ of the slow tendency evaluated at the previous-stage state, while the acoustic substep loop advances linearized perturbations about each RK stage-entry state.
Breeze.CompressibleEquations.acoustic_rk3_substep_loop! — Method
acoustic_rk3_substep_loop!(
model::AtmosphereModel,
substepper,
Δt,
β_stage,
Uᴸ
)
Execute one Wicker–Skamarock RK3 stage of the linearized acoustic substep loop. Number and size of substeps in this stage depend on substepper.substep_distribution.
Breeze.CompressibleEquations.freeze_linearization_state! — Method
freeze_linearization_state!(
substepper::AcousticSubstepper,
model
)
Compute the background quantities used by the substepper as the first linearization point of an outer step. Subsequent RK stages call prepare_acoustic_cache!, which refreshes the same cached quantities to the stage-entry state.
After this call:
linearization_exner= Πᴸ = (pᴸ/pˢᵗ)^κ derived frommodel.dynamics.pressurelinearization_potential_temperature= θᴸ = ρθᴸ/ρᴸ derived frommodel.dynamics.dry_density+ ρθ
Breeze.CompressibleEquations.prepare_acoustic_cache! — Method
prepare_acoustic_cache!(
substepper::AcousticSubstepper,
model
)
Stage-start cache preparation. Refreshes the cached linearization quantities (Πᴸ, θᴸ, γᵐRᵐᴸ) to the stage-entry state $Uᴸ_\mathrm{stage}$ (per Skamarock & Klemp 2008 above eq. 16), recomputing them from the live model.dynamics.*. The rewind-perturbation initialization (initialize_stage_perturbations!, called next) handles the WS-RK3 invariant by setting $(ρ)′_\mathrm{init} = Uᴸ_\mathrm{outer} − Uᴸ_\mathrm{stage}$ (zero for stage 1; nonzero for stages 2 and 3).
Breeze.CompressibleEquations.stage_fractions — Method
stage_fractions(
_::WickerSkamarock3
) -> Tuple{Rational{Int64}, Rational{Int64}, Rational{Int64}}
Return the stage-fraction tuple $(β_1, β_2, β_3)$ for the outer Runge–Kutta scheme. For WickerSkamarock3 this is the canonical $(1/3, 1/2, 1)$ of Wicker and Skamarock (2002).
Forcings
Breeze.Forcings.SpecificForcing — Method
SpecificForcing(
forcing
) -> SpecificForcing{_A, Nothing, Nothing} where _A
Wrap a user-supplied forcing that produces a specific (per-unit-mass) tendency so that Breeze applies the density multiply $ρ$ at kernel time. After materialization, the kernel callable returns
\[ρ(i, j, k) \, F_ϕ(i, j, k, t)\]
interpolating $ρ$ to the appropriate cell face for fields whose target prognostic lives at Face in any direction (e.g. $ρ$ is interpolated to x-Face for u-forcings via $ℑxᶠᵃᵃ$, to z-Face for w via $ℑzᵃᵃᶠ$). ρ is ρᵣ(z) under AnelasticDynamics and the prognostic ρ(x, y, z, t) under CompressibleDynamics; the same wrapper handles both.
Users typically supply specific forcings directly through specific-named keys (u, v, w, θ, e, qᵉ, qᵛ, …) in the forcing NamedTuple passed to AtmosphereModel, and the dispatch wraps each entry in SpecificForcing automatically. The wrapper can also be constructed directly when finer control is needed.
The inner forcing can be anything accepted by Breeze's materialize_atmosphere_model_forcing: a function (x, y, z, t), a Returns callable, a Field, an Oceananigans.Forcing, a Breeze forcing such as SubsidenceForcing or one produced by geostrophic_forcings, or a tuple of these.
Breeze.Forcings.SubsidenceForcing — Method
SubsidenceForcing(
wˢ
) -> SubsidenceForcing{_A, Nothing} where _A
Forcing that represents large-scale subsidence advecting horizontally-averaged fields downward. The kernel returns the specific tendency
\[F_ϕ = - w^s \, ∂_z \overline{ϕ}\]
where $w^s$ is the subsidence_vertical_velocity and $\overline{ϕ}$ is the horizontal average of the field being forced. Supply SubsidenceForcing under the specific prognostic name (e.g. θ, qᵉ, u); the AtmosphereModel dispatch wraps it in SpecificForcing so the density factor $ρ$ is applied automatically at kernel time.
Fields
wˢ: Either a function ofzspecifying the subsidence velocity profile, or aFieldcontaining the subsidence velocity.
The horizontal average is computed automatically during update_state!.
Example
using Breezegrid = RectilinearGrid(size=(64, 64, 75), x=(0, 6400), y=(0, 6400), z=(0, 3000))wˢ(z) = z < 1500 ? -0.0065 * z / 1500 : -0.0065 * (1 - (z - 1500) / 600)subsidence = SubsidenceForcing(wˢ)forcing = (; θ=subsidence, qᵛ=subsidence)model = AtmosphereModel(grid; forcing)model.forcing.ρθ.forcing# outputSubsidenceForcing with wˢ: 1×1×76 Field{Nothing, Nothing, Face} reduced over dims = (1, 2) on RectilinearGrid on CPU└── averaged_field: 1×1×75 Field{Nothing, Nothing, Center} reduced over dims = (1, 2) on RectilinearGrid on CPUBreeze.Forcings.geostrophic_forcings — Method
geostrophic_forcings(
uᵍ,
vᵍ
) -> NamedTuple{(:u, :v), <:Tuple{Breeze.Forcings.GeostrophicForcing{Oceananigans.Grids.XDirection, _A, Nothing} where _A, Breeze.Forcings.GeostrophicForcing{Oceananigans.Grids.YDirection, _A, Nothing} where _A}}
Create a pair of geostrophic forcings for the x- and y-momentum equations, keyed under specific names u and v. Each GeostrophicForcing returns a specific tendency; the model's density factor ρ is applied automatically via SpecificForcing when the forcing is dispatched under a specific key, with the correct horizontal interpolation of ρ to the appropriate cell face.
The Coriolis parameter is extracted from the model's coriolis during model construction.
Arguments
uᵍ: Function ofzspecifying the x-component of the geostrophic velocity.vᵍ: Function ofzspecifying the y-component of the geostrophic velocity.
Returns a NamedTuple with u and v forcing entries that can be merged into the model forcing.
Example
using Breezeuᵍ(z) = -10 + 0.001zvᵍ(z) = 0.0coriolis = FPlane(f=1e-4)forcing = geostrophic_forcings(uᵍ, vᵍ)# outputNamedTuple with 2 GeostrophicForcings:├── u: GeostrophicForcing{XDirection}│ └── geostrophic_velocity: vᵍ (generic function with 1 method)└── v: GeostrophicForcing{YDirection} └── geostrophic_velocity: uᵍ (generic function with 1 method)KinematicDriver
Breeze.KinematicDriver — Module
KinematicDriverModule implementing kinematic dynamics for atmosphere models.
Kinematic dynamics prescribes the velocity field rather than solving for it, enabling isolated testing of microphysics, thermodynamics, and other physics without the complexity of solving the momentum equations.
This is analogous to the kin1d driver in P3-microphysics.
Breeze.KinematicDriver.PrescribedDensity — Type
Wrapper indicating that density is fixed (not prognostic).
Breeze.KinematicDriver.PrescribedDynamics — Type
struct PrescribedDynamics{Div, D, P, FT}Dynamics for kinematic atmosphere models where velocity is prescribed. The type parameter Div indicates whether divergence correction is applied.
Breeze.KinematicDriver.PrescribedDynamics — Method
PrescribedDynamics(
density;
pressure,
surface_pressure,
standard_pressure,
divergence_correction
) -> PrescribedDynamics{_A, D} where {_A, D<:PrescribedDensity}
Construct PrescribedDynamics from a density field or PrescribedDensity. If pressure=nothing, hydrostatic pressure is computed during materialization.
Breeze.KinematicDriver.PrescribedDynamics — Method
PrescribedDynamics(
reference_state::ReferenceState;
divergence_correction
) -> PrescribedDynamics{_A, D} where {_A, D<:PrescribedDensity}
Construct PrescribedDynamics from a ReferenceState. Wraps density in PrescribedDensity (fixed in time).
If divergence_correction=true, scalar tendencies include +c∇·(ρU) to account for the non-divergent velocity field.
Example
using Oceananigansusing Breezegrid = RectilinearGrid(size=(4, 4, 8), extent=(1000, 1000, 2000))reference_state = ReferenceState(grid, ThermodynamicConstants())dynamics = PrescribedDynamics(reference_state)# outputPrescribedDynamics├── density: PrescribedDensity├── pressure: 1×1×8 Field{Nothing, Nothing, Center} reduced over dims = (1, 2) on RectilinearGrid on CPU├── surface_pressure: 101325.0└── standard_pressure: 100000.0Microphysics
Breeze.Microphysics.BulkMicrophysics — Type
BulkMicrophysics(
;
...
) -> BulkMicrophysics{N, Nothing, Nothing, Nothing} where N<:(SaturationAdjustment{E, S} where {E<:MixedPhaseEquilibrium, S<:SecantSolver})
BulkMicrophysics(
FT::DataType;
categories,
cloud_formation,
precipitation_boundary_condition,
negative_moisture_correction
) -> BulkMicrophysics{N, Nothing, Nothing, Nothing} where N<:(SaturationAdjustment{E, S} where {E<:MixedPhaseEquilibrium, S<:SecantSolver})
Return a BulkMicrophysics microphysics scheme.
Keyword arguments
categories: Microphysical categories (e.g., cloud liquid, cloud ice, rain, snow) ornothingfor non-precipitatingcloud_formation: Cloud formation scheme (default:SaturationAdjustment)precipitation_boundary_condition: Bottom boundary condition for precipitation sedimentation.nothing(default): Precipitation passes through the bottomImpenetrableBoundaryCondition(): Precipitation collects at the bottom
negative_moisture_correction: Correction scheme for negative moisture produced by advection.nothing(default): No correctionVerticalBorrowing(): Vertical redistribution of the moisture prognostic only
SpeciesBorrowing(): Same-level species borrowing onlySpeciesBorrowing(vertical_borrowing=VerticalBorrowing()): Species borrowing with vertical redistribution
Breeze.Microphysics.BulkMicrophysics — Type
struct BulkMicrophysics{N, C, B, NMC}Bulk microphysics scheme with cloud formation and precipitation categories.
Fields
cloud_formation: Cloud formation scheme (saturation adjustment or non-equilibrium)categories: Precipitation categories (e.g., rain, snow) ornothingprecipitation_boundary_condition: Bottom boundary condition for precipitation sedimentation.nothing(default): Precipitation passes through the bottom (open boundary)ImpenetrableBoundaryCondition(): Precipitation collects at the bottom (zero terminal velocity at surface)
negative_moisture_correction: Correction scheme for negative moisture produced by advection.nothing(default): No correctionVerticalBorrowing(): Vertical redistribution of the moisture prognostic only
SpeciesBorrowing(): Same-level species borrowing onlySpeciesBorrowing(vertical_borrowing=VerticalBorrowing()): Species borrowing with vertical redistribution
Breeze.Microphysics.ConstantRateCondensateFormation — Type
Return a condensate formation model that applies a constant phase-change rate.
This type is intended to be usable for both liquid (condensation/evaporation) and ice (deposition/sublimation).
Breeze.Microphysics.DCMIP2016KesslerMicrophysics — Type
DCMIP2016KesslerMicrophysics(
;
...
) -> Breeze.Microphysics.DCMIP2016KesslerMicrophysics
DCMIP2016KesslerMicrophysics(
FT;
dcmip_temperature_scale,
terminal_velocity_coefficient,
density_scale,
terminal_velocity_exponent,
autoconversion_rate,
autoconversion_threshold,
accretion_rate,
accretion_exponent,
evaporation_ventilation_coefficient_1,
evaporation_ventilation_coefficient_2,
evaporation_ventilation_exponent_1,
evaporation_ventilation_exponent_2,
diffusivity_coefficient,
thermal_conductivity_coefficient,
substep_cfl
) -> Breeze.Microphysics.DCMIP2016KesslerMicrophysics
Construct a DCMIP2016 implementation of the Kessler (1969) warm-rain bulk microphysics scheme.
This implementation follows the DCMIP2016 test case specification, which is based on Klemp and Wilhelmson (1978).
Positional Arguments
FT: Floating-point type for all parameters (default:Oceananigans.defaults.FloatType).
References
- Zarzycki, C. M., et al. (2019). DCMIP2016: the splitting supercell test case. Geoscientific Model Development, 12, 879–892.
- Kessler, E. (1969). On the Distribution and Continuity of Water Substance in Atmospheric Circulations. Meteorological Monographs, 10(32).
- Klemp, J. B., & Wilhelmson, R. B. (1978). The simulation of three-dimensional convective storm dynamics. Journal of the Atmospheric Sciences, 35(6), 1070-1096.
- DCMIP2016 Fortran implementation (
kessler.f90in DOI: 10.5281/zenodo.1298671)
Moisture Categories
This scheme represents moisture in three categories:
- Water vapor mixing ratio (
rᵛ) - Cloud water mixing ratio (
rᶜˡ) - Rain water mixing ratio (
rʳ)
Breeze tracks moisture using mass fractions (q), whereas the Kessler scheme uses mixing ratios (r). Conversions between these representations are performed internally. In Breeze, water vapor is not a prognostic variable; instead, it is diagnosed from the total specific moisture qᵗ and the liquid condensates.
Physical Processes
- Autoconversion: Cloud water converts to rain water when the cloud water mixing ratio exceeds a threshold.
- Accretion: Rain water collects cloud water as it falls.
- Saturation Adjustment: Water vapor condenses to cloud water or cloud water evaporates to maintain saturation.
- Rain Evaporation: Rain water evaporates into subsaturated air.
- Rain Sedimentation: Rain water falls gravitationally.
Implementation Details
- The microphysics update is applied via a GPU-compatible kernel launched from
microphysics_model_update!. - Rain sedimentation uses subcycling to satisfy CFL constraints, following the Fortran implementation.
- All microphysical updates are applied directly to the state variables in the kernel.
Keyword Arguments
Saturation (Tetens/Clausius-Clapeyron formula)
dcmip_temperature_scale(T_DCMIP2016): A parameter of uncertain provenance that appears in the DCMIP2016 implementation of the Kessler scheme (line 105 ofkessler.f90in DOI: 10.5281/zenodo.1298671)
The "saturation adjustment coefficient" f₅ is then computed as
\[f₅ = a T_DCMIP2016 ℒˡᵣ / cᵖᵈ\]
where a is the liquid_coefficient for Tetens' saturation vapor pressure formula, ℒˡᵣ is the latent heat of vaporization of liquid water, and cᵖᵈ is the heat capacity of dry air.
Rain Terminal Velocity (Klemp & Wilhelmson 1978, eq. 2.15)
Terminal velocity: 𝕎ʳ = a𝕎 × (ρ × rʳ × Cᵨ)^β𝕎 × √(ρ₀/ρ)
terminal_velocity_coefficient(a𝕎): Terminal velocity coefficient in m/s (default: 36.34)density_scale(Cᵨ): Density scale factor for unit conversion (default: 0.001)terminal_velocity_exponent(β𝕎): Terminal velocity exponent (default: 0.1364)ρ: Densityρ₀: Reference density at z=0
Autoconversion
autoconversion_rate(k₁): Autoconversion rate coefficient in s⁻¹ (default: 0.001)autoconversion_threshold(rᶜˡ★): Critical cloud water mixing ratio threshold in kg/kg (default: 0.001)
Accretion
accretion_rate(k₂): Accretion rate coefficient in s⁻¹ (default: 2.2)accretion_exponent(βᵃᶜᶜ): Accretion exponent for rain mixing ratio (default: 0.875)
Rain Evaporation (Klemp & Wilhelmson 1978, eq. 2.14)
Ventilation: (Cᵉᵛ₁ + Cᵉᵛ₂ × (ρ rʳ)^βᵉᵛ₁) × (ρ rʳ)^βᵉᵛ₂
evaporation_ventilation_coefficient_1(Cᵉᵛ₁): Evaporation ventilation coefficient 1 (default: 1.6)evaporation_ventilation_coefficient_2(Cᵉᵛ₂): Evaporation ventilation coefficient 2 (default: 124.9)evaporation_ventilation_exponent_1(βᵉᵛ₁): Evaporation ventilation exponent 1 (default: 0.2046)evaporation_ventilation_exponent_2(βᵉᵛ₂): Evaporation ventilation exponent 2 (default: 0.525)diffusivity_coefficient(Cᵈⁱᶠᶠ): Diffusivity-related denominator coefficient (default: 2.55e8)thermal_conductivity_coefficient(Cᵗʰᵉʳᵐ): Thermal conductivity-related denominator coefficient (default: 5.4e5)
Numerical
substep_cfl: CFL safety factor for sedimentation subcycling (default: 0.8)
Breeze.Microphysics.DCMIP2016KesslerMicrophysics — Type
struct DCMIP2016KesslerMicrophysics{FT}DCMIP2016 implementation of the Kessler (1969) warm-rain bulk microphysics scheme. See the constructor DCMIP2016KesslerMicrophysics for full documentation.
Breeze.Microphysics.InstantaneousPrecipitation — Type
InstantaneousPrecipitation(
;
...
) -> InstantaneousPrecipitation{S} where S<:(SaturationAdjustment{WarmPhaseEquilibrium, S} where S<:SecantSolver)
InstantaneousPrecipitation(
FT::DataType;
equilibrium,
solver
) -> InstantaneousPrecipitation{S} where S<:(SaturationAdjustment{WarmPhaseEquilibrium, S} where S<:SecantSolver)
Construct an InstantaneousPrecipitation scheme. equilibrium selects the phase equilibrium used by the underlying saturation solve (default warm-phase), and solver controls its iteration (see SaturationAdjustment).
Breeze.Microphysics.InstantaneousPrecipitation — Type
struct InstantaneousPrecipitation{S}Instantaneous-precipitation microphysics: an instantaneous, irreversible condensation with immediate rain-out and no re-evaporation (no cloud or rain stage). Excess water vapor above saturation condenses, releases its latent heat to the air, and is removed as precipitation in the same step. This is the "large-scale condensation" of the DCMIP2016 Reed–Jablonowski simple-physics suite.
The saturation/latent-heat solve is delegated to a SaturationAdjustment instance (saturation_adjustment), so the equilibrium thermodynamics are shared and validated. The distinction is irreversibility: the condensate is purged from the prognostic vapor every step and cannot re-evaporate.
The prognostic moisture is the vapor density ρqᵛ (no condensate is retained).
Breeze.Microphysics.NonEquilibriumCloudFormation — Type
NonEquilibriumCloudFormation(liquid, ice=nothing)A cloud formation scheme where cloud liquid and ice are prognostic variables that evolve via condensation/evaporation and deposition/sublimation tendencies, rather than being diagnosed instantaneously via saturation adjustment.
The condensation/evaporation and deposition/sublimation tendencies are commonly modeled as relaxation toward saturation with timescale τ_relax, including a latent-heat (psychrometric/thermal) correction factor; see Morrison and Grabowski (2008), Appendix Eq. (A3), and standard cloud microphysics texts such as Pruppacher and Klett (2010) or Rogers and Yau (1989).
For some bulk schemes (e.g. the CloudMicrophysics 1M extension), liquid and ice may be set to nothing and used purely as phase indicators (warm-phase vs mixed-phase), with any relaxation timescales sourced from the scheme's precipitation/category parameters instead.
Fields
liquid: Parameters for cloud liquid (contains relaxation timescaleτ_relax)ice: Parameters for cloud ice (contains relaxation timescaleτ_relax), ornothingfor warm-phase only
References
- Morrison, H. and Grabowski, W. W. (2008). A novel approach for representing ice microphysics in models: Description and tests using a kinematic framework. J. Atmos. Sci., 65, 1528–1548. https://doi.org/10.1175/2007JAS2491.1
- Pruppacher, H. R. and Klett, J. D. (2010). Microphysics of Clouds and Precipitation (2nd ed.).
- Rogers, R. R. and Yau, M. K. (1989). A Short Course in Cloud Physics (3rd ed.).
Breeze.Microphysics.SaturationAdjustment — Type
SaturationAdjustment(
;
...
) -> SaturationAdjustment{E, S} where {E<:MixedPhaseEquilibrium, S<:SecantSolver}
SaturationAdjustment(
FT::DataType;
solver,
equilibrium,
tolerance,
maxiter
) -> SaturationAdjustment{E, S} where {E<:MixedPhaseEquilibrium, S<:SecantSolver}
Return SaturationAdjustment microphysics representing an instantaneous adjustment to equilibrium between condensates and water vapor, computed by a secant iteration on the temperature residual controlled by solver.
The options for equilibrium are:
WarmPhaseEquilibrium()representing an equilibrium between water vapor and liquid water.MixedPhaseEquilibrium()representing a temperature-dependent equilibrium between water vapor, possibly supercooled liquid water, and ice. The equilibrium state is modeled as a linear variation of the equilibrium liquid fraction with temperature, between the freezing temperature (e.g. 273.15 K) below which liquid water is supercooled, and the temperature of homogeneous ice nucleation temperature (e.g. 233.15 K) at which the supercooled liquid fraction vanishes.
The options for solver are SecantSolver (default: SecantSolver(abstol=1e-4, maxiter=20), an absolute tolerance on the temperature-like residual in Kelvin) and FixedIterations, which performs a fixed number of secant steps with no convergence test (the form required for Reactant tracing and cheap reverse-mode differentiation).
Breeze.Microphysics.RelativeHumidity — Method
RelativeHumidity(
model
) -> KernelFunctionOperation{_A, _B, _C, _D, T, K, D} where {_A, _B, _C, _D, T, K<:Breeze.Microphysics.RelativeHumidityKernelFunction, D<:Tuple}
Return a KernelFunctionOperation representing the relative humidity $ℋ$, defined as the ratio of vapor pressure to saturation vapor pressure:
\[ℋ = \frac{pᵛ}{pᵛ⁺}\]
where $pᵛ$ is the vapor pressure (partial pressure of water vapor) computed from the ideal gas law
\[pᵛ = ρ qᵛ Rᵛ T\]
and $pᵛ⁺$ is the saturation vapor pressure.
For unsaturated conditions, $ℋ < 1$. For saturated conditions with saturation adjustment microphysics, $ℋ = 1$ (or very close to it due to numerical precision).
Examples
using Breezegrid = RectilinearGrid(size=(1, 1, 128), extent=(1e3, 1e3, 1e3))microphysics = SaturationAdjustment()model = AtmosphereModel(grid; microphysics)set!(model, θ=300, qᵗ=0.005) # subsaturatedℋ = RelativeHumidity(model)# outputKernelFunctionOperation at (Center, Center, Center)├── grid: 1×1×128 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 1×1×3 halo├── kernel_function: RelativeHumidityKernelFunction└── arguments: ()As with other diagnostics, RelativeHumidity may be wrapped in Field to store the result:
ℋ_field = RelativeHumidity(model) |> Field# output1×1×128 Field{Center, Center, Center} on RectilinearGrid on CPU├── grid: 1×1×128 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 1×1×3 halo├── boundary conditions: FieldBoundaryConditions│ └── west: Periodic, east: Periodic, south: Periodic, north: Periodic, bottom: ZeroFlux, top: ZeroFlux, immersed: Nothing├── operand: KernelFunctionOperation at (Center, Center, Center)├── status: time=0.0└── data: 3×3×134 OffsetArray(::Array{Float64, 3}, 0:2, 0:2, -2:131) with eltype Float64 with indices 0:2×0:2×-2:131 └── max=0.214949, min=0.137169, mean=0.172626We also provide a convenience constructor for the Field:
ℋ_field = RelativeHumidityField(model)# output1×1×128 Field{Center, Center, Center} on RectilinearGrid on CPU├── grid: 1×1×128 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 1×1×3 halo├── boundary conditions: FieldBoundaryConditions│ └── west: Periodic, east: Periodic, south: Periodic, north: Periodic, bottom: ZeroFlux, top: ZeroFlux, immersed: Nothing├── operand: KernelFunctionOperation at (Center, Center, Center)├── status: time=0.0└── data: 3×3×134 OffsetArray(::Array{Float64, 3}, 0:2, 0:2, -2:131) with eltype Float64 with indices 0:2×0:2×-2:131 └── max=0.214949, min=0.137169, mean=0.172626Breeze.Microphysics.adjust_thermodynamic_state — Method
adjust_thermodynamic_state(
𝒰₀::Breeze.Thermodynamics.AbstractThermodynamicState,
microphysics::SaturationAdjustment,
constants
) -> Breeze.Thermodynamics.LiquidIceDensityState
Return the saturation-adjusted thermodynamic state using a secant iteration.
Breeze.Microphysics.adjust_thermodynamic_state — Method
adjust_thermodynamic_state(
𝒰₀::Breeze.Thermodynamics.LiquidIceDensityState,
microphysics::SaturationAdjustment,
constants
) -> Breeze.Thermodynamics.LiquidIceDensityState
Saturation adjustment for the LiquidIceDensityState: a secant on the constant-density θˡⁱ-conservation residual, so qsat and the θˡⁱ inversion are evaluated at the state's actual density ρ (with true pressure p = ρRᵐT) rather than a fixed reference pressure. This is the density-consistent analogue of the generic (reference-pressure) adjust_state secant; like that one it holds θˡⁱ fixed (conserves it). See NumericalEarth/Breeze.jl#765.
Breeze.Microphysics.compute_temperature — Method
compute_temperature(
𝒰₀,
adjustment::SaturationAdjustment,
constants
) -> Any
Perform saturation adjustment and return the temperature associated with the adjusted state.
Breeze.Microphysics.kessler_terminal_velocity — Method
kessler_terminal_velocity(rʳ, ρ, ρ₁, microphysics) -> Any
Compute rain terminal velocity (m/s) following Klemp and Wilhelmson (1978) eq. 2.15.
The terminal velocity is computed as:
\[𝕎ʳ = a^𝕎 (ρ rʳ Cᵨ)^{β^𝕎} \sqrt{ρ₀/ρ}\]
where $a^𝕎$ is the terminal_velocity_coefficient, $Cᵨ$ is the density_scale, and $β^𝕎$ is the terminal_velocity_exponent.
Breeze.Microphysics.number_concentration — Method
number_concentration(model, species::Symbol) -> Any
Lazy diagnostic returning the total number concentration $ρnˣ$ (m⁻³) for the requested species.
For OneMomentCloudMicrophysics, species ∈ (:rain, :snow) returns a KernelFunctionOperation that computes $n_0 \, λ^{-1}$ from the prognostic $ρqˣ$ and the scheme's size distribution. Snow's intercept $n_0$ depends on $(q, ρ)$ per Kaul et al. (2015) — so this diagnostic stays consistent with the scheme's actual DSD without re-encoding species-specific physics at every call site.
For TwoMomentCloudMicrophysics, returns the prognostic $ρnˣ$ field directly (e.g., :rain → ρnʳ, :cloud_liquid → ρnᶜˡ).
Returns nothing if the species is not carried by the model (e.g., :hail for a 1-mom scheme without hail). Errors for microphysics schemes that do not define a DSD-based number concentration (e.g., SaturationAdjustment).
The return shape is therefore polymorphic — a lazy KernelFunctionOperation for 1-mom and a stored Field for 2-mom — so the function is snake-cased rather than PascalCased. Use number_concentration_field when you want a uniformly Field-typed handle.
Breeze.Microphysics.number_concentration_field — Method
number_concentration_field(model, species::Symbol) -> Any
Field-typed handle for the number_concentration diagnostic. For 1-mom, allocates a Field shell around the lazy KernelFunctionOperation (use compute! to populate it). For 2-mom, returns the prognostic $ρnˣ$ field directly. Returns nothing when the requested species is not carried by the model.
MoistAirBuoyancies
Breeze.MoistAirBuoyancies.MoistAirBuoyancy — Method
MoistAirBuoyancy(
grid;
surface_pressure,
reference_potential_temperature,
standard_pressure,
thermodynamic_constants
) -> MoistAirBuoyancy{RS, AT} where {RS<:(ReferenceState{_A, P, D, T, QV, QL, QI} where {_A, P<:(Field{Nothing, Nothing, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}), D<:(Field{Nothing, Nothing, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}), T<:(Field{Nothing, Nothing, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}), QV<:(Oceananigans.Fields.ZeroField{_A, 3} where _A), QL<:(Oceananigans.Fields.ZeroField{_A, 3} where _A), QI<:(Oceananigans.Fields.ZeroField{_A, 3} where _A)}), AT<:ThermodynamicConstants}
Return a MoistAirBuoyancy formulation that can be provided as input to an Oceananigans.NonhydrostaticModel.
Example
using Breeze, Oceananigansgrid = RectilinearGrid(size=(1, 1, 8), extent=(1, 1, 3e3))buoyancy = MoistAirBuoyancy(grid)# outputMoistAirBuoyancy:├── reference_state: ReferenceState{Float64}(p₀=101325.0, θ₀=288.0, pˢᵗ=100000.0)└── thermodynamic_constants: ThermodynamicConstants{Float64}To build a model with MoistAirBuoyancy, we include potential temperature and total specific humidity tracers θ and qᵗ to the model.
model = NonhydrostaticModel(grid; buoyancy, tracers = (:θ, :qᵗ))# outputNonhydrostaticModel{CPU, RectilinearGrid}(time = 0 seconds, iteration = 0)├── grid: 1×1×8 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 1×1×3 halo├── timestepper: RungeKutta3TimeStepper├── advection scheme: Centered(order=2)├── tracers: (θ, qᵗ)├── closure: Nothing├── buoyancy: MoistAirBuoyancy with ĝ = NegativeZDirection()└── coriolis: NothingParcelModels
Breeze.ParcelModels.ParcelDynamics — Type
ParcelDynamics(
;
...
) -> ParcelDynamics{Nothing, Nothing, Nothing, Nothing, PrescribedVerticalVelocity}
ParcelDynamics(
FT::DataType;
vertical_velocity_formulation,
surface_pressure,
standard_pressure
) -> ParcelDynamics{Nothing, Nothing, Nothing, Nothing, PrescribedVerticalVelocity}
Construct ParcelDynamics with default (uninitialized) state.
The environmental profiles and parcel state are set using set! after constructing the AtmosphereModel.
Breeze.ParcelModels.ParcelDynamics — Type
struct ParcelDynamics{S, TS, D, P, U, FT}Lagrangian parcel dynamics for AtmosphereModel.
Fields
state: parcel state (position, thermodynamics, microphysics)timestepper: SSP RK3 timestepper with tendenciesdensity: environmental density field [kg/m³]pressure: environmental pressure field [Pa]surface_pressure: surface pressure [Pa]standard_pressure: standard pressure for potential temperature [Pa]
Breeze.ParcelModels.ParcelInitialState — Type
mutable struct ParcelInitialState{FT, MP}x::Anyy::Anyz::Anyw::Anyqᵗ::Anyℰ::Anyμ::Any
Storage for the initial parcel prognostic state at the beginning of a time step. Used by SSP RK3 to combine the initial state with intermediate states.
Breeze.ParcelModels.ParcelModel — Type
ParcelModelType alias for AtmosphereModel{<:ParcelDynamics}.
A ParcelModel represents a Lagrangian adiabatic parcel that rises through a prescribed environmental atmosphere. The parcel is characterized by its position (x, y, z), thermodynamic state, and moisture content. The environmental profiles (temperature, pressure, density, velocities) are defined on a 1D vertical grid.
The parcel's motion is determined by interpolating environmental velocities to the parcel position, and its thermodynamic evolution follows adiabatic processes with optional microphysical interactions.
See also ParcelDynamics, AtmosphereModel.
Breeze.ParcelModels.ParcelState — Type
mutable struct ParcelState{FT, TH, MP}x::Anyy::Anyz::Anyw::Anyρ::Anyqᵗ::Anyρqᵗ::Anyℰ::Anyρℰ::Any𝒰::Anyμ::Any
State of a Lagrangian air parcel with position, thermodynamic state, and microphysics.
The parcel model evolves specific quantities (qᵗ, ℰ) directly for exact conservation. Density-weighted forms (ρqᵗ, ρℰ) are also stored for consistency with the microphysics interface.
w: parcel vertical velocity [m/s], prognostic forPrognosticVerticalVelocity, zero forPrescribedVerticalVelocityρ: environmental density at parcel height [kg/m³], interpolated from background profile, not the parcel's own density. The parcel density is computed fromdensity(𝒰, constants)using the ideal gas law applied to the parcel's thermodynamic state.
Breeze.ParcelModels.ParcelTendencies — Type
mutable struct ParcelTendencies{FT, GM}Gx::AnyGy::AnyGz::AnyGw::AnyGe::AnyGqᵗ::AnyGμ::Any
Tendencies (time derivatives) for parcel prognostic variables.
Breeze.ParcelModels.ParcelTimestepper — Type
struct ParcelTimestepper{GT, U0, FT}SSP RK3 time-stepper for ParcelModel.
Stores tendencies, the initial state at the beginning of a time step, and the SSP RK3 stage coefficients.
Fields
G: tendencies for prognostic variablesU⁰: initial state storage (position, moisture, thermodynamics, microphysics)α¹,α²,α³: SSP RK3 stage coefficients (1, 1/4, 2/3)
Breeze.ParcelModels.ParcelTimestepper — Method
ParcelTimestepper(
state::ParcelState{FT},
Gμ
) -> Breeze.ParcelModels.ParcelTimestepper{GT, U0} where {GT<:Breeze.ParcelModels.ParcelTendencies, U0<:Breeze.ParcelModels.ParcelInitialState}
Construct a ParcelTimestepper for SSP RK3 time-stepping.
Breeze.ParcelModels.PrescribedVerticalVelocity — Type
PrescribedVerticalVelocitySingleton type for prescribed vertical velocity dynamics. The parcel moves following the prescribed environmental vertical velocity field w(z).
This is the default vertical velocity formulation: dz/dt = w_env(z).
Breeze.ParcelModels.PrognosticVerticalVelocity — Type
PrognosticVerticalVelocitySingleton type for prognostic vertical velocity dynamics. The parcel has a prognostic vertical velocity driven by buoyancy, i.e., dz/dt = w and dw/dt = b, where b = -g (ρᵖ - ρᵉ) / ρᵉ is the net buoyancy from the density difference, including both the virtual temperature effect and condensate loading.
Breeze.ParcelModels.adjust_adiabatically — Function
Adjust the thermodynamic state for adiabatic ascent/descent to a new height. Conserves the thermodynamic variable (static energy or potential temperature).
Breeze.ParcelModels.compute_parcel_tendencies! — Method
compute_parcel_tendencies!(
model::AtmosphereModel{<:ParcelDynamics}
)
Compute tendencies for the parcel prognostic variables.
Position tendencies are interpolated from environmental velocity fields. Thermodynamic and moisture tendencies come from microphysical sources/sinks.
The parcel model evolves specific quantities (e, qᵗ) directly, not density-weighted quantities. For adiabatic ascent with no microphysics, specific static energy and moisture are exactly conserved (de/dt = dqᵗ/dt = 0). This is simpler and more accurate than stepping density-weighted quantities.
Breeze.ParcelModels.compute_vertical_velocity_tendencies! — Method
compute_vertical_velocity_tendencies!(
tendencies,
state,
dynamics,
model,
_::PrescribedVerticalVelocity
)
Compute vertical velocity tendencies for PrescribedVerticalVelocity.
The parcel follows the environmental vertical velocity: dz/dt = w_env(z). The parcel velocity tendency Gw is zero (unused prognostic).
Breeze.ParcelModels.compute_vertical_velocity_tendencies! — Method
compute_vertical_velocity_tendencies!(
tendencies,
state,
dynamics,
model,
_::PrognosticVerticalVelocity
)
Compute vertical velocity tendencies for PrognosticVerticalVelocity.
The parcel has a prognostic vertical velocity driven by buoyancy, i.e., dz/dt = w and dw/dt = B.
Breeze.ParcelModels.materialize_parcel_microphysics_prognostics — Method
materialize_parcel_microphysics_prognostics(
FT,
microphysics
) -> Union{Nothing, NamedTuple}
Create the parcel microphysics prognostic variables for the given microphysics scheme.
Returns nothing for microphysics schemes without explicit prognostic variables (e.g., Nothing, SaturationAdjustment), or a NamedTuple containing the prognostic density-weighted scalars for schemes with prognostic microphysics.
The prognostic variables use the same ρ-weighted names as the grid-based model (e.g., :ρqᶜˡ, :ρqʳ) from prognostic_field_names(microphysics).
Breeze.ParcelModels.parcel_buoyancy — Method
parcel_buoyancy(state, dynamics, constants) -> Any
Compute the net buoyancy acceleration for a parcel.
The buoyancy is computed from the density difference between the parcel and environment:
\[B = -g (ρ_{parcel} - ρ_{env}) / ρ_{env}\]
Here, $ρ_{env}$ is the environmental density interpolated at the parcel height and $ρ_{parcel} = p / (Rᵐ T)$ is the total parcel density from the ideal gas law, where $Rᵐ = qᵈ Rᵈ + qᵛ Rᵛ$ with $qᵈ = 1 - qᵛ - qˡ - qⁱ$. This formulation captures both the virtual temperature effect (from vapor content) and the condensate loading effect (condensate reduces $qᵈ$, reducing $Rᵐ$, increasing $ρ_{parcel}$) in a single term without double-counting.
Breeze.ParcelModels.ssp_rk3_parcel_substep! — Method
ssp_rk3_parcel_substep!(
model::AtmosphereModel{<:ParcelDynamics},
U⁰::Breeze.ParcelModels.ParcelInitialState,
Δt,
α
)
Apply an SSP RK3 substep with coefficient $α$:
\[u^{(m)} = (1 - α) u^{(0)} + α \left[u^{(m-1)} + Δt \, G^{(m-1)}\right]\]
where $u^{(0)}$ is the initial state, $u^{(m-1)}$ is the current state, and $G^{(m-1)}$ is the tendency at the current state.
The parcel model steps specific quantities (e, qᵗ) directly for exact conservation. For adiabatic ascent with no microphysics sources, de/dt = dqᵗ/dt = 0, so these quantities remain exactly constant throughout the simulation.
Breeze.ParcelModels.step_parcel_state! — Method
step_parcel_state!(
model::AtmosphereModel{<:ParcelDynamics},
Δt
)
Step the parcel state forward using Forward Euler:
\[x^{n+1} = x^n + Δt \, G^n\]
Compute tendencies at the current state, then advance all prognostic variables. After updating position, the thermodynamic state is adjusted for the new height (adiabatic adjustment) and environmental conditions are updated from the profiles.
Breeze.ParcelModels.store_initial_parcel_state! — Method
store_initial_parcel_state!(
U⁰::Breeze.ParcelModels.ParcelInitialState,
state::ParcelState
)
Copy current prognostic state values to the initial state storage.
PotentialTemperatureFormulations
Breeze.PotentialTemperatureFormulations — Module
PotentialTemperatureFormulationsSubmodule defining the liquid-ice potential temperature thermodynamic formulation for atmosphere models.
LiquidIcePotentialTemperatureFormulation uses liquid-ice potential temperature density ρθ as the prognostic thermodynamic variable.
Breeze.PotentialTemperatureFormulations.LiquidIcePotentialTemperatureFormulation — Type
LiquidIcePotentialTemperatureFormulation uses liquid-ice potential temperature density ρθ as the prognostic thermodynamic variable.
Liquid-ice potential temperature is a conserved quantity in moist adiabatic processes and is defined as:
\[θˡⁱ = T \left( \frac{p^{st}}{p} \right)^{Rᵐ/cᵖᵐ} \exp\left( -\frac{ℒˡᵣ qˡ + ℒⁱᵣ qⁱ}{cᵖᵐ T} \right)\]
Recovering temperature from θˡⁱ may require an iterative inversion, depending on the dynamics: with prognostic-density (compressible) dynamics, temperature solves the implicit relation T = (ρRᵐT/pˢᵗ)^κ θ + ΔL/cᵖᵐ. The inversion is controlled by temperature_solver:
DefaultTemperatureSolver()(default): resolved at materialization todefault_temperature_solver(dynamics)—nothingfor anelastic dynamics (closed-form inversion) andNewtonSolver()for compressible dynamics.NewtonSolver: tolerance-based Newton iteration.FixedIterations: a fixed number of Newton steps with no convergence test, which unrolls to straight-line code (required for Reactant tracing and cheap reverse-mode differentiation).nothing: the non-iterated closed-form inversion.
Breeze.PotentialTemperatureFormulations.LiquidIcePotentialTemperatureFormulation — Method
LiquidIcePotentialTemperatureFormulation(
;
temperature_solver
) -> LiquidIcePotentialTemperatureFormulation{Nothing, Nothing, Breeze.AtmosphereModels.DefaultTemperatureSolver}
Return a LiquidIcePotentialTemperatureFormulation with the given temperature_solver. The prognostic and diagnostic fields are materialized later in the model constructor.
using BreezeLiquidIcePotentialTemperatureFormulation(temperature_solver = FixedIterations(2))# outputLiquidIcePotentialTemperatureFormulation└── temperature_solver: FixedIterations(2)Solvers
Breeze.Solvers — Module
SolversIterative solvers for the small nonlinear scalar problems that arise in Breeze's thermodynamics: equation-of-state temperature inversions, saturation adjustment, and dewpoint computation.
A "solver" is a lightweight, isbits description of an iteration's stopping rule that algorithms dispatch on:
NewtonSolverandSecantSolveriterate until a tolerance-based convergence criterion is met (ormaxiteris reached).FixedIterationsperforms an exact number of iterations with no convergence test at all. Because the trip count is fixed, the loop unrolls to straight-line code, which is required for Reactant tracing and cheap reverse-mode differentiation (a tolerance-basedwhileloop traces to an XLAwhileop whose adjoint is pathological — see NumericalEarth/Breeze.jl#767).nothingmeans "do not iterate": the algorithm returns its initial guess (typically a closed-form approximation).
The drivers newton_solve and secant_solve implement the iterations once, so every algorithm shares the same loop logic and the same solver vocabulary.
Tolerance conventions
The choice between reltol and abstol follows the natural scale of the residual:
- Quantities bounded away from zero with a fixed precision target use an absolute tolerance. Every iteration on a temperature (the
θˡⁱ→Tinversion, saturation adjustment, the Boussinesq adjustment temperature) is solved toabstol = 1e-4K — far below any physically or numerically meaningful temperature increment, yet reached in a handful of iterations by both Newton (quadratic) and secant (superlinear). - Quantities that range over orders of magnitude use a relative tolerance against an algorithm-supplied
scale. The dewpoint solve iterates on a saturation-vapor-pressure residual (Pa), which spans roughly two decades over the atmospheric temperature range, so it usesreltol = 1e-4against the vapor pressure; an absolute Pa tolerance would be meaningless across that range.
Iteration caps reflect each method's convergence order and role: the quadratically-convergent Newton inversion caps at maxiter = 8, the superlinear secant temperature solves cap at maxiter = 20, and the dewpoint diagnostic caps at maxiter = 10.
Breeze.Solvers.FixedIterations — Type
struct FixedIterationsA solver that performs exactly iterations iterations with no convergence test.
The fixed trip count means the iteration unrolls to straight-line, branch-free code, making it the right choice for Reactant tracing and reverse-mode differentiation, where data-dependent while loops are pathological (NumericalEarth/Breeze.jl#767).
using BreezeFixedIterations(2)# outputFixedIterations(2)Breeze.Solvers.NewtonSolver — Type
NewtonSolver(; ...) -> NewtonSolver
NewtonSolver(
FT::DataType;
reltol,
abstol,
maxiter
) -> NewtonSolver
Return a NewtonSolver with relative tolerance reltol, absolute tolerance abstol, and iteration cap maxiter.
using BreezeNewtonSolver(maxiter=4)# outputNewtonSolver(reltol=0.0, abstol=0.0001, maxiter=4)Breeze.Solvers.NewtonSolver — Type
struct NewtonSolver{FT}A Newton iteration that terminates when the step size Δx satisfies |Δx| ≤ max(abstol, reltol * |x|), or after maxiter iterations.
Breeze.Solvers.SecantSolver — Type
SecantSolver(; ...) -> SecantSolver
SecantSolver(
FT::DataType;
reltol,
abstol,
maxiter
) -> SecantSolver
Return a SecantSolver with relative tolerance reltol, absolute tolerance abstol, and iteration cap maxiter.
using BreezeSecantSolver(abstol=1e-4, maxiter=20)# outputSecantSolver(reltol=0.0, abstol=0.0001, maxiter=20)Breeze.Solvers.SecantSolver — Type
struct SecantSolver{FT}A secant iteration that terminates when the residual r satisfies |r| ≤ max(abstol, reltol * |scale|) — where scale is an algorithm-supplied magnitude for the residual — or after maxiter iterations.
StaticEnergyFormulations
Breeze.StaticEnergyFormulations — Module
StaticEnergyFormulationsSubmodule defining the static energy thermodynamic formulation for atmosphere models.
StaticEnergyFormulation uses moist static energy density ρe as the prognostic thermodynamic variable. Moist static energy is a conserved quantity in adiabatic, frictionless flow that combines sensible heat, gravitational potential energy, and latent heat.
Breeze.StaticEnergyFormulations.StaticEnergyFormulation — Type
StaticEnergyFormulation uses moist static energy density ρe as the prognostic thermodynamic variable.
Moist static energy is a conserved quantity in adiabatic, frictionless flow that combines sensible heat, gravitational potential energy, and latent heat:
\[e = cᵖᵐ T + g z - ℒˡᵣ qˡ - ℒⁱᵣ qⁱ\]
The energy density equation includes a buoyancy flux term following Pauluis (2008).
TerrainFollowingDiscretization
Breeze.TerrainFollowingDiscretization — Module
TerrainFollowingDiscretizationModule implementing terrain-following vertical coordinates via the TerrainFollowingVerticalDiscretization (TFVD) grid type.
TFVD stores a uniform reference vertical coordinate $r$ and a formulation (e.g. LinearDecay or TwoLevelDecay) that defines the physical altitude
\[z(x, y, r) = r + h(x, y) \, b(r) ,\]
where $h(x, y)$ is the terrain and $b(r)$ is a decay basis satisfying $b(0) = 1$ and $b(z_\text{top}) = 0$.
Public API:
TerrainFollowingVerticalDiscretization— pass as thezargument toRectilinearGrid/LatitudeLongitudeGrid.LinearDecay(Gal-Chen & Somerville 1975).TwoLevelDecay(Schär et al. 2002).materialize_terrain!— fill the formulation's terrain fields from ah(x, y)function once the grid is built.build_terrain_metrics— attach a pressure-gradient stencil.
See docs/src/terrain_following_coordinates.md for the math, discrete operators, well-balancing reference state, and worked examples.
Breeze.TerrainFollowingDiscretization.LinearDecay — Type
struct LinearDecay{FT, H, SX, SY} <: Breeze.TerrainFollowingDiscretization.AbstractTerrainFormulationGal-Chen & Somerville (1975) terrain-following formulation: a single decay basis $b(r) = 1 - r/z_{top}$ that linearly attenuates the terrain from the surface to the model top.
Breeze.TerrainFollowingDiscretization.SlopeInsideInterpolation — Type
struct SlopeInsideInterpolationTerrain pressure gradient stencil where the slope is multiplied inside the interpolation of $∂p'/∂r$:
\[\text{correction} = \overline{\overline{s \, \partial_r p'}^x}^z\]
The slope is evaluated at each (Center, Center, Face) stencil point before averaging to (Face, Center, Center).
Breeze.TerrainFollowingDiscretization.SlopeOutsideInterpolation — Type
struct SlopeOutsideInterpolationTerrain pressure gradient stencil where the slope is multiplied outside the interpolation of $∂p'/∂r$:
\[\text{correction} = s(i,j,k) \, \overline{\overline{\partial_r p'}^x}^z\]
This is the default stencil.
Breeze.TerrainFollowingDiscretization.TerrainFollowingVerticalDiscretization — Method
TerrainFollowingVerticalDiscretization(r_faces; formulation=LinearDecay())Skeleton constructor. r_faces is the reference (computational) r face specification — a range, vector, or function — exactly as for a static z grid. The terrain components inside formulation are filled later by materialize_terrain! once the horizontal grid exists.
Breeze.TerrainFollowingDiscretization.TerrainMetrics — Type
struct TerrainMetrics{H, SX, SY, FT, PG}Pre-computed terrain derivative fields and model top height.
Fields
topography: 2D field storing $h(x, y)$ at(Center, Center)∂x_h: 2D field storing $\partial h / \partial x$ at(Face, Center)∂y_h: 2D field storing $\partial h / \partial y$ at(Center, Face)z_top: Height of the model top (top of the reference coordinate)pressure_gradient_stencil: Stencil type for the terrain-corrected horizontal pressure gradient (SlopeOutsideInterpolationorSlopeInsideInterpolation)
Breeze.TerrainFollowingDiscretization.TwoLevelDecay — Type
struct TwoLevelDecay{ZT, FT, H, SX, SY, B} <: Breeze.TerrainFollowingDiscretization.AbstractTerrainFormulationSchär et al. (2002) "Smooth LEvel VErtical" (SLEVE) terrain-following formulation. Splits the terrain into a smoothed large-scale component $h_1$ (decay length large_scale_height) and the residual small-scale component $h_2$ (decay length small_scale_height). Each is attenuated with a hyperbolic-sine basis $b_n(r) = \sinh((z_{top}-r)/s_n) / \sinh(z_{top}/s_n)$, so the small-scale features decay quickly while the large-scale envelope is preserved aloft.
Constructed via the kwarg form TwoLevelDecay(; large_scale_height, small_scale_height).
Breeze.TerrainFollowingDiscretization.build_terrain_metrics — Method
build_terrain_metrics(grid, stencil) -> TerrainMetrics
Build a TerrainMetrics for a materialized TerrainFollowingVerticalDiscretization grid. On such grids the terrain slope used by the dynamics comes from the grid ∂z∂x operator (formulation decay), so this object only carries the pressure_gradient_stencil, z_top, and a representative terrain field.
Breeze.TerrainFollowingDiscretization.materialize_terrain! — Method
materialize_terrain!(grid, topography) -> Any
Fill the terrain components of a TerrainFollowingVerticalDiscretization grid in place from topography(x, y). Must be called after the grid is built (the horizontal nodes are needed to evaluate the topography). For TwoLevelDecay, the terrain is split into large- and small-scale parts by horizontal smoothing.
The topography is evaluated at the horizontal cell-centre nodes. Its arguments follow the grid's horizontal coordinates with Flat dimensions dropped, matching every other set! initialiser: topography(x, y) on a RectilinearGrid, topography(λ, φ) on a LatitudeLongitudeGrid, and e.g. topography(x) when y is Flat.
Thermodynamics
Breeze.Thermodynamics.ClausiusClapeyron — Type
struct ClausiusClapeyronA saturation vapor pressure formulation based on the Clausius-Clapeyron relation.
The Clausius-Clapeyron equation describes how saturation vapor pressure varies with temperature based on thermodynamic principles. This formulation uses thermodynamic constants (latent heats, heat capacities, triple point values) to compute saturation vapor pressure analytically.
See saturation_vapor_pressure for the implementation details.
Breeze.Thermodynamics.ClausiusClapeyronThermodynamicConstants — Type
ClausiusClapeyronThermodynamicConstants{FT, C, I}Type alias for ThermodynamicConstants using the Clausius-Clapeyron formulation for saturation vapor pressure calculations.
Breeze.Thermodynamics.CondensedPhase — Type
CondensedPhase(; ...)
CondensedPhase(FT; reference_latent_heat, heat_capacity)
Return CondensedPhase with specified parameters converted to FT.
Two examples of CondensedPhase are liquid and ice. When matter is converted from vapor to liquid, water molecules in the gas phase cluster together and slow down to form liquid with heat_capacity, The lost of molecular kinetic energy is called the reference_latent_heat.
Likewise, during deposition, water molecules in the gas phase cluster into ice crystals.
Arguments
FT: Float type to use (defaults toOceananigans.defaults.FloatType)reference_latent_heat: Difference between the internal energy of the gaseous phase at theenergy_reference_temperature.heat_capacity: Heat capacity of the phase of matter.
Breeze.Thermodynamics.ExnerReferenceState — Type
ExnerReferenceState(
grid;
...
) -> ExnerReferenceState{_A, FP, FD, FE} where {_A, FP<:(Field{Nothing, Nothing, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}), FD<:(Field{Nothing, Nothing, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}), FE<:(Field{Nothing, Nothing, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B})}
ExnerReferenceState(
grid,
constants;
surface_pressure,
potential_temperature,
reference_temperature,
standard_pressure,
vapor_mass_fraction
) -> ExnerReferenceState{_A, FP, FD, FE} where {_A, FP<:(Field{Nothing, Nothing, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}), FD<:(Field{Nothing, Nothing, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}), FE<:(Field{Nothing, Nothing, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B})}
Construct an ExnerReferenceState by discrete Exner integration on grid.
Two modes are supported, controlled by which keyword is provided:
Isentropic (potential_temperature): Constant or horizontally-varying θ₀. Each column is built by Newton iteration on the discrete hydrostatic balance $(p_k - p_{k-1})/Δz_{face} + g(ρ_k + ρ_{k-1})/2 = 0$ so the substepper's slow vertical-momentum tendency vanishes to ulp on a rest atmosphere. The same column kernel handles both the 1D path (θ₀ constant or z-dependent) and the 3D path (θ₀(x, y, z)); vapor_mass_fraction is supported in both. When provided, the level-local moist gas constants $Rᵐ = (1-qᵛ)Rᵈ + qᵛRᵛ$, $cᵖᵐ = (1-qᵛ)cᵖᵈ + qᵛcᵖᵛ$ are used; the dry case is recovered exactly when $qᵛ ≡ 0$.
Isothermal (reference_temperature): Constant T₀ (MPAS baroclinic wave convention). Uses the analytic isothermal solution: $p₀(z) = pˢ \exp(-g z / (Rᵈ T₀))$, $Π₀ = (p₀/pˢᵗ)^κ$, $ρ₀ = p₀/(Rᵈ T₀)$, $θ₀ = T₀/Π₀$. This matches MPAS initatmcases.F lines 813-817 exactly.
Arguments
grid: The gridconstants: Thermodynamic constants (default:ThermodynamicConstants(eltype(grid)))
Keyword Arguments
surface_pressure: Pressure at z=0 (default: 101325 Pa)potential_temperature: Constant value or functionθᵣ(z)for isentropic reference (default: 288 K)reference_temperature: Constant T₀ for isothermal reference (default:nothing). When provided, overridespotential_temperature.standard_pressure: pˢᵗ for potential temperature definition (default: 1e5 Pa)vapor_mass_fraction: Optional vapor mass fraction for a moist reference state. A number or functionqᵛ(z)builds a 1D column; a multi-argument functionqᵛ(x, y, z)(orqᵛ(φ, z)on aLatitudeLongitudeGrid) builds a 3D field.
Breeze.Thermodynamics.ExnerReferenceState — Type
ExnerReferenceStateA dry reference state built in Exner coordinates, ensuring that the discrete Exner hydrostatic balance
\[cᵖᵈ θᵣ^{face} \frac{π₀[k] - π₀[k-1]}{Δz} = -g\]
holds exactly at every interior z-face. This is essential for the Exner pressure acoustic substepping formulation, where the vertical pressure gradient is computed as $cᵖᵈ θᵥ ∂π'/∂z$ and the hydrostatic part must cancel to machine precision.
Unlike ReferenceState which builds pressure first and derives Exner, this type builds the Exner function π₀ first by discrete integration and then derives pressure and density from it. This matches CM1's approach where pi0 is the fundamental reference variable.
Fields
surface_pressure: Reference pressure at z=0 (Pa)surface_potential_temperature: Reference potential temperature at z=0 (K)standard_pressure: pˢᵗ for potential temperature definition (Pa)pressure: Reference pressure field $p₀ = pˢᵗ π₀^{cᵖᵈ/Rᵈ}$ (derived from π₀)density: Reference density field $ρ₀ = p₀/(Rᵈ T₀)$ (derived from π₀ and θᵣ)exner_function: Reference Exner function π₀ (built by discrete integration)
Breeze.Thermodynamics.FlatauPolynomial — Type
FlatauPolynomial(
;
...
) -> Breeze.Thermodynamics.FlatauPolynomial
FlatauPolynomial(
FT;
liquid_coefficients,
ice_coefficients,
reference_temperature,
minimum_temperature_offset
) -> Breeze.Thermodynamics.FlatauPolynomial
Construct a FlatauPolynomial saturation vapor pressure formulation: the eighth-order polynomial fits of Flatau et al. (1992) to the saturation vapor pressure over planar liquid and ice surfaces,
\[pᵛ⁺(T) = \sum_{n=0}^{8} aₙ (T - Tᵣ)^n ,\]
with reference_temperature $Tᵣ = 273.16$ K and the relative-error-norm coefficient sets (their Tables 3 and 4), which are the fits in operational use in WRF-family microphysics. The temperature argument is clamped below at $Tᵣ -$ minimum_temperature_offset (80 K), the fits' stated range of validity.
Compared to the default integrated Clausius–Clapeyron formulation the polynomial agrees to within 0.2 % (liquid, 233–313 K) while replacing a ^ and an exp with a branch-free Horner chain — approximately 70× cheaper per call on CPU Float64 and free of the FP64 transcendental penalty on GPUs. See ClausiusClapeyron and TetensFormula for the alternative formulations.
Example
using Breeze.Thermodynamicsconstants = ThermodynamicConstants(; saturation_vapor_pressure = FlatauPolynomial())References
- Flatau, P. J., Walko, R. L. and Cotton, W. R. (1992). Polynomial fits to saturation vapor pressure. Journal of Applied Meteorology 31, 1507–1513.
Breeze.Thermodynamics.FlatauPolynomialThermodynamicConstants — Type
FlatauPolynomialThermodynamicConstants{FT, C, I}Type alias for ThermodynamicConstants using the Flatau et al. (1992) polynomial fits for saturation vapor pressure calculations.
Breeze.Thermodynamics.IdealGas — Type
struct IdealGas{FT}A struct representing an ideal gas with molar mass and specific heat capacity.
Fields
molar_mass: Molar mass of the gas in kg/molheat_capacity: Specific heat capacity at constant pressure in J/(kg·K)
Examples
using Breezedry_air = IdealGas(molar_mass=0.02897, heat_capacity=1005)# outputIdealGas{Float64}(molar_mass=0.02897, heat_capacity=1005.0)Breeze.Thermodynamics.MixedPhaseEquilibrium — Type
MixedPhaseEquilibrium(; freezing_temperature=273.15, homogeneous_ice_nucleation_temperature=233.15)Represents a mixed-phase equilibrium where both liquid and ice condensates are considered. The liquid fraction varies linearly with temperature between the freezing temperature and the homogeneous ice nucleation temperature.
Breeze.Thermodynamics.MoistureMassFractions — Type
struct MoistureMassFractions{FT}A struct representing the moisture mass fractions of a moist air parcel.
Fields
vapor: the mass fraction of vaporliquid: the mass fraction of liquidice: the mass fraction of ice
Breeze.Thermodynamics.MoistureMassFractions — Method
MoistureMassFractions(
r::Breeze.Thermodynamics.MoistureMixingRatio
) -> Breeze.Thermodynamics.MoistureMassFractions
Convert MoistureMixingRatio to MoistureMassFractions.
Mass fractions are defined as mass of constituent per total mass:
\[q = r / (1 + rᵗ)\]
where $rᵗ$ is the total mixing ratio.
Breeze.Thermodynamics.MoistureMixingRatio — Method
MoistureMixingRatio(
q::Breeze.Thermodynamics.MoistureMassFractions
) -> Breeze.Thermodynamics.MoistureMixingRatio
Convert MoistureMassFractions to MoistureMixingRatio.
Mixing ratios are defined as mass of constituent per mass of dry air:
\[r = q / (1 - qᵗ) = q / qᵈ\]
where $qᵗ$ is the total specific moisture and $qᵈ = 1 - qᵗ$ is the dry air mass fraction.
Breeze.Thermodynamics.PlanarMixedPhaseSurface — Type
struct PlanarMixedPhaseSurface{FT}Return PlanarMixedPhaseSurface for computing the saturation vapor pressure over a surface composed of a mixture of liquid and ice, with a given liquid_fraction.
Breeze.Thermodynamics.ReferenceState — Type
ReferenceState(
grid;
...
) -> ReferenceState{_A, P, D, T, QV, QL, QI} where {_A, P<:(Field{Nothing, Nothing, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}), D<:(Field{Nothing, Nothing, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}), T<:(Field{Nothing, Nothing, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}), QV<:(Oceananigans.Fields.ZeroField{_A, 3} where _A), QL<:(Oceananigans.Fields.ZeroField{_A, 3} where _A), QI<:(Oceananigans.Fields.ZeroField{_A, 3} where _A)}
ReferenceState(
grid,
constants;
surface_pressure,
potential_temperature,
standard_pressure,
discrete_hydrostatic_balance,
vapor_mass_fraction,
liquid_mass_fraction,
ice_mass_fraction
) -> ReferenceState{_A, P, D, T, QV, QL, QI} where {_A, P<:(Field{Nothing, Nothing, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}), D<:(Field{Nothing, Nothing, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}), T<:(Field{Nothing, Nothing, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}), QV<:(Oceananigans.Fields.ZeroField{_A, 3} where _A), QL<:(Oceananigans.Fields.ZeroField{_A, 3} where _A), QI<:(Oceananigans.Fields.ZeroField{_A, 3} where _A)}
Return a ReferenceState on grid, with ThermodynamicConstants constants that includes the hydrostatic reference pressure and reference density.
The reference state is initialized with a dry adiabatic temperature profile and the given moisture profiles (zero by default). The pressure and density are then computed by hydrostatic integration using the mixture gas constant $Rᵐ = qᵈ Rᵈ + qᵛ Rᵛ$ and the ideal gas law $ρ = p / (Rᵐ T)$.
Arguments
grid: The grid.constants :: ThermodynamicConstants: By default,ThermodynamicConstants(eltype(grid)).
Keyword arguments
surface_pressure: By default, 101325.potential_temperature: A constant value (default 288) or a function $θ(z)$ giving the potential temperature profile. When a constant is provided, closed-form adiabatic hydrostatic profiles are used. When a function is provided, the hydrostatic profiles are computed by numerical integration of $∂p/∂z = -g ρ$.standard_pressure: Reference pressure for potential temperature ($pˢᵗ$). By default, 1e5.discrete_hydrostatic_balance: Iftrue, recompute the reference pressure from the reference density using discrete integration, so that∂z(p_ref) + g * ℑz(ρ_ref) = 0exactly at the discrete level. By default,false.Discrete vs continuous hydrostatic balance With discrete balance, reference subtraction becomes a no-op (the subtracted terms cancel to machine precision). For split-explicit compressible dynamics, continuous balance (default) is preferred: both the actual and reference states share similar $O(Δz^2)$ truncation errors that cancel in the perturbation PG, leaving only the tiny truncation error of the physical perturbation $∂(p - p_{ref})/∂z$.
vapor_mass_fraction: Initial qᵛ profile. Can be aNumber,Function(z), orField. Default:nothing(ZeroField).liquid_mass_fraction: Initial qˡ profile. Default:nothing(ZeroField).ice_mass_fraction: Initial qⁱ profile. Default:nothing(ZeroField).
Pass =0 to allocate an actual Field initialized to zero — required for later use with compute_reference_state! or set_to_mean!.
Breeze.Thermodynamics.TetensFormula — Type
TetensFormula(; ...) -> Breeze.Thermodynamics.TetensFormula
TetensFormula(
FT;
reference_saturation_vapor_pressure,
reference_temperature,
liquid_coefficient,
liquid_temperature_offset,
ice_coefficient,
ice_temperature_offset
) -> Breeze.Thermodynamics.TetensFormula
Construct a TetensFormula saturation vapor pressure formulation. Tetens's (1930) formula is an empirical relationship for the saturation vapor pressure,
\[pᵛ⁺(T) = pᵛ⁺ᵣ \exp \left( a \frac{T - Tᵣ}{T - δT} \right) ,\]
where $pᵛ⁺ᵣ$ is reference_saturation_vapor_pressure, $Tᵣ$ is reference_temperature, $a$ is an empirical coefficient, and $δT$ is a temperature offset.
See also the wikipedia article on "Tetens equation". Different coefficients are used for liquid water and ice surfaces. Default values for the liquid formula are from Monteith and Unsworth (2014), and default values for the ice formula are from Murray (1967):
Liquid water (T > 0°C):
liquid_coefficient: 17.27liquid_temperature_offset: 35.85 K (corresponding to 237.3 K offset from 0°C)
Ice (T < 0°C):
ice_coefficient: 21.875ice_temperature_offset: 7.65 K (corresponding to 265.5 K offset from 0°C)
References
- Monteith, J. L. and Unsworth, M. H. (2014). Principles of Environmental Physics. 4th Edition (Academic Press).
- Murray, F. W. (1967). On the computation of saturation vapor pressure. Journal of Applied Meteorology 6, 203–204.
- Tetens, O. (1930). Über einige meteorologische Begriffe. Zeitschrift für Geophysik 6, 297–309.
- Wikipedia: Tetens equation; https://en.wikipedia.org/wiki/Tetens_equation
Example
julia> using Breeze.Thermodynamicsjulia> tf = TetensFormula()TetensFormula{Float64}(pᵣ=610.0, Tᵣ=273.15, aˡ=17.27, δTˡ=35.85, aⁱ=21.875, δTⁱ=7.65)Breeze.Thermodynamics.TetensFormulaThermodynamicConstants — Type
TetensFormulaThermodynamicConstants{FT, C, I}Type alias for ThermodynamicConstants using the Tetens formula for saturation vapor pressure calculations.
Breeze.Thermodynamics.ThermodynamicConstants — Type
ThermodynamicConstants(; ...) -> ThermodynamicConstants
ThermodynamicConstants(
FT;
molar_gas_constant,
gravitational_acceleration,
energy_reference_temperature,
triple_point_temperature,
triple_point_pressure,
dry_air_molar_mass,
dry_air_heat_capacity,
vapor_molar_mass,
vapor_heat_capacity,
liquid,
ice,
saturation_vapor_pressure
) -> ThermodynamicConstants
Return ThermodynamicConstants with parameters that represent gaseous mixture of dry "air" and vapor, as well as condensed liquid and ice phases. The triple_point_temperature and triple_point_pressure may be combined with internal energy parameters for condensed phases to compute the vapor pressure at the boundary between vapor and a homogeneous sample of the condensed phase. The gravitational_acceleration parameter is included to compute ReferenceState quantities associated with hydrostatic balance.
Breeze.Thermodynamics.WarmPhaseEquilibrium — Type
WarmPhaseEquilibrium()Represents a warm-phase equilibrium where only liquid water condensate is considered. The equilibrated surface is always a planar liquid surface.
Breeze.Thermodynamics.adiabatic_hydrostatic_density — Method
adiabatic_hydrostatic_density(
z,
p₀,
θ₀,
pˢᵗ,
constants
) -> Any
Compute the reference density at height z that associated with the reference pressure p₀, potential temperature θ₀, and standard pressure pˢᵗ. The reference density is defined as the density of dry air at the reference pressure and temperature.
Breeze.Thermodynamics.adiabatic_hydrostatic_pressure — Method
adiabatic_hydrostatic_pressure(
z,
p₀,
θ₀,
pˢᵗ,
constants
) -> Any
Compute the reference pressure at height z that associated with the reference pressure p₀, potential temperature θ₀, and standard pressure pˢᵗ. The reference pressure is defined as the pressure of dry air at the reference pressure and temperature.
Breeze.Thermodynamics.adjustment_saturation_specific_humidity — Method
adjustment_saturation_specific_humidity(
T,
pᵣ,
qᵗ,
constants,
surface
) -> Any
Compute the saturation specific humidity $qᵛ⁺$ for use in saturation adjustment, assuming saturated conditions where condensate is present.
This function always uses the saturated formula (equation 37 in paper by Pressel et al. 2015):
\[qᵛ⁺ = ϵᵈᵛ (1 - qᵗ) \frac{pᵛ⁺}{pᵣ - pᵛ⁺}\]
where $ϵᵈᵛ = Rᵈ / Rᵛ ≈ 0.622$.
Unlike equilibrium_saturation_specific_humidity, this function does not check whether the air is actually saturated. It is intended for use within the saturation adjustment iteration where we assume saturated conditions throughout.
Breeze.Thermodynamics.adjustment_saturation_specific_humidity — Method
adjustment_saturation_specific_humidity(
T,
pᵣ,
qᵗ,
constants,
equilibrium::Breeze.Thermodynamics.AbstractPhaseEquilibrium
) -> Any
Compute the adjustment saturation specific humidity using a phase equilibrium model to determine the condensation surface based on temperature T.
Breeze.Thermodynamics.compute_hydrostatic_reference! — Method
compute_hydrostatic_reference!(
ref::ReferenceState,
constants
)
Compute the hydrostatic reference pressure and density profiles from the temperature and moisture mass fraction profiles stored in ref.
The integration uses the mixture gas constant Rᵐ = qᵈ Rᵈ + qᵛ Rᵛ (where qᵈ = 1 - qᵛ - qˡ - qⁱ) and the ideal gas law ρ = p / (Rᵐ T).
Breeze.Thermodynamics.compute_reference_state! — Method
compute_reference_state!(
ref::ReferenceState,
T̄,
q̄ᵗ,
constants
)
Convenience method that assumes all moisture is vapor (no condensate in the reference state). Equivalent to compute_reference_state!(reference_state, T̄, q̄ᵗ, 0, 0, constants).
Breeze.Thermodynamics.compute_reference_state! — Method
compute_reference_state!(
ref::ReferenceState,
T̄,
q̄ᵛ,
q̄ˡ,
q̄ⁱ,
constants
)
Recompute the reference pressure and density profiles by setting the reference temperature to T̄ and moisture mass fractions to q̄ᵛ, q̄ˡ, q̄ⁱ, then integrating the hydrostatic equation using the mixture gas constant Rᵐ = qᵈ Rᵈ + qᵛ Rᵛ and ideal gas law ρ = p / (Rᵐ T).
T̄, q̄ᵛ, q̄ˡ, q̄ⁱ can be Numbers, Function(z)s, or Fields.
This function is useful for:
- Initialization: setting the reference state to match a non-constant-θ initial condition
- Runtime: calling from a callback to keep the reference state close to the evolving mean state
Breeze.Thermodynamics.dewpoint_temperature — Method
dewpoint_temperature(
pᵛ,
T,
constants,
surface,
solver
) -> Any
Compute the dewpoint temperature $T⁺$ given the vapor pressure pᵛ, actual temperature T, thermodynamic constants, and condensation surface.
The dewpoint temperature is defined as the temperature at which the saturation vapor pressure equals the actual vapor pressure:
\[pᵛ⁺(T⁺) = pᵛ\]
This implicit equation is solved using secant iteration, which works with any saturation vapor pressure formulation.
If the air is saturated or supersaturated ($pᵛ ≥ pᵛ⁺(T)$), the dewpoint equals the actual temperature and T is returned.
Arguments
pᵛ: Vapor pressure (Pa)T: Actual temperature (K), used as upper bound and first guessconstants:ThermodynamicConstantssurface: Surface type for saturation vapor pressure calculationsolver: Iterative solver controlling the secant iteration; the convergence criterion compares the vapor pressure residual againstpᵛ. When omitted, defaults toSecantSolver(reltol=1e-4, abstol=0, maxiter=10).
Breeze.Thermodynamics.dewpoint_temperature — Method
dewpoint_temperature(
pᵛ,
T,
constants,
equilibrium::Breeze.Thermodynamics.AbstractPhaseEquilibrium,
solver
) -> Any
Compute the dewpoint temperature using a phase equilibrium model to determine the condensation surface based on temperature T.
Breeze.Thermodynamics.equilibrated_surface — Function
equilibrated_surface(phase_equilibrium::AbstractPhaseEquilibrium, T)Return the appropriate surface type for computing saturation vapor pressure given the phase equilibrium model and temperature T.
Breeze.Thermodynamics.equilibrium_saturation_specific_humidity — Method
equilibrium_saturation_specific_humidity(
T,
p,
qᵗ,
constants,
surface
) -> Any
Compute the equilibrium saturation specific humidity $qᵛ⁺$ for air at temperature T, reference pressure p, and total specific moisture qᵗ, over a given surface. The function returns the correct saturation specific humidity in both saturated and unsaturated conditions:
In saturated conditions ($qᵗ ≥ qᵛ⁺$), condensate is present and $qᵛ = qᵛ⁺$. The dry-air mass fraction is fixed by $qᵗ$ (since $qᵈ = 1 - qᵗ$), and the equation of state can be solved in closed form or $qᵛ⁺$, yielding equation (37) of Pressel et al. (2015):
\[qᵛ⁺ = \frac{ϵᵈᵛ \, (1 - qᵗ) \, pᵛ⁺(T)}{p - pᵛ⁺(T)} ,\]
where $ϵᵈᵛ ≡ Rᵈ / Rᵛ ≈ 0.622$.
In unsaturated conditions ($qᵗ < qᵛ⁺$), all moisture is vapor and $qᵛ = qᵗ$. The density is then $ρ = p / (Rᵐ T)$ with mixture gas constant $Rᵐ = (1 - qᵗ) Rᵈ + qᵗ Rᵛ$, and
\[qᵛ⁺ = \frac{pᵛ⁺(T)}{ρ \, Rᵛ \, T} .\]
The function selects the branch by computing the unsaturated $qᵛ⁺$ and comparing with qᵗ. See also saturation_total_specific_moisture, which is the special case $qᵗ = qᵛ⁺$, and the Atmosphere Thermodynamics section of the documentation for a derivation.
Breeze.Thermodynamics.equilibrium_saturation_specific_humidity — Method
equilibrium_saturation_specific_humidity(
T,
pᵣ,
qᵗ,
constants,
equilibrium::Breeze.Thermodynamics.AbstractPhaseEquilibrium
) -> Any
Compute the equilibrium saturation specific humidity using a phase equilibrium model to determine the condensation surface based on temperature T.
Breeze.Thermodynamics.evaluate_profile — Method
evaluate_profile(profile, z)Evaluate a vertical profile at height z. If profile is a Number, returns it unchanged. If profile is a Function, calls profile(z).
Breeze.Thermodynamics.ice_latent_heat — Method
ice_latent_heat(T, constants::ThermodynamicConstants) -> Any
Return the latent heat of sublimation (vapor → ice) at temperature T.
The latent heat varies linearly with temperature:
\[ℒⁱ(T) = ℒⁱᵣ + (cᵖᵛ - cⁱ)(T - Tᵣ)\]
where $ℒⁱᵣ$ is the reference latent heat at the energy reference temperature $Tᵣ$, $cᵖᵛ$ is the heat capacity of vapor, and $cⁱ$ is the heat capacity of ice.
Breeze.Thermodynamics.liquid_latent_heat — Method
liquid_latent_heat(
T,
constants::ThermodynamicConstants
) -> Any
Return the latent heat of vaporization (vapor → liquid) at temperature T.
The latent heat varies linearly with temperature:
\[ℒˡ(T) = ℒˡᵣ + (cᵖᵛ - cˡ)(T - Tᵣ)\]
where $ℒˡᵣ$ is the reference latent heat at the energy reference temperature $Tᵣ$, $cᵖᵛ$ is the heat capacity of vapor, and $cˡ$ is the heat capacity of liquid water.
Breeze.Thermodynamics.mixture_gas_constant — Method
mixture_gas_constant(
q::Breeze.Thermodynamics.MoistureMassFractions,
constants::ThermodynamicConstants
) -> Any
Return the gas constant of moist air mixture [in J/(kg K)] given the specific humidity q and thermodynamic parameters constants.
The mixture gas constant is calculated as a weighted average of the dry air and water vapor gas constants:
\[Rᵐ = qᵈ Rᵈ + qᵛ Rᵛ ,\]
where:
Rᵈis the dry air gas constant,Rᵛis the water vapor gas constant,qᵈis the mass fraction of dry air, andqᵛis the mass fraction of water vapor.
Arguments
q: the moisture mass fractions (vapor, liquid, and ice)constants:ThermodynamicConstantsinstance containing gas constants
Breeze.Thermodynamics.mixture_gas_constant — Method
mixture_gas_constant(
r::Breeze.Thermodynamics.MoistureMixingRatio,
constants::ThermodynamicConstants
) -> Any
Compute the gas constant of a moist air mixture given moisture mixing ratios.
Converts mixing ratios to mass fractions and calls mixture_gas_constant(q::MMF, constants).
Breeze.Thermodynamics.mixture_heat_capacity — Method
mixture_heat_capacity(
q::Breeze.Thermodynamics.MoistureMassFractions,
constants::ThermodynamicConstants
) -> Any
Compute the heat capacity of a mixture of dry air, vapor, liquid, and ice, where the mass fractions of vapor, liquid, and ice are given by q. The heat capacity of moist air is the weighted sum of its constituents:
\[cᵖᵐ = qᵈ cᵖᵈ + qᵛ cᵖᵛ + qˡ cˡ + qⁱ cⁱ ,\]
where qᵛ = q.vapor, qˡ = q.liquid, qⁱ = q.ice are the mass fractions of vapor, liquid, and ice constituents, respectively, and qᵈ = 1 - qᵛ - qˡ - qⁱ is the mass fraction of dry air. The heat capacities cᵖᵈ, cᵖᵛ, cˡ, cⁱ are the heat capacities of dry air, vapor, liquid, and ice at constant pressure, respectively. The liquid and ice phases are assumed to be incompressible.
Breeze.Thermodynamics.mixture_heat_capacity — Method
mixture_heat_capacity(
r::Breeze.Thermodynamics.MoistureMixingRatio,
constants::ThermodynamicConstants
) -> Any
Compute the heat capacity of a moist air mixture given moisture mixing ratios.
Converts mixing ratios to mass fractions and calls mixture_heat_capacity(q::MMF, constants).
Breeze.Thermodynamics.potential_temperature_from_temperature — Method
potential_temperature_from_temperature(
T,
p,
pˢᵗ,
constants,
qᵛ
) -> Any
Compute potential temperature from temperature and pressure.
This is a convenience function that constructs a LiquidIcePotentialTemperatureState with no condensate and computes potential temperature using the standard thermodynamic relations.
Arguments
T: Temperature [K]p: Pressure [Pa]constants: Thermodynamic constants
Additional Arguments
pˢᵗ: Standard pressure for potential temperature definition [Pa]qᵛ: Specific humidity [kg/kg]
Breeze.Thermodynamics.pressure_balanced_density — Method
pressure_balanced_density(
ρ_background,
θ_background,
θ_initial
) -> Any
Return the density that keeps pressure unchanged when applying a potential-temperature perturbation at fixed composition.
pressure_balanced_density(ρ_background, θ_background, θ_initial) applies the dry-air / vapor-only relation, for which holding $ρ θ$ fixed avoids seeding an acoustic pressure perturbation.
For fixed-composition states with nonzero liquid or ice condensate, use pressure_balanced_density(ρ_background, θ_background, θ_initial, q, pᵣ, pˢᵗ, constants) instead. The condensate-aware method evaluates the full liquid-ice potential-temperature equation of state before balancing density.
Examples
using Breeze.Thermodynamics: pressure_balanced_densityρ_background = 1.0θ_background = 300.0θ_initial = 303.0pressure_balanced_density(ρ_background, θ_background, θ_initial)# output0.9900990099009901Breeze.Thermodynamics.relative_humidity — Function
relative_humidity(T, ρ, qᵛ, constants) -> Any
relative_humidity(T, ρ, qᵛ, constants, surface) -> Any
Compute the relative humidity as the ratio of vapor pressure to saturation vapor pressure:
\[ℋ = pᵛ / pᵛ⁺ = qᵛ / qᵛ⁺\]
Breeze.Thermodynamics.saturation_specific_humidity — Method
saturation_specific_humidity(
T,
ρ,
constants,
surface
) -> Any
Compute the saturation specific humidity for a gas at temperature T, total density ρ, constantsdynamics, and over surface via:
\[qᵛ⁺ = pᵛ⁺ / (ρ Rᵛ T) ,\]
where $pᵛ⁺$ is the saturation_vapor_pressure over surface, $ρ$ is total density, and $Rᵛ$ is the specific gas constant for water vapor.
Examples
First we compute the saturation specific humidity over a liquid surface:
using Breezeusing Breeze.Thermodynamics: PlanarLiquidSurface, PlanarIceSurface, PlanarMixedPhaseSurfaceconstants = ThermodynamicConstants()T = 288.0 # Room temperature (K)p = 101325.0 # Mean sea-level pressureRᵈ = Breeze.Thermodynamics.dry_air_gas_constant(constants)q = zero(Breeze.Thermodynamics.MoistureMassFractions{Float64})ρ = Breeze.Thermodynamics.density(T, p, q, constants)qᵛ⁺ˡ = Breeze.Thermodynamics.saturation_specific_humidity(T, ρ, constants, PlanarLiquidSurface())# output0.010359995391195264Note, this is slightly smaller than the saturation specific humidity over an ice surface:
julia> qᵛ⁺ˡ = Breeze.Thermodynamics.saturation_specific_humidity(T, ρ, constants, PlanarIceSurface())0.011945100768555072If a medium contains a mixture of 40% water and 60% ice that has (somehow) acquired thermodynamic equilibrium, we can compute the saturation specific humidity over the mixed phase surface,
mixed_surface = PlanarMixedPhaseSurface(0.4)qᵛ⁺ᵐ = Breeze.Thermodynamics.saturation_specific_humidity(T, ρ, constants, mixed_surface)# output0.01128386068542303Breeze.Thermodynamics.saturation_vapor_pressure — Method
saturation_vapor_pressure(
T,
constants::Breeze.Thermodynamics.ClausiusClapeyronThermodynamicConstants,
surface
) -> Any
Compute the saturation vapor pressure $pᵛ⁺$ over a surface labeled $β$ (for example, a planar liquid surface, or curved ice surface) using the Clausius-Clapeyron relation,
\[𝖽pᵛ⁺ / 𝖽T = pᵛ⁺ ℒᵝ(T) / (Rᵛ T^2) ,\]
where the temperature-dependent latent heat of the surface is $ℒᵝ(T)$.
Using a model for the latent heat that is linear in temperature, eg
\[ℒᵝ = ℒᵝ₀ + Δcᵝ T,\]
where $ℒᵝ₀ ≡ ℒᵝ(T=0)$ is the latent heat at absolute zero and $Δcᵝ ≡ cᵖᵛ - cᵝ$ is the constant difference between the vapor specific heat and the specific heat of phase $β$.
Note that we typically parameterize the latent heat in terms of a reference temperature $T = Tᵣ$ that is well above absolute zero. In that case, the latent heat is written
\[ℒᵝ = ℒᵝᵣ + Δcᵝ (T - Tᵣ) \qquad \text{and} \qquad ℒᵝ₀ = ℒᵝᵣ - Δcᵝ Tᵣ .\]
Integrating the Clausius-Clapeyron relation with a temperature-linear latent heat model, from the triple point pressure and temperature $(pᵗʳ, Tᵗʳ)$ to pressure $pᵛ⁺$ and temperature $T$, we obtain
\[\log(pᵛ⁺ / pᵗʳ) = - ℒᵝ₀ / (Rᵛ T) + ℒᵝ₀ / (Rᵛ Tᵗʳ) + (Δcᵝ / Rᵛ) \log(T / Tᵗʳ) ,\]
which then becomes
\[pᵛ⁺(T) = pᵗʳ (T / Tᵗʳ)^{Δcᵝ / Rᵛ} \exp \left [ (1/Tᵗʳ - 1/T) ℒᵝ₀ / Rᵛ \right ] .\]
Breeze.Thermodynamics.saturation_vapor_pressure — Method
saturation_vapor_pressure(
T,
constants::Breeze.Thermodynamics.FlatauPolynomialThermodynamicConstants,
surface::Breeze.Thermodynamics.PlanarMixedPhaseSurface
) -> Any
Compute the saturation vapor pressure over a planar mixed-phase surface by linearly interpolating the liquid and ice Flatau polynomials by liquid_fraction.
Breeze.Thermodynamics.saturation_vapor_pressure — Method
saturation_vapor_pressure(
T,
constants::Breeze.Thermodynamics.FlatauPolynomialThermodynamicConstants,
_::PlanarIceSurface
) -> Any
Compute the saturation vapor pressure over a planar ice surface from the Flatau et al. (1992) eighth-order polynomial in $T - Tᵣ$.
Breeze.Thermodynamics.saturation_vapor_pressure — Method
saturation_vapor_pressure(
T,
constants::Breeze.Thermodynamics.FlatauPolynomialThermodynamicConstants,
_::PlanarLiquidSurface
) -> Any
Compute the saturation vapor pressure over a planar liquid surface from the Flatau et al. (1992) eighth-order polynomial in $T - Tᵣ$.
Breeze.Thermodynamics.saturation_vapor_pressure — Method
saturation_vapor_pressure(
T,
constants::Breeze.Thermodynamics.TetensFormulaThermodynamicConstants,
surface::Breeze.Thermodynamics.PlanarMixedPhaseSurface
) -> Any
Compute the saturation vapor pressure over a mixed-phase surface by linearly interpolating between liquid and ice saturation vapor pressures based on the liquid fraction.
Breeze.Thermodynamics.saturation_vapor_pressure — Method
saturation_vapor_pressure(
T,
constants::Breeze.Thermodynamics.TetensFormulaThermodynamicConstants,
_::PlanarIceSurface
) -> Any
Compute the saturation vapor pressure over a planar ice surface using Tetens' empirical formula with ice coefficients from Murray (1967):
\[pᵛ⁺(T) = pᵛ⁺ᵣ \exp \left( aⁱ \frac{T - Tᵣ}{T - δTⁱ} \right)\]
References
- Murray, F. W. (1967). On the computation of saturation vapor pressure. Journal of Applied Meteorology 6, 203–204.
- Tetens, O. (1930). Über einige meteorologische Begriffe. Zeitschrift für Geophysik 6, 297–309.
Breeze.Thermodynamics.saturation_vapor_pressure — Method
saturation_vapor_pressure(
T,
constants::Breeze.Thermodynamics.TetensFormulaThermodynamicConstants,
_::PlanarLiquidSurface
) -> Any
Compute the saturation vapor pressure over a planar liquid surface using Tetens' empirical formula:
\[pᵛ⁺(T) = pᵛ⁺ᵣ \exp \left( aˡ \frac{T - Tᵣ}{T - δTˡ} \right)\]
Breeze.Thermodynamics.supersaturation — Method
supersaturation(
T,
ρ,
q::Breeze.Thermodynamics.MoistureMassFractions,
constants,
surface
) -> Any
Compute the supersaturation $𝒮 = pᵛ/pᵛ⁺ - 1$ over a given surface.
- $𝒮 < 0$ indicates subsaturation (evaporation conditions)
- $𝒮 = 0$ indicates saturation (equilibrium)
- $𝒮 > 0$ indicates supersaturation (condensation conditions)
Arguments
T: Temperatureρ: Total air densityq:MoistureMassFractionscontaining vapor, liquid, and ice mass fractionsconstants:ThermodynamicConstantssurface: Surface type (e.g.,PlanarLiquidSurface(),PlanarIceSurface())
Breeze.Thermodynamics.surface_density — Method
surface_density(p₀, θ₀, pˢᵗ, constants)Compute the surface air density from surface pressure p₀, potential temperature θ₀, standard pressure pˢᵗ, and thermodynamic constants using the ideal gas law for dry air.
The temperature is computed from potential temperature using the Exner function: T₀ = Π₀ * θ₀ where Π₀ = (p₀ / pˢᵗ)^(Rᵈ/cᵖᵈ).
Breeze.Thermodynamics.surface_density — Method
surface_density(p₀, T₀, constants)Compute the surface air density from surface pressure p₀, surface temperature T₀, and thermodynamic constants using the ideal gas law for dry air.
Breeze.Thermodynamics.surface_density — Method
surface_density(reference_state)Return the density at z=0 by interpolating the reference density field to the surface.
Breeze.Thermodynamics.temperature_from_potential_temperature — Method
temperature_from_potential_temperature(
θ,
p,
pˢᵗ,
constants,
qᵛ
) -> Any
Compute temperature from potential temperature and pressure.
This is a convenience function that constructs a LiquidIcePotentialTemperatureState with no condensate and computes temperature using the standard thermodynamic relations.
Arguments
θ: Potential temperature [K]p: Pressure [Pa]constants: Thermodynamic constants
Additional Arguments
pˢᵗ: Standard pressure for potential temperature definition [Pa]qᵛ: Specific humidity [kg/kg]
Breeze.Thermodynamics.vapor_pressure — Method
vapor_pressure(T, ρ, qᵛ, constants) -> Any
Compute the vapor pressure from the ideal gas law:
\[pᵛ = ρ qᵛ Rᵛ T\]
TimeSteppers
Breeze.TimeSteppers — Module
TimeSteppers module for Breeze.jl
Provides time stepping schemes for AtmosphereModel, including:
SSPRungeKutta3: Standard SSP RK3 scheme for explicit time steppingAcousticRungeKutta3: Wicker-Skamarock RK3 with acoustic substepping for compressible dynamics
Breeze.TimeSteppers.AcousticRungeKutta3 — Type
struct AcousticRungeKutta3{FT, U0, TG, TI, AS} <: Oceananigans.TimeSteppers.AbstractTimeStepperWicker–Skamarock third-order Runge–Kutta time stepper with linearized acoustic substepping for fully compressible dynamics. Stage fractions $β = (1/3, 1/2, 1)$. Each stage:
- Re-evaluates slow tendencies (advection + Coriolis + closure + forcing only — PGF and buoyancy are handled inside the substep loop in linearized form).
- Runs an inner substep loop that evolves linearized acoustic perturbations from the RK stage-entry state, initialized with a rewind term so every stage still advances from the outer-step-start prognostic state.
The acoustic substep loop is in acoustic_rk3_substep_loop!; see AcousticSubstepper for the substepper's storage and parameters.
Fields
β₁, β₂, β₃: Stage fractions (1/3, 1/2, 1).U⁰: Storage for state at the beginning of the outer time-step.Gⁿ: Slow-tendency fields, recomputed each stage.implicit_solver: Optional implicit solver for diffusion.substepper:AcousticSubstepperfor the linearized acoustic substep loop.
References
Wicker, L. J. & Skamarock, W. C. (2002). Time-splitting methods for elastic models using forward time schemes. MWR 130, 2088–2097.
Breeze.TimeSteppers.AcousticRungeKutta3 — Method
AcousticRungeKutta3(grid, prognostic_fields;
dynamics,
implicit_solver = nothing,
Gⁿ = map(similar, prognostic_fields),
U⁰ = map(similar, prognostic_fields))Construct an AcousticRungeKutta3 time stepper for fully compressible dynamics.
Gⁿ and U⁰ may be supplied to alias another stepper's tendency storage instead of allocating fresh fields (used by the native-stepper adiabatic-balance twin).
Breeze.TimeSteppers.SSPRungeKutta3 — Type
struct SSPRungeKutta3{FT, U0, TG, TI} <: Oceananigans.TimeSteppers.AbstractTimeStepperA strong stability preserving (SSP) third-order Runge-Kutta time stepper.
This time stepper uses the classic SSP RK3 scheme (Shu-Osher 2006 form):
\[\begin{align*} u^{(1)} &= u^{(0)} + Δt \, G(u^{(0)}) \\ u^{(2)} &= \frac{3}{4} u^{(0)} + \frac{1}{4} u^{(1)} + \frac{1}{4} Δt \, G(u^{(1)}) \\ u^{(3)} &= \frac{1}{3} u^{(0)} + \frac{2}{3} u^{(2)} + \frac{2}{3} Δt \, G(u^{(2)}) \end{align*}\]
where $G$ above is the right-hand-side, e.g., $\partial_t u = G(u)$.
Each stage can be written in the form:
\[u^{(m)} = (1 - α) u^{(0)} + α \left[u^{(m-1)} + Δt \, G(u^{(m-1)}) \right]\]
with $α = 1, 1/4, 2/3$ for stages 1, 2, 3 respectively.
This scheme has CFL coefficient equal to 1 and it is TVD (total variation diminishing).
Fields
α¹, α², α³: Stage coefficients (1, 1/4, 2/3)U⁰: Storage for state at beginning of time stepGⁿ: Tendency fields at current stageimplicit_solver: Optional implicit solver for diffusion
Breeze.TimeSteppers.SSPRungeKutta3 — Method
SSPRungeKutta3(
grid,
prognostic_fields;
dynamics,
implicit_solver,
Gⁿ,
U⁰
) -> SSPRungeKutta3{_A, _B, _C, Nothing} where {_A, _B, _C}
Construct an SSPRungeKutta3 on grid with prognostic_fields as described by Shu and Osher (1988).
Keyword Arguments
implicit_solver: Optional implicit solver for diffusion. Default:nothingGⁿ: Tendency fields at current stage. Default: similar toprognostic_fieldsU⁰: Storage for the state at the beginning of the step. Default: similar toprognostic_fields. Accepting it as a keyword lets callers (e.g. the adiabatic-balance twin) alias another stepper's tendency storage instead of allocating fresh fields.
References
Shu, C.-W., & Osher, S. (1988). Efficient implementation of essentially non-oscillatory shock-capturing schemes. Journal of Computational Physics, 77(2), 439-471.
Breeze.TimeSteppers.ssp_rk3_substep! — Method
ssp_rk3_substep!(model, Δt, α)
Apply an SSP RK3 substep with coefficient $α$:
\[u^{(m)} = (1 - α) u^{(0)} + α \left[ u^{(m-1)} + Δt \, G \right]\]
where $u^{(0)}$ is stored in the time stepper, $u^{(m-1)}$ is the current field value, and $G$ is the current tendency.
Breeze.TimeSteppers.store_initial_state! — Method
store_initial_state!(model)
Copy prognostic fields to U⁰ storage for use in later RK3 stages.
TurbulenceClosures
VerticalGrids
Breeze.VerticalGrids.PiecewiseStretchedDiscretization — Type
PiecewiseStretchedDiscretization(; z, Δz)Construct a stretched vertical grid where the spacing varies piecewise-linearly between breakpoints. The grid spacing is specified at breakpoint heights z, and linearly interpolated between them.
Between breakpoints where Δz values are equal, the grid is uniform. Where they differ, the spacing transitions linearly.
The result behaves as a vector of face positions and can be passed directly to RectilinearGrid as a coordinate argument.
Keyword Arguments
z: sorted vector of breakpoint heights (length ≥ 2)Δz: vector of grid spacings at each breakpoint (same length asz, all positive)
Examples
A three-region grid with uniform fine spacing, a linear transition, and uniform coarse spacing (as used for tropical cyclone simulations):
z = PiecewiseStretchedDiscretization( z = [0, 1000, 3500, 28000], Δz = [62.5, 62.5, 2000, 2000])Nz = length(z) - 1grid = RectilinearGrid(arch; size=(Nx, Ny, Nz), x=(0, Lx), y=(0, Ly), z)A four-region grid for deep convection (fine near surface, transition to moderate, uniform through the troposphere, then stretched to the model top):
z = PiecewiseStretchedDiscretization( z = [0, 1275, 5100, 18000, 27000], Δz = [50, 50, 100, 100, 300])BreezeRRTMGPExt
BreezeCloudMicrophysicsExt
Private API
Advection
AnelasticEquations
Breeze.AtmosphereModels.buoyancy_forceᶜᶜᶜ — Method
buoyancy_forceᶜᶜᶜ(
i,
j,
k,
grid,
dynamics::AnelasticDynamics,
temperature,
specific_prognostic_moisture,
microphysics,
microphysical_fields,
constants
) -> Any
Compute the buoyancy force density for anelastic dynamics at cell center (i, j, k).
The anelastic buoyancy force is the gravitational force on the density anomaly:
\[-g ρ' = -g (ρ - ρ_r)\]
where $ρ = p_r / (R^m T)$ is the in-situ density from the ideal gas law, and $ρ_r = p_r / (R^m_r T_r)$ is the reference density. Substituting:
\[\rho' = \frac{p_r}{R^m T} - \frac{p_r}{R^m_r T_r} = \frac{p_r}{R^m_r T_r} \left( \frac{R^m_r T_r}{R^m T} - 1 \right) = \rho_r \left( \frac{R^m_r T_r}{R^m T} - 1 \right)\]
This "perturbation form" avoids subtracting two large, nearly-equal numbers ($p_r / (R^m T) - ρ_r$), which causes catastrophic cancellation when $T ≈ T_r$. Instead, the ratio $R^m_r T_r / (R^m T)$ is close to 1, and the subtraction of 1 preserves relative precision.
Here, $R^m = q^d R^d + q^v R^v$ is the mixture gas constant for the current moisture state and $R^m_r$ is the mixture gas constant for the reference moisture state.
Breeze.AtmosphereModels.compute_pressure_correction! — Method
compute_pressure_correction!(
model::AtmosphereModel{<:AnelasticDynamics},
Δt
)
Compute the pressure correction for anelastic dynamics by solving the pressure Poisson equation.
Breeze.AtmosphereModels.default_drag_surface_temperature — Method
default_drag_surface_temperature(
dynamics::AnelasticDynamics,
grid,
constants
) -> Any
Default surface temperature for BulkDrag under AnelasticDynamics: the reference-state surface temperature, recovered from the reference potential temperature via the surface Exner function $T₀ = (p₀/pˢᵗ)^{Rᵈ/cᵖᵈ}\,θ₀$.
Used only when the user constructs BulkDrag without an explicit surface_temperature. The result is a horizontally uniform scalar.
Breeze.AtmosphereModels.default_dynamics — Method
default_dynamics(
grid,
constants
) -> AnelasticDynamics{R, Nothing} where R<:(ReferenceState{_A, P, D, T, QV, QL, QI} where {_A, P<:(Field{Nothing, Nothing, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}), D<:(Field{Nothing, Nothing, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}), T<:(Field{Nothing, Nothing, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}), QV<:(Oceananigans.Fields.ZeroField{_A, 3} where _A), QL<:(Oceananigans.Fields.ZeroField{_A, 3} where _A), QI<:(Oceananigans.Fields.ZeroField{_A, 3} where _A)})
Construct a "stub" AnelasticDynamics with just the reference_state. The pressure anomaly field is materialized later in the model constructor.
Breeze.AtmosphereModels.dynamics_density — Method
dynamics_density(dynamics::AnelasticDynamics) -> Any
Return the reference density field for AnelasticDynamics.
For anelastic models, the dynamics density is the time-independent reference state density $ρᵣ(z)$.
Breeze.AtmosphereModels.dynamics_pressure — Method
dynamics_pressure(dynamics::AnelasticDynamics) -> Any
Return the dynamics pressure field for AnelasticDynamics, in Pa.
For anelastic models, this is the time-independent hydrostatic reference state pressure $pᵣ(z)$.
Breeze.AtmosphereModels.initialize_model_thermodynamics! — Method
initialize_model_thermodynamics!(
model::AtmosphereModel{<:AnelasticDynamics}
)
Initialize thermodynamic state for anelastic models. Sets the initial potential temperature to the reference state value.
Breeze.AtmosphereModels.make_pressure_correction! — Method
make_pressure_correction!(
model::AtmosphereModel{<:AnelasticDynamics},
Δt
)
Update the predictor momentum $(ρu, ρv, ρw)$ with the non-hydrostatic pressure via
\[(\rho\boldsymbol{u})^{n+1} = (\rho\boldsymbol{u})^n - \Delta t \, \rho_r \boldsymbol{\nabla} \left( \alpha_r p_{nh} \right)\]
Breeze.AtmosphereModels.materialize_dynamics — Method
materialize_dynamics(
dynamics::AnelasticDynamics,
grid,
boundary_conditions,
thermodynamic_constants
) -> AnelasticDynamics{_A, P} where {_A, P<:(Field{Center, Center, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B})}
Materialize a stub AnelasticDynamics into a full dynamics object with the pressure anomaly field.
Breeze.AtmosphereModels.pressure_anomaly — Method
pressure_anomaly(dynamics::AnelasticDynamics) -> Any
Return the non-hydrostatic pressure anomaly for AnelasticDynamics, in Pa.
Breeze.AtmosphereModels.standard_pressure — Method
standard_pressure(dynamics::AnelasticDynamics) -> Any
Return the standard pressure from the reference state for potential temperature calculations.
Breeze.AtmosphereModels.surface_pressure — Method
surface_pressure(dynamics::AnelasticDynamics) -> Any
Return the surface pressure from the reference state for boundary condition regularization.
Breeze.AtmosphereModels.total_pressure — Method
total_pressure(dynamics::AnelasticDynamics) -> Any
Return the total pressure for AnelasticDynamics, in Pa. That is $p = p̄ + p'$, where $p̄$ is the hydrostatic reference pressure and $p'$ is the non-hydrostatic pressure anomaly.
AtmosphereModels
Breeze.AtmosphereModels.AbstractOptics — Type
abstract type AbstractOpticsAbstract type representing optics for RadiativeTransferModel.
Breeze.AtmosphereModels.DefaultTimeStepping — Type
struct DefaultTimeSteppingSentinel for AdiabaticBalancer's default time_stepping: the fully-explicit twin for CompressibleDynamics, and the native scheme for solvers without a separable time discretization (e.g. AnelasticDynamics). It lets the default avoid naming a concrete time discretization, whose type lives in a submodule loaded after AtmosphereModels.
Breeze.AtmosphereModels.additional_dynamics_field_names — Method
additional_dynamics_field_names(dynamics)Return a tuple of additional (diagnostic) field names for the dynamics.
Breeze.AtmosphereModels.additional_thermodynamic_field_names — Function
additional_thermodynamic_field_names(formulation)Return a tuple of additional (diagnostic) field names for the given thermodynamic formulation. Accepts a Symbol, Val(Symbol), or formulation struct.
Breeze.AtmosphereModels.adiabatic_balance_twin — Function
adiabatic_balance_twin(
model::AtmosphereModel
) -> Union{AtmosphereModel{_A, Frm, _B, _C, _D, Clk, _E, Mom, Moi, Nothing, _F, _G, _H, Trc, Adv, _I, Frc, Nothing, Cnd, Nothing, _J, Nothing} where {_A, Frm<:(LiquidIcePotentialTemperatureFormulation{F} where F<:Field), _B, _C, _D, Clk<:(Clock{Float64, _A, Float64, Int64, Int64} where _A), _E, Mom<:NamedTuple, Moi<:Field, _F, _G, _H, Trc<:NamedTuple, Adv<:NamedTuple, _I, Frc<:NamedTuple, Cnd<:(NamedTuple{(:qᵛ,), <:Tuple{Any}}), _J}, AtmosphereModel{_A, Frm, _B, _C, _D, Clk, _E, Mom, Moi, Nothing, _F, _G, _H, Trc, Adv, _I, Frc, Nothing, Cnd, Nothing, _J, Nothing} where {_A, Frm<:(StaticEnergyFormulation{E} where E<:Field), _B, _C, _D, Clk<:(Clock{Float64, _A, Float64, Int64, Int64} where _A), _E, Mom<:NamedTuple, Moi<:Field, _F, _G, _H, Trc<:NamedTuple, Adv<:NamedTuple, _I, Frc<:NamedTuple, Cnd<:(NamedTuple{(:qᵛ,), <:Tuple{Any}}), _J}}
adiabatic_balance_twin(
model::AtmosphereModel,
balancer::AdiabaticBalancer
) -> Union{AtmosphereModel{_A, Frm, _B, _C, _D, Clk, _E, Mom, Moi, Nothing, _F, _G, _H, Trc, Adv, _I, Frc, Nothing, Cnd, Nothing, _J, Nothing} where {_A, Frm<:(LiquidIcePotentialTemperatureFormulation{F} where F<:Field), _B, _C, _D, Clk<:(Clock{Float64, _A, Float64, Int64, Int64} where _A), _E, Mom<:NamedTuple, Moi<:Field, _F, _G, _H, Trc<:NamedTuple, Adv<:NamedTuple, _I, Frc<:NamedTuple, Cnd<:(NamedTuple{(:qᵛ,), <:Tuple{Any}}), _J}, AtmosphereModel{_A, Frm, _B, _C, _D, Clk, _E, Mom, Moi, Nothing, _F, _G, _H, Trc, Adv, _I, Frc, Nothing, Cnd, Nothing, _J, Nothing} where {_A, Frm<:(StaticEnergyFormulation{E} where E<:Field), _B, _C, _D, Clk<:(Clock{Float64, _A, Float64, Int64, Int64} where _A), _E, Mom<:NamedTuple, Moi<:Field, _F, _G, _H, Trc<:NamedTuple, Adv<:NamedTuple, _I, Frc<:NamedTuple, Cnd<:(NamedTuple{(:qᵛ,), <:Tuple{Any}}), _J}}
Build a stripped adiabatic twin of model that SHARES all field memory (momentum, velocities, densities, ρθ, moisture, tracers, temperature, pressure solver, dynamics fields) and steps it in place. Every prognostic scalar — momentum, ρθ/ρe, moisture, and tracers — is rewrapped with its surface fluxes stripped to no-flux (see adiabatic_scalar_bcs), sharing the production data so no memory is reallocated. The twin's dynamics comes from adiabatic_twin_dynamics (per balancer.time_stepping); microphysics, closure, the implicit diffusion solver, the sponge, and forcing — all dissipative/irreversible — are removed; the time stepper's Gⁿ/U⁰ tendency storage aliases the production stepper's same-named arrays (moisture key re-mapped from the microphysics name, e.g. :ρqᵉ, to the moistureless :ρqᵛ); and a fresh Clock is used so the balance's clock reset does not touch the production clock.
Breeze.AtmosphereModels.adiabatic_scalar_bcs — Function
adiabatic_scalar_bcs(bcs)Return a copy of the prognostic-scalar FieldBoundaryConditions bcs with every surface flux replaced by a no-flux condition, leaving all other (dynamical) boundary conditions untouched. Applied to both the thermodynamic density (bulk sensible-heat / energy / θ flux) and the moisture density (vapor flux) to strip surface sources from the adiabatic initialization twin, so its symmetric forward/backward excursion stays pure, reversible dynamics (see balance_adiabatically!). Extended by the BoundaryConditions module, which owns the flux BC types.
Breeze.AtmosphereModels.adiabatic_twin_dynamics — Method
adiabatic_twin_dynamics(
dynamics,
time_stepping
) -> CompressibleDynamics{ExplicitTimeStepping}
Return the dynamics for the adiabatic-balance twin, given the production dynamics and the requested time_stepping. The generic fallback reuses dynamics unchanged — correct for solvers without a separable time discretization (e.g. AnelasticDynamics) and for any future solver, keeping the balance solver-agnostic. CompressibleDynamics extends this to swap the time discretization (sponge always stripped, as it is irreversible).
Breeze.AtmosphereModels.adjust_thermodynamic_state — Method
adjust_thermodynamic_state(
state,
scheme::Nothing,
thermo
) -> Any
Adjust the thermodynamic state according to the scheme. For example, if scheme isa SaturationAdjustment, then this function will adjust and return a new thermodynamic state given the specifications of the saturation adjustment scheme.
If a scheme is non-adjusting, we just return state.
Breeze.AtmosphereModels.advecting_vertical_velocity — Method
advecting_vertical_velocity(dynamics, velocities)Return the vertical velocity that advects momentum through the grid's coordinate surfaces: the Cartesian velocities.w on height-coordinate grids, and the contravariant vertical velocity w̃ on terrain-following grids (mirroring advecting_momentum, whose vertical component is the contravariant momentum). The adaptive-implicit vertical-advection split must partition this velocity on both the explicit (flux-scaling) and implicit (tridiagonal) sides, so it stays consistent with the momentum flux divergence.
Breeze.AtmosphereModels.boundary_conditions_reference_state — Method
boundary_conditions_reference_state(dynamics, grid, thermodynamic_constants)Return a reference state with pressure, density, and standard_pressure fields suitable for constructing boundary-condition diagnostics (e.g. virtual potential temperature for stability-dependent bulk fluxes).
Boundary conditions are materialized before materialize_dynamics runs, so this hook lets each dynamics type decide what to expose at that point. The default returns dynamics.reference_state, which works for dynamics where the user constructs a fully-built reference state up front (e.g. AnelasticDynamics).
Breeze.AtmosphereModels.buoyancy_forceᶜᶜᶠ — Method
buoyancy_forceᶜᶜᶠ(i, j, k, grid, args...) -> Any
Interpolate buoyancy force to z-face location.
Breeze.AtmosphereModels.cloud_ice_effective_radius — Method
cloud_ice_effective_radius(
i,
j,
k,
grid,
effective_radius_model::ConstantRadiusParticles,
args...
) -> Any
Return the effective radius of cloud ice particles in meters.
This function dispatches on the effective_radius_model argument. The default implementation for ConstantRadiusParticles returns a constant value.
Microphysics schemes can extend this function to provide diagnosed effective radii based on cloud properties.
Breeze.AtmosphereModels.cloud_liquid_effective_radius — Method
cloud_liquid_effective_radius(
i,
j,
k,
grid,
effective_radius_model::ConstantRadiusParticles,
args...
) -> Any
Return the effective radius of cloud liquid droplets in meters.
This function dispatches on the effective_radius_model argument. The default implementation for ConstantRadiusParticles returns a constant value.
Microphysics schemes can extend this function to provide diagnosed effective radii based on cloud properties.
Breeze.AtmosphereModels.collect_prognostic_fields — Function
collect_prognostic_fields(formulation, dynamics, momentum, moisture_density, microphysical_fields, tracers)Collect all prognostic fields into a single NamedTuple.
Breeze.AtmosphereModels.compute_auxiliary_dynamics_variables! — Method
compute_auxiliary_dynamics_variables!(model)
Compute auxiliary (diagnostic) variables specific to the dynamics formulation.
For anelastic dynamics, this is a no-op (pressure is computed during time-stepping via the pressure Poisson equation).
For compressible dynamics, this computes the pressure field from the equation of state:
\[p = ρ R^m T\]
where $R^m$ is the mixture gas constant.
Breeze.AtmosphereModels.compute_auxiliary_thermodynamic_variables! — Function
compute_auxiliary_thermodynamic_variables!(formulation, dynamics, i, j, k, grid)Compute auxiliary thermodynamic variables from prognostic fields at grid point (i, j, k).
Breeze.AtmosphereModels.compute_auxiliary_variables! — Method
compute_auxiliary_variables!(model)
Compute auxiliary model variables:
velocities from momentum and density (eg $u = ρu / ρ$)
thermodynamic variables from the prognostic thermodynamic state,
- temperature $T$, possibly involving saturation adjustment
- specific thermodynamic variable ($e = ρe / ρ$ or $θ = ρθ / ρ$)
- moisture mass fraction $qᵗ = ρqᵗ / ρ$
Breeze.AtmosphereModels.compute_dynamics_tendency! — Method
compute_dynamics_tendency!(model)
Compute tendencies for dynamics-specific prognostic fields.
For anelastic dynamics, this is a no-op (no prognostic density). For compressible dynamics, this computes the density tendency from the continuity equation:
\[\partial_t \rho = -\boldsymbol{\nabla \cdot \,} (\rho \boldsymbol{u})\]
Breeze.AtmosphereModels.compute_forcings! — Method
compute_forcings!(model)
Compute forcing-specific quantities needed before tendency calculation. For example, SubsidenceForcing requires horizontal averages of the fields being advected.
Breeze.AtmosphereModels.compute_thermodynamic_tendency! — Function
compute_thermodynamic_tendency!(model, common_args)Compute the thermodynamic tendency. Dispatches on the thermodynamic formulation type.
Breeze.AtmosphereModels.compute_velocities! — Method
compute_velocities!(model::AtmosphereModel)
Compute velocities from momentum: u = ρu / ρ for each velocity component.
Breeze.AtmosphereModels.condensate_field_names — Method
condensate_field_names(microphysics) -> Tuple{}
Return the names of the prognostic microphysical fields that carry condensate mass (condensate and precipitation densities), excluding number-concentration fields.
This is the subset of prognostic_field_names that, together with the moisture density, is summed by total_condensate_density to form the total condensate mass per unit volume. It defaults to all prognostic fields; schemes with prognostic number concentrations (e.g. two-moment) override it to drop the ρnˣ fields.
Breeze.AtmosphereModels.correction_moisture_fields — Method
correction_moisture_fields(
microphysics,
microphysical_fields
) -> Tuple{Any}
Return a tuple of Field objects for density-weighted prognostic moisture mass fields that participate in the negative-moisture correction, ordered from heaviest hydrometeor to lightest.
Each field borrows from the next in the chain. The lightest field borrows from the moisture prognostic (vapor or equilibrium moisture, stored in model.moisture_density). Remaining vapor deficits are fixed by vertical borrowing when enabled.
Default: empty tuple (no correction).
Breeze.AtmosphereModels.correction_number_fields — Method
correction_number_fields(
microphysics,
microphysical_fields
) -> Tuple{Any, Any, Any}
Return a tuple of Field objects for density-weighted number concentration fields that should be clamped to non-negative after advection.
Number concentrations can become negative because the advection scheme might not be positive-definite. Unlike mass fields (which use borrowing to preserve conservation), number concentrations are simply zeroed since there is no meaningful conservation constraint for droplet number.
Only called for microphysics whose categories subtype AbstractNumberConcentrationCategories.
Default: empty tuple (no number fields to clamp).
Breeze.AtmosphereModels.correction_number_mass_pairs — Method
correction_number_mass_pairs(
microphysics,
microphysical_fields
) -> Tuple{Tuple{Any, Any}, Tuple{Any, Any}}
Return a tuple of (number_field, mass_field) pairs for number concentration consistency. After species borrowing, any number field whose corresponding mass field is non-positive is zeroed to avoid unphysical states (e.g., finite droplet number with zero mass).
Only called for microphysics whose categories subtype AbstractNumberConcentrationCategories.
Default: empty tuple (no number fields to correct).
Breeze.AtmosphereModels.default_drag_surface_temperature — Method
default_drag_surface_temperature(dynamics, grid, thermodynamic_constants)Return a default surface temperature for BulkDrag when the user has not supplied one. Dispatched on the dynamics type because the notion of a "default" surface temperature depends on what reference structure the dynamics carries: anelastic has a full reference profile whose surface value is well-defined; compressible has no equivalent up-front surface temperature and therefore requires the user to provide one explicitly.
The default (no method) throws an informative error. Each dynamics type extends this hook.
Breeze.AtmosphereModels.default_dynamics — Function
default_dynamics(grid, constants)Return the default dynamics for the given grid and thermodynamic constants.
Breeze.AtmosphereModels.default_timestepper — Method
default_timestepper(dynamics) -> Symbol
Return the default timestepper symbol for the given dynamics.
For anelastic dynamics or compressible dynamics with explicit timestepping, returns :SSPRungeKutta3. For compressible dynamics with acoustic substepping, returns :AcousticRungeKutta3.
Breeze.AtmosphereModels.diagnose_thermodynamic_state — Function
diagnose_thermodynamic_state(i, j, k, grid, formulation, dynamics, q)Diagnose the thermodynamic state at grid point (i, j, k) from the given formulation, dynamics, and pre-computed moisture mass fractions q.
This function does not compute moisture fractions internally to avoid circular dependencies. The caller is responsible for computing q = grid_moisture_fractions(...) before passing q to this function.
Breeze.AtmosphereModels.dynamics_pressure_solver — Function
dynamics_pressure_solver(dynamics, grid)Create the pressure solver for the given dynamics. Returns nothing for dynamics that do not require a pressure solver (e.g., compressible).
Breeze.AtmosphereModels.dynamics_prognostic_fields — Method
dynamics_prognostic_fields(dynamics)Return a NamedTuple of prognostic fields specific to the dynamics formulation.
For anelastic dynamics, returns an empty NamedTuple. For compressible dynamics, returns (ρ=density_field,).
Breeze.AtmosphereModels.dynamics_reference_state — Method
dynamics_reference_state(dynamics)Return the dynamics' reference state (an anelastic ReferenceState or a split-explicit ExnerReferenceState), or nothing if the dynamics carries none. Dispatched so that reset_reference_state! needn't reach into fields by name.
Breeze.AtmosphereModels.establish_densities! — Method
establish_densities!(model, total_density_given, dry_density_given)Mid-set! hook (run after density + moisture are set, before the thermodynamic variable and velocities) that makes the dry density ρᵈ and the diagnosed total density ρ mutually consistent and available to the phase-2 kernels. The two density-input modes need different computations:
total_density_given(:ρ): the field holds the total ρ (placeholder); split it into the total-density field and back outρᵈ = ρ − Σρqˣ(the moisture partial densities were already weighted by the total).dry_density_given(:ρᵈ): the field holdsρᵈ; recover the totalρ = ρᵈ/qᵈ(withqᵈ = 1 − qᵗ, taking the moisture into account) and (re)weight the moisture partial densitiesρqˣ = ρ·qˣ.- neither: diagnose
ρ = ρᵈ + Σρqˣfrom the existing fields.
No-op by default (single-density formulations like anelastic, where total_density === dynamics_density); CompressibleModel overrides it.
Breeze.AtmosphereModels.extract_microphysical_prognostics — Method
extract_microphysical_prognostics(
i,
j,
k,
microphysics,
μ_fields
) -> NamedTuple
Extract prognostic microphysical variables at grid point (i, j, k) into a NamedTuple of scalar values.
Uses prognostic_field_names to determine which fields to extract. The result is a NamedTuple with density-weighted values (e.g., (ρqᶜˡ=..., ρqʳ=...)).
This function enables a generic grid-indexed microphysical_state that extracts prognostics and delegates to the gridless version.
Breeze.AtmosphereModels.fix_negative_moisture! — Method
fix_negative_moisture!(model)
Fix negative moisture mixing ratios produced by the advection operator.
Operates in one or two phases depending on the correction scheme:
- Species borrowing (
SpeciesBorrowing, optional): at each grid cell, negative hydrometeors borrow from lighter species (rain <- cloud <- vapor). - Vertical borrowing (
VerticalBorrowing, optional): negative vapor is redistributed vertically within each column (top->bottom sweep, then one bottom->top step).
For microphysics with number concentrations (categories subtying AbstractNumberConcentrationCategories), orphaned number concentrations are zeroed and negatives are clamped after mass borrowing.
The correction is mass-conserving at each level for species borrowing and column-integrated for vertical borrowing. No energy adjustment is needed because Breeze's thermodynamic prognostics are moist-conserved variables.
The borrowing chain is defined by correction_moisture_fields, which microphysics schemes extend to specify their prognostic mass fields.
Breeze.AtmosphereModels.grid_microphysical_state — Method
grid_microphysical_state(i, j, k, grid, microphysics, μ_fields, ρ, 𝒰, velocities)Build an AbstractMicrophysicalState (ℳ) at grid point (i, j, k).
This is the grid-indexed wrapper that:
- Extracts prognostic values from
μ_fieldsviaextract_microphysical_prognostics - Calls the gridless
microphysical_state(microphysics, ρ, μ, 𝒰, velocities)
Microphysics schemes should implement the gridless version, not this one.
Arguments
i, j, k: Grid indicesgrid: The computational gridmicrophysics: The microphysics schemeμ_fields: NamedTuple of microphysical fieldsρ: Local density (scalar)𝒰: Thermodynamic statevelocities: Velocity fields $(u, v, w)$. Velocities are interpolated to cell centers for use by microphysics schemes (e.g., aerosol activation uses vertical velocity).
Returns
An AbstractMicrophysicalState subtype containing the local microphysical variables.
See also microphysical_tendency, AbstractMicrophysicalState.
Breeze.AtmosphereModels.initialize_model_microphysical_fields! — Method
initialize_model_microphysical_fields!(fields, _::Nothing)
Initialize default values for microphysical fields after materialization.
Sets ρnᵃ (aerosol number density) to initial_aerosol_number(microphysics) if the field exists. All other microphysical fields remain at zero. Users can override with set!.
Breeze.AtmosphereModels.initialize_model_thermodynamics! — Method
initialize_model_thermodynamics!(model)Initialize the thermodynamic state for a newly constructed model. For anelastic dynamics, sets initial θ to the reference potential temperature. For compressible dynamics, no default initialization is performed.
Breeze.AtmosphereModels.materialize_dynamics — Function
materialize_dynamics(dynamics_stub, grid, boundary_conditions, thermodynamic_constants, microphysics=nothing)Materialize a dynamics stub into a complete dynamics object with all required fields.
The microphysics argument is optional and used by dynamics types that need to know the microphysics scheme to create appropriate prognostic state (e.g., ParcelDynamics).
Breeze.AtmosphereModels.materialize_formulation — Function
materialize_formulation(formulation, dynamics, grid, boundary_conditions)Materialize a thermodynamic formulation from a Symbol (or formulation struct) into a complete formulation with all required fields.
Valid symbols:
:LiquidIcePotentialTemperature,:θ,:ρθ,:PotentialTemperature→LiquidIcePotentialTemperatureFormulation:StaticEnergy,:e,:ρe→StaticEnergyFormulation
Breeze.AtmosphereModels.materialize_microphysical_fields — Method
materialize_microphysical_fields(
microphysics::Nothing,
grid,
boundary_conditions
) -> NamedTuple{(:qᵛ,), <:Tuple{Field{Center, Center, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}}}
Build microphysical fields associated with microphysics on grid and with user defined boundary_conditions.
Breeze.AtmosphereModels.materialize_momentum_and_velocities — Function
materialize_momentum_and_velocities(dynamics, grid, boundary_conditions)Create momentum and velocity fields for the given dynamics.
Breeze.AtmosphereModels.materialize_velocities — Function
materialize_velocities(velocities, grid)Create velocity fields from a velocity specification (e.g., PrescribedVelocityFields).
Breeze.AtmosphereModels.maybe_adjust_thermodynamic_state — Method
maybe_adjust_thermodynamic_state(
state,
_::Nothing,
qᵛ,
constants
) -> Any
Possibly apply saturation adjustment. If a microphysics scheme does not invoke saturation adjustment, just return the state unmodified.
This function takes the thermodynamic state, microphysics scheme, total moisture, and thermodynamic constants. Schemes that use saturation adjustment override this to adjust the moisture partition. Non-equilibrium schemes simply return the state unchanged.
Breeze.AtmosphereModels.microphysical_velocities — Method
microphysical_velocities(
microphysics::Nothing,
microphysical_fields,
name
)
Return the microphysical velocities associated with microphysics, microphysical_fields, and tracer name.
Must be either nothing, or a NamedTuple with three components u, v, w. The velocities are added to the bulk flow velocities for advecting the tracer. For example, the terminal velocity of falling rain.
Breeze.AtmosphereModels.microphysics_model_update! — Method
microphysics_model_update!(microphysics::Nothing, model)
Apply the operator-split microphysics update for the given microphysics scheme.
This is called once per time step by the time-stepper (not from update_state!) to apply microphysics processes that operate on the full model state by the full Δt, rather than through the per-stage tendency interface. It runs after the time-stepper's update_state! has refreshed the diagnostic state it reads. Schemes that mutate prognostic fields here are responsible for restoring a consistent model state (halos, diagnostics, and tendencies) before returning — e.g. by calling update_state!. Defaults to a no-op; specific microphysics schemes extend this function.
Breeze.AtmosphereModels.prognostic_dynamics_field_names — Method
prognostic_dynamics_field_names(dynamics)Return a tuple of prognostic field names specific to the dynamics formulation.
For anelastic dynamics, returns an empty tuple (no prognostic density). For compressible dynamics, returns (:ρᵈ,) for prognostic density.
Breeze.AtmosphereModels.prognostic_field_names — Method
prognostic_field_names(_::Nothing) -> Tuple{}
Return tuple() - Nothing microphysics has no prognostic variables.
Breeze.AtmosphereModels.prognostic_momentum_field_names — Method
prognostic_momentum_field_names(dynamics)Return a tuple of prognostic momentum field names.
For prognostic dynamics (anelastic, compressible), returns (:ρu, :ρv, :ρw). For kinematic dynamics (prescribed velocities), returns an empty tuple.
Breeze.AtmosphereModels.prognostic_thermodynamic_field_names — Function
prognostic_thermodynamic_field_names(formulation)Return a tuple of prognostic field names for the given thermodynamic formulation. Accepts a Symbol, Val(Symbol), or formulation struct.
Breeze.AtmosphereModels.rescale_density_weighted_fields! — Method
rescale_density_weighted_fields!(model, ρ⁻)Rescale all density-weighted prognostic fields so that specific quantities (velocity, potential temperature, moisture, etc.) are preserved after a change in the reference density ρᵣ. Each field is multiplied by ρᵣ_new / ρᵣ_old.
Momentum fields (ρu, ρv, ρw) live at staggered face locations and require interpolation of the cell-centered density; a dedicated kernel handles this. All other prognostic fields are cell-centered and rescaled with broadcasting.
Breeze.AtmosphereModels.reset_reference_state! — Method
reset_reference_state!(model)Recompute the dynamics' reference state from the horizontal means of the model's current state via set_to_mean! — works for both the anelastic ReferenceState and the split-explicit ExnerReferenceState — if the dynamics carries one; a no-op otherwise. Invoked by set!(model; compute_reference_state=true).
Breeze.AtmosphereModels.set_hydrostatically_balanced_density! — Method
set_hydrostatically_balanced_density!(
model,
spec::HydrostaticallyBalancedDensity
)
Set the prognostic density of a CompressibleDynamics model into discrete hydrostatic balance with the current θˡⁱ/qᵛ, per HydrostaticallyBalancedDensity. Runs the same per-column Exner integration the reference-state constructor uses, then scales the dry density (and rescales the density-weighted prognostics, preserving θ, qˣ, and velocities) so the total density matches the balanced column.
Breeze.AtmosphereModels.set_momentum! — Method
set_momentum!(model, name, value)Set the momentum component name (:ρu, :ρv, or :ρw) to value.
Breeze.AtmosphereModels.set_thermodynamic_variable! — Function
set_thermodynamic_variable!(model, variable_name, value)Set a thermodynamic variable (e.g., :θ, :T, :e, :ρθ, :ρe) from the given value. Dispatches on the thermodynamic formulation type and variable name.
Breeze.AtmosphereModels.set_velocity! — Method
set_velocity!(model, name, value)Set the velocity component name (:u, :v, or :w) to value. Also updates the corresponding momentum field.
Breeze.AtmosphereModels.settable_specific_microphysical_names — Method
settable_specific_microphysical_names(
microphysics
) -> Tuple{}
Return a tuple of specific (non-density-weighted) names that can be set for the given microphysics scheme. These are derived from the prognostic field names by removing the 'ρ' prefix.
For mass fields (e.g., ρqᶜˡ → qᶜˡ) and number fields (e.g., ρnᶜˡ → nᶜˡ).
Breeze.AtmosphereModels.specific_field_name — Method
specific_field_name(name::Symbol) -> Symbol
Strip the leading ρ from a density-weighted field name to obtain the specific (per-mass) name. For example, :ρqᶜˡ → :qᶜˡ.
Breeze.AtmosphereModels.specific_to_density_weighted — Method
specific_to_density_weighted(
name::Symbol
) -> Union{Nothing, Symbol}
Convert a specific microphysical variable name to its density-weighted counterpart. For example, :qᶜˡ → :ρqᶜˡ, :qʳ → :ρqʳ, :nᶜˡ → :ρnᶜˡ.
Returns nothing if the name doesn't start with 'q' or 'n'.
Breeze.AtmosphereModels.standard_pressure — Function
standard_pressure(dynamics)Return the standard pressure used for potential temperature calculations. Default is 100000 Pa (1000 hPa).
Breeze.AtmosphereModels.surface_pressure — Function
surface_pressure(dynamics)Return the surface pressure used for boundary condition regularization. For anelastic dynamics, this is the reference state surface pressure. For compressible dynamics, this may be a constant or computed value.
Breeze.AtmosphereModels.total_condensate_density — Method
total_condensate_density(
i,
j,
k,
microphysics,
moisture_density,
microphysical_fields
) -> Any
Total condensate density $ρᵗ = ρqᵛᵉ + Σ ρqᶜ$ at (i, j, k): the moisture density $ρqᵛᵉ$ (vapor or equilibrium moisture) plus every condensed-species density named by condensate_field_names. Number-concentration fields (ρnˣ) are excluded. This sums all phases of the condensable species (water by default), so other condensates can be added by extending condensate_field_names.
Breeze.AtmosphereModels.total_density — Method
total_density(
i,
j,
k,
dry_density,
microphysics,
moisture_density,
microphysical_fields
) -> Any
Total air density $ρ = ρᵈ + ρᵗ$ at (i, j, k): the dry-air density dry_density plus the total_condensate_density $ρᵗ$. This is the diagnosed total mass density used where total mass enters the physics — the gravitational/buoyancy term and the equation of state.
Breeze.AtmosphereModels.total_density — Method
total_density(dynamics)Return the total air density ρ = ρᵈ + Σρˣ used by the thermodynamics, scalar advection, equation of state, and buoyancy. Defaults to dynamics_density — correct for formulations with a single density (e.g. the anelastic reference density). CompressibleDynamics overrides it with a diagnosed total-density field, distinct from the coupling density ρᵈ.
Breeze.AtmosphereModels.update_dynamics_with_velocities — Method
update_dynamics_with_velocities(dynamics, velocities)Update dynamics with velocity specification. Default is a no-op. For PrescribedDynamics, stores the PrescribedVelocityFields for dispatch.
Breeze.AtmosphereModels.update_radiation! — Method
update_radiation!(rtm, model)
Update the radiative fluxes from the current model state.
This function checks the radiation schedule and only updates if the schedule returns true. The actual radiation computation is dispatched to _update_radiation!(rtm, model).
Radiation is always computed on the first iteration (iteration 0) to ensure valid radiative fluxes before the first time step.
Breeze.AtmosphereModels.validate_microphysics — Method
validate_microphysics(microphysics, thermodynamic_constants)
Validate that microphysics is compatible with the model's thermodynamic_constants.
Defaults to a no-op. Schemes that require a particular thermodynamic formulation (for example a specific saturation vapor pressure formula) extend this method to throw a clear ArgumentError at model construction, rather than failing later inside a kernel — where the failure surfaces as an opaque dynamic getproperty / GPU compilation error.
Breeze.AtmosphereModels.validate_velocity_boundary_conditions — Method
validate_velocity_boundary_conditions(dynamics, user_boundary_conditions)Validate that velocity boundary conditions are only provided for dynamics that support them.
By default, throws an error if the user provides boundary conditions for :u, :v, or :w, since velocity is a diagnostic field for most dynamics (e.g., anelastic, compressible).
For PrescribedDynamics, velocity boundary conditions are allowed since velocities are regular fields that can be set directly.
Breeze.AtmosphereModels.velocity_boundary_condition_names — Method
velocity_boundary_condition_names(dynamics)Return a tuple of velocity field names that need default boundary conditions.
For most dynamics (anelastic, compressible), velocities are diagnostic and their boundary conditions are created internally. Returns an empty tuple.
For PrescribedDynamics, velocities are regular fields that can have user-provided boundary conditions, so this returns (:u, :v, :w).
Breeze.AtmosphereModels.w_buoyancy_forceᶜᶜᶠ — Method
w_buoyancy_forceᶜᶜᶠ(i, j, k, grid, w, args...) -> Any
Compute the product of vertical velocity and buoyancy force at z-face location. Used for the buoyancy flux term in the energy equation.
Breeze.AtmosphereModels.with_thermodynamic_density — Function
with_thermodynamic_density(formulation, ρᵡ)Return a copy of formulation whose thermodynamic density field (see thermodynamic_density) is replaced by ρᵡ, leaving the diagnostic fields and solvers untouched. Used to swap in a thermodynamic field carrying different boundary conditions without reallocating the diagnostics.
Breeze.AtmosphereModels.wrap_specific_forcing — Function
wrap_specific_forcing(value, density_name)Wrap value so that the kernel-time density factor ρ is applied automatically when the user supplies a forcing keyed by a specific (per-unit-mass) variable name like θ, u, qᵉ. Implemented in the Forcings module: constructs a SpecificForcing, recurses into tuples, and errors if value is itself a density-tendency forcing like SubsidenceForcing (which would double-count ρ).
density_name is the corresponding density-weighted prognostic name (e.g. :ρθ) used to produce a helpful error message when the wrap is rejected.
Breeze.AtmosphereModels.x_pressure_gradient — Method
x_pressure_gradient(i, j, k, grid, dynamics)Return the x-component of the pressure gradient force at (Face, Center, Center).
For anelastic dynamics, returns zero (pressure is handled via projection). For compressible dynamics, returns -∂p/∂x.
Breeze.AtmosphereModels.y_pressure_gradient — Method
y_pressure_gradient(i, j, k, grid, dynamics)Return the y-component of the pressure gradient force at (Center, Face, Center).
For anelastic dynamics, returns zero (pressure is handled via projection). For compressible dynamics, returns -∂p/∂y.
Breeze.AtmosphereModels.z_pressure_gradient — Method
z_pressure_gradient(i, j, k, grid, dynamics)Return the z-component of the pressure gradient force at (Center, Center, Face).
For anelastic dynamics, returns zero (pressure is handled via projection). For compressible dynamics, returns -∂p/∂z.
Breeze.AtmosphereModels.∇_dot_Jᶜ — Method
∇_dot_Jᶜ(i, j, k, grid, ρ, closure::AbstractTurbulenceClosure, closure_fields,
id, c, clock, model_fields, buoyancy)Return the discrete divergence of the dynamic scalar flux Jᶜ = ρ jᶜ, where jᶜ is the "kinematic scalar flux", using area-weighted differences divided by cell volume. Similar to Oceananigans' ∇_dot_qᶜ signature with the additional density factor ρ, where in Oceananigans qᶜ is the kinematic tracer flux.
Oceananigans.Fields.set! — Method
set!(model::AtmosphereModel; enforce_mass_conservation=true, kw...)Set variables in an AtmosphereModel.
Keyword Arguments
Variables are set via keyword arguments. Supported variables include:
Prognostic variables (density-weighted):
ρ/ρᵈ: total / dry density (compressible).ρmay also be set toHydrostaticallyBalancedDensity(), which derives the density from the just-setθˡⁱ/qᵛso the initial column is in discrete hydrostatic balance.ρu,ρv,ρw: momentum componentsρqᵉ/ρqᵛ/ρqᵗ: moisture density (scheme-dependent)- Prognostic microphysical variables
- Prognostic user-specified tracer fields
Settable thermodynamic variables:
T: in-situ temperatureθ: potential temperatureθˡⁱ: liquid-ice potential temperaturee: static energyρθ: potential temperature densityρθˡⁱ: liquid-ice potential temperature densityρe: static energy density (forStaticEnergyThermodynamics)
Diagnostic variables (specific, i.e., per unit mass):
u,v,w: velocity components (sets both velocity and momentum)qᵗ: total specific moisture (sets both specific and density-weighted moisture)ℋ: relative humidity (sets total moisture viaqᵗ = ℋ * qᵛ⁺, whereqᵛ⁺is the saturation specific humidity at the current temperature). Relative humidity is in the range [0, 1]. For models with saturation adjustment microphysics,ℋ > 1throws an error since the saturation adjustment would immediately reduce it to 1.
Specific microphysical variables (automatically converted to density-weighted):
qᶜˡ: specific cloud liquid, setsρqᶜˡ = ρᵣ * qᶜˡqʳ: specific rain, setsρqʳ = ρᵣ * qʳnᶜˡ: specific cloud liquid number [1/kg], setsρnᶜˡ = ρᵣ * nᶜˡnʳ: specific rain number [1/kg], setsρnʳ = ρᵣ * nʳ- Other prognostic microphysical variables with the
ρprefix removed
When using set!(model, θ=...), the value is interpreted as the liquid-ice potential temperature $θˡⁱ$.
Options
enforce_mass_conservation: Iftrue(default), applies a pressure correction to ensure the velocity field satisfies the anelastic continuity equation. Ifbalanceris also used, a final correction is applied after the balance.compute_reference_state: Iftrue(defaultfalse), recompute the dynamics' hydrostatic reference state from the horizontal means of the just-set state (seeset_to_mean!), before the mass-conservation correction. A no-op for dynamics without a reference state. Useful when initializing from an analysis whose mean profile should define the perturbation base state; otherwise the reference built at construction is preserved. For compressible dynamics, supply both a density and a thermodynamic variable in the sameset!call, since the recomputation integrates the hydrostatic column from the model's current state.balancer: adiabatic (FV3na_init) spin-up of the nonhydrostatic state, run in place after the rest ofset!— equivalent to callingbalance_adiabatically!(model, balancer).false(default) does nothing;trueusesAdiabaticBalancer()(auto step size); pass anAdiabaticBalancerto controlΔt,cycles,weight,with_moisture, and (compressible)time_stepping. The balance runs on a stripped twin that shares all field memory withmodel(no second field set, no graft). Works for bothCompressibleDynamicsandAnelasticDynamics.
Oceananigans.TimeSteppers.compute_flux_bc_tendencies! — Method
compute_flux_bc_tendencies!(model::AtmosphereModel)
Apply boundary conditions by adding flux divergences to the right-hand-side.
AtmosphereModels.Diagnostics
Breeze.AtmosphereModels.Diagnostics.dynamics_density_for_potential_temperature — Method
dynamics_density_for_potential_temperature(dynamics) -> Any
Return the density field used for computing potential temperature. For anelastic dynamics, this is the reference density.
Breeze.AtmosphereModels.Diagnostics.dynamics_pressure_for_potential_temperature — Method
dynamics_pressure_for_potential_temperature(dynamics) -> Any
Return the pressure field used for computing potential temperature. For anelastic dynamics, this is the reference pressure.
Breeze.AtmosphereModels.Diagnostics.dynamics_standard_pressure — Method
dynamics_standard_pressure(dynamics) -> Any
Return the standard pressure for potential temperature calculations.
Breeze.AtmosphereModels.Diagnostics.saturation_total_specific_moisture — Method
saturation_total_specific_moisture(
T,
pᵣ,
constants,
surface
) -> Any
Compute the saturation total specific moisture under the assumption that all moisture is vapor at saturation, $qᵗ = qᵛ⁺$. With this assumption, the equation of state for moist air can be solved in closed form, yielding an expression for the saturation specific humidity in terms of temperature T and reference pressure pᵣ alone:
\[qᵛ⁺ = \frac{ϵᵈᵛ \, pᵛ⁺(T)}{pᵣ + δᵈᵛ \, pᵛ⁺(T)} ,\]
where $ϵᵈᵛ ≡ Rᵈ / Rᵛ ≈ 0.622$ and $δᵈᵛ ≡ ϵᵈᵛ - 1 ≈ -0.378$.
The resulting expression coincides with the saturation specific humidity used in the COARE 3.6 Edson (2013) air-sea bulk-flux algorithms, where the air-side specific humidity at the surface is unknown a priori and saturation_specific_humidity cannot be evaluated directly.
See the Atmosphere Thermodynamics section of the documentation for a derivation.
BoundaryConditions
Breeze.AtmosphereModels.materialize_atmosphere_model_boundary_conditions — Method
materialize_atmosphere_model_boundary_conditions(
boundary_conditions,
grid,
formulation,
dynamics,
microphysics,
surface_pressure,
thermodynamic_constants,
microphysical_fields,
specific_prognostic_moisture,
temperature
) -> NamedTuple
Regularize boundary conditions for AtmosphereModel. This function walks through all boundary conditions and calls materialize_atmosphere_boundary_condition on each one, allowing specialized handling for bulk flux boundary conditions and other atmosphere-specific boundary condition types.
If formulation is :LiquidIcePotentialTemperature and ρe boundary conditions are provided, they are automatically converted to ρθ boundary conditions using EnergyFluxBoundaryCondition.
Breeze.BoundaryConditions.bulk_richardson_number — Function
bulk_richardson_number(h, θᵥ, θᵥ₀, U, U_min) -> Any
bulk_richardson_number(h, θᵥ, θᵥ₀, U, U_min, g) -> Any
Compute bulk Richardson number:
\[Riᴮ = (g / θ̄ᵥ) h (θᵥ - θᵥ₀) / U²\]
Wind speed is clamped to U_min to avoid singularity.
Arguments
h: Measurement height (m)θᵥ: Virtual potential temperature at measurement height (K)θᵥ₀: Virtual potential temperature at surface (K)U: Wind speed (m/s)U_min: Minimum wind speed (m/s)g: Gravitational acceleration (m/s², default: 9.81)
Breeze.BoundaryConditions.bulk_to_flux_richardson_number — Method
bulk_to_flux_richardson_number(Riᴮ, α, β, mapping) -> Any
Map bulk Richardson number $Riᴮ$ to the Monin-Obukhov stability parameter $ζ = z/L$ using the regression equations of Li et al. (2010).
Arguments
Riᴮ: Bulk Richardson numberα: $\ln(z / ℓ)$β: $\ln(ℓ / ℓ_h)$mapping:RichardsonNumberMappingwith regression coefficients
Breeze.BoundaryConditions.initialize! — Method
initialize!(fs::FilteredSurfaceScalar, field_3d, grid)Set filtered surface scalar to the current near-surface value.
Breeze.BoundaryConditions.initialize! — Method
initialize!(fv::FilteredSurfaceVelocities, velocities, grid)Set filtered surface velocities to the current near-surface values.
Breeze.BoundaryConditions.initialize_θᵥ! — Method
initialize_θᵥ!(fv::FilteredSurfaceVelocities, θᵥ_source, grid)Set the filtered virtual potential temperature to the current first-cell value.
Breeze.BoundaryConditions.integrated_stability_momentum — Method
integrated_stability_momentum(ζ, params) -> Any
Integrated stability function for momentum $Ψᴰ(ζ)$.
Note: $Ψᴰ$ corresponds to $Ψ_m$ in the literature.
Breeze.BoundaryConditions.integrated_stability_scalar — Method
integrated_stability_scalar(ζ, params) -> Any
Integrated stability function for scalars (heat, moisture) $Ψᵀ(ζ)$.
Note: $Ψᵀ$ corresponds to $Ψ_h$ in the literature.
Breeze.BoundaryConditions.neutral_coefficient_10m — Method
neutral_coefficient_10m(polynomial, U₁₀, U_min) -> Any
Compute neutral transfer coefficient at 10 m using the Large and Yeager (2009) form:
\[C^N_{10}(U) = (a_0 + a_1 U + a_2 / U) × 10^{-3}\]
Wind speed is clamped to U_min to avoid singularity in the $a_2/U$ term.
References
- Large, W., & Yeager, S. G. (2009). The global climatology of an interannually varying air–sea flux data set. Climate dynamics, 33(2), 341-364.
Breeze.BoundaryConditions.surface_virtual_potential_temperature — Method
surface_virtual_potential_temperature(
T₀,
p₀,
constants,
surface
) -> Any
Compute virtual potential temperature over a planar surface with surface temperature T₀ and surface pressure p₀,
\[θᵥ₀ = T₀ (1 + δᵛᵈ qᵛ⁺)\]
where $qᵛ⁺$ is the saturation specific humidity at the surface and $δᵛᵈ = Rᵛ/Rᵈ - 1$ (≈ 0.608 for water vapor in Earth's atmosphere; the actual value depends on the gas constants in constants).
Breeze.BoundaryConditions.update! — Method
update!(fs::FilteredSurfaceScalar, field_3d, grid, Δt)Update the filtered surface scalar using the exponential filter with time step Δt.
Breeze.BoundaryConditions.update! — Method
update!(fv::FilteredSurfaceVelocities, velocities, grid, Δt)Update the filtered surface velocities using the exponential filter with time step Δt. velocities should be a NamedTuple with fields u and v.
Breeze.BoundaryConditions.update_θᵥ! — Method
update_θᵥ!(fv::FilteredSurfaceVelocities, θᵥ_source, grid, Δt)Apply the exponential filter to the virtual potential temperature.
CelestialMechanics
CompressibleEquations
Breeze.CompressibleEquations.HeightProfile — Type
struct HeightProfile{P} <: FunctionAdapter that makes a vertical profile — a Number, a callable φ(z), or a HorizontalMeanProfile — settable onto a Field of any dimensionality. set! calls it with the field's node coordinates, which are (x, z) on a Flat-y grid, (x, y, z) in 3D and (λ, φ, z) on a latitude-longitude grid; only the last of those — the physical height, which on a terrain-following grid varies per column — is used. Subtypes Function so set! takes its function-evaluation path (which evaluates on the host and transfers once).
Breeze.CompressibleEquations.HorizontalMeanProfile — Type
struct HorizontalMeanProfile{H, V} <: FunctionCallable piecewise-linear vertical profile. profile(z) linearly interpolates values against heights (both ordered bottom-to-top) and holds the nearest end value constant for z below heights[1] or above heights[end]. Subtypes Function so it is picked up by evaluate_profile wherever a z-dependent reference profile is expected.
Breeze.AtmosphereModels.Diagnostics.dynamics_density_for_potential_temperature — Method
dynamics_density_for_potential_temperature(
dynamics::CompressibleDynamics
) -> Any
Return the density field for potential temperature diagnostics. For compressible dynamics, uses the diagnosed total air density (the moisture fractions need total ρ).
Breeze.AtmosphereModels.Diagnostics.dynamics_pressure_for_potential_temperature — Method
dynamics_pressure_for_potential_temperature(
dynamics::CompressibleDynamics
) -> Any
Return the pressure field for potential temperature diagnostics. For compressible dynamics, uses the actual pressure field.
Breeze.AtmosphereModels.Diagnostics.dynamics_standard_pressure — Method
dynamics_standard_pressure(
dynamics::CompressibleDynamics
) -> Any
Return the standard pressure for potential temperature diagnostics.
Breeze.AtmosphereModels.boundary_conditions_reference_state — Method
boundary_conditions_reference_state(
dynamics::CompressibleDynamics,
grid,
thermodynamic_constants
) -> Union{Nothing, ExnerReferenceState}
Return a reference state suitable for boundary-condition diagnostics.
Boundary conditions are materialized before materialize_dynamics runs, so the stub CompressibleDynamics.reference_state field still holds the reference spec rather than an ExnerReferenceState. This method builds explicit and automatic references on demand using the same grid-dependent logic as materialize_dynamics, so boundary conditions that require a reference profile can be materialized before the dynamics. When the reference is disabled (nothing) or the dynamics has already been materialized, the existing value is returned.
Breeze.AtmosphereModels.buoyancy_forceᶜᶜᶜ — Method
buoyancy_forceᶜᶜᶜ(
i,
j,
k,
grid,
dynamics::CompressibleDynamics,
temperature,
specific_prognostic_moisture,
microphysics,
microphysical_fields,
constants
) -> Any
Compute the buoyancy force density for compressible dynamics at cell center (i, j, k).
When a reference state is provided, the buoyancy force is computed as a perturbation:
\[ρ b = -g (ρ - ρ_r)\]
where $ρ_r$ is the reference density in discrete hydrostatic balance. This eliminates the $O(Δz^2)$ truncation error from the near-cancellation of $∂p/∂z$ and $gρ$, which is essential for stability with acoustic substepping at large time steps.
Without a reference state, the full gravitational force $-gρ$ is used.
Breeze.AtmosphereModels.compute_auxiliary_dynamics_variables! — Method
compute_auxiliary_dynamics_variables!(
model::AtmosphereModel{<:CompressibleDynamics}
)
Compute temperature and pressure jointly for CompressibleModel.
For compressible dynamics with potential temperature thermodynamics, temperature and pressure are coupled via the ideal gas law and the potential temperature definition:
\[θ = T (p₀/p)^κ \quad \text{and} \quad p = ρ R^m T\]
Eliminating the circular dependency gives the direct formula:
\[T = θ^γ \left(\frac{ρ R^m}{p₀}\right)^{γ-1}\]
where $γ = c_p / c_v$ is the heat capacity ratio. Once temperature is known, pressure is computed from the ideal gas law $p = ρ R^m T$.
This joint computation is necessary because, unlike anelastic dynamics where pressure comes from a reference state, compressible dynamics requires solving for both temperature and pressure simultaneously.
Breeze.AtmosphereModels.compute_dynamics_tendency! — Method
compute_dynamics_tendency!(
model::AtmosphereModel{<:CompressibleDynamics}
)
Compute the density tendency for compressible dynamics using the continuity equation.
The density evolves according to:
\[\partial_t \rho = -\boldsymbol{\nabla \cdot \,} (\rho \boldsymbol{u})\]
Since momentum ρu is already available, this is simply the negative divergence of momentum.
Breeze.AtmosphereModels.compute_pressure_correction! — Method
compute_pressure_correction!(
_::AtmosphereModel{<:CompressibleDynamics},
Δt
)
No-op for CompressibleDynamics - pressure is computed diagnostically from the equation of state.
Breeze.AtmosphereModels.default_drag_surface_temperature — Method
default_drag_surface_temperature(
_::CompressibleDynamics,
grid,
constants
)
BulkDrag under CompressibleDynamics requires the user to supply surface_temperature explicitly. Unlike AnelasticDynamics, compressible dynamics does not carry a reference profile from which a surface temperature can be unambiguously derived. A clean default would require either coupling to a surface model or diagnosing the surface state from the prognostic fields (which would make ρ₀ grid-dependent and break MO consistency at the surface); both are out of scope for now.
Breeze.AtmosphereModels.default_timestepper — Method
default_timestepper(
dynamics::CompressibleDynamics
) -> Symbol
Return the default timestepper for CompressibleDynamics based on its time_discretization.
SplitExplicitTimeDiscretization: Returns:AcousticRungeKutta3for acoustic substeppingExplicitTimeStepping: Returns:SSPRungeKutta3for standard explicit time-stepping
Breeze.AtmosphereModels.dynamics_density — Method
dynamics_density(dynamics::CompressibleDynamics) -> Any
Return the prognostic density field for CompressibleDynamics.
Breeze.AtmosphereModels.dynamics_pressure — Method
dynamics_pressure(dynamics::CompressibleDynamics) -> Any
Return the dynamics pressure for CompressibleDynamics. For compressible dynamics, there is no background/anomaly decomposition - returns the prognostic pressure field, computed diagnostically from the equation of state.
Breeze.AtmosphereModels.dynamics_pressure_solver — Method
dynamics_pressure_solver(
dynamics::CompressibleDynamics,
grid
)
Return nothing for CompressibleDynamics - no pressure solver is needed. Pressure is computed directly from the equation of state.
Breeze.AtmosphereModels.dynamics_prognostic_fields — Method
dynamics_prognostic_fields(
dynamics::CompressibleDynamics
) -> NamedTuple{(:ρᵈ,), <:Tuple{Any}}
Return prognostic fields specific to compressible dynamics. Returns the density field as a prognostic variable.
Breeze.AtmosphereModels.make_pressure_correction! — Method
make_pressure_correction!(
_::AtmosphereModel{<:CompressibleDynamics},
Δt
)
No-op for CompressibleDynamics - no pressure projection is needed.
Breeze.AtmosphereModels.materialize_dynamics — Method
materialize_dynamics(
dynamics::CompressibleDynamics,
grid,
boundary_conditions,
thermodynamic_constants
) -> CompressibleDynamics{_A, D, DT, P, _B, RS, TM, CV, CM} where {_A, D<:(Field{Center, Center, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}), DT<:(Field{Center, Center, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}), P<:(Field{Center, Center, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}), _B, RS<:Union{Nothing, ExnerReferenceState{_A, FP, FD, FE} where {_A, FP<:Union{Field{Nothing, Nothing, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}, Field{Center, Center, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}}, FD<:Union{Field{Nothing, Nothing, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}, Field{Center, Center, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}}, FE<:Union{Field{Nothing, Nothing, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}, Field{Center, Center, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}}}}, TM<:Union{Nothing, TerrainMetrics}, CV<:Union{Nothing, Field{Center, Center, Face, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}}, CM<:Union{Nothing, Field{Center, Center, Face, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}}}
Materialize a stub CompressibleDynamics into a full dynamics object with density and pressure fields.
Breeze.AtmosphereModels.pressure_anomaly — Method
pressure_anomaly(dynamics::CompressibleDynamics) -> Int64
Return the pressure anomaly for CompressibleDynamics. For compressible dynamics, there is no decomposition - returns zero.
Breeze.AtmosphereModels.reset_reference_state! — Method
reset_reference_state!(
model::AtmosphereModel{<:CompressibleDynamics{<:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:TerrainMetrics}}
)
Recompute the terrain-following model's 3D ExnerReferenceState in place from the height-resolved horizontal-mean state, via compute_terrain_reference_state!. Unlike the flat Exner / anelastic set_to_mean! reset, this specializes on the model (rather than the reference type) because the terrain mean must be taken at constant physical height (horizontal_mean_profile), not per computational level. No update_state! follows: the terrain reference feeds only the buoyancy and pressure-gradient tendencies, not any diagnostic field. A no-op if the dynamics carries no reference.
Breeze.AtmosphereModels.standard_pressure — Method
standard_pressure(dynamics::CompressibleDynamics) -> Any
Return the standard pressure for potential temperature calculations.
Breeze.AtmosphereModels.surface_pressure — Method
surface_pressure(dynamics::CompressibleDynamics) -> Any
Return a standard surface pressure for boundary condition regularization. For compressible dynamics, uses the standard atmospheric pressure (101325 Pa).
Breeze.AtmosphereModels.total_pressure — Method
total_pressure(dynamics::CompressibleDynamics) -> Any
Return the total pressure for CompressibleDynamics, in Pa.
Breeze.CompressibleEquations.compute_acoustic_substeps — Method
compute_acoustic_substeps(
grid,
Δt,
thermodynamic_constants,
acoustic_cfl
) -> Any
Compute the number of acoustic substeps $N$ from the horizontal acoustic CFL:
\[N \approx \left\lceil \frac{|\Delta t| \, \mathbb{C}^{ac}}{\nu \, \Delta x_\min} \right\rceil ,\]
with $\mathbb{C}^{ac} = \sqrt{γ^d R^d T_r}$ for a nominal reference temperature $T_r = 300\,\mathrm{K}$ and $ν$ the target acoustic Courant number acoustic_cfl (default 0.5, the conventional ERF/WRF target — equivalent to a safety factor of 2).
Breeze.CompressibleEquations.compute_contravariant_velocity! — Method
compute_contravariant_velocity!(
model::AtmosphereModel{<:CompressibleDynamics{<:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:TerrainMetrics}}
)
Compute the contravariant vertical velocity $\tilde{w}$ and contravariant vertical momentum $\rho \tilde{w}$ from the Cartesian velocity and momentum fields.
The contravariant vertical velocity is the velocity component normal to the terrain-following coordinate surfaces:
\[\tilde{w} = w - \left(\frac{\partial z}{\partial x}\right)_r u - \left(\frac{\partial z}{\partial y}\right)_r v\]
Breeze.CompressibleEquations.compute_terrain_reference_state! — Method
compute_terrain_reference_state!(
pᵣ,
ρᵣ,
πᵣ,
grid,
p₀,
ref_spec,
pˢᵗ,
constants
)
Fill the 3D fields pᵣ, ρᵣ and πᵣ with the hydrostatic reference pressure, density and Exner function, solving the discrete hydrostatic balance per column. On a terrain-following grid, different columns have different physical heights at the same computational index k, so the reference state varies horizontally even though the reference atmosphere is horizontally uniform.
Each column is anchored at its own terrain surface with the continuous hydrostatic state at that physical height, and every face above it — starting with the surface-to-first-center half cell — is closed by the Newton solve of the discrete balance
\[\frac{p_{ref}[k] - p_{ref}[k-1]}{Δz} + g \frac{ρ_{ref}[k] + ρ_{ref}[k-1]}{2} = 0\]
to near machine precision (the Exner integration provides only the Newton initial guess). The reference atmosphere uses level-local moist constants $Rᵐ = qᵈ Rᵈ + qᵛ Rᵛ$, $cᵖᵐ = qᵈ cᵖᵈ + qᵛ cᵖᵛ$, $κᵐ = Rᵐ/cᵖᵐ$, with the dry case recovered exactly when $qᵛ ≡ 0$. Enforcing the discrete balance is essential for reducing the truncation error in the vertical momentum equation ($-∂p/∂z - gρ$), which would otherwise be dominated by the near-cancellation of two large terms.
The reference pressure is also used for the perturbation horizontal pressure gradient, reducing the terrain-following PGF error.
Breeze.CompressibleEquations.converged_hydrostatic_pressure — Method
converged_hydrostatic_pressure(
z,
p₀,
dpdz;
tolerance,
initial_steps,
max_steps
) -> Any
Integrate the hydrostatic equation $∂p/∂z = \mathrm{dpdz}(z, p)$ from the surface to height $z$, repeatedly doubling the number of steps until the pressure at $z$ changes by less than the relative tolerance between successive refinements. dpdz(z, p) returns the local pressure gradient $-g ρ$ given height and pressure.
Breeze.CompressibleEquations.convert_acoustic_parameter — Method
Split-explicit time discretization for compressible dynamics.
Outer integration is the Wicker–Skamarock RK3 scheme (Wicker and Skamarock 2002) with stage fractions $β = (1/3, 1/2, 1)$. Within each stage, an inner substep loop evolves linearized acoustic perturbations about each RK stage-entry state. The vertically implicit solve uses an off-centered Crank-Nicolson scheme with off-centering parameter $\omega$ (default 0.65; $\omega = 0.5$ is classic centered CN). In multi-substep stages, the first acoustic substep includes the frozen stage-entry horizontal pressure gradient but skips the acoustic perturbation pressure gradient, which is applied on subsequent substeps following the MPAS forward-backward sequencing.
The substep distribution across stages is selectable via the AcousticSubstepDistribution interface.
Fields
substeps: Number of acoustic substeps $N$ per outer $Δt$. Defaultnothingadaptively chooses $N$ from the horizontal acoustic CFL each step (seeacoustic_cfl).acoustic_cfl: Target horizontal acoustic Courant number used by the adaptive substep count whensubsteps === nothing. The substep count is $N \approx \lceil \Delta t \, \mathbb{C}^{ac} / (\mathrm{acoustic\_cfl} \cdot \Delta x_\min) \rceil$, so smaller values give more substeps. Default0.5(the ERF/WRF target — equivalent to the conventional safety factor of2). Ignored whensubstepsis set explicitly.forward_weight: Off-centering parameter $\omega$ for the vertically implicit solve. $\omega = 0.5$ is classic centered Crank-Nicolson; the default $\omega = 0.65$ adds modest off-centering ($\varepsilon = 2\omega - 1 = 0.3$). Combined with the default divergence damping, it keeps a rest atmosphere at machine ε at production $\Delta t = 20$ s and survives the DCMIP-2016 dry/moist baroclinic-wave smoke tests at production grid.Note on residual non-normality: the column tridiag has anti-symmetric buoyancy off-diagonals (gravity-wave physics) and asymmetric PGF off-diagonals on a stratified $\bar\theta(z)$, so the substep operator $U$ has spectral radius $\rho(U) = 1$ but operator norm $\|U\|_2 \gg 1$ (≈ 44 at $\Delta t = 20$ s, $\omega = 0.55$, no damping). Perturbations can transiently project onto the non-normal amplified subspace. The stage-rewind formulation keeps the exact discrete rest atmosphere bounded even without divergence damping, while the default off-centering plus Klemp horizontal divergence damping damps acoustic noise in production baroclinic-wave and LES runs.
damping: Acoustic divergence damping strategy. Default:ThermalDivergenceDampingwith coefficient 0.1. The exact discrete rest atmosphere is covered bytest/substepper_rest_state.jleven withNoDivergenceDamping, but noisy acoustic production cases use damping to control grid-scale divergent modes.sponge: OptionalUpperSpongethat applies implicit Rayleigh damping to $(ρw)′$ inside the substep loop's column tridiag, absorbing acoustic / gravity-wave energy in a layer below the rigid lid. Defaultnothing(off). PassingUpperSponge(; ...)enables it with the configureddamping_rateanddepth.substep_distribution: How acoustic substeps are distributed across the three WS-RK3 stages.open_boundary_relaxation: Per-substep relaxation factor $α \in (0, 1]$ applied at the outermost open-boundary cell of $ρ′,(ρθ)′$ to enforce the prescribed wall value across the acoustic substeps. Default $α = 0.5$, matching FV3-LAM's outermost-blend-row weight ($\approx 0.6$). Without this enforcement the perturbation halos reflect, biasing the discrete mass balance under transient open-boundary inflow (issue #738). The relaxation is a no-op when no side carries an active open BC (periodic, walls, impenetrable defaults all skip it).
Backward integration
Backward integration (Δt < 0) is supported. The off-centered Crank–Nicolson vertical solve with $ω ∈ [0.5, 1]$ has amplification factor $|A|^2 = (1 + ((1-ω) ω_0 Δτ)^2) / (1 + (ω ω_0 Δτ)^2) \le 1$ for either sign of $Δτ$, so the linearized acoustic substep is A-stable in both directions. Horizontal divergence damping is sign-self-consistent ($γ \propto Δτ^{-1}$ and $(ρθ)' - (ρθ)'_\mathrm{old} \propto Δτ$ both flip sign with Δt). The adaptive substep count uses $|Δt|$, and the optional UpperSponge keeps its dissipative sign so it acts as a one-sided regularizer in both directions (i.e. backward integration through a sponge layer is stable but not an exact inverse of the forward step inside the sponge).
See also ExplicitTimeStepping.
Breeze.CompressibleEquations.horizontal_mean_profile — Method
horizontal_mean_profile(
field
) -> Breeze.CompressibleEquations.HorizontalMeanProfile
Reduce a 3D field to a HorizontalMeanProfile of its horizontal mean at constant physical height. On a terrain-following grid the cell-center height znode(i, j, k, …) varies with (i, j), so a plain per-k average would blend, e.g., valley-floor and mountain-top air at the same computational level. Instead every column is first interpolated onto a common set of physical heights and the mean is taken there, giving a genuine θ̄(z) — the horizontally-uniform reference profile that WRF-style base states use, evaluated per column at its own terrain by compute_terrain_reference_state!.
The common heights are the columnwise minima of the cell-center heights at each level k, obtained by a minimum! reduction: on a terrain-following grid these are the levels of the lowest-terrain column, they increase strictly with k, and every column's level-k center lies at or above them — so the per-column interpolation never extrapolates above a column's top.
A column whose terrain rises above a given height has no air there, and contributes nothing to that height's mean: the interpolation kernel also fills an indicator field, and the mean is the ratio of the two sum! reductions. Extending such columns downward instead (holding the surface value) would bias the mean towards near-surface air by ~(z̄ − z_surface)·dφ/dz at the lowest levels. The lowest-terrain column contributes to every height, so no level is ever empty.
Breeze.CompressibleEquations.solve_for_pressure! — Method
solve_for_pressure!(
_::AtmosphereModel{<:CompressibleDynamics}
)
No-op for CompressibleDynamics - pressure is computed from the equation of state, not solved.
Breeze.CompressibleEquations.terrain_exner_reference_state — Method
terrain_exner_reference_state(
grid,
surface_pressure,
ref_spec,
standard_pressure,
constants
) -> ExnerReferenceState{_A, FP, FD, FE} where {_A, FP<:(Field{Center, Center, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}), FD<:(Field{Center, Center, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}), FE<:(Field{Center, Center, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B})}
Build the single 3D ExnerReferenceState for a terrain-following compressible model from an explicit reference profile ref_spec (a reference_potential_temperature — constant or θ(z) — optionally with reference_vapor_mass_fraction). Its pressure/density/exner_function are horizontally-varying CenterFields in per-column discrete hydrostatic balance (compute_terrain_reference_state!); only pressure/density are read by the terrain kernels, but exner_function is filled for consistency with the 1D-column form.
Breeze.CompressibleEquations.terrain_reference_mean_profiles — Method
terrain_reference_mean_profiles(
model
) -> NamedTuple{(:reference_potential_temperature, :reference_vapor_mass_fraction), <:Tuple{Breeze.CompressibleEquations.HorizontalMeanProfile, Union{Nothing, Breeze.CompressibleEquations.HorizontalMeanProfile}}}
Build the reference specification (reference_potential_temperature, reference_vapor_mass_fraction) for a terrain-following compressible model from the horizontal means of its current θˡⁱ and qᵛ. The vapor profile is dropped (set to nothing, selecting the dry reference path) when the mean moisture is identically zero.
Breeze.CompressibleEquations.terrain_surface_reference_fields — Method
terrain_surface_reference_fields(
grid,
p₀,
θᵣ,
qᵛᵣ,
pˢᵗ,
constants
) -> Tuple{Field{Center, Center, Nothing, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}, Union{Field{Center, Center, Nothing, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}, Oceananigans.Fields.ZeroField{_A, 3} where _A}, Field{Center, Center, Nothing, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}}
Return the reference (θˢ, qᵛˢ, pˢ) at the terrain surface — the bottom face of each column — as 2D fields. pˢ is the continuous hydrostatic pressure at the local terrain height, which anchors the column integration in compute_terrain_reference_state!.
The surface heights come from a kernel; the profiles and the hydrostatic integration are host callables (an arbitrary user θ(z) and, for moist references, an adaptive vertical integration), so they are evaluated in a single vectorized pass over those heights — one evaluation per column, not per cell — and transferred back. A dry reference returns qᵛˢ::ZeroField.
Breeze.CompressibleEquations.with_time_discretization — Method
with_time_discretization(
dynamics::CompressibleDynamics,
time_discretization
) -> CompressibleDynamics
Return a CompressibleDynamics identical to dynamics but with its time_discretization replaced. Every field (densities, pressure, reference and terrain states) is shared by reference — only the immutable scheme wrapper changes — so this allocates no field memory. Used to build the adiabatic-balance twin (an ExplicitTimeStepping view of a production model).
Breeze.CompressibleEquations.without_sponge — Method
without_sponge(
time_discretization
) -> SplitExplicitTimeDiscretization{_A, _B, _C, Nothing} where {_A, _B, _C}
Return a copy of time_discretization with its upper sponge removed. The adiabatic-balance excursion must be reversible, and the sponge (like divergence damping) is an irreversible term; balance_adiabatically! therefore requires a sponge-free model. No-op for discretizations that carry no sponge (e.g. ExplicitTimeStepping).
Forcings
KinematicDriver
Microphysics
Breeze.Microphysics.NumberConcentrationKernelFunction — Type
NumberConcentrationKernelFunction{P, M, Q, R}Kernel callable for the lazy total number concentration $ρnˣ$ (m⁻³) of a one-moment microphysics species, computed from the prognostic mass density $ρqˣ$ and the species' assumed Marshall–Palmer size distribution as $ρnˣ = n_0 \, λ^{-1}$.
Fields
pdf: size distribution (ParticlePDFIceRainorParticlePDFSnow)mass: mass(radius) parameters (ParticleMass)ρq: prognostic mass density field for the species [kg/m³]reference_density: air density field [kg/m³]
Breeze.AtmosphereModels.materialize_microphysical_fields — Method
materialize_microphysical_fields(
_::Breeze.Microphysics.DCMIP2016KesslerMicrophysics,
grid,
boundary_conditions
) -> NamedTuple{(:ρqᶜˡ, :ρqʳ, :qᵛ, :qᶜˡ, :qʳ, :precipitation_rate, :𝕎ʳ), <:Tuple{Field{Center, Center, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}, Field{Center, Center, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}, Field{Center, Center, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}, Field{Center, Center, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}, Field{Center, Center, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}, Field{Center, Center, Nothing, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}, Field{Center, Center, Center, Nothing, G, I, D, T, B, Nothing} where {G, I, D, T, B}}}
Create and return the microphysical fields for the Kessler scheme.
Prognostic Fields (Density-Weighted)
ρqᶜˡ: Density-weighted cloud liquid mass fraction.ρqʳ: Density-weighted rain mass fraction.
Diagnostic Fields (Mass Fractions)
qᵛ: Water vapor mass fraction, diagnosed as $q^v = q^t - q^{cl} - q^r$.qᶜˡ: Cloud liquid mass fraction (kg/kg).qʳ: Rain mass fraction (kg/kg).precipitation_rate: Surface precipitation rate (m/s), defined as $q^r v^t_{rain}$ to match one-moment microphysics.𝕎ʳ: Rain terminal velocity (m/s).
Breeze.AtmosphereModels.maybe_adjust_thermodynamic_state — Method
maybe_adjust_thermodynamic_state(
𝒰,
_::Breeze.Microphysics.DCMIP2016KesslerMicrophysics,
qᵛ,
constants
) -> Any
Return the thermodynamic state without adjustment.
The Kessler scheme performs its own saturation adjustment internally via the kernel.
Breeze.AtmosphereModels.microphysical_tendency — Method
microphysical_tendency(
_::Breeze.Microphysics.DCMIP2016KesslerMicrophysics,
name,
ρ,
ℳ,
𝒰,
constants
) -> Any
Return zero tendency.
All microphysical source/sink terms are applied directly to the prognostic fields via the microphysics_model_update! kernel, bypassing the standard tendency interface.
Breeze.AtmosphereModels.microphysical_velocities — Method
microphysical_velocities(
_::Breeze.Microphysics.DCMIP2016KesslerMicrophysics,
μ,
name
)
Return nothing.
Rain sedimentation is handled internally by the kernel rather than through the advection interface.
Breeze.AtmosphereModels.microphysics_model_update! — Method
microphysics_model_update!(
microphysics::Breeze.Microphysics.DCMIP2016KesslerMicrophysics,
model
)
Apply the Kessler microphysics to the model.
This function launches a kernel that processes each column independently, with rain sedimentation subcycling.
The kernel handles conversion between mass fractions and mixing ratios internally for efficiency. Water vapor is diagnosed from $q^v = q^t - q^{cl} - q^r$.
The kernel writes prognostic fields in the interior only, so update_state! is called afterwards to restore a consistent model state (halos, diagnostics, and tendencies).
Breeze.AtmosphereModels.microphysics_model_update! — Method
microphysics_model_update!(
microphysics::Breeze.Microphysics.DCMIP2016KesslerMicrophysics,
model::AtmosphereModel{<:ParcelDynamics}
)
Apply DCMIP2016 Kessler microphysics to a parcel model.
For a Lagrangian parcel, the microphysics processes are:
- Autoconversion: Cloud water → rain when cloud exceeds threshold
- Accretion: Rain + cloud → rain (collection)
- Saturation adjustment: Vapor ↔ cloud to maintain equilibrium
- Rain evaporation: Rain → vapor in subsaturated air
Note: Rain sedimentation is not applicable to a Lagrangian parcel since the parcel is a closed system (rain does not fall out of the parcel).
Breeze.AtmosphereModels.microphysics_model_update! — Method
microphysics_model_update!(
microphysics::InstantaneousPrecipitation,
model
)
Condense supersaturation, retain the released latent heat, and remove the condensate as precipitation — applied directly to the prognostic vapor ρqᵛ and liquid-ice potential temperature density ρθˡⁱ.
Breeze.AtmosphereModels.precipitation_rate — Method
precipitation_rate(
model,
_::Breeze.Microphysics.DCMIP2016KesslerMicrophysics,
_::Val{:liquid}
) -> Any
Return the liquid precipitation rate field for the DCMIP2016 Kessler microphysics scheme.
The precipitation rate is computed internally by the Kessler kernel and stored in μ.precipitation_rate. It is defined as $q^r v^t_{rain}$ (rain mass fraction times terminal velocity), matching the one-moment microphysics definition. Units are m/s.
This implements the Breeze precipitation_rate(model, phase) interface, allowing the DCMIP2016 Kessler scheme to integrate with Breeze's standard diagnostics.
Breeze.AtmosphereModels.prognostic_field_names — Method
prognostic_field_names(
_::Breeze.Microphysics.DCMIP2016KesslerMicrophysics
) -> Tuple{Symbol, Symbol}
Return the names of prognostic microphysical fields for the Kessler scheme.
Fields
:ρqᶜˡ: Density-weighted cloud liquid mass fraction (kg/m³).:ρqʳ: Density-weighted rain mass fraction (kg/m³).
Breeze.AtmosphereModels.surface_precipitation_flux — Method
surface_precipitation_flux(
model,
_::Breeze.Microphysics.DCMIP2016KesslerMicrophysics
) -> Field{LX, LY, LZ, O, G, I, D, T, B, Oceananigans.Fields.FieldStatus{Float64}} where {LX, LY, LZ, O, G, I, D, T, B}
Return the surface precipitation flux field for the DCMIP2016 Kessler microphysics scheme.
The surface precipitation flux is $ρ q^r v^t_{rain}$ at the surface, matching the one-moment microphysics definition. Units are kg/m²/s.
This implements the Breeze surface_precipitation_flux(model) interface.
Breeze.AtmosphereModels.surface_precipitation_flux — Method
surface_precipitation_flux(
model,
_::InstantaneousPrecipitation
) -> Field{LX, LY, LZ, O, G, I, D, T, B, Oceananigans.Fields.FieldStatus{Float64}} where {LX, LY, LZ, O, G, I, D, T, B}
Return the surface precipitation flux for the instantaneous-precipitation scheme.
The scheme removes condensed water immediately, so the surface flux is the column integral of the volumetric precipitation rate. Units are kg/m²/s.
Breeze.Microphysics.cloud_to_rain_production — Method
cloud_to_rain_production(rᶜˡ, rʳ, Δt, microphysics)Compute cloud-to-rain production rate from autoconversion and accretion (Klemp and Wilhelmson 1978, eq. 2.13).
This implements the combined effect of:
- Autoconversion: Cloud water spontaneously converting to rain when
rᶜˡ > rᶜˡ★ - Accretion: Rain collecting cloud water as it falls
The formula uses an implicit time integration for numerical stability.
References
- Klemp, J. B., & Wilhelmson, R. B. (1978). The simulation of three-dimensional convective storm dynamics. Journal of the Atmospheric Sciences, 35(6), 1070-1096.
Breeze.Microphysics.condensation_rate — Method
condensation_rate(
qᵛ,
qᵛ⁺,
qᶜˡ,
T,
ρ,
q,
τᶜˡ,
constants
) -> Any
Compute the condensation/evaporation rate for cloud liquid water in a relaxation-to-saturation model.
This returns the rate of change of cloud liquid mass fraction (kg/kg/s). Positive values indicate condensation; negative values indicate evaporation. Evaporation is limited by the available cloud liquid.
Breeze.Microphysics.deposition_rate — Method
deposition_rate(
qᵛ,
qᵛ⁺ⁱ,
qᶜⁱ,
T,
ρ,
q,
τᶜⁱ,
constants
) -> Any
Compute the deposition/sublimation rate for cloud ice in a relaxation-to-saturation model.
This returns the rate of change of cloud ice mass fraction (kg/kg/s). Positive values indicate deposition; negative values indicate sublimation. Sublimation is limited by the available cloud ice.
Breeze.Microphysics.ice_thermodynamic_adjustment_factor — Method
ice_thermodynamic_adjustment_factor(
qᵛ⁺ⁱ,
T,
q,
constants
) -> Any
Compute the thermodynamic adjustment factor Γ used in relaxation-to-saturation deposition/sublimation tendencies (ice analogue of thermodynamic_adjustment_factor).
Breeze.Microphysics.mass_fractions_to_mixing_ratios — Method
mass_fractions_to_mixing_ratios(
qᵛ,
ρqᶜˡ,
ρqʳ,
ρ
) -> Tuple{Any, Any, Any}
Convert from mass fractions to mixing ratios.
Returns (rᵛ, rᶜˡ, rʳ) mixing ratios for use in Kessler physics.
Breeze.Microphysics.mixing_ratios_to_mass_fractions — Method
mixing_ratios_to_mass_fractions(
rᵛ,
rᶜˡ,
rʳ
) -> NTuple{4, Any}
Convert from mixing ratios back to mass fractions.
Returns (qᵛ, qᶜˡ, qʳ, qᵗ).
Breeze.Microphysics.step_kessler_microphysics — Method
step_kessler_microphysics(
rᵛ,
rᶜˡ,
rʳ,
Δr𝕎,
T,
ρ,
p,
Δt,
microphysics,
constants,
f₅,
δT,
FT
) -> NTuple{4, Any}
Apply one Kessler microphysics step: autoconversion, accretion, saturation adjustment, rain evaporation, and condensation.
Δr𝕎 is the sedimentation flux divergence (zero for parcel models).
Returns (rᵛ, rᶜˡ, rʳ, Δrˡ).
Breeze.Microphysics.thermodynamic_adjustment_factor — Method
thermodynamic_adjustment_factor(qᵛ⁺, T, q, constants) -> Any
Compute the thermodynamic adjustment factor Γ used in relaxation-to-saturation condensation/evaporation tendencies.
MoistAirBuoyancies
Breeze.MoistAirBuoyancies.compute_boussinesq_adjustment_temperature — Method
compute_boussinesq_adjustment_temperature(
𝒰₀::Breeze.Thermodynamics.LiquidIcePotentialTemperatureState{FT},
constants::ThermodynamicConstants
) -> Any
Return the temperature $T$ corresponding to thermodynamic equilibrium between the specific humidity and liquid mass fractions of the input thermodynamic state 𝒰₀, wherein the specific humidity is equal to or less than the saturation specific humidity at the given conditions and affiliated with theromdynamic constants constants.
The saturation equilibrium temperature satisfies the nonlinear relation
\[θ = [1 - ℒˡᵣ qˡ / (cᵖᵐ T)] T / Π ,\]
with $ℒˡᵣ$ the latent heat at the reference temperature $Tᵣ$, $cᵖᵐ$ the mixture specific heat, $Π$ the Exner function, $qˡ = \max(0, qᵗ - qᵛ⁺)$ the condensate specific humidity, $qᵗ$ is the total specific humidity, and $qᵛ⁺$ is the saturation specific humidity.
The saturation equilibrium temperature is thus obtained by solving $r(T) = 0$, where
\[r(T) ≡ T - θ Π - ℒˡᵣ qˡ / cᵖᵐ .\]
Solution of $r(T) = 0$ is found via the secant method.
ParcelModels
Breeze.ParcelModels.check_domain_bounds! — Method
check_domain_bounds!(state, grid)
Check that the parcel remains within the vertical grid domain [0, Lz].
Throws an error if the parcel escapes the domain, since extrapolation of environmental profiles (pressure, density) beyond the grid is unphysical.
Breeze.ParcelModels.initialize_parcel_state! — Method
initialize_parcel_state!(state, z₀, x₀, y₀, model)
Initialize the parcel state by interpolating environmental conditions at the given position.
Breeze.ParcelModels.reconstruct_thermodynamic_state — Function
Reconstruct a thermodynamic state with a new conserved variable value and updated z, p.
Breeze.ParcelModels.set_moisture_from_relative_humidity! — Method
set_moisture_from_relative_humidity!(
qᵗ_field,
ℋ,
T_field,
ρ_field,
constants
)
Set specific humidity field from relative humidity, computing
\[qᵗ = ℋ qᵛ⁺(T, ρ).\]
where $qᵗ$ is the total specific moisture, $ℋ$ is the relative humidity, and $qᵛ⁺$ is the saturation specific humidity at temperature $T$ and density $ρ$.
Breeze.ParcelModels.set_temperature_from_potential_temperature! — Method
set_temperature_from_potential_temperature!(
T_field,
θ,
p_field,
pˢᵗ,
constants
)
Set temperature field from potential temperature, using proper thermodynamic relations.
Breeze.ParcelModels.ssp_rk3_microphysics_substep — Method
ssp_rk3_microphysics_substep(
_::Nothing,
_::Nothing,
_::Nothing,
Δt,
α
)
Apply SSP RK3 substep formula to microphysics prognostic variables.
Oceananigans.Fields.set! — Method
set!(
model::AtmosphereModel{<:ParcelDynamics};
T,
θ,
ρ,
p,
qᵗ,
ℋ,
u,
v,
w,
w_parcel,
x,
y,
z
)
Set the environmental profiles and initial parcel state for a ParcelModel.
Environmental profiles are set on the model's fields (temperature, density, pressure, velocities). The parcel is initialized at the specified position with environmental conditions interpolated at that height.
Keyword Arguments
Thermodynamic profiles (provide one of T or θ):
T: Temperature profile T(z) [K] - function, array, Field, or constantθ: Potential temperature profile θ(z) [K] - function, array, or constant. If provided,Tis computed fromθandpusing thermodynamic relations.ρ: Density profile ρ(z) [kg/m³] - function, array, Field, or constantp: Pressure profile p(z) [Pa] - function, array, Field, or constant
Moisture (provide one of qᵗ or ℋ):
qᵗ: Specific humidity profile qᵗ(z) [kg/kg] - function, array, or constant (default: 0)ℋ: Relative humidity profile ℋ(z) [0-1] - function, array, or constant. If provided,qᵗis computed asqᵗ = ℋ * qᵛ⁺(T, ρ).
Velocities:
u: Zonal velocity u(z) [m/s] - function, array, or constant (default: 0)v: Meridional velocity v(z) [m/s] - function, array, or constant (default: 0)w: Vertical velocity w(z) [m/s] - function, array, or constant (default: 0)
Parcel state:
x: Initial parcel x-position [m], default: 0y: Initial parcel y-position [m], default: 0z: Initial parcel height [m], required to initialize parcel statew_parcel: Initial parcel vertical velocity [m/s], forPrognosticVerticalVelocity
Oceananigans.TimeSteppers.time_step! — Method
time_step!(
model::AtmosphereModel{<:ParcelDynamics, <:Any, <:Any, <:SSPRungeKutta3},
Δt;
callbacks
)
Advance the parcel model by one time step $Δt$ using SSP RK3.
The SSP RK3 scheme Shu and Osher (1988) is:
\[\begin{align*} u^{(1)} &= u^{(0)} + Δt \, G(u^{(0)}) \\ u^{(2)} &= \frac{3}{4} u^{(0)} + \frac{1}{4} u^{(1)} + \frac{1}{4} Δt \, G(u^{(1)}) \\ u^{(3)} &= \frac{1}{3} u^{(0)} + \frac{2}{3} u^{(2)} + \frac{2}{3} Δt \, G(u^{(2)}) \end{align}\]
This scheme has CFL coefficient = 1 and is TVD (total variation diminishing).
Oceananigans.TimeSteppers.update_state! — Function
update_state!(model::AtmosphereModel{<:ParcelDynamics}; ...)
update_state!(
model::AtmosphereModel{<:ParcelDynamics},
callbacks;
compute_tendencies
)
Update the parcel model state, computing tendencies and auxiliary variables.
This function is called at the beginning of each time step and after each substep in multi-stage time steppers. It mirrors the role of update_state! for AtmosphereModel and consolidates all state-dependent computations:
- Compute position tendencies (Gx, Gy, Gz) from environmental velocity profiles
- Any other auxiliary state computations (currently none)
Keyword Arguments
compute_tendencies: Iftrue(default), compute tendencies for prognostic variables.
PotentialTemperatureFormulations
Breeze.AtmosphereModels.diagnose_thermodynamic_state — Method
diagnose_thermodynamic_state(
i,
j,
k,
grid,
formulation::LiquidIcePotentialTemperatureFormulation,
dynamics,
q
) -> Breeze.Thermodynamics.LiquidIceDensityState
Build a LiquidIcePotentialTemperatureState at grid point (i, j, k) from the given formulation, dynamics, and pre-computed moisture mass fractions q.
Breeze.AtmosphereModels.set_thermodynamic_variable! — Method
set_thermodynamic_variable!(
model::AtmosphereModel{<:Any, <:LiquidIcePotentialTemperatureFormulation},
_::Val{:T},
value
)
Set the thermodynamic state from in-situ temperature $T$.
The temperature is converted to liquid-ice potential temperature θˡⁱ using the relation between $T$ and θˡⁱ` that accounts for the moisture distribution.
For unsaturated air (no condensate), this simplifies to $θ = T / Π$ where $Π$ is the Exner function.
Breeze.AtmosphereModels.static_energy_density — Method
static_energy_density(model::PotentialTemperatureModel)Return the static energy density as a Field with boundary conditions that return energy fluxes when used with BoundaryConditionOperation.
For LiquidIcePotentialTemperatureFormulation, the prognostic variable is potential temperature density ρθ. This function converts the ρθ boundary conditions to energy flux boundary conditions by multiplying by the mixture heat capacity cᵖᵐ.
Solvers
Breeze.Solvers.materialize_solver — Method
materialize_solver(solver::NewtonSolver, FT) -> NewtonSolver
Return solver with its tolerances converted to float type FT, so that solver parameters stored on Float32 models do not promote kernel arithmetic.
Breeze.Solvers.newton_solve — Method
newton_solve(
residual_and_derivative,
solver::NewtonSolver,
x
) -> Any
Solve r(x) = 0 by Newton iteration from initial guess x, where residual_and_derivative(x) returns the tuple (r(x), r′(x)).
The iteration is controlled by solver:
NewtonSolver: iterate until|Δx| ≤ max(abstol, reltol * |x|)ormaxiteris reachedFixedIterations: perform exactlyiterationsNewton steps (no convergence test)nothing: return the initial guessxunmodified
using Breezeusing Breeze.Solvers: newton_solvesolver = NewtonSolver(reltol=1e-12, maxiter=20)x = newton_solve(x -> (x^2 - 2, 2x), solver, 1.0)round(x, digits=10)# output1.4142135624Breeze.Solvers.secant_solve — Method
secant_solve(
residual,
solver::SecantSolver,
x₁,
x₂,
scale
) -> Any
Solve r(x) = 0 by secant iteration from the initial guesses x₁ and x₂, where residual(x) returns r(x). The convergence criterion compares the residual against scale: iteration stops when |r| ≤ max(abstol, reltol * |scale|).
The iteration is controlled by solver:
SecantSolver: iterate until the residual converges ormaxiteris reachedFixedIterations: perform exactlyiterationssecant steps (no convergence test)
A degenerate step (r₂ = r₁, slope undefined) terminates a SecantSolver iteration at the current iterate and leaves a FixedIterations iterate unchanged.
using Breezeusing Breeze.Solvers: secant_solvesolver = SecantSolver(abstol=1e-12, maxiter=20)x = secant_solve(x -> x^2 - 2, solver, 1.0, 2.0, 1.0)round(x, digits=10)# output1.4142135624StaticEnergyFormulations
Breeze.AtmosphereModels.diagnose_thermodynamic_state — Method
diagnose_thermodynamic_state(
i,
j,
k,
grid,
formulation::StaticEnergyFormulation,
dynamics,
q
) -> Breeze.Thermodynamics.StaticEnergyState
Build a StaticEnergyState at grid point (i, j, k) from the given formulation, dynamics, and pre-computed moisture mass fractions q.
Breeze.AtmosphereModels.set_thermodynamic_variable! — Method
set_thermodynamic_variable!(
model::AtmosphereModel{<:Any, <:StaticEnergyFormulation},
_::Val{:T},
value
)
Set the thermodynamic state from temperature $T$.
The temperature is converted to static energy $e$ using the relation:
\[e = cᵖᵐ T + g z - ℒˡ qˡ - ℒⁱ qⁱ .\]
TerrainFollowingDiscretization
Thermodynamics
Breeze.Thermodynamics.enforce_discrete_hydrostatic_balance! — Method
enforce_discrete_hydrostatic_balance!(pᵣ, ρᵣ, grid, g)Recompute the reference pressure pᵣ from the reference density ρᵣ by discrete upward integration, ensuring that the discrete hydrostatic balance
\[\frac{p_{ref}[k] - p_{ref}[k-1]}{Δz} + g \frac{ρ_{ref}[k] + ρ_{ref}[k-1]}{2} = 0\]
holds exactly at every interior z-face. This guarantees that reference-state subtraction in the pressure gradient and buoyancy cancels to machine precision, eliminating the $O(Δz^2)$ truncation error that would otherwise dominate the momentum tendency for nearly-hydrostatic flows.
Breeze.Thermodynamics.numerically_integrated_hydrostatic_density — Method
numerically_integrated_hydrostatic_density(z, p₀, θ_func, pˢᵗ, constants)Compute the dry hydrostatic density at height z from the numerically integrated pressure and the given potential temperature profile θ_func(z).
Breeze.Thermodynamics.numerically_integrated_hydrostatic_pressure — Method
numerically_integrated_hydrostatic_pressure(z, p₀, θ_func, pˢᵗ, constants)Compute the dry hydrostatic pressure at height $z$ by numerically integrating $∂p/∂z = -g ρ$ from $z=0$, where $ρ = p/(Rᵈ T)$ and $T = θ(z) (p/pˢᵗ)^κ$.
This function handles non-uniform potential temperature profiles $θ(z)$ for which the closed-form adiabatic solution does not apply. The integration is carried out in the dry Exner function $Π = (p / pˢᵗ)^κ$, which satisfies the linear equation $∂Π/∂z = -g / (cᵖᵈ θ(z))$.
TimeSteppers
Breeze.TimeSteppers.acoustic_rk3_substep! — Method
acoustic_rk3_substep!(model::AtmosphereModel, Δt, β)
Run one Wicker–Skamarock RK3 stage: compute slow tendencies, then execute the linearized-acoustic substep loop, then update remaining scalars.
Breeze.TimeSteppers.compute_slow_momentum_tendencies! — Method
compute_slow_momentum_tendencies!(model)
Compute slow momentum tendencies (advection, Coriolis, closure, forcing). The pressure-gradient force and buoyancy are excluded; they are handled in linearized form inside the acoustic substep loop.
Breeze.TimeSteppers.compute_slow_scalar_tendencies! — Method
compute_slow_scalar_tendencies!(model)
Compute slow tendencies for density and the thermodynamic variable:
- $Gˢ_ρᵈ = -∇·m$: full dry-density tendency (continuity equation), written into
model.timestepper.Gⁿ.ρᵈ. - $Gˢ_ρᵡ$: full thermodynamic-density tendency (advection + physics).
Breeze.TimeSteppers.implicit_substep! — Method
implicit_substep!(model, Δt_stage)
Apply the vertically-implicit tridiagonal solve to the prognostics that the acoustic substep loop advances: momentum and the thermodynamic variable. Dispatch on the timestepper's implicit_solver selects the method: nothing means nothing in the model is vertically implicit and the substep is a no-op.
Each field's solve combines every implicit vertical piece into a single tridiagonal system: the first-order-upwind remainder of adaptive implicit vertical advection (whose CFL-limited explicit flux the slow tendencies carry through the advection dispatch), plus vertically-implicit closure diffusion. Explicit advection schemes contribute no advection coefficients and explicit closures no diffusion coefficients, so each combination reduces to the right system. The solve runs once per RK stage after the substep loop, over the stage interval — the operator split WRF and CM1 use for their implicit vertical pieces. Continuity takes no implicit solve: the coupling-density tendency is the acoustic mass-flux divergence itself, not scalar advection.
The advecting velocity passed to each solve must be the one its slow tendency was built with, so the explicit/implicit velocity split is consistent: the RK stage-entry predictor velocities (see compute_slow_momentum_tendencies! and compute_slow_scalar_tendencies!), not the substepper's time-averaged transport velocities that moisture and tracers use.
Breeze.TimeSteppers.scalar_substep! — Method
scalar_substep!(model, kernel!, Δt_implicit, kernel_args...)
Update non-acoustic scalar fields (moisture, tracers) using the given kernel. Iterates over prognostic fields, skipping the first 5 ($ρ, ρu, ρv, ρw, ρθ$) which are handled by the acoustic substep loop.
Oceananigans.TimeSteppers.time_step! — Method
time_step!(
model::AtmosphereModel{<:Any, <:Any, <:Any, <:SSPRungeKutta3},
Δt;
callbacks
)
Step forward model one time step $Δt$ with the SSP RK3 method.
The algorithm is:
\[\begin{align*} u^{(1)} &= u^{(0)} + Δt \, G(u^{(0)}) \\ u^{(2)} &= \frac{3}{4} u^{(0)} + \frac{1}{4} u^{(1)} + \frac{1}{4} Δt \, G(u^{(1)}) \\ u^{(3)} &= \frac{1}{3} u^{(0)} + \frac{2}{3} u^{(2)} + \frac{2}{3} Δt \, G(u^{(2)}) \end{align*}\]
where $G$ above is the right-hand-side, e.g., $∂u/∂t = G(u)$.
Oceananigans.TimeSteppers.time_step! — Method
time_step!(
model::AtmosphereModel{<:CompressibleDynamics, <:Any, <:Any, <:AcousticRungeKutta3},
Δt;
callbacks
)
Step forward model one time step Δt with Wicker–Skamarock RK3 and linearized acoustic substepping.
TurbulenceClosures
VerticalGrids
BreezeRRTMGPExt
Breeze.AtmosphereModels.RadiativeTransferModel — Method
RadiativeTransferModel(
grid::Oceananigans.Grids.AbstractGrid,
::AllSkyOptics,
constants::ThermodynamicConstants;
background_atmosphere,
surface_temperature,
solar_position,
surface_emissivity,
direct_surface_albedo,
diffuse_surface_albedo,
surface_albedo,
solar_constant,
schedule,
liquid_effective_radius,
ice_effective_radius,
ice_roughness
)
Construct an all-sky (gas + cloud) full-spectrum RadiativeTransferModel for the given grid.
This constructor requires that NCDatasets is loadable in the user environment because RRTMGP loads lookup tables from netCDF via an extension.
Keyword Arguments
background_atmosphere: Background atmospheric gas composition (default:BackgroundAtmosphere()). O₃ can be a Number or Function ofz; other gases are global mean constants. O₃ can be a Number, Function, or Field; other gases are global mean constants.surface_temperature: Surface temperature in Kelvin, aNumberor 2DField. Default:nothing— bind one before the first radiation update (a coupled model wires its interface surface temperature into the radiation automatically).solar_position: Specification of the solar zenith angle. SeeAbstractSolarPositionand its subtypes:ApparentSolarPosition(default) — time-varying, computed from the model clock and grid (or explicit) longitude/latitude.FixedCosineZenith— constant cos(θ_z), independent of the clock.
surface_emissivity: Surface emissivity, 0-1 (default: 0.98). Scalar.surface_albedo: Surface albedo, 0-1. Can be scalar or 2D field. Alternatively, provide bothdirect_surface_albedoanddiffuse_surface_albedo.direct_surface_albedo: Direct surface albedo, 0-1. Can be scalar or 2D field.diffuse_surface_albedo: Diffuse surface albedo, 0-1. Can be scalar or 2D field.solar_constant: Top-of-atmosphere solar flux in W/m² (default: 1361)liquid_effective_radius: Model for cloud liquid effective radius in meters (default:ConstantRadiusParticles(10e-6))ice_effective_radius: Model for cloud ice effective radius in meters (default:ConstantRadiusParticles(30e-6))ice_roughness: Ice crystal roughness for cloud optics (1=smooth, 2=medium, 3=rough; default: 2)
Breeze.AtmosphereModels.RadiativeTransferModel — Method
RadiativeTransferModel(
grid::Oceananigans.Grids.AbstractGrid,
::ClearSkyOptics,
constants::ThermodynamicConstants;
background_atmosphere,
surface_temperature,
solar_position,
surface_emissivity,
direct_surface_albedo,
diffuse_surface_albedo,
surface_albedo,
solar_constant,
schedule
)
Construct a clear-sky (gas-only) full-spectrum RadiativeTransferModel for the given grid.
This constructor requires that NCDatasets is loadable in the user environment because RRTMGP loads lookup tables from netCDF via an extension.
Keyword Arguments
background_atmosphere: Background atmospheric gas composition (default:BackgroundAtmosphere()). O₃ can be a Number or Function ofz; other gases are global mean constants.surface_temperature: Surface temperature in Kelvin, aNumberor 2DField. Default:nothing— bind one before the first radiation update (a coupled model wires its interface surface temperature into the radiation automatically).solar_position: Specification of the solar zenith angle. SeeAbstractSolarPositionand its subtypes:ApparentSolarPosition(default) — time-varying, computed from the model clock and grid (or explicit) longitude/latitude.FixedCosineZenith— constant cos(θ_z), independent of the clock.
surface_emissivity: Surface emissivity, 0-1 (default: 0.98). Scalar.surface_albedo: Surface albedo, 0-1. Can be scalar or 2D field. Alternatively, provide bothdirect_surface_albedoanddiffuse_surface_albedo.direct_surface_albedo: Direct surface albedo, 0-1. Can be scalar or 2D field.diffuse_surface_albedo: Diffuse surface albedo, 0-1. Can be scalar or 2D field.solar_constant: Top-of-atmosphere solar flux in W/m² (default: 1361)
Breeze.AtmosphereModels.RadiativeTransferModel — Method
RadiativeTransferModel(
grid::Oceananigans.Grids.AbstractGrid,
::GrayOptics,
constants::ThermodynamicConstants;
optical_thickness,
surface_temperature,
solar_position,
surface_emissivity,
direct_surface_albedo,
diffuse_surface_albedo,
surface_albedo,
solar_constant,
schedule
)
Construct a gray atmosphere radiative transfer model for the given grid.
Keyword Arguments
optical_thickness: Optical thickness parameterization (default:GrayOpticalThicknessOGorman2008(FT)).surface_temperature: Surface temperature in Kelvin, aNumberor 2DField. Default:nothing— bind one before the first radiation update (a coupled model wires its interface surface temperature into the radiation automatically).solar_position: Specification of the solar zenith angle. SeeAbstractSolarPositionand its subtypes:ApparentSolarPosition(default) — time-varying, computed from the model clock and grid (or explicit) longitude/latitude.FixedCosineZenith— constant cos(θ_z), independent of the clock.
surface_emissivity: Surface emissivity, 0-1 (default: 0.98). Scalar.surface_albedo: Surface albedo, 0-1. Can be scalar or 2D field. Alternatively, provide bothdirect_surface_albedoanddiffuse_surface_albedo.direct_surface_albedo: Direct surface albedo, 0-1. Can be scalar or 2D field.diffuse_surface_albedo: Diffuse surface albedo, 0-1. Can be scalar or 2D field.solar_constant: Top-of-atmosphere solar flux in W/m² (default: 1361)
RRTMGP.Parameters.RRTMGPParameters — Method
RRTMGPParameters(constants::ThermodynamicConstants)Construct RRTMGPParameters from Breeze's ThermodynamicConstants.
Breeze.AtmosphereModels._update_radiation! — Method
_update_radiation!(
rtm::RadiativeTransferModel{<:Any, <:Any, <:Any, <:BackgroundAtmosphere, <:RRTMGP.AtmosphericStates.AtmosphericState{<:Any, <:Any, <:Any, <:Any, <:Any, <:RRTMGP.AtmosphericStates.CloudState}},
model
)
Update the all-sky (gas + cloud) full-spectrum radiative fluxes from the current model state.
Breeze.AtmosphereModels._update_radiation! — Method
_update_radiation!(
rtm::RadiativeTransferModel{<:Any, <:Any, <:Any, <:BackgroundAtmosphere},
model
)
Update the clear-sky full-spectrum radiative fluxes from the current model state.
Breeze.AtmosphereModels._update_radiation! — Method
_update_radiation!(
rtm::RadiativeTransferModel{<:Any, <:Any, <:Any, Nothing},
model
)
Update the radiative fluxes from the current model state.
This function:
- Updates the RRTMGP atmospheric state from model fields (T, p)
- Computes the solar zenith angle from the model clock and grid location
- Solves the longwave and shortwave RTE
- Copies the fluxes to Oceananigans fields for output
Sign convention: positive flux = upward, negative flux = downward.
BreezeRRTMGPExt.copy_fluxes_to_fields! — Method
copy_fluxes_to_fields!(
rtm::RadiativeTransferModel{<:Any, <:Any, <:Any, Nothing},
grid
)
Copy RRTMGP flux arrays to Oceananigans ZFaceFields.
Applies sign convention:
- positive = upward
- negative = downward.
For the non-scattering shortwave solver, only the direct beam flux is computed.
BreezeRRTMGPExt.rrtmgp_context — Method
rrtmgp_context(arch::CPU) -> Any
Create an RRTMGP-compatible ClimaComms context from an Oceananigans architecture.
BreezeRRTMGPExt.update_rrtmgp_state! — Method
update_rrtmgp_state!(
rrtmgp_state::RRTMGP.AtmosphericStates.GrayAtmosphericState,
model,
surface_temperature
)
Update the RRTMGP GrayAtmosphericState arrays from model fields.
Grid staggering: layers vs levels
RRTMGP requires atmospheric state at both "layers" (cell centers) and "levels" (cell faces). This matches the finite-volume staggering used in Oceananigans:
┌─────────────────────────────────────────────────┐ z_lev[Nz+1] ━━━━━━━ │ level Nz+1 (TOA): p_lev, t_lev, z_lev │ ← extrapolated └─────────────────────────────────────────────────┘ ┌─────────────────────────────────────────────────┐ │ layer Nz: T[Nz], p_lay[Nz] = pᵣ[Nz] │ ← from model └─────────────────────────────────────────────────┘ z_lev[Nz] ━━━━━━━ level Nz: p_lev, t_lev, z_lev ← interpolated ┌─────────────────────────────────────────────────┐ │ layer Nz-1 │ └─────────────────────────────────────────────────┘ ⋮ ┌─────────────────────────────────────────────────┐ │ layer 2 │ └─────────────────────────────────────────────────┘ z_lev[2] ━━━━━━━ level 2: p_lev, t_lev, z_lev ← interpolated ┌─────────────────────────────────────────────────┐ │ layer 1: T[1], p_lay[1] = pᵣ[1] │ ← from model └─────────────────────────────────────────────────┘ z_lev[1] ━━━━━━━ level 1 (surface, z=0): p_lev = p₀, t_lev │ ← from reference state ══════════════════════════════════════════════════ GROUND (t_sfc)Why the model must provide level values
RRTMGP is a general-purpose radiative transfer solver that operates on columns of atmospheric data. It does not interpolate from layers to levels internally because:
Boundary conditions: The surface (level 1) and TOA (level Nz+1) require boundary values that only the atmospheric model knows. For pressure, we use the reference state's
surface_pressureat z=0. For the top, we extrapolate using the adiabatic hydrostatic formula.Physics-appropriate interpolation: Different quantities need different interpolation methods. Pressure uses geometric mean (log-linear interpolation) because it varies exponentially with height. Temperature uses arithmetic mean.
Model consistency: The pressure profile must be consistent with the atmospheric model's reference state. RRTMGP has no knowledge of the anelastic approximation or the reference potential temperature θ₀.
Physics notes
Temperature: We use the actual temperature field T from the model state. This is the temperature that matters for thermal emission and absorption.
Pressure: In the anelastic approximation, pressure perturbations are negligible compared to the hydrostatic reference pressure. We use reference_state.pressure at cell centers, computed via adiabatic_hydrostatic_pressure(z, p₀, θ₀).
RRTMGP array layout
- Layer arrays
(Nz, Nc): values at cell centers, layer 1 at bottom - Level arrays
(Nz+1, Nc): values at cell faces, level 1 at surface (z=0)
BreezeRRTMGPExt.update_solar_zenith_angle! — Method
update_solar_zenith_angle!(
sw_solver,
_::FixedCosineZenith,
grid,
clock
)
Update the cosine of the solar zenith angle in the shortwave solver's boundary condition array, dispatched on the solar-position specification:
ApparentSolarPosition: recompute cos(θ_z) from the model clock and observer (λ, φ) — either an explicit coordinate or the grid's λ/φ per column.FixedCosineZenith: no-op. The BC array was set once at construction byinitialize_cos_zenith!.
BreezeCloudMicrophysicsExt
BreezeCloudMicrophysicsExt.AerosolActivation — Type
AerosolActivation{AP, AD, FT}Aerosol activation parameters for two-moment microphysics.
Aerosol activation is the physical process that creates cloud droplets from aerosol particles when air becomes supersaturated. This struct bundles the parameters needed to compute the activation source term for cloud droplet number concentration.
Fields
activation_parameters:AerosolActivationParametersfrom CloudMicrophysics.jlaerosol_distribution: Aerosol size distribution (modes with number, size, hygroscopicity)nucleation_timescale: Nucleation timescale [s] for converting activation deficit to rate (default: 1s)
References
- Abdul-Razzak, H. and Ghan, S.J. (2000). A parameterization of aerosol activation: 2. Multiple aerosol types. J. Geophys. Res., 105(D5), 6837-6844.
BreezeCloudMicrophysicsExt.MixedPhaseOneMomentState — Type
MixedPhaseOneMomentState{FT} <: AbstractMicrophysicalState{FT}Microphysical state for mixed-phase one-moment bulk microphysics.
Contains the local mixing ratios for cloud liquid, cloud ice, rain, and snow. This state is used for both saturation adjustment and non-equilibrium cloud formation in mixed-phase simulations.
Fields
qᶜˡ: Cloud liquid mixing ratio (kg/kg)qᶜⁱ: Cloud ice mixing ratio (kg/kg)qʳ: Rain mixing ratio (kg/kg)qˢ: Snow mixing ratio (kg/kg)
BreezeCloudMicrophysicsExt.OneMomentCloudMicrophysics — Type
OneMomentCloudMicrophysics(
;
...
) -> BulkMicrophysics{N, C, Nothing, Nothing} where {N<:(NonEquilibriumCloudFormation{ConstantRateCondensateFormation{FT}, Nothing} where FT), C<:(BreezeCloudMicrophysicsExt.OneMomentCloudMicrophysicsCategories{P, V} where {P<:(CloudMicrophysics.Parameters.Microphysics1MParams{OPT, CP, PP, AP, VL} where {OPT<:(CloudMicrophysics.Parameters.Microphysics1MOptions{CLF, CIF, CloudMicrophysics.Parameters.CloudIceMelt, RA, SA, CloudMicrophysics.Parameters.RainEvaporation, CloudMicrophysics.Parameters.DepositionAndSublimation, CloudMicrophysics.Parameters.SnowMelt, CLRA, CLSA, CIRA, CISA, RSA} where {CLF<:CloudMicrophysics.Parameters.CloudLiquidFormation, CIF<:CloudMicrophysics.Parameters.ConstantTimescale, RA<:(CloudMicrophysics.Parameters.Kessler1M{AC} where AC<:CloudMicrophysics.Parameters.Acnv1M), SA<:(CloudMicrophysics.Parameters.NoSupersaturation{AC} where AC<:CloudMicrophysics.Parameters.Acnv1M), CLRA<:CloudMicrophysics.Parameters.CloudLiquidRainAccretion, CLSA<:CloudMicrophysics.Parameters.CloudLiquidSnowAccretion, CIRA<:CloudMicrophysics.Parameters.CloudIceRainAccretion, CISA<:CloudMicrophysics.Parameters.CloudIceSnowAccretion, RSA<:CloudMicrophysics.Parameters.RainSnowAccretion}), CP<:(CloudMicrophysics.Parameters.CloudPhaseParams1M{LCL, ICL} where {LCL<:CloudMicrophysics.Parameters.CloudLiquid, ICL<:(CloudMicrophysics.Parameters.CloudIce{_A, PD, MS} where {_A, PD<:CloudMicrophysics.Parameters.ParticlePDFIceRain, MS<:CloudMicrophysics.Parameters.ParticleMass})}), PP<:(CloudMicrophysics.Parameters.PrecipPhaseParams1M{RAI, SNO} where {RAI<:(CloudMicrophysics.Parameters.Rain{PD, MS, AR, VT} where {PD<:CloudMicrophysics.Parameters.ParticlePDFIceRain, MS<:CloudMicrophysics.Parameters.ParticleMass, AR<:CloudMicrophysics.Parameters.ParticleArea, VT<:CloudMicrophysics.Parameters.Ventilation}), SNO<:(CloudMicrophysics.Parameters.Snow{_A, PD, MS, AR, VT, AP} where {_A, PD<:CloudMicrophysics.Parameters.ParticlePDFSnow, MS<:CloudMicrophysics.Parameters.ParticleMass, AR<:CloudMicrophysics.Parameters.ParticleArea, VT<:CloudMicrophysics.Parameters.Ventilation, AP<:CloudMicrophysics.Parameters.SnowAspectRatio})}), AP<:CloudMicrophysics.Parameters.AirProperties, VL<:(CloudMicrophysics.Parameters.Blk1MVelType{R, S} where {R<:CloudMicrophysics.Parameters.Blk1MVelTypeRain, S<:CloudMicrophysics.Parameters.Blk1MVelTypeSnow})}), V<:(CloudMicrophysics.Parameters.TerminalVelocityParams{STOKES, CHEN, BLK1M} where {STOKES<:CloudMicrophysics.Parameters.StokesRegimeVelType, CHEN<:(CloudMicrophysics.Parameters.Chen2022VelType{R, SI, LI} where {R<:(CloudMicrophysics.Parameters.Chen2022VelTypeRain{FT, 3} where FT<:AbstractFloat), SI<:(CloudMicrophysics.Parameters.Chen2022VelTypeSmallIce{FT, 3, 4} where FT<:AbstractFloat), LI<:(CloudMicrophysics.Parameters.Chen2022VelTypeLargeIce{FT, 3} where FT<:AbstractFloat)}), BLK1M<:(CloudMicrophysics.Parameters.Blk1MVelType{R, S} where {R<:CloudMicrophysics.Parameters.Blk1MVelTypeRain, S<:CloudMicrophysics.Parameters.Blk1MVelTypeSnow})})})}
OneMomentCloudMicrophysics(
FT::DataType;
cloud_formation,
categories,
precipitation_boundary_condition,
negative_moisture_correction
) -> BulkMicrophysics{N, C, Nothing, Nothing} where {N<:(NonEquilibriumCloudFormation{ConstantRateCondensateFormation{FT}, Nothing} where FT), C<:(BreezeCloudMicrophysicsExt.OneMomentCloudMicrophysicsCategories{P, V} where {P<:(CloudMicrophysics.Parameters.Microphysics1MParams{OPT, CP, PP, AP, VL} where {OPT<:(CloudMicrophysics.Parameters.Microphysics1MOptions{CLF, CIF, CloudMicrophysics.Parameters.CloudIceMelt, RA, SA, CloudMicrophysics.Parameters.RainEvaporation, CloudMicrophysics.Parameters.DepositionAndSublimation, CloudMicrophysics.Parameters.SnowMelt, CLRA, CLSA, CIRA, CISA, RSA} where {CLF<:CloudMicrophysics.Parameters.CloudLiquidFormation, CIF<:CloudMicrophysics.Parameters.ConstantTimescale, RA<:(CloudMicrophysics.Parameters.Kessler1M{AC} where AC<:CloudMicrophysics.Parameters.Acnv1M), SA<:(CloudMicrophysics.Parameters.NoSupersaturation{AC} where AC<:CloudMicrophysics.Parameters.Acnv1M), CLRA<:CloudMicrophysics.Parameters.CloudLiquidRainAccretion, CLSA<:CloudMicrophysics.Parameters.CloudLiquidSnowAccretion, CIRA<:CloudMicrophysics.Parameters.CloudIceRainAccretion, CISA<:CloudMicrophysics.Parameters.CloudIceSnowAccretion, RSA<:CloudMicrophysics.Parameters.RainSnowAccretion}), CP<:(CloudMicrophysics.Parameters.CloudPhaseParams1M{LCL, ICL} where {LCL<:CloudMicrophysics.Parameters.CloudLiquid, ICL<:(CloudMicrophysics.Parameters.CloudIce{_A, PD, MS} where {_A, PD<:CloudMicrophysics.Parameters.ParticlePDFIceRain, MS<:CloudMicrophysics.Parameters.ParticleMass})}), PP<:(CloudMicrophysics.Parameters.PrecipPhaseParams1M{RAI, SNO} where {RAI<:(CloudMicrophysics.Parameters.Rain{PD, MS, AR, VT} where {PD<:CloudMicrophysics.Parameters.ParticlePDFIceRain, MS<:CloudMicrophysics.Parameters.ParticleMass, AR<:CloudMicrophysics.Parameters.ParticleArea, VT<:CloudMicrophysics.Parameters.Ventilation}), SNO<:(CloudMicrophysics.Parameters.Snow{_A, PD, MS, AR, VT, AP} where {_A, PD<:CloudMicrophysics.Parameters.ParticlePDFSnow, MS<:CloudMicrophysics.Parameters.ParticleMass, AR<:CloudMicrophysics.Parameters.ParticleArea, VT<:CloudMicrophysics.Parameters.Ventilation, AP<:CloudMicrophysics.Parameters.SnowAspectRatio})}), AP<:CloudMicrophysics.Parameters.AirProperties, VL<:(CloudMicrophysics.Parameters.Blk1MVelType{R, S} where {R<:CloudMicrophysics.Parameters.Blk1MVelTypeRain, S<:CloudMicrophysics.Parameters.Blk1MVelTypeSnow})}), V<:(CloudMicrophysics.Parameters.TerminalVelocityParams{STOKES, CHEN, BLK1M} where {STOKES<:CloudMicrophysics.Parameters.StokesRegimeVelType, CHEN<:(CloudMicrophysics.Parameters.Chen2022VelType{R, SI, LI} where {R<:(CloudMicrophysics.Parameters.Chen2022VelTypeRain{FT, 3} where FT<:AbstractFloat), SI<:(CloudMicrophysics.Parameters.Chen2022VelTypeSmallIce{FT, 3, 4} where FT<:AbstractFloat), LI<:(CloudMicrophysics.Parameters.Chen2022VelTypeLargeIce{FT, 3} where FT<:AbstractFloat)}), BLK1M<:(CloudMicrophysics.Parameters.Blk1MVelType{R, S} where {R<:CloudMicrophysics.Parameters.Blk1MVelTypeRain, S<:CloudMicrophysics.Parameters.Blk1MVelTypeSnow})})})}
Return a OneMomentCloudMicrophysics microphysics scheme for warm-rain and mixed-phase precipitation.
The one-moment scheme uses CloudMicrophysics.jl 1M processes:
- Condensation/evaporation of cloud liquid (relaxation toward saturation)
- Autoconversion of cloud liquid to rain
- Accretion of cloud liquid by rain
- Terminal velocity for rain sedimentation
By default, non-equilibrium cloud formation is used, where cloud liquid is a prognostic variable that evolves via condensation/evaporation tendencies following Morrison and Grabowski (2008) (see Appendix A). The prognostic variables are ρqᶜˡ (cloud liquid mass density) and ρqʳ (rain mass density).
For equilibrium (saturation adjustment) cloud formation, pass:
using Breeze.Microphysicscloud_formation = SaturationAdjustment(equilibrium=WarmPhaseEquilibrium())# outputSaturationAdjustment{WarmPhaseEquilibrium, Breeze.Solvers.SecantSolver{Float64}}(WarmPhaseEquilibrium(), SecantSolver(reltol=0.0, abstol=0.0001, maxiter=20))Keyword arguments
categories: One-moment parameters and terminal velocities, typically built withone_moment_cloud_microphysics_categories.precipitation_boundary_condition: Controls whether precipitation passes through the bottom boundary.nothing(default): Rain exits through the bottom (open boundary)ImpenetrableBoundaryCondition(): Rain collects at the bottom (zero terminal velocity at surface)
See the CloudMicrophysics.jl documentation for details.
References
- Morrison, H. and Grabowski, W. W. (2008). A novel approach for representing ice microphysics in models: Description and tests using a kinematic framework. J. Atmos. Sci., 65, 1528–1548. https://doi.org/10.1175/2007JAS2491.1
BreezeCloudMicrophysicsExt.TwoMomentCategories — Type
TwoMomentCategories{W, AP, LV, RV, AA, TL}Parameters for two-moment (Seifert and Beheng, 2006) warm-rain microphysics.
Fields
warm_processes: Seifert and Beheng (2006) parameters bundling autoconversion, accretion, self-collection, breakup, evaporation, number adjustment, and size distribution parametersair_properties:AirPropertiesfor thermodynamic calculationscloud_liquid_fall_velocity:StokesRegimeVelTypefor cloud droplet terminal velocityrain_fall_velocity:SB2006VelTypeorChen2022VelTypeRainfor raindrop terminal velocityaerosol_activation:AerosolActivationparameters for cloud droplet nucleation (ornothingto disable)τⁿᵘᵐ: Timescale [s] for per-reservoir tendency limiting (default: 10)
References
- Abdul-Razzak, H. and Ghan, S.J. (2000). A parameterization of aerosol activation: 2. Multiple aerosol types. J. Geophys. Res., 105(D5), 6837-6844.
- Seifert, A. and Beheng, K. D. (2006). A two-moment cloud microphysics parameterization for mixed-phase clouds. Part 1: Model description. Meteorol. Atmos. Phys., 92, 45-66. https://doi.org/10.1007/s00703-005-0112-4
BreezeCloudMicrophysicsExt.TwoMomentCloudMicrophysics — Type
TwoMomentCloudMicrophysics(FT = Oceananigans.defaults.FloatType;
cloud_formation = NonEquilibriumCloudFormation(nothing, nothing),
categories = two_moment_cloud_microphysics_categories(FT),
precipitation_boundary_condition = nothing)Return a TwoMomentCloudMicrophysics microphysics scheme for warm-rain precipitation using the Seifert and Beheng (2006) two-moment parameterization.
The two-moment scheme tracks both mass and number concentration for cloud liquid and rain, using CloudMicrophysics.jl 2M processes:
- Aerosol activation: Creates cloud droplets when supersaturation develops (enabled by default)
- Condensation/evaporation of cloud liquid (relaxation toward saturation)
- Autoconversion of cloud liquid to rain (mass and number)
- Accretion of cloud liquid by rain (mass and number)
- Cloud liquid self-collection (number only)
- Rain self-collection and breakup (number only)
- Rain evaporation (mass and number)
- Number adjustment to maintain physical mean particle mass bounds
- Terminal velocities (number-weighted and mass-weighted)
Non-equilibrium cloud formation is used, where cloud liquid mass and number are prognostic variables that evolve via condensation/evaporation, aerosol activation, and microphysical tendencies.
The prognostic variables are:
ρqᶜˡ: cloud liquid mass density [kg/m³]ρnᶜˡ: cloud liquid number density [1/m³]ρqʳ: rain mass density [kg/m³]ρnʳ: rain number density [1/m³]
Aerosol Activation
Aerosol activation is enabled by default and provides the physical source term for cloud droplet number concentration. Without activation, cloud droplets cannot form. The default aerosol population represents typical continental conditions (~100 cm⁻³).
To customize the aerosol population, pass a custom categories with different aerosol_activation:
# Marine aerosol (fewer, more hygroscopic particles)marine_mode = CMAM.Mode_κ(0.08e-6, 1.8, 50e6, (1.0,), (1.0,), (0.058,), (1.0,))marine_activation = AerosolActivation( AerosolActivationParameters(Float64), CMAM.AerosolDistribution((marine_mode,)))categories = two_moment_cloud_microphysics_categories(aerosol_activation = marine_activation)microphysics = TwoMomentCloudMicrophysics(categories = categories)Keyword arguments
cloud_formation: Cloud formation scheme (default:NonEquilibriumCloudFormation)categories:TwoMomentCategoriescontaining SB2006 and aerosol activation parametersprecipitation_boundary_condition: Controls whether precipitation passes through the bottom boundary.nothing(default): Rain exits through the bottom (open boundary)ImpenetrableBoundaryCondition(): Rain collects at the bottom (zero terminal velocity at surface)
See the CloudMicrophysics.jl 2M documentation for details on the Seifert and Beheng (2006) scheme.
References
- Seifert, A. and Beheng, K. D. (2006). A two-moment cloud microphysics parameterization for mixed-phase clouds. Part 1: Model description. Meteorol. Atmos. Phys., 92, 45-66. https://doi.org/10.1007/s00703-005-0112-4
- Abdul-Razzak, H. and Ghan, S.J. (2000). A parameterization of aerosol activation: 2. Multiple aerosol types. J. Geophys. Res., 105(D5), 6837-6844.
BreezeCloudMicrophysicsExt.WarmPhaseOneMomentState — Type
WarmPhaseOneMomentState{FT} <: AbstractMicrophysicalState{FT}Microphysical state for warm-phase one-moment bulk microphysics.
Contains the local mixing ratios needed to compute tendencies for cloud liquid and rain. This state is used for both saturation adjustment and non-equilibrium cloud formation in warm-phase (liquid only) simulations.
Fields
qᶜˡ: Cloud liquid mixing ratio (kg/kg)qʳ: Rain mixing ratio (kg/kg)
BreezeCloudMicrophysicsExt.WarmPhaseTwoMomentState — Type
WarmPhaseTwoMomentState{FT, V} <: AbstractMicrophysicalState{FT}Microphysical state for warm-phase two-moment bulk microphysics.
Contains the local mixing ratios and number concentrations needed to compute tendencies for cloud liquid and rain following the Seifert-Beheng 2006 scheme.
Fields
qᶜˡ: Cloud liquid mixing ratio (kg/kg)nᶜˡ: Cloud liquid number per unit mass (1/kg)qʳ: Rain mixing ratio (kg/kg)nʳ: Rain number per unit mass (1/kg)nᵃ: Aerosol number per unit mass (1/kg)velocities: NamedTuple of velocity components(; u, v, w)[m/s]. The vertical velocitywis used for aerosol activation.
References
- Seifert, A. and Beheng, K. D. (2006). A two-moment cloud microphysics parameterization for mixed-phase clouds. Part 1: Model description. Meteorol. Atmos. Phys., 92, 45-66. https://doi.org/10.1007/s00703-005-0112-4
Breeze.AtmosphereModels.surface_precipitation_flux — Method
surface_precipitation_flux(
model,
microphysics::BulkMicrophysics{<:Any, <:BreezeCloudMicrophysicsExt.OneMomentCloudMicrophysicsCategories{<:CloudMicrophysics.Parameters.Microphysics1MParams, <:CloudMicrophysics.Parameters.TerminalVelocityParams}}
) -> Field{LX, LY, LZ, O, G, I, D, T, B, Oceananigans.Fields.FieldStatus{Float64}} where {LX, LY, LZ, O, G, I, D, T, B}
Return a 2D Field representing the precipitation flux at the bottom boundary.
The surface precipitation flux is $wʳ ρqʳ$ at k = 1 (bottom face), representing the rate at which rain mass leaves the domain through the bottom boundary.
Units: kg/m²/s (positive = downward, out of domain)
Breeze.AtmosphereModels.surface_precipitation_flux — Method
surface_precipitation_flux(
model,
microphysics::BulkMicrophysics{<:Any, <:BreezeCloudMicrophysicsExt.TwoMomentCategories{<:CloudMicrophysics.Parameters.SB2006, <:CloudMicrophysics.Parameters.AirProperties, <:CloudMicrophysics.Parameters.StokesRegimeVelType}}
) -> Field{LX, LY, LZ, O, G, I, D, T, B, Oceananigans.Fields.FieldStatus{Float64}} where {LX, LY, LZ, O, G, I, D, T, B}
Return a 2D Field representing the precipitation flux at the bottom boundary.
The surface precipitation flux is $wʳ ρqʳ$ at k = 1 (bottom face), representing the rate at which rain mass leaves the domain through the bottom boundary.
Units: kg/m²/s (positive = downward, out of domain)
BreezeCloudMicrophysicsExt.aerosol_activated_fraction — Method
aerosol_activated_fraction(aerosol_activation, aps, ρ, ℳ, 𝒰, constants)Compute the fraction of aerosol that activates given current thermodynamic conditions. Uses the maximum supersaturation to determine which aerosol modes activate.
BreezeCloudMicrophysicsExt.aerosol_activation_mass_tendency — Method
aerosol_activation_mass_tendency(aerosol_activation, aps, ρ, ℳ, 𝒰, constants)Compute the cloud liquid mass tendency from aerosol activation.
When aerosol particles activate to form cloud droplets, the newly formed droplets have a finite initial size given by the activation radius. This function computes the corresponding mass source term for cloud liquid water.
The activation radius is derived from Köhler theory:
\[r_{act} = \frac{2A}{3 S}\]
where $A = 2σ/(ρ_w R_v T)$ is the curvature parameter and $S$ is the instantaneous supersaturation. See eq. 19 in Abdul-Razzak et al. (1998).
The mass tendency is then:
\[\frac{\mathrm{d}q^{cl}}{\mathrm{d}t}_{act} = \frac{\mathrm{d}N^{cl}}{\mathrm{d}t}_{act} \frac{4}{3} π r_{act}^3 \frac{ρ_w}{ρ}\]
The activation rate is controlled by the nucleation timescale τⁿᵘᶜ stored in the AerosolActivation parameters (default: 1s).
Returns
Mass tendency for cloud liquid [kg/kg/s]
BreezeCloudMicrophysicsExt.cloud_ice_melting — Method
cloud_ice_melting(
cloud_ice::CloudMicrophysics.Parameters.CloudIce,
air_properties::CloudMicrophysics.Parameters.AirProperties,
qᶜⁱ,
ρ,
T,
Tᶠ,
constants
) -> Any
Compute melting of cloud ice to cloud liquid using Breeze thermodynamics.
BreezeCloudMicrophysicsExt.default_aerosol_activation — Function
default_aerosol_activation(FT = Float64; τⁿᵘᶜ = 1)Create a default AerosolActivation representing a typical continental aerosol population.
The default distribution is a single mode with:
- Mean dry radius: 0.05 μm (50 nm)
- Geometric standard deviation: 2.0
- Number concentration: 100 cm⁻³ (100 × 10⁶ m⁻³)
- Hygroscopicity κ: 0.5 (typical for ammonium sulfate)
Keyword arguments
τⁿᵘᶜ: Nucleation timescale [s] for converting activation deficit to rate (default: 1s). Controls how quickly the cloud droplet number relaxes toward the target activated number.
This provides sensible out-of-the-box behavior for two-moment microphysics. Users can customize the aerosol population by constructing their own AerosolActivation.
Example
# Use default aerosolmicrophysics = TwoMomentCloudMicrophysics()# Custom aerosol: marine (fewer, larger particles)marine_mode = CMAM.Mode_κ(0.08e-6, 1.8, 50e6, (1.0,), (1.0,), (0.058,), (1.0,))marine_aerosol = AerosolActivation( AerosolActivationParameters(Float64), CMAM.AerosolDistribution((marine_mode,)), 1 # τⁿᵘᶜ = 1s)microphysics = TwoMomentCloudMicrophysics(aerosol_activation = marine_aerosol)# Disable aerosol activation (not recommended)microphysics = TwoMomentCloudMicrophysics(aerosol_activation = nothing)BreezeCloudMicrophysicsExt.diffusional_growth_factor — Method
diffusional_growth_factor(
aps::CloudMicrophysics.Parameters.AirProperties{FT},
T,
constants
) -> Any
Compute the thermodynamic factor $G$ that controls the rate of diffusional growth of cloud droplets and rain drops.
The $G$ factor combines the effects of thermal conductivity and vapor diffusivity on phase change. It appears in the Mason equation for droplet growth:
\[\frac{\mathrm{d}m}{\mathrm{d}t} = 4π r G 𝒮\]
where $𝒮$ is supersaturation and $r$ is droplet radius.
This is a translation of CloudMicrophysics.Common.G_func_liquid using Breeze's thermodynamics instead of Thermodynamics.jl.
See Eq. (13.28) by Pruppacher & Klett (2010).
References
- Pruppacher, H. R., Klett, J. D. (2010). Microphysics of clouds and precipitation. Springer Netherlands. 2nd Edition
BreezeCloudMicrophysicsExt.ice_autoconversion_with_supersaturation — Method
ice_autoconversion_with_supersaturation(
option::CloudMicrophysics.Parameters.WithSupersaturation,
parameters::CloudMicrophysics.Parameters.Microphysics1MParams,
q::Breeze.Thermodynamics.MoistureMassFractions{FT},
qᶜⁱ,
ρ,
T,
Tᶠ,
constants
) -> Any
Compute supersaturation-dependent autoconversion of cloud ice to snow using Breeze thermodynamics.
BreezeCloudMicrophysicsExt.max_supersaturation_breeze — Method
max_supersaturation_breeze(aerosol_activation, aps, ρ, ℳ, 𝒰, constants)Compute the maximum supersaturation using the Abdul-Razzak and Ghan (2000) parameterization.
This is a translation of CloudMicrophysics.AerosolActivation.max_supersaturation that uses Breeze's thermodynamics instead of Thermodynamics.jl.
Arguments
aerosol_activation: AerosolActivation containing activation parameters and aerosol distributionaps: AirProperties (thermal conductivity, vapor diffusivity)ρ: Air density [kg/m³]ℳ: Microphysical state containing updraft velocity and number concentrations𝒰: Thermodynamic stateconstants: Breeze ThermodynamicConstants
Returns
Maximum supersaturation (dimensionless, e.g., 0.01 = 1% supersaturation)
References
- Abdul-Razzak, H. and Ghan, S.J. (2000). A parameterization of aerosol activation: 2. Multiple aerosol types. J. Geophys. Res., 105(D5), 6837-6844.
BreezeCloudMicrophysicsExt.one_moment_cloud_microphysics_categories — Function
one_moment_cloud_microphysics_categories(
;
...
) -> BreezeCloudMicrophysicsExt.OneMomentCloudMicrophysicsCategories{P, V} where {P<:(CloudMicrophysics.Parameters.Microphysics1MParams{OPT, CP, PP, AP, VL} where {OPT<:(CloudMicrophysics.Parameters.Microphysics1MOptions{CLF, CIF, CloudMicrophysics.Parameters.CloudIceMelt, RA, SA, CloudMicrophysics.Parameters.RainEvaporation, CloudMicrophysics.Parameters.DepositionAndSublimation, CloudMicrophysics.Parameters.SnowMelt, CLRA, CLSA, CIRA, CISA, RSA} where {CLF<:CloudMicrophysics.Parameters.CloudLiquidFormation, CIF<:CloudMicrophysics.Parameters.ConstantTimescale, RA<:(CloudMicrophysics.Parameters.Kessler1M{AC} where AC<:CloudMicrophysics.Parameters.Acnv1M), SA<:(CloudMicrophysics.Parameters.NoSupersaturation{AC} where AC<:CloudMicrophysics.Parameters.Acnv1M), CLRA<:CloudMicrophysics.Parameters.CloudLiquidRainAccretion, CLSA<:CloudMicrophysics.Parameters.CloudLiquidSnowAccretion, CIRA<:CloudMicrophysics.Parameters.CloudIceRainAccretion, CISA<:CloudMicrophysics.Parameters.CloudIceSnowAccretion, RSA<:CloudMicrophysics.Parameters.RainSnowAccretion}), CP<:(CloudMicrophysics.Parameters.CloudPhaseParams1M{LCL, ICL} where {LCL<:CloudMicrophysics.Parameters.CloudLiquid, ICL<:(CloudMicrophysics.Parameters.CloudIce{_A, PD, MS} where {_A, PD<:CloudMicrophysics.Parameters.ParticlePDFIceRain, MS<:CloudMicrophysics.Parameters.ParticleMass})}), PP<:(CloudMicrophysics.Parameters.PrecipPhaseParams1M{RAI, SNO} where {RAI<:(CloudMicrophysics.Parameters.Rain{PD, MS, AR, VT} where {PD<:CloudMicrophysics.Parameters.ParticlePDFIceRain, MS<:CloudMicrophysics.Parameters.ParticleMass, AR<:CloudMicrophysics.Parameters.ParticleArea, VT<:CloudMicrophysics.Parameters.Ventilation}), SNO<:(CloudMicrophysics.Parameters.Snow{_A, PD, MS, AR, VT, AP} where {_A, PD<:CloudMicrophysics.Parameters.ParticlePDFSnow, MS<:CloudMicrophysics.Parameters.ParticleMass, AR<:CloudMicrophysics.Parameters.ParticleArea, VT<:CloudMicrophysics.Parameters.Ventilation, AP<:CloudMicrophysics.Parameters.SnowAspectRatio})}), AP<:CloudMicrophysics.Parameters.AirProperties, VL<:(CloudMicrophysics.Parameters.Blk1MVelType{R, S} where {R<:CloudMicrophysics.Parameters.Blk1MVelTypeRain, S<:CloudMicrophysics.Parameters.Blk1MVelTypeSnow})}), V<:(CloudMicrophysics.Parameters.TerminalVelocityParams{STOKES, CHEN, BLK1M} where {STOKES<:CloudMicrophysics.Parameters.StokesRegimeVelType, CHEN<:(CloudMicrophysics.Parameters.Chen2022VelType{R, SI, LI} where {R<:(CloudMicrophysics.Parameters.Chen2022VelTypeRain{FT, 3} where FT<:AbstractFloat), SI<:(CloudMicrophysics.Parameters.Chen2022VelTypeSmallIce{FT, 3, 4} where FT<:AbstractFloat), LI<:(CloudMicrophysics.Parameters.Chen2022VelTypeLargeIce{FT, 3} where FT<:AbstractFloat)}), BLK1M<:(CloudMicrophysics.Parameters.Blk1MVelType{R, S} where {R<:CloudMicrophysics.Parameters.Blk1MVelTypeRain, S<:CloudMicrophysics.Parameters.Blk1MVelTypeSnow})})}
one_moment_cloud_microphysics_categories(
FT::DataType;
parameters,
hydrometeor_velocities,
freezing_temperature
) -> BreezeCloudMicrophysicsExt.OneMomentCloudMicrophysicsCategories{P, V} where {P<:(CloudMicrophysics.Parameters.Microphysics1MParams{OPT, CP, PP, AP, VL} where {OPT<:(CloudMicrophysics.Parameters.Microphysics1MOptions{CLF, CIF, CloudMicrophysics.Parameters.CloudIceMelt, RA, SA, CloudMicrophysics.Parameters.RainEvaporation, CloudMicrophysics.Parameters.DepositionAndSublimation, CloudMicrophysics.Parameters.SnowMelt, CLRA, CLSA, CIRA, CISA, RSA} where {CLF<:CloudMicrophysics.Parameters.CloudLiquidFormation, CIF<:CloudMicrophysics.Parameters.ConstantTimescale, RA<:(CloudMicrophysics.Parameters.Kessler1M{AC} where AC<:CloudMicrophysics.Parameters.Acnv1M), SA<:(CloudMicrophysics.Parameters.NoSupersaturation{AC} where AC<:CloudMicrophysics.Parameters.Acnv1M), CLRA<:CloudMicrophysics.Parameters.CloudLiquidRainAccretion, CLSA<:CloudMicrophysics.Parameters.CloudLiquidSnowAccretion, CIRA<:CloudMicrophysics.Parameters.CloudIceRainAccretion, CISA<:CloudMicrophysics.Parameters.CloudIceSnowAccretion, RSA<:CloudMicrophysics.Parameters.RainSnowAccretion}), CP<:(CloudMicrophysics.Parameters.CloudPhaseParams1M{LCL, ICL} where {LCL<:CloudMicrophysics.Parameters.CloudLiquid, ICL<:(CloudMicrophysics.Parameters.CloudIce{_A, PD, MS} where {_A, PD<:CloudMicrophysics.Parameters.ParticlePDFIceRain, MS<:CloudMicrophysics.Parameters.ParticleMass})}), PP<:(CloudMicrophysics.Parameters.PrecipPhaseParams1M{RAI, SNO} where {RAI<:(CloudMicrophysics.Parameters.Rain{PD, MS, AR, VT} where {PD<:CloudMicrophysics.Parameters.ParticlePDFIceRain, MS<:CloudMicrophysics.Parameters.ParticleMass, AR<:CloudMicrophysics.Parameters.ParticleArea, VT<:CloudMicrophysics.Parameters.Ventilation}), SNO<:(CloudMicrophysics.Parameters.Snow{_A, PD, MS, AR, VT, AP} where {_A, PD<:CloudMicrophysics.Parameters.ParticlePDFSnow, MS<:CloudMicrophysics.Parameters.ParticleMass, AR<:CloudMicrophysics.Parameters.ParticleArea, VT<:CloudMicrophysics.Parameters.Ventilation, AP<:CloudMicrophysics.Parameters.SnowAspectRatio})}), AP<:CloudMicrophysics.Parameters.AirProperties, VL<:(CloudMicrophysics.Parameters.Blk1MVelType{R, S} where {R<:CloudMicrophysics.Parameters.Blk1MVelTypeRain, S<:CloudMicrophysics.Parameters.Blk1MVelTypeSnow})}), V<:(CloudMicrophysics.Parameters.TerminalVelocityParams{STOKES, CHEN, BLK1M} where {STOKES<:CloudMicrophysics.Parameters.StokesRegimeVelType, CHEN<:(CloudMicrophysics.Parameters.Chen2022VelType{R, SI, LI} where {R<:(CloudMicrophysics.Parameters.Chen2022VelTypeRain{FT, 3} where FT<:AbstractFloat), SI<:(CloudMicrophysics.Parameters.Chen2022VelTypeSmallIce{FT, 3, 4} where FT<:AbstractFloat), LI<:(CloudMicrophysics.Parameters.Chen2022VelTypeLargeIce{FT, 3} where FT<:AbstractFloat)}), BLK1M<:(CloudMicrophysics.Parameters.Blk1MVelType{R, S} where {R<:CloudMicrophysics.Parameters.Blk1MVelTypeRain, S<:CloudMicrophysics.Parameters.Blk1MVelTypeSnow})})}
Return one-moment categories backed by CloudMicrophysics' unified Microphysics1MParams container.
Keyword arguments
parameters: CloudMicrophysics particle parameters and process options.hydrometeor_velocities: Terminal-velocity parameters for cloud condensate. Its rain and snow component is replaced withparameters.terminal_velocityso the two containers cannot diverge.freezing_temperature: Temperature used to route melting and freezing processes. Defaults to CloudMicrophysics' standard value, 273.15 K.
BreezeCloudMicrophysicsExt.rain_evaporation — Method
rain_evaporation(
::CloudMicrophysics.Parameters.Rain,
vel::CloudMicrophysics.Parameters.Blk1MVelTypeRain{FT},
aps::CloudMicrophysics.Parameters.AirProperties{FT},
q::Breeze.Thermodynamics.MoistureMassFractions{FT},
qʳ,
ρ,
T,
constants
) -> Any
Compute the rain evaporation rate (dqʳ/dt, negative for evaporation).
This is a translation of CloudMicrophysics.Microphysics1M.conv_q_rai_to_q_vap that uses Breeze's internal thermodynamics instead of Thermodynamics.jl.
Arguments
rain_params: Rain microphysics parameters (pdf, mass, vent)vel: Terminal velocity parametersaps: Air properties (kinematic viscosity, vapor diffusivity, thermal conductivity)q:MoistureMassFractionscontaining vapor, liquid, and ice mass fractionsqʳ: Rain specific humidityρ: Air densityT: Temperatureconstants: Breeze ThermodynamicConstants
Returns
Rate of change of rain specific humidity (negative = evaporation)
BreezeCloudMicrophysicsExt.rain_evaporation_2m — Method
rain_evaporation_2m(sb, aps, q, qʳ, ρ, Nʳ, T, constants)Compute the two-moment rain evaporation rate returning both number and mass tendencies.
This is a translation of CloudMicrophysics.Microphysics2M.rain_evaporation that uses Breeze's internal thermodynamics instead of Thermodynamics.jl.
Arguments
sb: SB2006 parameters containing pdf_r and evapaps: Air properties (kinematic viscosity, vapor diffusivity, thermal conductivity)q:MoistureMassFractionscontaining vapor, liquid, and ice mass fractionsqʳ: Rain specific humidity [kg/kg]ρ: Air density [kg/m³]Nʳ: Rain number concentration [1/m³]T: Temperature [K]constants: Breeze ThermodynamicConstants
Returns
Named tuple (; evap_rate_0, evap_rate_1) where:
evap_rate_0: Rate of change of number concentration [m⁻³ s⁻¹)], negative for evaporationevap_rate_1: Rate of change of mass mixing ratio [kg/kg/s], negative for evaporation
BreezeCloudMicrophysicsExt.snow_melting — Method
snow_melting(
::CloudMicrophysics.Parameters.Snow{FT},
vel::CloudMicrophysics.Parameters.Blk1MVelTypeSnow{FT},
aps::CloudMicrophysics.Parameters.AirProperties{FT},
qˢ,
ρ,
T,
Tᶠ,
constants
) -> Any
Compute the snow melting rate (dqˢ/dt due to melting, always non-negative).
Sensible-heat-driven melting: heat from warm air ($T > Tᶠ$) melts snow to rain. The rate is proportional to ($T - Tᶠ$) and includes ventilation corrections.
This is a translation of CloudMicrophysics.Microphysics1M.conv_q_sno_to_q_rai that uses Breeze's internal thermodynamics instead of Thermodynamics.jl.
Arguments
snow_params: Snow microphysics parameters (pdf, mass, vent)vel: Snow terminal velocity parametersaps: Air properties (kinematic viscosity, vapor diffusivity, thermal conductivity)qˢ: Snow specific humidityρ: Air densityT: TemperatureTᶠ: Freezing temperatureconstants: BreezeThermodynamicConstants
Returns
Rate of snow mass lost to melting [kg/kg/s] (always non-negative)
BreezeCloudMicrophysicsExt.snow_sublimation_deposition — Method
snow_sublimation_deposition(
::CloudMicrophysics.Parameters.Snow{FT},
vel::CloudMicrophysics.Parameters.Blk1MVelTypeSnow{FT},
aps::CloudMicrophysics.Parameters.AirProperties{FT},
q::Breeze.Thermodynamics.MoistureMassFractions{FT},
qˢ,
ρ,
T,
constants
) -> Any
Compute the snow sublimation/deposition rate (dqˢ/dt).
Positive values mean deposition (vapor → snow), negative means sublimation (snow → vapor). Unlike rain evaporation, both signs are physical for snow.
This is a translation of CloudMicrophysics.Microphysics1M.conv_q_sno_to_q_vap for snow that uses Breeze's internal thermodynamics instead of Thermodynamics.jl.
Arguments
snow_params: Snow microphysics parameters (pdf, mass, vent)vel: Snow terminal velocity parametersaps: Air properties (kinematic viscosity, vapor diffusivity, thermal conductivity)q:MoistureMassFractionscontaining vapor, liquid, and ice mass fractionsqˢ: Snow specific humidityρ: Air densityT: Temperatureconstants: Breeze ThermodynamicConstants
Returns
Rate of change of snow specific humidity (positive = deposition, negative = sublimation)
BreezeCloudMicrophysicsExt.temperature_dependent_ice_relaxation_timescale — Method
temperature_dependent_ice_relaxation_timescale(
cloud_ice::CloudMicrophysics.Parameters.CloudIce,
air_properties::CloudMicrophysics.Parameters.AirProperties,
frostenberg,
qᶜⁱ,
T
) -> Any
Return the cloud-ice deposition relaxation timescale for the CloudMicrophysics TemperatureDependent option.
This is a branch-free translation of CloudMicrophysics.MicrophysicsNonEq.τ_relax for use from Breeze GPU kernels.
BreezeCloudMicrophysicsExt.two_moment_cloud_microphysics_categories — Function
two_moment_cloud_microphysics_categories(FT = Oceananigans.defaults.FloatType;
warm_processes = SB2006(FT),
air_properties = AirProperties(FT),
cloud_liquid_fall_velocity = StokesRegimeVelType(FT),
rain_fall_velocity = SB2006VelType(FT),
aerosol_activation = default_aerosol_activation(FT))Construct TwoMomentCategories with default Seifert-Beheng 2006 parameters and aerosol activation.
Keyword arguments
warm_processes: Seifert-Beheng 2006 parameters for warm-rain microphysicsair_properties: Air properties for thermodynamic calculationscloud_liquid_fall_velocity: Terminal velocity parameters for cloud droplets (Stokes regime)rain_fall_velocity: Terminal velocity parameters for rain dropsaerosol_activation: Aerosol activation parameters (default: continental aerosol). Set tonothingto disable activation (not recommended for physical simulations).τⁿᵘᵐ: Timescale [s] for per-reservoir tendency limiting. Must satisfyτⁿᵘᵐ ≥ Δtto prevent reservoir overdraw. Default: 10 seconds.
References
- Seifert, A. and Beheng, K. D. (2006). A two-moment cloud microphysics parameterization for mixed-phase clouds. Part 1: Model description. Meteorol. Atmos. Phys., 92, 45-66. https://doi.org/10.1007/s00703-005-0112-4
BreezeCloudMicrophysicsExt.warm_accretion_melt_factor — Method
warm_accretion_melt_factor(T, Tᶠ, constants) -> Any
Compute the thermal melt factor for warm accretion processes.
When cloud liquid or rain collides with snow above freezing, the sensible heat carried by the warm hydrometeor melts additional snow. The factor $α$ gives the mass ratio of melted snow to accreted warm hydrometeor mass:
\[α = cˡ (T - Tᶠ) / ℒ_f\]
This is a translation of CloudMicrophysics.Microphysics1M.warm_accretion_melt_factor that uses Breeze's internal thermodynamics instead of Thermodynamics.jl.
Arguments
T: TemperatureTᶠ: Freezing temperatureconstants: BreezeThermodynamicConstants
Returns
Thermal melt factor α (zero when $T ≤ Tᶠ$)