On Thu, Jun 24, 2010 at 2:49 PM, Ted Stern <[log in to unmask]> wrote:
> On 24 Jun 2010 11:40:59 -0700, Vivek Rao wrote:
>>
>> Hello.
>>
>> If x(:) is your big array, in Fortran 90+ you can define a pointers x1(:), x2
>> (:) etc. that refer to sections of it, for example
>>
>> allocate (x(1000000)
>> x1 => x(1:300000)
>> x2 => x(300001:1000000)
>>
>> Vivek Rao
>
> Naomi was specifically asking how to avoid slowdowns due to use of
> pointers.
Not the way I read her email.
I thought she was asking how to avoid slowdowns due to dynamic allocation.
But I have to say that I've never met anyone who tried to outwit the
system's dynamic allocator who came to a good end. The system Naomi is
suggesting is what we had to do in the bad old days, when we'd malloc
a huge array in C and find some kludgy way to equivalence Fortran
arrays to it.
-P.
|