@KjellJorner Thanks for posting here. We are developing many of the tools such as fpm that should help with this task in the future. I also recommend the C interface route as others have mentioned. See this recommendation that I wrote up about 10 years ago:
- Fortran Best Practices — Fortran90 1.0 documentation
- Fortran Best Practices — Fortran90 1.0 documentation
Back then I would recommend Cython, but you don’t have to use it, you can use any other way to interface C from Python.
Note that I would like to generate the C interface and Python wrappers automatically down the road:
I would probably have it checked in a repository, so that you don’t have to rerun it every time.