[log in to unmask] writes:
> What I would really like is a way to point a complex array at real and
> imaginary components, and vice-versa. That would eliminate all data
> motion. That was the game we could play in F77. A real array with
> size 2*N could be passed to a subroutine and received as a complex
> array of size N.
>
> I cannot think of any legal way to do this in F90, but I wish it were
> possible.
I cannot find anything in the f77 standard that allowed this. In
15.6.2.3 of the f77 standard, I see
"The actual arguments in a subroutine reference must agree in order,
number, and type with the corresponding dummy arguments..."
I can't see anywhere that an exception to this is mentioned. You
could presumably equivalence the real to a complex array (assuming
that the real wasn't a dummy - because you can't equivalence to
dummies) and then pass that real array, but I don't see anything that
allows you to directly pass a real to a complex or vice versa.
What you might have been able to get by with in many compilers is
another question, but anything in this area that was legal in f77
remains legal in f90.
There are, admitedly, things you might want to do in f90. For
example, you might want to use an allocatable or pointer array
(which you can't equivalence to). But again, that's not directly
something that was legal in f77 and now illegal in f90.
--
Richard Maine | Good judgment comes from experience;
[log in to unmask] | experience comes from bad judgment.
| -- Mark Twain
|