-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #180 from EcoExtreML/fix_issue_96
Fix issue 96
- Loading branch information
Showing
24 changed files
with
482 additions
and
462 deletions.
There are no files selected for viewing
Binary file not shown.
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
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
function SoilVariables = defineSoilVariables(InitialValues, SoilProperties, VanGenuchten) | ||
%{ | ||
Create a SoilVariables structure and define some variables. | ||
SoilVariables is input for initializing Temperature, Matric potential | ||
and soil air pressure. | ||
%} | ||
|
||
% Create a SoilVariables structure | ||
SoilVariables = struct(); | ||
|
||
% Add initial values to SoilVariables | ||
soil_fields = { | ||
'P_g', 'P_gg', 'h', 'T', 'TT', 'h_frez', 'Theta_L', ... | ||
'Theta_LL', 'Theta_V', 'Theta_g', 'Se', 'KL_h', ... | ||
'DTheta_LLh', 'KfL_T', 'Theta_II', 'Theta_I', ... | ||
'Theta_UU', 'Theta_U', 'TT_CRIT', 'KfL_h', 'DTheta_UUh' | ||
}; | ||
for field = soil_fields | ||
SoilVariables.(field{1}) = InitialValues.(field{1}); | ||
end | ||
|
||
% Calculate some of SoilVariables | ||
SoilVariables.XK = VanGenuchten.Theta_r + 0.02; % 0.11 This is for silt loam; For sand XK=0.025 | ||
SoilVariables.XWILT = equations.van_genuchten(VanGenuchten.Theta_s, VanGenuchten.Theta_r, VanGenuchten.Alpha, -1.5e4, VanGenuchten.n, VanGenuchten.m); | ||
SoilVariables.XCAP = equations.van_genuchten(VanGenuchten.Theta_s, VanGenuchten.Theta_r, VanGenuchten.Alpha, -336, VanGenuchten.n, VanGenuchten.m); | ||
|
||
SoilVariables.VPERSOC = equations.calc_msoc_fraction(SoilProperties.MSOC); % fraction of soil organic matter | ||
SoilVariables.FOSL = 1 - SoilProperties.FOC - SoilProperties.FOS - SoilVariables.VPERSOC; | ||
|
||
% Add variables to SoilVariables, see issue 141 | ||
SoilVariables.POR = SoilProperties.porosity; | ||
SoilVariables.VPERS = SoilProperties.FOS' .* (1 - SoilVariables.POR); | ||
SoilVariables.VPERSL = SoilVariables.FOSL' .* (1 - SoilVariables.POR); | ||
SoilVariables.VPERC = SoilProperties.FOC' .* (1 - SoilVariables.POR); | ||
SoilVariables.Ks = SoilProperties.SaturatedK; | ||
SoilVariables.Vol_qtz = SoilProperties.FOS; | ||
|
||
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,10 +1,10 @@ | ||
function Btmh = updateBtmh(VanGenuchten, SoilData, SoilVariables, i) | ||
function Btmh = updateBtmh(VanGenuchten, SoilVariables, i) | ||
% get model settings | ||
ModelSettings = io.getModelSettings(); | ||
|
||
if ModelSettings.SWCC == 1 % VG soil water retention model | ||
Btmh = init.calcInitH(VanGenuchten.Theta_s(i), VanGenuchten.Theta_r(i), SoilData.BtmX, VanGenuchten.n(i), VanGenuchten.m(i), VanGenuchten.Alpha(i)); | ||
Btmh = init.calcInitH(VanGenuchten.Theta_s(i), VanGenuchten.Theta_r(i), SoilVariables.BtmX, VanGenuchten.n(i), VanGenuchten.m(i), VanGenuchten.Alpha(i)); | ||
else | ||
Btmh = SoilVariables.Phi_s(i) * (SoilData.BtmX / VanGenuchten.Theta_s(i))^(-1 / SoilVariables.Lamda(i)); | ||
Btmh = SoilVariables.Phi_s(i) * (SoilVariables.BtmX / VanGenuchten.Theta_s(i))^(-1 / SoilVariables.Lamda(i)); | ||
end | ||
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
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
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
function SoilConstants = getSoilConstants() | ||
|
||
SoilConstants.hd = -1e7; | ||
SoilConstants.hm = -9899; | ||
SoilConstants.CHST = 0; | ||
SoilConstants.Elmn_Lnth = 0; | ||
SoilConstants.Dmark = 0; | ||
SoilConstants.Phi_S = [-17.9 -17 -17 -19 -10 -10]; | ||
SoilConstants.Phi_soc = -0.0103; | ||
SoilConstants.Lamda_soc = 2.7; | ||
SoilConstants.Theta_soc = 0.6; | ||
% XK=0.11 for silt loam; For sand XK=0.025 | ||
% SoilConstants.XK is used in updateSoilVariables | ||
SoilConstants.XK = 0.11; | ||
|
||
end |
Oops, something went wrong.