Skip to content

SE-NH condensate water loading and energy-consistent physics coupling - #117

Open
nandroski wants to merge 4 commits into
NCAR:stormspeedfrom
nandroski:senh_condensate_loading
Open

nandroski wants to merge 4 commits into
NCAR:stormspeedfrom
nandroski:senh_condensate_loading

Conversation

@nandroski

Copy link
Copy Markdown

Target: NCAR/StormSPEED branch stormspeed
Head: senh_condensate_loading, 4 commits on the current stormspeed
Depends on: the HOMME PR to jtruesdal/E3SM#1 (condensate water loading, port of mt5555/E3SM#10). .gitmodules will be updated to its tag before merge. Until then the submodule points at commit 371f313e69, so this PR is a draft.

What it does

1. Condensate water loading for SE-NH (theta-l), opt-in.

  • Mass: dp3d and ps carry dry air, vapor and the condensates listed in water_species_in_air.
  • Gas constant: R* = Rd·q_dry + Rv·qv, so θ_v becomes the density potential temperature.
  • Effect: condensate weight enters the buoyancy and the pressure gradient force through the mass and the equation of state.
  • Control: CAM sets HOMME's condensate list from water_species_in_air, so CAM and HOMME always agree. The default stays 'Q' (no loading), as in HOMME and EAM.

2. Energy-consistent physics forcing for SE-NH.

  • HOMME applies physics heating at constant nonhydrostatic pressure, so the dycore gains c_p*·ΔT with c_p* = c_pd·R*/R_d, HOMME's constant-κ enthalpy.
  • The physics temperature increment is now rescaled by cpairv/cp_or_cv_dycore, as already done for SE and MPAS. That rescaling was missing for SE-NH.
  • The SE-NH dycore-energy diagnostics use the SE energy formula with the constant-κ consistent heat capacity.

3. Dry-mass adjustment.

  • HOMME's applyCAMforcing_tracers does the moist-mass adjustment.
  • physics_dme_adjust is therefore called for SE-NH for diagnostics only, and the state is restored afterwards.
  • It runs every step, so the physics_dme_adjust snapshots work with thermo_budget_history off.

4. Adjust pdeldry computation in d_p_coupling.

  • pdeldry is computed from all listed water species, then was immediately overwritten with a vapor-only value. It is now kept.

5. preqx stays vapor-only.

  • Water loading exists only for theta-l. preqx gets a 'Q' default and aborts if condensates are listed.

6. Thermodynamic budgets enabled for SE-NH on the GLL grid for physics. Budgets computed within the dycore remain disabled.

Answer impact

  • Every SE-NH test changes answers, including those with water_species_in_air = 'Q', because of the temperature rescaling in (2) done within CAM physics.
  • With 'Q', the HOMME PR port are bit-for-bit.
  • Condensate loading changes answers in HOMME only when it is turned on.

Testing

Runs on derecho/intel: FKESSLER ne30_ne30, theta-l, moist bubble on a reduced-radius planet (X=120), 150 steps. Compared against the earlier SourceMods implementation of condensate loading on the same base:

Configuration Result
water_species_in_air = 'Q' Bit-for-bit
'Q','CLDLIQ','RAINQM', HOMME port only Roundoff-level differences (10⁻¹² when condensate appears)
'Q','CLDLIQ','RAINQM', with the pdeldry fix Only physics change; grows chaotically from 10⁻⁶
Column checks: mass, tracer, dry-mass and budgets Same pass pattern as the earlier implementation, in the most heavily loaded column
HOMME log Reports water_loading = T and condensate_idx = 2 3

Build-only checks: QPC6 and QPC7 (ne30pg2, theta-l) build.

preqx does not build on stormspeed itself, before this PR. dyn_comp.F90 imports fine_ne, hypervis_power and max_hypervis_courant, which HOMME's control_mod at stormspeed_homme.01 no longer has. So the preqx guard in (5) is untested. With it, preqx gets water_species_in_air = 'Q' from build-namelist.

Not yet run: aux_cam_e3sm and aux_cam_preqx. Not built: the Kokkos target.

