Skip to content

Commit f15533c

Browse files
Merge pull request #33 from gregory-halverson/main
checking intermediate values in `canopy_shortwave_radiation`
2 parents a8d714f + abde8b3 commit f15533c

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

breathing_earth_system_simulator/canopy_shortwave_radiation.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,10 @@ def canopy_shortwave_radiation(
7878
}
7979

8080
for param_name, param_value in parameters.items():
81+
check_distribution(param_value, param_name)
8182
if param_value is None:
8283
raise ValueError(f"The parameter '{param_name}' cannot be None.")
8384

84-
# self.diagnostic(PARDiff, "PARDiff", date_UTC, target)
85-
# self.diagnostic(PARDir, "PARDir", date_UTC, target)
86-
# self.diagnostic(NIRDiff, "NIRDiff", date_UTC, target)
87-
# self.diagnostic(NIRDir, "NIRDir", date_UTC, target)
88-
# self.diagnostic(UV, "UV", date_UTC, target)
89-
# self.diagnostic(SZA, "SZA", date_UTC, target)
90-
# self.diagnostic(LAI, "LAI", date_UTC, target)
91-
# self.diagnostic(CI, "CI", date_UTC, target)
92-
# self.diagnostic(RVIS, "RVIS", date_UTC, target)
93-
# self.diagnostic(RNIR, "RNIR", date_UTC, target)
94-
9585
# Beam radiation extinction coefficient of canopy
9686
kb = np.where(SZA > 89, 50.0, 0.5 / np.cos(np.radians(SZA))) # Table A1
9787
check_distribution(kb, "kb")
@@ -111,11 +101,15 @@ def canopy_shortwave_radiation(
111101
# Sunlit fraction
112102
fSun = np.clip(1.0 / kb * (1.0 - np.exp(-kb * LAI * CI)) / LAI, 0, 1) # Integration of Eq. (1)
113103
fSun = np.where(LAI == 0, 0, fSun) # Eq. (1)
104+
check_distribution(fSun, "fSun")
114105

115106
# For simplicity
116107
L_CI = LAI * CI
108+
check_distribution(L_CI, "L_CI")
117109
exp_kk_Pd_L_CI = np.exp(-kk_Pd * L_CI)
110+
check_distribution(exp_kk_Pd_L_CI, "exp_kk_Pd_L_CI")
118111
exp_kk_Nd_L_CI = np.exp(-kk_Nd * L_CI)
112+
check_distribution(exp_kk_Nd_L_CI, "exp_kk_Nd_L_CI")
119113

120114
# Total absorbed incoming PAR
121115
Q_PDn = (1.0 - albedo_visible) * PARDir * (1.0 - np.exp(-kk_Pb * L_CI)) + (1.0 - albedo_visible) * PARDiff * (
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.5.3
1+
1.5.4

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["setuptools>=60", "setuptools-scm>=8.0", "wheel"]
33

44
[project]
55
name = "breathing-earth-system-simulator"
6-
version = "1.5.3"
6+
version = "1.5.4"
77
description = "Breathing Earth System Simulator (BESS) Gross Primary Production (GPP) and Evapotranspiration (ET) Model Python"
88
readme = "README.md"
99
authors = [

0 commit comments

Comments
 (0)