Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions rose-stem/app/lfric_atm/opt/rose-app-ral3.conf
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ reference_reset_time=$DT
[namelist:mixing]
conservative_diffusion=.true.
density_weighted=.true.
leonard_inc_ice=.true.
leonard_kl=2.0
leonard_term=.true.
max_diff_factor=1.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Inner product checksum rho = 48399774
Inner product checksum theta = 5135493E
Inner product checksum u = 612F454A
Inner product checksum mr1 = 4090F564
Inner product checksum mr2 = 35AC3C55
Inner product checksum mr3 = 2FA5F7C0
Inner product checksum mr4 = 33F4FD5A
Inner product checksum mr5 = BEDD43D
Inner product checksum rho = 48399779
Inner product checksum theta = 5135493C
Inner product checksum u = 612F4542
Inner product checksum mr1 = 4090F54C
Inner product checksum mr2 = 35AD9767
Inner product checksum mr3 = 2FA612E3
Inner product checksum mr4 = 33F4FD5C
Inner product checksum mr5 = BEDF80D
Inner product checksum mr6 = 0
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Inner product checksum rho = 48399985
Inner product checksum theta = 51354898
Inner product checksum u = 612F4B6A
Inner product checksum mr1 = 40916361
Inner product checksum mr2 = 3684D2A0
Inner product checksum mr3 = 2FAD3D2F
Inner product checksum mr4 = 33F4FE0F
Inner product checksum mr5 = BF85CFF
Inner product checksum rho = 4839998D
Inner product checksum theta = 51354896
Inner product checksum u = 612F4B5D
Inner product checksum mr1 = 4091642D
Inner product checksum mr2 = 366BB016
Inner product checksum mr3 = 2FACCAE3
Inner product checksum mr4 = 33F4FE42
Inner product checksum mr5 = BF85C5E
Inner product checksum mr6 = 0
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Inner product checksum rho = 48398C72
Inner product checksum rho = 48398C6C
Inner product checksum theta = 513542FA
Inner product checksum u = 612EE1C7
Inner product checksum mr1 = 40910314
Inner product checksum mr2 = 358600ED
Inner product checksum mr3 = 3000FB73
Inner product checksum mr4 = 3404ABEC
Inner product checksum mr5 = C1462BB
Inner product checksum u = 612EE1BC
Inner product checksum mr1 = 4091031B
Inner product checksum mr2 = 358AC7DB
Inner product checksum mr3 = 30010699
Inner product checksum mr4 = 3404ABCF
Inner product checksum mr5 = C1462B6
Inner product checksum mr6 = 0
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Inner product checksum rho = 483997B2
Inner product checksum theta = 51354962
Inner product checksum u = 612F4912
Inner product checksum mr1 = 4090FC04
Inner product checksum mr2 = 35B167C4
Inner product checksum mr3 = 2FA645AF
Inner product checksum mr4 = 33F4FE48
Inner product checksum mr5 = BECFC33
Inner product checksum rho = 483997B7
Inner product checksum theta = 51354961
Inner product checksum u = 612F490C
Inner product checksum mr1 = 4090FAE0
Inner product checksum mr2 = 35B3E45C
Inner product checksum mr3 = 2FA642EB
Inner product checksum mr4 = 33F4FE35
Inner product checksum mr5 = BECD102
Inner product checksum mr6 = 0
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Inner product checksum rho = 483997E0
Inner product checksum theta = 5135494E
Inner product checksum rho = 483997DC
Inner product checksum theta = 5135494F
Inner product checksum u = 612F4984
Inner product checksum mr1 = 409110E8
Inner product checksum mr2 = 35E540AB
Inner product checksum mr3 = 2FA98AF3
Inner product checksum mr4 = 33F4FF5D
Inner product checksum mr5 = BF18191
Inner product checksum mr1 = 40911114
Inner product checksum mr2 = 35E5C49D
Inner product checksum mr3 = 2FA94418
Inner product checksum mr4 = 33F4FF54
Inner product checksum mr5 = BF18177
Inner product checksum mr6 = 0
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Inner product checksum rho = 48398C6B
Inner product checksum rho = 48398C69
Inner product checksum theta = 51354302
Inner product checksum u = 612EDCBC
Inner product checksum mr1 = 40910380
Inner product checksum mr2 = 358489D6
Inner product checksum mr3 = 3000F2CD
Inner product checksum mr4 = 3404AC27
Inner product checksum mr5 = C14A272
Inner product checksum u = 612EDCAE
Inner product checksum mr1 = 40910306
Inner product checksum mr2 = 35903E6B
Inner product checksum mr3 = 30010A9D
Inner product checksum mr4 = 3404AC21
Inner product checksum mr5 = C14A26B
Inner product checksum mr6 = 0
24 changes: 24 additions & 0 deletions science/gungho/rose-meta/lfric-gungho/HEAD/rose-meta.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3661,6 +3661,28 @@ ns=namelist/Science/Dynamics/Mixing
sort-key=Panel-A09
type=logical