Notes for reviewers

  • dycore_budget.F90: most of the diff is about 520 previously commented-out (!!$) budget lines, now enabled. The commented-out lines enable budgets computed in physics (e.g. BF, BP, AP, AM) while leaving budgets within the dycore disabled.
  • Cost of the diagnostic dme-adjust call: dme-adjust within physics is turned on for SE-NH and is only computed for diagnostics even when thermo_budget_history is turned off. The state is returned after being called. This allows snapshots to be used in cases where thermo_budget_history is false. The call is column-local and in a FKESSLER moist bubble test, all of tphysac took about 0.5% of dyn_run.
  • Physics still sees hydrostatic columns. Midpoint pressure is hydrostatic π, so physics heights and density differ from HOMME's by a factor p/π. That is unchanged by this PR and could be a follow-up. An MPAS-style option would pass the nonhydrostatic midpoint pressure instead. The differences this may cause remains untested and unclear.

AI disclosure: The original modifications were made by the developer. Changes to adapt to the port of mt5555/E3SM#10 where made and verified against the original using Claude Code (Anthropic). The developer reviewed the changes and remains responsible for the code.

Nicholas Androski and others added 4 commits November 18, 2026 21:08
Connect CAM's water_species_in_air to HOMME theta-l condensate water
loading (HOMME port of mt5555/E3SM PR NCAR#10), so dp3d carries the mass of
dry air, vapor and the listed condensates.

- dycore submodule: HOMME water_loading, condensate_idx, get_q_dry and
  get_R_star(R, q_dry, qv) (371f313e69, on stormspeed_homme.01).
- dyn_comp.F90: set HOMME water_loading and condensate_idx from
  water_species_in_air before HOMME initializes, so CAM and HOMME use one
  species list. set_thermostate receives the full tracer array.
- dp_coupling.F90: pdeldry = pdel*(1 - sum of the listed water species),
  kept through set_state_pdry(state, .false.) so pintdry/pmiddry and the
  wet<->dry conversions (and Kessler's dry mixing ratios and density) use
  the same dry mass as HOMME; update cp_or_cv_dycore each physics step.
- air_composition.F90: cp_or_cv_dycore = cpd*R*/Rd for SENH, HOMME's
  constant-kappa enthalpy.
- namelist_defaults_senh.xml: water_species_in_air='Q' for theta-l
  (loading off by default, as in HOMME/EAM).

AI disclosure: prepared with Claude Code (Anthropic).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HOMME condensate water loading is implemented only for theta-l
(preqx has its own element_ops without get_q_dry). Without a preqx
default, preqx would take CAM's microphysics water_species_in_air list
and add condensate mass to dp3d without the matching gas constant.

- namelist_defaults_senh.xml: water_species_in_air='Q' for preqx.
- dyn_comp.F90: water_loading is set only under MODEL_THETA_L; preqx
  aborts with a clear message if condensates are listed.

AI disclosure: prepared with Claude Code (Anthropic).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- physpkg.F90 (cam, cam7, simple): for SENH, rescale the physics T
  increment by cpairv/cp_or_cv_dycore at the end of tphysac, as for SE
  and MPAS. HOMME applies physics heating at constant (nonhydrostatic)
  pressure, so the dycore gains cp*dT with cp* = cpd*R*/Rd.
- physpkg.F90 (cam, cam7, simple): SENH branch for physics_dme_adjust.
  HOMME's applyCAMforcing_tracers does the moist-mass adjustment, so the
  call is diagnostic only and the state is restored afterwards. It is not
  gated by thermo_budget_history, so the physics_dme_adjust snapshots work
  with the budgets off (cost: one column-local pass per step).
- check_energy.F90: SENH dycore-energy diagnostics use the SE energy
  formula with cp_or_cv_dycore (check_energy_timestep_init,
  check_energy_cam_chng and tot_energy_phys).
- physics_types.F90: SENH no longer returns early from
  physics_dme_adjust; comment explains the diagnostic-only use.
- cam_budget.F90, senh/dycore_budget.F90: enable the thermodynamic
  budgets and their printing for SENH on the GLL grid.

AI disclosure: prepared with Claude Code (Anthropic).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tag name and PR URL are placeholders until the PR is opened and merged.

AI disclosure: prepared with Claude Code (Anthropic).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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