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

do concurrent in pure subroutine

briggart
Beginner
437 Views

When I try to compile the following program with ifort 12.1.3 20120212, I get

test_concurrent.f90(25): error #7617: This host associated object appears in a 'defining' context in a PURE procedure or in an internal procedure contained in a PURE procedure.
do concurrent(i=1:n)
------------------^
test_concurrent.f90(26): error #7617: This host associated object appears in a 'defining' context in a PURE procedure or in an internal procedure contained in a PURE procedure. [PROD]
prod%d(i) = x%d(i)*y%d(i)
-------^
compilation aborted for test.f90 (code 1)

I can't see what I'm doing wrong, thanks for any suggestion!
Loris



[fortran]module test_type implicit none type :: t1 real ,allocatable :: d(:) end type t1 interface operator(*) module procedure t1_times_t1 end interface private t1_times_t1 contains elemental function t1_times_t1(x,y) result(prod) type(t1) ,intent(in) :: x,y type(t1) :: prod integer :: i,n n = size(x%d) allocate(prod%d(n)) do concurrent(i=1:n) prod%d(i) = x%d(i)*y%d(i) end do end function t1_times_t1 end module test_type program test use test_type implicit none integer ,parameter :: ns = 16, np = 12*ns**2 type(t1) :: x,y,z allocate(x%d(np),y%d(np)) x%d = 2. y%d = 0.5 z = x*y print*,sum(z%d)/np end program test [/fortran]

0 Kudos
2 Replies
Ron_Green
Moderator
438 Views
This appears to be a bug in the compiler. I have entered a bug report, the tracking ID is DPD200233820

thank you for sending this to us.

ron
0 Kudos
Ron_Green
Moderator
438 Views
This bug will have a fix in an upcoming update release, Composer XE 2013 Update 1. This should be available sometime in the next month. Thank you for helping us improve our compiler. ron
0 Kudos
Reply