Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Error 7836

dajum
Novice
559 Views
I'm getting the error from the following situation (greatly simplified from the actual code)
A is declared in a module with
REAL, ALLOCATABLE :: A(:)

I'm trying to pass in the first element of a subset of the array

CALL SUB(A(9))

SUB is defined with an interface spec
INTERFACE
SUBROUTINE SUB(A)
REAL,INTENT(IN) :: A(*)
END SUBROUTINE
END INTERFACE

I'd like to make this work from the interface spec but I can't seem to figure out how.

This works
CALL SUB([A(9)])
But is much harder to implement.So is it possible to tell the compiler this is okay (without changing compiler settings)?

I'm gather from reading all the various posts on this error that A may not be contiguous in memory. Is that true?

Thanks,

Dave

0 Kudos
1 Reply
Steven_L_Intel1
Employee
559 Views
The text of that diagnostic is: If the actual argument is scalar, the corresponding dummy argument shall be scalar unless the actual argument is an element of an array that is not an assumed-shape or pointer array, or a substring of such an element.

Is A really ALLOCATABLE or is it a POINTER? The error makes sense if it is POINTER, not if it is ALLOCATABLE.

Assuming that it is POINTER, the problem is that A(9) and A(10) may not be contiguous, thus "sequence association" is not allowed for pointer arrays. I discussed this topic here.
0 Kudos
Reply