Aleksandar Donev wrote:
> Hi,
>
> I do not have time to elaborate on details, and that would probably be
> premature, but...the next revision of Fortran has several features in
> development that deal with this. In particular, Fortran 2008 will have
> macros, which can be used to generate the routines for different ranks
> and types automatically. It will also have pointer rank-remapping
> enhancements which will allow you to pass a 3-d contiguous array to a
> 1-d one without copying to a buffer (as PACK would likely do).
>
> In Fortran 2003, C pointers can be used to emulate void*. So, just
> declare the dummy argument as
> TYPE(C_PTR), VOID :: dummy
I assume you meant VALUE rather than VOID in the line above.
>
> and then use the intrinsic C_F_POINTER to convert this into a Fortran
> pointer of the appropriate type and rank and shape. This of course
> will introduce aliasing issues to deal with :-\
>
> Fortran 2003 also has CLASS(*), so-called unlimited polymorphic
> dummies, which can correspond to an actual of any type (but the rank
> cannot change, sadly, some of us tried to extend Fortran in this way
> but it is not easy...).
>
> Best,
> Aleks
>
--
Bill Long [log in to unmask]
Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9142
Cray Inc., 1340 Mendota Heights Rd., Mendota Heights, MN, 55120
|