From owner-sc22wg5+sc22wg5-dom8=www.open-std.org@open-std.org  Mon Mar 12 21:55:47 2012
Return-Path: <owner-sc22wg5+sc22wg5-dom8=www.open-std.org@open-std.org>
X-Original-To: sc22wg5-dom8
Delivered-To: sc22wg5-dom8@www.open-std.org
Received: by www.open-std.org (Postfix, from userid 521)
	id 161069DB113; Mon, 12 Mar 2012 21:55:46 +0100 (CET)
Delivered-To: sc22wg5@open-std.org
Received: from mailrelay1.lrz-muenchen.de (mailrelay1.lrz-muenchen.de [129.187.254.106])
	by www.open-std.org (Postfix) with ESMTP id ED3B09DB112
	for <sc22wg5@open-std.org>; Mon, 12 Mar 2012 21:55:45 +0100 (CET)
Received: from postout1.mail.lrz.de ([10.156.6.18] [10.156.6.18]) by mailrelay1.lrz-muenchen.de with ESMTP; Mon, 12 Mar 2012 21:55:40 +0100
Received: from BADWLRZ-SWHBT1.ads.mwn.de (BADWLRZ-SWHBT1.ads.mwn.de [IPv6:2001:4ca0:0:108::125])
	(using TLSv1 with cipher AES128-SHA (128/128 bits))
	(No client certificate requested)
	by postout1.mail.lrz.de (Postfix) with ESMTPS id 9F018C5823;
	Mon, 12 Mar 2012 21:55:40 +0100 (CET)
Received: from BADWLRZ-SWMBX1.ads.mwn.de ([fe80::11b4:b130:c4e2:2d0e]) by
 BADWLRZ-SWHBT1.ads.mwn.de ([fe80::e42f:e9f5:bde9:f99b%16]) with mapi id
 14.01.0355.002; Mon, 12 Mar 2012 21:55:40 +0100
From: "Bader, Reinhold" <Reinhold.Bader@lrz.de>
To: WG5 <sc22wg5@open-std.org>,
    "j3@j3-fortran.org" <j3@j3-fortran.org>
Subject: Comment on N1904 cont'd
Thread-Topic: Comment on N1904 cont'd
Thread-Index: Ac0AkXf3Bf9BOgwWSVCPILpVVFzrsQ==
Date: Mon, 12 Mar 2012 20:55:39 +0000
Message-Id: <166ED263DF83324D9A3BA67FB6772B2B47FF8580@BADWLRZ-SWMBX1.ads.mwn.de>
Accept-Language: de-DE, en-US
Content-Language: de-DE
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [129.187.48.252]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Sender: owner-sc22wg5@open-std.org
Precedence: bulk

Hello all,=20

It appears to me to be a good idea to enforce interoperable=20
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=20
warned by the notation that she/he's aiming at the space between=20
her/his toes. This would obsolete my issues (H) to (J), and=20
(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;=20
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;=20
this would also have the advantage that the restrictions on coarrays
as well as the topic of the paragraph above are already included=20
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=20
     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=20
 POINTER attribute, or is of type character with a length that is
 assumed or declared by an expression that is not a constant=20
 expression is interoperable with a C descriptor. If it is
 assumed-type, it is interoperable with a pointer to void.=20
 Otherwise, it is interoperable with a scalar C entity that has=20
 the same type and type parameters."

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

15.3.6 of F2008 could be reworded to

para 1:

"A Fortran variable that is a named array is interoperable if and=20
 only if it is not a coarray and either
 (a) its type and type parameters are interoperable, it is of=20
     explicit shape, assumed size, assumed shape, assumed rank,=20
     or is a dummy argument with the ALLOCATABLE or POINTER=20
     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=20
 (a) has the ALLOCATABLE or POINTER attribute, or is of type character=20
     with a length that is assumed or declared by an expression that=20
     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=20
 named array that is assumed-type and assumed-size is interoperable
 with a pointer to void."
=20
<<<Unfortunate side effects:=20
   * replication of text for characters
   * having assumed-rank as part of "named arrays".=20
   This indicates that it may be better to compress 15.3.5 and 15.3.6
   into a single subsection.>>>
=20







--
 Dr. Reinhold Bader

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

