diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 39c70da0c39..8bc9cc3d803 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -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 diff --git a/src/ClimaAtmos.jl b/src/ClimaAtmos.jl index 1f0c7fcac38..05b35455338 100644 --- a/src/ClimaAtmos.jl +++ b/src/ClimaAtmos.jl @@ -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")) diff --git a/src/prognostic_equations/filter_sgs_u3_tendency.jl b/src/prognostic_equations/filter_sgs_u3_tendency.jl new file mode 100644 index 00000000000..49923760f4d --- /dev/null +++ b/src/prognostic_equations/filter_sgs_u3_tendency.jl @@ -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 diff --git a/src/prognostic_equations/remaining_tendency.jl b/src/prognostic_equations/remaining_tendency.jl index 6c428fd3890..0f610587858 100644 --- a/src/prognostic_equations/remaining_tendency.jl +++ b/src/prognostic_equations/remaining_tendency.jl @@ -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) diff --git a/toml/edmfx_box.toml b/toml/edmfx_box.toml index 9eb2be9b120..4f58178f41d 100644 --- a/toml/edmfx_box.toml +++ b/toml/edmfx_box.toml @@ -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." diff --git a/toml/edmfx_box_gabls.toml b/toml/edmfx_box_gabls.toml index a0683cc1ae2..4f58178f41d 100644 --- a/toml/edmfx_box_gabls.toml +++ b/toml/edmfx_box_gabls.toml @@ -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."