Skip to content

Commit

Permalink
Fix 2438
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Dec 15, 2023
1 parent a0ccabd commit 0c97cc0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/cache/cache.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion src/solver/type_getters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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(;
Expand Down
2 changes: 2 additions & 0 deletions src/solver/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0c97cc0

Please sign in to comment.