[f2py] f2py and F90 compiler options
Jeremy Roberts <[email protected]>
| Newsgroups | gmane.comp.python.f2py.user |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I'm new to f2pi, and I'm seemingly running into issues using the Fortran-90
compiler options. The issue is that I have a large Fortran unformatted file
with a record marker length of 4, and default on my system is 8. I can fix
this by using "-frecord-marker = 4". A Fortran executable works fine to
read this.
However, using f2pi and calling the same subroutine from Python yields an
error indicating that the "-frecord-marker" assignment hasn't been properly
used.
Fortran 90 :
*terminal% **gfortran -frecord-marker=4 testfort.f90 testmain.f90 -o testx
terminal% testx
** read **
*
where my files are:
*
*
*module testfort ! testfort.f90*
* implicit none*
* contains*
* subroutine fudge(a)*
* integer, intent(in) :: a*
* integer :: ucov=77, io*
* open (unit = ucov, file = "44groupcov", action = "read", status =
"old", & *
* position = "rewind", iostat = io, form="unformatted") *
* read(ucov)*
* print *, " ** read ** "*
* end subroutine fudge*
*end module testfort
program testmain ! testmain.f90
use testfort
implicit none
call fudge(1)
end program testmain
*
Note, without the frecord assignment, I get:
*terminal% gfortran testfort.f90 testmain.f90 -o testx
terminal% testx
At line 9 of file testfort.f90
Fortran runtime error: Invalid argument
*
which seems to mean it's expecting a different file marker length in the
unformatted file "44groupcov".
Now, using f2py:
*terminal% f2py -m testfort -c testfort.f90 --f90flags="-frecord-marker=4"
--fcompiler=gfortran*
*terminal% python test.py
At line 9 of file testfort.f90
Fortran runtime error: Invalid argument*
Where test.py is:
*#! /usr/bin/env python
import testfort
testfort.testfort.fudge(1)*
Any insight as to what I'm doing wrong would be greatly appreciated.
I'm using f2py version 2_5972 and Python 2.5.4.
_______________________________________________
f2py-users mailing list
f2py-users-Y4l6ocDipWCuvFJfX82//[email protected]
http://cens.ioc.ee/mailman/listinfo/f2py-users