Dear Felix,
Thank you very much for sharing with us your R code.
I am currently undertaking a research on hydrological modeling, part of which will require multiple consecutive SHETRAN runs similar to your case.
In my case however, I am attempting to implement a similar code in Matlab, but have not succeeded in this matter.
If you are familiar with Matlab, could you provide suggestion on how to convert your code into one based on it?
Cheers,
Setya