Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
trontrytel committed Sep 20, 2023
1 parent 8cf09db commit b345002
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion config/model_configs/edmfx_adv_test_box.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edmfx_upwinding: "first_order"
config: "box"
moist: "equil"
hyperdiff: "true"
kappa_4: .0e8
kappa_4: 1e8
x_max: 1e4
y_max: 1e4
z_max: 3e4
Expand Down
18 changes: 9 additions & 9 deletions src/prognostic_equations/advection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ NVTX.@annotate function explicit_vertical_advection_tendency!(Yₜ, Y, p, t)
ᶜρa⁰ = advect_tke ? (n > 0 ? p.ᶜρa⁰ : Y.c.ρ) : nothing
ᶜρ⁰ = advect_tke ? (n > 0 ? p.ᶜρ⁰ : Y.c.ρ) : nothing
ᶜtke⁰ = advect_tke ? (n > 0 ? p.ᶜspecific⁰.tke : p.ᶜtke⁰) : nothing
ᶜtmp_scalar = p.ᶜtemp_scalar
ᶜa_scalar = p.ᶜtemp_scalar
ᶜω³ = p.ᶜtemp_CT3
ᶠω¹² = p.ᶠtemp_CT12
ᶠω¹²ʲs = p.ᶠtemp_CT12ʲs
Expand Down Expand Up @@ -140,28 +140,28 @@ NVTX.@annotate function explicit_vertical_advection_tendency!(Yₜ, Y, p, t)

# TODO: Move this to implicit_vertical_advection_tendency!.
for j in 1:n
@. ᶜtmp_scalar[colidx] =
@. ᶜa_scalar[colidx] =
Y.c.sgsʲs.:($$j).ρa[colidx] / ᶜρʲs.:($$j)[colidx]
vertical_transport!(
Yₜ.c.sgsʲs.:($j).ρa[colidx],
ᶜJ[colidx],
ᶜρʲs.:($j)[colidx],
ᶠu³ʲs.:($j)[colidx],
ᶜtmp_scalar[colidx],
ᶜa_scalar[colidx],
dt,
edmfx_upwinding,
)

if :ρae_tot in propertynames(Yₜ.c.sgsʲs.:($j))
@. ᶜtmp_scalar[colidx] =
@. ᶜa_scalar[colidx] =
ᶜh_totʲs.:($$j)[colidx] * Y.c.sgsʲs.:($$j).ρa[colidx] /
ᶜρʲs.:($$j)[colidx]
vertical_transport!(
Yₜ.c.sgsʲs.:($j).ρae_tot[colidx],
ᶜJ[colidx],
ᶜρʲs.:($j)[colidx],
ᶠu³ʲs.:($j)[colidx],
ᶜtmp_scalar[colidx],
ᶜa_scalar[colidx],
dt,
edmfx_upwinding,
)
Expand All @@ -170,15 +170,15 @@ NVTX.@annotate function explicit_vertical_advection_tendency!(Yₜ, Y, p, t)
for (ᶜρaχʲₜ, ᶜχʲ, χ_name) in
matching_subfields(Yₜ.c.sgsʲs.:($j), ᶜspecificʲs.:($j))
χ_name == :e_tot && continue
@. ᶜtmp_scalar[colidx] =
@. ᶜa_scalar[colidx] =
ᶜχʲ[colidx] * Y.c.sgsʲs.:($$j).ρa[colidx] /
ᶜρʲs.:($$j)[colidx]
vertical_transport!(
ᶜρaχʲₜ[colidx],
ᶜJ[colidx],
ᶜρʲs.:($j)[colidx],
ᶠu³ʲs.:($j)[colidx],
ᶜtmp_scalar[colidx],
ᶜa_scalar[colidx],
dt,
edmfx_upwinding,
)
Expand All @@ -187,13 +187,13 @@ NVTX.@annotate function explicit_vertical_advection_tendency!(Yₜ, Y, p, t)

# TODO: Move this to implicit_vertical_advection_tendency!.
if use_prognostic_tke(turbconv_model) # advect_tke triggers allocations
@. ᶜtmp_scalar[colidx] = ᶜtke⁰[colidx] * ᶜρa⁰[colidx] / ᶜρ⁰[colidx]
@. ᶜa_scalar[colidx] = ᶜtke⁰[colidx] * ᶜρa⁰[colidx] / ᶜρ⁰[colidx]
vertical_transport!(
Yₜ.c.sgs⁰.ρatke[colidx],
ᶜJ[colidx],
ᶜρ⁰[colidx],
ᶠu³⁰[colidx],
ᶜtmp_scalar[colidx],
ᶜa_scalar[colidx],
dt,
edmfx_upwinding,
)
Expand Down
7 changes: 1 addition & 6 deletions toml/edmfx_box_advection.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
[C_E]
alias = "C_E"
value = 0.044
type = "float"

[EDMF_surface_area]
alias = "surface_area"
value = 0
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."

0 comments on commit b345002

Please sign in to comment.