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 GPU bug from sif model #719

Merged
merged 4 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion experiments/benchmarks/land.jl
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ function setup_prob(t0, tf, Δt; nelements = (101, 15))
# or PR #645 for details.
# For now, this clipping is similar to what CLM does.
LAIfunction = TimeVaryingInput(
joinpath(era5_artifact_path, "era5_2021_0.9x1.25_clima.nc"),
joinpath(era5_artifact_path, "era5_lai_2021_0.9x1.25_clima.nc"),
"lai",
surface_space;
reference_date = ref_time,
Expand Down
2 changes: 1 addition & 1 deletion experiments/integrated/global/global_soil_canopy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ photosynthesis_args = (;
# Set up plant hydraulics
# Not ideal
LAIfunction = TimeVaryingInput(
joinpath(era5_artifact_path, "era5_2021_0.9x1.25_clima.nc"),
joinpath(era5_artifact_path, "era5_lai_2021_0.9x1.25_clima.nc"),
"lai",
surface_space;
reference_date = ref_time,
Expand Down
3 changes: 2 additions & 1 deletion experiments/long_runs/land.jl
Original file line number Diff line number Diff line change
Expand Up @@ -462,14 +462,15 @@ function setup_prob(t0, tf, Δt; outdir = outdir, nelements = (101, 15))
)
)
# Set up plant hydraulics

# Note that we clip all values of LAI below 0.05 to zero.
# This is because we currently run into issues when LAI is
# of order eps(FT) in the SW radiation code.
# Please see Issue #644
# or PR #645 for details.
# For now, this clipping is similar to what CLM does.
LAIfunction = TimeVaryingInput(
joinpath(era5_artifact_path, "era5_2021_0.9x1.25_clima.nc"),
joinpath(era5_artifact_path, "era5_lai_2021_0.9x1.25_clima.nc"),
"lai",
surface_space;
reference_date = ref_time,
Expand Down
1 change: 1 addition & 0 deletions src/standalone/Vegetation/optimality_farquhar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,4 @@ function update_photosynthesis!(
@. Rd = dark_respiration(Vcmax25, β, f, ΔHRd, T, To, R)
@. An = net_photosynthesis(Ac, Aj, Rd, β)
end
Base.broadcastable(m::OptimalityFarquharParameters) = tuple(m)
14 changes: 10 additions & 4 deletions src/standalone/Vegetation/solar_induced_fluorescence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,18 @@ function update_SIF!(
T_freeze,
photosynthesis_parameters,
)
(; ΔHJmax, To, θj, ϕ) = photosynthesis_parameters
sif_parameters = sif_model.parameters
@. SIF = compute_SIF_at_a_point(
APAR,
Tc,
Vcmax25,
R,
T_freeze,
photosynthesis_parameters,
ΔHJmax,
To,
θj,
ϕ,
sif_parameters,
)
end
Expand All @@ -95,10 +99,12 @@ function compute_SIF_at_a_point(
Vcmax25::FT,
R::FT,
T_freeze::FT,
photosynthesis_parameters,
sif_parameters,
ΔHJmax::FT,
To::FT,
θj::FT,
ϕ::FT,
sif_parameters::SIFParameters{FT},
) where {FT}
(; ΔHJmax, To, θj, ϕ) = photosynthesis_parameters
Jmax = max_electron_transport(Vcmax25, ΔHJmax, Tc, To, R)
J = electron_transport(APAR, Jmax, θj, ϕ)
(; kf, kd_p1, kd_p2, min_kd, kn_p1, kn_p2, kp, kappa_p1, kappa_p2) =
Expand Down
Loading