Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
878b733
Add meta data fro blending option 4
Adrian-Lock Jun 30, 2026
ab43d37
Bug fixes
Adrian-Lock Jun 30, 2026
3a5cf6e
Extras for blending opt4: include blended L cap by 1d L; use actual s…
Adrian-Lock Jul 2, 2026
3874e79
Add code needed in bdy_expl2
Adrian-Lock Jul 2, 2026
270f63c
Put mixing length cap on its own switch, cap_blended_ml
Adrian-Lock Jul 6, 2026
ab7db55
Merge branch 'vn3.1_blending_opt4' into vn3.2_blending_opt4
Adrian-Lock Sep 2, 2026
813ed93
Add upgrade macro
Adrian-Lock Sep 2, 2026
da7a76a
Add new code documentation
Adrian-Lock Sep 3, 2026
60dcdc6
Add rose stem test for new options
Adrian-Lock Sep 3, 2026
ffb8522
Add rose stem test resources
Adrian-Lock Sep 3, 2026
c6fdd1f
Add checksums for new rose stem tasks
Adrian-Lock Sep 3, 2026
0fb3ab2
Fixes for unit tests
Adrian-Lock Sep 4, 2026
d0f6bcd
And add my other new namelist variable to the unit tests
Adrian-Lock Sep 4, 2026
b44202e
Following reviewer suggestion to add a ral_dev task and include my ne…
Adrian-Lock Sep 7, 2026
0ae3208
Correct name of opt file
Adrian-Lock Sep 8, 2026
f625c55
Change name to cumulus_cth, as suggested by sci-tech reviewer
Adrian-Lock Sep 8, 2026
ca0fc68
Manual merge from #730, increase build times on AzSpice
Adrian-Lock Sep 8, 2026
883e980
Add checksum for new ral_dev task
Adrian-Lock Sep 8, 2026
5c1d525
Update checksum for azspice
Adrian-Lock Sep 8, 2026
33b4eb0
Update checksum and correct README file
Adrian-Lock Sep 8, 2026
60a23e8
Suggestions from sci-tech review
Adrian-Lock Sep 9, 2026
1d41171
Merge remote-tracking branch 'origin' into vn3.2_blending_opt4
Adrian-Lock Sep 9, 2026
f0ca8a8
Update new lfric unit tests with my new namelist variables
Adrian-Lock Sep 9, 2026
b8fe776
Correct upgrade macro
Adrian-Lock Sep 9, 2026
a8deda2
Bug fix
Adrian-Lock Sep 9, 2026
942c88e
Add revised checksums to be consistent with changes on main
Adrian-Lock Sep 10, 2026
f7eda4e
Code reviewer responses: correct upgrade macro and revert AzSpice tim…
Adrian-Lock Sep 11, 2026
ed48fbf
Remove end-of-line whitespace from new documentation
Adrian-Lock Sep 14, 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
Original file line number Diff line number Diff line change
Expand Up @@ -1986,7 +1986,7 @@ length, :math:`S` is the wind shear, :math:`f_\chi(Ri)` is the stability
function and :math:`\chi` represents conserved heat and moisture
variables, or momentum. Both schemes use the same stability function,
and both schemes can use the full 3D shear for :math:`S`. Therefore the
only difference is in the mixing length, which is calculated as
only difference is in the mixing length, which is initially calculated as

.. math:: :label: eq-lblend

