Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
bfa6623
Implemented new in-cloud water-content check in pc2_checks (and chang…
MichaelWhitall Mar 19, 2026
a30e93a
Add new kernel to do the safety-checks on prognostic precip fraction.
MichaelWhitall Mar 23, 2026
bb05154
Skip existing call to fracs_consistency on input to comorph if the ch…
MichaelWhitall Mar 23, 2026
65d1402
Fixed misplaced comma.
MichaelWhitall Mar 25, 2026
039c24c
Moved map_w3 to before map_wth in the argument list, to get same orde…
MichaelWhitall Mar 25, 2026
1851bcc
Added l_pc2_checks_cfffix to the cloud namelist and now use to toggle…
MichaelWhitall Mar 26, 2026
1c36de1
Moved the call to lsp_precfrac_checks outside of cld_alg, so that the…
MichaelWhitall Mar 26, 2026
607a342
Switched the new functionality on in the comorph_dev rose-stem test.
MichaelWhitall Mar 26, 2026
154a87b
Signed the contributors.md file.
MichaelWhitall Mar 26, 2026
f8e4bd0
Update KGOs for CoMorph rose-stem tests that change answers.
MichaelWhitall Mar 26, 2026
625eefa
Lower-cased missed fortran keywords in comment.
MichaelWhitall Mar 27, 2026
ff3dcca
Lower-cased missed fortran keywords in comment.
MichaelWhitall Mar 27, 2026
f4f5149
Changed level-loops in pc2_checks and lsp_precfrac_checks kernels to …
MichaelWhitall Mar 27, 2026
e843639
Changed level-loops in pc2_checks and lsp_precfrac_checks kernels to …
MichaelWhitall Mar 27, 2026
1872fcb
Changed declaration style of precfrac in semi_implicit_timestep to ma…
MichaelWhitall Mar 27, 2026
6e29705
Changed declaration style of precfrac in semi_implicit_timestep to ma…
MichaelWhitall Mar 27, 2026
071fe16
Make the precision changes on copying data in the lsp_precfrac_checks…
MichaelWhitall Mar 27, 2026
6d8d84f
Make the precision changes on copying data in the lsp_precfrac_checks…
MichaelWhitall Mar 27, 2026
d998e33
Removed temp logical l_pc2_checks_cfffix; hard-code the bug-fix instead.
MichaelWhitall Mar 30, 2026
45bb0c1
Removed temp logical l_pc2_checks_cfffix; hard-code the bug-fix instead.
MichaelWhitall Mar 30, 2026
b885c9a
Updated KGOs consistent with now hard-coding the pc2_checks CFF bug-fix.
MichaelWhitall Mar 30, 2026
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
3 changes: 2 additions & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@
| thomasmelvin | Thomas Melvin | Met Office | 2026-01-15 |
| tinyendian | Wolfgang Hayek | Earth Sciences New Zealand | 2026-02-02 |
| DanStoneMO | Daniel Stone | Met Office | 2026-02-26 |
| ericaneininger | Erica Neininger | Met Office | 2026-03-02 |
| ericaneininger | Erica Neininger | Met Office | 2026-03-02 |
| MichaelWhitall | Michael Whitall | Met Office | 2026-03-26 |
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,22 @@ ns=namelist/Science/UM Cloud
sort-key=Panel-A10
type=logical

[namelist:cloud=l_ensure_max_in_cloud_pc2]
compulsory=true
description=Impose a max limit on in-cloud water contents (liquid and ice)
help=The max allowed in-cloud water content qc/cf is calculated interactively;
=it scales with the mean total-water q+qcl+qcf in the column below
=the current level. It also scales with the cloud-fraction, so that
=the limit is lower at points with very tiny cloud-amounts
=(these points are the ones most likely to have ill-constrained
= in-cloud water content, since the transport scheme applied
= independently to condensate mass and cloud-fraction can create tiny
= inconsistent values of the two near the edges of advected clouds).
!kind=default
ns=namelist/Science/UM Cloud
sort-key=Panel-A09b
type=logical

[namelist:cloud=max_sigmas]
compulsory=true
description=Max width of bimodal cloud-scheme Gaussian PDFs
Expand Down Expand Up @@ -569,6 +585,7 @@ trigger=namelist:cloud=mphys_erosion: 'pc2' ;
=namelist:cloud=i_bm_ez_opt: 'pc2', 'bimodal' ;
=namelist:cloud=l_bm_sigma_s_grad: 'pc2', 'bimodal' ;
=namelist:cloud=l_bm_tweaks: 'pc2', 'bimodal' ;
=namelist:cloud=l_ensure_max_in_cloud_pc2: 'pc2' ;
=namelist:cloud=max_sigmas: 'pc2', 'bimodal' ;
=namelist:cloud=min_sigx_ft: 'pc2', 'bimodal' ;
=namelist:cloud=turb_var_fac_bm: 'pc2', 'bimodal' ;
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 vn31_t243(MacroUpgrade):
# Upgrade macro for Issue #243 by Mike Whitall

BEFORE_TAG = "vn3.1"
AFTER_TAG = "vn3.1_t243"

def upgrade(self, config, meta_config=None):
# Add settings

nml = "namelist:cloud"
self.add_setting(config, [nml,"l_ensure_max_in_cloud_pc2"], ".false.")

return config, self.reports
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,19 @@ value-titles=Assumed homogenous sub-grid areas,
=Assumed sub-grid spatial correlations
values='homog','correl'

[namelist:microphysics=l_improve_precfrac_checks]
compulsory=true
description=Improved safety-checks on the prognostic precip fraction
help=a) Variable max limit on the in-rainshaft precip-mass better-targets small
= noise values generated by the advection scheme.
=b) Avoid wrong application of the check where precip-mass is negative
=c) Reset precip-fraction to zero where precip-mass is zero.
=d) Extra call to the checking routine before convection if needed
!kind=default
ns=namelist/Science/UM Microphysics
sort-key=Panel-A01g
type=logical

