Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
casim:
source: git@github.com:MetOffice/casim.git
ref: 2026.07.1
source: git@github.com:iboutle/casim.git
ref: activation_fix

jules:
source: git@github.com:MetOffice/jules.git
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,25 @@ range=-1:1
sort-key=Panel-A05
type=real

[namelist:microphysics=casim_activation]
compulsory=true
description=CASIM droplet activation option
!enumeration=true
help=Fixed number uses a fixed cloud droplet number within liquid cloud and
=makes no use of any aerosol, which is the option used by RAL3.
=
=Abdul-Razzak and Ghan uses the mechanistic activation scheme of
=Abdul-Razzak and Ghan (2000, https://doi.org/10.1029/1999JD901161) to
=work the cloud droplet number out from the fraction activated in each
=aerosol mode. The aerosol is taken from the GLOMAP modal aerosol, which
=is passed into CASIM but is not modified by it, so UKCA must be running.
!kind=default
ns=namelist/Science/UM Microphysics
sort-key=Panel-A02c
trigger=namelist:microphysics=casim_cdnc_opt: 'fixed';
value-titles=Fixed number, Abdul-Razzak and Ghan
values='fixed','arg'

[namelist:microphysics=casim_cdnc_opt]
compulsory=true
description=How to calculate cloud number in Casim
Expand All @@ -89,9 +108,13 @@ help=External will take the cloud number calculated by an external aerosol
= with the Jones relation
=
=Fixed number will use a fixed cloud drop number, as in RA3
=
=This only applies to the fixed number droplet activation. Abdul-Razzak
=and Ghan activation always works the cloud number out from the aerosol
=supplied to CASIM, so there is nothing external left for it to take.
!kind=default
ns=namelist/Science/UM Microphysics
sort-key=Panel-A02
sort-key=Panel-A02d
value-titles=External code, Fixed number
values='external','fixed'

Expand Down Expand Up @@ -295,7 +318,7 @@ help=Setting to True will switch from the Wilson and Ballard (1999)
!kind=default
ns=namelist/Science/UM Microphysics
sort-key=Panel-A00
trigger=namelist:microphysics=casim_cdnc_opt: .true.;
trigger=namelist:microphysics=casim_activation: .true.;
=namelist:microphysics=graupel_scheme: .false.;
=namelist:microphysics=shape_rime: .false.;
=namelist:microphysics=orog_rain: .false.;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,17 @@ def upgrade(self, config, meta_config=None):
# Add settings
return config, self.reports
"""


class vn32_t709(MacroUpgrade):
"""Upgrade macro for #709 by Ian Boutle."""

BEFORE_TAG = "vn3.2"
AFTER_TAG = "vn3.2_t709"

def upgrade(self, config, meta_config=None):
# Commands From: rose-meta/um-microphysics
self.add_setting(
config, ["namelist:microphysics", "casim_activation"], "'fixed'"
)
return config, self.reports
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
! The file LICENCE, distributed with this code, contains details of the terms
! under which the code may be used.
!-------------------------------------------------------------------------------
! Some of the content of this file has been produced with the assistance of
! Anthropic Claude Opus 5 (Claude Code).
!-------------------------------------------------------------------------------
!> @brief Interface to the CASIM activation scheme

module casim_activate_alg_mod
Expand All @@ -17,6 +20,7 @@ module casim_activate_alg_mod
use mesh_mod, only: mesh_type
use microphysics_config_mod, only: casim_cdnc_opt, &
casim_cdnc_opt_fixed
use mphys_inputs_mod, only: casim_iopt_act, fixed_number
use mr_indices_mod, only: nummr, imr_cl, imr_ci
use sci_geometric_constants_mod, only: get_height_fv
use section_choice_config_mod, only: convection, convection_um
Expand All @@ -37,18 +41,25 @@ contains
!> documentation.
!>@param[in] config Application namelist configuration object
!>@param[in] mr (in) Mixing ratios, in theta space
!>@param[in] m_cl_pre_fast (in) Cloud liq after advection
!>@param[in] cloud_fields (in) Fields for cloud fractions
!>@param[in,out] microphysics_fields (in,out) Fields for mphys scheme
!>@param[in] convection_fields (in) Fields for convection scheme
!>@param[in] aerosol_fields (in) Fields for the aerosol schemes
!>@param[in] turbulence_fields (in) Fields for turbulence scheme
!>@param[in] initialise Flag to use routine to initialise fields
subroutine casim_activate_alg(config, &
theta, mr, &
theta, mr, m_cl_pre_fast, &
derived_fields, &
cloud_fields, &
microphysics_fields, &
convection_fields, initialise)
convection_fields, &
aerosol_fields, turbulence_fields, &
initialise)

