Skip to content

aerosol: give radmod the particle radius the namelist asked for - #60

Open
Sohex wants to merge 1 commit into
alphaparrot:masterfrom
Sohex:fix/aerosol-particle-radius
Open

aerosol: give radmod the particle radius the namelist asked for#60
Sohex wants to merge 1 commit into
alphaparrot:masterfrom
Sohex:fix/aerosol-particle-radius

Conversation

@Sohex

@Sohex Sohex commented Aug 19, 2026

Copy link
Copy Markdown

apart, the aerosol particle radius, is declared twice -- in aeromod and in radmod, both defaulting to 50 nm -- and only aeromod's is in a namelist. aero_ini reads aero_nl into aeromod's copy and use-associates l_aerorad and aerofile from radmod, but not apart, so radmod's copy keeps its compiled default however the run is configured.

The two halves of the shortwave optical depth then disagree about the particle. aerocore calls mmr2n(mmr, apart, rhop, ...) with aeromod's value, so the number density nrho is right for the particle the run asked for. radmod's aeroprof then computes

daerod = nrho * PI * apart**2 * qex1 * zdz

with radmod's value. For fixed mass nrho goes as 1/r³ and the optical depth as nrho·r², so a consistent calculation goes as 1/r; with the copies disagreeing the model computes nrho(r_true) * r_radmod², and

τ_computed / τ_intended = (50e-9 / r_true)²

Both defaults are 50 nm, so nothing happens until a run sets apart — but a run that sets it is exactly a run that meant to. At 500 nm the radiation sees 1% of the intended optical depth; at 1 µm, 0.25%.

Why it is invisible

radmod also declares namelist/aero_nl/ including its own apart, and nothing in radmod ever opens or reads that namelist — aero_ini is the only reader and it reads aeromod's group. So radmod looks wired up and is not. That declaration is removed here, because leaving it is what makes the defect impossible to see by reading.

The fix

Two lines of mechanism: aero_ini copies its namelist value into radmod's, and radini broadcasts it beside the l_aerorad broadcast already there. The two variables stay separate because radmod cannot use aeromod — aeromod already uses radmod, and make_plasim compiles it second.

Compiles at T21/8. No behaviour change for any run that leaves apart at its default.

`apart`, the aerosol particle radius, is declared twice: in `aeromod` and in
`radmod`, both defaulting to 50 nm. Only aeromod's is in a namelist. `aero_ini`
reads `aero_nl` into aeromod's copy and use-associates `l_aerorad` and
`aerofile` from radmod, but not `apart`, so radmod's copy keeps its compiled
default however the run is configured.

Both halves of the shortwave aerosol optical depth then disagree about the
particle. `aerocore` calls `mmr2n(mmr, apart, rhop, ...)` with aeromod's value,
so the number density `nrho` is right for the particle the run asked for.
`radmod`'s `aeroprof` then computes

    daerod = nrho * PI * apart**2 * qex1 * zdz

with radmod's value. For a fixed mass mixing ratio `nrho` goes as 1/r**3 and the
optical depth as nrho*r**2, so a consistent calculation goes as 1/r; with the
two copies disagreeing the model computes nrho(r_true) * r_radmod**2 instead,
and

    tau_computed / tau_intended = (50e-9 / r_true)**2

Both defaults are 50 nm, so nothing happens until a run sets `apart` -- but a
run that sets it is exactly a run that meant to.

WHY IT IS INVISIBLE. radmod also declares `namelist/aero_nl/` including its own
`apart`, and nothing in radmod ever opens or reads that namelist; `aero_ini` is
the only reader and it reads aeromod's group. So radmod looks wired up and is
not. That declaration is removed here, because leaving it is what makes the
defect impossible to see by reading.

THE FIX is two lines of mechanism: `aero_ini` copies its namelist value into
radmod's, and `radini` broadcasts it beside the `l_aerorad` broadcast that is
already there. The two variables stay separate because radmod cannot use
aeromod -- aeromod already uses radmod, and make_plasim compiles it second.

Worth knowing for anyone with results from this module: the scaling is quadratic
and unforgiving. At a 500 nm particle the radiation sees 1% of the intended
optical depth; at 1 um, 0.25%.

Co-Authored-By: Claude Opus 5 (1M context) <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