By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,621 Members | 1,077 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,621 IT Pros & Developers. It's quick & easy.

Re: F2PY: Access Fortran module data from multiple python module

P: n/a
En Wed, 19 Nov 2008 20:06:37 -0200, Yann Vonder
Here is a description of what I am trying to implement using F2PY:
I have created two python extension modules using F2PY. The first
module (say contains a Fortran module (say "tmod") and a
subroutine (say "subr1") that modifies the data contained in "tmod". The
second extension module ( contains the same Fortran module as (tmod), and a different subroutine ("subr2") that also modifies
the data contained in "tmod". I am hoping to be able to have
and share the content of "tmod," in a way that if a call is made,
python, to "subr1", followed by a call to "subr2", both subroutine access
the same data contained in "tmod". Unfortunately, if I run the Python
If you put tmod in both libraries, you'll have two copies of it, and two
copies of the data. Can't you join both libraries onto a single one? Or
make one load the other? Or avoid global variables, and pass the required
data to the subroutines? Either way, this is a design problem that you'll
have to solve on the Fortran side, not in Python.

Gabriel Genellina

Nov 21 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.