Skip to content

PartMC: no crustal-fraction limit on the upper hysteresis curve - #4

Open
mwest1066 wants to merge 1 commit into
partmc-libraryfrom
crustal-threshold-particle-resolved
Open

mwest1066 wants to merge 1 commit into
partmc-libraryfrom
crustal-threshold-particle-resolved

Conversation

@mwest1066

@mwest1066 mwest1066 commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

PartMC: no crustal-fraction limit on the upper hysteresis curve

Branch crustal-threshold-particle-resolved (one commit on partmc-library at 2c5e006, i.e. after PR #2). Files:
MOSAIC_v2/aerosol/module_mosaic_ext.f90 (+12 -3, in
MESA_convergence_criterion),
MOSAIC_v2/datamodules/module_data_mosaic_aero.f90 (+6: the parameter
xhyst_up_crustal_thresh_partmc = 1.0_r8 and its comment).

Problem

MESA_convergence_criterion declares a bin whose salts have all dissolved
(sumflux = 0) fully liquid, i.e. on the upper hysteresis curve, only if
its crustal solids (OIN, CaCO3, CaSO4) are at most
xhyst_up_crustal_thresh = 0.30 of its dry mass. The comment with the
parameter gives the reason: in a sectional or modal model mineral dust is
mostly externally mixed within a bin, so a minor dust fraction will reside
in a minor fraction of the bin's particles and should not control the
bin's water (earlier MOSAIC versions used 0.0).

In PartMC every bin is one particle, so the averaging argument does not
apply: the crustal material is in the particle itself. A dust-rich
particle (more than 30% crustal) whose salts have all dissolved is then
never put on the upper curve. It stays "mixed" on the lower curve with no
solid salt, is solid again below its MDRH (instead of staying liquid down
to its CRH, as other particles that deliquesced do), and is deliquesced
from scratch and handed to MESA_PTC again in every phase-state
evaluation, where MESA_PTC finds in one iteration that there is nothing
to do.

Measurements

PartMC (update_mosaic, 1716875) linked against MOSAIC built as
compile.sh does for gfortran (-O2 -g -fallow-argument-mismatch,
gfortran 14.3, Perlmutter CPU node). Urban plume scenario, 24 h, 10000
particles, del_t 60 s, hourly output, rand_init 7, coagulation off. With
coagulation off and flat (or flat_source) weighting no random decision of PartMC depends on
the particles' composition, so every run has the same particles (checked:
the particle ids agree in every output) and the differences between runs
come from the chemistry alone. Numbers: largest relative difference over
the 24 hourly outputs.

The current code has run-to-run noise of 1e-3 to 1e-2 in the bulk species
from the switch at XT = 2 (companion PR xt-roundoff-tolerance), larger
than the effect of this change in most quantities. So the change is
measured on top of the companion branch: "effect" is the merge of both
branches against xt-roundoff-tolerance alone; "noise" is
xt-roundoff-tolerance with the particles handed to MOSAIC in a different
random order at every step (a test-only change of PartMC's
mosaic_from_partmc/mosaic_to_partmc; see the companion PR) against the
same without. Four scenarios: as it is (flat weighting, initial RH 95%;
few dust particles), weight_type flat_source (one flat weight per
source, so that the rare paved-road dust emission gets its share of the
computational particles), and initial RH 80% and 60%.

scenario run gases (max of HNO3, NH3, HCl) bulk NO3, NH4, Cl bulk H2O particle-outputs on the other leg on upper curve (24 h mean)
as it is noise 1.0e-6 1e-7, 9e-8, 4e-7 2e-7 69 of 362864 0.582
effect 1.4e-6 1e-7, 7e-8, 3e-7 8e-5 80 0.582
flat_source noise 1.7e-6 1e-5, 2e-6, 4e-5 4e-6 10 of 280589 0.533
effect 2.2e-6 2e-5, 3e-6, 6e-5 1e-4 35360 (12.6%) 0.533 -> 0.658
initial RH 80% noise 1.9e-6 1e-6, 7e-7, 3e-6 2e-6 24 of 362864 0.282
effect 2.6e-6 2e-7, 2e-7, 4e-6 2e-3 36 0.282
initial RH 60% (dry all day) noise 1.0e-7 1e-8, 9e-9, 4e-8 2e-8 0 of 362864 0.000
effect 1.3e-7 2e-7, 2e-7, 3e-6 1e-3 8 0.000

So with flat_source weighting one in eight particle-outputs moves to the
upper curve (the dust-rich particles whose salts have dissolved; 53% -> 66%
of the particles on the upper curve). The gases and the bulk NO3, NH4 and
Cl change by no more than the noise; bulk water changes by up to 0.2%
(RH 80%: hours 11 and 12; RH 60%: hours 11 to 16; as it is: 8e-5 in hours
11 to 16), where the noise is 1e-6 or less.