[namelist:mixing=leonard_inc_ice]
compulsory=true
description=Include ice in the Leonard term.
help=If enabled the Leonard term includes ice mixing ratio
=in its conserved variables and mixing calculations.
!kind=default
ns=namelist/Science/Dynamics/Mixing
sort-key=Panel-A07a
type=logical

[namelist:mixing=leonard_inc_with_bl]
compulsory=true
description=Add increment of Leonard term together with boundary layer.
fail-if=this==".true." and namelist:physics=blayer_placement=="'slow'" ;
Comment thread
iboutle marked this conversation as resolved.
Outdated
help=If enabled the Leonard term increment is passed to boundary layer implicit
=solver and solved together with cloud scheme.
=Note the increments are calculated from time-level n fields in any case.
!kind=default
ns=namelist/Science/Dynamics/Mixing
sort-key=Panel-A07b
type=logical

[namelist:mixing=leonard_kl]
compulsory=true
description=Leonard term parameter
Expand Down Expand Up @@ -3688,6 +3710,8 @@ help=Calculate turbulent vertical fluxes due to Leonard terms,
!kind=default
sort-key=Panel-A06
trigger=namelist:mixing=leonard_kl: .true. ;
=namelist:mixing=leonard_inc_ice: .true. ;
=namelist:mixing=leonard_inc_with_bl: .true. ;
type=logical

