diff --git a/src/+init/soilHeteroSubroutine.m b/src/+init/soilHeteroSubroutine.m index 042619ba..f78083f4 100644 --- a/src/+init/soilHeteroSubroutine.m +++ b/src/+init/soilHeteroSubroutine.m @@ -47,12 +47,12 @@ j = i - 1; end - SoilVariables.IS(i) = indexOfSoilType; + SoilVariables.IS(j) = indexOfSoilType; if subRoutine == 4 SoilVariables.IS(5:8) = 5; end - J = SoilVariables.IS(i); + J = SoilVariables.IS(j); [SoilVariables, VanGenuchten] = init.updateSoilVariables(SoilVariables, VanGenuchten, SoilProperties, ModelSettings, j, J); SoilVariables.Imped(i) = ImpedF(J);