Skip to content

Commit

Permalink
override broadcasting for retention models
Browse files Browse the repository at this point in the history
  • Loading branch information
juliasloan25 committed Oct 22, 2024
1 parent 4b56b5c commit 19c16b0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/standalone/Soil/retention_models.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export AbstractSoilHydrologyClosure, vanGenuchten, BrooksCorey

"""
AbstractSoilHydrologyClosure{FT <: AbstractFloat}
AbstractSoilHydrologyClosure{FT <: AbstractFloat}
The abstract type of soil hydrology closure, of which
vanGenuchten{FT} and BrooksCorey{FT} are the two supported
vanGenuchten{FT} and BrooksCorey{FT} are the two supported
concrete types.
To add a new parameterization, methods are required for:
Expand All @@ -20,7 +20,7 @@ Base.broadcastable(x::AbstractSoilHydrologyClosure) = tuple(x)
"""
vanGenuchten{FT} <: AbstractSoilHydrologyClosure{FT}
The van Genuchten soil hydrology closure, chosen when the
The van Genuchten soil hydrology closure, chosen when the
hydraulic conductivity and matric potential are modeled
using the van Genuchten parameterization (van Genuchten 1980;
see also Table 8.2 of G. Bonan 2019).
Expand All @@ -41,13 +41,13 @@ struct vanGenuchten{FT} <: AbstractSoilHydrologyClosure{FT}
S_c = (1 + ((n - 1) / n)^(1 - 2 * n))^(-m)
return new{FT}(α, n, m, S_c)
end

end
Base.broadcastable(vg::vanGenuchten) = tuple(vg)

"""
BrooksCorey{FT} <: AbstractSoilHydrologyClosure{FT}
The Brooks and Corey soil hydrology closure, chosen when the
The Brooks and Corey soil hydrology closure, chosen when the
hydraulic conductivity and matric potential are modeled
using the Brooks and Corey parameterization (Brooks and Corey,
1964, 1966; see also Table 8.2 of G. Bonan 2019).
Expand All @@ -66,3 +66,4 @@ struct BrooksCorey{FT} <: AbstractSoilHydrologyClosure{FT}
return new{FT}(c, ψb, S_c)
end
end
Base.broadcastable(bc::BrooksCorey) = tuple(bc)

0 comments on commit 19c16b0

Please sign in to comment.