[namelist:microphysics=l_mcr_precfrac]
compulsory=true
description=Include prognostic rain/graupel fraction
Expand All @@ -237,6 +250,7 @@ help=Switch to include a prognostic field for the fraction of the
ns=namelist/Science/UM Microphysics
sort-key=Panel-A01e
trigger=namelist:microphysics=i_update_precfrac: .true. ;
=namelist:microphysics=l_improve_precfrac_checks: .true. ;
type=logical

[namelist:microphysics=l_proc_fluxes]
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 vn31_t243(MacroUpgrade):
# Upgrade macro for Issue #243 by Mike Whitall

BEFORE_TAG = "vn3.1"
AFTER_TAG = "vn3.1_t243"

def upgrade(self, config, meta_config=None):
# Add settings

nml = "namelist:microphysics"
self.add_setting(config, [nml,"l_improve_precfrac_checks"], ".false.")

return config, self.reports
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module iau_pc2_assimilation_alg_mod
!>@param[in,out] cloud_fields Fields for cloud scheme
!>@param[in] theta Potential temperature
!>@param[in] theta_earlier Copy of potential temperature before incrementing
!>@param[in] exner Exner pressure on w3 space
!>@param[in] exner_wth Exner pressure on wtheta space
!>@param[in] exner_earlier_wth Copy of exner pressure on wtheta before incrementing
!>@param[in] m_v Vapour mass mixing ratio
Expand All @@ -44,7 +45,7 @@ module iau_pc2_assimilation_alg_mod
!>@param[in] m_g Graupel mixing ratio
!>@param[in] mg_earlier Copy of graupel mixing ratio before incrementing
!>@param[in] dt Timestep length (s)
subroutine iau_pc2_assimilation( exner_wth,exner_earlier_wth, &
subroutine iau_pc2_assimilation( exner, exner_wth,exner_earlier_wth, &
theta, theta_earlier, &
m_v, mv_earlier , &
m_cl, mcl_earlier, &
Expand All @@ -60,6 +61,7 @@ module iau_pc2_assimilation_alg_mod
type( field_collection_type ), intent(inout) :: cloud_fields
type( field_type ), intent(inout) :: theta
type( field_type ), intent(in) :: theta_earlier
type( field_type ), intent(in) :: exner
type( field_type ), intent(in) :: exner_wth
type( field_type ), intent(in) :: exner_earlier_wth
type( field_type ), intent(inout) :: m_v
Expand Down Expand Up @@ -167,6 +169,7 @@ module iau_pc2_assimilation_alg_mod
bcf, &
theta, &
exner_wth, &
exner, &
! Responses
theta_inc_wth, &
mv_inc_wth, &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ module update_iau_inc_alg_mod
! PC2 cloud and humidity adjustments
if ( iau_pc2 ) then

call iau_pc2_assimilation( exner_wth, exner_earlier_wth, &
call iau_pc2_assimilation( exner, exner_wth, exner_earlier_wth, &
theta, theta_earlier, &
m_v, mv_earlier , &
m_cl, mcl_earlier, &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ contains
!> See UMDP30 for full scheme details.
!>@param[in] mr Start of timestep mixing ratios
!>@param[in] theta Potential temperature (theta) in wth space
!>@param[in] exner Exner pressure on w3 space
!>@param[in] derived_fields Group of derived fields
!>@param[in] cloud_fields Group of cloud fields
!>@param[out] dtheta_pc2_inc Potential temperature response in wth space
Expand All @@ -41,6 +42,7 @@ contains

subroutine pc2_checks_alg( mr, &
theta, &
exner, &
derived_fields, &
cloud_fields, &
dtheta_pc2_inc, &
Expand All @@ -59,8 +61,7 @@ contains
implicit none

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

type( field_type ), intent( in ) :: theta, exner
type( field_collection_type ), intent(in) :: derived_fields, cloud_fields

type( field_type ), intent(out) :: dtheta_pc2_inc
Expand Down Expand Up @@ -108,6 +109,7 @@ contains
bulk_fraction, &
theta, &
exner_in_wth, &
exner, &
! Responses
dtheta_pc2_inc, &
dmv_pc2_inc, &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -774,8 +774,8 @@ subroutine conv_comorph_code(nlayers, seg_len, &
fldname_n_cor_ins, &
fldname_cor_ins_du

use aerosol_config_mod, only: glomap_mode, &
glomap_mode_dust_and_clim, &
use aerosol_config_mod, only: glomap_mode, &
glomap_mode_dust_and_clim, &
glomap_mode_ukca

use log_mod, only : log_event, log_scratch_space, LOG_LEVEL_ERROR
Expand All @@ -785,13 +785,15 @@ subroutine conv_comorph_code(nlayers, seg_len, &
! UM modules containing switches or global constants
!---------------------------------------
use bl_option_mod, only: max_tke
use cloud_inputs_mod, only: l_pc2_homog_conv_pressure
use cv_run_mod, only: l_mom, &
l_conv_prog_dtheta, l_conv_prog_dq, &
use cloud_inputs_mod, only: l_pc2_homog_conv_pressure, &
l_cloud_call_b4_conv, &
l_ensure_max_in_cloud_pc2
use cv_run_mod, only: l_mom, &
l_conv_prog_dtheta, l_conv_prog_dq, &
tau_conv_prog_dtheta, tau_conv_prog_dq
use jules_surface_mod, only: srf_ex_cnv_gust, IP_SrfExWithCnv
use mphys_inputs_mod, only: l_mcr_qgraup, l_mcr_qrain, l_mcr_precfrac, &
l_mcr_qcf2
use mphys_inputs_mod, only: l_mcr_qgraup, l_mcr_qrain, l_mcr_qcf2, &
l_mcr_precfrac, l_improve_precfrac_checks
use nlsizes_namelist_mod, only: row_length, rows, bl_levels
use planet_constants_mod, only: p_zero, kappa, planet_radius, g
use timestep_mod, only: timestep
Expand Down Expand Up @@ -2008,28 +2010,28 @@ subroutine conv_comorph_code(nlayers, seg_len, &
end do
end do

do i = 1, row_length
do k = 1, nlayers
precfrac_star(i,1,k) = precfrac(map_wth(1,i)+k)
end do
end do

! The "latest" (_star) fields used by convection are values
! interpolated to departure points by SL advection.
! The interpolation is not guaranteed to preserve consistency
! between the cloud fraction and cloud water fields.
! However, various things can go wrong within CoMorph if they
! are inconsistent; especially the routine calc_env_partitions,
! which attempts to calculate the internal properties of
! the in-cloud and clear sub-regions of the grid-box.
! E.g. a common problem is if qcf is large but CFF is small,
! the in-cloud qcf can get implausibly large, which can
! cause the phase-change calculations to yield nonsense.
! are inconsistent.
! Therefore, apply safety checks to the cloud-fractions
! before passing them into convection...
do i = 1, row_length
do k = 1, nlayers
precfrac_star(i,1,k) = precfrac(map_wth(1,i)+k)
end do
end do
CALL fracs_consistency ( qcl_conv, qcf_conv, qcf2_conv, &
if ( ( .not. (l_cloud_call_b4_conv .and. l_ensure_max_in_cloud_pc2) ) .or. &
( l_mcr_precfrac .and. ( .not. l_improve_precfrac_checks ) ) ) then
! Don't need to do this if similar checks already switched on elsewhere
CALL fracs_consistency( qcl_conv, qcf_conv, qcf2_conv, &
qrain_conv, qgraup_conv, &
cf_liquid_conv, cf_frozen_conv, bulk_cf_conv, &
precfrac_star )
end if

! Note: if not using PC2, the cloud-fraction _star fields do exist
! but are just set to values after slow_physics
Expand Down
Loading
Loading