I'm working on making our subroutines used by a commercial FE software thread safe. To do so, I have turned all the subroutines to recursive subroutines, and that has led to significant slow down of the code. I wonder if this is expected, and if so, if there is any remedy to it.
Thanks,
Alireza