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

Passing slice of allocatable arrays through procedures

ljuba
Beginner
1,367 Views

Hello,

I have a problem with passing of allocatable arrays trough subroutines ona Intel Fortran Compiler 10. In my code i'm using a modules instead subroutines as solution for allocatable arrays. The problem occurs when i tried to move a slice of allocatable array into another module.My code isoriginaly from the CVF 6.6C(Compaq Visual Fortran 6.6C), where it works fine. But when i compile the same codewith theIntel Fortran Compiler 10 i get the message ''Error1 Error: If dummy arg is allocatable, actual arg must be a whole array and not a section''.Is anyone knows how can i resolve this problem, without changing the code.

Thanks in advance

0 Kudos
1 Reply
Steven_L_Intel1
Employee
1,367 Views
Without changing the code? No. Your code has an error and has to be fixed. The fix is to remove the ALLOCATABLE attribute on the dummy arguments in the called routines. There is no requirement to have that attribute passed along unless you plan to change the allocation status in the subroutine, in which case you obviously cannot pass a slice.
0 Kudos
Reply