[f2py] call-back arguments
Mon, 23 Jul 2001 17:34:51 +0200 (EET)
On Thu, 26 Jul 2001, Martin Wiechert wrote:
> Thanks for your quick help.
> Just for clarification:
> Restrictions mentioned in the documentation (Sec.2.7 - Call-back modules:
> some attribute, initializations ignored, CPP-macros not available, etc.) do
> no longer apply?
They still do, indeed. So, in
> > subroutine cb_f(x,a,m,n) ! in :cb:test.f:foo:unknown_interface
> > real*8 dimension(m),intent(out) :: x
> > real*8 dimension(m,n),intent(in) :: a
> > integer optional,check(shape(a,1)==m),depend(a) :: m=shape(a,1)
> > integer optional,check(shape(a,0)==n),depend(a) :: n=shape(a,0)
> > end subroutine cb_f
expressions n,m=shape(..) have no effect. If the cb_f would be defined as
cb_f(m,x) then the optional attribute for m would change the signature
so that in python one would have cb_py(x,[m]).
Note that these restrictions are not actually restrictions: there is no
use for the mentioned attributes and initializations in the callback
functions. For instance, the values of m,n are already initialized in
Fortran side, and resetting them makes no sense.