[Matrix-SIG] Pyfort: Intent inout must be an array.? / Please make meaningfull exit values.
Paul F. Dubois
dubois1@llnl.gov
Sun, 19 Sep 1999 12:29:13 -0700
----- Original Message -----
From: Berthold Höllmann <se6y095@public.uni-hamburg.de>
To: <matrix-sig@python.org>
Cc: <dubois1@llnl.gov>
>
> I try to wrap a FORTRAN function which uses one integer parameter as
> input as well as as output value, so I tried:
>
> integer, intent(inout):: n
>
> but pyfort quits with the message:
>
> ('Intent inout must be an array.',)
>
> is there a technical reason for this, or is this only not implemented.
>
The user must pass an array since Python integers are immutable. It would of
course be possible to write the wrapper and then object at runtime if the
argument passed wan't an array; but then the documentation would not match
what the user had to do.
I chose to do this to make the point crystal clear. The fix is to change it
to n(1) in your Pyfort input. You need not touch the Fortran, of course. I
could be talked out of this decision by someone with a forceful personality;
it was an arbitrary decision.
> Another point I have is, that if an error occurs in pyfort it uses
>
> raise SystemExit
>
> in some places, I would prefer to make it
>
> raise SystemExit, 1
>
> becaus this would allow make to stop at this point and not trying to
> proceed.
>
Will fix.