Atmospheric_dynamics
- AnelasticMassContinuity
model
atmospheric_dynamics
clark1977
Anelastic mass continuity equation from Clark (1977), Eq. 2.4. The component forms the three density-weighted velocity components rho_u = ρ̄u, rho_v = ρ̄v, rho_w = ρ̄w from the base-state density ρ̄ and the velocity field (u, v, w), and computes the anelastic mass-continuity residual mass_continuity as the sum of the three externally-supplied density-weighted divergence terms ∂(ρ̄u)/∂x + ∂(ρ̄v)/∂y + ∂(ρ̄w)/∂z. The anelastic approximation constrains this residual to zero, filtering acoustic (sound) waves from the dynamics by replacing the geometric velocity divergence with the density-weighted one. Four purely-algebraic equations, no time integration. Migrated from AtmosphericDynamics.jl@816cc391 src/clark1977.jl:369 (`AnelasticMassContinuity` @component).
- AnelasticMomentum
model
atmospheric_dynamics
clark1977
Anelastic momentum equations from Clark (1977), 'A Small-Scale Dynamic Model Using a Terrain-Following Coordinate Transformation', Journal of Computational Physics 24, 186-215. A diagnostic (purely algebraic) component that evaluates the residuals of the three nonlinear anelastic momentum equations (Eqs. 2.1-2.3) in Cartesian coordinates. Given the velocity components (u, v, w), their material derivatives (du/dt, dv/dt, dw/dt), the perturbation-pressure gradients (∂p'/∂x, ∂p'/∂y, ∂p'/∂z), the base-state and perturbation densities (ρ̄, ρ'), the Reynolds-stress divergences ((∇·τ)₁, (∇·τ)₂, (∇·τ)₃), the Coriolis parameter f and the Rayleigh-friction time scale τ_R, it returns the three momentum-equation residuals mom_u, mom_v, mom_w. Each residual is the sum of the inertial term ρ̄·(dV/dt), the Coriolis term ρ̄·V·f (horizontal components only), the perturbation-pressure gradient, the negative Reynolds-stress divergence, the buoyancy term ρ'·g (vertical component only) and the negative Rayleigh-friction sink ρ̄·V/τ_R; the residual vanishes when the momentum balance is exactly satisfied. The model has 3 algebraic variables (no time integration), 3 equations and 17 parameters (1 physical constant + 16 inputs). All quantities are SI. Migrated from AtmosphericDynamics.jl@816cc391 src/clark1977.jl:282 (`AnelasticMomentum` @component).
- AnelasticThermodynamics
model
atmospheric_dynamics
clark1977
Anelastic thermodynamics equation (the first law of thermodynamics) with Smagorinsky turbulent heat flux, from Clark (1977), 'A Small-Scale Dynamic Model Using a Terrain-Following Coordinate Transformation'. Given the base-state air density rho_bar, the eddy heat diffusivity K_H, and the potential-temperature gradients, the component computes the three turbulent heat-flux components H1, H2, H3 = rho_bar*K_H*grad(theta) (Eq. 2.19), the heat-flux divergence term div_H = -div(H), and the residual of the anelastic thermodynamic equation rho_bar*dtheta/dt = -div(H) (Eq. 2.14) — which vanishes for an energy-conserving solution. Five purely-algebraic equations, no time integration. Migrated from AtmosphericDynamics.jl@816cc391 src/clark1977.jl:426 (`AnelasticThermodynamics` @component).
- AtmosphericDiffusion
model
atmospheric_dynamics
Atmospheric eddy-diffusivity and wind-profile parameterizations from Seinfeld & Pandis (2006) Ch. 18, Sec. 18.12. Given a height z above ground, the component computes the mean wind speed u_wind from a power-law profile (Eq. 18.118) and the vertical and horizontal eddy diffusivities K_zz, K_yy that govern turbulent transport of trace species in the planetary boundary layer. K_zz is selected by atmospheric stability from the Monin-Obukhov length L_MO: an unstable four-piece convective profile (Eq. 18.121, Lamb & Duran 1977), a neutral profile (Eq. 18.122, Myrup & Ranzieri 1976), or a stable profile (Eq. 18.125, Businger & Arya 1974). K_yy is 0.1*w_star*z_i under unstable conditions (Eq. 18.128) and equals K_zz otherwise. Three purely-algebraic equations, no time integration. Migrated from AtmosphericDynamics.jl@816cc391 src/atmospheric_diffusion.jl:30 (`AtmosphericDiffusion` @component).
- AtmosphericPressureProfile
model
atmospheric_dynamics
sp_ch1
Atmospheric pressure, density, and vertical pressure gradient as a function of altitude for an isothermal atmosphere. Couples the hydrostatic equation with the ideal gas law: the scale height H = R*T/(M_air*g) (Eq. 1.4) sets the e-folding altitude, the barometric formula p = p_0*exp(-z/H) (Eq. 1.5) gives pressure, the ideal gas law rho = M_air*p/(R*T) (Eq. 1.2) gives density, and the hydrostatic equation dpdz = -rho*g (Eqs. 1.1/1.3) gives the pressure gradient. Migrated from AtmosphericDynamics.jl@816cc391 src/seinfeld_pandis_ch1.jl:151 (`AtmosphericPressureProfile` @component). Implements Seinfeld & Pandis (2006) Chapter 1 Equations 1.1-1.5 for an isothermal atmosphere — the integrated, constant-scale-height form; a non-isothermal atmosphere would require numerical integration of Eq. 1.3. Parameterized as observed-only: altitude z and temperature T are inputs (parameters in standalone form, with R, M_air, g, p_0 as further parameter inputs carrying their upstream @constant values), and H, p, rho, dpdz are the four algebraic outputs. The upstream `5.3 AtmosphericPressureProfile Compilation` test compiles the component with `inputs = [app_nns.T]`, confirming T is an input.
- AtmosphericStability
model
atmospheric_dynamics
local_scale
Atmospheric static-stability diagnostics from Seinfeld & Pandis (2006) Ch. 16 (Meteorology of the Local Scale). Given the air temperature T and pressure p at a height z, the air temperature T_below one layer below, and the layer spacing delta_z, the component computes the potential temperature theta = T*(p_0/p)^(R_air/c_p) (Eq. 16.14), the actual temperature lapse rate dT_dz = (T - T_below)/delta_z, the potential-temperature gradient dtheta_dz = dT_dz + Gamma_d (Eqs. 16.16-16.18), and the static-stability parameter S = dtheta_dz: S > 0 stable, S = 0 neutral, S < 0 unstable. Four purely-algebraic equations, no time integration. Migrated from AtmosphericDynamics.jl@816cc391 src/local_scale_meteorology.jl:32 (`AtmosphericStability` @component).
- AtmosphericThermodynamics
model
atmospheric_dynamics
sp_ch1
Atmospheric thermodynamic profile for an isothermal atmosphere: given altitude and temperature it computes the scale height H = R*T/(M_air*g) (Eq. 1.4), the atmospheric pressure p = p_0*exp(-z/H) from the barometric formula (Eq. 1.5), the air density rho = M_air*p/(R*T) from the ideal gas law (Eq. 1.2), and the total molar concentration c_total = p/(R*T) (Eq. 1.7). Migrated from AtmosphericDynamics.jl@816cc391 src/seinfeld_pandis_ch1.jl:479 (`AtmosphericThermodynamics` @component). Implements Seinfeld & Pandis (2006) Chapter 1 Equations 1.2, 1.4, 1.5, 1.7. Despite the upstream docstring describing it as 'combining' equations from other components, the Julia @component is a flat model — it re-derives the four equations directly via `System(eqs, t; name)` with no MTK subsystems — so it is migrated here as a flat algebraic model (not subsystem-composed), mirroring the structurally identical sibling pressure_profile.esm. Parameterized as observed-only: altitude z and temperature T are inputs (parameters in standalone form, with R, M_air, g, p_0 as further parameter inputs carrying their upstream @constant values), and H, p, rho, c_total are the four algebraic outputs. The upstream `5.9 AtmosphericThermodynamics Compilation` test compiles the component with `inputs = [at_nns.T]`, confirming T is an input.
- BarometricFormula
model
atmospheric_dynamics
sp_ch1
Barometric formula for an isothermal atmosphere: p(z) = p_0 * exp(-z/H). Gives the pressure at altitude z from the sea-level pressure p_0 and the atmospheric scale height H. Migrated from AtmosphericDynamics.jl@816cc391 src/seinfeld_pandis_ch1.jl:201 (`BarometricFormula` @component). Implements Seinfeld & Pandis Ch 1 Eq. 1.5 — the integrated form of the hydrostatic equation for an isothermal atmosphere. Parameterized as observed-only: z, H, and p_0 are inputs (parameters in standalone form), pressure_ratio and p are the algebraic outputs.
- CarbonCycle
model
atmospheric_dynamics
global_cycles
Seven-reservoir model of the global carbon cycle from Schmitz (2002), as presented in Seinfeld & Pandis (2006) Ch. 22 (Global Cycles: Sulfur and Carbon), Table 22.1 and Fig. 22.6, pp. 1009-1015. Carbon is tracked as a mass (kg) in seven reservoirs — atmosphere (M1), warm ocean surface waters (M2), cool ocean surface waters (M3), deep ocean waters (M4), terrestrial biota (M5), soils and detritus (M6), and fossil fuel reserves (M7) — plus a dimensionless land-use-change scaling factor G that modulates biotic uptake (Eq. 22.21). Inter-reservoir transport uses first-order exchange coefficients k_ij (Table 22.1), except three nonlinear fluxes carried as auxiliary algebraic variables: the saturating atmosphere-to-biota photosynthetic uptake F15 (Eq. 22.19) and the carbonate-buffer power-law ocean-to-atmosphere outgassing fluxes F21 and F31 (Eq. 22.18). Three external forcing parameters drive the anthropogenic perturbation — fossil fuel emissions Ff, deforestation Fd, and reforestation Fr — all zero by default, recovering the preindustrial (~1850) steady state. The system is an 11-unknown ODE model (8 time-differentiated reservoir states M1-M7,G + 3 algebraic flux states F15/F21/F31) with 11 equations and 25 parameters (22 first-order/derived constants + 3 forcing fluxes). All quantities are SI (kg for mass, s for time); the source material's Pg C (1 Pg = 1e12 kg) and years (1 yr = 31557600 s) are converted to maintain unit consistency. Migrated from AtmosphericDynamics.jl@816cc391 src/global_cycles.jl:115 (`CarbonCycle` @component).
- Clark1977AnelasticSystem
model
atmospheric_dynamics
clark1977
Complete 3D anelastic atmospheric dynamics system in terrain-following coordinates from Clark (1977), 'A Small-Scale Dynamic Model Using a Terrain-Following Coordinate Transformation', Journal of Computational Physics 24, 186-215. The full nonlinear Clark (1977) model assembled as a hierarchical composition of eight subsystems: the isentropic base state (Eqs. 2.6-2.9), Witch-of-Agnesi mountain topography (Eq. 7.1), the terrain-following coordinate transformation (Eqs. 2.20-2.27), the Smagorinsky turbulence closure (Eqs. 2.15-2.19), the anelastic momentum residuals (Eqs. 2.1-2.3), anelastic mass continuity (Eq. 2.4), anelastic thermodynamics with turbulent heat flux (Eq. 2.14) and the diagnostic pressure equation (Section 4). Migrated from AtmosphericDynamics.jl@816cc391 src/clark1977.jl:582 (`Clark1977AnelasticSystem` @component) — a pure subsystem composition (`System(Equation[], t; systems=[...])`, no coupling equations): the eight subsystems are inlined verbatim under `subsystems` (ESS spec §4.7) and remain dynamically independent. Purely algebraic — every subsystem is a diagnostic (observed-only) system with no time derivative. SI units throughout.
- DiagnosticPressure
model
atmospheric_dynamics
clark1977
Diagnostic pressure equation for the anelastic atmosphere in terrain-following coordinates, from Clark (1977) "A Small-Scale Dynamic Model Using a Terrain-Following Coordinate Transformation", Section 4. Observed-only algebraic component: from the pressure-gradient-force divergences, the pressure-perturbation Laplacian terms, and a momentum-divergence source it computes the pressure-gradient-force divergence div_PF (with the terrain-following Jacobian factor G^(1/2) scaling the vertical term), the pressure Laplacian laplacian_p, and the diagnostic pressure equation residual pressure_residual (Eq. 4.2), which vanishes when the anelastic mass-continuity constraint is satisfied. Migrated from AtmosphericDynamics.jl@816cc391 src/clark1977.jl:499 (`DiagnosticPressure` @component); the upstream @constant g is declared as a fixed-default parameter.
- GeneralCirculation
model
atmospheric_dynamics
General circulation of the atmosphere — Coriolis parameter, tangential speed, geostrophic wind, and thermal-wind relations from Seinfeld & Pandis (2006) Chapter 21. Migrated from AtmosphericDynamics.jl@816cc391 src/general_circulation.jl:60 (`GeneralCirculation` @component).
- HoltslagBovilleLocalDiffusion
model
atmospheric_dynamics
holtslag_boville
Local boundary-layer diffusion scheme of Holtslag & Boville (1993) — eddy diffusivity from local gradients of wind and virtual potential temperature, via a height-dependent mixing length and a Richardson-number stability function. Migrated from AtmosphericDynamics.jl@816cc391 src/holtslag_boville_1993.jl:184 (`HoltslagBovilleLocalDiffusion` @component).
- HoltslagBovilleNonlocalABL
model
atmospheric_dynamics
holtslag_boville
Nonlocal atmospheric boundary-layer diffusion scheme of Holtslag & Boville (1993). Given the height z, boundary-layer depth h, friction velocity u_star, surface virtual heat flux wθ_v0, surface scalar flux wC_0, surface virtual potential temperature θ_v0 and Obukhov length L, it computes the convective velocity scale w_star, the φ_m/φ_h Monin-Obukhov similarity profiles, the momentum and scalar velocity scales w_m/w_t, the turbulent Prandtl number Pr, the eddy-diffusivity profile Kc = κ·w_t·z·(1−z/h)² and the countergradient nonlocal transport term γc. The nonlocal scheme represents transport by large convective eddies that the local scheme cannot. Migrated from AtmosphericDynamics.jl@816cc391 src/holtslag_boville_1993.jl:290 (`HoltslagBovilleNonlocalABL` @component); algebraic (observed-only) — the 7 inputs are parameters, the 14 turbulence quantities are algebraic state variables, no ODE integration.
- HoltslagBovilleSurfaceFlux
model
atmospheric_dynamics
holtslag_boville
Parameterized atmospheric-boundary-layer surface fluxes following Holtslag & Boville (1993), 'Local Versus Nonlocal Boundary-Layer Diffusion in a Global Climate Model', J. Climate 6, 1825-1842. A diagnostic (purely algebraic) bulk-aerodynamic scheme: from the lowest-model-level wind (u₁, v₁), the surface and lowest-level potential and virtual potential temperatures (θ₀/θ₁, θᵥ₀/θᵥ₁), and specific humidities (q₀, q₁), it computes the kinematic surface fluxes of momentum (wu₀, wv₀; Eqs. 2.1-2.2), heat (wθ₀; Eq. 2.3) and moisture (wq₀; Eq. 2.4). The stability-dependent exchange coefficients Cₘ and Cₕ (Eqs. 2.5-2.6) are the neutral coefficient Cₙ (Eq. 2.7, a logarithmic function of the roughness ratio) modulated by the stability functions fₘ and fₕ, which switch on the sign of the surface bulk Richardson number Ri₀ (Eq. 2.8): the unstable branch uses the Louis et al. (1982) forms (Eqs. 2.9-2.10) and the stable branch the Holtslag & Beljaars (1989) form (Eq. 2.11). The model has 11 algebraic variables (no time integration), 11 equations, and 15 parameters (4 physical constants + 11 inputs). All quantities are SI. Migrated from AtmosphericDynamics.jl@816cc391 src/holtslag_boville_1993.jl:35 (`HoltslagBovilleSurfaceFlux` @component).
- IdealGasLaw
model
atmospheric_dynamics
sp_ch1
Ideal gas law for atmospheric air density: rho = M_air * p / (R * T). Migrated from AtmosphericDynamics.jl@816cc391 src/seinfeld_pandis_ch1.jl:68 (`IdealGasLaw` @component). Implements Seinfeld & Pandis Ch 1 Eq 1.2. Parameterized as observed-only: T and p are inputs (parameters in standalone form), rho is the algebraic output. Upstream the Julia @component declares T and p as @variables for composition into a parent system; for standalone serialization (3 unknowns vs 1 equation otherwise), they are declared as parameters here, mirroring the WaterEquilibrium serialization pattern.
- IsentropicBaseState
model
atmospheric_dynamics
clark1977
Isentropic base-state atmosphere for the Clark (1977) terrain-following mountain-wave model, "A Small-Scale Dynamic Model Using a Terrain-Following Coordinate Transformation", Eqs. 2.6-2.9. The base state assumes a constant potential temperature Θ — the deep, isentropic reference atmosphere of Ogura and Phillips (1962) adopted in Clark (1977) Eq. 2.6 — and derives the height-dependent thermodynamic profiles that satisfy hydrostatic balance: from the reference potential temperature Θ, the surface pressure P_0, and the height above the surface z, the component computes the isentropic scale height H_s = c_p*Θ/g, the base-state temperature T_bar = Θ*(1 - z/H_s) (Eq. 2.7), the base-state pressure p_bar = P_0*(1 - z/H_s)^(c_p/R_d) (Eq. 2.8), and the base-state density ρ_bar = P_0/(R_d*Θ)*(1 - z/H_s)^(c_p/R_d - 1) (Eq. 2.9). Temperature falls linearly with height while pressure and density fall as powers of the same (1 - z/H_s) factor, all three vanishing at the top of the isentropic atmosphere z = H_s. Four purely-algebraic equations, no time integration. Migrated from AtmosphericDynamics.jl@816cc391 src/clark1977.jl:49 (`IsentropicBaseState` @component); the five upstream @constants — g, R_d, c_p and the derived exponents inv_kappa = c_p/R_d and inv_kappa_m1 = c_p/R_d - 1 — are declared as fixed-default parameters.
- LocalScaleMeteorology
model
atmospheric_dynamics
local_scale
Local-scale boundary-layer meteorology from Seinfeld & Pandis (2006) "Atmospheric Chemistry and Physics", 2nd ed., Chapter 16 "Meteorology of the Local Scale". A flat observed-only algebraic component that combines atmospheric static-stability analysis, Monin-Obukhov surface-layer similarity theory and Pasquill stability-class estimation: from the air temperature and pressure, the surface-layer geometry, the friction velocity u_star and the surface sensible heat flux q_z it computes the potential temperature θ (Eq. 16.14), the actual and potential-temperature lapse rates dT_dz and dθ_dz (Eqs. 16.16-16.18), the Monin-Obukhov length L and its inverse L_inv (Eq. 16.70), the stability parameter ζ = z/L, the Businger-Dyer stability functions φ_m, φ_h and their integrated forms ψ_m, ψ_h (Eqs. 16.75, 16.78-16.79), the stability-corrected mean wind speed ū (Eq. 16.66) and the Pasquill stability class (1=A to 6=F) via the Golder (1972) correlation (Eq. 16.83). Twelve purely-algebraic equations, no time integration. Migrated from AtmosphericDynamics.jl@816cc391 src/local_scale_meteorology.jl:234 (`LocalScaleMeteorology` @component).
- MixingRatio
model
atmospheric_dynamics
sp_ch1
Volume (mole) mixing ratio of an atmospheric species: xi = c_i / c_total, the ratio of the species molar concentration to the total molar concentration of air. Migrated from AtmosphericDynamics.jl@816cc391 src/seinfeld_pandis_ch1.jl:278 (`MixingRatio` @component). Implements Seinfeld & Pandis (2006) Chapter 1 Equation 1.6. The mixing ratio is dimensionless (stored with unit 1) and in the atmosphere spans roughly twelve orders of magnitude — from ~0.78 for the dominant gas N2 down to parts-per-trillion (~1e-12) trace species — so it is conventionally quoted in ppm, ppb, or ppt. Parameterized as observed-only: c_i and c_total are inputs (parameters in standalone form), xi is the algebraic output. Upstream the Julia @component declares c_i, c_total, and xi as @variables for composition into a parent system; for standalone serialization (3 unknowns vs 1 equation otherwise) c_i and c_total are declared as parameters here, mirroring the IdealGasLaw / ScaleHeight / RelativeHumidity serialization pattern in this directory.
- PartialPressureMixingRatio
model
atmospheric_dynamics
sp_ch1
Relates the volume mixing ratio of an atmospheric species to its partial pressure: xi = p_i / p (Seinfeld & Pandis, Atmospheric Chemistry and Physics, Ch. 1, Eq. 1.8). The mixing ratio equals the ratio of the species' partial pressure to the total atmospheric pressure. Migrated from AtmosphericDynamics.jl@816cc391 src/seinfeld_pandis_ch1.jl:308 (`PartialPressureMixingRatio` @component). Parameterized as observed-only: the partial pressure p_i and total pressure p are inputs (parameters in standalone form), xi is the algebraic output. Upstream the Julia @component declares p_i, p, and xi as @variables for composition into a parent system; for standalone serialization (3 unknowns vs 1 equation otherwise), p_i and p are declared as parameters here, mirroring the IdealGasLaw / ScaleHeight serialization pattern in the same module.
- RelativeHumidity
model
atmospheric_dynamics
sp_ch1
Relative humidity from water-vapor partial pressure and saturation vapor pressure: RH = 100 * p_H2O / p_sat. Migrated from AtmosphericDynamics.jl@816cc391 src/seinfeld_pandis_ch1.jl:397 (`RelativeHumidity` @component). Implements Seinfeld & Pandis Ch 1 Eq. 1.9. Relative humidity is expressed as a percentage (0-100 for subsaturated air, >100 under transient supersaturation), stored as a dimensionless ratio scaled by 100. Parameterized as observed-only: p_H2O and p_sat are inputs (parameters in standalone form), RH is the algebraic output. Upstream the Julia @component declares p_H2O and p_sat as @variables for composition into a parent system; for standalone serialization (3 unknowns vs 1 equation otherwise), they are declared as parameters here, mirroring the IdealGasLaw / ScaleHeight serialization pattern in this directory.
- SaturationVaporPressure
model
atmospheric_dynamics
sp_ch1
Saturation vapor pressure of water over liquid water as a function of temperature: p_sat = p_std * exp(c1*a - c2*a^2 - c3*a^3 - c4*a^4) with a = 1 - T_boil/T (Seinfeld & Pandis Eq. 1.10). An empirical fit valid for liquid water (T > 273 K). Migrated from AtmosphericDynamics.jl@816cc391 src/seinfeld_pandis_ch1.jl:351 (`SaturationVaporPressure` @component). Algebraic (observed-only): T is an input parameter; a and p_sat are algebraic state outputs fixed by two explicit equations. Pressure is reported in Pa (the upstream module uses P_0 = 101325 Pa = 1013.25 mbar).
- ScaleHeight
model
atmospheric_dynamics
sp_ch1
Atmospheric scale height H = R*T/(M_air*g) — the altitude increase over which atmospheric pressure decreases by a factor of e (~2.718) for an isothermal atmosphere. Migrated from AtmosphericDynamics.jl@816cc391 src/seinfeld_pandis_ch1.jl:109 (`ScaleHeight` @component). Implements Seinfeld & Pandis Eq. 1.4. Parameterized as observed-only: T is an input parameter, H is the algebraic observed output.
- SfclayRev
model
atmospheric_dynamics
sfclayrev
WRF's revised MM5 surface-layer scheme (sf_sfclay_physics = 1; Jimenez et al. 2012), transcribed from the CCPP kernel sf_sfclayrev_run of phys/physics_mmm/sf_sfclayrev.F90 (WRF 4.8, NCAR/MMM-physics 550b5b4 with the kind-generic fixes of the ctessum-claude fork 52cfbd7). The scheme is a diagnostic (time-step-free) Monin-Obukhov surface layer for one grid column: from the lowest-model-level state (u, v, T, qv, p, layer thickness), the surface pressure and skin temperature, the surface type and the previous step's roughness, friction velocity, temperature scale and surface humidity it computes (1) the potential, virtual and surface saturation quantities; (2) an effective wind speed that adds the Beljaars (1994) convective velocity over land or the Wyngaard form over water and the Mahrt and Sun (1995) subgrid velocity; (3) the bulk Richardson number Ri_b = g za (theta_v1 - theta_vs)/(theta_1 |U|^2), which fixes the stability regime (1 stable, 3 neutral, 4 unstable); (4) the stability parameter zol = za/L by inverting Ri_b = zol psi_h(zol)/psi_m(zol)^2 with the Jimenez et al. (2012) integrated similarity functions (Cheng-Brutsaert stable, Kansas/free-convection unstable), which the kernel does with a secant iteration stopped at 0.01 (bulk_richardson_zol.esm: transcribed step by step as one recurrence over the 33-cell index set secant_steps because the stopping rule leaves zol up to 8e-5 relative from the exact root), or from the first guess zol = Ri_b ln((za+z0)/z0) when the previous friction velocity is below 1 mm/s; (5) the integrated stability corrections psi_m, psi_h between z0 (or the thermal/moisture roughness z0t, z0q over water and for iz0tlnd > 0 over land) and the first level, 2 m and 10 m; (6) the friction velocity u* = k |U|/psi_m relaxed 50/50 against the previous value, the temperature scale mol = k (theta_1 - theta_s)/psi_h, the 2 m and 10 m diagnostics and the drag/exchange coefficients ck, cka, cd, cda; and (7), when surface fluxes are enabled (isfflx), the updated sea-surface roughness (Charnock + smooth flow, AHW, or Jimenez-Dudhia shallow water), the exchange coefficients flhc, flqc, chs, chs2, cqs2 and the sensible, latent and moisture fluxes. Every quantity is a scalar observed; the only array is the secant recurrence. Constants: lib/wrf_constants.esm as subsystem wrf; scheme constants sfclayrev_parameters.esm as subsystem par (note the kernel receives real32 copies of the WRF constants, g = 9.8100004, karman = 0.40000001, ep1 = 0.60836244, svp1 = 0.61119998, and its literals are default-real, which bounds the agreement of a real64 build with this component at about 1e-7 relative -- FORTRAN_BUGS.md N2, N10). Previous-step inputs are named *_in (WRF intent(inout) arguments read before being overwritten: znt, ust, mol, qsfc, hfx, qfx, ustm, chs, chs2, cqs2). Option flags are numeric parameters (isfflx, shalwater_z0, scm_force_flux as 0/1; isftcflx, iz0tlnd as 0/1/2). NOT transcribed: the KIM turbulent orographic form drag (if_kim_tofd), whose Fortran uses the uninitialised variable dx_factor on its own right-hand side (FORTRAN_BUGS.md B3), so cf = 0; the optional TKE-coupling ustm is included. lh is xlv qfx always, whereas the kernel leaves lh unassigned when isfflx is false or scm_force_flux is true (FORTRAN_BUGS.md N11). The 0.9 ln((z+z0)/z0) caps that the kernel applies to psi_m, psi_h, psi_h2, psi_m10, psi_h10 in the unstable regime only are applied unconditionally here, which is equivalent because the stable and neutral corrections are non-positive. Regime selection by the sign of zol inside the profile templates is equivalent to the kernel's selection by the sign of Ri_b because zol has the sign of Ri_b or is zero.
- SfclayRevParameters
model
atmospheric_dynamics
sfclayrev
Scheme constants of WRF's revised MM5 surface-layer scheme (sf_sfclay_physics = 1, `sf_sfclayrev_run` in phys/physics_mmm/sf_sfclayrev.F90, WRF 4.8 / NCAR MMM-physics; Jimenez et al. 2012), transcribed from the module `parameter` declarations and the in-line literals of the kernel so that no tuning constant is written inline in the physics. Mounted by the SfclayRev component as subsystem `par`. Values are the nominal (decimal) values written in the Fortran source. The coefficients of the similarity functions themselves (Cheng-Brutsaert 6.1/2.5 and 5.3/1.1, Kansas 16, free-convection 10/34 and the 0.33 exponent) and the psi lookup-table discretisation (step 0.01, 1000 nodes) are properties of the published functions, not tuning constants, and live with the functions in similarity_functions.esm. NOTE (FORTRAN_BUGS.md N2/N10): the kernel's literals are default-real, so a real64 build runs with their single-precision roundings (e.g. 1/2.5 = 0.4000000059604645, sqrt(3.) and atan(1.) evaluated in real32, the lookup-table nodes float(n)*0.01 rounded to real32); the SfclayRev tests document the resulting O(1e-7) relative mismatch in their tolerances rather than reproducing the rounding here.
- SmagorinskyTurbulence
model
atmospheric_dynamics
clark1977
Smagorinsky (1963) subgrid-scale turbulence closure as used in Clark (1977), 'A Small-Scale Dynamic Model Using a Terrain-Following Coordinate Transformation', J. Comput. Phys. 24, 186-215. A diagnostic (purely algebraic) eddy-viscosity scheme: from the six independent components of the resolved-flow deformation tensor (D11, D22, D33, D12, D13, D23; Eq. 2.16) and the grid filter width Δ_grid it computes the total deformation magnitude |Def| (Eq. 2.18), the Smagorinsky eddy viscosity coefficient K_M = (k·Δ)²·|Def| (Eq. 2.17), and the turbulent heat diffusivity K_H, which Clark sets equal to the eddy viscosity (Eq. 2.19, unit turbulent Prandtl number). The model has 3 algebraic variables (no time integration), 3 equations, and 9 parameters (2 physical constants — the Smagorinsky constant k = 0.25 and a unit reference deformation rate — plus 7 inputs). All quantities are SI. Migrated from AtmosphericDynamics.jl@816cc391 src/clark1977.jl:214 (`SmagorinskyTurbulence` @component).
- SurfaceLayerProfile
model
atmospheric_dynamics
local_scale
Monin-Obukhov surface-layer similarity theory for the atmospheric surface layer, from Seinfeld & Pandis (2006) "Atmospheric Chemistry and Physics", 2nd ed., Chapter 16 "Meteorology of the Local Scale". Observed-only algebraic component: from the friction velocity u_star, surface sensible heat flux q_z, and surface-layer geometry it computes the Monin-Obukhov length L (Eq. 16.70), the dimensionless stability parameter ζ = z/L, the Businger-Dyer stability functions φ_m and φ_h (Eq. 16.75), their integrated forms ψ_m and ψ_h (Eq. 16.78-16.79), and the stability-corrected mean wind speed ū (Eq. 16.66 with the Eq. 16.77 correction). Migrated from AtmosphericDynamics.jl@816cc391 src/local_scale_meteorology.jl:107 (`SurfaceLayerProfile` @component); the 4 upstream @constants (g, κ, ĉ_p, ε_q) are declared as fixed-default parameters.
- TerrainFollowingTransform
model
atmospheric_dynamics
clark1977
Terrain-following coordinate transformation from Clark (1977) "A Small-Scale Dynamic Model Using a Terrain-Following Coordinate Transformation", Eqs. 2.20-2.23 and 2.27. Observed-only algebraic component: from the terrain surface height z_s, the domain height H, the transformed vertical coordinate z_bar, and the two terrain slopes dz_s_dx and dz_s_dy it computes the transformation Jacobian G^(1/2) = 1 - z_s/H (G_sqrt), the two metric coefficients G^(1/2)G^13 and G^(1/2)G^23 that carry the terrain slope into the transformed equations (G_sqrt_G13, G_sqrt_G23), the physical height z_phys recovered from z_bar (the inverse of the mapping z_bar = H(z - z_s)/(H - z_s)), and the diagnostic Jacobian factor ω_diag used to recover the contravariant vertical velocity ω (Eq. 2.27). The transformation maps the irregular lower boundary z = z_s(x,y) to the flat computational surface z_bar = 0 while preserving the rigid lid z = H at z_bar = H. Migrated from AtmosphericDynamics.jl@816cc391 src/clark1977.jl:157 (`TerrainFollowingTransform` @component).
- TotalMolarConcentration
model
atmospheric_dynamics
sp_ch1
Total molar concentration of air from the ideal gas law: c_total = N/V = p / (R * T) (Seinfeld & Pandis Eq. 1.7). Migrated from AtmosphericDynamics.jl@816cc391 src/seinfeld_pandis_ch1.jl:244 (`TotalMolarConcentration` @component). Algebraic (observed-only): T and p are input parameters; c_total is the algebraic output fixed by one explicit equation. Upstream the Julia @component declares T and p as @variables for composition into a parent system; for standalone serialization (3 unknowns vs 1 equation otherwise), they are declared as parameters here, mirroring the sibling ideal_gas.esm / sat_vapor_pressure.esm pattern.
- WaterVaporThermodynamics
model
atmospheric_dynamics
sp_ch1
Composite water-vapor thermodynamics system from Seinfeld & Pandis (2006) Chapter 1: given air temperature and water-vapor partial pressure it computes the saturation vapor pressure of water over liquid water (Eq. 1.10) and the relative humidity (Eq. 1.9). Migrated from AtmosphericDynamics.jl@816cc391 src/seinfeld_pandis_ch1.jl:433 (`WaterVaporThermodynamics` @component), which composes two MTK subsystems via `System(eqs, t; systems=[sat, rh])`. Represented here as a subsystem-composed ESS model (spec §4.7): the `sat` subsystem inlines the already-migrated SaturationVaporPressure component (sat_vapor_pressure.esm, esm-zuku) and the `rh` subsystem inlines RelativeHumidity (relative_humidity.esm, esm-vann), wired together by five top-level coupling equations. Algebraic (observed-only): T and p_H2O are input parameters; p_sat and RH are algebraic state outputs. The flattened chain T -> sat.a -> sat.p_sat -> rh.p_sat -> rh.RH is fully explicit and triangular.
- WitchOfAgnesi
model
atmospheric_dynamics
clark1977
"Witch of Agnesi" bell-shaped mountain topography from Clark (1977) "A Small-Scale Dynamic Model Using a Terrain-Following Coordinate Transformation", Equation 7.1 — the canonical idealized terrain for mountain-wave simulations. Algebraic component: from the mountain half-width a, peak height h_mtn, and horizontal position x relative to the mountain center it computes the terrain surface height z_s = a^2 h_mtn / (a^2 + x^2) (Eq. 7.1) and the terrain slope dz_s_dx = d(z_s)/dx. Migrated from AtmosphericDynamics.jl@816cc391 src/clark1977.jl:107 (`WitchOfAgnesi` @component); z_s and dz_s_dx are upstream `@variables` bound by algebraic equations and migrate as state-typed variables.
- WSM6ColdAccretion
model
atmospheric_dynamics
wsm6
Collection (accretion) process rates between the six water species of the WRF single-moment 6-class microphysics scheme below and above freezing (WSM6; Hong and Lim 2006 appendix A; Lin et al. 1983; Rutledge and Hobbs 1983, 1984), transcribed from the cold-rain block of mp_wsm6_run in phys/physics_mmm/mp_wsm6.F90 (WRF 4.8, NCAR/MMM-physics): accretion of cloud ice by rain (praci), of rain by cloud ice (piacr), of cloud ice by snow (psaci) and by graupel (pgaci) -- all only below 0 C --, of cloud water by snow (psacw) and by graupel (pgacw) and their snow/graupel-weighted combination (paacw), of snow by rain (pracs, below 0 C), of rain by snow (psacr) and by graupel (pgacr), the eliminated snow-by-graupel term (pgacs = 0 since WRF V3.0, when snow and graupel received a common fall speed), and the enhanced melting of snow and graupel above 0 C by the sensible heat of the liquid water they collect (pseml, pgeml). Each collection rate is the geometric sweep-out of one species by another: pi/4 n0 |V_a - V_b| times a size-distribution kernel (collection_kernel_* templates) times the collected mixing ratio, with the collection efficiencies (eacrs = exp(-0.07 (T0 - T)) for ice, 1 for water) and WSM6's empirical reduction min(max(0, q_collector/q_collected), 1)^2 folded into the UNLIMITED rate because they are functions of the state alone. The kernel additionally applies per-process time-step limiters (a sink may not remove more than q/dtcld per sub-step; pseml/pgeml are also floored at zero), exposed separately as <rate>_lim with the sub-step length dtcld as a parameter -- time-step artefacts, not physics (EqWeFiC FORTRAN_BUGS.md note N3); the mass-conservation rescaling applied afterwards is not part of this component. The size distributions, number concentrations and fall speeds are supplied by hydrometeor_slopes.esm mounted as subsystem `sd` (referenced as sd.<name>), exactly as the kernel evaluates them once per sub-step and reuses them here; cloud water qc and the sub-step dtcld are this component's own inputs. Scheme constants come from wsm6_parameters.esm (subsystem `par`), physical constants from lib/wrf_constants.esm (`wrf`). Consumer-supplied inputs are the rewrite-target ops `input_<name>` lowered in the inline tests through a per-test template library extracted from kernel dumps of the instrumented WRF fork ctessum-claude/WRF, commit e42a269 (v4.8.0-2-ge42a269e) (esm-spec 6.6 parameter_overrides admit scalars only). EqWeFiC, cited here for FORTRAN_BUGS.md and couplings/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.
- WSM6HydrometeorSlopes
model
atmospheric_dynamics
wsm6
Size-distribution and fall-speed diagnostics of the WRF single-moment 6-class microphysics scheme (WSM6; Hong and Lim 2006), transcribed from slope_wsm6 and the cold-rain preamble of mp_wsm6_run in phys/physics_mmm/mp_wsm6.F90 (WRF 4.8, NCAR/MMM-physics): the temperature-dependent snow intercept factor n0s(T)/n0s (HDC 2004 eq. 6), the inverse slopes lambda^-1 of the exponential rain, snow and graupel distributions and their powers lambda^-b, lambda^-2, lambda^-3 (held at 1/lambda_max below the threshold qcrmin), the diagnosed ice crystal number concentration N_i (HDC eq. 5c), mean ice crystal diameter D_i (HDC eq. 5b) and fall speed V_i (HDC eq. 5a), the mass-weighted fall speeds of rain, snow and graupel V = a Gamma(4+b)/6 lambda^-b (rho0/rho)^(1/2), the ventilation coefficients precs1/2 and precg1/2 of the snow and graupel distributions (mp_wsm6_init products shared by deposition, evaporation and melting), and the combined snow/graupel fall speed WSM6 uses since V3.0. Everything is a pointwise function of the layer state on the layer index `lev` (WRF k, layer 1 at the surface). It also holds the transport properties of air at T and p (kinematic viscosity, vapor diffusivity, thermal conductivity; lib/wrf_air_properties.esm), the ventilation factor (WSM6 work2) and the ventilation moments coeres of rain, snow and graupel. The process-rate components (warm_rain.esm, cold_accretion.esm, ice_deposition.esm) mount this component as subsystem `sd` and take all of these from it, mirroring how the kernel computes them once per sub-step (slope_wsm6) and reuses them in every process; melting_freezing.esm evaluates the same templates at its own, earlier state. Scheme constants come from wsm6_parameters.esm (subsystem `par`) and physical constants from lib/wrf_constants.esm (subsystem `wrf`). Consumer-supplied inputs are the rewrite-target ops `input_<name>` lowered in the inline tests through a per-test template library extracted from kernel dumps of the instrumented WRF fork ctessum-claude/WRF, commit e42a269 (v4.8.0-2-ge42a269e). EqWeFiC, cited here for FORTRAN_BUGS.md and couplings/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.
- WSM6IceDeposition
model
atmospheric_dynamics
wsm6
Vapor-exchange and conversion process rates of the ice phase of the WRF single-moment 6-class microphysics scheme (WSM6; Hong and Lim 2006; Hong, Dudhia and Chen 2004), transcribed from the cold-rain block of mp_wsm6_run in phys/physics_mmm/mp_wsm6.F90 (WRF 4.8, NCAR/MMM-physics): deposition/sublimation of vapor on cloud ice (pidep, HDC eq. 9), snow (psdep, HDC eq. 14) and graupel (pgdep, HL A21) below 0 C; ice nucleation from vapor (pigen, HDC eqs. 7-8); aggregation of ice to snow (psaut, HDC eq. 12) and of snow to graupel (pgaut, LFO eq. 37); and evaporation of melting snow (psevp, HL A35) and graupel (pgevp, HL A25) above 0 C. The UNLIMITED rates are the physics: pidep = 4 D_i N_i (rh_i - 1)/F_i, psdep/pgdep/psevp/pgevp the ventilated diffusional growth (rh - 1)(c1 lambda^-2 + c2 f_v coeres)/F, pgaut = alpha2(T) max(0, qs - qs0). Two processes are instantaneous adjustments that the kernel writes as rates: nucleation relaxes the ice content to the target q_i0(T) = 4.92e-11 N_i0(T)^1.33/rho and ice-to-snow aggregation removes the excess of q_i over q_imax = 2.08e22 D_max^8/rho; here the physical quantities are the targets q_i0 and q_imax (observeds qi_nucleation_target, qi_max) and the rates pigen, psaut carry the sub-step dtcld as a parameter (EqWeFiC FORTRAN_BUGS.md N3). WSM6 limits the deposition processes SEQUENTIALLY against the vapor budget: after the rain evaporation prevp of the warm-rain block (an INPUT here, from warm_rain.esm), each of pidep, psdep, pgdep may take at most half the supersaturation over ice per sub-step (satdt/2) and at most what the earlier processes left (supice), a sublimating species may not lose more than it holds, and once the running sum of the limited rates reaches satdt the flag ifsat closes the remaining processes and the nucleation; that chain is transcribed pointwise as the <rate>_lim observeds and the ifsat_* indicators, all time-step artefacts kept apart from the physics. The saturation state over water and ice (qsat_w, rh_w, qsat_i, rh_i, xl) is an INPUT from saturation.esm evaluated at the start of the sub-step (EqWeFiC FORTRAN_BUGS.md N4); the size distributions, N_i, D_i come from hydrometeor_slopes.esm mounted as subsystem `sd`; the deposition coefficients precs1/2, precg1/2, the transport properties of air, the ventilation factor and the ventilation moments live there too; the diffusional-growth denominators over water and ice are computed here with the same template as warm_rain.esm. Constants: wsm6_parameters.esm (`par`), lib/wrf_constants.esm (`wrf`). Consumer-supplied inputs are the rewrite-target ops `input_<name>` lowered in the inline tests through a per-test template library extracted from kernel dumps of the instrumented WRF fork ctessum-claude/WRF, commit e42a269 (v4.8.0-2-ge42a269e). EqWeFiC, cited here for FORTRAN_BUGS.md and couplings/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.
- WSM6MassConservation
model
atmospheric_dynamics
wsm6
Mass-conservation rescaling of the WSM6 process rates and the state update it feeds, transcribed from the block 'check mass conservation of generation terms and feedback to the large scale' of mp_wsm6_run (phys/physics_mmm/mp_wsm6.F90, WRF 4.8 NCAR/MMM-physics). The process rates of warm_rain.esm, cold_accretion.esm and ice_deposition.esm each carry their OWN limiter (a single process may not drain more than q/dtcld), but nothing stops the SUM of the processes draining one species from overdrawing it within a sub-step; WSM6 therefore walks the five species budgets in the fixed order cloud water, cloud ice, rain, snow, graupel (four in the warm branch: cloud water, rain, snow, graupel) and, whenever the total sink S of a species over one sub-step exceeds the mass v = max(q_floor, q) available, multiplies EVERY rate entering that budget by v/S. The factors are written branch-free as v/max(S, v) (microphysics_templates.esm mass_conservation_factor), which is 1 for a budget that is not overdrawn and for a net source. Because the blocks run in sequence, a rate that appears in several budgets is scaled once per budget, so its final value is the raw rate times the PRODUCT of the factors of the species whose budgets it drains -- praut = praut_raw f_qc f_qr, paacw = paacw_raw f_qc f_qs f_qg, piacr = piacr_raw f_qr f_qs f_qg, and so on -- which is how the cascade is written here, one factor per species instead of one rescaled copy per block. This is a TIME-STEP ARTEFACT of the explicit operator splitting, not physics: every factor depends on dtcld and all of them are 1 in the dtcld -> 0 limit (EqWeFiC FORTRAN_BUGS.md note N3). The same block then applies the rescaled rates to the state ('feedback to the large scale'): the vapor tendency dqv_dt (WSM6 work2), the latent-heating tendency dT_dt (WSM6 -xlwork2/cpm, with the latent heats xl of vaporization, xls of sublimation and xls - xl of fusion), and the updated mixing ratios, each floored at zero. Below 0 C (`cold`) the deposition/ice branch runs and the ice-rain collection products are partitioned between snow and graupel by the switches delta2, delta3 (rain and snow below the threshold par.q_delta = 1e-4 kg/kg send the products to snow); above 0 C only evaporation of melting precipitation, enhanced melting and pgacs act, cloud ice is untouched, and the accreted cloud water goes to rain rather than to the collector. The two branches are blended with the indicator `cold` rather than an ifelse per quantity, so that each updated field is one expression. The latent heats xl and cpm are INPUTS from saturation.esm at the START-of-sub-step state, as WSM6 uses them (EqWeFiC FORTRAN_BUGS.md note N4), while the mixing ratios and temperature are the state at which the rates were evaluated (after the sub-step's sedimentation, melting and freezing). Consumer-supplied inputs: the column fields T, qv, qc, qi, qr, qs, qg, xl, cpm and the 22 raw process rates are REWRITE-TARGET ops `input_<name>` (esm-spec 4.2 open tier) that the consumer lowers -- in the inline tests through a per-test `expression_template_imports` library (tests/<id>_inputs.esm, extracted from kernel dumps of the instrumented WRF fork ctessum-claude/WRF, commit e42a269 (v4.8.0-2-ge42a269e)) because esm-spec 6.6 `parameter_overrides` admit scalars only, and in EqWeFiC couplings/microphysics_column*.esm through the additive `<name>_in` coupling-target parameters. psacw and pgacw are not inputs: only their mixing-ratio-weighted mean paacw enters the budgets and the update. EqWeFiC, cited here for FORTRAN_BUGS.md and couplings/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.
- WSM6MeltingFreezing
model
atmospheric_dynamics
wsm6
Melting and freezing block of the WRF single-moment 6-class microphysics scheme (WSM6; Hong and Lim 2006), transcribed from the first part of the minor loop of mp_wsm6_run in phys/physics_mmm/mp_wsm6.F90 (WRF 4.8, NCAR/MMM-physics), which the kernel applies IN PLACE, layer by layer and in a fixed order, between the sedimentation of the precipitation and the evaluation of the process rates: (1) melting of snow above 0 C by heat conduction and ventilation (psmlt, HL A33, RH83 A25), (2) melting of graupel (pgmlt, HL A23, LFO 47) evaluated at the temperature already lowered by the snow melting, (3) instantaneous melting of all cloud ice above 0 C (pimlt, HL A47), (4) homogeneous freezing of all cloud water colder than -40 C (pihmf, HL A45), (5) heterogeneous Bigg freezing of cloud water (pihtf, HL A44) and (6) probabilistic Bigg freezing of rain to graupel (pgfrz, HL A20, LFO 45), the last four sharing one supercooling and one latent heat of fusion evaluated after the melting. The physics are the melting RATES psmlt_rate, pgmlt_rate (kg/kg/s) and the freezing RATES pihtf_rate, pgfrz_rate; pimlt and pihmf are total conversions with no rate. Because the block is an in-place step, the quantities the kernel actually applies are INCREMENTS (kg/kg) over the sub-step dtcld with per-process limiters (a melting increment may not exceed the frozen mass, a freezing increment the liquid mass) -- exposed as <process>_inc with dtcld as a parameter, time-step artefacts kept apart from the rates (EqWeFiC FORTRAN_BUGS.md N3) -- and the component also returns the state after the block (T_out, qc_out, qi_out, qr_out, qs_out, qg_out) so that a consumer can chain it into the rate components and the tests can close the water and energy budgets against the kernel. Inputs are the state at the START of the block: the sub-step's initial temperature T (the kernel's t is untouched before this block), cloud water qc (unchanged by sedimentation), the post-sedimentation rain, snow, graupel and cloud-ice mixing ratios, density rho, pressure p (both read by `sd`), and the start-of-step cpm and xl (saturation.esm); the size distributions of the post-sedimentation state come from hydrometeor_slopes.esm mounted as subsystem `sd` (the kernel calls slope_wsm6 right after the sedimentation and reuses those slopes here; mstep, the sedimentation sub-step count of older WSM6 versions, is identically 1 in this version). The transport properties and the ventilation factor come from `sd`, evaluated once at the initial temperature, exactly as the kernel does (work2), while the conductivity entering the graupel melting is re-evaluated at the temperature after the snow melting. Constants: wsm6_parameters.esm (`par`), lib/wrf_constants.esm (`wrf`); templates from microphysics_templates.esm and lib/wrf_air_properties.esm. Consumer-supplied inputs are the rewrite-target ops `input_<name>` lowered in the inline tests through a per-test template library extracted from kernel dumps of the instrumented WRF fork ctessum-claude/WRF, commit e42a269 (v4.8.0-2-ge42a269e). EqWeFiC, cited here for FORTRAN_BUGS.md and couplings/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.
- WSM6Parameters
model
atmospheric_dynamics
wsm6
Scheme constants of the WRF single-moment 6-class microphysics scheme (WSM6), transcribed from the `parameter` declarations, the mp_wsm6_init products and the in-line literals of phys/physics_mmm/mp_wsm6.F90 (WRF 4.8, NCAR/MMM-physics CCPP kernel mp_wsm6_run). Mounted by the WSM6 components as subsystem `par` so that no tuning constant is written inline in the physics. Values are the nominal (decimal) values of the Fortran source; the two Gamma-function constants are the values WSM6 itself computes with its `rgmma` routine (a Weierstrass product truncated after 10000 factors), which differ from the exact Gamma function by about 7e-4 (recorded in EqWeFiC FORTRAN_BUGS.md) -- the scheme's effective constants are the rgmma values, so those are what the tests reproduce. NOTE (also in EqWeFiC FORTRAN_BUGS.md): the kernel declares its constants real(kind_phys) but initialises them from default-real literals, so a real64 build runs with single-precision roundings (bvtr = 0.800000011920929, avtr = 841.9000244); the WSM6 tests document the resulting O(1e-7) relative mismatch in their tolerances rather than reproducing the rounding here. EqWeFiC, cited here for FORTRAN_BUGS.md and couplings/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.
- WSM6Saturation
model
atmospheric_dynamics
wsm6
Thermodynamic state of a column as the WSM6 microphysics scheme evaluates it once per sub-time step (phys/physics_mmm/mp_wsm6.F90, the inlined fpvs block and the cpmcal/xlcal statement functions of mp_wsm6_run): saturation vapor pressure and mixing ratio over water and over ice from the integrated Clausius-Clapeyron relation with temperature-linear latent heats (lib/wrf_thermo.esm saturation_vapor_pressure_fpvs), the relative humidities, the latent heat of vaporization and the moist heat capacity. Layer index `lev` (WRF k, layer 1 at the surface); all fields are pointwise functions of the layer state, so no grid geometry is needed. The ice formula is used only below the triple point, above it the ice saturation equals the water saturation (the Fortran branch). The vapor pressure is capped at es_cap p and the saturation mixing ratio and relative humidity are floored at qmin, exactly as the kernel does. This model is a separate component from the process rates (warm_rain.esm) because WSM6 computes it from the temperature and vapor at the START of the sub-step and does not update it after sedimentation, melting and freezing have changed the temperature (EqWeFiC FORTRAN_BUGS.md note N4); the process-rate components therefore take qsat, rh and xl as inputs so that a consumer can bind either this model's outputs or, to reproduce the kernel, its start-of-step values. Consumer-supplied inputs: the column fields T (temperature), qv (vapor mixing ratio) and p (pressure) are REWRITE-TARGET ops `input_<name>` (esm-spec 4.2 open tier) that the consumer lowers -- in the inline tests through a per-test `expression_template_imports` library (tests/<id>_inputs.esm, extracted from kernel dumps of the instrumented WRF fork ctessum-claude/WRF, commit e42a269 (v4.8.0-2-ge42a269e)) because esm-spec 6.6 `parameter_overrides` admit scalars only. EqWeFiC, cited here for FORTRAN_BUGS.md and couplings/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.
- WSM6SaturationAdjustment
model
atmospheric_dynamics
wsm6
Saturation adjustment of cloud water in the WRF single-moment 6-class microphysics scheme (WSM6; Hong and Lim 2006), transcribed from the pcond block at the end of each sub-time step of mp_wsm6_run (phys/physics_mmm/mp_wsm6.F90, WRF 4.8, NCAR/MMM-physics; the statement function conden and the loop labelled 'pcond: condensational/evaporational rate of cloud water [HL A46] [RH83 A6]'). After every process rate has been applied and the hydrometeors have fallen, the kernel recomputes the saturation mixing ratio OVER WATER from the updated temperature and vapor (the inlined fpvs block, water branch only -- ice saturation plays no part here, whatever the temperature) and removes the remaining super- or sub-saturation with the one-step Newton (Asai 1965; Rutledge and Hobbs 1983 eq. A6) increment dq = (qv - qsat) / (1 + L^2 qsat / (r_v cpm T^2)), the linearisation of the Clausius-Clapeyron feedback of the latent heating on qsat. Condensation (dq > 0) is capped by the available vapor, evaporation (dq < 0) happens only where cloud water exists and is capped by the cloud water present, so that a layer that dries out loses all its cloud (the kernel then pads qc <= qmin to 0). The latent heat L and the moist heat capacity cpm are the START-OF-CALL values (EqWeFiC FORTRAN_BUGS.md note N4), so they are inputs here (saturation.esm xl, cpm); the saturation state at the adjusted temperature comes from saturation.esm mounted as subsystem `sat` on the same inputs. This is an INSTANTANEOUS ADJUSTMENT, not a rate: WSM6 applies the whole increment dq once per sub-step and stores pcond = dq/dtcld only for bookkeeping, so the stored 'rate' scales with 1/dtcld (EqWeFiC FORTRAN_BUGS.md note N3) and a small-dt replay of the kernel is meaningless for it. The model therefore exposes (i) the adjusted target state T*, qv*, qc* and the applied increment dq_applied, which are step-free and are what the tests check against the kernel, (ii) pcond = dq_applied/dtcld as the kernel reports it, and (iii) the relaxation-rate form pcond_relax = dq_adj/tau with an adjustment time tau as a parameter: for tau = dtcld it reproduces the kernel's unlimited rate, and a continuous model that cannot take an instantaneous step would use this form with a physical tau (a few seconds to tens of seconds) as the condensation tendency. Layer index `lev` (WRF k, layer 1 at the surface), pointwise, no grid geometry. Consumer-supplied inputs are the REWRITE-TARGET ops input_T, input_qv, input_p (read by the `sat` subsystem and re-exported), input_qc, input_xl and input_cpm, lowered in the inline tests through a per-test expression_template_imports library extracted from kernel dumps of the instrumented WRF fork ctessum-claude/WRF, commit e42a269 (v4.8.0-2-ge42a269e) (esm-spec 6.6 admits scalar overrides only). EqWeFiC, cited here for FORTRAN_BUGS.md and couplings/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.
- WSM6Sedimentation
model
atmospheric_dynamics
wsm6
Sedimentation (fallout) of the precipitating hydrometeors of the WRF single-moment 6-class microphysics scheme (WSM6; Hong and Lim 2006), written as the flux-form continuity law of each falling category, dq/dt = -(1/rho) d/dz(rho v_t q), with the mass-weighted terminal fall speeds v_t of hydrometeor_slopes.esm (mounted as subsystem sd) and lowered on the column_nonuniform_1d grid by EarthSciDiscretizations sedimentation_jh2010_flux_D_lev (PR #42), the dt -> 0 limit of WSM6's own forward semi-Lagrangian fallout (nislfv_rain_plm, Juang and Hong 2010): the flux through a layer's lower face is a third-order interpolated interface fall speed times the monotone average-slope face value of the layer above (FORTRAN_BUGS N77), nothing enters through the model top, and the outflow through the lowest face is the surface precipitation rate. Rain falls at its own speed v_r; snow and graupel fall TOGETHER at the mixing-ratio-weighted speed v_sg (WSM6 sediments the two categories jointly since V3.0, nislfv_rain_plm6 with the combined worka), so the snow and graupel fluxes both use W_sg; cloud ice falls at v_i (Heymsfield-Donner power law of the mean crystal diameter); cloud water does not fall. Negative input mixing ratios (round-off in the kernel inputs) are advected as zero mass; WSM6 advects den*q with the negatives in it, which in these tests changes the tendencies by <= 1.1e-9 of the column maximum. THIS IS THE METHOD-OF-LINES (INSTANTANEOUS DERIVATIVE) FORM: WSM6 integrates fallout with that semi-Lagrangian scheme, whose increment over one WRF step is not dt times this derivative, but as dt -> 0 its tendency converges to exactly the operator written here (measured against the verbatim Fortran routine in every test, to <= 1.14e-7 of the column maximum for rain, snow and graupel and 6.4e-6 for ice; the ice gap is the one branch the rule omits, the upwind side of a face whose interpolated speed overshoots below zero). The fall speeds are set to zero where WSM6 zeroes them (rain where q_r <= 0, ice where q_i <= 0, the joint snow/graupel speed where q_s + q_g <= 1e-15): with donor-cell that was immaterial, because the flux of an empty layer is zero either way, but the jh2010 interface speed reads the NEIGHBOURS' speeds and switches to the layer above wherever a speed is exactly zero, and without the zero the early-storm rain tendency was 16 % off. The kernel's `fall` flux DIAGNOSTIC converges (linearly in dt) to the layer-centred fluxes rho v_t q, which is what the FLUX assertions pin; they do not depend on the rule. Until 2026-09-22 this component imported the first-order donor-cell rule sedimentation_upwind1_flux_D_lev, which differs from WRF's converged fallout by 16-112 % of the column maximum in these tests. Transcribed from the fallout block of mp_wsm6_run in phys/physics_mmm/mp_wsm6.F90 (WRF 4.8, NCAR/MMM-physics fork ctessum-claude/MMM-physics@52cfbd7): slope_wsm6 -> workr/worka -> nislfv_rain_plm/plm6 -> fall, and the ice fallout work1c -> nislfv_rain_plm -> fallc. EqWeFiC, cited here for FORTRAN_BUGS.md and couplings/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.
- WSM6WarmRain
model
atmospheric_dynamics
wsm6
Warm-rain process rates of the WRF single-moment 6-class microphysics scheme (WSM6; Hong and Lim 2006, Hong, Dudhia and Chen 2004), transcribed from the warm-rain block of mp_wsm6_run in phys/physics_mmm/mp_wsm6.F90 (WRF 4.8, NCAR/MMM-physics): autoconversion of cloud water to rain praut = qck1 qc^(7/3) above the threshold qc0 (HDC eq. 16), accretion of cloud water by rain pracw = pacrr lambda^-(3+b) qc (rho0/rho)^(1/2) (HL eq. A40), and evaporation/condensation of rain prevp = (rh - 1)(precr1 lambda^-2 + precr2 f_v coeres)/F (HDC eq. 14), all in kg/kg/s as pointwise functions of the layer state on the layer index `lev` (WRF k, layer 1 at the surface; no grid geometry is needed). The raindrop size distribution (the inverse slope lambda^-1 and its powers, the density factor), the transport properties of air (kinematic viscosity, vapor diffusivity, thermal conductivity), the ventilation factor and the rain ventilation moment come from hydrometeor_slopes.esm mounted as subsystem `sd`, which the cold-rain, deposition, melting and sedimentation components mount too, so every process sees one size distribution and one work2 for a given state, as in the kernel; the diffusional-growth denominator F, which needs the saturation state, is computed here (microphysics_templates.esm); the scheme constants (n0r, a, b, r0, N_c, ...) come from wsm6_parameters.esm as subsystem `par` and the physical constants from lib/wrf_constants.esm as subsystem `wrf`. The derived rate coefficients qc0 = (4/3) pi rho_w r0^3 N_c / rho0, qck1 = 0.104 g E / (N_c rho_w)^(1/3) / mu rho0^(4/3), pacrr = pi n0r a Gamma(3+b) E_rc/4, precr1 = 2 pi n0r a_v and precr2 = 2 pi n0r b_v a^(1/2) Gamma(2.5+b/2) are observeds so that they can be checked against the values mp_wsm6_init computes. The saturation state (qsat, rh, xl) is an INPUT rather than computed here: WSM6 evaluates it once at the start of each sub-time step (saturation.esm) and does not refresh it after sedimentation, melting and freezing have changed the temperature, so the rates are evaluated at a temperature that differs from the one behind qsat/rh/xl (EqWeFiC FORTRAN_BUGS.md note N4); a consumer binds saturation.esm's outputs at the state of its choice. The UNLIMITED rates praut, pracw, prevp are the physics; the kernel additionally applies per-process time-step limiters (a sink may not remove more than q/dtcld per sub-step, rain evaporation/condensation may not exceed half the vapor deficit/excess per sub-step), which are exposed separately as praut_lim, pracw_lim, prevp_lim with the sub-step length dtcld as a parameter -- they are time-step artefacts, not physics (EqWeFiC FORTRAN_BUGS.md note N3), and the mass-conservation rescaling the kernel applies afterwards is not part of this component. Consumer-supplied inputs: the column fields qv, qc, qsat, rh, xl here and T, qr, qi, qs, qg, rho, p in `sd` (ice, snow and graupel enter only sd's diagnostics, not the warm-rain rates) are REWRITE-TARGET ops `input_<name>` (esm-spec 4.2 open tier) that the consumer lowers -- in the inline tests through a per-test `expression_template_imports` library (tests/<id>_inputs.esm, extracted from kernel dumps of the instrumented WRF fork ctessum-claude/WRF, commit e42a269 (v4.8.0-2-ge42a269e)) because esm-spec 6.6 `parameter_overrides` admit scalars only. EqWeFiC, cited here for FORTRAN_BUGS.md and couplings/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.
- YSU
model
atmospheric_dynamics
ysu
The YSU (Yonsei University) nonlocal boundary-layer scheme of Hong, Noh and Dudhia (2006), with the stable-regime (Hong 2010) and top-down (theta_li) boundary-layer-top diagnostics of WRF 4.8, written as a single-column PDE component on the EarthSciDiscretizations grids/column_nonuniform_1d grid (layer index `lev`, layer 1 at the surface; interface index `lev_nodes`, interface 1 the surface). The physics is transcribed from the CCPP kernel bl_ysu_run in phys/physics_mmm/bl_ysu.F90 (NCAR/MMM-physics, the WRF 4.8 submodule). Prognostic column fields theta (potential temperature), u, v, qv, qc and qi obey the density-weighted flux-form vertical diffusion d(c)/dt = (1/rho) d/dz[ rho K_c dc/dz - Phi_c ], where K_c is the interface eddy diffusivity of the field (K_h for theta, K_m for u and v, K_q for water) and Phi_c is the prescribed (non-gradient) part of the turbulent flux: the surface flux on interface 1 (-hfx/cp for theta, -qfx for qv, rho_s u_*^2 u_1/|U| for momentum -- the sign convention of the ESD flux rule, Phi = rho K dc/dz on the face) and, inside the boundary layer, the YSU nonlocal (counter-gradient) flux rho K_c gamma_c plus the entrainment flux (w'c')_h ((z - z_1)/(h - z_1))^3, zero on the top interface. The gradient term is lowered by the ESD rule varcoeff_face_laplacian_lev_flux_bc applied to (rho K) on the interfaces (its own prescribed face fluxes kdudz_bot/kdudz_top are zero here because every prescribed flux is carried by Phi so that the six prognostic fields can share one rule instance), the prescribed-flux term by face_flux_D_lev_supplied_faces. The density weighting is exactly the hydrostatic sigma-coordinate form of the Fortran: rho on an interface is (p[k] - p[k+1])/(g (zc[k+1] - zc[k])) and in a layer (p_int[k] - p_int[k+1])/(g dz[k]), so with WRF's pressures and heights the lowered operator reproduces bl_ysu_run's tridiagonal coefficients term by term (dsig xkzh rdz / del). Boundary-layer height: the bulk-Richardson search of components/atmospheric_dynamics/ysu/bulk_richardson.esm is applied (1) with the lowest-level theta_v, (2) with the thermal excess of the surface heat and moisture fluxes when the surface layer is unstable and the buoyancy flux positive, (3) the top-down theta_li scan that raises the top to just above the highest theta_li-unstable level (ysu_topdown_pblmix; it starts at the previous kpbl and evaluates the bulk Richardson number from theta_li at every level it visits, level 1 included -- brli1 -- rather than seeding level 1 with the surface-layer br), and (4) the stable-regime search with the Hong (2010) critical value (0.25 over land, Rossby-number dependent over water) when the surface layer is stable and no boundary layer was found; each search is an aggregate over the level index and never a recurrence (see bulk_richardson.esm). Diffusivities: inside the boundary layer the K-profile K_m = k w_s z (1 - z/h)^p with the surface-layer velocity scale w_s = (u_*^3 + phifac k w_*^3 (1 - z/h))^(1/3) (or u_*/phi_m(z) when stable), K_h = K_m / Pr with the height-tapered Prandtl number of Hong et al. (2006, their eq. A10), K_q likewise; above the boundary layer the local Ri-dependent mixing-length diffusivity of Louis type with the in-cloud moist Richardson number; in the entrainment zone ((z - h)/delta)^2 < 4.6 the geometric mean of the local value and the entrainment-flux value -w_e dz_h exp(-((z - h)/delta)^2). Every diffusivity is floored by the background values and capped by xkzmax. Consumer-supplied inputs: the column fields (p, p_int, exner, ze and the initial theta, u, v, qv, qc, qi) are REWRITE-TARGET ops `input_<name>` (esm-spec 4.2 open tier) that the consumer lowers -- in the inline tests through a per-test `expression_template_imports` library (tests/<test id>_inputs.esm) because esm-spec 6.6 `parameter_overrides` admit scalars only; surface-layer scalars (hfx, qfx, u_*, psi_m, psi_h, br, |U|, U10, land mask, z0, psfc) are ordinary parameters. NOT transcribed (inactive in every test regime): the BEP/BEP+BEM urban forcing terms, the optional ocean-current (uox/vox) surface drag, the topo_wind corrections (ctopo = ctopo2 = 1), the extra passive-tracer mixing (nmix = 0), and the WRF diagnostic outputs u10/v10 (pass-through), dusfc/dvsfc/dtsfc/dqsfc (column sums) and the TKE/hybrid-PBLH diagnostics. The cloud-top radiative-entrainment branch (ysu_topdown_pblmix, WRF cloudflg: a cloud layer at kpbl-1 whose integrated radiative cooling radsum drives top-down thermals wstar3_2, extra entrainment we_rad, a counter-gradient term hgamt2 and a second K-profile term wscalek2) is transcribed (exercised by synthetic_cloudtop_call120, and switched off by topdown = 0 in synthetic_notopdown_cloudtop_call120); radsum is the cumulative column integral of the radiative cooling. Fractional powers of quantities that vanish identically outside their regime (w_*^3 in a stable column, wstar3_2 below a cloud-free top) are gated with ifelse, so that a Jacobian of the right-hand side never evaluates the derivative of a root at zero. Tendencies are observed variables (`dthdt`, `dudt`, `dvdt`, `dqvdt`, `dqcdt`, `dqidt`) so that the inline tests assert the instantaneous right-hand side at time 0 against the real64 kernel's tendency extrapolated to dt -> 0 (Richardson extrapolation of the implicit step over dt = 0.04, 0.02, 0.01 s; the Fortran solves the diffusion implicitly, so its finite-step tendency differs from the derivative by O(dt K / dz^2)). Test provenance: the inputs and expected values come from a WRF v4.8.0 em_scm_xy single-column run of the instrumented fork ctessum-claude/WRF (branch earthsciml-instrumented, module_esm_dump; physics_mmm at ctessum-claude/MMM-physics 52cfbd7) and from replays of the dumped kernel calls through that fork's real64 kernels/ysu_driver; the synthetic_* tests replay a dumped column after the modification their description states. The numbers were transcribed by tools/fill_tests.py of EarthSciML/EqWeFiC. The dumps, the driver and the generator are not part of this repository, so the values are recorded data rather than regenerable output.
- YSUParameters
model
atmospheric_dynamics
ysu
Scheme constants of the YSU (Yonsei University) nonlocal boundary-layer scheme, transcribed from the `parameter` declarations and in-line literals of phys/physics_mmm/bl_ysu.F90 (WRF 4.8, NCAR/MMM-physics CCPP kernel `bl_ysu_run`). Mounted by the YSU component as subsystem `par` so that no tuning constant is written inline in the physics. Values are the nominal (decimal) values written in the Fortran source. NOTE (recorded in FORTRAN_BUGS.md of EarthSciML/EqWeFiC): the kernel declares these as real(kind_phys) but initialises them from default-real literals, so a real64 build actually runs with the single-precision roundings (e.g. h1 = 0.33333335 -> 0.3333333432674408, not 1/3; afac = 6.800000190734863); the YSU tests document the resulting O(1e-7) relative mismatch in their tolerances rather than reproducing the rounding here.