use casim_activate_kernel_mod, only: casim_activate_kernel_type
use casim_ice_act_kernel_mod, only: casim_ice_act_kernel_type
use casim_arg_act_kernel_mod, only: casim_arg_act_kernel_type

implicit none

Expand All @@ -57,10 +68,12 @@ contains
type( field_collection_type ), intent(in) :: derived_fields
type( field_collection_type ), intent(in) :: cloud_fields
type( field_collection_type ), intent(in) :: convection_fields
type( field_collection_type ), intent(in) :: aerosol_fields
type( field_collection_type ), intent(in) :: turbulence_fields
type( field_collection_type ), intent(inout) :: microphysics_fields

type( field_type ), intent( in ), target :: mr(nummr)
type( field_type ), intent( in ) :: theta
type( field_type ), intent( in ) :: theta, m_cl_pre_fast

logical, intent(in) :: initialise

Expand All @@ -73,13 +86,42 @@ contains
type( field_type ), pointer :: rho_wth
type( field_type ), pointer :: mci_init

! Fields needed by the mechanistic activation
type( field_type ), pointer :: cf_liq_pre_fast
type( field_type ), pointer :: w_in_wth
type( field_type ), pointer :: wvar

! GLOMAP modal aerosol
type( field_type ), pointer :: n_ait_sol
type( field_type ), pointer :: ait_sol_su
type( field_type ), pointer :: ait_sol_bc
type( field_type ), pointer :: ait_sol_om
type( field_type ), pointer :: n_acc_sol
type( field_type ), pointer :: acc_sol_su
type( field_type ), pointer :: acc_sol_bc
type( field_type ), pointer :: acc_sol_om
type( field_type ), pointer :: acc_sol_ss
type( field_type ), pointer :: n_cor_sol
type( field_type ), pointer :: cor_sol_su
type( field_type ), pointer :: cor_sol_bc
type( field_type ), pointer :: cor_sol_om
type( field_type ), pointer :: cor_sol_ss
type( field_type ), pointer :: n_ait_ins
type( field_type ), pointer :: ait_ins_bc
type( field_type ), pointer :: ait_ins_om
type( field_type ), pointer :: n_acc_ins
type( field_type ), pointer :: acc_ins_du
type( field_type ), pointer :: n_cor_ins
type( field_type ), pointer :: cor_ins_du

type( mesh_type ), pointer :: mesh
integer( tik ) :: id

if ( LPROF ) call start_timing( id, 'microphysics.casim_activate' )

! For fixed CDNC or if we want to initialise the CDNC
if (casim_cdnc_opt == casim_cdnc_opt_fixed .or. initialise) then
if ( ( casim_cdnc_opt == casim_cdnc_opt_fixed .and. &
casim_iopt_act == fixed_number ) .or. initialise ) then

call cloud_fields%get_field('liquid_fraction', cf_liq)
call microphysics_fields%get_field('nl_mphys', nl_mphys)
Expand All @@ -97,6 +139,64 @@ contains

end if

! Mechanistic activation of any liquid cloud which the physics outside
! CASIM has created since the start of the fast physics
if (casim_iopt_act > fixed_number .and. .not. initialise) then

