Intel® Fortran Compiler 16.0 User and Reference Guide

Handling Fortran Array Pointers and Allocatable Arrays

When a Standard Fortran array pointer or array is passed to another language, either its descriptor or its base address can be passed.

The following affects how Standard Fortran array pointers and arrays are passed:

If the INTERFACE declares the array pointer or array with deferred shape (for example, ARRAY(:)), its descriptor is passed. If the INTERFACE declares the array pointer or array with fixed shape, or if there is no interface, the array pointer or array is passed by base address as a contiguous array, which is like passing the first element of an array for contiguous array slices.

Use of the REFERENCE attribute on an array has no effect. Additionally, the VALUE attribute cannot be used with array arguments.

When you pass a Fortran array pointer or an array by descriptor to a non-Fortran routine, that routine needs to know how to interpret the descriptor. Part of the descriptor is a pointer to address space, such as a C pointer, and part of it is a description of the pointer or array properties, such as its rank, stride, and bounds.

For information about the Intel Fortran array descriptor format, see Handling Fortran Array Descriptors.

Standard Fortran array pointers and assumed-shape arrays are passed by passing the address of the array descriptor.

Standard Fortran pointers that point to scalar data contain the address of the data and are not passed by descriptor.