Re-add diagnostic-Nc activation for the 2M scheme#729
Draft
haakon-e wants to merge 1 commit into
Draft
Conversation
Member
Author
|
This change is part of the following stack:
Change managed by git-spice. |
This was referenced Jun 14, 2026
2f8f8ba to
fac357f
Compare
2a5dd29 to
fd01299
Compare
fac357f to
aaf6093
Compare
fd01299 to
b543310
Compare
Restore the activation-closure dispatch dropped before the P3 merge, trimmed to the consumer-ready pieces: an AbstractActivationScheme with NoActivation (the default null source) and DiagnosticNc, which relaxes the prognostic droplet number toward a prescribed target on a fixed physical timescale while cloud mass is present (the RCEMIP-I closure). The fused 2M tendency dispatches through activation_source and folds the result into dn_lcl_dt; the w/p ambient inputs stay positional for the supersaturation-driven closures to come. This mirrors the options pattern of the 1M scheme's PrescribedNd (which shapes autoconversion from a prescribed droplet number instead of sourcing a prognostic one). Twomey and Abdul-Razzak-Ghan tiers stay deferred to a broader activation API.
aaf6093 to
603d7a2
Compare
b543310 to
c500623
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re-add diagnostic-Nc activation for the 2M scheme
Motivation
The aerosol-activation closure dispatch was dropped from the 2-moment scheme before the P3 merge, leaving the fused 2M tendency with a hardwired zero cloud-droplet number source. The host model could supply its own activation, but there was no in-scheme way to source the prognostic droplet number, which the diagnostic-Nc closure that RCEMIP-I and pre-ARG GCM configurations rely on requires. This PR restores activation, trimmed to the consumer-ready pieces.
What changed
A small activation-scheme type hierarchy is added: an abstract AbstractActivationScheme with two concrete schemes, NoActivation (the default null source) and DiagnosticNc. Each is a pure immutable parameter struct that fully specifies one closure, and the fused 2M tendency dispatches on the scheme type through a new activation_source helper whose result is folded into the cloud-droplet number tendency dn_lcl_dt.
DiagnosticNc relaxes the prognostic droplet number toward a prescribed target on a fixed physical timescale while cloud mass is present: while cloud liquid mass exceeds a threshold the target is the prescribed number and the tendency is (target - n) / tau, otherwise the target is zero (cloud has evaporated) and the tendency drives n back toward zero on the same timescale. Two design points are worth stating. The relaxation timescale is a fixed physical time, not the integrator timestep: relaxing by 1/dt would produce an infinitely stiff source as an adaptive solver refines the step, which is the same 1/dt-clip pathology avoided elsewhere in this stack. The cloud-existence threshold on liquid mass avoids activating into essentially vapor-only cells, where numerical noise in the liquid mass would otherwise create phantom droplets.
The scheme is wired through WarmRainParams2M as an activation_scheme field defaulting to NoActivation, so existing constructions are unaffected, and surfaced as an activation_scheme keyword on the TOML constructors. The vertical-velocity and pressure ambient inputs are kept as positional arguments to activation_source even though DiagnosticNc ignores them, so the call site can broadcast and the supersaturation-driven closures to come can read them without an interface change.
This mirrors the options pattern of the 1-moment scheme's PrescribedNd, which shapes autoconversion from a prescribed droplet number rather than sourcing a prognostic one: a parameter struct selected by the caller, dispatched on inside the tendency.
Scope and deferred work
This restores only the diagnostic-Nc tier. The supersaturation-driven activation closures (Twomey, Abdul-Razzak-Ghan) and a prognostic activation-memory model are deferred to a broader activation API; the positional ambient inputs are the seam left for them.
Testing
The activation_schemes tests cover NoActivation returning an exact zero source, DiagnosticNc relaxation in both the cloud-present and evaporated branches and across the threshold and timescale, activation folding correctly into the fused 2M tendency (the NoActivation default leaves the source at zero, and with DiagnosticNc enabled the droplet-number tendency increases by exactly the activation source), and the activation source typed concretely under mixed argument types.