call cloud_fields%get_field('liquid_fraction', cf_liq)
call microphysics_fields%get_field('nl_mphys', nl_mphys)
call microphysics_fields%get_field('cf_liq_pre_fast', cf_liq_pre_fast)
call derived_fields%get_field('exner_in_wth', exner_wth)
call derived_fields%get_field('rho_in_wth', rho_wth)
call derived_fields%get_field('w_in_wth', w_in_wth)
call turbulence_fields%get_field('wvar', wvar)

call aerosol_fields%get_field('n_ait_sol', n_ait_sol)
call aerosol_fields%get_field('ait_sol_su', ait_sol_su)
call aerosol_fields%get_field('ait_sol_bc', ait_sol_bc)
call aerosol_fields%get_field('ait_sol_om', ait_sol_om)
call aerosol_fields%get_field('n_acc_sol', n_acc_sol)
call aerosol_fields%get_field('acc_sol_su', acc_sol_su)
call aerosol_fields%get_field('acc_sol_bc', acc_sol_bc)
call aerosol_fields%get_field('acc_sol_om', acc_sol_om)
call aerosol_fields%get_field('acc_sol_ss', acc_sol_ss)
call aerosol_fields%get_field('n_cor_sol', n_cor_sol)
call aerosol_fields%get_field('cor_sol_su', cor_sol_su)
call aerosol_fields%get_field('cor_sol_bc', cor_sol_bc)
call aerosol_fields%get_field('cor_sol_om', cor_sol_om)
call aerosol_fields%get_field('cor_sol_ss', cor_sol_ss)
call aerosol_fields%get_field('n_ait_ins', n_ait_ins)
call aerosol_fields%get_field('ait_ins_bc', ait_ins_bc)
call aerosol_fields%get_field('ait_ins_om', ait_ins_om)
call aerosol_fields%get_field('n_acc_ins', n_acc_ins)
call aerosol_fields%get_field('acc_ins_du', acc_ins_du)
call aerosol_fields%get_field('n_cor_ins', n_cor_ins)
call aerosol_fields%get_field('cor_ins_du', cor_ins_du)

call invoke( casim_arg_act_kernel_type( mr(imr_cl), m_cl_pre_fast, &
rho_wth, theta, exner_wth, &
cf_liq, cf_liq_pre_fast, &
w_in_wth, wvar, &
nl_mphys, &
n_ait_sol, ait_sol_su, &
ait_sol_bc, ait_sol_om, &
n_acc_sol, acc_sol_su, &
acc_sol_bc, acc_sol_om, &
acc_sol_ss, &
n_cor_sol, cor_sol_su, &
cor_sol_bc, cor_sol_om, &
cor_sol_ss, &
n_ait_ins, ait_ins_bc, &
ait_ins_om, &
n_acc_ins, acc_ins_du, &
n_cor_ins, cor_ins_du ) )

if (write_diag .and. use_xios_io) then
call nl_mphys%write_field('casim__nl_mphys_act')
end if

end if

! If convection has provided an increment to ice or we want to
! initialise the ice
if (convection == convection_um .or. initialise) then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
! The file LICENCE, distributed with this code, contains details of the terms
! under which the code may be used.
!-------------------------------------------------------------------------------
! Some of the content of this file has been produced with the assistance of
! Anthropic Claude Opus 5 (Claude Code).
!-------------------------------------------------------------------------------
!> @brief Interface to the CASIM Microphysics scheme

module casim_alg_mod
Expand Down Expand Up @@ -115,6 +118,29 @@ contains

type( field_type ), pointer :: wvar

