The code that barfed was a declaration:
COMPLEX FUNCTION LI2*16(X)
I tried it and it _is_ accepted by G77 (but not by gfortran).
Out of which left-field did this extension come?
--
Ivan Reid, School of Engineering & Design, _____________ CMS Collaboration,
Brunel University. Ivan.Reid@[brunel.ac.uk|cern.ch] Room 40-1-B12, CERN
KotPT -- "for stupidity above and beyond the call of duty".
My test input for convert.f90 contains
complexfunctionx1*16(i)
and I think it came from IBM.
Regards,
Mike Metcalf
> The code that barfed was a declaration:
>
> COMPLEX FUNCTION LI2*16(X)
> I tried it and it _is_ accepted by G77 (but not by gfortran).
> Out of which left-field did this extension come?
That is, at least, the form used by the OS/360 Fortran compilers.
The form COMPLEX*16 FUNCTION LI2(X) does not seem to be allowed.
On variable declarations one can override the length such as:
REAL*8 BAKER, HOLD, VALUE*4, ITEM(5,5)
such that VALUE is REAL*4, the rest are REAL*8.
Specifying the length on individual CHARACTER variables
seems to still work, but FUNCTION statements don't seem to
work that way.
CHARACTER FUNCTION S*10(X)
doesn't seem to be legal.
-- glen
The IBM VS Fortran manual of Feb 1981 gave on p.109 an IBM
extension to f77 allowing a function statement to be something like
COMPLEX FUNCTION f*16(z) but not like COMPLEX*16 FUNCTION f(z)
In g77 on Intel i386 NetBSD both forms work: the following prints
1.3333333333333333 -0.3333333333333333
with that compiler:
* Test nonstandard *16 syntax
COMPLEX*16 f
PRINT "(2F20.16)",f((4.0d0,-1.0d0))
END
COMPLEX*16 FUNCTION f(z)
COMPLEX*16 z
f = z/3
END
and so does the same program with COMPLEX*16 FUNCTION f(z) replaced by
COMPLEX FUNCTION f*16(z)
but of course a standard-conforming compiler, whether f77 f90 f95 or
f2003, is free to reject either form.
-- John Harper, School of Mathematics, Statistics and Computer Science,
Victoria University, PO Box 600, Wellington 6140, New Zealand
e-mail john....@vuw.ac.nz phone (+64)(4)463 6780 fax (+64)(4)463 5045