[namelist:mixing=max_diff_factor]
Expand Down
11 changes: 11 additions & 0 deletions science/gungho/rose-meta/lfric-gungho/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,14 @@ def upgrade(self, config, meta_config=None):
# Add settings
return config, self.reports
"""
class vn32_t725(MacroUpgrade):
# Upgrade macro for #725 by Ian Boutle

BEFORE_TAG = "vn3.2"
AFTER_TAG = "vn3.2_t725"

def upgrade(self, config, meta_config=None):
# Add settings
self.add_setting(config,["namelist:mixing", "leonard_inc_ice"], ".false.")
self.add_setting(config,["namelist:mixing", "leonard_inc_with_bl"], ".false.")
return config, self.reports
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module leonard_term_alg_mod
use field_collection_mod, only: field_collection_type
use integer_field_mod, only: integer_field_type
use mesh_mod, only: mesh_type
use mr_indices_mod, only: nummr, imr_v, imr_cl
use mr_indices_mod, only: nummr, imr_v, imr_cl, imr_s

use formulation_config_mod, only: moisture_formulation, &
moisture_formulation_dry
Expand All @@ -24,7 +24,7 @@ module leonard_term_alg_mod
get_face_selector_ns
use physics_constants_mod, only: get_dtrdz_fd2

use mixing_config_mod, only: leonard_kl
use mixing_config_mod, only: leonard_kl, leonard_inc_ice

use timing_mod, only: start_timing, stop_timing, tik, LPROF
use log_mod, only: log_event, LOG_LEVEL_INFO
Expand Down Expand Up @@ -62,7 +62,7 @@ subroutine leonard_term_alg(config, &
use leonard_term_kl_kernel_mod, only: leonard_term_kl_kernel_type
use leonard_term_th_kernel_mod, only: leonard_term_th_kernel_type
use leonard_term_u_kernel_mod, only: leonard_term_u_kernel_type
use planet_constants_mod, only: lcrcp_def
use planet_constants_mod, only: lcrcp_def, lsrcp_def
use extrusion_config_mod, only: planet_radius
use nlsizes_namelist_mod, only: bl_levels

Expand Down Expand Up @@ -116,6 +116,8 @@ subroutine leonard_term_alg(config, &
type( field_type ) :: mt
! w increment
type( field_type ) :: vel_w2v_inc_leonard
! ice mixing ratio
type( field_type ) :: mr_ice

if ( LPROF ) call start_timing( id, 'leonard_term' )

Expand Down Expand Up @@ -147,6 +149,13 @@ subroutine leonard_term_alg(config, &
call theta%copy_field_properties(thetal)
call theta%copy_field_properties(mt)
call theta%copy_field_properties(vel_w2v_inc_leonard)
call theta%copy_field_properties(mr_ice)

if (leonard_inc_ice) then
call invoke( setval_X( mr_ice, mr(imr_s)) )
else
call invoke( setval_C( mr_ice, 0.0_r_def ) )
end if

!--------------------------------------------------------------------
! Apply stability-limit to leonard_kl:
Expand Down Expand Up @@ -201,9 +210,10 @@ subroutine leonard_term_alg(config, &
! Flux of liquid + ice water potential temperature:
!--------------------------------------------------------------------
! Calculate thetaL =
! theta - ((lc/cp)*mcl) / exner
! (theta - (lc/cp)*mcl [-(ls/cp)*msnow]) / exner
Comment thread
iboutle marked this conversation as resolved.
Outdated
X_times_Y(thetal, theta, exner_in_wth), &
inc_X_minus_bY(thetal, lcrcp_def, mr(imr_cl)), &
inc_X_minus_by(thetal, lsrcp_def, mr_ice), &
Comment thread
iboutle marked this conversation as resolved.
Outdated
inc_X_divideby_Y(thetal, exner_in_wth), &
! Call Leonard term code for scalars
leonard_term_th_kernel_type( thetal_inc_leonard, &
Expand All @@ -222,8 +232,9 @@ subroutine leonard_term_alg(config, &
! Flux of total water content:
!--------------------------------------------------------------------
if ( moisture_formulation /= moisture_formulation_dry ) then
! Calculate mt = mv+mcl
! Calculate mt = mv+mcl(+msnow)
call invoke( X_plus_Y(mt, mr(imr_v), mr(imr_cl)), &
inc_X_plus_Y(mt, mr_ice), &
! Call Leonard term code for scalars
leonard_term_th_kernel_type( mt_inc_leonard, &
mt, &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ module fast_physics_alg_mod
only: enforce_lower_bound_kernel_type
use moisture_conservation_alg_mod, &
only: moisture_conservation_alg
use mixing_config_mod, only: smagorinsky
use mixing_config_mod, only: smagorinsky, leonard_term, leonard_inc_with_bl
use smagorinsky_alg_mod, only: smagorinsky_alg
use timestepping_config_mod, &
only : outer_iterations
Expand Down Expand Up @@ -190,7 +190,10 @@ contains
! ...for boundary layer stochastic perturbation
type( field_type ) :: dtheta_blpert
type( field_type ) :: dmv_blpert

! ...for Leonard term flux
type( field_type ), pointer :: u_inc_leonard
type( field_type ), pointer :: mt_inc_leonard
type( field_type ), pointer :: thetal_inc_leonard
! ...surface fields passed from BL to Jules
type( field_type ) :: surf_heat_flux
type( field_type ) :: canopy_evap
Expand Down Expand Up @@ -264,6 +267,17 @@ contains
! UM implicit boundary layer
!--------------------------------------------------------------------
if (boundary_layer == boundary_layer_um) then

! Possibly add Leonard increments here
if (leonard_term .and. leonard_inc_with_bl) then
call turbulence_fields%get_field('u_inc_leonard', u_inc_leonard)
call turbulence_fields%get_field('mt_inc_leonard', mt_inc_leonard)
call turbulence_fields%get_field('thetal_inc_leonard', thetal_inc_leonard)
call invoke(inc_X_plus_Y(mr(imr_v), mt_inc_leonard), &
inc_X_plus_Y(theta_latest, thetal_inc_leonard), &
inc_X_plus_Y(u_latest, u_inc_leonard) )
end if

if(blayer_placement == blayer_placement_b4conv) then
call bl_imp_alg(config, &
dtheta, du, theta_latest, u_latest, mr, &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module slow_physics_alg_mod
use mesh_mod, only: mesh_type
use driver_modeldb_mod, only: modeldb_type
use field_parent_mod, only: write_interface
use mixing_config_mod, only: leonard_term
use mixing_config_mod, only: leonard_term, leonard_inc_with_bl
use print_field_stats_alg_mod, only: print_field_stats_alg
use physics_config_mod, only: microphysics_placement, &
microphysics_placement_slow, &
Expand Down Expand Up @@ -289,9 +289,9 @@ contains
! ...for methane oxidation
type( field_type ) :: dmv_methox
! ...for Leonard term flux
type( field_type ) :: u_inc_leonard
type( field_type ), pointer :: mt_inc_leonard => null()
type( field_type ), pointer :: thetal_inc_leonard => null()
type( field_type ), pointer :: u_inc_leonard
type( field_type ), pointer :: mt_inc_leonard
type( field_type ), pointer :: thetal_inc_leonard
! ...for evaporation condensation
type( field_type ) :: dtheta_cld
type( field_type ) :: dmr_cld(nummr)
Expand Down Expand Up @@ -923,7 +923,7 @@ contains
!--------------------------------------------------------------------

if (leonard_term .and. boundary_layer == boundary_layer_um ) then
call u%copy_field_properties(u_inc_leonard)
call turbulence_fields%get_field('u_inc_leonard', u_inc_leonard)
call turbulence_fields%get_field('mt_inc_leonard', mt_inc_leonard)
call turbulence_fields%get_field('thetal_inc_leonard', thetal_inc_leonard)
call leonard_term_alg(modeldb%config, &
Expand Down Expand Up @@ -1070,11 +1070,10 @@ contains
call dmv_methox%field_final()
end if

if (leonard_term_done) then
if (leonard_term_done .and. .not. leonard_inc_with_bl) then
call invoke(inc_X_plus_Y(mr(imr_v), mt_inc_leonard), &
inc_X_plus_Y(dtheta, thetal_inc_leonard), &
inc_X_plus_Y(du, u_inc_leonard) )
call u_inc_leonard%field_final()
end if

if (evap_condense_done) then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module create_physics_prognostics_mod
LOG_LEVEL_WARNING, &
LOG_LEVEL_ERROR
use mesh_mod, only : mesh_type
use mixing_config_mod, only : smagorinsky
use mixing_config_mod, only : smagorinsky, leonard_term
use physics_config_mod, only : stochastic_physics_placement, &
stochastic_physics_placement_fast
use pure_abstract_field_mod, only : pure_abstract_field_type
Expand Down Expand Up @@ -674,8 +674,12 @@ subroutine process_physics_prognostics(processor)
call processor%apply(make_spec('rhokm_bl', main%turbulence, Wtheta))
call processor%apply(make_spec('dtrdz_tq_bl', main%turbulence, Wtheta))
call processor%apply(make_spec('dw_bl', main%turbulence, Wtheta))
call processor%apply(make_spec('thetal_inc_leonard', main%turbulence, Wtheta))
call processor%apply(make_spec('mt_inc_leonard', main%turbulence, Wtheta))
call processor%apply(make_spec('thetal_inc_leonard', main%turbulence, &
Wtheta, empty=(.not. leonard_term)))
call processor%apply(make_spec('mt_inc_leonard', main%turbulence, Wtheta, &
empty=(.not. leonard_term)))
call processor%apply(make_spec('u_inc_leonard', main%turbulence, W2, &
empty=(.not. leonard_term)))

! 3D fields on W3 (rho) levels
call processor%apply(make_spec('moist_flux_bl', main%turbulence, W3))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ contains
smag_l_calc = smag_l_calc_UseDx, &
leonard_term = .false., &
leonard_kl = 4.0_r_def, &
leonard_inc_ice = .false., &
Comment thread
iboutle marked this conversation as resolved.
leonard_inc_with_bl = .false., &
conservative_diffusion = .false., &
density_weighted = .false., &
max_diff_factor = 1.0_r_def )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ contains
smag_l_calc = smag_l_calc_UseDx, &
leonard_term = .false., &
leonard_kl = 1.0_r_def, &
leonard_inc_ice = .false., &
leonard_inc_with_bl = .false., &
conservative_diffusion = .false., &
density_weighted = .false., &
max_diff_factor = 1.0_r_def )
Expand Down