From owner-sc22wg5+sc22wg5-dom8=www.open-std.org@open-std.org  Tue May 28 19:55:52 2013
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 DF6AF356E98; Tue, 28 May 2013 19:55:52 +0200 (CEST)
Delivered-To: sc22wg5@open-std.org
Received: from exprod6og106.obsmtp.com (exprod6og106.obsmtp.com [64.18.1.191])
	by www.open-std.org (Postfix) with ESMTP id B1F243568DE
	for <sc22wg5@open-std.org>; Tue, 28 May 2013 19:55:34 +0200 (CEST)
Received: from CFWEX01.americas.cray.com ([136.162.34.11]) (using TLSv1) by exprod6ob106.postini.com ([64.18.5.12]) with SMTP
	ID DSNKUaTvlXR/3VPY7l+oDjUQ0DZXEZ2M9F+s@postini.com; Tue, 28 May 2013 10:55:51 PDT
Received: from fortran.us.cray.com (172.31.19.200) by
 CFWEX01.americas.cray.com (172.30.88.25) with Microsoft SMTP Server id
 14.2.342.3; Tue, 28 May 2013 12:55:31 -0500
Message-ID: <51A4F07C.2050608@cray.com>
Date: Tue, 28 May 2013 12:59:24 -0500
From: Bill Long <longb@cray.com>
Reply-To: <longb@cray.com>
Organization: Cray Inc.
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130509 Thunderbird/17.0.6
MIME-Version: 1.0
To: sc22wg5 <sc22wg5@open-std.org>
Subject: Re: (j3.2006) (SC22WG5.5003) AW:  Corrections to TS29113
References: <20130527194800.755D0356E40@www.open-std.org>	<OFDC9B32A5.2402B96B-ON85257B78.00759D51-85257B78.00764A8E@ca.ibm.com> <20130528064313.2D3EA356EC9@www.open-std.org> <OFCE0017B3.69D3A1DF-ON85257B79.005A07AD-85257B79.005ABEA3@ca.ibm.com>
In-Reply-To: <OFCE0017B3.69D3A1DF-ON85257B79.005A07AD-85257B79.005ABEA3@ca.ibm.com>
Content-Type: text/plain; charset="ISO-8859-1"; format=flowed
Content-Transfer-Encoding: 7bit
Sender: owner-sc22wg5@open-std.org
Precedence: bulk

Hopefully reducing the confusion:

1) An assumed-rank dummy argument may have the allocatable or pointer 
attribute.  This is based on these not being in the list of prohibited 
attributes in C535a.  It is also clearly the intent based on the text in 
6.3p1.

2) The model for assumed-rank that is not allocatable or pointer is an 
assumed-shape array.  Both assumed-shape and assumed-rank that is 
nonpointer nonallocatable come under the CFI_attribute_other category in 
Table 8.1.  There is not way for the C function to distinguish these cases.

3) If the procedure with the assumed-rank argument also has BIND(C) then 
the argument passing is implemented as a pointer to a C descriptor.  If 
the argument is not a pointer or allocatable, then the lower bounds in 
the descriptor are zero, as stated in 8.3.3.

4) If the procedure with the assumed-rank argument does not have BIND(C) 
and the argument is not a pointer or allocatable, then it should be 
treated like a Fortran assumed-shape array with no lower bounds 
specified and would have lower bounds of 1, a specified in the LBOUND 
intrinsic in F2008. That text we not modified by the TS.

5) The proposed edit for the end of 6.3p1 is inconsistent with (3) 
above.   The lower bound value was intentionally omitted in 6.3p1.

Cheers,
Bill