! GLOMAP modal aerosol, used by the CASIM mechanistic activation
type( field_type ), pointer :: n_ait_sol
type( field_type ), pointer :: ait_sol_su
type( field_type ), pointer :: ait_sol_bc
type( field_type ), pointer :: ait_sol_om
type( field_type ), pointer :: n_acc_sol
type( field_type ), pointer :: acc_sol_su
type( field_type ), pointer :: acc_sol_bc
type( field_type ), pointer :: acc_sol_om
type( field_type ), pointer :: acc_sol_ss
type( field_type ), pointer :: n_cor_sol
type( field_type ), pointer :: cor_sol_su
type( field_type ), pointer :: cor_sol_bc
type( field_type ), pointer :: cor_sol_om
type( field_type ), pointer :: cor_sol_ss
type( field_type ), pointer :: n_ait_ins
type( field_type ), pointer :: ait_ins_bc
type( field_type ), pointer :: ait_ins_om
type( field_type ), pointer :: n_acc_ins
type( field_type ), pointer :: acc_ins_du
type( field_type ), pointer :: n_cor_ins
type( field_type ), pointer :: cor_ins_du

type( field_type ), pointer :: height_w3 => null()
type( field_type ), pointer :: height_wth => null()
type( field_type ), pointer :: dz_in_wth
Expand Down Expand Up @@ -170,6 +196,28 @@ contains
call aerosol_fields%get_field('cloud_drop_no_conc',cloud_drop_no_conc)
call aerosol_fields%get_field('murk', murk)

call aerosol_fields%get_field('n_ait_sol', n_ait_sol)
call aerosol_fields%get_field('ait_sol_su', ait_sol_su)
call aerosol_fields%get_field('ait_sol_bc', ait_sol_bc)
call aerosol_fields%get_field('ait_sol_om', ait_sol_om)
call aerosol_fields%get_field('n_acc_sol', n_acc_sol)
call aerosol_fields%get_field('acc_sol_su', acc_sol_su)
call aerosol_fields%get_field('acc_sol_bc', acc_sol_bc)
call aerosol_fields%get_field('acc_sol_om', acc_sol_om)
call aerosol_fields%get_field('acc_sol_ss', acc_sol_ss)
call aerosol_fields%get_field('n_cor_sol', n_cor_sol)
call aerosol_fields%get_field('cor_sol_su', cor_sol_su)
call aerosol_fields%get_field('cor_sol_bc', cor_sol_bc)
call aerosol_fields%get_field('cor_sol_om', cor_sol_om)
call aerosol_fields%get_field('cor_sol_ss', cor_sol_ss)
call aerosol_fields%get_field('n_ait_ins', n_ait_ins)
call aerosol_fields%get_field('ait_ins_bc', ait_ins_bc)
call aerosol_fields%get_field('ait_ins_om', ait_ins_om)
call aerosol_fields%get_field('n_acc_ins', n_acc_ins)
call aerosol_fields%get_field('acc_ins_du', acc_ins_du)
call aerosol_fields%get_field('n_cor_ins', n_cor_ins)
call aerosol_fields%get_field('cor_ins_du', cor_ins_du)

call turbulence_fields%get_field('wvar', wvar)

height_w3 => get_height_fv(config, theta%get_mesh(), W3)
Expand All @@ -195,7 +243,16 @@ contains
ls_rain_3d, ls_snow_3d, ls_graup_3d, &
theta_inc, cloud_drop_no_conc, murk, &
refl_tot, refl_1km, &
superc_liq, superc_rain ) )
superc_liq, superc_rain, &
n_ait_sol, ait_sol_su, &
ait_sol_bc, ait_sol_om, &
n_acc_sol, acc_sol_su, &
acc_sol_bc, acc_sol_om, acc_sol_ss, &
n_cor_sol, cor_sol_su, &
cor_sol_bc, cor_sol_om, cor_sol_ss, &
n_ait_ins, ait_ins_bc, ait_ins_om, &
n_acc_ins, acc_ins_du, &
n_cor_ins, cor_ins_du ) )

if (turb_gen_mixph) then
dz_in_wth => get_dz_at_wtheta(config, theta%get_mesh())
Expand Down
Loading