From owner-sc22wg5@open-std.org  Mon Jun  6 00:40:06 2011
Return-Path: <owner-sc22wg5@open-std.org>
X-Original-To: sc22wg5-dom8
Delivered-To: sc22wg5-dom8@www2.open-std.org
Received: by www2.open-std.org (Postfix, from userid 521)
	id 653ABC178E5; Mon,  6 Jun 2011 00:40:06 +0200 (CET DST)
X-Original-To: sc22wg5@open-std.org
Delivered-To: sc22wg5@open-std.org
Received: from mailrelay2.lrz-muenchen.de (mailrelay2.lrz-muenchen.de [129.187.254.102])
	by www2.open-std.org (Postfix) with ESMTP id AE59BC178E3
	for <sc22wg5@open-std.org>; Mon,  6 Jun 2011 00:40:04 +0200 (CET DST)
Received: from postout2.mail.lrz.de ([10.156.6.19] [10.156.6.19]) by mailrelay2.lrz-muenchen.de with ESMTP for sc22wg5@open-std.org; Mon, 6 Jun 2011 00:39:32 +0200
Received: from BADWLRZ-SWHBT2.ads.mwn.de (BADWLRZ-SWHBT2.ads.mwn.de [IPv6:2001:4ca0:0:108::126])
	(using TLSv1 with cipher AES128-SHA (128/128 bits))
	(No client certificate requested)
	by postout2.mail.lrz.de (Postfix) with ESMTPS id 40317ABC82
	for <sc22wg5@open-std.org>; Mon,  6 Jun 2011 00:39:32 +0200 (CEST)
Received: from BADWLRZ-SWMBX1.ads.mwn.de ([fe80::11b4:b130:c4e2:2d0e]) by
 BADWLRZ-SWHBT2.ads.mwn.de ([fe80::5951:9dc3:7b2b:14ba%14]) with mapi id
 14.01.0289.001; Mon, 6 Jun 2011 00:39:32 +0200
From: "Bader, Reinhold" <Reinhold.Bader@lrz.de>
To: WG5 <sc22wg5@open-std.org>
Subject: Question on CONTIGUOUS
Thread-Topic: Question on CONTIGUOUS
Thread-Index: Acwjz7aVy8DIG2k6QBWFxVJKaUzPVQ==
Date: Sun, 5 Jun 2011 22:39:31 +0000
Message-Id: <166ED263DF83324D9A3BA67FB6772B2B1248D1C1@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.215]
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, =0A=
=0A=
Consider the following program:=0A=
=0A=
module mod_cont=0A=
contains=0A=
  subroutine fcont(x)=0A=
    real, contiguous :: x(:)=0A=
    integer :: i=0A=
    x =3D (/ (real(i),i=3D1,size(x)) /)=0A=
  end subroutine fcont=0A=
end module mod_cont=0A=
program cont=0A=
  use mod_cont=0A=
  implicit none=0A=
  real :: x(45)=0A=
=0A=
  call fcont(x(1::3))=0A=
=0A=
end program=0A=
=0A=
Question: Does this program conform to the Fortran 2008 standard?=0A=
=0A=
Reason: Of three compilers that accept the CONTIGUOUS attribute, one=0A=
rejects the above, and two accept it. Given 5.3.7 para 1 I would tend to =
=0A=
conclude that the code is invalid. =0A=
=0A=
=0A=
 From a usability point of view I'd consider it a nice feature if the proce=
ssor would=0A=
 do the necessary copy-in/out if the actual argument is non-contiguous. If =
the code=0A=
 is deemed invalid - why was it decided to not support this?=0A=
 =0A=
Regards=0A=
Reinhold=0A=
