I got this simple module in Fortran:
test.f90
module test implicit none contains subroutine foo(chid) implicit none character(len=*),intent(out):: chid ! char. identifier chid = "foo" end subroutine foo end module test program bar use test character(len=20) text call foo(text) write(*,*) text end program bar
compile it (in windows) gfortran test.f90 -o test.exe and run it, as expected:
foo
I can also compile it with f2py: c:\Python27\python.exe c:\Python27\Scripts\f2py.py --fcompiler=gnu95 --compiler=mingw32 -c -m test \test.f90
When I run this Python script:
test.py
from id_map import test print "This should be 'foo':" print test.foo() print "was it?"
I get the following output:
This should be 'foo': was it?
As you can see, the line, which should be "foo", is empty. Why is this?
source share