Skip to content

Commit

Permalink
Merge pull request #144 from EcoExtreML/fix_139
Browse files Browse the repository at this point in the history
Fix some of the issues of StartInit
  • Loading branch information
SarahAlidoost authored Feb 10, 2023
2 parents b4ed873 + 3cd1d37 commit 7a5cd50
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 20 deletions.
Binary file modified run_model_on_snellius/exe/STEMMUS_SCOPE
Binary file not shown.
6 changes: 0 additions & 6 deletions src/+init/applySoilHeteroEffect.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
SoilVariables.Phi_s(i) = SoilConstants.Phi_S(i);
SoilVariables.Lamda(i) = SoilProperties.Coef_Lamda(i);
end
VanGenuchten.Theta_s(i) = Theta_s_ch(i); % see issue 139, item 3
end
end

Expand All @@ -23,11 +22,6 @@
for i = 1:length(initX)
SoilConstants.InitialValues.initH(i) = init.calcInitH(VanGenuchten.Theta_s(j), VanGenuchten.Theta_r(j), initX(i), VanGenuchten.n(j), VanGenuchten.m(j), VanGenuchten.Alpha(j));
end
% see issue 139, item 11
Btmh = init.calcInitH(VanGenuchten.Theta_s(j), VanGenuchten.Theta_r(j), SoilConstants.BtmX, VanGenuchten.n(j), VanGenuchten.m(j), VanGenuchten.Alpha(j));
if Btmh==-inf
Btmh = -1e7;
end
Dmark = [];
for i=1:SoilConstants.totalNumberOfElements % NL
SoilConstants.Elmn_Lnth = SoilConstants.Elmn_Lnth + SoilConstants.DeltZ(i);
Expand Down
2 changes: 0 additions & 2 deletions src/+init/applySoilHeteroWithInitialFreezing.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

for i=1:SoilConstants.numberOfNodes
SoilVariables.h_frez = init.updateHfreez(i, SoilVariables, SoilConstants);

SoilVariables.h_frez(i) = SoilVariables.h_frez(i); % see issue 139, item 2
SoilVariables.hh_frez(i) = SoilVariables.h_frez(i);
SoilVariables.h(i) = SoilVariables.h(i) - SoilVariables.h_frez(i);
SoilVariables.hh(i) = SoilVariables.h(i);
Expand Down
7 changes: 0 additions & 7 deletions src/+init/soilHeteroSubroutine.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,6 @@
SoilVariables.T(i) = SoilConstants.BtmT + (i-1) * (initT(indexOfInit) - SoilConstants.BtmT) / ML;
SoilVariables.h(i) = Btmh + (i-1) * (initH(indexOfInit) - Btmh) / ML;
SoilVariables.IH(i) = 1; % Index of wetting history of soil which would be assumed as dry at the first with the value of 1
elseif subRoutine==0
delta1 = SoilConstants.totalNumberOfElements + 2 - Dmark; % see issue 139
delta2 = ML + 2 - Dmark;
domainZ = i - Dmark + 1;
SoilVariables.T(i) = init.calcSoilTemp(initT(indexOfInit), initT((indexOfInit+1)), delta1, domainZ);
SoilVariables.h(i) = init.calcSoilTemp(initH(indexOfInit), initH((indexOfInit+1)), delta2, domainZ);
SoilVariables.IH(j) = 1;
else
delta = ML + 2 - Dmark;
domainZ = i - Dmark + 1;
Expand Down
6 changes: 1 addition & 5 deletions src/+init/updateSoilVariables.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,13 @@
SoilVariables.XWILT(i) = equations.van_genuchten(VanGenuchten.Theta_s(i), VanGenuchten.Theta_r(i), VanGenuchten.Alpha(i), -1.5e4, VanGenuchten.n(i), VanGenuchten.m(i));
SoilVariables.XCAP(i) = equations.van_genuchten(VanGenuchten.Theta_s(i), VanGenuchten.Theta_r(i), VanGenuchten.Alpha(i), -336, VanGenuchten.n(i), VanGenuchten.m(i));
else
VanGenuchten.Theta_s(i) = Theta_s_ch(j); % TODO check undefined Theta_s_ch
VanGenuchten.Theta_r(i) = SoilProperties.ResidualMC(j);

if SoilConstants.CHST==0 % Indicator of parameters derivation using soil texture or not. CHST=1, use; CHST=0 not use
SoilVariables.Phi_s(i) = SoilConstants.Phi_S(j);
SoilVariables.Lamda(i) = SoilProperties.Coef_Lamda(j);
else
VanGenuchten.Theta_s_min(i)=0.489-0.00126*SoilVariables.VPER(i,1)/(1-SoilVariables.POR(i))*100;
VanGenuchten.Theta_s(i) = VanGenuchten.Theta_s_min(i)*(1-SoilVariables.XSOC(i))+SoilVariables.XSOC(i)*SoilConstants.Theta_soc;
VanGenuchten.Theta_s(i) = VanGenuchten.Theta_s_min(i); % TODO check repeated lines

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);
end
Expand Down

0 comments on commit 7a5cd50

Please sign in to comment.