Skip to content

Commit

Permalink
lai consistency check
Browse files Browse the repository at this point in the history
  • Loading branch information
kmdeck committed Jul 24, 2023
1 parent 357bb84 commit bb451e3
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/ClimaLSM.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import .Parameters as LSMP
include("shared_utilities/Regridder.jl")
include("shared_utilities/Domains.jl")
using .Domains
include("shared_utilities/ntuple_utils.jl")
include("shared_utilities/indexing_utils.jl")
include("shared_utilities/models.jl")
include("shared_utilities/drivers.jl")
include("shared_utilities/utils.jl")
Expand Down
8 changes: 4 additions & 4 deletions src/standalone/Vegetation/Canopy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import ClimaLSM:

using ClimaLSM.Domains: Point, Plane, SphericalSurface
export SharedCanopyParameters,
CanopyModel, set_canopy_parameter_field!, update_canopy_parameter_field!
CanopyModel, set_canopy_prescribed_field!, update_canopy_prescribed_field!
include("./component_models.jl")
include("./PlantHydraulics.jl")
using .PlantHydraulics
Expand Down Expand Up @@ -309,7 +309,7 @@ function ClimaLSM.make_set_initial_aux_state(model::CanopyModel)
update_aux! = make_update_aux(model)
# eventually extend to other components when needed
function set_initial_aux_state!(p, Y0, t0)
set_canopy_parameter_field!(model.hydraulics, p, t0)
set_canopy_prescribed_field!(model.hydraulics, p, t0)
update_aux!(p, Y0, t0)
end
return set_initial_aux_state!
Expand Down Expand Up @@ -347,7 +347,7 @@ function ClimaLSM.make_update_aux(
) where {FT}
function update_aux!(p, Y, t)
#Extend to other fields when necessary
update_canopy_parameter_field!(canopy.hydraulics, p, t)
update_canopy_prescribed_field!(canopy.hydraulics, p, t)

# other auxiliary variables being updated
APAR = p.canopy.radiative_transfer.apar
Expand Down Expand Up @@ -403,7 +403,7 @@ function ClimaLSM.make_update_aux(
hydraulics = canopy.hydraulics
n_stem = hydraulics.n_stem
n_leaf = hydraulics.n_leaf
#PlantHydraulics.lai_consistency_check.(n_stem, n_leaf, area_index)
PlantHydraulics.lai_consistency_check.(n_stem, n_leaf, area_index)
(; retention_model, conductivity_model, S_s, ν) = hydraulics.parameters
@inbounds @. ψ[1] = PlantHydraulics.water_retention_curve(
retention_model,
Expand Down
24 changes: 12 additions & 12 deletions src/standalone/Vegetation/PlantHydraulics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ module PlantHydraulics
using ClimaLSM
using ..ClimaLSM.Canopy:
AbstractCanopyComponent,
update_canopy_parameter_field!,
set_canopy_parameter_field!
update_canopy_prescribed_field!,
set_canopy_prescribed_field!
using ClimaCore
using DocStringExtensions

Expand Down Expand Up @@ -297,13 +297,13 @@ ClimaLSM.auxiliary_types(model::PlantHydraulicsModel{FT}) where {FT} = (


"""
set_canopy_parameter_field!(component::PlantHydraulics{FT},
p,
t0,
) where {FT}
set_canopy_prescribed_field!(component::PlantHydraulics{FT},
p,
t0,
) where {FT}
"""
function ClimaLSM.Canopy.set_canopy_parameter_field!(
function ClimaLSM.Canopy.set_canopy_prescribed_field!(
component::PlantHydraulicsModel{FT},
p,
t0,
Expand All @@ -316,13 +316,13 @@ end


"""
update_canopy_parameter_field!(component::PlantHydraulics{FT},
p,
t,
) where {FT}
update_canopy_prescribed_field!(component::PlantHydraulics{FT},
p,
t,
) where {FT}
"""
function ClimaLSM.Canopy.update_canopy_parameter_field!(
function ClimaLSM.Canopy.update_canopy_prescribed_field!(
component::PlantHydraulicsModel{FT},
p,
t,
Expand Down
30 changes: 15 additions & 15 deletions src/standalone/Vegetation/component_models.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,36 +114,36 @@ end


"""
set_canopy_parameter_field!(component::AbstractCanopyComponent,
p,
t0,
) end
set_canopy_prescribed_field!(component::AbstractCanopyComponent,
p,
t0,
) end
Sets the spatially and temporally varying parameter fields of the `component`
Sets the spatially and temporally varying prescribed fields of the `component`
with their initial values.
These fields are stored in the aux-state and should not depend on the prognostic
state `Y` or other diagnostic variables stored in `p`, as there is no
guarantee on the order of operations in terms of when diagnostic auxiliary
variables are updated vs. parameter field auxiliary variables.
variables are updated vs. prescribed field auxiliary variables.
"""
function set_canopy_parameter_field!(component::AbstractCanopyComponent, p, t0) end
function set_canopy_prescribed_field!(component::AbstractCanopyComponent, p, t0) end

"""
update_canopy_parameter_field!(component::AbstractCanopyComponent,
p,
t,
) end
Updates the spatially and temporally varying parameter fields of the `component`
update_canopy_prescribed_field!(component::AbstractCanopyComponent,
p,
t,
) end
Updates the spatially and temporally varying prescribed fields of the `component`
with their values at time `t`.
These fields are stored in the aux-state and should not depend on the prognostic
state `Y` or other diagnostic variables stored in `p`, as there is no
guarantee on the order of operations in terms of when diagnostic auxiliary
variables are updated vs. parameter field auxiliary variables.
variables are updated vs. prescribed field auxiliary variables.
"""
function update_canopy_parameter_field!(
function update_canopy_prescribed_field!(
component::AbstractCanopyComponent,
p,
t,
Expand Down

0 comments on commit bb451e3

Please sign in to comment.