Expand Down Expand Up @@ -2119,18 +2119,27 @@ boundary layer depth and type <sec_types>`)
but alternatively (``blending_option``\ :math:`=`\ 4) this can be
restricted to strictly shallow cumulus clouds, defined as contiguously
cloudy levels (cloud fraction greater than SC_CFTOL) with cloud top
height below input parameter ``shallow_cu_maxtop``. Note that the
height below the input parameter ``shallow_cu_maxtop``. Note that the
diagnosis of shallow cumulus from the diagnosis parcel ascent (that was
used to identify a cumulus regime) was found frequently to indicate deep
used to identify a cumulus regime) has frequently been found to indicate deep
convection even when the resolved clouds were shallow because the
diagnosis parcel, being undilute, would penetrate to the tropopause.
However, having decided the regime is shallow convection, we do still
set :math:`z_{\mathrm{turb}}` to the diagnosis parcel top height because, for
current km-scale configurations (without a cumulus convection
parametrization), it was found that the resulting stronger parametrized
vertical mixing was beneficial for the development of the convection,
and that without this a widespread stratiform cloud layer could develop
instead.
Under ``blending_option``\ :math:`=`\ 4, then, if such a shallow cumulus
regime is diagnosed, :math:`z_{\mathrm{turb}}` is set to the resolved cloud
top height.

One less desirable feature of the combination of the forms of the blended
mixing length :eq:`eq-lblend` and :math:`W_{1D}` :eq:`eq-tanh` functions
is that the resulting mixing length does not simply increase monotonically
towards :math:`l_{\mathrm{bl}}` as :math:`z_{\mathrm{turb}}` reduces (and
the turbulence becomes entirely unresolved). To illustrate this, consider
the case of :math:`\Delta x= z_{\mathrm{turb}} = 1` km, which gives
:math:`W_{1D} \approx 0.9` (see :numref:`Figure %s <fig-blend>`\ a).
Ignoring the reduction in length scales towards the surface, we find
:math:`l_{\mathrm{bl}}=150` m and :math:`l_{\mathrm{smag}}=200` m such that
:math:`l_{\mathrm{blend}} = 155` m. A simple way to avoid this is to cap
the blended length scale explicitly by :math:`l_{\mathrm{bl}}` via the
namelist switch ``cap_blended_ml``.

Above the boundary layer top, `Boutle et al. (2014)`_ aimed
for any free atmospheric mixing to be done by the 3D Smagorinsky scheme.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,17 @@ module um_physics_init_mod
heavy_rain_evap_fac_in => &
heavy_rain_evap_fac

use mixing_config_mod, only : smagorinsky, &
mixing_method => method, &
method_3d_smag, &
method_2d_smag, &
method_blend_smag_fa, &
method_blend_1dbl_fa, &
mix_factor_in => mix_factor, &
leonard_term
use mixing_config_mod, only : smagorinsky, &
mixing_method => method, &
method_3d_smag, &
method_2d_smag, &
method_blend_smag_fa, &
method_blend_1dbl_fa, &
method_blend_cth_shcu_only, &
cap_blended_ml_in => cap_blended_ml, &
shallow_cu_maxtop_in => shallow_cu_maxtop, &
mix_factor_in => mix_factor, &
leonard_term

use radiation_config_mod, only : topography, topography_horizon

Expand Down Expand Up @@ -370,6 +373,7 @@ subroutine um_physics_init()
l_noice_in_turb, l_use_var_fixes, &
i_interp_local_cf_dbdz, tke_diag_fac, a_ent_2, dec_thres_cloud, &
dec_thres_cu, near_neut_z_on_l, blend_gridindep_fa, &
blend_cth_shcu_only, shallow_cu_maxtop, cap_blended_ml, &
specified_fluxes_tstar, buoy_integ_low, num_sweeps_bflux, &
l_use_sml_dsc_fixes, l_converge_ga, improved_tke_diag
use cloud_inputs_mod, only: i_cld_vn, forced_cu, i_rhcpt, i_cld_area, &
Expand Down Expand Up @@ -1600,6 +1604,9 @@ subroutine um_physics_init()
mix_factor = real(mix_factor_in, r_um)
turb_startlev_vert = 2
turb_endlev_vert = bl_levels
if (mixing_method /= method_3d_smag) then
cap_blended_ml = cap_blended_ml_in
end if

! Options which are bespoke to the choice of scheme
select case ( mixing_method )
Expand All @@ -1622,6 +1629,11 @@ subroutine um_physics_init()
l_subfilter_horiz = .true.
l_subfilter_vert = .true.
blending_option = blend_gridindep_fa
case( method_blend_cth_shcu_only )
l_subfilter_horiz = .true.
l_subfilter_vert = .true.
blending_option = blend_cth_shcu_only
shallow_cu_maxtop = real(shallow_cu_maxtop_in, r_bl)
end select

else ! not Smagorinsky
Expand Down
2 changes: 2 additions & 0 deletions rose-stem/app/lfric_atm/opt/README
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ Science settings
- ral3 - regional configuration
- ral3_ens - extra config for regional ensembles (including stochastic physics)
- ral3_scm - single column regional physics (includes convection scheme)
- ral_blendshcu - development version of the turbulence blending for shallow
cumulus regimes
- ral_mixmol_opts - extra options for regional models when using the MoL
transport scheme and mixed solver configuration
- ral_opts - extra options for regional models, including LBC blending weights
Expand Down
5 changes: 5 additions & 0 deletions rose-stem/app/lfric_atm/opt/rose-app-blendshcu.conf
Comment thread
Adrian-Lock marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[namelist:mixing]
cap_blended_ml=.true.
method='blend_cth_shcu_only'
shallow_cu_maxtop=3000.0
smagorinsky=.true.
14 changes: 14 additions & 0 deletions rose-stem/site/common/lfric_atm/tasks_lfric_atm.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,20 @@
"xios_min_buffer_size": 2097152,
}) %}

{% elif task_ns.conf_name == "ral_dev-seuk_MG" %}

{% do task_dict.update({
"opt_confs": ["l70_40km","ral3","blendshcu","ral_opts","hh_solve"],
"resolution": "seuk_MG",
"DT": 60,
"tsteps": 120,
"crun": 2,
"crun_compare": false,
"mpi_parts": 16,
"kgo_checks": ["checksum"],
"plot_str": "plot_map.py -ral $NODAL_DATA_DIR/lfric_diagnostics.nc $PLOT_DIR",
}) %}

{% elif task_ns.conf_name == "ral3_mixmol-seuk_MG" %}

{% do task_dict.update({
Expand Down
2 changes: 2 additions & 0 deletions rose-stem/site/meto/groups/groups_lfric_atm.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"lfric_atm_ral_azspice_developer": [
"lfric_atm_ral3-seuk_MG_azspice_gnu_fast-debug-32bit",
"lfric_atm_ral3_ens-seuk_MG_azspice_gnu_fast-debug-32bit",
"lfric_atm_ral_dev-seuk_MG_azspice_gnu_fast-debug-32bit",
"lfric_atm_ral3_mixmol-seuk_MG_azspice_gnu_fast-debug-32bit",
],
"lfric_atm_scm_azspice_developer": [
Expand Down Expand Up @@ -140,6 +141,7 @@
"lfric_atm_ral_ex1a_developer": [
"lfric_atm_ral3-seuk_MG_ex1a_cce_fast-debug-32bit",
"lfric_atm_ral3_ens-seuk_MG_ex1a_cce_fast-debug-32bit",
"lfric_atm_ral_dev-seuk_MG_ex1a_cce_fast-debug-32bit",
"lfric_atm_ral3_mixmol-seuk_MG_ex1a_cce_fast-debug-32bit",
],
"lfric_atm_ral_ex1a_weekly": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Inner product checksum rho = 4839977E
Inner product checksum theta = 5135493C
Inner product checksum u = 612F4556
Inner product checksum mr1 = 4090F41B
Inner product checksum mr2 = 35AC7EDC
Inner product checksum mr3 = 2FA559EC
Inner product checksum mr4 = 33F4FDAE
Inner product checksum mr5 = BEDF860
Inner product checksum mr6 = 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Inner product checksum rho = 483997BF
Inner product checksum theta = 5135495F
Inner product checksum u = 612F491D
Inner product checksum mr1 = 4090F962
Inner product checksum mr2 = 35B6E523
Inner product checksum mr3 = 2FA5A395
Inner product checksum mr4 = 33F4FE66
Inner product checksum mr5 = BECFC40
Inner product checksum mr6 = 0
6 changes: 6 additions & 0 deletions rose-stem/site/meto/lfric_atm/tasks_lfric_atm_ex1a.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@
"memory": [24, "GB"],
}) %}

{% elif task_ns.conf_name == "ral_dev-seuk_MG" %}

{% do task_dict.update({
"memory": [24, "GB"],
}) %}

{% elif task_ns.conf_name == "ral3_mixmol-seuk_MG" %}

{% do task_dict.update({
Expand Down
34 changes: 30 additions & 4 deletions science/gungho/rose-meta/lfric-gungho/HEAD/rose-meta.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3786,12 +3786,38 @@ help=Options for Smagorinsky subgrid mixing scheme:
=_________________________________________________________________
=Blended scheme + 1D BL above
= As above, but relaxes to 1D BL above BL
=_________________________________________________________________
=Blended scheme + cloud-top of for shallow cu
= As above, but use cloud-top as blending length-scale only for
= shallow cu
=
= WARNING: This option currently does not conserve energy and as
= a result may be unstable.
= WARNING: This option will only conserve if
= conservative_diffusion is true
sort-key=Panel-A05
value-titles=3D Smagorinsky, 2D Smagorinsky + 1D BL, Blended scheme + Smag above, Blended scheme + 1D BL above
values='3d_smag', '2d_smag', 'blend_smag_fa','blend_1dbl_fa'
trigger=namelist:mixing=shallow_cu_maxtop: 'blend_cth_shcu_only' ;
Comment thread
Adrian-Lock marked this conversation as resolved.
=namelist:mixing=cap_blended_ml: 'blend_smag_fa', 'blend_1dbl_fa', 'blend_cth_shcu_only' ;
value-titles=3D Smagorinsky, 2D Smagorinsky + 1D BL, Blended scheme + Smag above,
=Blended scheme + 1D BL above, Blended scheme with CTH for shallow cu only
values='3d_smag', '2d_smag', 'blend_smag_fa','blend_1dbl_fa','blend_cth_shcu_only'

[namelist:mixing=cap_blended_ml]
compulsory=true
description=Cap the blended mixing length by the 1D
help=If true this caps the magnitude of the blended 1D-3D mixing length
=by the 1D mixing length
!kind=default
sort-key=Panel-A05a
type=logical

[namelist:mixing=shallow_cu_maxtop]
compulsory=true
description=Max permitted cloud top height for shallow cu blending
help=The maximum permitted cloud top height (in metres) for shallow cumulus
=to be diagosed, as then used for method=blending_option=blend_cth_shcu_only
=to use the cumulus parcel top height as the length scale in the blending weight
!kind=default
sort-key=Panel-A05b
type=real

[namelist:mixing=mix_factor]
compulsory=true
Expand Down
17 changes: 15 additions & 2 deletions science/gungho/rose-meta/lfric-gungho/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ def upgrade(self, config, meta_config=None):
# Add settings
return config, self.reports
"""


class vn32_t634(MacroUpgrade):
"""Upgrade macro for ticket #634 by Ian Boutle."""

Expand Down Expand Up @@ -61,3 +59,18 @@ def upgrade(self, config, meta_config=None):
self.add_setting(config, ["namelist:mixing", "fullstress"], ".false.")

return config, self.reports


class vn32_t752(MacroUpgrade):
# Upgrade macro for #752 by Adrian Lock

BEFORE_TAG = "vn3.2_t479"
AFTER_TAG = "vn3.2_t752"

def upgrade(self, config, meta_config=None):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need a second self.add_setting for the shallow_cu_maxtop variable

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, good spot, thanks. Bizarrely, I'd also left out the return config, self.reports, maybe in the merge of main (not sure why it still worked), so added that back in too.

# Add settings
self.add_setting(
config, ["namelist:mixing", "cap_blended_ml"], ".false.")
self.add_setting(
config, ["namelist:mixing", "shallow_cu_maxtop"], "3000.0")
return config, self.reports
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ contains
leonard_kl = 4.0_r_def, &
conservative_diffusion = .true., &
density_weighted = .true., &
max_diff_factor=1.0_r_def )
max_diff_factor = 1.0_r_def, &
cap_blended_ml = .false., &
shallow_cu_maxtop= 0.0_r_def )

! Variables for testing momentum_smagorinsky
! Get sizes of everything
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ contains
leonard_kl = 4.0_r_def, &
conservative_diffusion = .true., &
density_weighted = .true., &
max_diff_factor=1.0_r_def )
max_diff_factor = 1.0_r_def, &
cap_blended_ml = .false., &
shallow_cu_maxtop= 0.0_r_def )

! Variables for testing momentum_smagorinsky
! Get sizes of everything
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ contains
leonard_kl = 4.0_r_def, &
conservative_diffusion = .false., &
density_weighted = .false., &
max_diff_factor = 1.0_r_def, &
fullstress = .false. )
max_diff_factor = 1.0_r_def, &
fullstress = .false., &
cap_blended_ml = .false., &
shallow_cu_maxtop= 0.0_r_def )

call feign_finite_element_config( &
cellshape=cellshape_quadrilateral, &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ contains
leonard_kl = 1.0_r_def, &
conservative_diffusion = .false., &
density_weighted = .false., &
max_diff_factor = 1.0_r_def, &
fullstress = .false. )
max_diff_factor = 1.0_r_def, &
fullstress = .false., &
cap_blended_ml = .false., &
shallow_cu_maxtop= 0.0_r_def )

call feign_finite_element_config( &
cellshape=cellshape_quadrilateral, &
Expand Down
21 changes: 11 additions & 10 deletions science/physics_schemes/source/boundary_layer/bdy_expl2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,9 @@ subroutine bdy_expl2 ( &
2:bl_levels), &
! Mixing length for heat (m),
! held on theta and rho levels, resp.
cumulus_cth(pdims%i_start:pdims%i_end,pdims%j_start:pdims%j_end), &
! cf_bulk cloud top height used in blended BL
! for shallow convection
fm_3d(tdims%i_start:tdims%i_end,tdims%j_start:tdims%j_end,bl_levels), &
! stability function for momentum transport
! level 1 value is dummy
Expand Down Expand Up @@ -717,9 +720,6 @@ subroutine bdy_expl2 ( &
! Flag for having reached
! the top of the turbulently mixed
! layer.
l_shallow_cth(pdims%i_start:pdims%i_end,pdims%j_start:pdims%j_end), &
! Flag to indicate shallow convection based on
! cf_bulk cloud top height
cloud_base_found(pdims%i_start:pdims%i_end,pdims%j_start:pdims%j_end), &
! Flag for having reached cloud base
cloud_top_found(pdims%i_start:pdims%i_end,pdims%j_start:pdims%j_end)
Expand Down Expand Up @@ -1829,20 +1829,21 @@ subroutine bdy_expl2 ( &
!$OMP SCHEDULE(STATIC) &
!$OMP DEFAULT(none) &
!$OMP private(i) &
!$OMP SHARED(pdims,l_shallow_cth)
!$OMP SHARED(pdims,cumulus_cth)
do i = pdims%i_start, pdims%i_end
l_shallow_cth(i,j) = .false.
cumulus_cth(i,j) = zero ! initialise to zero for case of no cloud
! - will then blend using BL depth
end do
!$OMP end PARALLEL do

if (blending_option == blend_cth_shcu_only) then
! only going to use the parcel top as the length scale in blending
! going to use cloud top height as the length scale in blending only
! if the convection is shallow, where we define shallow convection here
! as the resolved cloud top (from cf_bluk) being below shallow_cu_maxtop
!$OMP PARALLEL &
!$OMP DEFAULT(none) &
!$OMP private(i,k) &
!$OMP SHARED(pdims,bl_levels,z_uv,l_shallow_cth,cumulus,ntml,cf_bulk, &
!$OMP SHARED(pdims,bl_levels,z_uv,cumulus_cth,cumulus,ntml,cf_bulk, &
!$OMP shallow_cu_maxtop,cloud_base_found,cloud_top_found)
!$OMP do SCHEDULE(STATIC)
do i = pdims%i_start, pdims%i_end
Expand All @@ -1863,7 +1864,7 @@ subroutine bdy_expl2 ( &
cf_bulk(i,j,k+1) < sc_cftol ) then
! got to cloud-top
cloud_top_found(i,j) = .true.
l_shallow_cth(i,j) = z_uv(i,j,k+1) < shallow_cu_maxtop
cumulus_cth(i,j) = z_uv(i,j,k+1)
end if
end do
!$OMP end do
Expand All @@ -1878,7 +1879,7 @@ subroutine bdy_expl2 ( &
bl_levels,k_log_layr,BL_diag, &
! in fields
sigma_h,flandg,dvdzm,ri,rho_wet_tq,z_uv,z_tq,z0m_eff_gb,zhnl,zhpar,zhsc, &
zdsc_base,ntpar,ntml_nl,ntdsc,nbdsc,l_shallow_cth,rmlmax2,rneutml_sq, &
zdsc_base,ntpar,ntml_nl,ntdsc,nbdsc,cumulus_cth,rmlmax2,rneutml_sq, &
delta_smag, &
! in/out fields
cumulus,weight_1dbl, &
Expand Down Expand Up @@ -2475,7 +2476,7 @@ subroutine bdy_expl2 ( &
bl_type_6(i,j) = one
! Label this shallow regime as 2.0_r_bl here, to be able to identify it
! in diagnostics_bl, but the "cumulus" stash output will still be 1.0
if (l_shallow_cth(i,j)) bl_type_6(i,j) = 2.0_r_bl
if (cumulus_cth(i,j) < shallow_cu_maxtop) bl_type_6(i,j) = 2.0_r_bl
end if
end if
end do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,10 @@ module bl_option_mod
! as minimum, and use cloud-top as blending length-scale only for shallow cu
integer, parameter :: blend_cth_shcu_only =4

! 11a max permitted cloud top height in metres for shallow cu, used for
! 11a switch to cap the blended mixing length by the 1D
LOGICAL :: cap_blended_ml = .FALSE.

! 11b max permitted cloud top height in metres for shallow cu, used for
! blending_option=blend_cth_shcu_only
real(kind=r_bl) :: shallow_cu_maxtop = rmdi

Expand Down Expand Up @@ -640,6 +643,8 @@ subroutine print_nlist_run_bl()
call umprint(linebuffer,src='bl_option_mod')
write(lineBuffer,'(A,ES12.4)') 'shallow_cu_maxtop = ',shallow_cu_maxtop
call umprint(linebuffer,src='bl_option_mod')
write(lineBuffer,'(A,L1)') ' cap_blended_ml = ',cap_blended_ml
call umprint(linebuffer,src='bl_option_mod')
write(lineBuffer,'(2(A,F0.5))') 'alpha_cd_in = ', &
alpha_cd_in(1),' ',alpha_cd_in(2)
call umPrint(lineBuffer,src='bl_option_mod')
Expand Down
Loading