[f2py] intent(inout) scalar arguments

Ben Forbes bdforbes at gmail.com
Thu Apr 28 07:02:39 EEST 2011


I've read section 4.1 "Scalar arguments" in the documentation, but I
still don't understand why rank-0 arrays must be used. If I have a
routine:

subroutine foo(b)
  integer(4),intent(inout)::b
  b=b+10
end subroutine foo

and I call from Python using

b=5
scalar.foo(b)

Won't a pointer to b get passed through to the C-wrapper and then to
Fortran? Why wouldn't b be incremented?


-- 
Benjamin D. Forbes
School of Physics
The University of Melbourne
Parkville, VIC 3010, Australia



More information about the f2py-users mailing list