(j3.2006) (SC22WG5.4630) Comment on N1904 cont'd

Bader, Reinhold Reinhold.Bader
Mon Mar 12 16:55:39 EDT 2012


Hello all, 

It appears to me to be a good idea to enforce interoperable 
type and type parameters for non-assumed-type dummy entities.
This leaves less room for misuse, and by pushing all non-
interoperable stuff to the TYPE(*) case the programmer is 
warned by the notation that she/he's aiming at the space between 
her/his toes. This would obsolete my issues (H) to (J), and 
(K) with the possible exception of CLASS(*).
[ Remaining TYPE(*) issues are for a different thread. ]

With respect to John's point about C1255 I am not sure I agree; 
the constraint points to paragraphs where interoperability of
variables is defined, and I think it is there that the extensions
to the concept of interoperability for variables should be placed; 
this would also have the advantage that the restrictions on coarrays
as well as the topic of the paragraph above are already included 
there. It would simply be necessary to remove some restrictions
spelled out in 15.3.5 and 15.3.6 and spell out what the new stuff
interoperates with.

15.3.5 of F2008 could be reworded to

"A named scalar Fortran variable is interoperable if and only if
 it is not a coarray, and either
 (a) its type and type parameters are interoperable, and it is a 
     dummy argument if it has the ALLOCATABLE or
     POINTER attribute, or
 (b) it is assumed-type.

 An interoperable Fortran variable that has the ALLOCATABLE or 
 POINTER attribute, or is of type character with a length that is
 assumed or declared by an expression that is not a constant 
 expression is interoperable with a C descriptor. If it is
 assumed-type, it is interoperable with a pointer to void. 
 Otherwise, it is interoperable with a scalar C entity that has 
 the same type and type parameters."

<<<The last part of the last sentence did not make much sense to 
   me in the original, but of course I may be overlooking 
   something.>>>

15.3.6 of F2008 could be reworded to

para 1:

"A Fortran variable that is a named array is interoperable if and 
 only if it is not a coarray and either
 (a) its type and type parameters are interoperable, it is of 
     explicit shape, assumed size, assumed shape, assumed rank, 
     or is a dummy argument with the ALLOCATABLE or POINTER 
     attributes, or
 (b) it is assumed-type, and is of assumed-size, assumed-shape, or
     assumed-rank."

para 2 stays as-is. Delete NOTE 15.16 and add para 3:

"An interoperable Fortran named array that 
 (a) has the ALLOCATABLE or POINTER attribute, or is of type character 
     with a length that is assumed or declared by an expression that 
     is not a constant expression, or
 (b) is of assumed-type and assumed-shape or assumed-rank
 is interoperable with a C descriptor. An interoperable Fortran 
 named array that is assumed-type and assumed-size is interoperable
 with a pointer to void."
 
<<<Unfortunate side effects: 
   * replication of text for characters
   * having assumed-rank as part of "named arrays". 
   This indicates that it may be better to compress 15.3.5 and 15.3.6
   into a single subsection.>>>
 







--
 Dr. Reinhold Bader

 Leibniz Supercomputing Centre (http://www.lrz.de) / HPC Support  
 Tel. +49 89 35831 8825 - Fax  +49 89 35831 8625





More information about the J3 mailing list