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

Move equations to right folder #171

Merged
merged 2 commits into from
May 24, 2023
Merged
Show file tree
Hide file tree
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
14 changes: 14 additions & 0 deletions src/+equations/calcLambda.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
function calcLambda(VPER, POR, Lamda_soc, XSOC)
%{
Calculate soil hydraulic properties according to equation 6c in
Zheng, D., van der Velde, R., Su, Z., Wang, X., Wen, J., Booij, M. J.,
Hoekstra, A. Y., and Chen, Y.: Augmentations to the Noah model physics
for application to the Yellow River source area. Part I: Soil water
flow, Journal of Hydrometeorology, 16, 2659-2676,
https://doi.org/10.1175/JHM-D-14-0198.1, 2015

%}

Lamda = (2.91 + 0.159 * VPER / (1 - POR) * 100);
Lamda = 1 / (Lamda * (1 - XSOC) + XSOC * Lamda_soc);
end
15 changes: 15 additions & 0 deletions src/+equations/calcPhi_s.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
function Phi_s = calcPhi_s(VPER, POR, Phi_soc, XSOC)
%{
Calculate soil hydraulic properties according to equation 6b in
Zheng, D., van der Velde, R., Su, Z., Wang, X., Wen, J., Booij, M. J.,
Hoekstra, A. Y., and Chen, Y.: Augmentations to the Noah model physics
for application to the Yellow River source area. Part I: Soil water
flow, Journal of Hydrometeorology, 16, 2659-2676,
https://doi.org/10.1175/JHM-D-14-0198.1, 2015

%}

Phi_s = -0.01 * 10^(1.88 - 0.0131 * VPER / (1 - POR) * 100);
Phi_s = (Phi_s * (1 - XSOC) + XSOC * Phi_soc) * 100;

end
4 changes: 2 additions & 2 deletions src/+init/updateSoilVariables.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
SoilVariables.Lamda(i) = SoilProperties.Coef_Lamda(j);
else
VanGenuchten.Theta_s(i) = 0.489 - 0.00126 * SoilVariables.VPER(i, 1) / (1 - SoilVariables.POR(i)) * 100;
SoilVariables.Phi_s(i) = init.calcPhi_s(SoilVariables.VPER(i, 1), SoilVariables.POR, SoilConstants.Phi_soc, SoilVariables.XSOC);
SoilVariables.Lamda(i) = init.calcLambda(SoilVariables.VPER(i, 3), SoilVariables.POR, SoilVariables.Lamda_soc, SoilVariables.XSOC);
SoilVariables.Phi_s(i) = equations.calcPhi_s(SoilVariables.VPER(i, 1), SoilVariables.POR, SoilConstants.Phi_soc, SoilVariables.XSOC);
Yunfei-Wang1993 marked this conversation as resolved.
Show resolved Hide resolved
Yunfei-Wang1993 marked this conversation as resolved.
Show resolved Hide resolved
SoilVariables.Lamda(i) = equations.calcLambda(SoilVariables.VPER(i, 3), SoilVariables.POR, SoilVariables.Lamda_soc, SoilVariables.XSOC);
end
SoilVariables.XWILT(i) = VanGenuchten.Theta_s(i) * ((-1.5e4) / SoilVariables.Phi_s(i))^(-1 * SoilVariables.Lamda(i));
end