Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
MostafaGomaa93 committed Aug 15, 2024
1 parent c795088 commit ee43233
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/+io/calculateSoilLayerThickness.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
function soilThick = calculateSoilLayerThickness(ModelSettings)
%{
Calculate soil layers thickness (cumulative layers thickness; e.g. 1, 2,
3, 5, 10, ......., 480, total soil depth)
soilThick cumulative soil layers thickness (from top to bottom)
%}

soilThick = zeros(ModelSettings.NN, 1); % cumulative soil layers thickness
soilThick(1) = 0;

for i = 2:ModelSettings.NL
soilThick(i) = soilThick(i - 1) + ModelSettings.DeltZ_R(i - 1);
end
soilThick(ModelSettings.NN) = ModelSettings.Tot_Depth; % total soil depth

end

0 comments on commit ee43233

Please sign in to comment.