diff --git a/src/cache/diagnostic_edmf_precomputed_quantities.jl b/src/cache/diagnostic_edmf_precomputed_quantities.jl index 61d40de08fc..7441b5f85e7 100644 --- a/src/cache/diagnostic_edmf_precomputed_quantities.jl +++ b/src/cache/diagnostic_edmf_precomputed_quantities.jl @@ -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( - u³⁰_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, ) @@ -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( - u³⁰_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, ) diff --git a/src/cache/prognostic_edmf_precomputed_quantities.jl b/src/cache/prognostic_edmf_precomputed_quantities.jl index 537e6c91d13..d17af47771e 100644 --- a/src/cache/prognostic_edmf_precomputed_quantities.jl +++ b/src/cache/prognostic_edmf_precomputed_quantities.jl @@ -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, ) @@ -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, ) diff --git a/src/prognostic_equations/advection.jl b/src/prognostic_equations/advection.jl index c3a500edcc4..ead08a394b1 100644 --- a/src/prognostic_equations/advection.jl +++ b/src/prognostic_equations/advection.jl @@ -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