Re: Some Fortraner comments...

Chuck Koelbel (chk@cs.rice.edu)
Fri, 7 Feb 1997 16:29:40 -0600

>> 2. Fortran90/95 elements are used in some places (KIND=, ! for comments,
>> DO/END DO, ...). It would be a significant improvement for people
>> concerned about Fortran90/95 bindings if the INTENT attribute would
>> also be used in the specification of the Fortran bindings. This does
>> not solve the <choice>-type and other problems, but would be a good
>> first step (and easy to ignore for FORTRAN77-ers). The attribute comes
>> in three forms, INTENT(IN|OUT|INOUT), and should be easily derived from
>> the language-independent specs. Lots of typing, of course, and a separate
>> section for corresponding MPI 1.1 Fortran interfaces might be
>>necessary...
>
>The warrants further discussion.
>It seems like basically a good idea, but I'm not sure how to
>handle some details.
>1. Do we now need to specify separate F77 and F90 bindings?
>2. Am I correct that these functions now require explicit interfaces
>and therefore would require using the mpi module?
>3. For routines with choice arguments, do we just leave out
>the intent information?

I haven't had a chance to download the chapter, but can offer a few comments:

1. KIND= requires explicit subprogram interfaces; therefore, it cannot be
part of an F77 binding. If you use KIND=, you already need separate F77
and F90 bindings (although the F90 bindings could be a superset of the F77).

2. INTENT does not require explicit subprogram interfaces. It is basically
advice to the compiler and/or programmer. So it does not require a
separate binding, but it may look a bit odd to people who only know F77.

I think that adding INTENT would be a good idea. It would probably be wise
to add a one-sentence (maybe one-paragraph) explanation for F77 programmers
as well.

I'm doing this from memory, but I'm sure somebody will quickly correct me
if I misspoke.:-)

>A related change would be to use assumed-shape arrays rather
>than assumed-size arrays for dummy arguments. This
>seems to involve the same issues.

Yes, assumed-shape arrays require explicit interfaces.

But there are other issues with assumed-shape dummies as well (e.g. they
can be passed strided sections, which interact poorly with MPI data types).

Chuck

**********************************************************************
Charles Koelbel CRPC, MS 132
Center for Research on Parallel Computation Rice University
Rice University 6100 Main Street
chk@cs.rice.edu Houston, TX 77005
**********************************************************************