[f2py] intent(inout) scalar arguments

Ben Forbes <[email protected]> Thu, 28 Apr 2011 14:02:39 +1000
Newsgroups gmane.comp.python.f2py.user
Message-ID <[email protected]>
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