Skip to content

feat(Rosenbrock): 1M donor / coupled / exact modes on the unified framework#731

Draft
haakon-e wants to merge 4 commits into
he/rosenbrock-2m-p3from
he/1m-ad
Draft

feat(Rosenbrock): 1M donor / coupled / exact modes on the unified framework#731
haakon-e wants to merge 4 commits into
he/rosenbrock-2m-p3from
he/1m-ad

Conversation

@haakon-e

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

Copy link
Copy Markdown
Member

What this adds

Adds the 1-moment (Microphysics1Moment) path to the RosenbrockAverage framework from the previous PR. It introduces three presets:

  • rosenbrock_donor(): DonorJacobian, the donor-based linearization M, reproducing LinearizedAverage (they agree to round-off in Float64).
  • rosenbrock_coupled(): CoupledDonorJacobian, the donor matrix plus the vapor-competition (WBF) coupling, and corrects the sign of the snow source from cloud liquid.
  • rosenbrock_exact(): the exact ForwardDiff Jacobian with the growth term taken explicitly and a saturation adjustment. Several 1M kernels were modified to accept dual numbers so ForwardDiff can differentiate the tendency.

Donor versus exact

The exact Jacobian costs about 2.5× the donor matrix per call. The donor matrix omits cross-couplings that in mixed-phase conditions exceed the diagonal, so at a given number of substeps the exact Jacobian is more accurate there; coupled restores the dominant vapor-competition coupling at the donor option's cost.

Testing

1M tests: rosenbrock_donor() ≡ LinearizedAverage(), the keyword constructor, all three presets return finite tendencies, and convergence against a fine explicit reference; zero-allocation and JET checks in Float64 and Float32.

@haakon-e
haakon-e force-pushed the he/1m-unification branch from f227cd9 to d0a06bf Compare June 14, 2026 02:45
@haakon-e
haakon-e changed the base branch from he/1m-unification to he/diagnostic-nc June 14, 2026 03:42
@haakon-e
haakon-e changed the base branch from he/diagnostic-nc to he/rosenbrock-2m-p3 June 14, 2026 04:07
@haakon-e
haakon-e force-pushed the he/rosenbrock-2m-p3 branch from 1fa016b to 9bffa2c Compare June 16, 2026 20:00
@haakon-e
haakon-e force-pushed the he/rosenbrock-2m-p3 branch from 9bffa2c to 5ba20ad Compare June 17, 2026 21:20
@haakon-e haakon-e changed the title Add 1M AD-Rosenbrock averaged-tendency mode feat(Rosenbrock): 1M donor / coupled / exact modes on the unified framework Jun 17, 2026
@haakon-e
haakon-e force-pushed the he/rosenbrock-2m-p3 branch from 5ba20ad to c161025 Compare June 18, 2026 21:42
@haakon-e
haakon-e force-pushed the he/1m-ad branch 2 times, most recently from d761cf7 to 35b9d20 Compare June 18, 2026 22:41
@haakon-e
haakon-e force-pushed the he/rosenbrock-2m-p3 branch from c161025 to 326fb30 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/rosenbrock-2m-p3 branch from 326fb30 to 0265692 Compare June 22, 2026 21:01
@haakon-e
haakon-e force-pushed the he/rosenbrock-2m-p3 branch from 0265692 to df7621d Compare June 22, 2026 23:43
@haakon-e
haakon-e force-pushed the he/rosenbrock-2m-p3 branch from df7621d to e1ee26d Compare June 22, 2026 23:55
@haakon-e
haakon-e force-pushed the he/rosenbrock-2m-p3 branch from a5d4a45 to 631d52a Compare June 26, 2026 01:22
@haakon-e
haakon-e force-pushed the he/rosenbrock-2m-p3 branch from 631d52a to 62a00be Compare June 26, 2026 01:31
@haakon-e
haakon-e force-pushed the he/rosenbrock-2m-p3 branch from 62a00be to 0f9989e Compare July 1, 2026 05:34
@haakon-e
haakon-e force-pushed the he/rosenbrock-2m-p3 branch from 0f9989e to b3cba94 Compare July 1, 2026 05:46
@haakon-e
haakon-e force-pushed the he/rosenbrock-2m-p3 branch from b3cba94 to 4cc8acb Compare July 1, 2026 06:24
@haakon-e
haakon-e force-pushed the he/rosenbrock-2m-p3 branch from 4cc8acb to 5336a31 Compare July 1, 2026 15:01
@haakon-e
haakon-e force-pushed the he/rosenbrock-2m-p3 branch from 5336a31 to 558fe72 Compare July 8, 2026 04:34
@haakon-e
haakon-e force-pushed the he/rosenbrock-2m-p3 branch from 558fe72 to 4eff57c Compare July 10, 2026 02:14
@haakon-e
haakon-e force-pushed the he/rosenbrock-2m-p3 branch from 4eff57c to f91130e Compare July 10, 2026 23:15
@haakon-e
haakon-e force-pushed the he/rosenbrock-2m-p3 branch from f91130e to 5ae5e06 Compare July 11, 2026 00:58
@haakon-e
haakon-e force-pushed the he/1m-ad branch 2 times, most recently from daa78f8 to 19dbc82 Compare July 11, 2026 02:14
@haakon-e
haakon-e force-pushed the he/rosenbrock-2m-p3 branch from 1082418 to 61d0407 Compare July 11, 2026 02:31
haakon-e added 4 commits July 10, 2026 20:24
Extend the unified RosenbrockAverage framework to the one-moment model:
add the DonorCellJacobian and CoupledDonorJacobian providers and channel
masks, the rosenbrock_donor() and rosenbrock_coupled() presets, and the
Microphysics1Moment substep driver. LinearizedAverage now forwards to
rosenbrock_donor(), the donor-cell configuration of the framework. The
one-moment kernels are made ForwardDiff-able so rosenbrock_exact() runs
on the 1M model. Documentation and Float64/Float32 tests cover the
donor/coupled/exact presets, the keyword constructor, donor-equals-
LinearizedAverage, and zero-allocation hot calls.
The 2M+P3 RosenbrockAverage entry point dispatches only on ExactJacobian
(or ManualJacobian); the default RosenbrockAverage() selects DonorJacobian,
which the guard rejects with an ArgumentError. Pass rosenbrock_exact() so
the kernel exercises the intended path.
Extract the shared saturation bisection from the two
EndStateSaturationAdjustment methods. Rename _jacobian_1m_relinearized to
_jacobian_1m_coupled to match CoupledDonorJacobian and rosenbrock_coupled().
Parametrize the 1M convergence tests over the limiter-free presets and use
named presets instead of the bare default constructor; drop a rationale
comment covered by the AD-compatibility guide.
Cover rosenbrock_donor, rosenbrock_coupled, and rosenbrock_exact through
the 1M bulk_microphysics_tendencies entry on the GPU backend.
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