Skip to content

Commit 80687aa

Browse files
committed
rft: split horizontal and vertical smagorinsky
1 parent 21de9d3 commit 80687aa

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

config/default_configs/default_config.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,14 @@ vert_diff:
163163
hyperdiff:
164164
help: "Hyperdiffusion. Use `CAM_SE` for sensible default values and ClimaHyperdiffusion for user control. [`CAM_SE` (default), `ClimaHyperdiffusion` (or `true`), `none` (or `false`)]"
165165
value: "CAM_SE"
166-
smagorinsky_lilly:
167-
help: "Smagorinsky-Lilly diffusive closure [`false` (default), `true`]"
166+
smagorinsky:
167+
help: "Smagorinsky diffusive closure in the horizontal and vertical [`false` (default), `true`]"
168+
value: false
169+
smagorinsky_horizontal:
170+
help: "Smagorinsky diffusive closure in the horizontal [`false` (default), `true`]"
171+
value: false
172+
smagorinsky_vertical:
173+
help: "Smagorinsky diffusive closure in the vertical [`false` (default), `true`]"
168174
value: false
169175
bubble:
170176
help: "Enable bubble correction for more accurate surface areas"

src/solver/model_getters.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,14 @@ function get_viscous_sponge_model(parsed_args, params, ::Type{FT}) where {FT}
169169
end
170170
end
171171

172-
function get_smagorinsky_lilly_model(parsed_args)
173-
is_model_active = parsed_args["smagorinsky_lilly"]
174-
@assert is_model_active in (true, false)
175-
return is_model_active ? SmagorinskyLilly() : nothing
172+
function get_smagorinsky_model(parsed_args; dir)
173+
dir = (; h = "horizontal", v = "vertical")[dir]
174+
smag_dir = parsed_args["smagorinsky_$dir"]
175+
smag = parsed_args["smagorinsky"]
176+
@assert smag_dir isa Bool "'smagorinsky_$dir' must be `true` or `false`."
177+
@assert smag isa Bool "'smagorinsky' must be `true` or `false`."
178+
@assert smag smag_dir "Only one of 'smagorinsky' and 'smagorinsky_$dir' can be set to true."
179+
return smag_dir || smag ? SmagorinskyLilly() : nothing
176180
end
177181

178182
function get_rayleigh_sponge_model(parsed_args, params, ::Type{FT}) where {FT}

src/solver/type_getters.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ function get_atmos(config::AtmosConfig, params)
145145
Explicit(),
146146
sgs_vertdiff_mode = implicit_sgs_vertdiff ? Implicit() : Explicit(),
147147
sgs_mf_mode = implicit_sgs_mass_flux ? Implicit() : Explicit(),
148-
smagorinsky_lilly = get_smagorinsky_lilly_model(parsed_args),
148+
smagorinsky_horizontal = get_smagorinsky_model(parsed_args; dir = :h),
149+
smagorinsky_vertical = get_smagorinsky_model(parsed_args; dir = :v),
149150

150151
# AtmosGravityWave
151152
non_orographic_gravity_wave = get_non_orographic_gravity_wave_model(

0 commit comments

Comments
 (0)