(j3.2006) Suggestion for Fortran 201x: Adding support for ignoring the TKR of the actual argument
Bill Long
longb
Mon Mar 4 09:08:44 EST 2013
On 3/3/13 9:05 PM, Malcolm Cohen wrote:
>> Secondly, and that's a much bigger issue: If I use a generic interface,
>> "dimension(*)" will cease to accept arrays of any rank. Thus, I have to
>> add a scalar version and one array version per rank.
>
> So don't use a generic then.
I agree that the generics have problems.
>
>> First, having two "void *buffer" arguments might also occur.
>
> This is a solved problem, just use C_PTR and C_LOC. You don't even need the TS
> features for this. Admittedly each call is a little uglier, but it's not that
> big a deal.
I think the main problem is that the MPI 3 interfaces are using
type(*),dimension(*) assuming this matches a void * C function formal
parameter. It does for array actual arguments, but fails for the one
case of a scalar dummy argument. We "fixed" the scalar dummy argument
problem for the assumed-rank case / descriptor case, but not for the
assumed-size/void * case.
While it is a kluge, this could be fixed by modifying the rules such
that a scalar actual argument that is not an array element can
correspond to a rank-one assumed-size dummy argument in an interface
with BIND(C). The assumed size of the dummy would be 1 in this case.
Cheers,
Bill
>
> Cheers,
>
--
Bill Long longb at cray.com
Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9142
Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101
More information about the J3
mailing list