Nested Davies relaxation via SpecificForcing on a PrescribedAtmosphere parent (fixes boundary cooling)#461
Nested Davies relaxation via SpecificForcing on a PrescribedAtmosphere parent (fixes boundary cooling)#461ewquon wants to merge 8 commits into
SpecificForcing on a PrescribedAtmosphere parent (fixes boundary cooling)#461Conversation
The framework Davies relaxation (parent_forcings, prescribed-parent path) nudged the density-weighted ρθ toward the parent ρθ. Under CompressibleDynamics ρθ is the pressure variable (p ∝ (ρθ)^γ), so relaxing it bleeds the near-wall acoustic restoring pressure: mass piles into ρᵈ unchecked while ρθ is held down, and since T is diagnosed as θ = ρθ/ρᵈ, the ρᵈ pile-up surfaces as a growing near-wall cold rim (boundary cells toward ~140 K on a 24-h CONUS run; a minimal steady nested reproducer grows −13.5 K at 2 min to −90 K at 60 min). Relax the *specific* θ instead, supplied under the specific key `θ`: Breeze wraps a θ-keyed forcing in SpecificForcing, which multiplies by the live child ρᵈ at kernel time. The Relaxation reads the diagnosed specific θ, so the net ρθ tendency is ρᵈ_local·rate·mask·(θ_parent − θ) = rate·mask·(ρᵈ_local·θ_parent − ρθ): θ → θ_parent with no pressure bled and ρᵈ/momentum untouched. θ_parent is time-varying via the FTS. The StateExchanger already computes the intensive θ in _compute_child_prognostics! (it forms ρθ = ρᵈ·θ then discards θ); store θ as a sixth window-managed member of the prognostic FTS and relax the davies block toward prognostic.θ. This matches the specific-θ relaxation the hand-rolled live-parent Davies already used. Reproducer through the patched built-in relaxation: near-wall d=2 dipole −18.7 K → +2.9 K (benign, stable); ρᵈ pile-up 5× smaller. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…nsive by parent kind Builds on the intensive-θ cold-rim fix. The interior Davies relaxation now also nudges the specific velocities u/v (not the density-weighted ρu/ρv), and the intensive-vs-extensive choice is dispatched on the parent kind via `davies_forcing_variables`: - `PrescribedAtmosphere` (reference driving data) → intensive specific u/v/θ. Breeze wraps each `u`/`v`/`θ`-keyed forcing in `SpecificForcing` (target ρᵈ_child·⟨parent⟩), so a near-wall ρᵈ transient neither corrupts velocity/ temperature nor bleeds the ρθ (compressible-pressure) acoustic restoring force — the same reasoning that fixed the θ cold rim. - live prognostic parent → density-weighted ρu/ρv/ρθ, matching the parent's own conserved densities at the boundary. The state exchanger now carries the specific u/v members alongside the density- weighted ρu/ρv (θ was already added); `ρᵈ` (mass) and moisture stay density- weighted. The extensive (live-parent) branch is a forward-looking hook — `nested_atmosphere_model` still dispatches on `::PrescribedAtmosphere`, so every call currently takes the intensive path. Adds a dispatch unit test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Builds a small PrescribedAtmosphere parent and checks the exchanger's output members directly: ρθ = ρᵈ·θ, ρu = ρᵈ·u, ρv = ρᵈ·v, and u/v are verbatim parent velocity copies — the invariant the intensive SpecificForcing relaxation relies on. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Follow-up on the #457 ocean MWE with this branch: this PR closes #457. The density-weighted relaxation was the dominant cause of the reported drift, and the small residual that remains after the fix is now fully attributed — it is expected free-interior physics of the bare-nest configuration, not a nesting defect. Reproduction and effect of this PRSame MWE (N = 60, 12 h, cfl = 0.5, single GPU). A density-weighted baseline reproduces #457 (surface Δθᵛ = −3.59 K vs −3.64 K reported); this branch cuts it to −0.62 K (~83 %) and collapses the vertical dipole. The residual −0.62 K is not an LBC problem
What it actually isThe MWE removes every process that maintains ERA5's marine boundary layer (surface drag, surface fluxes, radiation, SGS closure). Two resolved responses follow:
Budget at 30 m: parent diurnal −0.24 + restratification flux −0.37 ≈ −0.61 vs −0.62 observed. The mid-troposphere warming is the retained (real) trade subsidence no longer balanced by radiative cooling; it saturates on a 4–6 h timescale as the inversion sharpens. Positive control: re-enabling just For reference, a survey of LBC practice (WRF, MPAS-A, ERF, FV3-LAM, ICON-LAM, COSMO, ALADIN) shows the scheme in this PR matches established practice — closest to ICON-LAM (intensive θᵥ/u/v, density relaxed) — while the pre-PR density-weighted-θ-without-comoving-mass configuration has no analog in any surveyed model. Bare-nest takeaway: with no BL physics, the interior should not hold ERA5's flux-maintained near-surface state; −0.6 K/12 h is its natural inviscid restratification plus ERA5's own diurnal cycle. 🤖 Generated with Claude Code |


What
For a
PrescribedAtmosphere(reference-driving) parent, the nested-atmosphere interior Davies relaxation now nudges the intensive fields — specificθ,u,v— via Breeze'sSpecificForcing, instead of the density-weightedρθ/ρu/ρv.ρᵈ(mass) and the moisture density stay density-weighted; the lateral BCs are unchanged.Closes #457.
Why: nonphysical boundary cooling
The relaxation nudged the density-weighted
ρθtoward the parent. UnderCompressibleDynamics,ρθis the compressible pressure (p ∝ (ρθ)^γ), so relaxing it toward the smooth parent bled the near-wall acoustic restoring pressure — mass piled intoρᵈwhileρθwas held down, and sinceT = θ = ρθ/ρᵈ, the pile-up surfaced as a growing near-wall cold rim (24-h CONUS boundary cells reaching ~170 K).Supplied under the specific key
θ, Breeze wraps it inSpecificForcing, which multiplies by the live childρᵈat kernel time — the effective tendency israte·mask·(ρᵈ_local·θ_parent − ρθ), soθ → θ_parentwith no pressure bled andρᵈ/momentum untouched.u/vget the same treatment for consistency. On the 24-h CONUS run this takes the worst near-wall surface cell from 171 K → 257 K and the ring-averaged near-wall dip from −13 K → −1.4 K; a minimal steady reproducer goes from −18.7 K → +2.9 K.Generalized for telescoping nests
The intensive-vs-extensive choice is dispatched on the parent kind (
davies_forcing_variables):::PrescribedAtmosphere→ intensive(ρᵈ, θ, u, v)(ρᵈ, ρθ, ρu, ρv)The extensive branch is a forward-looking hook for telescoping nests:
nested_atmosphere_modelstill dispatches on::PrescribedAtmosphere, so every call currently takes the intensive path, but once the entry point accepts a live parent nest the density-weighted relaxation activates automatically — a live parent'sρu/ρθare a genuine prognostic solution to match at the boundary, not merely a reference.Implementation
The state exchanger already computed the parent's intensive
θ(to formρθ = ρᵈ·θ) and reads the parent velocitiesu/v; it now carries all three as extra window-managed members alongside the density-weighted ones. Adds adavies_forcing_variablesdispatch unit test.(The
exchanger.prognosticfield naming is intentionally left as-is here; renaming it is discussed separately in #459.)🤖 Generated with Claude Code