Metcalf & Reid say, in Fortran 90/95 Explained,
"The various uses to which EQUIVALENCE was put are replaced by ..."
implying that EQUIVALENCE is never needed in Fortran 90/95.
I have some Fortran77 code that includes, for good reasons that I
needn't go into,
DOUBLE PRECISION c(16), e(3), xx(3,3)
EQUIVALENCE (e(1),c(1)), (xx(1,1),c(7))
I believe that in Fortran 90 I can get the same effect as the first of
these equivalences by using
DOUBLE PRECISION, TARGET :: c(16)
DOUBLE PRECISION, POINTER :: e(:)
e => c(1:3)
but I can't do a similar thing for xx because xx(1:3,1:3) and c(7:15)
have different shapes.
Have I got this right? If so (or even if not) how do I achieve the
effect of the equivalence for xx?
I wouldn't worry about this, since EQUIVALENCE is still supposed to
work, but one compiler doesn't seem to cope with it correctly. (My
case is actually a bit more complicated than this one; there are
scalars equivalenced to the elements of xx.)
--
Anthony Stone http://fandango.ch.cam.ac.uk/
University Chemical Laboratory, Email: [log in to unmask]
Lensfield Road, Phone: +44 1223 336375
Cambridge CB2 1EW Fax: +44 1223 336362
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|