Python and Fortran code
Jose L Gomez Dans
j.l.gomez-dans at sheffield.ac.uk
Thu Jul 8 07:54:43 EDT 1999
Hi!
I have a quetion on using python to do some simple processing on
some data I pre-process with some Fortran code. I wanted to be able to call
this subroutine from within python, as it is already "tried and tested" and
optimized. Basically, my subroutine looks like this:
subroutine ex1(exdata)
dimension exdata(256,200)
print*,'Doing some processing in FORTRAN'
C We said we were doing some processing, so we might as well do it :)
C Processing of exdata
return
end
This subroutine would need to get input from the user and would also
need to print stuff out for the user to see several parameters as the
software runs. I'd like to pass exdata as a Python object (NumPy array
object), and then recover it with the results. I wonder if I could somehow
do that compiling this subroutine as an object file and then calling it from
python (not that i know how to do it, but with scilab, it works :D).
If it's of any use, I am using Debian GNU/Linux and g77. And using
loads of complex numbers :))))
Thanks in advance!
Jose
--
Jose L Gomez Dans PhD student
Radar & Communications Group
Department of Electronic Engineering
University of Sheffield UK
More information about the Python-list
mailing list