From b77108a1efe9a79de30c967c118229bcac4f690f Mon Sep 17 00:00:00 2001 From: Edward Speer Date: Sun, 2 Jun 2024 00:35:29 -0700 Subject: [PATCH] reformat --- experiments/integrated/fluxnet/ozark_pft.jl | 7 ++----- experiments/integrated/fluxnet/run_fluxnet.jl | 7 ++----- .../conservation/ozark_conservation_setup.jl | 7 ++----- .../integrated/performance/profile_allocations.jl | 7 ++----- .../src/Fluxnet/fluxnet_utilities/make_setup.jl | 10 +--------- lib/ClimaLandSimulations/src/Fluxnet/run_fluxnet.jl | 6 +----- src/integrated/soil_canopy_model.jl | 12 +++++------- src/standalone/Vegetation/Canopy.jl | 3 +-- test/standalone/Vegetation/canopy_model.jl | 2 +- 9 files changed, 17 insertions(+), 44 deletions(-) diff --git a/experiments/integrated/fluxnet/ozark_pft.jl b/experiments/integrated/fluxnet/ozark_pft.jl index 66accb4e81..baae661d20 100644 --- a/experiments/integrated/fluxnet/ozark_pft.jl +++ b/experiments/integrated/fluxnet/ozark_pft.jl @@ -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),) diff --git a/experiments/integrated/fluxnet/run_fluxnet.jl b/experiments/integrated/fluxnet/run_fluxnet.jl index 82c6de378b..69cc9a60dd 100644 --- a/experiments/integrated/fluxnet/run_fluxnet.jl +++ b/experiments/integrated/fluxnet/run_fluxnet.jl @@ -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),) diff --git a/experiments/integrated/performance/conservation/ozark_conservation_setup.jl b/experiments/integrated/performance/conservation/ozark_conservation_setup.jl index 3c308abcd1..df788f1b18 100644 --- a/experiments/integrated/performance/conservation/ozark_conservation_setup.jl +++ b/experiments/integrated/performance/conservation/ozark_conservation_setup.jl @@ -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 = (; diff --git a/experiments/integrated/performance/profile_allocations.jl b/experiments/integrated/performance/profile_allocations.jl index 0506c05e6b..214cd40227 100644 --- a/experiments/integrated/performance/profile_allocations.jl +++ b/experiments/integrated/performance/profile_allocations.jl @@ -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 = (; diff --git a/lib/ClimaLandSimulations/src/Fluxnet/fluxnet_utilities/make_setup.jl b/lib/ClimaLandSimulations/src/Fluxnet/fluxnet_utilities/make_setup.jl index 9e9434004f..9fb3738ecd 100644 --- a/lib/ClimaLandSimulations/src/Fluxnet/fluxnet_utilities/make_setup.jl +++ b/lib/ClimaLandSimulations/src/Fluxnet/fluxnet_utilities/make_setup.jl @@ -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, diff --git a/lib/ClimaLandSimulations/src/Fluxnet/run_fluxnet.jl b/lib/ClimaLandSimulations/src/Fluxnet/run_fluxnet.jl index d27c702fc1..b49356f4a3 100644 --- a/lib/ClimaLandSimulations/src/Fluxnet/run_fluxnet.jl +++ b/lib/ClimaLandSimulations/src/Fluxnet/run_fluxnet.jl @@ -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}( diff --git a/src/integrated/soil_canopy_model.jl b/src/integrated/soil_canopy_model.jl index c86b43d39a..15608398f5 100644 --- a/src/integrated/soil_canopy_model.jl +++ b/src/integrated/soil_canopy_model.jl @@ -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 * diff --git a/src/standalone/Vegetation/Canopy.jl b/src/standalone/Vegetation/Canopy.jl index 910772de7f..c42dd619d8 100644 --- a/src/standalone/Vegetation/Canopy.jl +++ b/src/standalone/Vegetation/Canopy.jl @@ -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) diff --git a/test/standalone/Vegetation/canopy_model.jl b/test/standalone/Vegetation/canopy_model.jl index 006e4c601d..b0d9c2d065 100644 --- a/test/standalone/Vegetation/canopy_model.jl +++ b/test/standalone/Vegetation/canopy_model.jl @@ -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,