Print

Print


On Dec 16, 2004, at 2:43 AM, Jouni Lerssi wrote:

> I have encountered following problem, when recompiling "old" fortran 77
> code by NAGWAre f95 -compiler:
...
> Extension: dzhank.f, line 1: Byte count on numeric data type
>            detected at *@16
...
> Obsolescent: dzhank.f, line 1: Fixed source form
> Error: dzhank.f, line 116: EQUIVALENCE of default numeric with
> non-default intrinsic type

First, just as an aside, I assume you know that the compiler is right
and
that this stuff has never been standard or portable, even in f77. In
particular, f77 compilers varied a lot as to how double precision
complex
was declared.  I have personally worked with (different) f77 compilers
that

1. Insisted that double precision complex be declared as complex*16.

2. Insisted that double complex be declared as "double complex".

and

3. Didn't implement a double precision complex at all.

And then I've seen popular libraries that used both the "double
complex" and
complex*16 forms in different subroutines.  I'm sure this wasn't done
intentionally
to maximize portability problems, but it sure annoyed me in trying to
deal
with it.  :-(

> Is there any way to substitute EQUIVALENCE (C,T(1)),(CMAX,TMAX(1))
> -statement with modern fortran (90,95) terms ?

Hmm. I'll let others try to come up with some suggestions there.
Depending
on how it is used, it might be easy or not.

But allow me to point you to the NAG compiler's -dusty switch. If you
have
a fairly recent version of the compiler, -dusty allows the above
equivalences.
I think this was new to version 5.x. You will still see the message
(unless
you use an appropriate -w switch to change that), but it will be
downgraded
to a warning instead of an error, so compilation will succeed.

So, although I do generally recommend sticking to the standard, you can
get
by with this nonstandard practice if it is too much bother to change. I
think
most compilers accept it - NAG's was probably in the minority in not
having
a way to accept it (until v5.x).

--
Richard Maine                |  Good judgment comes from experience;
[log in to unmask]       |  experience comes from bad judgment.
                             |        -- Mark Twain