diff --git a/applications/lfric_atm/metadata/field_def_diags.xml b/applications/lfric_atm/metadata/field_def_diags.xml
index a2e35f72c0..d700f6e58d 100644
--- a/applications/lfric_atm/metadata/field_def_diags.xml
+++ b/applications/lfric_atm/metadata/field_def_diags.xml
@@ -362,6 +362,7 @@
+
@@ -400,6 +401,7 @@
+
@@ -408,6 +410,8 @@
+
+
diff --git a/applications/lfric_atm/optimisation/azngarch-sandbox/transmute/kernel/conv_gr_kernel_mod.py b/applications/lfric_atm/optimisation/azngarch-sandbox/transmute/kernel/conv_gr_kernel_mod.py
index 7a704a47f5..3bcd7c41c3 100644
--- a/applications/lfric_atm/optimisation/azngarch-sandbox/transmute/kernel/conv_gr_kernel_mod.py
+++ b/applications/lfric_atm/optimisation/azngarch-sandbox/transmute/kernel/conv_gr_kernel_mod.py
@@ -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
+# Met Office Claude Code Enterprise.
+# -----------------------------------------------------------------------------
"""
PSyclone script for applying OpenMP transformations specific to the
Gregory-Rowntree convection kernel.
@@ -240,6 +243,7 @@ def is_wtrac_loop(node: Node):
"mid_dt",
"mid_dq",
"cca_unadjusted",
+ "ccw_unadjusted",
"massflux_up_half",
"du_conv",
"dv_conv",
diff --git a/applications/lfric_atm/optimisation/meto-ex1a/transmute/kernel/conv_gr_kernel_mod.py b/applications/lfric_atm/optimisation/meto-ex1a/transmute/kernel/conv_gr_kernel_mod.py
index edd0c18f63..a992317a04 100644
--- a/applications/lfric_atm/optimisation/meto-ex1a/transmute/kernel/conv_gr_kernel_mod.py
+++ b/applications/lfric_atm/optimisation/meto-ex1a/transmute/kernel/conv_gr_kernel_mod.py
@@ -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
+# Met Office Claude Code Enterprise.
+# -----------------------------------------------------------------------------
"""
PSyclone script for applying OpenMP transformations specific to the
Gregory-Rowntree convection kernel.
@@ -40,7 +43,7 @@
"conv_rain_3d", "conv_snow_3d", "entrain_up", "entrain_down",
"detrain_up", "detrain_down", "dd_dt", "dd_dq", "deep_massflux",
"deep_dt", "deep_dq", "shallow_massflux", "shallow_dt", "shallow_dq",
- "mid_massflux", "mid_dt", "mid_dq", "cca_unadjusted",
+ "mid_massflux", "mid_dt", "mid_dq", "cca_unadjusted", "ccw_unadjusted",
"massflux_up_half", "du_conv", "dv_conv", "dmv_conv",
"conv_prog_precip", "conv_prog_precip", "dt_conv", "conv_prog_dtheta",
"conv_prog_dmv", "dcfl_conv", "dcff_conv", "dbcf_conv", "dd_mf_cb",
diff --git a/applications/lfric_atm/optimisation/meto-ex1a/transmute/kernel/script_options.py b/applications/lfric_atm/optimisation/meto-ex1a/transmute/kernel/script_options.py
index 288d9c0775..07d845fc78 100644
--- a/applications/lfric_atm/optimisation/meto-ex1a/transmute/kernel/script_options.py
+++ b/applications/lfric_atm/optimisation/meto-ex1a/transmute/kernel/script_options.py
@@ -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
+# Met Office Claude Code Enterprise.
+# -----------------------------------------------------------------------------
'''
This file lifts optional overrides, where possible, into a localised,
single location.
@@ -35,6 +38,7 @@
"parcel_buoyancy", "qsat_at_lcl", "bl_type_ind", "visc_m_blend",
"visc_h_blend", "zh_2d", "zhsc_2d", "ntml_2d", "cumulus_2d",
"rh_crit", "mix_len_bm", "dsldzm", "wvar", "zht", "oblen",
+ "cape_undilute_2d",
]
}
diff --git a/applications/lfric_atm/optimisation/ncas-ex/transmute/kernel/conv_gr_kernel_mod.py b/applications/lfric_atm/optimisation/ncas-ex/transmute/kernel/conv_gr_kernel_mod.py
index 7a704a47f5..3bcd7c41c3 100644
--- a/applications/lfric_atm/optimisation/ncas-ex/transmute/kernel/conv_gr_kernel_mod.py
+++ b/applications/lfric_atm/optimisation/ncas-ex/transmute/kernel/conv_gr_kernel_mod.py
@@ -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
+# Met Office Claude Code Enterprise.
+# -----------------------------------------------------------------------------
"""
PSyclone script for applying OpenMP transformations specific to the
Gregory-Rowntree convection kernel.
@@ -240,6 +243,7 @@ def is_wtrac_loop(node: Node):
"mid_dt",
"mid_dq",
"cca_unadjusted",
+ "ccw_unadjusted",
"massflux_up_half",
"du_conv",
"dv_conv",
diff --git a/interfaces/physics_schemes_interface/source/algorithm/bl_exp_alg_mod.x90 b/interfaces/physics_schemes_interface/source/algorithm/bl_exp_alg_mod.x90
index 8fa7710e84..5b13ec4451 100644
--- a/interfaces/physics_schemes_interface/source/algorithm/bl_exp_alg_mod.x90
+++ b/interfaces/physics_schemes_interface/source/algorithm/bl_exp_alg_mod.x90
@@ -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
+! Met Office Claude Code Enterprise.
+!-------------------------------------------------------------------------------
!> @brief Interface to the explicit UM Boundary Layer scheme
module bl_exp_alg_mod
@@ -217,7 +220,7 @@ contains
type(mesh_type), pointer :: mesh
type( field_type ) :: dtl_mphys, dmt_mphys, ngstress_w2, &
fd_tau_w2, ngstress_bl, fd_taux, fd_tauy, fd_tauz, &
- zht, oblen
+ zht, oblen, cape_undilute
type( field_type) :: rdz_wth, taux_land, tauy_land, taux_ssi, tauy_ssi
type( field_type ) :: mr_ice
@@ -343,7 +346,7 @@ contains
dz_wth => get_dz_at_wtheta(config, mesh)
! Initialise diagnostics
- call initialise_diags_for_bl_exp(zht, oblen)
+ call initialise_diags_for_bl_exp(zht, oblen, cape_undilute)
! Fields from microphysics
call dtheta_mphys%copy_field_properties(dtl_mphys)
@@ -409,7 +412,8 @@ contains
bl_weight_1dbl, bl_type_ind, level_ent, &
level_ent_dsc, ent_we_lim, ent_t_frac, &
ent_zrzi, ent_we_lim_dsc, ent_t_frac_dsc, &
- ent_zrzi_dsc, zht, oblen ), &
+ ent_zrzi_dsc, zht, oblen, &
+ cape_undilute ), &
! Initialise w2 fields
setval_c(rhokm_w2, 0.0_r_def), &
setval_c(surf_interp_w2, 0.0_r_def), &
@@ -478,7 +482,7 @@ contains
ent_we_lim, ent_t_frac, ent_zrzi, &
ent_we_lim_dsc, ent_t_frac_dsc, &
ent_zrzi_dsc, zht, oblen, &
- bl_weight_1dbl)
+ cape_undilute, bl_weight_1dbl)
end if
diff --git a/interfaces/physics_schemes_interface/source/algorithm/conv_comorph_alg_mod.x90 b/interfaces/physics_schemes_interface/source/algorithm/conv_comorph_alg_mod.x90
index a686bd4c1a..f9fabbac1f 100644
--- a/interfaces/physics_schemes_interface/source/algorithm/conv_comorph_alg_mod.x90
+++ b/interfaces/physics_schemes_interface/source/algorithm/conv_comorph_alg_mod.x90
@@ -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
+! Met Office Claude Code Enterprise.
+!-------------------------------------------------------------------------------
!> @brief Interface to the Comorph convection scheme
module conv_comorph_alg_mod
@@ -270,6 +273,8 @@ contains
type( field_type ) :: pres_cv_base,pres_cv_top
type( field_type ) :: pres_lowest_cv_base, pres_lowest_cv_top, lowest_cca_2d
type( field_type ) :: cloud_base_icao_height, cloud_top_icao_height
+ type( field_type ) :: lowest_cloud_base_icao_height
+ type( field_type ) :: lowest_cloud_top_icao_height
type( field_type ) :: massflux_up_half
type( field_type ) :: u_in_w3_latest, v_in_w3_latest, w_in_w3_latest, dw_conv
@@ -484,7 +489,9 @@ contains
detrain_down, &
massflux_up_half, &
cloud_base_icao_height, &
- cloud_top_icao_height)
+ cloud_top_icao_height, &
+ lowest_cloud_base_icao_height, &
+ lowest_cloud_top_icao_height)
! call the scheme
ncells = mesh%get_last_edge_cell()
@@ -692,7 +699,9 @@ contains
detrain_down, &
massflux_up_half, &
cloud_base_icao_height, &
- cloud_top_icao_height)
+ cloud_top_icao_height, &
+ lowest_cloud_base_icao_height, &
+ lowest_cloud_top_icao_height)
end if
diff --git a/interfaces/physics_schemes_interface/source/algorithm/conv_gr_alg_mod.x90 b/interfaces/physics_schemes_interface/source/algorithm/conv_gr_alg_mod.x90
index 720cbf3599..0393b9f709 100644
--- a/interfaces/physics_schemes_interface/source/algorithm/conv_gr_alg_mod.x90
+++ b/interfaces/physics_schemes_interface/source/algorithm/conv_gr_alg_mod.x90
@@ -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
+! Met Office Claude Code Enterprise.
+!-------------------------------------------------------------------------------
!> @brief Interface to the UM Gregory Rowntree convection scheme
module conv_gr_alg_mod
@@ -259,6 +262,7 @@ contains
! Local variables
type( field_type ) :: cca_unadjusted
+ type( field_type ) :: ccw_unadjusted
type( field_type ) :: deep_in_col, shallow_in_col, mid_in_col, deep_term
type( field_type ) :: deep_prec, shallow_prec, mid_prec
type( field_type ) :: freeze_level, cape_timescale
@@ -271,6 +275,8 @@ contains
type( field_type ) :: pres_cv_base, pres_cv_top
type( field_type ) :: pres_lowest_cv_base, pres_lowest_cv_top, lowest_cca_2d
type( field_type ) :: cloud_base_icao_height, cloud_top_icao_height
+ type( field_type ) :: lowest_cloud_base_icao_height
+ type( field_type ) :: lowest_cloud_top_icao_height
type( field_type ) :: deep_cfl_limited, mid_cfl_limited
type( field_type ) :: massflux_up_half, massflux_up_cmpta
type( field_type ) :: dth_conv_noshal, dmv_conv_noshal
@@ -507,10 +513,13 @@ contains
massflux_up_half, &
massflux_up_cmpta, &
cca_unadjusted, &
+ ccw_unadjusted, &
dth_conv_noshal, &
dmv_conv_noshal, &
cloud_base_icao_height, &
- cloud_top_icao_height)
+ cloud_top_icao_height, &
+ lowest_cloud_base_icao_height, &
+ lowest_cloud_top_icao_height)
! Calculate total ice field
call mr(imr_s)%copy_field_properties(mr_ice)
@@ -720,7 +729,8 @@ contains
deep_tops, &
massflux_up_half, &
massflux_up_cmpta, &
- cca_unadjusted, dth_conv_noshal, dmv_conv_noshal ) &
+ cca_unadjusted, ccw_unadjusted, &
+ dth_conv_noshal, dmv_conv_noshal ) &
) ! end of invoke
! Switch UM back to columns
@@ -795,10 +805,13 @@ contains
massflux_up_half, &
massflux_up_cmpta, &
cca_unadjusted, &
+ ccw_unadjusted, &
dth_conv_noshal, &
dmv_conv_noshal, &
cloud_base_icao_height,&
- cloud_top_icao_height)
+ cloud_top_icao_height, &
+ lowest_cloud_base_icao_height, &
+ lowest_cloud_top_icao_height)
end if
diff --git a/interfaces/physics_schemes_interface/source/diagnostics/bl_exp_diags_mod.f90 b/interfaces/physics_schemes_interface/source/diagnostics/bl_exp_diags_mod.f90
index 23051799bf..a0f814c905 100644
--- a/interfaces/physics_schemes_interface/source/diagnostics/bl_exp_diags_mod.f90
+++ b/interfaces/physics_schemes_interface/source/diagnostics/bl_exp_diags_mod.f90
@@ -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
+! Met Office Claude Code Enterprise.
+!-------------------------------------------------------------------------------
!> @brief Processes diagnostics for bl_exp_alg
module bl_exp_diags_mod
@@ -18,7 +21,7 @@ module bl_exp_diags_mod
private
! Logical indicating whether diagnostics are requested
- logical( l_def ) :: zht_flag, oblen_flag
+ logical( l_def ) :: zht_flag, oblen_flag, cape_undilute_flag
public :: initialise_diags_for_bl_exp
public :: output_diags_for_bl_exp
@@ -28,18 +31,21 @@ module bl_exp_diags_mod
!> @brief Initialise fields for locally-computed diagnostics
!> @param[inout] zht Turbulent mixing height
!> @param[inout] oblen Obukhov length
- subroutine initialise_diags_for_bl_exp(zht, oblen)
+ !> @param[inout] cape_undilute CAPE from an undilute parcel ascent
+ subroutine initialise_diags_for_bl_exp(zht, oblen, cape_undilute)
implicit none
type( field_type ), intent(inout) :: zht
type( field_type ), intent(inout) :: oblen
+ type( field_type ), intent(inout) :: cape_undilute
integer( tik ) :: id
if ( LPROF ) call start_timing( id, 'diags.bl_exp' )
zht_flag = init_diag(zht, 'turbulence__zht')
oblen_flag = init_diag(oblen, 'turbulence__oblen')
+ cape_undilute_flag = init_diag(cape_undilute, 'convection__cape_undilute')
if ( LPROF ) call stop_timing( id, 'diags.bl_exp' )
@@ -68,6 +74,7 @@ end subroutine initialise_diags_for_bl_exp
!> @param[in] ent_zrzi_dsc Level height as fraction of DSC inversion height above DSC ML base
!> @param[in] zht Turbulent mixing height
!> @param[in] oblen Obukhov length
+ !> @param[in] cape_undilute CAPE from an undilute parcel ascent
!> @param[in] bl_weight_1dbl Blending weight to 1D BL scheme in the BL
subroutine output_diags_for_bl_exp(ntml, cumulus, bl_type_ind, &
wvar, dsldzm, mix_len_bm, &
@@ -76,7 +83,7 @@ subroutine output_diags_for_bl_exp(ntml, cumulus, bl_type_ind, &
ent_we_lim, ent_t_frac, ent_zrzi, &
ent_we_lim_dsc, ent_t_frac_dsc, &
ent_zrzi_dsc, zht, oblen, &
- bl_weight_1dbl)
+ cape_undilute, bl_weight_1dbl)
implicit none
@@ -87,7 +94,8 @@ subroutine output_diags_for_bl_exp(ntml, cumulus, bl_type_ind, &
zht, &
ent_we_lim, ent_t_frac, ent_zrzi, &
ent_we_lim_dsc, ent_t_frac_dsc, &
- ent_zrzi_dsc, oblen, bl_weight_1dbl
+ ent_zrzi_dsc, oblen, cape_undilute, &
+ bl_weight_1dbl
type(integer_field_type), intent(in) :: level_ent, level_ent_dsc, ntml, &
cumulus, bl_type_ind
integer( tik ) :: id
@@ -120,6 +128,7 @@ subroutine output_diags_for_bl_exp(ntml, cumulus, bl_type_ind, &
! Diagnostics computed in the kernel
if (zht_flag) call zht%write_field()
if (oblen_flag) call oblen%write_field()
+ if (cape_undilute_flag) call cape_undilute%write_field()
if ( LPROF ) call stop_timing( id, 'diags.bl_exp' )
diff --git a/interfaces/physics_schemes_interface/source/diagnostics/comorph_diags_mod.x90 b/interfaces/physics_schemes_interface/source/diagnostics/comorph_diags_mod.x90
index e49d04c21e..a6f2322965 100644
--- a/interfaces/physics_schemes_interface/source/diagnostics/comorph_diags_mod.x90
+++ b/interfaces/physics_schemes_interface/source/diagnostics/comorph_diags_mod.x90
@@ -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
+! Met Office Claude Code Enterprise.
+!-------------------------------------------------------------------------------
!> @brief Processes diagnostics for comorph_alg
module comorph_diags_mod
@@ -34,7 +37,9 @@ module comorph_diags_mod
detrain_down_flag, &
massflux_up_half_flag, &
cloud_base_icao_height_flag, &
- cloud_top_icao_height_flag
+ cloud_top_icao_height_flag, &
+ lowest_cloud_base_icao_height_flag, &
+ lowest_cloud_top_icao_height_flag
public :: initialise_diags_for_comorph
public :: output_diags_for_comorph
@@ -57,7 +62,9 @@ contains
detrain_down, &
massflux_up_half, &
cloud_base_icao_height, &
- cloud_top_icao_height)
+ cloud_top_icao_height, &
+ lowest_cloud_base_icao_height, &
+ lowest_cloud_top_icao_height)
implicit none
@@ -77,7 +84,9 @@ contains
detrain_down, &
massflux_up_half, &
cloud_base_icao_height, &
- cloud_top_icao_height
+ cloud_top_icao_height, &
+ lowest_cloud_base_icao_height, &
+ lowest_cloud_top_icao_height
integer(tik) :: id
if ( LPROF ) call start_timing( id, 'diags.comorph' )
@@ -98,10 +107,19 @@ contains
pres_cv_top_flag = init_diag(pres_cv_top, 'convection__pres_cv_top', &
activate=cloud_top_icao_height_flag)
+ lowest_cloud_base_icao_height_flag = init_diag( &
+ lowest_cloud_base_icao_height, &
+ 'convection__lowest_conv_cloud_base_icao_height')
+ lowest_cloud_top_icao_height_flag = init_diag( &
+ lowest_cloud_top_icao_height, &
+ 'convection__lowest_conv_cloud_top_icao_height')
+
pres_lowest_cv_base_flag = init_diag(pres_lowest_cv_base, &
- 'convection__pres_lowest_cv_base')
+ 'convection__pres_lowest_cv_base', &
+ activate=lowest_cloud_base_icao_height_flag)
pres_lowest_cv_top_flag = init_diag(pres_lowest_cv_top, &
- 'convection__pres_lowest_cv_top')
+ 'convection__pres_lowest_cv_top', &
+ activate=lowest_cloud_top_icao_height_flag)
lowest_cca_2d_flag = init_diag(lowest_cca_2d, &
'convection__lowest_cca_2d')
@@ -160,7 +178,9 @@ contains
detrain_down, &
massflux_up_half, &
cloud_base_icao_height, &
- cloud_top_icao_height)
+ cloud_top_icao_height, &
+ lowest_cloud_base_icao_height, &
+ lowest_cloud_top_icao_height)
implicit none
@@ -202,7 +222,9 @@ contains
detrain_down, &
massflux_up_half, &
cloud_base_icao_height, &
- cloud_top_icao_height
+ cloud_top_icao_height, &
+ lowest_cloud_base_icao_height, &
+ lowest_cloud_top_icao_height
integer(tik) :: id
if ( LPROF ) call start_timing( id, 'diags.comorph' )
@@ -246,6 +268,18 @@ contains
call cloud_top_icao_height%write_field()
end if
+ if (lowest_cloud_base_icao_height_flag) then
+ call invoke(icao_heights_kernel_type( &
+ lowest_cloud_base_icao_height, pres_lowest_cv_base, g_over_r_def))
+ call lowest_cloud_base_icao_height%write_field()
+ end if
+
+ if (lowest_cloud_top_icao_height_flag) then
+ call invoke(icao_heights_kernel_type( &
+ lowest_cloud_top_icao_height, pres_lowest_cv_top, g_over_r_def))
+ call lowest_cloud_top_icao_height%write_field()
+ end if
+
! Diagnostics computed within the kernel
! 2D
if (lowest_cv_base_flag) call lowest_cv_base%write_field()
diff --git a/interfaces/physics_schemes_interface/source/diagnostics/conv_diags_mod.x90 b/interfaces/physics_schemes_interface/source/diagnostics/conv_diags_mod.x90
index c83967f9ed..5148b581ca 100644
--- a/interfaces/physics_schemes_interface/source/diagnostics/conv_diags_mod.x90
+++ b/interfaces/physics_schemes_interface/source/diagnostics/conv_diags_mod.x90
@@ -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
+! Met Office Claude Code Enterprise.
+!-------------------------------------------------------------------------------
!> @brief Processes diagnostics for conv_alg
module conv_diags_mod
@@ -57,10 +60,13 @@ module conv_diags_mod
massflux_up_half_flag, &
massflux_up_cmpta_flag, &
cca_unadjusted_flag, &
+ ccw_unadjusted_flag, &
dth_conv_noshal_flag, &
dmv_conv_noshal_flag, &
cloud_base_icao_height_flag, &
- cloud_top_icao_height_flag
+ cloud_top_icao_height_flag, &
+ lowest_cloud_base_icao_height_flag, &
+ lowest_cloud_top_icao_height_flag
public :: initialise_diags_for_conv
public :: output_diags_for_conv
@@ -109,10 +115,13 @@ contains
massflux_up_half, &
massflux_up_cmpta, &
cca_unadjusted, &
+ ccw_unadjusted, &
dth_conv_noshal, &
dmv_conv_noshal, &
cloud_base_icao_height, &
- cloud_top_icao_height)
+ cloud_top_icao_height, &
+ lowest_cloud_base_icao_height, &
+ lowest_cloud_top_icao_height)
implicit none
@@ -159,10 +168,13 @@ contains
massflux_up_half, &
massflux_up_cmpta, &
cca_unadjusted, &
+ ccw_unadjusted, &
dth_conv_noshal, &
dmv_conv_noshal, &
cloud_base_icao_height, &
- cloud_top_icao_height
+ cloud_top_icao_height, &
+ lowest_cloud_base_icao_height, &
+ lowest_cloud_top_icao_height
logical(l_def) :: ignore
integer(tik) :: id
@@ -223,12 +235,24 @@ contains
activate=cloud_top_icao_height_flag)
! not zeroed because overwritten
+ lowest_cloud_base_icao_height_flag = init_diag( &
+ lowest_cloud_base_icao_height, &
+ 'convection__lowest_conv_cloud_base_icao_height')
+ ! not zeroed because overwritten
+
+ lowest_cloud_top_icao_height_flag = init_diag( &
+ lowest_cloud_top_icao_height, &
+ 'convection__lowest_conv_cloud_top_icao_height')
+ ! not zeroed because overwritten
+
pres_lowest_cv_base_flag = init_diag(pres_lowest_cv_base, &
- 'convection__pres_lowest_cv_base')
+ 'convection__pres_lowest_cv_base', &
+ activate=lowest_cloud_base_icao_height_flag)
! not zeroed because overwritten
pres_lowest_cv_top_flag = init_diag(pres_lowest_cv_top, &
- 'convection__pres_lowest_cv_top')
+ 'convection__pres_lowest_cv_top', &
+ activate=lowest_cloud_top_icao_height_flag)
! not zeroed because overwritten
lowest_cca_2d_flag = init_diag(lowest_cca_2d, &
@@ -301,6 +325,9 @@ contains
cca_unadjusted_flag = init_diag(cca_unadjusted, 'convection__cca_unadjusted')
if (cca_unadjusted_flag) call invoke( setval_c(cca_unadjusted, 0.0_r_def) )
+ ccw_unadjusted_flag = init_diag(ccw_unadjusted, 'convection__ccw_unadjusted')
+ if (ccw_unadjusted_flag) call invoke( setval_c(ccw_unadjusted, 0.0_r_def) )
+
dth_conv_noshal_flag = init_diag(dth_conv_noshal, 'convection__dth_conv_noshal')
dmv_conv_noshal_flag = init_diag(dmv_conv_noshal, 'convection__dmv_conv_noshal')
@@ -382,10 +409,13 @@ contains
massflux_up_half, &
massflux_up_cmpta, &
cca_unadjusted, &
+ ccw_unadjusted, &
dth_conv_noshal, &
dmv_conv_noshal, &
cloud_base_icao_height, &
- cloud_top_icao_height)
+ cloud_top_icao_height, &
+ lowest_cloud_base_icao_height, &
+ lowest_cloud_top_icao_height)
implicit none
@@ -451,10 +481,13 @@ contains
massflux_up_half, &
massflux_up_cmpta, &
cca_unadjusted, &
+ ccw_unadjusted, &
dth_conv_noshal, &
dmv_conv_noshal, &
cloud_base_icao_height, &
- cloud_top_icao_height
+ cloud_top_icao_height, &
+ lowest_cloud_base_icao_height, &
+ lowest_cloud_top_icao_height
integer( tik ) :: id
if ( LPROF ) call start_timing( id, 'diags.conv' )
@@ -498,6 +531,18 @@ contains
call cloud_top_icao_height%write_field()
end if
+ if (lowest_cloud_base_icao_height_flag) then
+ call invoke(icao_heights_kernel_type( &
+ lowest_cloud_base_icao_height, pres_lowest_cv_base, g_over_r_def))
+ call lowest_cloud_base_icao_height%write_field()
+ end if
+
+ if (lowest_cloud_top_icao_height_flag) then
+ call invoke(icao_heights_kernel_type( &
+ lowest_cloud_top_icao_height, pres_lowest_cv_top, g_over_r_def))
+ call lowest_cloud_top_icao_height%write_field()
+ end if
+
! Diagnostics computed within the kernel
! 2D
if (deep_in_col_flag) call deep_in_col%write_field()
@@ -540,6 +585,7 @@ contains
if (massflux_up_half_flag) call massflux_up_half%write_field()
if (massflux_up_cmpta_flag) call massflux_up_cmpta%write_field()
if (cca_unadjusted_flag) call cca_unadjusted%write_field()
+ if (ccw_unadjusted_flag) call ccw_unadjusted%write_field()
if (dth_conv_noshal_flag) call dth_conv_noshal%write_field()
if (dmv_conv_noshal_flag) call dmv_conv_noshal%write_field()
diff --git a/interfaces/physics_schemes_interface/source/kernel/bl_exp_kernel_mod.F90 b/interfaces/physics_schemes_interface/source/kernel/bl_exp_kernel_mod.F90
index 12c16f8eeb..3fe6af81fb 100644
--- a/interfaces/physics_schemes_interface/source/kernel/bl_exp_kernel_mod.F90
+++ b/interfaces/physics_schemes_interface/source/kernel/bl_exp_kernel_mod.F90
@@ -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
+! Met Office Claude Code Enterprise.
+!-----------------------------------------------------------------------------
!> @brief Interface to the explicit UM boundary layer scheme.
module bl_exp_kernel_mod
@@ -40,7 +43,7 @@ module bl_exp_kernel_mod
!>
type, public, extends(kernel_type) :: bl_exp_kernel_type
private
- type(arg_type) :: meta_args(93) = (/ &
+ type(arg_type) :: meta_args(94) = (/ &
arg_type(GH_FIELD, GH_REAL, GH_READ, WTHETA), &! theta_in_wth
arg_type(GH_FIELD, GH_REAL, GH_READ, W3), &! rho_in_w3
arg_type(GH_FIELD, GH_REAL, GH_READ, WTHETA), &! rho_in_wth
@@ -133,7 +136,8 @@ module bl_exp_kernel_mod
arg_type(GH_FIELD, GH_REAL, GH_WRITE, ANY_DISCONTINUOUS_SPACE_5),&! ent_t_frac_dsc
arg_type(GH_FIELD, GH_REAL, GH_WRITE, ANY_DISCONTINUOUS_SPACE_5),&! ent_zrzi_dsc
arg_type(GH_FIELD, GH_REAL, GH_WRITE, ANY_DISCONTINUOUS_SPACE_1),&! diag__zht
- arg_type(GH_FIELD, GH_REAL, GH_WRITE, ANY_DISCONTINUOUS_SPACE_1) &! diag__oblen
+ arg_type(GH_FIELD, GH_REAL, GH_WRITE, ANY_DISCONTINUOUS_SPACE_1),&! diag__oblen
+ arg_type(GH_FIELD, GH_REAL, GH_WRITE, ANY_DISCONTINUOUS_SPACE_1) &! diag__cape_undilute
/)
integer :: operates_on = DOMAIN
contains
@@ -242,6 +246,8 @@ module bl_exp_kernel_mod
!> @param[in,out] ent_zrzi_dsc Level height as fraction of DSC inversion height above DSC ML base
!> @param[in,out] zht Diagnostic: turb mixing height
!> @param[in,out] oblen Diagnostic: Obukhov length
+ !> @param[in,out] cape_undilute_2d Diagnostic: CAPE from an undilute
+ !> parcel ascent
!> @param[in] ndf_wth Number of DOFs per cell for potential temperature space
!> @param[in] undf_wth Number of unique DOFs for potential temperature space
!> @param[in] map_wth Dofmap for the cell at the base of the column for potential temperature space
@@ -357,6 +363,7 @@ subroutine bl_exp_code(nlayers, seg_len, &
ent_zrzi_dsc, &
zht, &
oblen, &
+ cape_undilute_2d, &
ndf_wth, undf_wth, map_wth, &
ndf_w3, undf_w3, map_w3, &
ndf_2d, undf_2d, map_2d, &
@@ -501,6 +508,7 @@ subroutine bl_exp_code(nlayers, seg_len, &
real(kind=r_def), pointer, intent(inout) :: zht(:)
real(kind=r_def), pointer, intent(inout) :: oblen(:)
+ real(kind=r_def), pointer, intent(inout) :: cape_undilute_2d(:)
!-----------------------------------------------------------------------
! Local variables for the kernel
!-----------------------------------------------------------------------
@@ -1162,6 +1170,11 @@ subroutine bl_exp_code(nlayers, seg_len, &
oblen(map_2d(1,i)) = BL_diag%oblen(i,1)
end do
end if
+ if (.not. associated(cape_undilute_2d, empty_real_data) ) then
+ do i = 1, seg_len
+ cape_undilute_2d(map_2d(1,i)) = real(cape_undilute(i,1), r_def)
+ end do
+ end if
! deallocate diagnostics deallocated in atmos_physics2
call dealloc_bl_expl(bl_diag)
diff --git a/interfaces/physics_schemes_interface/source/kernel/conv_gr_kernel_mod.F90 b/interfaces/physics_schemes_interface/source/kernel/conv_gr_kernel_mod.F90
index 84136e4f17..46ca016a26 100644
--- a/interfaces/physics_schemes_interface/source/kernel/conv_gr_kernel_mod.F90
+++ b/interfaces/physics_schemes_interface/source/kernel/conv_gr_kernel_mod.F90
@@ -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
+! Met Office Claude Code Enterprise.
+!-----------------------------------------------------------------------------
!> @brief Interface to the UM Gregory Rowntree Convection scheme.
!>
module conv_gr_kernel_mod
@@ -34,7 +37,7 @@ module conv_gr_kernel_mod
!>
type, public, extends(kernel_type) :: conv_gr_kernel_type
private
- type(arg_type) :: meta_args(210) = (/ &
+ type(arg_type) :: meta_args(211) = (/ &
arg_type(GH_SCALAR, GH_INTEGER, GH_READ), &! outer
arg_type(GH_FIELD, GH_REAL, GH_READ, W3), &! rho_in_w3
arg_type(GH_FIELD, GH_REAL, GH_READ, WTHETA), &! rho_in_wth
@@ -243,6 +246,7 @@ module conv_gr_kernel_mod
arg_type(GH_FIELD, GH_REAL, GH_READWRITE, W3), &! massflux_up_half
arg_type(GH_FIELD, GH_REAL, GH_READWRITE, W3), &! massflux_up_cmpta
arg_type(GH_FIELD, GH_REAL, GH_READWRITE, WTHETA), &! cca_unadjusted
+ arg_type(GH_FIELD, GH_REAL, GH_READWRITE, WTHETA), &! ccw_unadjusted
arg_type(GH_FIELD, GH_REAL, GH_WRITE, WTHETA), &! dth_conv_noshal
arg_type(GH_FIELD, GH_REAL, GH_WRITE, WTHETA) &! dmv_conv_noshal
/)
@@ -469,6 +473,7 @@ module conv_gr_kernel_mod
!> @param[in,out] massflux_up_half Convective upwards mass flux on half-levels (Pa/s)
!> @param[in,out] massflux_up_cmpta Convective upwards mass flux component A (Pa/s)
!> @param[in,out] cca_unadjusted Convective cloud amout unadjusted for radiation calc.
+ !> @param[in,out] ccw_unadjusted Convective cloud water unadjusted for radiation calc.
!> @param[out] dth_conv_noshal Convection theta increment from non-shallow regions
!> @param[out] dmv_conv_noshal Convection vapour increment from non-shallow regions
!> @param[in] ndf_w3 Number of DOFs per cell for density space
@@ -693,6 +698,7 @@ subroutine conv_gr_code(nlayers, &
massflux_up_half, &
massflux_up_cmpta, &
cca_unadjusted, &
+ ccw_unadjusted, &
dth_conv_noshal, &
dmv_conv_noshal, &
ndf_w3, &
@@ -1071,6 +1077,7 @@ subroutine conv_gr_code(nlayers, &
massflux_up_half(:), &
massflux_up_cmpta(:),&
cca_unadjusted(:), &
+ ccw_unadjusted(:), &
dth_conv_noshal(:), &
dmv_conv_noshal(:)
@@ -2519,6 +2526,14 @@ subroutine conv_gr_code(nlayers, &
end do
end do
end if
+ if (.not. associated(ccw_unadjusted, empty_real_data) ) then
+ do k = 1, n_conv_levels
+ do i = 1, ncells
+ ccw_unadjusted(map_wth(1,i) + k) = ccw_unadjusted(map_wth(1,i) + k) + &
+ it_ccw(i,1,k)*one_over_conv_calls
+ end do
+ end do
+ end if
if (.not. associated(massflux_up_half, empty_real_data) ) then
do k = 1, n_conv_levels
do i = 1, ncells
diff --git a/rose-stem/app/lfric_atm/file/file_def_diags_oper_nwp_gl.xml b/rose-stem/app/lfric_atm/file/file_def_diags_oper_nwp_gl.xml
index ed3d5eafa0..d036abeeb9 100644
--- a/rose-stem/app/lfric_atm/file/file_def_diags_oper_nwp_gl.xml
+++ b/rose-stem/app/lfric_atm/file/file_def_diags_oper_nwp_gl.xml
@@ -148,7 +148,9 @@
-
+
+
+