On 5/28/13 11:31 AM, Daniel C Chen wrote:
>
> XL Fortran Development - IBM Toronto Software Lab
> Phone: 905-413-3056
> Tie: 969-3056
> Email: cdchen@ca.ibm.com
> http://www.ibm.com/software/awdtools/fortran/xlfortran
>
> Inactive hide details for "Bader, Reinhold" ---05/28/2013
> 02:43:26---Hello Daniel, Von: j3-bounces@mailman.j3-fortran.org
> [mail"Bader, Reinhold" ---05/28/2013 02:43:26---Hello Daniel, Von:
> j3-bounces@mailman.j3-fortran.org
> [mailto:j3-bounces@mailman.j3-fortran.org] Im A
>
> From: "Bader, Reinhold" <Reinhold.Bader@lrz.de>
> To: WG5 <sc22wg5@open-std.org>,
> Date: 05/28/2013 02:43
> Subject: (j3.2006) (SC22WG5.5003) AW:  Corrections to TS29113
> Sent by: j3-bounces@mailman.j3-fortran.org
>
> ------------------------------------------------------------------------
>
>
>
> Hello Daniel,
>
> *Von:* j3-bounces@mailman.j3-fortran.org
> [mailto:j3-bounces@mailman.j3-fortran.org] *Im Auftrag von *Daniel C Chen*
> Gesendet:* Montag, 27. Mai 2013 23:32*
> An:* fortran standards email list for J3*
> Cc:* WG5; j3-bounces@mailman.j3-fortran.org; Bill Long*
> Betreff:* Re: (j3.2006) (SC22WG5.5001) Corrections to TS29113
>
> "(A) Assumed rank entities.
> The Fortran lower bounds of an assumed-rank dummy argument that does not
> have the POINTER or ALLOCATABLE attribute should be one.
> EDIT to TS29113:
> In section 6.3, end of para 1, insert
> "If the actual argument is a non-pointer non-allocatable array, the
> lower bounds of the dummy argument have the value one."
> FIXME: corresponding edit in section 9.7 is needed."
>
>
> An assumed-rank entity is a nonallocatable and nonpointer entity.
>
> No, it is also permitted for it to have the POINTER or ALLOCATABLE
> attribute.
>
> In F2008 standard, An array with the POINTER or ALLOCATABLE attribute
> shall have deferred-shape-spec-list by
>
> C532 An array with the POINTER or ALLOCATABLE attribute shall have an
> array-spec that is a deferred-shape-spec-list.
>
> I didn't find any edit to this constraint to allow assumed-rank to be
> pointer or allocatable. Should there be an edit? Even an assumed-rank
> dummy argument can be pointer or allocatable, should the edit to 6.3 be
> read "If the dummy argument is  a non-pointer non-allocatable...."
>
> As long as the corresponding actual argument is an array, the lower
> bounds of the assumed-rank dummy argument have the value one.
> I am not sure if the proposed edit to 6.3 covers this as if the dummy
> argument is not assumed-rank, for instance, it can be explicit shape
> with low bounds declared other than one.
>
> To my understanding, all restrictions in paragraph 1 of 6.3 presuppose
> assumed-rank dummy entities.
>
>
>
> Daniel
>
>
> XL Fortran Development - IBM Toronto Software Lab
> Phone: 905-413-3056
> Tie: 969-3056
> Email: _cdchen@ca.ibm.com_ <mailto:cdchen@ca.ibm.com>_
> __http://www.ibm.com/software/awdtools/fortran/xlfortran_
>
> Inactive hide details for "Bader, Reinhold" ---05/27/2013
> 15:50:16---Hello Bill, based on Tobias' implementation experience
> as"Bader, Reinhold" ---05/27/2013 15:50:16---Hello Bill,  based on
> Tobias' implementation experience as well as observations by others, I
> have as
>
> From: "Bader, Reinhold" <_Reinhold.Bader@lrz.de_
> <mailto:Reinhold.Bader@lrz.de>>
> To: Bill Long <_longb@cray.com_ <mailto:longb@cray.com>>,
> Cc: WG5 <_sc22wg5@open-std.org_ <mailto:sc22wg5@open-std.org>>
> Date: 05/27/2013 15:50
> Subject: (j3.2006) (SC22WG5.5001) Corrections to TS29113
> Sent by: _j3-bounces@mailman.j3-fortran.org_
> <mailto:j3-bounces@mailman.j3-fortran.org>
>
> ------------------------------------------------------------------------
>
>
>
>
> Hello Bill,
>
> based on Tobias' implementation experience as well as observations by
> others, I have assembled
> a "fix paper draft" for a number of glitches and omissions to the
> interop TS. Since you were going to write a
> paper on a minor extension anyway (cf. item "D" in the attached draft),
> the question is whether to
> put all this into one paper, or to write a number of separate ones.
> Furthermore, feedback on the
> suggestions in the draft is welcome.
>
> Best wishes
> Reinhold
>
>
> [attachment "ts29113_corrections.txt" deleted by Daniel C
> Chen/Toronto/IBM] _______________________________________________
> J3 mailing list_
> __J3@mailman.j3-fortran.org_ <mailto:J3@mailman.j3-fortran.org>_
> __http://mailman.j3-fortran.org/mailman/listinfo/j3________________________________________________
> J3 mailing list
> J3@mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3
>
>
>
> _______________________________________________
> J3 mailing list
> J3@mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3
>

-- 
Bill Long                                           longb@cray.com
Fortran Technical Support    &                 voice: 651-605-9024
Bioinformatics Software Development            fax:   651-605-9142
Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101


