Skip to content

Commit

Permalink
Merge pull request #201 from EcoExtreML/fix_issue_195
Browse files Browse the repository at this point in the history
Fix issue 195
  • Loading branch information
SarahAlidoost committed Oct 17, 2023
2 parents 8e2642f + 79b69ce commit 8dd9c18
Show file tree
Hide file tree
Showing 9 changed files with 185 additions and 271 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
[197](https://github.com/EcoExtreML/STEMMUS_SCOPE/pull/197)
- Remove `ObservationPoints` script
[200](https://github.com/EcoExtreML/STEMMUS_SCOPE/pull/200)
- Remove all global variables from `STEMMUS_SCOPE` script
[201](https://github.com/EcoExtreML/STEMMUS_SCOPE/pull/201)

**Fixed:**

Expand All @@ -20,6 +22,7 @@
- issue [#99](https://github.com/EcoExtreML/STEMMUS_SCOPE/issues/99)
- issue [#100](https://github.com/EcoExtreML/STEMMUS_SCOPE/issues/100)
- issue [#101](https://github.com/EcoExtreML/STEMMUS_SCOPE/issues/101)
- issue [#195](https://github.com/EcoExtreML/STEMMUS_SCOPE/issues/195)

<a name="1.3.0"></a>
# [1.3.0](https://github.com/EcoExtreML/STEMMUS_SCOPE/releases/tag/1.3.0) - 22 Jun 2023
Expand Down
Binary file modified run_model_on_snellius/exe/STEMMUS_SCOPE
Binary file not shown.
4 changes: 2 additions & 2 deletions src/+equations/Soil_Inertia1.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
function [GAM] = Soil_Inertia1(SMC)
global theta_s0
function [GAM] = Soil_Inertia1(SMC, theta_s0)
% soil inertia method by Murray and Verhoef (

% % parameters
Expand Down Expand Up @@ -32,3 +31,4 @@
Hc = (Hcw * SMC) + (1 - theta_s) * Hcs;

GAM = sqrt(lambdas .* Hc);
end
8 changes: 5 additions & 3 deletions src/+equations/calc_rssrbs.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
function [rss, rbs] = calc_rssrbs(SMC, LAI, rbs)
global SaturatedMC ResidualMC fieldMC
function [rss, rbs] = calc_rssrbs(SoilProperties, LAI, rbs)

% an alias
SP = SoilProperties;
aa = 3.8;
rss = exp((aa + 4.1) - aa * (SMC - ResidualMC(1)) / (fieldMC(1) - ResidualMC(1)));
rss = exp((aa + 4.1) - aa * (SP.SMC - SP.ResidualMC(1)) / (SP.fieldMC(1) - SP.ResidualMC(1)));
rbs = rbs * LAI / 4.3;
4 changes: 2 additions & 2 deletions src/+io/select_input.m
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@

%% derived input
if options.soil_heat_method == 1
SoilProperties.GAM = equations.Soil_Inertia1(SoilProperties.SMC);
SoilProperties.GAM = equations.Soil_Inertia1(SoilProperties.SMC, SoilProperties.theta_s0);
else
SoilProperties.GAM = equations.Soil_Inertia0(SoilProperties.cs, SoilProperties.rhos, SoilProperties.lambdas);
end
if options.calc_rss_rbs
[SoilProperties.rss, SoilProperties.rbs] = equations.calc_rssrbs(SoilProperties.SMC, canopy.LAI, SoilProperties.rbs);
[SoilProperties.rss, SoilProperties.rbs] = equations.calc_rssrbs(SoilProperties, canopy.LAI, SoilProperties.rbs);
end

if leafbio.Type
Expand Down
6 changes: 3 additions & 3 deletions src/Max_Rootdepth.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% REFERENCES
function [bbx] = Max_Rootdepth(bbx, NL, KT, TT)
function [bbx] = Max_Rootdepth(bbx)

% get model settings
ModelSettings = io.getModelSettings();
Expand All @@ -18,11 +18,11 @@
Tot_Depth = ModelSettings.Tot_Depth;
DeltZ = ModelSettings.DeltZ;
Elmn_Lnth = 0;
for ML = 1:NL
for ML = 1:ModelSettings.NL
Elmn_Lnth = Elmn_Lnth + DeltZ(ML);
if Elmn_Lnth < Tot_Depth - R_depth
bbx(ML) = 0;
elseif Elmn_Lnth >= Tot_Depth - R_depth && Elmn_Lnth <= Tot_Depth - 5 % && TT(ML)>0
elseif Elmn_Lnth >= Tot_Depth - R_depth && Elmn_Lnth <= Tot_Depth - 5
bbx(ML) = 1;
else
bbx(ML) = 0;
Expand Down
Loading

0 comments on commit 8dd9c18

Please sign in to comment.