Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29004 Discussions

Explicit interface for structures and allocatable arrays

OP1
New Contributor III
636 Views

When a subroutine has a dummy array with the ALLOCATABLE attribute, an explicit interface is required.

If a subroutine has a dummy variable which is a user defined structure (TYPE(my_structure) for instance), and if one of this structure's component is an allocatable array, then no explicit interface is required.

Why is there a difference?

[BTW: these two features (allocatable dummy argument and allocatable structure component) are an extremely welcome addition to the Fortran language!!]

Olivier

0 Kudos
1 Solution
Steven_L_Intel1
Employee
636 Views

An allocatable array argument is always deferred-shape which requires an explicit interface so that the descriptor can be passed. For a derived type with allocatable components, it could be a fixed-shape array which does not require an interface.

View solution in original post

0 Kudos
2 Replies
Steven_L_Intel1
Employee
637 Views

An allocatable array argument is always deferred-shape which requires an explicit interface so that the descriptor can be passed. For a derived type with allocatable components, it could be a fixed-shape array which does not require an interface.

0 Kudos
OP1
New Contributor III
636 Views

An allocatable array argument is always deferred-shape which requires an explicit interface so that the descriptor can be passed. For a derived type with allocatable components, it could be a fixed-shape array which does not require an interface.

Thanks Steve!
0 Kudos
Reply