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
4 changes: 4 additions & 0 deletions applications/lfric_atm/metadata/field_def_diags.xml
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@
<field id="convection__cca_2d" name="cca_2d" long_name="convective_cloud_amount_(2d)_with_no_anvil" unit="1" domain_ref="face" />
<field id="convection__lowest_cca_2d" name="lowest_cca_2d" long_name="lowest_convective_cloud_amount_(2d)_with_no_anvil" unit="1" domain_ref="face" />
<field id="convection__ccw" name="ccw" long_name="convective_cloud_water" unit="kg kg-1" grid_ref="full_level_face_grid" />
<field id="convection__ccw_unadjusted" name="ccw_unadjusted" long_name="convective_cloud_water_unadjusted_for_rad" unit="kg kg-1" grid_ref="full_level_face_grid" />
<field id="convection__massflux_up" name="massflux_up" long_name="convection_upward_massflux" unit="Pa s-1" grid_ref="full_level_face_grid" />
<field id="convection__massflux_up_half" name="massflux_up_half" long_name="conv_upward_massflux_half_levs" unit="Pa s-1" grid_ref="half_level_face_grid" />
<field id="convection__massflux_up_cmpta" name="massflux_up_cmpta" long_name="conv_upward_mfx_component_a" unit="Pa s-1" grid_ref="half_level_face_grid" />
Expand Down Expand Up @@ -400,6 +401,7 @@
<field id="convection__mid_in_col" name="mid_in_col" long_name="frequency_of_midlevel_convection" unit="1" domain_ref="face" />
<field id="convection__mid_cfl_limited" name="mid_cfl_limited" long_name="midlevel_convection_cfl_limited" unit="1" domain_ref="face" />
<field id="convection__cape_diluted" name="cape_diluted" long_name="cape_diluted" unit="J/kg" domain_ref="face" />
<field id="convection__cape_undilute" name="cape_undilute" long_name="cape_from_undilute_parcel_ascent" unit="J/kg" domain_ref="face" />
<field id="convection__cape_timescale" name="cape_timescale" long_name="cape_timescale" unit="s" domain_ref="face" />
<field id="convection__freeze_level" name="freeze_level" long_name="model_level_number_at_freezing_level" unit="1" domain_ref="face" />
<field id="convection__pres_lowest_cv_base" name="pres_lowest_cv_base" long_name="pressure_at_lowest_convective_cloud_base" unit="Pa" domain_ref="face" />
Expand All @@ -408,6 +410,8 @@
<field id="convection__pres_cv_top" name="pres_cv_top" long_name="pressure_at_convective_cloud_top" unit="Pa" domain_ref="face" />
<field id="convection__conv_cloud_base_icao_height" name="convection_conv_cloud_base_icao_height" long_name="height_of_convective_cloud_base" unit="kft" domain_ref="face" />
<field id="convection__conv_cloud_top_icao_height" name="convection_conv_cloud_top_icao_height" long_name="height_of_convective_cloud_top" unit="kft" domain_ref="face" />
<field id="convection__lowest_conv_cloud_base_icao_height" name="convection_lowest_conv_cloud_base_icao_height" long_name="height_of_lowest_convective_cloud_base" unit="kft" domain_ref="face" />
<field id="convection__lowest_conv_cloud_top_icao_height" name="convection_lowest_conv_cloud_top_icao_height" long_name="height_of_lowest_convective_cloud_top" unit="kft" domain_ref="face" />
<!-- microphysics diagnostics -->
<field id="microphysics__dtheta_mphys" name="dtheta_mphys" long_name="potential_temperature_increment_due_to_microphysics" unit="K" grid_ref="full_level_face_grid" />
<field id="microphysics__dt_mphys" name="dt_mphys" long_name="temperature_increment_due_to_microphysics" unit="K" grid_ref="full_level_face_grid" />
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
# Met Office Claude Code Enterprise.
# -----------------------------------------------------------------------------
"""
PSyclone script for applying OpenMP transformations specific to the
Gregory-Rowntree convection kernel.
Expand Down Expand Up @@ -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",
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
# Met Office Claude Code Enterprise.
# -----------------------------------------------------------------------------
"""
PSyclone script for applying OpenMP transformations specific to the
Gregory-Rowntree convection kernel.
Expand Down Expand Up @@ -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",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Again, it'd be nice to know / understand what the changes in these optimisation files actually do, given I'm meant to be reviewing this! (stick it to "separation of concerns"!) Are we really meant to just let AI copy/paste what's done for existing variables without understanding it?

"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",
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
# Met Office Claude Code Enterprise.
# -----------------------------------------------------------------------------
'''
This file lifts optional overrides, where possible, into a localised,
single location.
Expand Down Expand Up @@ -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",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you explain what this is doing? Why are we telling PsyClone to "ignore dependencies" specifically for the undilute cape diagnostic output by conv_diag?

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.

I'm not sure - I'm hoping Hacka Fett (@christophermaynard) is going to say whether this is correct or not (it is at least consistent with what happens for the other diagnostic fields!)

]
}

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
# Met Office Claude Code Enterprise.
# -----------------------------------------------------------------------------
"""
PSyclone script for applying OpenMP transformations specific to the
Gregory-Rowntree convection kernel.
Expand Down Expand Up @@ -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",
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
! Met Office Claude Code Enterprise.
!-------------------------------------------------------------------------------
!> @brief Interface to the explicit UM Boundary Layer scheme

module bl_exp_alg_mod
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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), &
Expand Down Expand Up @@ -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

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
! Met Office Claude Code Enterprise.
!-------------------------------------------------------------------------------
!> @brief Interface to the Comorph convection scheme

module conv_comorph_alg_mod
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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

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
! Met Office Claude Code Enterprise.
!-------------------------------------------------------------------------------
!> @brief Interface to the UM Gregory Rowntree convection scheme

module conv_gr_alg_mod
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

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
! Met Office Claude Code Enterprise.
!-------------------------------------------------------------------------------
!> @brief Processes diagnostics for bl_exp_alg

module bl_exp_diags_mod
Expand All @@ -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
Expand All @@ -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' )

Expand Down Expand Up @@ -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, &
Expand All @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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' )

Expand Down
Loading
Loading