[SciPy-User] [F2py] basic help

Benjamin benjamin.hause@colorado....
Thu Feb 9 11:37:32 CST 2012

I have a fortran 77 code (which I did not write, but currently runs fine) and I
would like to create a 'front end' for it with python. As a first step, I would
like to simply be able to call this fortran code from python (ideally it would
just be one call and I pass in the input as paramaters).

Based on the user guide (http://cens.ioc.ee/projects/f2py2e/usersguide/) section
2.1 'the quick way' I have entered the command:
f2py -c *.f -m slab

but I get errors. The output is really long so I won't post it here, but it
looks like it does fine until it tries to compile the code. Some errors/warnings
are at the bottom of this post. Note that the only changes I made to the main
fortran program was making it a subroutine and passing the input as parameters.
I was hoping this would be fairly trivial for me, like it was for this guy:

Any advice is appreciated.

446   if (biz.gt.3.75) go to 148                                        
Warning: Label 446 at (1) defined but not used
gfortran:f77: slab.f
Warning: Nonconforming tab character in column 1 of line 221

    Included at slab.f:14:

Warning: Possible change of value in conversion from REAL(4) to INTEGER(4) at (1)

    Included at slab.f:14:

Error: COMMON attribute conflicts with DUMMY attribute in 'lx' at (1)

More information about the SciPy-User mailing list