(j3.2006) (SC22WG5.3804) [ukfortran] N1761, TYPE(*), BIND(C) and arrays

Van Snyder Van.Snyder at jpl.nasa.gov
Tue Dec 9 15:50:24 EST 2008


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 at 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.



More information about the J3 mailing list