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

An array Temporary

ferrad01
Beginner
526 Views

I get the following warning message:

forrtl: warning (402): fort: (1): In call to SOLINT, an array temporary was created for argument #2:

call solint(tdtab(1:nsoltab),ytabval(1:3*layrs+3,1:nsoltab),
& nsoltab,td,yintval(1:3*layrs+3),3*layrs+3)
...

SUBROUTINE SOLINT(X,Y,N,XX,YY,M)
INTEGER M,N
REAL*8 X(n),Y(m,n),XX,YY(m)

I presume this is because the array ytabval is not passed as a contiguous array, whereas it is expected as such in the called subroutine. Should I pass the full array instead?

Adrian

0 Kudos
1 Reply
Steven_L_Intel1
Employee
526 Views

You're passing a non-contiguous array slice, and as you say, the called routine expects a contiguous array. Passing the whole array would change the meaning of the program, wouldn't it? Yes, that would eliminate the temporary.

Another option is to declare the argument in Y as Y(:,:) and make an explicit interface available. This will avoid a temp (but will then slow down SOLINT somewhat.) You'll have to decide which is preferable.

0 Kudos
Reply