From: olipt at mayo.edu (Travis Oliphant)
Date: Tue, 27 Apr 1999 02:45:58 -0500
Subject: sharing variables in fortran
In-Reply-To: <3725643A.734B9F06@crystal.uwa.edu.au>
References: <3725643A.734B9F06@crystal.uwa.edu.au>
Message-ID: <Pine.LNX.4.04.9904270241500.31241-100000@us2.mayo.edu>
X-UID: 1528                                                  

> I am wondering if it is possible to coerce python to use
> memory  addresses corresponding to a fortran common block (by way of a c
> extension)
> for storage of certain variables.

Yes, but you won't find a ton of information about it.  Be prepared to
experiment a little.

I would suggest using the Numeric module with it's C-API.

There is an exported function you can call from C called 
PyArray_FromDimsAndData that creates a NumPy array from some dimension
information and a pointer to already allocated memory.  There is some
improving documentation on the C-API to Numeric in the documentation
recently released for NumPy.  See the scientific computing topic section
of www.python.org

I'm not sure how to access a Fortran common block from C at the moment.

Have you heard about the PyOpenGL interface?

Good luck.

Travis








