Conversation
Bring the UM routines needed for CASIM mechanistic (ARG) activation on
one-way UKCA aerosol input into the lfric_apps CASIM directory:
aerosol_extract_convert_mod.F90
aerosol_extract_convert - UKCA tracers to CASIM modal mass,
number and Bk for the main CASIM call
casim_activation_in_um_mod.F90
examine_ukca_aerosol_column - UKCA tracers to the CASIM internal
aerosol arrays
activate_column_ukca - activation of cloud made by physics
outside CASIM
Both files are copied from src/atmosphere/large_scale_precipitation/CASIM
in the UM unaltered apart from the lfric_apps code styling (lower case
Fortran keywords and intrinsics). Only the routines needed for
casim_iopt_act = 3 with casim_aerosol_couple_choice = ukca_aerosol_in
have been taken; the murk, tracer and two-way UKCA variants are left
behind, and the public list of casim_activation_in_um_mod is trimmed to
match.
The UM routines are dimensioned over tdims. lfric_apps runs the UM
physics with row_length = rows = 1 inside column kernels, so tdims
covers a single column and the routines can be used unchanged.
Some of the content of this change has been produced with the assistance of Anthropic Claude Opus 5 (Claude Code).
The copied UM CASIM routines declare their UKCA tracer arguments with the UM module variable tr_ukca and index them with nmr_index_um and mmr_index_um, so both have to be available in lfric_apps. Add tr_ukca to nlsizes_namelist_mod and set it in set_ukca_field_lists, alongside the call that asks UKCA for its tracer list. nmr_index_um and mmr_index_um were only set up when plume scavenging was active, which ties them to the choice of convection scheme. They are now set up whenever UKCA is initialised. Some of the content of this change has been produced with the assistance of Anthropic Claude Opus 5 (Claude Code).
Introduce namelist:microphysics=casim_activation with values 'fixed' (the existing behaviour, casim_iopt_act = fixed_number) and 'arg' (mechanistic activation following Abdul-Razzak and Ghan, casim_iopt_act = 3). The 'arg' option requires the UKCA GLOMAP modal aerosol, so it errors if glomap_mode is anything other than glomap_mode_ukca. casim_set_dependent_switches only selects soluble_insoluble_modes when the ice nucleation scheme asks for the insoluble modes, and LFRic fixes casim_iopt_inuc at 1. Since LFRic supplies the full set of soluble and insoluble GLOMAP modes, casim_aerosol_option is overridden after the call. This is safe because the value is not passed to CASIM until the later call to set_mphys_switches. casim_cdnc_opt is now triggered by casim_activation == 'fixed', as it has no meaning when the droplet number is derived mechanistically from the aerosol. Some of the content of this change has been produced with the assistance of Anthropic Claude Opus 5 (Claude Code).
The CASIM Abdul-Razzak and Ghan activation needs the soluble and insoluble aerosol modes, which were previously hardwired to zero in the CASIM kernel. Add a helper which gathers the LFRic GLOMAP prognostics into a UKCA tracer array column, and use the UM aerosol_extract_convert to fill the CASIM aerosol arrays from it. Some of the content of this change has been produced with the assistance of Anthropic Claude Opus 5 (Claude Code).
Liquid cloud can be created or removed by physics outside CASIM. With the Abdul-Razzak and Ghan activation, the droplet number for any newly created cloud is worked out from the GLOMAP modal aerosol using the UM activate_column_ukca, and removed again where the cloud has gone. Keep copies of the liquid cloud from before the fast physics so that the change can be diagnosed, and take the in-cloud number for radiation from CASIM whenever the activation is mechanistic. Note that the activation holds the column aerosol in module level storage, so the activation algorithm is not thread safe. Some of the content of this change has been produced with the assistance of Anthropic Claude Opus 5 (Claude Code).
The GLOMAP mode number and component mass indices set up by ukca_set_conv_indices were previously built only for plume scavenging, and were made unconditional so that the CASIM aerosol interface could use them too. Running the setup in every UKCA configuration is wider than needed and exposes configurations that never called it to the ereport in ukca_set_conv_indices for an unrecognised component suffix. Gate it instead on the circumstances that actually need it: plume scavenging as before, or CASIM running with Abdul-Razzak and Ghan activation. The switches are taken from the microphysics namelist rather than the derived casim_iopt_act, which is only assigned inside the CASIM branch of um_physics_init. The copy in aerosol_ukca_dust_only_init reverts to the original plume scavenging test, as Abdul-Razzak and Ghan activation requires the full GLOMAP aerosol and so never reaches the dust-only path. Some of the content of this change has been produced with the assistance of Anthropic Claude Opus 5 (Claude Code).
James Bruten (james-bruten-mo)
left a comment
There was a problem hiding this comment.
Macro / rose-stem changes looks good
thomasmelvin
left a comment
There was a problem hiding this comment.
Minor comment on the text of use of AI models, otherwise looks fine to me
There was a problem hiding this comment.
The changes add in the ukca 1-way coupling to casim, only. This implements the casim_iopt_act=3 option, with casim carrying out the Abdul-Razzak and Ghan droplet activation and Cooper Nice-Temperature for the ice concentration.
Initial AMIP runs show realistic (and different to previous) values for cloud droplet number suggesting that it is implemented correctly (could add a screen grab of that for completeness?).
Erica Neininger (ericaneininger)
left a comment
There was a problem hiding this comment.
I have no real issues with this - just one minor comment about the code styling script used for one of the imported UM files.
Awaiting code owner approval for Gungho changes from CCD team (Ricky Wong (@mo-rickywong) )
There was a problem hiding this comment.
The styling script which has been run on this script has produced some slightly odd looking lowercase- UPPERCASE keyword features around OMP directives - all do ,end do, private etc keywords have been converted to lowercase, but some other keywords (e.g. PARALLEL, DEFAULT, SCHEDULE, STATIC, NO WAIT) have been left as uppercase.
Example on L278:
!$OMP do SCHEDULE(STATIC)
There was a problem hiding this comment.
I think this is a known issue with the code styling script for importing UM code - do you want me to make any changes by hand (and if so, what?)
There was a problem hiding this comment.
If you would please - I will open a PR on the styling script and make sure that gets updated!
Leave !OMP but otherwise please make sure everything is lowercase.
|
Your CLA signature was found on the base branch, but you appear to have modified the CONTRIBUTORS.md file in this PR. Please do not edit the CONTRIBUTORS.md file. If you have already signed the CLA, revert changes to the file and your signature will be picked up. |
PR Summary
Sci/Tech Reviewer: paulfield2024
Code Reviewer: Erica Neininger (@ericaneininger)
Implements activation of UCKA aerosol into Casim prognostic drop numbers. This is the one-way coupling only, there is no processing of the aerosol inside Casim (yet). The 2 routines in
physics_schemes/source/large_scale_precipitation/CASIMare direct imports from the UM code (i.e. only code styling and a minor bugfix has been made)Linked to MetOffice/casim#19
Valnote: Autoassess
Code Quality Checklist
Testing
trac.log
Test Suite Results - lfric_apps - casim_arg_activation/run1
Suite Information
✅ succeeded tasks - 1376
Security Considerations
Performance Impact
AI Assistance and Attribution
Documentation
PSyclone Approval
Sci/Tech Review
(Please alert the code reviewer via a tag when you have approved the SR)
Code Review