Aj/bulk micro options part2#717
Open
trontrytel wants to merge 1 commit into
Open
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #717 +/- ##
==========================================
+ Coverage 92.19% 92.24% +0.05%
==========================================
Files 55 55
Lines 2420 2450 +30
==========================================
+ Hits 2231 2260 +29
- Misses 189 190 +1
🚀 New features to boost your workflow:
|
9c23633 to
0f0343e
Compare
sajjadazimi
approved these changes
May 22, 2026
| return accretion(mp.cloud.ice, mp.precip.rain, mp.terminal_velocity.rain, mp.collision, q_icl, q_rai, ρ) | ||
| end | ||
|
|
||
| @inline accretion(::CMP.NoCloudIceSnowAccretion, mp, tps, micro, thermo) = zero(thermo.T) |
Member
There was a problem hiding this comment.
These define different processes. Maybe renaming them to what converts to what is useful. For example accretion_ice_snow, accretion_ice_rain, accretion_liquid_rain. This also helps avoid the confusion that what processes must be chosen by a non-expert user.
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.
Refactor 1-moment microphysics process options
Summary
This PR refactors how individual microphysical processes are enabled and disabled in the 1-moment scheme. Every process now has an explicit
No*option that returns zero tendency, and each process is addressed individually via option dispatch. Accretion processes are added to the options struct for the first time. TheVarTimescaleAcnvoption has been moved from CM2 to CM1 module and its parameters are consolidated into the 1M parameter tree. All callers — bulk tendencies, tests, docs — are updated.Changes
src/parameters/Microphysics1MOptions.jlNo*option singletons for every process so each one can be individually disabled:NoCloudLiquidFormation,NoCloudIceFormation,NoRainAutoconversion,NoSnowAutoconversion,NoRainCondensationEvaporation,NoSnowDepositionSublimation,NoSnowMelt, and one for each accretion pair.CloudIceMeltToLiquid→CloudIceMeltLiquidAutoconv1M→RainAutoconversion1MLiquidAutoconv2M→RainAutoconversionPrescribedNdSnowAutoconvNoSupersat/WithSupersat→SnowAutoconversionNoSupersaturation/WithSupersaturationEvaporationOnly→RainEvaporationSublimationOnly→SnowSublimationDepositionSublimation→SnowDepositionSublimationrain_evaporation→rain_condensation_evaporationsnow_sublimation→snow_deposition_sublimationcloud_liquid_autoconversion→rain_autoconversionMicrophysics1MOptions:CloudLiquidRainAccretion,CloudLiquidSnowAccretion,CloudIceRainAccretion,CloudIceSnowAccretion,RainSnowAccretion(each with a correspondingNo*variant).RainIceAccretion(previously an undifferentiated accretion flag).src/parameters/Microphysics1MParams.jlprescribed_Ncfield; droplet number concentration is now stored insideVarTimescaleAcnv.Nc.FTtype parameter fromMicrophysics1MParams.src/parameters/Microphysics1M.jlVarTimescaleAcnvexport and definition (moved fromMicrophysics2M.jl). It now holdsτ,α, andNcas a single struct.src/parameters/Microphysics2M.jlVarTimescaleAcnvstruct, constructor, and export (moved toMicrophysics1M.jl).src/Microphysics1M.jlconv_q_lcl_to_q_raifrom a directAcnv1M-struct-based call to option dispatch:conv_q_lcl_to_q_rai(::NoRainAutoconversion | ::RainAutoconversion1M | ::RainAutoconversionPrescribedNd, mp, tps, micro, thermo).accretionwrappers to option dispatch for all four cloud-precip pairs (CloudLiquidRainAccretion,CloudLiquidSnowAccretion,CloudIceRainAccretion,CloudIceSnowAccretion).accretion_snow_rain(::NoRainSnowAccretion | ::RainSnowAccretion, mp, tps, micro, thermo)that calls both the cold and warm collision arms and returns(; S_rai_sno, S_sno_rai, S_melt).accretion_rain_sinkpublic docstring (it is now an internal-only low-level kernel).src/BulkMicrophysicsTendencies.jlMicrophysics1MOptions, passing the fullmpstruct through to each process wrapper.