From owner-sc22wg5@dkuug.dk  Thu Jun 19 18:53:52 2003
Received: (from majordom@localhost)
	by dkuug.dk (8.12.8p1/8.9.2) id h5JGrqvI022049
	for sc22wg5-domo; Thu, 19 Jun 2003 18:53:52 +0200 (CEST)
	(envelope-from owner-sc22wg5@dkuug.dk)
X-Authentication-Warning: ptah.dkuug.dk: majordom set sender to owner-sc22wg5@dkuug.dk using -f
Received: from inf.rl.ac.uk (nfs7.inf.rl.ac.uk [130.246.72.7])
	by dkuug.dk (8.12.8p1/8.9.2) with ESMTP id h5JGrkEc022044
	for <sc22wg5@dkuug.dk>; Thu, 19 Jun 2003 18:53:48 +0200 (CEST)
	(envelope-from j.k.reid@rl.ac.uk)
Received: from numerical.cc.rl.ac.uk (numerical [130.246.8.23])
	by inf.rl.ac.uk (8.11.6+Sun/8.8.8) with ESMTP id h5JGprD24537
	for <sc22wg5@dkuug.dk>; Thu, 19 Jun 2003 17:51:53 +0100 (BST)
Received: from rl.ac.uk (jkr.cse.rl.ac.uk [130.246.9.202])
	by numerical.cc.rl.ac.uk (8.8.8+Sun/8.8.8) with ESMTP id SAA27246
	for <sc22wg5@dkuug.dk>; Thu, 19 Jun 2003 18:02:32 +0100 (BST)
Message-ID: <3EF1EBA1.8060205@rl.ac.uk>
Date: Thu, 19 Jun 2003 17:58:09 +0100
From: John Reid <j.k.reid@rl.ac.uk>
Reply-To: j.k.reid@rl.ac.uk
Organization: Rutherford Appleton Laboratory
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: WG5 <sc22wg5@dkuug.dk>
Subject: [Fwd: Re: (SC22WG5.2781) Modules TR (fwd)]
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sender: owner-sc22wg5@dkuug.dk
Precedence: bulk



Aleksandar Donev wrote:
 >Lawrie's original example in his J3 paper on the proposal was more
 >convincing and I am not sure if it would compile or not under Van's
 >draft. Something like a dummy argument for a separate procedure declared
 >with
 >
 >REAL, DIMENSION(N) :: x
 >
 >where N is a parameter in the module which is overwritten in the
 >submodule with a different value. Which N is the dimension of X
 >referring to? Although technically this may lead to different interfaces
 >(does the exact dimension of a dummy array argument matter?), I doubt a
 >compiler would catch that.

What, like the program:

    program junk
      interface
        subroutine s(a)
          real a(10)
        end subroutine
      end interface
      real x(20)
      call s(x)
    end
    subroutine s(q)
      real q(20)
      q = 0
    end

For which an existing implementation produces:

    Error: junk.f90: Inconsistent INTERFACE block for procedure S from JUNK
           Argument Q (no. 1) has a different array size

Van Snyder further wrote:
 >is allowed, and would not be caught, because the extent of an
 >explicit-shape dummy argument is not a characteristic.

Not so. I quote
   "The characteristics of a dummy data object are ... its shape ..."

So not only the total size, but the rank and extent in each dimension are
characteristics.  Indeed,  if an array bound
   "is not an initialization expression, the exact dependence on
    the entities in the expression is a characteristic"

This one is less likely to be thoroughly checked but is a requirement on
the user program nonetheless.

Cheers,
-- 
...........................Malcolm Cohen, NAG Ltd., Oxford, U.K.
                            (malcolm@nag.co.uk)


