Skip to content
Snippets Groups Projects
Commit 5ade1fcb authored by ESCOBAR Juan's avatar ESCOBAR Juan
Browse files

Juan 03/03/2022:ZSOLVER/dotprod.f90, for no MANAGED version , update variable before SUM_DD_R2_ll

parent 4ee00374
No related branches found
No related tags found
No related merge requests found
......@@ -88,6 +88,11 @@ USE MODE_ll
!JUAN
USE MODE_REPRO_SUM
!JUAN
#ifdef MNH_OPENACC
USE MODE_MNH_ZWORK, ONLY: MNH_MEM_GET, MNH_MEM_POSITION_PIN, MNH_MEM_RELEASE
#endif
!
USE MODE_MPPDB
!
IMPLICIT NONE
!
......@@ -118,13 +123,18 @@ INTEGER :: ILBXB,ILBYB,ILBXE,ILBYE ! loop indices depending on the
!
INTEGER :: IINFO_ll
!JUAN16
REAL, ALLOCATABLE, DIMENSION(:,:) :: ZDOTPROD
REAL, POINTER, CONTIGUOUS, DIMENSION(:,:) :: ZDOTPROD
!JUAN16
!
!-------------------------------------------------------------------------------
!
!* 1. COMPUTE LOOP BOUNDS
! -------------------
!-------------------
if ( mppdb_initialized ) then
!Check all in arrays
call Mppdb_check( PA, "Dotprod beg:PA" )
call Mppdb_check( PB, "Dotprod beg:PB" )
end if
!
CALL GET_INDICE_ll(IIB,IJB,IIE,IJE)
!
......@@ -167,8 +177,13 @@ ENDIF
! -----------------------
!
!JUAN16
#ifndef MNH_OPENACC
ALLOCATE(ZDOTPROD(ILBXB:ILBXE,ILBYB:ILBYE))
!$acc kernels
#else
CALL MNH_MEM_POSITION_PIN()
CALL MNH_MEM_GET(ZDOTPROD, ILBXB,ILBXE ,ILBYB,ILBYE )
#endif
!$acc kernels present(ZDOTPROD)
ZDOTPROD = 0.
!$acc loop seq
DO JK = IKB-1,IKE+1
......@@ -180,8 +195,14 @@ DO JK = IKB-1,IKE+1
END DO
END DO
!$acc end kernels
!$acc update host(ZDOTPROD)
PDOTPROD = SUM_DD_R2_ll(ZDOTPROD)
!JUAN16
#ifndef MNH_OPENACC
DEALLOCATE(ZDOTPROD)
#else
CALL MNH_MEM_RELEASE()
#endif
!
!-------------------------------------------------------------------------------
!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment