Skip to content

Aerosol interaction vn14.2 - #20

Draft
paulfield2024 wants to merge 3 commits into
MetOffice:mainfrom
paulfield2024:aerosol_interaction_vn14.2
Draft

Aerosol interaction vn14.2#20
paulfield2024 wants to merge 3 commits into
MetOffice:mainfrom
paulfield2024:aerosol_interaction_vn14.2

Conversation

@paulfield2024

@paulfield2024 paulfield2024 commented Aug 14, 2026

Copy link
Copy Markdown

PR Summary

Sci/Tech Reviewer:
Code Reviewer:

Code Quality Checklist

(Some checks are automatically carried out via the CI pipeline)

  • I have performed a self-review of my own code
  • My code follows the project's style guidelines
  • Comments have been included that aid understanding and enhance the readability of the code
  • My changes generate no new warnings

Testing

  • If shared files have been modified, I have run the UM and LFRic Apps rose
    stem suites
  • If any tests fail (rose-stem or CI) the reason is understood and
    acceptable (eg. kgo changes)
  • I have added tests to cover new functionality as appropriate (eg. system
    tests, unit tests, etc.)

trac.log

Security Considerations

  • I have reviewed my changes for potential security issues
  • Sensitive data is properly handled (if applicable)
  • Authentication and authorisation are properly implemented (if applicable)

Performance Impact

  • Performance of the code has been considered and, if applicable, suitable performance measurements have been conducted

AI Assistance and Attribution

  • Some of the content of this change has been produced with the assistance of Generative AI tool name (e.g., Met Office Github Copilot Enterprise, Github Copilot Personal, ChatGPT GPT-4, etc) and I have followed the Simulation Systems AI policy (including attribution labels)

Documentation

  • Where appropriate I have updated documentation related to this change and confirmed that it builds correctly

Sci/Tech Review

  • I understand this area of code and the changes being added
  • The proposed changes correspond to the pull request description
  • Documentation is sufficient (do documentation papers need updating)
  • Sufficient testing has been completed

Please alert the code reviewer via a tag when you have approved the SR

Code Review

  • All dependencies have been resolved
  • Related Issues have been properly linked and addressed
  • CLA compliance has been confirmed
  • Code quality standards have been met
  • Tests are adequate and have passed
  • Documentation is complete and accurate
  • Security considerations have been addressed
  • Performance impact is acceptable

…_max_mact

Ports the CASIM SVN branch
dev/paulfield/um13.9_um13.9_casim_max_mact@12572 (created from
casim/trunk@11952) onto the vn14.1 baseline.

Changes:
- aerosol_routines: increase max mean activated mass threshold, aerosol
  tidyup, handle zeros in aerosol
- activation: replace erfg/casim_erfc with intrinsic erf/erfc
- sedimentation: add limits for aerosol sedimentation
- mphys_tidy: aerosol tidy-up rework
- special: minor supporting change
@github-actions github-actions Bot added the cla-required The CLA has not yet been signed by the author of this PR - added by GA label Aug 14, 2026
@github-actions

Copy link
Copy Markdown

Hello paulfield2024! 👋

Thank you for your contribution. Since this is your first time contributing to this repository, we ask that you sign our Contributor Licence Agreement (CLA).

📄 You can read the CLA here.

To agree to the CLA, please add your details (GitHub username, Real Name, Affiliation, and Date) to the CONTRIBUTORS.md file (create one, if required) in the development branch for this PR. After signing the CLA, you won't need to do this again for future PRs.

@paulfield2024

Copy link
Copy Markdown
Author

This PR is linked to UM PR

Summary of changes on aerosol_interaction_vn14.2

activation.F90
dactive/dmass_d are now always initialized to zero before the ice-nucleation branch (previously only for iopt_inuc < 4), and the higher-order-scheme branch condition changed from else to explicit iopt_inuc > 3. Prevents possible use of uninitialized values for warm/low-Smax cases.

aerosol_routines.F90
aero_mact_mean_max/dust_mact_mean_max caps raised from small physical limits (~1e-15/1e-13 kg) to effectively unlimited (1e30), and most mact*_mean = min(...) clamps for secondary/tertiary categories (mact2, mact3, mact1) are commented out. Only the primary mact_mean clamp remains, but now also reduces nact/ntot (number) proportionally when the mean-mass cap is hit, rather than only capping mass.

Effect: aerosol/dust mean activated particle mass is essentially no longer artificially capped except in one place, and when it is capped, number concentration is now also adjusted to stay consistent — avoids unphysical size clamping ("bug" workaround) but changes activated-aerosol mass/number partitioning throughout activation.

mphys_tidy.F90
Adds a new "tidy" pass that zeros out several aerosol tracers (i_am1/i_an1 Aitken sol, i_am2/i_an2 Accum sol, i_am3/i_an3 Coarse sol, i_am6/i_an6 Coarse dust, i_am10/i_an10) when their mass or number falls below new aeromass_small/aeronumber_small thresholds (from thresholds module).
l_qsig/l_qsneg reset from indexing only element 0 to resetting the whole array; adds reset flags for qr, nl, ql, ni.
Fixes an index bug: an i_an12 reference in a conservation check for i_an11 corrected to i_an11.

sedimentation.F90
Aerosol/dust mass sedimentation fluxes (dmac, dmad) for cloud/rain/ice/snow/graupel categories are now capped with `min(flux, mact/(step_length*rdz_on_rho))' This limits sedimentation flux so it can't remove more aerosol/dust mass from a level than is actually present in one timestep. Applied consistently in both interior-level and boundary (top-level) flux calculations.

special.F90
casim_erfc now uses the intrinsic erfc(x) instead of erfg(x,c), noting a bug in erfg for c=1 and small x.

What it affects
Aerosol/dust activation and scavenging physics: activated aerosol mass/number partitioning across cloud, rain, ice, snow, graupel; aerosol mass conservation/tidy-up (small-value flushing); and aerosol/dust sedimentation flux stability (prevents non-physical over-removal). Also fixes a small numerical bug in the complementary error function used elsewhere in the microphysics. These changes primarily affect simulations with aerosol-cloud interaction (l_ased/dust/aerosol tracers) enabled. This should improve stability/conservation but will change aerosol-related diagnostics and activated hydrometeor mass/number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-required The CLA has not yet been signed by the author of this PR - added by GA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants