Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix method definition overwritten warning from Canopy Model tests #722

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions test/standalone/Vegetation/canopy_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ import ClimaLand
import ClimaLand.Parameters as LP
import ClimaParams

for FT in (Float32, Float64)
@testset "Canopy software pipes, FT = $FT" begin

@testset "Canopy software pipes" begin
for FT in (Float32, Float64)
domain = Point(; z_sfc = FT(0.0))

AR_params = AutotrophicRespirationParameters(FT)
Expand Down Expand Up @@ -376,10 +377,12 @@ for FT in (Float32, Float64)
)
@test ρ_sfc == compute_ρ_sfc.(thermo_params, ts_in, T_sfc)
end
end


@testset "Component prescribed fields, FT = $FT" begin
FT = Float32
@testset "Component prescribed fields" begin
struct Default{FT} <: ClimaLand.Canopy.AbstractCanopyComponent{FT} end
for FT in (Float32, Float64)
# Plant Hydraulics
LAI = FT(2)
RAI = FT(1)
Expand Down Expand Up @@ -479,7 +482,6 @@ for FT in (Float32, Float64)
FT(LAI * sin(200 * 2π / 365)),
)

struct Default{FT} <: ClimaLand.Canopy.AbstractCanopyComponent{FT} end
set_canopy_prescribed_field!(Default{FT}(), p, t0)
set_canopy_prescribed_field!(Default{FT}(), p, t0)
# Test that they are unchanged
Expand All @@ -494,8 +496,10 @@ for FT in (Float32, Float64)
Array(parent(p.canopy.hydraulics.area_index.root)) .== FT(1.0),
)
end
end

@testset "PrescribedSoil, FT = $FT" begin
@testset "PrescribedSoil" begin
for FT in (Float32, Float64)
soil_driver = PrescribedSoil(FT)
@test ground_albedo_PAR(soil_driver, nothing, nothing, nothing) ==
FT(0.2)
Expand All @@ -506,8 +510,10 @@ for FT in (Float32, Float64)
@test FT.(soil_driver.ψ(2.0)) == FT.(0.0)
@test FT.(soil_driver.T(2.0)) == FT.(298.0)
end
end

@testset "Canopy software pipes with energy model, FT = $FT" begin
@testset "Canopy software pipes with energy model" begin
for FT in (Float32, Float64)
domain = Point(; z_sfc = FT(0.0))

RTparams = BeerLambertParameters(FT)
Expand Down Expand Up @@ -753,9 +759,11 @@ for FT in (Float32, Float64)
) .== FT(289),
)
end
end


@testset "Zero LAI; FT = $FT" begin
@testset "Zero LAI;" begin
for FT in (Float32, Float64)
domain = Point(; z_sfc = FT(0.0))

BeerLambertparams = BeerLambertParameters(FT)
Expand Down Expand Up @@ -979,7 +987,5 @@ for FT in (Float32, Float64)
@test all(parent(p.canopy.radiative_transfer.nir.abs) .== FT(0))
@test all(parent(p.canopy.autotrophic_respiration.Ra) .== FT(0))
end


end
end
Loading