Skip to content

Commit

Permalink
reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
Espeer5 committed Jun 2, 2024
1 parent 2c6f8c7 commit ecdd138
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 46 deletions.
7 changes: 2 additions & 5 deletions experiments/integrated/fluxnet/ozark_pft.jl
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,8 @@ plant_hydraulics_ps = PlantHydraulics.PlantHydraulicsParameters(;
conductivity_model = conductivity_model,
retention_model = retention_model,
)
plant_hydraulics_args = (
parameters = plant_hydraulics_ps,
h_stem = h_stem,
h_leaf = h_leaf,
)
plant_hydraulics_args =
(parameters = plant_hydraulics_ps, h_stem = h_stem, h_leaf = h_leaf)

energy_args = (parameters = Canopy.BigLeafEnergyParameters{FT}(ac_canopy),)

Expand Down
7 changes: 2 additions & 5 deletions experiments/integrated/fluxnet/run_fluxnet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,8 @@ plant_hydraulics_ps = PlantHydraulics.PlantHydraulicsParameters(;
conductivity_model = conductivity_model,
retention_model = retention_model,
)
plant_hydraulics_args = (
parameters = plant_hydraulics_ps,
h_stem = h_stem,
h_leaf = h_leaf,
)
plant_hydraulics_args =
(parameters = plant_hydraulics_ps, h_stem = h_stem, h_leaf = h_leaf)

energy_args = (parameters = Canopy.BigLeafEnergyParameters{FT}(ac_canopy),)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,8 @@ plant_hydraulics_ps = PlantHydraulics.PlantHydraulicsParameters(;
conductivity_model = conductivity_model,
retention_model = retention_model,
)
plant_hydraulics_args = (
parameters = plant_hydraulics_ps,
h_stem = h_stem,
h_leaf = h_leaf,
)
plant_hydraulics_args =
(parameters = plant_hydraulics_ps, h_stem = h_stem, h_leaf = h_leaf)

# Canopy component args
canopy_component_args = (;
Expand Down
7 changes: 2 additions & 5 deletions experiments/integrated/performance/profile_allocations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,8 @@ plant_hydraulics_ps = PlantHydraulics.PlantHydraulicsParameters(;
conductivity_model = conductivity_model,
retention_model = retention_model,
)
plant_hydraulics_args = (
parameters = plant_hydraulics_ps,
h_stem = h_stem,
h_leaf = h_leaf,
)
plant_hydraulics_args =
(parameters = plant_hydraulics_ps, h_stem = h_stem, h_leaf = h_leaf)

# Canopy component args
canopy_component_args = (;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,7 @@ setup site specific domain and time stepping:
- dt, the time step (s)
- n, the number of time step between saving outputs
"""
function make_setup(;
dz_bottom,
dz_top,
h_stem,
h_leaf,
t0,
dt,
n,
)
function make_setup(; dz_bottom, dz_top, h_stem, h_leaf, t0, dt, n)
return (
dz_bottom = dz_bottom,
dz_top = dz_top,
Expand Down
6 changes: 1 addition & 5 deletions lib/ClimaLandSimulations/src/Fluxnet/run_fluxnet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,7 @@ function run_fluxnet(
conductivity_model = params.plant_hydraulics.conductivity_model,
retention_model = params.plant_hydraulics.retention_model,
)
plant_hydraulics_args = (
parameters = plant_hydraulics_ps,
h_stem,
h_leaf,
)
plant_hydraulics_args = (parameters = plant_hydraulics_ps, h_stem, h_leaf)

energy_args = (
parameters = Canopy.BigLeafEnergyParameters{FT}(
Expand Down
14 changes: 6 additions & 8 deletions src/integrated/soil_canopy_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ function make_update_boundary_fluxes(
FT,
MM <: Soil.Biogeochemistry.SoilCO2Model{FT},
SM <: Soil.EnergyHydrology{FT},
RM <: Canopy.CanopyModel{FT, PlantHydraulics.BigLeadHydraulicsModel{FT}},
RM <: Canopy.CanopyModel{FT, PlantHydraulics.BigLeafHydraulicsModel{FT}},
}
update_soil_bf! = make_update_boundary_fluxes(land.soil)
update_soilco2_bf! = make_update_boundary_fluxes(land.soilco2)
Expand All @@ -257,18 +257,16 @@ function make_update_boundary_fluxes(

area_index = p.canopy.hydraulics.area_index

labels = land.canopy.hydraulics.parameters.h_stem > 0 ? [:stem, :leaf] : [:leaf]
labels =
land.canopy.hydraulics.parameters.h_stem > 0 ? [:stem, :leaf] :
[:leaf]

above_ground_area_index = getproperty(
area_index,
labels[1],
)
above_ground_area_index = getproperty(area_index, labels[1])

h_stem = land.canopy.hydraulics.parameters.h_stem
h_leaf = land.canopy.hydraulics.parameters.h_leaf

midpoint =
labels[1] == :stem ? h_stem / 2 : model.h_leaf / 2
midpoint = labels[1] == :stem ? h_stem / 2 : model.h_leaf / 2

@. p.root_extraction =
(area_index.root + above_ground_area_index) / 2 *
Expand Down
3 changes: 1 addition & 2 deletions src/standalone/Vegetation/Canopy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,7 @@ function ClimaLand.make_update_aux(
)

areai = getproperty(area_index, labels[i])
areaip1 =
getproperty(area_index, labels[ip1])
areaip1 = getproperty(area_index, labels[ip1])

midpoint = hydraulics.h_stem / 2
midpointip1 = hydraulics.h_stem + (model.h_leaf / 2)
Expand Down
2 changes: 1 addition & 1 deletion src/standalone/Vegetation/PlantHydraulics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ function lai_consistency_check(
model::BigLeafHydraulicsModel{FT},
area_index::NamedTuple{(:root, :stem, :leaf), Tuple{FT, FT, FT}},
) where {FT}
if area_index.leaf > esp(FT) || area_index.stem > eso(FT)
if area_index.leaf > eps(FT) || area_index.stem > eps(FT)
@assert area_index.root > eps(FT)
end
# If the SAI is 0, then the stem compartment should be height 0
Expand Down
2 changes: 1 addition & 1 deletion test/standalone/Vegetation/canopy_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ for FT in (Float32, Float64)
)
h_stem = FT(0.0)
h_leaf = FT(1.0)

plant_hydraulics = PlantHydraulics.BigLeafHydraulicsModel{FT}(;
parameters = param_set,
h_stem = h_stem,
Expand Down

0 comments on commit ecdd138

Please sign in to comment.