Skip to content

Add implicit-temperature Rosenbrock averaged-tendency mode#733

Draft
haakon-e wants to merge 1 commit into
he/postsolve-diagnosticsfrom
he/implicit-T
Draft

Add implicit-temperature Rosenbrock averaged-tendency mode#733
haakon-e wants to merge 1 commit into
he/postsolve-diagnosticsfrom
he/implicit-T

Conversation

@haakon-e

@haakon-e haakon-e commented Jun 14, 2026

Copy link
Copy Markdown
Member

What this adds

This adds a Rosenbrock averaged-tendency mode that treats temperature implicitly, for both the 1-moment and 2-moment + P3 configurations. The species-only mode advances the local temperature explicitly between substeps from the latent heat of the realized increment, so the dependence of the tendency on temperature sits outside the species Jacobian and the vapor-to-latent-heat-to-temperature-to-saturation feedback is operator-split, which rings about the saturation limit at coarse substeps. Promoting temperature into the implicitly-solved state removes that splitting.

How

The state is augmented with temperature as a final component (a nine-component 2-moment + P3 state and a five-component 1-moment state), and a joint species-and-temperature tendency appends the latent-heating rate, which is the rate form of the existing between-substep temperature update, so an explicit integration of the augmented tendency reproduces the explicit-temperature trajectory. With temperature differentiated, the Jacobian gains the latent-heating row and the saturation-dependence (Clausius-Clapeyron) column, so the thermal feedback is solved inside the same L-stable one-stage step as the species exchange and no separate between-substep temperature update is done. The dimension-generic kernel is reused unchanged at the new state sizes. This also relaxes the temperature argument of the deposition, sublimation, and evaporation rate helpers (G_func_liquid and G_func_ice) so a dual temperature flows through them, with the air-properties element type still keying the guards, so concrete-temperature callers are unchanged. The existing modes are untouched.

Validation

Reproducing the operator-split ringing diagnostic, the implicit-temperature mode removes the sign-flip oscillation where the explicit-temperature mode rings, and it converges monotonically against a fine augmented-explicit reference for both schemes and both precisions. In an extreme large-substep cold-deposition case the explicit-temperature temperature diverges by hundreds of kelvin while the implicit-temperature temperature stays bounded. One honest limit: a single very large step still shows single-step linearization error, which is one-stage method truncation error rather than operator splitting, and is cured by more substeps.

Testing

New tests cover trajectory reproduction, convergence, ringing removal, degeneracy and finiteness, zero allocation, and JET, for both schemes. The existing test set passes unchanged, including the paths that exercise the relaxed temperature signatures.

Notes

Draft, top of the stack.

The species-only RosenbrockAverage advances the local temperature
explicitly between substeps from the latent heat of the realized species
increment, so the partial of the tendency with respect to T is outside the
species Jacobian. The vapor -> latent-heat -> temperature -> saturation ->
exchange-flux feedback is then operator-split and rings about the saturation
limit at coarse substeps (decaying).

Add RosenbrockAverageImplicitT for the 1M and 2M+P3 configurations, which
promotes T into the implicitly-solved state. The state is augmented with T as
a final component (MicroState1MT, dim 5; MicroState2MP3T, dim 9), and a joint
species+temperature tendency appends the latent-heating rate dT/dt -- the rate
form of the existing between-substep update, so an explicit integration of the
augmented tendency reproduces the explicit-T trajectory. With T differentiated,
the Jacobian gains the latent-heating row and the Clausius-Clapeyron column
(the saturation-dependence of the relaxation rates), so the thermal feedback
sits inside the same L-stable one-stage solve as the species exchange and the
split ringing is removed; no separate between-substep T update is done.

The dimension-generic Rosenbrock kernel is reused unchanged at N = 5 / 9. The
temperature channel is always present in the channel mask (T is far above the
near-empty threshold) and equilibration gives it its own ~250-scale row, so the
species/temperature scale split stays conditioned in Float32. The existing
modes are untouched.

Relax the temperature argument of G_func_liquid / G_func_ice from a pinned
element type to untyped so a dual temperature flows through the 1M deposition,
sublimation and evaporation rates; the air-properties element type still keys
the numerical guards, so concrete-temperature callers are unchanged.
@haakon-e haakon-e force-pushed the he/postsolve-diagnostics branch from bc7f5f3 to 258ece7 Compare June 14, 2026 04:07
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