sharing variables in fortran

Douglas du Boulay ddb at crystal.uwa.edu.au
Tue Apr 27 03:16:10 EDT 1999


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.

I am looking (still) at converting a large fortran program to use
python/tkinter/pyOpenGL with an
intermediate C-interface to the more numerically intensive fortran
OpenGL rendering routines.
Currently it looks like there are around 500 variables controlling
various aspects of the rendering
which need to be set and adjusted in python/tkinter routines, and whose
values are needed by the
fortran code. If it is possible to avoid using 500 Py_PassTuple() etc.
C  routines every time the user
moves the mouse, it would be very useful to know.

I am sure it is possible to get the tkinter widgets to read current
state before being invoked and then
call another C function to copy it back, but if there was a way to share
the fortran/C variable address space
so that the tkinter widgets changed them directly ....

Thanks in advance for any info.
Doug
(still a python beginner)

P.S.  if you are interested to see what a beast the gui really is take a
look at part of it here:
http://www.crystal.uwa.edu.au/~ddb/panels.py
(it doesn't actually do anything constructive yet)






More information about the Python-list mailing list