For an intro to
f2py see here.
It’s possible to combine multiple Fortran modules into a single shared library to be used by Python using
f2py. It’s actually pretty easy, but I’m writing a note about it because I’ll likely forget how to do it in the future.
Let’s suppose we have two modules,
two, and we only explicitly want to use the functions in
one from Python.
one.f90 might contain:
… while in
To compile, execute:
Now, check that it works in python