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

Position-dependent explicit interface?

John4
Valued Contributor I
831 Views

Hi,

When I try to compile the code below, I get an error stating that the specified interface (for the procedure func) is not declared. But if I place the "square" function right before "loopOverFunc" then I get no error (although I get a misleading warning regarding the result of the "square" function). Is it a bug in the compiler or the intended behavior?

module mod1

implicit none

contains
!------------------------------------------------------------------------------
function loopOverFunc(func, array) result(sq)
procedure(square) :: func
integer, intent(IN) :: array(:)
integer :: sq(SIZE(array))
integer :: i
continue
do i = 1, SIZE(array)
sq(i) = func(array(i))
enddo

end function
!------------------------------------------------------------------------------
elemental function square(a) result(sq)
integer :: sq
integer, intent(IN) :: a

continue
sq = a ** 2
end function

end module mod1

0 Kudos
1 Solution
Steven_L_Intel1
Employee
831 Views
These issues have been fixed in our sources. The fix should appear in 11.1 Update 5, scheduled for mid-February.

View solution in original post

0 Kudos
4 Replies
Steven_L_Intel1
Employee
831 Views
Looks like a bug or two - we'll investigate.
0 Kudos
Steven_L_Intel1
Employee
831 Views
Both issues have been escalated as DPD200141623.
0 Kudos
Steven_L_Intel1
Employee
832 Views
These issues have been fixed in our sources. The fix should appear in 11.1 Update 5, scheduled for mid-February.
0 Kudos
Steven_L_Intel1
Employee
831 Views
Fixed in 11.1 Update 6, available now.
0 Kudos
Reply