From owner-sc22wg5+sc22wg5-dom8=www.open-std.org@open-std.org  Wed Apr  6 11:39:06 2016
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 7D9949DB15B; Wed,  6 Apr 2016 11:38:30 +0200 (CEST)
Delivered-To: sc22wg5@open-std.org
Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46])
	(using TLSv1 with cipher RC4-SHA (128/128 bits))
	(No client certificate requested)
	by www.open-std.org (Postfix) with ESMTP id 25ECD356F47
	for <sc22wg5@open-std.org>; Wed,  6 Apr 2016 11:37:04 +0200 (CEST)
Received: by mail-wm0-f46.google.com with SMTP id f198so65195056wme.0
        for <sc22wg5@open-std.org>; Wed, 06 Apr 2016 02:37:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bris-ac-uk.20150623.gappssmtp.com; s=20150623;
        h=date:from:message-id:to:subject:cc:reply-to:in-reply-to;
        bh=qQGR/QlWl/sYMGylWqCdVIz4N9tqdDlKCrWDzw4x1Ls=;
        b=oH1GH+m8Azhi1bmmT8jjh6dFLoFsDyp+VuBmDPPmefGPYLBcwaTYFPgfWd6Z6OHAjR
         gNruGhdzzn6X/c0a5J9eDOFIVmDLQi761geiGXkhIlRgpsZPk4KzLu1afQ3PrlJWjxfc
         TtqS9LwdeGTIoA7TLojtePDjgU0YgCv0+o7Eazks4AP5zTkIbThvxvwBRSQOwPOihIFi
         Uht10UT3pVNeinatCRBCVfhKqJIuydDOHK2c3m75V9QzZV/fCTv/9+UuuO3Ej0ByzAxz
         G0WKac0r6h5Y54Et8/VahDAVq0E3Y6ydqoQLMGuAkNDfc0O/WOf/UdNsNiCKWcY0M8mm
         x0uQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:message-id:to:subject:cc:reply-to
         :in-reply-to;
        bh=qQGR/QlWl/sYMGylWqCdVIz4N9tqdDlKCrWDzw4x1Ls=;
        b=G8Ntw7RlwEldPv8X6fxITsLo6kSHfPPDaAPr/6BKOEGWgYq3A2/Ft9YyQl2uRWKK24
         jGYObJXDDaPOb/GFkRrcCN+Z1EZiouRMU8U4o49KRgM3/obpKDPK+HYnFUj7n8bf1FmP
         7edvpyiTMXWcAtRsWPN/zIf/FlNg4S+6m25UoKz4BGgnTph0KKO5mS8urR0xMN/Y+6JA
         LdZ9/Cf5ItWZS9zaTIW7baV4YwntgjF8mXRv9VUiLOwxlsIKEg8IIojTaMNCuURan9kQ
         OKpMG5jBtrOWU2A6VhaEKDlCuQRrEQMlXKomGVWI3wJhtzhB7buKlllWB8c3Z5G86SBZ
         Hbsw==
X-Gm-Message-State: AD7BkJIO4cNvzr1VUDFUOkKmLnavFWSCfRAatPbBWJiZ01cytdq9uK373wAoiZBCHh+l2PQW
X-Received: by 10.28.182.194 with SMTP id g185mr23274103wmf.41.1459935422572;
        Wed, 06 Apr 2016 02:37:02 -0700 (PDT)
Received: from mech-as222.men.bris.ac.uk (mech-as222.men.bris.ac.uk. [137.222.170.4])
        by smtp.gmail.com with ESMTPSA id c128sm23897302wma.11.2016.04.06.02.37.01
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 06 Apr 2016 02:37:02 -0700 (PDT)
Received: from mech-as222.men.bris.ac.uk (localhost [127.0.0.1])
	by mech-as222.men.bris.ac.uk (8.15.2/8.15.2) with ESMTP id u369b1UW065110;
	Wed, 6 Apr 2016 10:37:01 +0100 (BST)
	(envelope-from mexas@mech-as222.men.bris.ac.uk)
Received: (from mexas@localhost)
	by mech-as222.men.bris.ac.uk (8.15.2/8.15.2/Submit) id u369b0KT065107;
	Wed, 6 Apr 2016 10:37:00 +0100 (BST)
	(envelope-from mexas)
Date: Wed, 6 Apr 2016 10:37:00 +0100 (BST)
From: Anton Shterenlikht <mexas@bris.ac.uk>
Message-Id: <201604060937.u369b0KT065107@mech-as222.men.bris.ac.uk>
To: j3@mailman.j3-fortran.org, Reinhold.Bader@lrz.de
Subject: Re: [ukfortran] (SC22WG5.5699) AW: (j3.2006)  coarray dummy arguments
Cc: sc22wg5@open-std.org
Reply-To: mexas@bris.ac.uk
In-Reply-To: <20160405233438.6AE86358789@www.open-std.org>
Sender: owner-sc22wg5@open-std.org
Precedence: bulk

Hi Reinhold

Your example makes your point much clearer.
Still...

> Image 1:
> 
> INTEGER  ::  I[*] = 0
> 
> I[2] = I[2] + 1
> SYNC IMAGES( [1,2] )
> 
> Image 2:
> 
> INTEGER :: IL
> 
> CALL S1(I, IL)
> 
> The current text in the standard causes the above to be non-conforming
> for two reasons:
> 
> (1) the dummy argument A of procedure S1 is modified by a different
>     image, in violation of 12.5.2.13 para 3+4. Since the ability to do
>     such modifications is part of the coarray design, further
>     exceptions need to be added to the above paragraphs. The exceptions

I think this code violates [195:3-4].
Variable I is defined on image 1 and used on image 2
in the same segment, which is prohibited.
"I" is used on image 2 as actual argument when
calling subroutine S1. I believe that to conform,
SYNC IMAGES( [1,2] ) must appear before CALL S1(I, IL).

This seems to be related to the dummy variable issue
you are addressing. When you say that the ability to
modify a dummy argument by a different image is part
of the coarray design, I'm not sure.

Anton