Alone against partmc-library as it is, the change is hidden in the
current noise: as it is, the largest differences (gas NH3 5.0e-3, bulk NO3
7e-4, H2O 7e-4) are of the size of the shuffled-order noise of the current
code or below it (two seeds: NH3 3.2e-3, 4.8e-3; NO3 8e-3, 1e-2; H2O 3e-3,
2e-3); with flat_source they are two to three times the noise of one
shuffled run (gas NH3 9.2e-3, bulk NO3 3e-3, H2O 2e-3 against 5.5e-3,
1e-3, 1e-3), and
35469 particle-outputs move to the upper curve (0.533 -> 0.659), as on top
of the companion branch.

Cost (wall time of the 24 h runs, side by side on one node, so +-1 to 2%):
as it is 336 s with the change against 334 s without (on top of the
companion branch; 332 s against 332 s alone); flat_source 250 s against
263 s (248 s against 258 s alone), i.e. 4 to 5% faster, presumably
because the dust-rich particles no longer go through MESA_PTC at every
evaluation (not profiled);
RH 80% 290 s against 291 s; RH 60% 138 s against 137 s.

The change

    ! PartMC: each bin is one particle (see module_data_mosaic_aero)
    if (m_partmc_mosaic > 0) then
       crustal_thresh = xhyst_up_crustal_thresh_partmc     ! 1.0
    else
       crustal_thresh = xhyst_up_crustal_thresh            ! 0.30
    endif
    if ( sumflux .eq. 0.0 .and. &
         crustal_solids .le. crustal_thresh*(mass_dry_a(ibin)*1.0e15) ) then

Why this form. The change should apply where each bin is a single
particle, and nowhere else. Choices considered:

  • mSIZE_FRAMEWORK == mUNSTRUCTURED: PartMC sets it, but so does the
    MOSAIC box model's own example input (case1.inp: msize_framework = 2), where a bin is a population. Not used.
  • A module variable with default 0.30 that PartMC sets: needs a change in
    PartMC's mosaic_init (PartMC's src/mosaic.F90 sets MOSAIC's module
    variables directly; MOSAIC has no PartMC initialisation routine of its
    own), i.e. a second PR in another repository.
  • m_partmc_mosaic > 0 (chosen): MOSAIC's existing flag for "coupled to
    PartMC". PartMC's mosaic_init sets it to 100, the MOSAIC box model's
    readinputfile sets it to 0, and MOSAIC already uses it for the other
    PartMC-specific branches (module_mosaic_aerdynam_intr,
    module_mosaic_init_aerosol, module_pmcmos_aer,
    mosaic_allocate_memory). No change to PartMC is needed, and the box
    model and the sectional/modal uses are unchanged.

1.0 means no restriction: crustal_solids <= the whole dry mass always
holds. (The comparison is kept, so that the expression is the same as
before for the other hosts.)

What was checked

  • Builds with gfortran 14.3 (Perlmutter) and PartMC runs the urban plume
    for 24 h with it, alone and merged with xt-roundoff-tolerance, in the
    four scenarios above.
  • The branch merges cleanly with xt-roundoff-tolerance.

Left for the reviewer to judge

  • The physics: a dust-rich particle whose salts have dissolved now keeps
    its water down to its crystallisation point (CRH) on drying, like any
    other particle that deliquesced, instead of losing it at its MDRH. We
    think that is right for a single particle (there is no hidden external
    mixture to average over), but it is a change of the model.
  • Whether PartMC should rather be able to choose the value (a variable
    that PartMC sets), e.g. for comparisons with sectional models.
  • Whether 1.0 (no limit) or another value is wanted: with no averaging,
    any value below 1 is a statement about the particle's own hygroscopicity
    rather than about mixing.

Relation to other PRs

  • Based on partmc-library after PR Compile with -O2 and avoid per-bin work-array allocation #2 (-O2 under gfortran, per-bin work
    arrays; merged), which changed no result.
  • Companion PR xt-roundoff-tolerance: independent; touches other lines.
    Its effect is larger, and it removes the run-to-run noise that would
    otherwise hide most of the effect of this change; hence the measurements
    above on top of it.

🤖 Generated with Claude Code

MESA_convergence_criterion declares a bin whose salts have all dissolved
fully liquid (upper hysteresis curve) only if its crustal solids (OIN,
CaCO3, CaSO4) are at most xhyst_up_crustal_thresh = 0.30 of its dry mass.
The reason given with the parameter is that in a sectional or modal model
dust is mostly externally mixed within a bin, so a minor dust fraction
should not control the water of the whole bin.

In PartMC each bin is one particle, so that reason does not apply, and a
dust-rich particle whose salts have dissolved stays "mixed" on the lower
curve indefinitely. When MOSAIC is coupled to PartMC (m_partmc_mosaic > 0,
the flag PartMC's mosaic_init sets and the other PartMC-specific branches
of MOSAIC already test) the threshold is now
xhyst_up_crustal_thresh_partmc = 1.0 (no restriction): such a particle
goes to the upper curve like any other. The MOSAIC box model and other
hosts (m_partmc_mosaic <= 0) are unchanged.

Co-Authored-By: Claude Opus 5.5 <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