diff --git a/src/ZSOLVER/tensorproductmultigrid_Source/communication.f90 b/src/ZSOLVER/tensorproductmultigrid_Source/communication.f90 index bb9003ede850faeffabe03ae665001dd6ec3911f..77f0f54eea9d6a6d4963233f27d48f212c42af38 100644 --- a/src/ZSOLVER/tensorproductmultigrid_Source/communication.f90 +++ b/src/ZSOLVER/tensorproductmultigrid_Source/communication.f90 @@ -697,6 +697,8 @@ contains integer :: icompx_max,icompy_max real , dimension(:,:,:) , pointer , contiguous :: za_st + + integer :: nib,nie,njb,nje,nzb,nze ! Update Real Boundary for Newman case u(0) = u(1) , etc ... @@ -728,31 +730,45 @@ contains icompx_max = a%icompx_max icompy_max = a%icompy_max - !$acc kernels - if ( ix_min == 1 ) then - !acc kernels - za_st(0,:,:) = za_st(1,:,:) - !acc end kernels - endif - if ( ix_max == n ) then - !acc kernels - za_st(icompx_max+1,:,:) = za_st(icompx_max,:,:) - !acc end kernels - endif - if ( iy_min == 1 ) then - !acc kernels - za_st(:,0,:) = za_st(:,1,:) - !acc end kernels - endif - if ( iy_max == n ) then - !acc kernels - za_st(:,icompy_max+1,:) = za_st(:,icompy_max,:) - !acc end kernels - endif - !$acc end kernels - + nib = Lbound(za_st,1) ; nie = Ubound(za_st,1) + njb = Lbound(za_st,2) ; nje = Ubound(za_st,2) + nzb = Lbound(za_st,3) ; nze = Ubound(za_st,3) + + call boundary_mnh_dim(za_st) + endif + contains + subroutine boundary_mnh_dim(pza_st) + implicit none + + real :: pza_st(nib:nie,njb:nje,nzb:nze) + + !$acc kernels + if ( ix_min == 1 ) then + !acc kernels + pza_st(0,:,:) = pza_st(1,:,:) + !acc end kernels + endif + if ( ix_max == n ) then + !acc kernels + pza_st(icompx_max+1,:,:) = pza_st(icompx_max,:,:) + !acc end kernels + endif + if ( iy_min == 1 ) then + !acc kernels + pza_st(:,0,:) = pza_st(:,1,:) + !acc end kernels + endif + if ( iy_max == n ) then + !acc kernels + pza_st(:,icompy_max+1,:) = pza_st(:,icompy_max,:) + !acc end kernels + endif + !$acc end kernels + + end subroutine boundary_mnh_dim + end subroutine boundary_mnh !================================================================== ! Initiate asynchronous halo exchange