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
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 @@ -134,6 +134,7 @@ reference_reset_time=$DT
conservative_diffusion=.true.
density_weighted=.true.
fullstress=.false.
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 = 4839976C
Inner product checksum theta = 5135493F
Inner product checksum u = 612F4546
Inner product checksum mr1 = 4090F5D8
Inner product checksum mr2 = 35B989F8
Inner product checksum mr3 = 2FA5EB0E
Inner product checksum mr4 = 33F4FD76
Inner product checksum mr5 = BEDF85E
Inner product checksum rho = 4839977A
Inner product checksum theta = 5135493D
Inner product checksum u = 612F4542
Inner product checksum mr1 = 4090F4FE
Inner product checksum mr2 = 35B4D473
Inner product checksum mr3 = 2FA6198D
Inner product checksum mr4 = 33F4FD46
Inner product checksum mr5 = BEDF7E6
Inner product checksum mr6 = 0
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Inner product checksum rho = 4839997B
Inner product checksum theta = 5135489B
Inner product checksum u = 612F4B64
Inner product checksum mr1 = 40916436
Inner product checksum mr2 = 36823DEC
Inner product checksum mr3 = 2FAD639B
Inner product checksum mr4 = 33F4FE50
Inner product checksum mr5 = BF85D74
Inner product checksum rho = 48399985
Inner product checksum theta = 51354897
Inner product checksum u = 612F4B51
Inner product checksum mr1 = 409163CD
Inner product checksum mr2 = 367D7E0E
Inner product checksum mr3 = 2FAD3562
Inner product checksum mr4 = 33F4FE54
Inner product checksum mr5 = BF85BF8
Inner product checksum mr6 = 0
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Inner product checksum rho = 48398C70
Inner product checksum rho = 48398C74
Inner product checksum theta = 513542F8
Inner product checksum u = 612EE1BE
Inner product checksum mr1 = 409102F3
Inner product checksum mr2 = 359530A4
Inner product checksum mr3 = 30010773
Inner product checksum mr4 = 3404ABD3
Inner product checksum mr5 = C1462BB
Inner product checksum u = 612EE1CD
Inner product checksum mr1 = 40910300
Inner product checksum mr2 = 358650CB
Inner product checksum mr3 = 3001097F
Inner product checksum mr4 = 3404AC2C
Inner product checksum mr5 = C1462C6
Inner product checksum mr6 = 0
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Inner product checksum rho = 483997B8
Inner product checksum rho = 483997B2
Inner product checksum theta = 51354962
Inner product checksum u = 612F490E
Inner product checksum mr1 = 4090FB38
Inner product checksum mr2 = 35AE36C7
Inner product checksum mr3 = 2FA6571A
Inner product checksum mr4 = 33F4FE4B
Inner product checksum mr5 = BECFC7D
Inner product checksum u = 612F4922
Inner product checksum mr1 = 4090FB85
Inner product checksum mr2 = 35AB7E5A
Inner product checksum mr3 = 2FA630D3
Inner product checksum mr4 = 33F4FE56
Inner product checksum mr5 = BECD174
Inner product checksum mr6 = 0
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Inner product checksum rho = 483997DA
Inner product checksum theta = 51354950
Inner product checksum u = 612F4977
Inner product checksum mr1 = 4091114C
Inner product checksum mr2 = 35E0B089
Inner product checksum mr3 = 2FA93754
Inner product checksum mr4 = 33F4FF8E
Inner product checksum mr5 = BF183A5
Inner product checksum rho = 483997E1
Inner product checksum theta = 5135494C
Inner product checksum u = 612F497B
Inner product checksum mr1 = 40911133
Inner product checksum mr2 = 35D964C0
Inner product checksum mr3 = 2FA94882
Inner product checksum mr4 = 33F4FF7D
Inner product checksum mr5 = BF17CA5
Inner product checksum mr6 = 0
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Inner product checksum rho = 48398C69
Inner product checksum rho = 48398C66
Inner product checksum theta = 51354302
Inner product checksum u = 612EDCB7
Inner product checksum mr1 = 40910378
Inner product checksum mr2 = 3590B532
Inner product checksum mr3 = 30010AD7
Inner product checksum mr4 = 3404AC2D
Inner product checksum mr5 = C14A26E
Inner product checksum u = 612EDCB3
Inner product checksum mr1 = 40910357
Inner product checksum mr2 = 35902A35
Inner product checksum mr3 = 3000F13E
Inner product checksum mr4 = 3404AC8B
Inner product checksum mr5 = C14A277
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 @@ -3729,6 +3729,27 @@ help=Switch to enable full tensor expression for stress in the turbulence
sort-key=Panel-A03
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.
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 @@ -3756,6 +3777,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 Expand Up @@ -5050,6 +5073,7 @@ help=Determines where the boundary layer implicit solver is called from.
!kind=default
ns=namelist/Science/Timestep placement
sort-key=Panel-A03
trigger=namelist:mixing=leonard_inc_with_bl: 'fast','b4conv' ;
value-titles=Fast physics, Before convection, Slow physics
values='fast','b4conv','slow'

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 @@ -61,3 +61,14 @@ def upgrade(self, config, meta_config=None):
self.add_setting(config, ["namelist:mixing", "fullstress"], ".false.")

return config, self.reports
class vn32_t725(MacroUpgrade):
# Upgrade macro for #725 by Ian Boutle

BEFORE_TAG = "vn3.2_t479"
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
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), &
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 @@ -926,7 +926,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 @@ -1073,11 +1073,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 @@ -126,6 +126,8 @@ contains
smag_l_calc = smag_l_calc_UseDx, &
leonard_term = .false., &
leonard_kl = 4.0_r_def, &
leonard_inc_ice = .false., &
leonard_inc_with_bl = .false., &
conservative_diffusion = .true., &
density_weighted = .true., &
max_diff_factor=1.0_r_def )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ contains
smag_l_calc = smag_l_calc_UseDx, &
leonard_term = .false., &
leonard_kl = 4.0_r_def, &
leonard_inc_ice = .false., &
leonard_inc_with_bl = .false., &
conservative_diffusion = .true., &
density_weighted = .true., &
max_diff_factor=1.0_r_def )
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
Loading