On Wed, 28 Feb 2001, Malcolm Cohen wrote:
> The only glitch I'm aware of is for (ugh) assumed-length character
> functions. [snip]
> the lengths mismatch! Very rare to see one of these though
Well actually I've used this quite a bit in my old code; the ugliness is a
matter of opinion.
The other gotcha I've come across (in other people's code) is a procedure
called with arguments of varying dimensionality, e.g. like this:
CALL SOMESUB(ARRAY, NPTS)
...
CALL SOMESUB(SCALAR, 1)
Of course, such usage is contrary to the F77 Standard, but it's actually
rather common in existing code, and I'm not aware of any compiler which
actually fails to handle it sensibly. This does prevent you generating
an interface block that works both ways. One solution is to
have two actual functions, one for scalars and one for arrays, and then a
generic interface called SOMESUB which calls the appropriate specific
routine, the scalar one of which is just a wrapper around the array
version. This is not too hard to do by hand, if only it were easy to
automate.
--
Clive Page,
Dept of Physics & Astronomy,
University of Leicester.
|