From owner-sc22wg5@open-std.org  Wed Dec 10 05:50:44 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 E659DCA343D; Wed, 10 Dec 2008 05:50:44 +0100 (CET)
X-Original-To: sc22wg5@open-std.org
Delivered-To: sc22wg5@open-std.org
Received: from nspiron-2.llnl.gov (nspiron-2.llnl.gov [128.115.41.82])
	by www2.open-std.org (Postfix) with ESMTP id 04035C178E6
	for <sc22wg5@open-std.org>; Wed, 10 Dec 2008 05:50:43 +0100 (CET)
X-Attachments: None
Received: from vpna-user-128-15-244-108.llnl.gov (HELO [128.15.244.108]) ([128.15.244.108])
  by nspiron-2.llnl.gov with ESMTP; 09 Dec 2008 20:50:41 -0800
Message-ID: <493F4AA1.4060204@llnl.gov>
Date: Tue, 09 Dec 2008 20:50:41 -0800
From: Aleksandar Donev <donev1@llnl.gov>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.8) Gecko/20071009 SeaMonkey/1.1.5
MIME-Version: 1.0
To: WG5 <sc22wg5@open-std.org>
Subject: Re: (j3.2006) (SC22WG5.3807)   Response on the TR29113 draft N1761
References: <20081209223135.06FA6C178D6@www2.open-std.org>
In-Reply-To: <20081209223135.06FA6C178D6@www2.open-std.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Sender: owner-sc22wg5@open-std.org
Precedence: bulk

Hi,

Concerning the question of whether it is intended to have only a single 
Fortran descriptor (constant size) with just the fields changing for 
different arrays: The intention was to not impose any particular choice. 
The Fortran descriptors are opaque. Certainly it was intended that the 
descriptors could be different (including byte count) for different ranks.

> You are referring to the case I described above ('construct_foo_c'),
> suppressing which seems to make excellent sense at this point.
I guess I still don't get it. I am referring to this example:

subroutine sub(x) bind(c) ! External procedure
    real :: x(:)
end subroutine

program test
   interface
      subroutine sub(x) bind(c) ! External procedure
        real :: x(:)
      end subroutine
   end interface

   call sub(x) ! This will call two wrappers twice
end program

Did you intend to make this illegal? If yes, that seems contentious. If 
not, how would it skip the wrappers if the compiler has no clue that the 
procedure is actually written in C nor does it know the "local Fortran 
name"?

> What does the C function pass to the wrapper for arguments not
> present?
> If the C function call passes NULL
OK, that is what I wasn't sure about. How does this resolve the issue of 
  VALUE+OPTIONAL then?

> True. But we'd then need to change the semantics of DIMENSION(*)
> in *generic interfaces*, and I don't see how this can be done while
> maintaining backward compatibility, *especially* if the scalar case
> is included. Some existing code could become invalid.
You are right. So now the question is: Is being able to use generic 
interfaces enough to justify adding the new concept of 
assumed-rank-and-size? Of course it would be better, but is it worth it. 
I think so, but all of WG5 ought to be convinced.

Best,
Aleks

-- 
Aleksandar Donev, Ph.D.
Lawrence Postdoctoral Fellow @ Lawrence Livermore National Laboratory
High Performance Computational Materials Science and Chemistry
E-mail: donev1@llnl.gov
Phone: (925) 424-6816  Fax: (925) 423-0785
Address: P.O.Box 808, L-367, Livermore, CA 94551-9900
Web: http://cherrypit.princeton.edu/donev
