Skip to content

feat(Rosenbrock): post-solve per-process verbose diagnostics#732

Draft
haakon-e wants to merge 2 commits into
he/1m-adfrom
he/postsolve-diagnostics
Draft

feat(Rosenbrock): post-solve per-process verbose diagnostics#732
haakon-e wants to merge 2 commits into
he/1m-adfrom
he/postsolve-diagnostics

Conversation

@haakon-e

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

Copy link
Copy Markdown
Member

What this adds

Adds post-solve per-process tendency diagnostics for the RosenbrockAverage modes (1M and 2M+P3) as a Verbose{M} wrapper around any mode, reporting the contribution of each microphysical process as realized by the implicit solve.

Why the decomposition is exact

Each substep solves a system that is linear in the right-hand side f:

(I/h − J) Δ = f,   f = Σₚ fₚ          (fₚ = the p-th process tendency)
⇒  Δ = Σₚ Δₚ   with   (I/h − J) Δₚ = fₚ

so the per-process increments Δₚ sum to the substep increment Δ. With nsub > 1 each substep is re-evaluated at the state it starts from, and the per-process increments and the clamp term are accumulated across substeps, so the relation holds for the averaged tendency. The positivity clamp max(x + Δ, 0) is the only nonlinear step; it is returned as a single correction term c that is not attributable to any one process:

Σₚ Δₚ + c = realized net increment.

The clamp is a no-op for the donor option (its rates are floored) and binds only rarely for the exact option, since the saturation adjustment already bounds growth. With the clamp disabled the decomposition is exactly Σₚ Δₚ = net, which is a reason it could be made optional.

Testing

Exactness tests confirm the per-process increments plus the clamp correction reconstruct the net to round-off (≈ 1e-13 in Float64) and that the verbose net equals the non-verbose net, for both schemes and precisions. The non-verbose path is unchanged and allocation-free. The verbose path currently allocates and is intended for offline diagnostics; an allocation-free version (a preallocated per-process accumulator, as in the earlier LinearizedAverage verbose variant) is a possible refinement.

@haakon-e
haakon-e force-pushed the he/postsolve-diagnostics branch from 3877f3b to 060db2d Compare June 14, 2026 02:45
@haakon-e
haakon-e force-pushed the he/postsolve-diagnostics branch from 060db2d to bc7f5f3 Compare June 14, 2026 03:42
@haakon-e
haakon-e force-pushed the he/postsolve-diagnostics branch from bc7f5f3 to 258ece7 Compare June 14, 2026 04:07
@haakon-e
haakon-e force-pushed the he/postsolve-diagnostics branch from 258ece7 to 0122e0e Compare June 16, 2026 20:00
@haakon-e
haakon-e force-pushed the he/postsolve-diagnostics branch from 0122e0e to 224c902 Compare June 17, 2026 21:20
@haakon-e haakon-e changed the title Add post-solve per-process Rosenbrock tendency diagnostics feat(Rosenbrock): post-solve per-process verbose diagnostics Jun 17, 2026
@haakon-e
haakon-e force-pushed the he/postsolve-diagnostics branch 2 times, most recently from 328ac11 to 3ab1235 Compare June 18, 2026 22:41
@haakon-e haakon-e mentioned this pull request Jun 18, 2026
@haakon-e
haakon-e force-pushed the he/postsolve-diagnostics branch from 3ab1235 to 2b6587d Compare June 22, 2026 21:01
@haakon-e
haakon-e force-pushed the he/postsolve-diagnostics branch from 2b6587d to 4edcf64 Compare June 22, 2026 23:43
@haakon-e
haakon-e force-pushed the he/postsolve-diagnostics branch from a789eb4 to df30b49 Compare June 26, 2026 00:38
@haakon-e
haakon-e force-pushed the he/postsolve-diagnostics branch from df30b49 to 82ef2c6 Compare June 26, 2026 01:22
@haakon-e
haakon-e force-pushed the he/postsolve-diagnostics branch from 82ef2c6 to 83d763e Compare June 26, 2026 01:31
@haakon-e
haakon-e force-pushed the he/postsolve-diagnostics branch from 83d763e to 5d0be63 Compare July 1, 2026 05:34
@haakon-e
haakon-e force-pushed the he/postsolve-diagnostics branch from 5d0be63 to 6299f13 Compare July 1, 2026 05:46
@haakon-e
haakon-e force-pushed the he/postsolve-diagnostics branch from 6299f13 to 3e406c0 Compare July 1, 2026 06:24
@haakon-e
haakon-e force-pushed the he/postsolve-diagnostics branch from 3e406c0 to 2b40424 Compare July 1, 2026 15:01
@haakon-e
haakon-e force-pushed the he/postsolve-diagnostics branch from 2b40424 to 9f81040 Compare July 8, 2026 04:34
@haakon-e
haakon-e force-pushed the he/postsolve-diagnostics branch from 9f81040 to 58e4ca6 Compare July 10, 2026 02:14
@haakon-e
haakon-e force-pushed the he/postsolve-diagnostics branch from 58e4ca6 to 132adb1 Compare July 10, 2026 23:15
@haakon-e
haakon-e force-pushed the he/postsolve-diagnostics branch from 132adb1 to e91d34c Compare July 11, 2026 00:58
@haakon-e
haakon-e force-pushed the he/postsolve-diagnostics branch from e91d34c to db5a1cc Compare July 11, 2026 02:14
@haakon-e
haakon-e force-pushed the he/postsolve-diagnostics branch from db5a1cc to 6eeffe8 Compare July 11, 2026 02:31
haakon-e added 2 commits July 10, 2026 20:24
Guard the Verbose substep Jacobian on state finiteness, matching the
non-verbose loops' Euler fallback. Add an informative error for Verbose
with a non-Exact Jacobian on the 2M+P3 scheme. Test that a limiter-free
exact-Jacobian mode gives identical verbose and non-verbose nets.
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