Skip to content
Snippets Groups Projects
Commit 6be72dd3 authored by ESCOBAR MUNOZ Juan's avatar ESCOBAR MUNOZ Juan
Browse files

Juan 21/09/2021:pressurez.f90, rewrite boundaries with DO CONCURRENT + acc async/wait for GPU opt

parent 111dd0a9
No related branches found
No related tags found
No related merge requests found
......@@ -663,32 +663,33 @@ CALL GX_M_U_DEVICE(1,IKU,1,ZPHIT,PDXX,PDZZ,PDZX,ZDV_SOURCE)
IF ( GWEST ) THEN
!!!!!!!!!!!!!!!! FUJI compiler directive !!!!!!!!!!
!!!!!!!!!!!!!!!! FUJI compiler directive !!!!!!!!!!
!$acc kernels
DO JK=2,IKU-1
ZDV_SOURCE(IIB,:,JK)= &
(ZPHIT(IIB,:,JK) - ZPHIT(IIB-1,:,JK) - 0.5 * ( &
PDZX(IIB,:,JK) * (ZPHIT(IIB,:,JK)-ZPHIT(IIB,:,JK-1)) / PDZZ(IIB,:,JK) &
+PDZX(IIB,:,JK+1) * (ZPHIT(IIB,:,JK+1)-ZPHIT(IIB,:,JK)) / PDZZ(IIB,:,JK+1) &
!$acc kernels loop independent collapse(2) async
DO CONCURRENT (JJ=1:IJU , JK=2:IKU-1)
ZDV_SOURCE(IIB,JJ,JK)= &
(ZPHIT(IIB,JJ,JK) - ZPHIT(IIB-1,JJ,JK) - 0.5 * ( &
PDZX(IIB,JJ,JK) * (ZPHIT(IIB,JJ,JK)-ZPHIT(IIB,JJ,JK-1)) / PDZZ(IIB,JJ,JK) &
+PDZX(IIB,JJ,JK+1) * (ZPHIT(IIB,JJ,JK+1)-ZPHIT(IIB,JJ,JK)) / PDZZ(IIB,JJ,JK+1) &
) &
) / PDXX(IIB,:,JK)
) / PDXX(IIB,JJ,JK)
END DO
!$acc end kernels
ENDIF
!
IF( GEAST ) THEN
!$acc kernels
DO JK=2,IKU-1
ZDV_SOURCE(IIE+1,:,JK)= &
(ZPHIT(IIE+1,:,JK) - ZPHIT(IIE+1-1,:,JK) - 0.5 * ( &
PDZX(IIE+1,:,JK) * (ZPHIT(IIE+1-1,:,JK)-ZPHIT(IIE+1-1,:,JK-1)) &
/ PDZZ(IIE+1-1,:,JK) &
+PDZX(IIE+1,:,JK+1) * (ZPHIT(IIE+1-1,:,JK+1)-ZPHIT(IIE+1-1,:,JK)) &
/ PDZZ(IIE+1-1,:,JK+1) &
!$acc kernels loop independent collapse(2) async
DO CONCURRENT (JJ=1:IJU , JK=2:IKU-1)
ZDV_SOURCE(IIE+1,JJ,JK)= &
(ZPHIT(IIE+1,JJ,JK) - ZPHIT(IIE+1-1,JJ,JK) - 0.5 * ( &
PDZX(IIE+1,JJ,JK) * (ZPHIT(IIE+1-1,JJ,JK)-ZPHIT(IIE+1-1,JJ,JK-1)) &
/ PDZZ(IIE+1-1,JJ,JK) &
+PDZX(IIE+1,JJ,JK+1) * (ZPHIT(IIE+1-1,JJ,JK+1)-ZPHIT(IIE+1-1,JJ,JK)) &
/ PDZZ(IIE+1-1,JJ,JK+1) &
) &
) / PDXX(IIE+1,:,JK)
) / PDXX(IIE+1,JJ,JK)
END DO
!$acc end kernels
END IF
!$acc wait
!
CALL MPPDB_CHECK3DM("before MXM PRESSUREZ :PRU/V/WS",PRECISION,PRUS,PRVS,PRWS)
IF(CEQNSYS=='MAE' .OR. CEQNSYS=='DUR') THEN
......@@ -720,31 +721,31 @@ IF(.NOT. L2D) THEN
IF ( GSOUTH ) THEN
!!!!!!!!!!!!!!!! FUJI compiler directive !!!!!!!!!!
!!!!!!!!!!!!!!!! FUJI compiler directive !!!!!!!!!!
!$acc kernels async
DO JK=2,IKU-1
ZDV_SOURCE(:,IJB,JK)= &
(ZPHIT(:,IJB,JK) - ZPHIT(:,IJB-1,JK) - 0.5 * ( &
PDZY(:,IJB,JK) * (ZPHIT(:,IJB,JK)-ZPHIT(:,IJB,JK-1)) / PDZZ(:,IJB,JK) &
+PDZY(:,IJB,JK+1) * (ZPHIT(:,IJB,JK+1)-ZPHIT(:,IJB,JK)) / PDZZ(:,IJB,JK+1) &
) &
) / PDYY(:,IJB,JK)
END DO
!$acc end kernels
END IF
!
IF ( GNORTH ) THEN
!$acc kernels async
DO JK=2,IKU-1
ZDV_SOURCE(:,IJE+1,JK)= &
(ZPHIT(:,IJE+1,JK) - ZPHIT(:,IJE+1-1,JK) - 0.5 * ( &
PDZY(:,IJE+1,JK) * (ZPHIT(:,IJE+1-1,JK)-ZPHIT(:,IJE+1-1,JK-1)) &
/ PDZZ(:,IJE+1-1,JK) &
+PDZY(:,IJE+1,JK+1) * (ZPHIT(:,IJE+1-1,JK+1)-ZPHIT(:,IJE+1-1,JK)) &
/ PDZZ(:,IJE+1-1,JK+1) &
) &
) / PDYY(:,IJE+1,JK)
END DO
!$acc end kernels
!$acc kernels loop independent collapse(2) async
DO CONCURRENT (JI=1:IIU , JK=2:IKU-1)
ZDV_SOURCE(JI,IJB,JK)= &
(ZPHIT(JI,IJB,JK) - ZPHIT(JI,IJB-1,JK) - 0.5 * ( &
PDZY(JI,IJB,JK) * (ZPHIT(JI,IJB,JK)-ZPHIT(JI,IJB,JK-1)) / PDZZ(JI,IJB,JK) &
+PDZY(JI,IJB,JK+1) * (ZPHIT(JI,IJB,JK+1)-ZPHIT(JI,IJB,JK)) / PDZZ(JI,IJB,JK+1) &
) &
) / PDYY(JI,IJB,JK)
END DO
!$acc end kernels
END IF
!
IF ( GNORTH ) THEN
!$acc kernels loop independent collapse(2) async
DO CONCURRENT (JI=1:IIU , JK=2:IKU-1)
ZDV_SOURCE(JI,IJE+1,JK)= &
(ZPHIT(JI,IJE+1,JK) - ZPHIT(JI,IJE+1-1,JK) - 0.5 * ( &
PDZY(JI,IJE+1,JK) * (ZPHIT(JI,IJE+1-1,JK)-ZPHIT(JI,IJE+1-1,JK-1)) &
/ PDZZ(JI,IJE+1-1,JK) &
+PDZY(JI,IJE+1,JK+1) * (ZPHIT(JI,IJE+1-1,JK+1)-ZPHIT(JI,IJE+1-1,JK)) &
/ PDZZ(JI,IJE+1-1,JK+1) &
) &
) / PDYY(JI,IJE+1,JK)
END DO
!$acc end kernels
END IF
!$acc wait
!
......
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