Thanks to Aleksandar and Richard
I realize the question I should have asked is can allocated arrays be
safely passed to old F77 routines - and the answer must be yes (as I had
assumed - but often my assumptions are suspect).
On Thu, 7 Aug 2003, Richard Maine wrote:
> Peter Steinle writes:
> > Is the memory assigned by an allocate statement guaranteed to be
> > continuous ?
>
> The simple answer is "yes". This is a good enough answer for most
> practical purposes.
>
> For the pedantic, the answer is that the standard doesn't specify
> implementation at that level. The standard just specifies how things
> have to work. In this case, things have to work in such a way that
> you wouldn't be able to tell the difference from it being continuous
> (or contiguous, which is a slightly more appropriate term).
>
So allocated to F77 must work
<snip>
> And if you are working in a shared memory multiprocessing environment,
> the question becomes more complicated. I don't know all the details
> of those kinds of environments, but I'm sure they make questions like
> this more subtle.
..and of course guess which machines we use - but fortunately the mapping
into memory banks satisfies the "I can't tell"
>
> But to return to the simple answer...yes. If you are doing something
> where this answer isn't good enough, you'll know.
>
I think this is most likely to arise when vendors port our code to new
architectures, and we would prefer them to spend time optimizing the code
rather than getting around any non-standard features.
Thanks again for the reply. Having jsut been through the tendering process
we want to ensure we don't immediately start causing problems for next
time.
Peter
|