Skip to content

Support reference-state thermodynamics in anelastic microphysics - #3564

Draft
pressel wants to merge 11 commits into
erf-model:developmentfrom
pressel:feature/anelastic-microphysics-pressure
Draft

Support reference-state thermodynamics in anelastic microphysics#3564
pressel wants to merge 11 commits into
erf-model:developmentfrom
pressel:feature/anelastic-microphysics-pressure

Conversation

@pressel

@pressel pressel commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

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:

$$\theta = \frac{\rho\theta}{\rho}, \qquad T = \theta \pi_0, \qquad p = p_0$$

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

  • Add the reference Exner function, ($\pi_0$), to the ERF base-state thermodynamic contract.
  • Initialize reference pressure and Exner consistently through the shared hydrostatic base-state path.
  • Treat the stored reference Exner function as authoritative when diagnosing anelastic temperature.
  • Reconstruct ($\pi_0$) when reading legacy checkpoints that contain ($p_0$) but predate the new base-state component.
  • Preserve base-state consistency through initialization, AMR level construction, ghost filling, and restart handling.

Microphysics integration

Add a shared thermodynamic diagnosis for Eulerian microphysics and use it for the following anelastic model selections:

  • Kessler
  • Kessler_NoRain
  • SAM
  • SAM_NoIce
  • SAM_NoPrecip_NoIce
  • Morrison
  • Morrison_NoIce
  • WSM6

For these schemes, anelastic microphysics uses:

$$T = \theta \pi_0$$

and:

$$p = p_0$$

Scheme-specific pressure conventions remain unchanged:

  • Kessler and SAM store pressure internally in mbar/hPa.
  • Morrison and WSM6 retain pressure in Pa.
  • ERF performs these conversions internally; users do not need to provide scheme-specific pressure units.
  • WSM6 continues to reconstruct conserved potential temperature from its updated temperature and held pressure after the microphysics source update.

Compressible configurations continue to use the existing local equation-of-state diagnosis for pressure and temperature.

SuperDroplets compatibility

SuperDroplets is 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:

  • run SuperDroplets with compressible dynamics; or
  • select a supported Eulerian moisture model for anelastic simulations.

The existing particle-enabled build requirement for SuperDroplets remains unchanged.

Cloud Chamber behavior

  • Strengthen the Cloud Chamber initialization path for the prescribed reference thermodynamic state.
  • Preserve independently prescribed Cloud Chamber density.
  • Use the configured reference temperature and pressure consistently.
  • Retain the analytic hydrostatic pressure profile.
  • Improve validation of incompatible Cloud Chamber configurations.
  • Strengthen deterministic pressure and configuration checks.

Restart compatibility

  • Add support for reconstructing the reference Exner function when reading older checkpoints that contain the previous base-state component count.
  • Preserve current checkpoint behavior when (\pi_0) is already present.
  • Avoid changing unrelated checkpoint formats or restart semantics.

Documentation

Update the Sphinx microphysics documentation to explain:

  • how anelastic dynamics are enabled;
  • which Eulerian microphysics models use the hydrostatic reference state;
  • how pressure and temperature are supplied to those schemes;
  • that users do not need to provide an additional microphysics pressure field;
  • that users do not need to perform pressure-unit conversions;
  • that compressible microphysics behavior is unchanged;
  • how legacy checkpoints reconstruct a missing reference Exner function;
  • why SuperDroplets is not supported with anelastic dynamics.

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:

erf.anelastic = 1

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:

  • shared anelastic microphysics thermodynamic diagnosis;
  • production Array4 and MultiFab wiring;
  • Kessler reference-state copy-in;
  • SAM reference-state copy-in and pressure handling;
  • Morrison reference-state copy-in;
  • WSM6 reference-state copy-in and conserved-state copy-out;
  • hydrostatic reference pressure and Exner consistency;
  • internal and ghost-cell base-state handling;
  • legacy checkpoint reconstruction of missing (\pi_0);
  • SatAdj temperature and pressure diagnostics;
  • CUDA-portable SatAdj test initialization;
  • Cloud Chamber thermodynamic checks;
  • Cloud Chamber invalid-configuration failures;
  • SuperDroplets and anelastic compatibility checks.

The ABL_MOST_IMP_DIFF_TKE regression 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant