Support reference pressure in anelastic microphysics - #3564
Conversation
PR #3564 Review — Support reference-state thermodynamics in anelastic microphysicsDiff reviewed: SummaryThe core change is correct. Findings1. Gold file regeneration will break CI — medium/high
Nothing in this diff can change a dry ABL+MOST+TKE run: the only production path it touches Fix: drop the gold change and rebase. 2. Copy-out breaks the "stored π₀ is authoritative" invariant the PR introduces — medium
Copy-in computes Concrete scenario: any base state where Fix: use the stored 3. Unintended compressible behavior change in SAM + new dead state — medium
Separately, 4. Dead code — advertised legacy-checkpoint feature does not exist — medium
Fix: either remove the block (and the docs note) or fix the intended predicate. 5. Latched mode flag consumed by a different call — low/medium
Relatedly, the guard at 6. Test oracle hardcodes deck values it does not read — low
Fix: read the values from the inputs file, or assert them. 7. Unguarded decode of a sentinel — low
If the tie-match at lines 488-501 finds no cell ( Fix: guard with 8. Dead member — low
|
e1e8eb3 to
2b25a7b
Compare
Summary
This PR adds consistent reference-pressure thermodynamics for supported Eulerian microphysics schemes when ERF is run with anelastic dynamics.
On an anelastic AMR level, ERF uses
and diagnoses temperature as
Here, (p_{\mathrm{base}}) is ERF's hydrostatic base-state pressure and (p_{\mathrm{ref}}) is the fixed reference pressure used in the definition of potential temperature.
The anelastic pressure-temperature conversion uses ERF's configured
erf.c_p.Compressible AMR levels retain their existing local equation-of-state behavior.
Supported Eulerian microphysics
The reference-pressure treatment applies to:
KesslerKessler_NoRainSAMSAM_NoIceSAM_NoPrecip_NoIceMorrisonMorrison_NoIceWSM6WDM6SatAdjalready uses the hydrostatic base-state pressure in anelastic configurations.MoistNoCondensationdoes not have a pressure-dependent condensation source requiring this treatment.Pressure conventions
ERF handles the scheme-specific pressure units internally:
Users do not provide an additional microphysics pressure field or perform these pressure-unit conversions themselves.
Compressible non-regression
The existing compressible thermodynamic path is intentionally preserved.
In particular, the historical WSM6 and WDM6 temperature-to-potential-temperature conversion behavior is retained in compressible configurations, including when
erf.c_pdiffers from the default value.For anelastic levels, those conversions instead use the configured (R_d/c_p) together with the held hydrostatic base-state pressure.
SAM
The existing compressible SAM coefficient construction is unchanged:
The anelastic path instead uses thermodynamic fields diagnosed from the hydrostatic base-state pressure.
Mixed AMR hierarchies
erf.anelasticmay be specified per AMR level.The microphysics thermodynamic path is selected independently on each level:
SuperDroplets
SuperDropletsis not currently supported if any AMR level is anelastic.The current SuperDroplets implementation does not consume ERF's hydrostatic base-state pressure. Instead, it diagnoses pressure and temperature through the compressible equation of state and uses those thermodynamic fields in saturation calculations, phase change, particle mass change, terminal-velocity calculations, and coalescence.
That pressure diagnosis is not valid for anelastic dynamics, so ERF now detects and rejects this configuration during input validation rather than allowing physically inconsistent microphysics.
Users should either:
SuperDropletswith compressible dynamics; orThis PR does not modify SuperDroplets particle physics.
Scope
This rebuilt PR intentionally does not:
pi0as a new independent microphysics input;pi0as authoritative for anelastic microphysics;pi0from legacy checkpoints;Documentation
The Sphinx documentation now describes:
Validation
The rebuilt implementation was validated with:
14/14;461/461;16/16;10/10;git diff --check;developmentand the feature branch.The Sphinx feature build introduces no new documentation warnings relative to clean
development.Focused regression coverage includes:
c_pcompressible non-regression;c_pcompressible non-regression;GitHub CI results should be interpreted from the current PR checks rather than from this description.