[pgi apm] prevent data transfer on sub calls

Hi

There is code below. Please say me how I can prevent data transfer on sub calls? When I use reflected(a) directive, I get segfault

Note: question is about PGI APM, not OpenACC. Compiler is pgfortran 11.5

	program test
	parameter (n = 100)
	double precision a(n,n,n)

!$acc data region copy(a)
	call foo(a,n)
	call goo(a,n)
!$acc end data region

	end
	

	subroutine foo(a,n)

	double precision a(n,n,n)
!$acc region
	do k = 1,n
	do j = 1,n
	do i = 1,n
    	  a(i,j,k) = ( 1. + i + j + k)
	end do
	end do
	end do
!$acc end region

	end

	subroutine goo(a,n)

	double precision a(n,n,n)
   	
!$acc region
	do k = 2,n-1
	do j = 2,n-1
	do i = 2,n-1
    	  a(i,j,k) = ( a(i-1,j,k) + a(i+1,j,k) ) / 2
	end do
	end do
	end do
!$acc end region

	end



$ pgfortran -V

pgfortran 11.5-0 64-bit target on x86-64 Linux -tp nehalem 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2011, STMicroelectronics, Inc.  All Rights Reserved.

Hi krvladislav,

Reflected is the correct method, however, your routines need to have interfaces to use it. The easiest thing to is put “foo” and “goo” into a module where an implicit interface will be created.

Hope this helps,
Mat

Thanks, Mat!