> On Mar 8, 2018, at 8:32 AM, Anton Shterenlikht <[log in to unmask]> wrote:
> I think I also read somewhere that, at least
> with some compilers, an allocatable dummy
> is better performing than assumed-shape array.
> Maybe I'm wrong here?
Allocatable variables are always contiguous in memory, so can make vectorization easier for modern processors where there is a penalty for noncontiguous accesses. Assumed-shape arrays can be discontiguous, so optimization is harder. A solution is to specify the CONTIGUOUS attribute for the assumed-shape dummy, which reenables the optimization advantage of knowing the variable is contiguous. If you always call the procedure with actual arguments that are known contiguous, there is no call-site overhead associated with the CONTIGUOUS attribute on the corresponding dummy.
Bill Long [log in to unmask]
Principal Engineer, Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9143
Cray Inc./ 2131 Lindau Lane/ Suite 1000/ Bloomington, MN 55425