Skip to content

Commit 1781ea8

Browse files
authored
fix three bugs: one in canopy, one in run fluxnet, one in fluxnet data (#1310)
1 parent c46bee6 commit 1781ea8

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

experiments/integrated/fluxnet/ozark_pft.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ site_ID_val = FluxnetSimulations.replace_hyphen(site_ID)
5858
soil_α_NIR,
5959
Ω,
6060
χl,
61-
G_Function,
6261
α_PAR_leaf,
6362
λ_γ_PAR,
6463
τ_PAR_leaf,

experiments/integrated/fluxnet/ozark_soilsnow.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ site_ID_val = FluxnetSimulations.replace_hyphen(site_ID)
5555
soil_α_NIR,
5656
Ω,
5757
χl,
58-
G_Function,
5958
α_PAR_leaf,
6059
λ_γ_PAR,
6160
τ_PAR_leaf,

experiments/integrated/fluxnet/run_fluxnet.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ site_ID_val = FluxnetSimulations.replace_hyphen(site_ID)
5858
soil_α_NIR,
5959
Ω,
6060
χl,
61-
G_Function,
6261
α_PAR_leaf,
6362
λ_γ_PAR,
6463
τ_PAR_leaf,

ext/fluxnet_simulations/data_processing.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ function FluxnetSimulations.get_comparison_data(
186186
v = data[:, idx]
187187
missing_mask = var_missing.(v; val)
188188
not_missing_mask = .~missing_mask
189-
n_missing = sum(not_missing_mask)
190-
if n_missing <= length(v) # some data are present
189+
n_missing = sum(missing_mask)
190+
if n_missing < length(v) # some data are present
191191
v[missing_mask] .= sum(v[not_missing_mask]) / sum(not_missing_mask)
192192
return (; Symbol(climaland_shortname) => preprocess_func.(v))
193193
else

src/standalone/Vegetation/canopy_parameterizations.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,16 @@ end
5959
6060
Returns the leaf angle distribution value for CLM G function as a function of the
6161
cosine of the solar zenith angle and the leaf orientation index.
62-
See section 3.1 of https://www2.cesm.ucar.edu/models/cesm2/land/CLM50_Tech_Note.pdf
62+
See section 3.1 of https://www2.cesm.ucar.edu/models/cesm2/land/CLM50_Tech_Note.pdf.
63+
64+
Note that the zenith angle is defined ∈ [0,2π), so to prevent a negative value
65+
of G when the sun is below the horizon, we clip cosθs >= 0.
6366
"""
6467
function compute_G(G::CLMGFunction, cosθs::FT) where {FT}
6568
χl = G.χl
6669
ϕ1 = 0.5 - 0.633 * χl - 0.33 * χl^2
6770
ϕ2 = 0.877 * (1 - 2 * ϕ1)
68-
return FT(ϕ1 + ϕ2 * cosθs)
71+
return FT(ϕ1 + ϕ2 * max(cosθs, 0))
6972
end
7073

7174
"""

0 commit comments

Comments
 (0)