Subject: Re: mapping of pointers

From: Rob Schreiber <[email-masked]>
Date: Thu, 30 Apr 92 08:42:13 PDT

Thanks for the comments on pointers to mapped arrays;  I dont know
of any example of the kind you ask for (usefulness of pointer to mapped array).

Rob

---

From: Rob Schreiber <[email-masked]>
Date: Tue, 5 May 92 14:04:03 PDT

These are good arguments; the use that David Serafini has discussed
cannot be duplicated by a collection of allocatable arrays in a module.

Still, distribution and pointer has the potential to be what Bert
called a "rathole".

I earlier proposed that realignment and redistribution of pointer
arrays (not arrays of pointers) should be allowed, but only when
the pointer points to dynamic storage.   
There is no way to realign
or redistribute such storage except through the pointer.  The pointer cannot
be pointed at a subarray of the array.  

The pointer would have to be declared redistributable.  It should not
be possible to use a pointer in an align or distribute (static) directive,
only to realign or redistribute following allocation.

I would continue to bar
explicit alignment and distribution of target arrays.

Is this too complicated?

---

From: Michael Wolfe <[email-masked]>
Date: Tue, 5 May 92 15:59:30 -0700

Sorry to interject, but:

> I expect that pointers to explicitly mapped arrays will be quite important.
> Suppose I need a number of global, dynamically allocated objects. What is
> the appropriate mechanism for dealing with these arrays? The methoid that
> comes to my mind immediately is a common block which contains a whole bunch
> of pointers. I then go allocate the arrays and assign them to the pointers.
> Is there a better way?  Is this perhaps what modules are supposed to do?

The most appropriate way, given your brief description, is not pointers,
but "allocatable" arrays.  These are dynamically allocatable arrays,
much like pointers, except they can only point to dynamically allocated
data;  pointers, on the other hand, can point to subarrays of other
arrays, either dynamic or not.

Dynamic allocation will be extremely important, but the F90 pointer is
not the only way to do it.