Here is a PR that is an example of how to avoid killing the Python kernel when a Fortran STOP statement is encountered: SHTOOLS/SHTOOLS#59
It works, but I am not happy with the end result in how Python deals with the exception. Everything is described in the PR, and the only thing that probably needs to be refactored is the function
pystop that is defined in the main
I would like to get your comments on this before proceeding with fixing all the other routines, because this is going to take a significant amount of my time.