Skip to content

Commit

Permalink
canopy model is imex model
Browse files Browse the repository at this point in the history
  • Loading branch information
kmdeck authored and juliasloan25 committed Sep 6, 2024
1 parent 7eb5cb7 commit 03be375
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 20 deletions.
13 changes: 0 additions & 13 deletions src/shared_utilities/models.jl
Original file line number Diff line number Diff line change
Expand Up @@ -211,19 +211,6 @@ function make_imp_tendency(model::AbstractImExModel)
return imp_tendency!
end

"""
make_imp_tendency(model::AbstractModel)
Returns an `imp_tendency` that does nothing. This model type is not
stepped explicity.
"""
function make_imp_tendency(model::AbstractModel)
compute_imp_tendency! = make_compute_imp_tendency(model)
function imp_tendency!(dY, Y, p, t)
compute_imp_tendency!(dY, Y, p, t)
end
end

"""
make_exp_tendency(model::AbstractModel)
Expand Down
8 changes: 2 additions & 6 deletions src/standalone/Vegetation/Canopy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ using ClimaLand: AbstractRadiativeDrivers, AbstractAtmosphericDrivers
import ..Parameters as LP

import ClimaLand:
AbstractExpModel,
name,
prognostic_vars,
prognostic_types,
Expand Down Expand Up @@ -59,7 +58,7 @@ struct SharedCanopyParameters{FT <: AbstractFloat, PSE}
end

"""
CanopyModel{FT, AR, RM, PM, SM, PHM, EM, SM, A, R, S, PS, D} <: AbstractExpModel{FT}
CanopyModel{FT, AR, RM, PM, SM, PHM, EM, SM, A, R, S, PS, D} <: ClimaLand.AbstractImExModel{FT}
The model struct for the canopy, which contains
- the canopy model domain (a point for site-level simulations, or
Expand Down Expand Up @@ -103,7 +102,7 @@ treated differently.
$(DocStringExtensions.FIELDS)
"""
struct CanopyModel{FT, AR, RM, PM, SM, PHM, EM, SIFM, A, R, S, PS, D} <:
AbstractExpModel{FT}
ClimaLand.AbstractImExModel{FT}
"Autotrophic respiration model, a canopy component model"
autotrophic_respiration::AR
"Radiative transfer model, a canopy component model"
Expand Down Expand Up @@ -697,10 +696,7 @@ end
function ClimaLand.get_drivers(model::CanopyModel)
return (model.atmos, model.radiation)
end


include("./canopy_boundary_fluxes.jl")

#Make the canopy model broadcastable
Base.broadcastable(C::CanopyModel) = tuple(C)
end
2 changes: 1 addition & 1 deletion test/standalone/Vegetation/canopy_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ end
) ./ ΔT
estimated_LW = p.canopy.energy.∂LW_n∂Tc
@test parent(abs.(finitediff_LW .- estimated_LW) ./ finitediff_LW)[1] <
0.05
0.01

finitediff_SHF = (p_2.canopy.energy.shf .- p.canopy.energy.shf) ./ ΔT
estimated_SHF = p.canopy.energy.∂SHF∂Tc
Expand Down

0 comments on commit 03be375

Please sign in to comment.