Skip to content

feat(P3): implement additional rates + some fixes#681

Merged
haakon-e merged 6 commits into
mainfrom
he/update-p3-melting
Jun 11, 2026
Merged

feat(P3): implement additional rates + some fixes#681
haakon-e merged 6 commits into
mainfrom
he/update-p3-melting

Conversation

@haakon-e

@haakon-e haakon-e commented Feb 12, 2026

Copy link
Copy Markdown
Member

Purpose: Integrate the P3 ice scheme with the two-moment microphysics

This branch makes the P3 ice category usable as a coupled component of the two-moment scheme, rather than a standalone solver. The motivation is to expose P3 ice processes (collisions, melting, nucleation, sedimentation) through the shared bulk-tendencies entry point so that a host model can drive 2M liquid and P3 ice consistently and performantly.

Rationale for the principal changes:

  • Explicit P3State. Ice shape/threshold properties were previously recomputed ad hoc at each call site. Centralising them in a single, type-stable state object removes redundant work, makes the per-process interfaces uniform, and is a prerequisite for the GPU-ready paths below.
  • Rates without time-step limiting. Melting and nucleation now return true instantaneous tendencies instead of pre-capping to the available mass/number over dt. Capping is the integrator's responsibility; doing it inside the process broke composability across sub-steps and conflated the physics with the numerics.
  • 2M+P3 collision path and BMT coupling. A type-stable, allocation-free liquid–ice collision path and the bulk-tendencies entry point are what let P3 ice run on GPU at acceptable cost and interoperate with the existing 2M tendencies.
  • Frostenberg INP nucleation. Adds an immersion-freezing parameterisation needed for realistic heterogeneous ice formation.

Tests and reference values were updated to reflect the new (uncapped) rates and the refactored APIs; numerical smoke references that shifted were re-derived and verified.

@haakon-e

haakon-e commented Feb 12, 2026

Copy link
Copy Markdown
Member Author

@haakon-e haakon-e changed the base branch from he/docs-improve-formatting-fix-typo to main February 17, 2026 21:53
@haakon-e haakon-e force-pushed the he/update-p3-melting branch 3 times, most recently from eeadbe5 to 1f5f9a8 Compare February 20, 2026 20:12
@haakon-e haakon-e changed the base branch from main to he/fix-2m-tendencies March 2, 2026 00:50
@haakon-e haakon-e force-pushed the he/update-p3-melting branch from 1f5f9a8 to c172fe9 Compare March 2, 2026 00:50
@haakon-e haakon-e force-pushed the he/fix-2m-tendencies branch from fbd7881 to e88d224 Compare March 2, 2026 01:04
@haakon-e haakon-e force-pushed the he/update-p3-melting branch from c172fe9 to 5e20908 Compare March 2, 2026 01:04
@haakon-e haakon-e force-pushed the he/fix-2m-tendencies branch from e88d224 to f5021ff Compare March 2, 2026 01:45
@haakon-e haakon-e force-pushed the he/update-p3-melting branch from 5e20908 to 85389a5 Compare March 2, 2026 01:45
@haakon-e haakon-e force-pushed the he/fix-2m-tendencies branch from f5021ff to 5c10212 Compare March 2, 2026 01:48
@haakon-e haakon-e force-pushed the he/update-p3-melting branch from 85389a5 to 07bcdda Compare March 2, 2026 01:48
@haakon-e haakon-e force-pushed the he/fix-2m-tendencies branch from 5c10212 to c06175b Compare March 2, 2026 01:49
@haakon-e haakon-e force-pushed the he/update-p3-melting branch from 07bcdda to e3cf649 Compare March 2, 2026 01:49
@haakon-e haakon-e force-pushed the he/fix-2m-tendencies branch 2 times, most recently from ec34417 to d3091fb Compare March 2, 2026 02:05
@haakon-e haakon-e force-pushed the he/update-p3-melting branch 2 times, most recently from f0ea9b8 to e1dd6a8 Compare March 2, 2026 02:22

@haakon-e haakon-e left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments to assist review.

Comment thread docs/src/plots/P3ImmersionFreezing.jl
Comment thread docs/src/plots/P3Melting.jl
Comment thread src/parameters/Microphysics2MParams.jl Outdated
Comment thread src/BulkMicrophysicsTendencies.jl Outdated
dn_ice_dt += n_dep
dq_ice_dt += m_dep
dq_rim_dt += m_dep
db_rim_dt += m_dep / 900

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dividing by 900 here is related to my note to self in src/parameters/MicrophysicsP3.jl. Need to check which ice densities I need.

Comment thread src/BulkMicrophysicsTendencies.jl Outdated
Comment thread src/IceNucleation.jl
Comment thread src/P3_processes.jl
Comment thread src/P3_processes.jl
@haakon-e haakon-e force-pushed the he/fix-2m-tendencies branch from d3091fb to 9a89238 Compare March 11, 2026 22:47
@haakon-e haakon-e force-pushed the he/update-p3-melting branch from e1dd6a8 to 3223573 Compare March 11, 2026 22:47
@haakon-e haakon-e force-pushed the he/fix-2m-tendencies branch from 9a89238 to d11950c Compare March 11, 2026 22:54
@haakon-e haakon-e force-pushed the he/update-p3-melting branch from 3223573 to 14b07f3 Compare March 11, 2026 22:54
@haakon-e haakon-e changed the title fix: do not limit P3 melting with dt feat(P3): implement additional rates + some fixes Mar 11, 2026
@haakon-e haakon-e force-pushed the he/fix-2m-tendencies branch from d11950c to 74e6b25 Compare March 11, 2026 23:10
@haakon-e haakon-e force-pushed the he/update-p3-melting branch from 14b07f3 to d1764d5 Compare March 11, 2026 23:10
Comment thread src/P3_particle_properties.jl
Comment thread src/P3_particle_properties.jl
Comment thread src/P3_particle_properties.jl
Comment thread src/P3_particle_properties.jl
Comment thread src/P3_particle_properties.jl
Comment thread src/P3_processes.jl
Comment thread src/P3_processes.jl
Comment thread src/P3_processes.jl
Comment thread src/P3_processes.jl
Comment thread src/P3_processes.jl
Comment thread src/P3_processes.jl
Comment thread src/P3_processes.jl
Comment thread src/P3_processes.jl
Comment thread src/P3_processes.jl
Comment thread src/P3_processes.jl
Comment thread src/P3_processes.jl
Comment thread src/P3_processes.jl
Comment thread src/P3_processes.jl
Comment thread src/P3_processes.jl
Comment thread src/P3_processes.jl
Comment thread src/P3_size_distribution.jl
Comment thread src/P3_size_distribution.jl
Comment thread src/P3_size_distribution.jl
Comment thread src/P3_terminal_velocity.jl
Comment thread src/P3_terminal_velocity.jl
Comment thread src/Quadrature.jl
Comment thread src/Utilities.jl
Comment thread src/Utilities.jl
Comment thread src/Utilities.jl
end

"""
rime_mass_fraction(q_rim, q_ice, q_ice_half)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this in Utilities and not P3 code?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept them here since they're very simple wrappers so it felt natural to have them near the "actual" code. Then I didn't want sgs_weight_function and _regularised_ratio in P3 code, so I put them here.

Happy to move them

Comment thread src/Utilities.jl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved 🍀 P3 Predicted particle properties

Projects

None yet

Development

Successfully merging this pull request may close these issues.

P3: Microphysical rates Add collisions/coalescence parameterizations

3 participants