-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
84 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
function latent_heat!(leleaf::Leaf, Gw::Leaf, VPD_air, slope, Tc_old::Leaf, temp_air, rho_a, Cp_ca, psychrometer) | ||
leleaf.o_sunlit = Gw.o_sunlit * (VPD_air + slope * (Tc_old.o_sunlit - temp_air)) * rho_a * Cp_ca / psychrometer | ||
leleaf.o_shaded = Gw.o_shaded * (VPD_air + slope * (Tc_old.o_shaded - temp_air)) * rho_a * Cp_ca / psychrometer | ||
leleaf.u_sunlit = Gw.u_sunlit * (VPD_air + slope * (Tc_old.u_sunlit - temp_air)) * rho_a * Cp_ca / psychrometer | ||
leleaf.u_shaded = Gw.u_shaded * (VPD_air + slope * (Tc_old.u_shaded - temp_air)) * rho_a * Cp_ca / psychrometer | ||
function latent_heat!(leleaf::Leaf, Gw::Leaf, VPD, slope, Tc_old::Leaf, Tair, rho_a, Cp_ca, gamma) | ||
leleaf.o_sunlit = Gw.o_sunlit * (VPD + slope * (Tc_old.o_sunlit - Tair)) * rho_a * Cp_ca / gamma | ||
leleaf.o_shaded = Gw.o_shaded * (VPD + slope * (Tc_old.o_shaded - Tair)) * rho_a * Cp_ca / gamma | ||
leleaf.u_sunlit = Gw.u_sunlit * (VPD + slope * (Tc_old.u_sunlit - Tair)) * rho_a * Cp_ca / gamma | ||
leleaf.u_shaded = Gw.u_shaded * (VPD + slope * (Tc_old.u_shaded - Tair)) * rho_a * Cp_ca / gamma | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
function rainfall_stage1_jl(Tair::Float64, prcp::Float64, mass_water_o_last::Float64, mass_water_u_last::Float64, | ||
lai_o::Float64, lai_u::Float64, clumping::Float64) | ||
|
||
length_step = kstep | ||
|
||
# Ta > 0, otherwise it is snow fall | ||
Tair <= 0.0 && (prcp = 0.0) | ||
|
||
density_water = 1025.0 | ||
prcp_g = 0.0 | ||
|
||
# overstorey | ||
prcp_o = prcp | ||
mass_water_o = mass_water_o_last + prcp_o * length_step * density_water * (1 - exp(-lai_o * clumping)) | ||
massMax_water_o = 0.1 * lai_o | ||
|
||
mass_water_o = clamp(mass_water_o, 0, massMax_water_o) | ||
|
||
massStep_water_o = mass_water_o - mass_water_o_last | ||
massStep_water_o = max(0.0, massStep_water_o) | ||
|
||
percent_water_o = mass_water_o / massMax_water_o | ||
percent_water_o = min(1.0, percent_water_o) | ||
|
||
# understorey | ||
prcp_u = prcp_o - massStep_water_o / density_water / length_step | ||
mass_water_u = mass_water_u_last + prcp_u * length_step * density_water * (1 - exp(-lai_u * clumping)) | ||
massMax_water_u = 0.1 * lai_u | ||
|
||
mass_water_u = clamp(mass_water_u, 0, massMax_water_u) | ||
|
||
massStep_water_u = mass_water_u - mass_water_u_last | ||
massStep_water_u = max(0.0, massStep_water_u) | ||
|
||
percent_water_u = mass_water_u / massMax_water_u | ||
percent_water_u = min(1, percent_water_u) | ||
|
||
# ground | ||
prcp_g = prcp_u - massStep_water_u / density_water / length_step | ||
|
||
return mass_water_o, mass_water_u, percent_water_o, percent_water_u, prcp_g | ||
end | ||
|
||
|
||
function rainfall_stage2_jl(evapo_water_o::Float64, evapo_water_u::Float64, | ||
mass_water_o::Ref{Float64}, mass_water_u::Ref{Float64}) | ||
|
||
length_step = kstep # 6min or 360s per step | ||
mass_water_o[] = max(mass_water_o[] - evapo_water_o * length_step, 0.0) | ||
mass_water_u[] = max(mass_water_u[] - evapo_water_u * length_step, 0.0) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters