diff --git a/src/cache/cache.jl b/src/cache/cache.jl index a8925fb7beb..0a547aa4870 100644 --- a/src/cache/cache.jl +++ b/src/cache/cache.jl @@ -13,7 +13,6 @@ struct AtmosCache{ PREC, SCRA, HYPE, - DSS, PR, LSAD, EXTFORCING, @@ -70,8 +69,6 @@ struct AtmosCache{ ghost buffers for DSS""" hyperdiff::HYPE - do_dss::DSS - """Additional parameters used by the various tendencies""" precipitation::PR large_scale_advection::LSAD @@ -117,11 +114,8 @@ function build_cache(Y, atmos, params, surface_setup, sim_info, aerosol_names) (; ᶜf³, ᶠf¹²) = compute_coriolis(ᶜcoord, ᶠcoord, params) - quadrature_style = - Spaces.quadrature_style(Spaces.horizontal_space(axes(Y.c))) - do_dss = quadrature_style isa Quadratures.GLL ghost_buffer = - !do_dss ? (;) : + do_dss(axes(Y.c)) ? (;) : (; c = Spaces.create_dss_buffer(Y.c), f = Spaces.create_dss_buffer(Y.f)) net_energy_flux_toa = [Geometry.WVector(FT(0))] @@ -201,7 +195,6 @@ function build_cache(Y, atmos, params, surface_setup, sim_info, aerosol_names) precomputed, scratch, hyperdiff, - do_dss, precipitation, large_scale_advection, external_forcing, diff --git a/src/prognostic_equations/dss.jl b/src/prognostic_equations/dss.jl index b7232ac2d6d..aeffb72e82e 100644 --- a/src/prognostic_equations/dss.jl +++ b/src/prognostic_equations/dss.jl @@ -13,7 +13,7 @@ using ClimaCore.Utilities: half import ClimaCore.Fields: ColumnField NVTX.@annotate function dss!(Y, p, t) - if p.do_dss + if do_dss(axes(Y.c)) Spaces.weighted_dss!(Y.c => p.ghost_buffer.c, Y.f => p.ghost_buffer.f) end end diff --git a/src/prognostic_equations/hyperdiffusion.jl b/src/prognostic_equations/hyperdiffusion.jl index 0a41e42d0be..6c4a5d30d45 100644 --- a/src/prognostic_equations/hyperdiffusion.jl +++ b/src/prognostic_equations/hyperdiffusion.jl @@ -15,7 +15,6 @@ hyperdiffusion_cache(Y, hyperdiff::Nothing, _) = (;) function hyperdiffusion_cache(Y, hyperdiff::ClimaHyperdiffusion, turbconv_model) quadrature_style = Spaces.quadrature_style(Spaces.horizontal_space(axes(Y.c))) - do_dss = quadrature_style isa Quadratures.GLL FT = eltype(Y) n = n_mass_flux_subdomains(turbconv_model) @@ -44,7 +43,7 @@ function hyperdiffusion_cache(Y, hyperdiff::ClimaHyperdiffusion, turbconv_model) (;) sgs_quantities = (; sgs_quantities..., maybe_ᶜ∇²tke⁰...) quantities = (; gs_quantities..., sgs_quantities...) - if do_dss + if do_dss(axes(Y.c)) quantities = (; quantities..., hyperdiffusion_ghost_buffer = map( diff --git a/src/prognostic_equations/remaining_tendency.jl b/src/prognostic_equations/remaining_tendency.jl index a31344f1d91..908671a42b1 100644 --- a/src/prognostic_equations/remaining_tendency.jl +++ b/src/prognostic_equations/remaining_tendency.jl @@ -2,7 +2,7 @@ NVTX.@annotate function hyperdiffusion_tendency!(Yₜ, Yₜ_lim, Y, p, t) prep_tracer_hyperdiffusion_tendency!(Yₜ_lim, Y, p, t) prep_hyperdiffusion_tendency!(Yₜ, Y, p, t) - if p.do_dss && !isnothing(p.atmos.hyperdiff) + if do_dss(axes(Y.c)) && !isnothing(p.atmos.hyperdiff) pairs = dss_hyperdiffusion_tendency_pairs(p) Spaces.weighted_dss!(pairs...) end diff --git a/src/utils/utilities.jl b/src/utils/utilities.jl index 06a248bbae1..18320791c3a 100644 --- a/src/utils/utilities.jl +++ b/src/utils/utilities.jl @@ -262,6 +262,18 @@ function verify_callbacks(t) end end + +""" + do_dss(space) + +Return whether the underlying horizontal space required DSS or not. +""" +function do_dss(space::Spaces.AbstractSpace) + return Spaces.quadrature_style(Spaces.horizontal_space(space)) isa + Quadratures.GLL +end + + using ClimaComms is_distributed(::ClimaComms.SingletonCommsContext) = false is_distributed(::ClimaComms.MPICommsContext) = true diff --git a/test/coupler_compatibility.jl b/test/coupler_compatibility.jl index e7b063d4b95..c361b363c8c 100644 --- a/test/coupler_compatibility.jl +++ b/test/coupler_compatibility.jl @@ -79,7 +79,6 @@ const T2 = 290 p.precomputed, p.scratch, p.hyperdiff, - p.do_dss, p.precipitation, p.large_scale_advection, p.external_forcing,