Hi all,<br>Here is a description of what I am trying to implement using F2PY:<br>I have created two python extension modules using F2PY. The first extension module (say fsubr1.so) contains a Fortran module (say "tmod") and a subroutine (say "subr1") that modifies the data contained in "tmod". The second extension module (fsubr2.so) contains the same Fortran module as fsubr1.so (tmod), and a different subroutine ("subr2") that also modifies the data contained in "tmod". I am hoping to be able to have fsubr1.so and fsubr2.so share the content of "tmod," in a way that if a call is made, from python, to "subr1", followed by a call to "subr2", both subroutine access the same data contained in "tmod". Unfortunately, if I run the Python script:<br>
<br>from fsubr1 import *<br>from fsubr2 import *<br><br>subr1()<br>print tmod.data<br>subr2()<br>
print tmod.data<br><br>the data in "tmod" will be modified only by the subroutine contained in the python module imported last, i.e. subr2 in this case.<br><br>Does anyone know how to go about this problem?<br>
Any help/insight will be greatly appreciated.<br><br>Thanks,<br><br>YAV<br><br>