Skip to content
Open
Show file tree
Hide file tree
Changes from 12 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
2 changes: 2 additions & 0 deletions rose-stem/app/gungho_model/rose-app.conf
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,8 @@ si_tolerance=1.0e-1
split_w=.true.

[namelist:mixing]
!!conservative_diffusion=.true.
!!density_weighted=.true.
!!leonard_kl=1.0
leonard_term=.false.
!!method='blending'
Expand Down
2 changes: 2 additions & 0 deletions rose-stem/app/lfric_atm/rose-app.conf
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,8 @@ si_tolerance=1.0e-1
split_w=.true.

[namelist:mixing]
!!conservative_diffusion=.true.
!!density_weighted=.true.
!!leonard_kl=2.0
leonard_term=.false.
!!method='blend_1dbl_fa'
Expand Down
40 changes: 40 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 @@ -3534,6 +3534,35 @@ help=Currently available schemes are:
ns=namelist/Science/Dynamics/Mixing
sort-key=Section-A05

[namelist:mixing=conservative_diffusion]
compulsory=true
description=Use conservative form of tracer diffusion operator
help=When true, the diffusion operator for tracers is implemented in
=conservative form, i.e. the fluxes are computed and then the divergence of
=the fluxes is taken to obtain the tendency.
=
=When false, a non-conservative form is used, i.e. the Laplacian of the
=tracer field is computed directly to obtain the tendency.
!kind=default
ns=namelist/Science/Dynamics/Mixing
sort-key=Panel-A08
type=logical

[namelist:mixing=density_weighted]
compulsory=true
description=Whether to include the dry density in the tracer diffusion operator
help=When true, the conservative diffusion operator for tracers includes the
=density: i.e. the operator is (1/rho)*div(rho*nu*grad(tracer)), where
=nu is the diffusivity.
=
=When false, the operator is then simply div(nu*grad(tracer)).
=
=If conservative_diffusion is false, then this setting has no effect.
!kind=default
ns=namelist/Science/Dynamics/Mixing
sort-key=Panel-A09
type=logical

[namelist:mixing=leonard_kl]
compulsory=true
description=Leonard term parameter
Expand Down Expand Up @@ -3563,6 +3592,14 @@ sort-key=Panel-A06
trigger=namelist:mixing=leonard_kl: .true. ;
type=logical

[namelist:mixing=max_diff_factor]
compulsory=true
description=Maximum factor for capping Smagorinsky diffusivity coefficient
help=Typical value is 1.0
!kind=default
sort-key=Panel-A10
type=real

[namelist:mixing=method]
compulsory=true
description=Smagorinsky subgrid mixing scheme option
Expand Down Expand Up @@ -3625,6 +3662,9 @@ sort-key=Panel-A03
trigger=namelist:mixing=method: .true. ;
=namelist:mixing=mix_factor: .true. ;
=namelist:mixing=smag_l_calc: .true. ;
=namelist:mixing=max_diff_factor: .true.;
=namelist:mixing=conservative_diffusion: .true.;
=namelist:mixing=density_weighted: .true.;
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.

Suggest triggering this from conservative_diffusion, since it only applies if that is true

=namelist:physics=smagorinsky_placement: .true. ;
type=logical

Expand Down
18 changes: 18 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,21 @@ def upgrade(self, config, meta_config=None):
# Add settings
return config, self.reports
"""

class vn31_t378(MacroUpgrade):
"""Upgrade macro for ticket #378 by Thomas Bendall."""

BEFORE_TAG = "vn3.1"
AFTER_TAG = "vn3.1_t378"

def upgrade(self, config, meta_config=None):
self.add_setting(
config, ["namelist:mixing", "conservative_diffusion"], ".false."
)
self.add_setting(
config, ["namelist:mixing", "density_weighted"], ".true."
)
self.add_setting(
config, ["namelist:mixing", "max_diff_factor"], "1.0"
)
return config, self.reports
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ contains
!> @param[in] derived_fields Group of derived fields
!> @param[in] rho Density
!> @param[in] dt The model timestep length
!> @param[in] model_clock The model clock
subroutine mixing_alg(mr, theta, u, derived_fields, &
rho, dt)
rho, dt, model_clock)

use constants_mod, only: i_def,r_def
use log_mod, only: log_event, &
Expand All @@ -39,6 +40,7 @@ contains
use momentum_viscosity_kernel_mod, only: momentum_viscosity_kernel_type
use physics_config_mod, only: smagorinsky_placement, &
smagorinsky_placement_end
use model_clock_mod, only: model_clock_type

implicit none

Expand All @@ -51,6 +53,7 @@ contains

! Timestepping information
real( r_def ), intent(in) :: dt
class( model_clock_type ), intent(in) :: model_clock

! Increment fields
type( field_type ) :: du, dtheta
Expand All @@ -68,7 +71,7 @@ contains
call du%initialise( u%get_function_space() )
call invoke( setval_c(dtheta, 0.0_r_def), &
setval_c(du, 0.0_r_def) )
call smagorinsky_alg(dtheta, du, mr, theta, u, derived_fields, rho, dt)
call smagorinsky_alg(dtheta, du, mr, theta, u, derived_fields, rho, dt, model_clock)
call invoke( inc_X_plus_Y( theta, dtheta ), &
inc_X_plus_Y( u, du ) )

Expand Down
Loading
Loading