Support reference-state thermodynamics in anelastic microphysics - #3564
Support reference-state thermodynamics in anelastic microphysics#3564pressel wants to merge 11 commits into
Conversation
…tic-microphysics-pressure
…tic-microphysics-pressure
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
|
Summary
This PR adds consistent pressure and temperature handling for Eulerian microphysics when ERF is run with anelastic dynamics.
For anelastic levels, the Kessler, SAM, and Morrison model families, along with WSM6, now use ERF's hydrostatic reference state:
Here, ($p_0$ ) is the hydrostatic reference pressure and ($\pi_0$ ) is the corresponding reference Exner function.
This avoids reconstructing microphysics pressure from the compressible equation of state on anelastic levels while preserving the existing compressible behavior.
Changes
Reference-state thermodynamics
Microphysics integration
Add a shared thermodynamic diagnosis for Eulerian microphysics and use it for the following anelastic model selections:
KesslerKessler_NoRainSAMSAM_NoIceSAM_NoPrecip_NoIceMorrisonMorrison_NoIceWSM6For these schemes, anelastic microphysics uses:
and:
Scheme-specific pressure conventions remain unchanged:
Compressible configurations continue to use the existing local equation-of-state diagnosis for pressure and temperature.
SuperDroplets compatibility
SuperDropletsis not currently supported when any AMR level uses anelastic dynamics.ERF now rejects this configuration early because the current SuperDroplets thermodynamic path reconstructs pressure through the compressible equation of state.
Users can instead:
The existing particle-enabled build requirement for SuperDroplets remains unchanged.
Cloud Chamber behavior
Restart compatibility
Documentation
Update the Sphinx microphysics documentation to explain:
The SuperDroplets compatibility warning and particle build requirement are retained in the dedicated Super-Droplet documentation section.
User impact
Users enable anelastic dynamics through the existing input:
The option may be specified once for all AMR levels or as one value per level.
No additional microphysics pressure field is required. ERF supplies the hydrostatic reference pressure and corresponding temperature to supported Eulerian schemes and handles internal pressure-unit conversions automatically.
Existing compressible configurations are unchanged.
Testing
This PR adds or strengthens coverage for:
Array4andMultiFabwiring;The
ABL_MOST_IMP_DIFF_TKEregression reference was regenerated after integrating current upstream changes. The resulting differences are at roundoff scale, and no regression comparison tolerances were loosened.Notes for reviewers
The stored reference Exner function is authoritative for anelastic temperature diagnosis. Microphysics does not recompute it from reference pressure inside each scheme kernel.
The compressible thermodynamic path is intentionally unchanged.
The updated TKE gold file reflects the current combined branch after upstream integration. The update does not loosen tolerances or intentionally change the physical configuration.