diff --git a/src/cache/cache.jl b/src/cache/cache.jl index 4e7cd73b0da..2ab1ae28420 100644 --- a/src/cache/cache.jl +++ b/src/cache/cache.jl @@ -129,9 +129,11 @@ function build_cache(Y, atmos, params, surface_setup, dt, start_date) net_energy_flux_toa = [Geometry.WVector(FT(0))] net_energy_flux_sfc = [Geometry.WVector(FT(0))] - limiter = - isnothing(atmos.numerics.limiter) ? nothing : - atmos.numerics.limiter(similar(Y.c, FT)) + limiter = if isnothing(atmos.numerics.limiter) + nothing + elseif atmos.numerics.limiter isa QuasiMonotoneLimiter + Limiters.QuasiMonotoneLimiter(similar(Y.c, FT)) + end numerics = (; limiter) diff --git a/src/solver/type_getters.jl b/src/solver/type_getters.jl index f4e35e213a2..54c9473eade 100644 --- a/src/solver/type_getters.jl +++ b/src/solver/type_getters.jl @@ -98,7 +98,7 @@ function get_numerics(parsed_args) Val(Symbol(parsed_args["edmfx_sgsflux_upwinding"])) limiter = - parsed_args["apply_limiter"] ? Limiters.QuasiMonotoneLimiter : nothing + parsed_args["apply_limiter"] ? CA.QuasiMonotoneLimiter : nothing # wrap each upwinding mode in a Val for dispatch numerics = AtmosNumerics(; diff --git a/src/solver/types.jl b/src/solver/types.jl index e1b8cc8afc1..314d88c0fa5 100644 --- a/src/solver/types.jl +++ b/src/solver/types.jl @@ -270,6 +270,8 @@ abstract type AbstractTimesteppingMode end struct Explicit <: AbstractTimesteppingMode end struct Implicit <: AbstractTimesteppingMode end +struct QuasiMonotoneLimiter end # For dispatching to use the ClimaCore QuasiMonotoneLimiter. + Base.@kwdef struct AtmosNumerics{ EN_UP, TR_UP,