From ee4323335e1498bc9eb01ec9fbf8c5047e575356 Mon Sep 17 00:00:00 2001 From: Mostafa Gomaa Daoud <54531356+MostafaGomaa93@users.noreply.github.com> Date: Thu, 15 Aug 2024 12:59:29 +0300 Subject: [PATCH] Add files via upload --- src/+io/calculateSoilLayerThickness.m | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/+io/calculateSoilLayerThickness.m diff --git a/src/+io/calculateSoilLayerThickness.m b/src/+io/calculateSoilLayerThickness.m new file mode 100644 index 00000000..dae1f9b0 --- /dev/null +++ b/src/+io/calculateSoilLayerThickness.m @@ -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