Skip to content

Commit

Permalink
Add the filter for GABLS, set the configs
Browse files Browse the repository at this point in the history
  • Loading branch information
trontrytel committed Sep 26, 2023
1 parent 6a495ed commit 0473937
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 3 deletions.
1 change: 0 additions & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,6 @@ steps:
julia --color=yes --project=examples examples/hybrid/driver.jl
--config_file $CONFIG_PATH/edmfx_gabls_box.yml
artifact_paths: "edmfx_gabls_box/*"
soft_fail: true
agents:
slurm_mem: 20GB

Expand Down
1 change: 1 addition & 0 deletions src/ClimaAtmos.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ include(joinpath("utils", "discrete_hydrostatic_balance.jl"))

include(joinpath("prognostic_equations", "pressure_work.jl"))
include(joinpath("prognostic_equations", "zero_velocity.jl"))
include(joinpath("prognostic_equations", "filter_sgs_u3_tendency.jl"))

include(joinpath("prognostic_equations", "implicit", "wfact.jl"))
include(joinpath("prognostic_equations", "implicit", "schur_complement_W.jl"))
Expand Down
19 changes: 19 additions & 0 deletions src/prognostic_equations/filter_sgs_u3_tendency.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
###
### tmp sgs u3 filter
###
function filter_sgs_u3_tendency!(Yₜ, Y, p, t, colidx)
# set the sgs momentum tendency to the grid mean momentum tendency
# if updraft area <= 0
if p.atmos.turbconv_model isa EDMFX
FT = eltype(Y)
n = n_mass_flux_subdomains(p.atmos.turbconv_model)
for j in 1:n
@. Yₜ.f.sgsʲs.:($$j).u₃[colidx] = ifelse(
ᶠinterp(Y.c.sgsʲs.:($$j).ρa[colidx] / p.ᶜρʲs.:($$j)[colidx]) <= FT(0),
Yₜ.f.u₃[colidx],
Yₜ.f.sgsʲs.:($$j).u₃[colidx],
)
end
end
return nothing
end
9 changes: 9 additions & 0 deletions src/prognostic_equations/remaining_tendency.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ NVTX.@annotate function additional_tendency!(Yₜ, Y, p, t)
# NOTE: All ρa tendencies should be applied before calling this function
pressure_work_tendency!(Yₜ, Y, p, t, colidx, p.atmos.turbconv_model)

# NOTE: This will set the sgs momentum tendency to the grid mean momentum tendency
# if the updraft area fraction is equal or smaller than zero.
# We should not need this, but right now we are diverging slightly
# (maybe starting from diverging densities?)
# TODO - A better way to implement this would be to
# make sgs_e_int = gm_e_int when a == 0 and then recompute sgs_e_tot
# based on w and the new sgs_e_int
filter_sgs_u3_tendency!(Yₜ, Y, p, t, colidx)

# NOTE: This will zero out all monmentum tendencies in the edmfx advection test
# please DO NOT add additional velocity tendencies after this function
zero_velocity_tendency!(Yₜ, Y, p, t, colidx)
Expand Down
2 changes: 1 addition & 1 deletion toml/edmfx_box.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ type = "float"

[EDMF_min_area]
alias = "min_area"
value = 1.0e-2
value = 1.0e-3
type = "float"
description = "Minimum area fraction per updraft. Parameter not described in the literature."
8 changes: 7 additions & 1 deletion toml/edmfx_box_gabls.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,11 @@ type = "float"

[EDMF_surface_area]
alias = "surface_area"
value = 1e-4
value = 0.1
type = "float"

[EDMF_min_area]
alias = "min_area"
value = 1.0e-3
type = "float"
description = "Minimum area fraction per updraft. Parameter not described in the literature."

0 comments on commit 0473937

Please sign in to comment.