From owner-sc22wg5@open-std.org  Tue Nov 11 09:33:58 2008
Return-Path: <owner-sc22wg5@open-std.org>
X-Original-To: sc22wg5-dom7
Delivered-To: sc22wg5-dom7@www2.open-std.org
Received: by www2.open-std.org (Postfix, from userid 521)
	id 44A1CC178DC; Tue, 11 Nov 2008 09:33:58 +0100 (CET)
X-Original-To: sc22wg5@open-std.org
Delivered-To: sc22wg5@open-std.org
Received: from ns.nag-j.co.jp (218-42-159-107.cust.bit-drive.ne.jp [218.42.159.107])
	by www2.open-std.org (Postfix) with ESMTP id 2185BC178D9
	for <sc22wg5@open-std.org>; Tue, 11 Nov 2008 09:33:55 +0100 (CET)
Received: from 218-42-159-108.cust.bit-drive.ne.jp ([218.42.159.108] helo=[127.0.0.1])
	by ns.nag-j.co.jp with esmtp (Exim 4.50)
	id 1Kzogy-0005CP-9c
	for sc22wg5@open-std.org; Tue, 11 Nov 2008 17:33:44 +0900
Message-ID: <491943B1.2070904@nag-j.co.jp>
Date: Tue, 11 Nov 2008 17:34:57 +0900
From: Malcolm Cohen <malcolm@nag-j.co.jp>
User-Agent: Thunderbird 3.0a1pre (Windows/2008022014)
MIME-Version: 1.0
To: WG5 <sc22wg5@open-std.org>
Subject: Re: (j3.2006) (SC22WG5.3653) [ukfortran] FW: Notes on WG5 coarray
 papers
References: <49137AD3.1070402@lrz.de>	<20081110124449.AEBF1C178E0@www2.open-std.org>	<20081111030258.C9550C178D9@www2.open-std.org> <49193B79.8030807@lrz.de>
In-Reply-To: <49193B79.8030807@lrz.de>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Sender: owner-sc22wg5@open-std.org
Precedence: bulk

Hi folks,

Reinhold Bader wrote:
>
> [discussion on restriction I want but cannot get]
>
> Do you think this is then only a matter of telling users
> "don't use volatile (array, derived type) coarrays thusly" or
> something which needs fixing in the standard in a more
> appropriate manner than suggested by me?
>   
Probably more the latter than the former.  I usually prefer to have less 
ambiguity in my standards.
>>> Example 2.4 ("Protected Context") is non-conforming since the cited
>>> restriction is violated by the object in question being VOLATILE within
>>> the scope of the DO loop. This would apply even if the CASE(1) statements
>>> were not present.
>>>
>>>       
>> There is no restriction that says a DO index variable cannot have the
>> VOLATILE attribute, and the "cited restriction" does not even mention
>> VOLATILE.  So I cannot agree with your reasoning.  (In fact I think the
>> example is conforming when used as described in the paper.)
>>     
>
> I don't agree with that one. Referring to 08-007r2, we have
>
> 5.3.19 para1: The VOLATILE attribute specifies that an object may be referenced,
>                        defined, or become undefined, by means not specified by the program,
>                        or by another image without synchronization.
>
> so if the DO index variable is volatile, it will by virtue of its volatility violate the cited
> restriction, won't it?
No.

It only violates the restriction if it actually *IS*  defined etc.

This is not a static restriction but a dynamic one.
>  Or do you consider the program conforming (statistically
> conforming?) as long as simply by chance the index isn't stomped on by anyone
> else while DO executes?
>   
That is *EXACTLY* what those words mean.

Like in the Fortran 90 program snippet

   INTEGER x(100)
   EQUIVALENCE(x(50),i)
   x = 0
   DO i=1,10
     READ *,j
     x(j) = i
   END DO

That is not conforming if the user types in a number <1 or >100 
(subscript error) or ==50 (updating a DO index error); it is conforming 
otherwise.

Cheers,
-- 
.........................Malcolm Cohen, Nihon NAG, Tokyo.


