Skip to content

Commit

Permalink
change buoyancy
Browse files Browse the repository at this point in the history
  • Loading branch information
szy21 committed Oct 28, 2023
1 parent a01efa2 commit dd8d788
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions src/cache/diagnostic_edmf_precomputed_quantities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -359,13 +359,13 @@ function set_diagnostic_edmf_precomputed_quantities_do_integral!(Y, p, t)
local_geometry_prev_halflevel,
),
TD.relative_humidity(thermo_params, tsʲ_prev_level),
ᶜphysical_buoyancy(params, ρ_ref_prev_level, ρʲ_prev_level),
ᶜphysical_buoyancy(params, ρ_prev_level, ρʲ_prev_level),
get_physical_w(
_prev_halflevel,
u³_prev_halflevel,
local_geometry_prev_halflevel,
),
TD.relative_humidity(thermo_params, ts_prev_level),
ᶜphysical_buoyancy(params, ρ_ref_prev_level, ρ_prev_level),
FT(0),
dt,
p.atmos.edmfx_entr_model,
)
Expand All @@ -383,13 +383,13 @@ function set_diagnostic_edmf_precomputed_quantities_do_integral!(Y, p, t)
local_geometry_prev_halflevel,
),
TD.relative_humidity(thermo_params, tsʲ_prev_level),
ᶜphysical_buoyancy(params, ρ_ref_prev_level, ρʲ_prev_level),
ᶜphysical_buoyancy(params, ρ_prev_level, ρʲ_prev_level),
get_physical_w(
_prev_halflevel,
u³_prev_halflevel,
local_geometry_prev_halflevel,
),
TD.relative_humidity(thermo_params, ts_prev_level),
ᶜphysical_buoyancy(params, ρ_ref_prev_level, ρ_prev_level),
FT(0),
dt,
p.atmos.edmfx_detr_model,
)
Expand Down
12 changes: 6 additions & 6 deletions src/cache/prognostic_edmf_precomputed_quantities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ function set_prognostic_edmf_precomputed_quantities_closures!(Y, p, t)
draft_area(Y.c.sgsʲs.:($$j).ρa, ᶜρʲs.:($$j)),
get_physical_w(ᶜuʲs.:($$j), ᶜlg),
TD.relative_humidity(thermo_params, ᶜtsʲs.:($$j)),
ᶜphysical_buoyancy(params, ᶜρ_ref, ᶜρʲs.:($$j)),
get_physical_w(ᶜu, ᶜlg),
ᶜphysical_buoyancy(params, Y.c.ρ, ᶜρʲs.:($$j)),
get_physical_w(ᶜu, ᶜlg),
TD.relative_humidity(thermo_params, ᶜts⁰),
ᶜphysical_buoyancy(params, ᶜρ_ref, ᶜρ⁰),
FT(0),
dt,
p.atmos.edmfx_entr_model,
)
Expand All @@ -214,10 +214,10 @@ function set_prognostic_edmf_precomputed_quantities_closures!(Y, p, t)
draft_area(Y.c.sgsʲs.:($$j).ρa, ᶜρʲs.:($$j)),
get_physical_w(ᶜuʲs.:($$j), ᶜlg),
TD.relative_humidity(thermo_params, ᶜtsʲs.:($$j)),
ᶜphysical_buoyancy(params, ᶜρ_ref, ᶜρʲs.:($$j)),
get_physical_w(ᶜu, ᶜlg),
ᶜphysical_buoyancy(params, Y.c.ρ, ᶜρʲs.:($$j)),
get_physical_w(ᶜu, ᶜlg),
TD.relative_humidity(thermo_params, ᶜts⁰),
ᶜphysical_buoyancy(params, ᶜρ_ref, ᶜρ⁰),
FT(0),
dt,
p.atmos.edmfx_detr_model,
)
Expand Down
4 changes: 2 additions & 2 deletions src/prognostic_equations/advection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ NVTX.@annotate function explicit_vertical_advection_tendency!(Yₜ, Y, p, t)
ᶠgradᵥ(ᶜKʲs.:($$j)[colidx])

# TODO: Move this to implicit_vertical_advection_tendency!.
# TODO: This assumes grid-mean is in hydrostatic balance
@. Yₜ.f.sgsʲs.:($$j).u₃[colidx] -=
(
ᶠgradᵥ(ᶜp[colidx] - ᶜp_ref[colidx]) +
ᶠinterp(ᶜρʲs.:($$j)[colidx] - ᶜρ_ref[colidx]) *
ᶠinterp(ᶜρʲs.:($$j)[colidx] - Y.c.ρ[colidx]) *
ᶠgradᵥ_ᶜΦ[colidx]
) / ᶠinterp(ᶜρʲs.:($$j)[colidx])
end
Expand Down

0 comments on commit dd8d788

Please sign in to comment.