Subject: mapping of pointers

From: Richard Shapiro <[email-masked]>
Date: Tue, 5 May 92 15:26:18 EDT

How important will the use of pointers to explicitly mapped arrays be to
   High Performance Fortran users?  I can think of a number of reasons why
   it might not be so important:

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?

    1. Pointers are a new feature in Fortran 90 that was not present in
       FORTRAN 77, so FORTRAN 77 users are probably not accustomed to using
       (at least) Fortran 90 pointers.

This argument is specious. A LOT of Fortran 90 features are not in FORTRAN 77.

    2. Fortran 90 has other features, such as allocatable arrays, array sections,
       and explicit array reshaping operators, which take over many of the uses
       of the FORTRAN 77 pointer extensions, such as Cray pointers, without
       requiring the use of Fortran 90 pointers.

Except for the global, allocatable data.

   Frankly, I suspect that pointers to explicitly mapped arrays should go fairly
   far down on the priority list of things that HPF needs to support in order
   to be useful, so I think we should beware of falling into a rathole about it.
   But that's mostly because I haven't seen any examples of the type described
   in (a) above.  I'd be happy to be educated on this point by some feedback from
   real users.						-Bert Halstead

I hope this helps, but perhaps it is I who need the education vis a vis
modules. 

		Richard Shapiro,
		United Technologies Corporation
		([email-masked])

---

From: [email-masked]
Date: Tue, 05 May 92 15:50:21 -0400

> of pointers. I then go allocate the arrays and assign them to the pointers.

Well, that is a good point.  I hadn't thought about the fact that common
blocks can't have allocatable arrays in them, even though they can have
pointers to arrays.

Modules can in fact be used for this purpose -- see the example in Section
11.3.3.4 of the Fortran 90 standard.  But I suppose this is only relevant if
HPF actually includes modules.

> This argument is specious. A LOT of Fortran 90 features are not in FORTRAN 77.

I'm sorry you didn't like my argument.  I only meant to say that upward
compatibility from FORTRAN 77 would not be one of the reasons to support lots
of ways to use pointers -- I didn't mean to imply that there might not be
other reasons; in fact, I sent the message to find out what other reasons
there might be.

Thanks for your comments!					-Bert

---

From: David B. Serafini <[email-masked]>
Date: Tue, 5 May 92 13:29:56 PDT

[Bert Halstead ([email-masked]) writes...]

   [Rich Shapiro ([email-masked]) replies...]

As some of us have already discovered with CM Fortran, this seems to be the
most reasonable way to implement multi-block CFD algorithms w.r.t. memory
efficiency.  In CMF a compiler-dependent array descriptor is used instead of
the pointer, and a dynamic array of these descriptors is built so the implementation
can loop through the solver algorithm for each block, when the number and size
of the blocks is unknown at compile time.  The result is a hierarchical data
structure that is completely allocatable at run-time.  

-David