From owner-sc22wg5@open-std.org  Tue Dec  9 21:50:32 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 2F60BCA343D; Tue,  9 Dec 2008 21:50:32 +0100 (CET)
X-Original-To: sc22wg5@open-std.org
Delivered-To: sc22wg5@open-std.org
Received: from mail.jpl.nasa.gov (sentrion2.jpl.nasa.gov [128.149.139.106])
	by www2.open-std.org (Postfix) with ESMTP id 2DFADCA3439
	for <sc22wg5@open-std.org>; Tue,  9 Dec 2008 21:50:29 +0100 (CET)
Received: from mprox2.jpl.nasa.gov (mprox2.jpl.nasa.gov [137.78.160.141])
	by mail.jpl.nasa.gov (Switch-3.3.2mp/Switch-3.3.2mp) with ESMTP id mB9KoQ7a011943
	for <sc22wg5@open-std.org>; Tue, 9 Dec 2008 20:50:26 GMT
Received: from [137.79.7.57] (math.jpl.nasa.gov [137.79.7.57])
	(authenticated bits=0)
	by mprox2.jpl.nasa.gov (Switch-3.2.6/Switch-3.2.6) with ESMTP id mB9KoOQh017777
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <sc22wg5@open-std.org>; Tue, 9 Dec 2008 12:50:24 -0800
Subject: Re: (j3.2006) (SC22WG5.3802) [ukfortran]    N1761,
	TYPE(*),	BIND(C) and arrays
From: Van Snyder <Van.Snyder@jpl.nasa.gov>
Reply-To: Van.Snyder@jpl.nasa.gov
To: WG5 <sc22wg5@open-std.org>
In-Reply-To: <20081209203233.1E8AFCA3439@www2.open-std.org>
References: <20081127193527.EF00DC178D9@www2.open-std.org>
	 <20081209172327.D05AFC178D6@www2.open-std.org>
	 <20081209184656.288E8CA3439@www2.open-std.org>
	 <20081209185450.B4B95CA3439@www2.open-std.org>
	 <20081209203233.1E8AFCA3439@www2.open-std.org>
Content-Type: text/plain
Organization: Yes
Date: Tue, 09 Dec 2008 12:50:24 -0800
Message-Id: <1228855824.15904.965.camel@math.jpl.nasa.gov>
Mime-Version: 1.0
X-Mailer: Evolution 2.12.3 (2.12.3-8.el5_2.2) 
Content-Transfer-Encoding: 7bit
X-Source-IP: math.jpl.nasa.gov [137.79.7.57]
X-Source-Sender: Van.Snyder@jpl.nasa.gov
X-AUTH: Authorized
Sender: owner-sc22wg5@open-std.org
Precedence: bulk


On Tue, 2008-12-09 at 12:32 -0800, N.M. Maclaren wrote:
> Bill keeps talking C calling Fortran.  Fine.  In THAT case, I agree
> that all of the arguments are dummy arguments.  That isn't the issue.
> What about the case of Fortran calling C?  PLEASE take a look at that
> program and consider the issues.

Fortran argument-passing conventions are based entirely upon the
specifications of the dummy arguments, which is why certain forms of
them require explicit interface -- so the processor can do the right
thing when compiling the calling program unit.

I assume "that program" refers to the one in SC22WG5 message 3787 -- the
one with the module named mudpuddle and the C interface named slough.

That interface has an assumed-rank dummy argument

The TR says that assumed-rank dummy arguments are passed by descriptor,
and that the appearance of an assumed-rank dummy argument requires
explicit interface..

So long as the processor can see the interface at the point of the call,
which it can because you put in an appropriate USE statement, it can
build the actual argument descriptors correctly, that is, so they are
what the called procedure expects in its dummy arguments.

Therefore, none of the examples in the program are problematical.

-- 
Van Snyder                    |  What fraction of Americans believe 
Van.Snyder@jpl.nasa.gov       |  Wrestling is real and NASA is fake?
Any alleged opinions are my own and have not been approved or
disapproved by JPL, CalTech, NASA, the President, or anybody else.

