I want to share data which is located in a Fortran 90 module between many self compiled F2PY extension modules. The documentation of F2PY says that this is not possible due to to how Python imports shared libraries in general.
F2PY generates wrappers to common blocks defined in a routine signature block. Common blocks are visible by all Fortran codes linked with the current extension module, but not to other extension modules (this restriction is due to how Python imports shared libraries).
[...]
The F2PY interface to Fortran 90 module data is similar to Fortran 77 common blocks.
Due to the fact, that I have to use about 100 nested Fortran 90 subroutines, I need to share data between them. Any suggestions how I can achieve that?
I thought about passing every variable as parameter to each subroutine and return the variables afterwards, but this sounds somehow wrong.