-----Original Message-----
> From: Fortran 90 List [mailto:[log in to unmask]] On
Behalf
> Of R. Vowels
> Sent: 07 December 2007 23:03
> That's right.
> Think of it this way.
> When you pass a named array, a descriptor of the array is passed.
> If you construct an array e.g., [x,y,z], you are not passing
> three descriptors - one for each of x, y, and z - instead you
> are still passing ONE descriptor.
> There is no guarantee that the named elements x, y, and z, are in
> adjacent storage locations and in general they won't be.
> So even if x, y, and z happened to be in adjacent storage
> locations, a single descriptor fot the constructed array is passed.
Many thanks for the replies. It is obvious when you think about it. I
think that subconsciously I was assuming an array of descriptors would
be formed.
Of course when I went back and put intent(inout) on the subroutine
argument the original code would not compile. Must remember to do that
more often, it saves a lot of time ...
Simon.
|