(j3.2006) TYPE(*) and scalars

Bader, Reinhold Reinhold.Bader
Wed Mar 21 14:35:25 EDT 2012


Hello, 


[...]
> 
> 
> It should be possible to work around this.  If the "known interface
> name" is foo, then
> 
> interface foo
>   subroutine bar1 (x) bind(C, name="cbar")
>     type(*) :: x
>   end subroutine bar1
>   subroutine bar2 (x) bind(C, name="cbar")
>     type(*),dimension(*) :: x
>   end subroutine bar2
> end interface
> 
> will work.  The specifics are distinguishable because of the rank
> distinction, independent of the types.  Since you can map both of them
> to the same C routine, there is no need to have extra C wrappers.  On
> the C side, the corresponding formal parameter is (void *), which is
> valid for either specific.

Unfortunately, this will not quite solve the problem, because it now is not possible any more
to process rank 2 and higher arrays - as soon as you put a DIMENSION(*) dummy into a generic
interface, exact rank matching of actual with dummy will be required. I guess one could add
interfaces with 

type(*),dimension(1,*) :: x
type(*),dimension(1,1,*) :: x

etc. though.

Regards
Reinhold

> 
> Cheers,
> Bill
> 
> > FYI.  We have released a tarball for the Open MPI implementation of the new
> MPI-3 Fortran standard.  In case there are any vendors who wish to try this beta
> please let Jeff Squyres know.  Several vendors have already tried this beta
> release and have fixed bugs in their compilers.
> >
> > -craig
> >
> >
> >
> >
> > _______________________________________________
> > J3 mailing list
> > J3 at j3-fortran.org
> > http://j3-fortran.org/mailman/listinfo/j3
> 
> --
> 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
> 
> 
> _______________________________________________
> J3 mailing list
> J3 at j3-fortran.org
> http://j3-fortran.org/mailman/listinfo/j3




More information about the J3 mailing list