-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenACC port of wave propagation (ACCV6) #6
Changes from 1 commit
ae322e0
bc824f1
756a754
d1bd955
6c46fa8
b555fec
4f6d4f1
de24c4c
a6090b1
3558443
31a263a
a0d568a
c655ed2
dd87579
d642d66
ed6a9d1
79988d1
142659b
6b8301a
a8f5c9b
a0c9607
f78680f
7084540
b7dd9c9
d74d1f6
4262014
e422898
fb87ad5
318594c
d026989
54e56ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,12 +29,18 @@ SUBROUTINE CTUWDRV (DELPRO, MSTART, MEND, & | |
USE PARKIND_WAVE, ONLY : JWIM, JWRB, JWRU | ||
USE YOWDRVTYPE , ONLY : WVGRIDGLO | ||
|
||
|
||
USE YOWCURR , ONLY : LLCFLCUROFF | ||
USE YOWGRID , ONLY : NPROMA_WAM | ||
USE YOWMPP , ONLY : IRANK | ||
USE YOWPARAM , ONLY : NIBLO ,NANG ,NFRE_RED | ||
USE YOWSTAT , ONLY : IREFRA | ||
USE YOWTEST , ONLY : IU06 | ||
USE YOWUBUF , ONLY : WLATN ,WLONN ,WCORN | ||
USE YOWFRED , ONLY : FR ,DELTH, COSTH ,SINTH | ||
USE YOWPCONS , ONLY : ZPI | ||
|
||
|
||
|
||
USE YOMHOOK , ONLY : LHOOK, DR_HOOK, JPHOOK | ||
|
||
|
@@ -73,12 +79,15 @@ SUBROUTINE CTUWDRV (DELPRO, MSTART, MEND, & | |
|
||
IF (LHOOK) CALL DR_HOOK('CTUWDRV',0,ZHOOK_HANDLE) | ||
|
||
!! NPROMA=NPROMA_WAM | ||
!! =NPROMA_WAM | ||
MTHREADS=1 | ||
!$ MTHREADS=OMP_GET_MAX_THREADS() | ||
NPROMA=(IJL-IJS+1)/MTHREADS + 1 | ||
|
||
|
||
#ifndef _OPENACC | ||
!$OMP PARALLEL DO SCHEDULE(DYNAMIC,1) PRIVATE(JKGLO, KIJS, KIJL, ICALL, IJ, LL2NDCALL) | ||
#endif /*_OPENACC*/ | ||
DO JKGLO = IJS, IJL, NPROMA | ||
KIJS=JKGLO | ||
KIJL=MIN(KIJS+NPROMA-1,IJL) | ||
|
@@ -91,6 +100,7 @@ SUBROUTINE CTUWDRV (DELPRO, MSTART, MEND, & | |
& COSPHM1_EXT, DEPTH_EXT, U_EXT, V_EXT ) | ||
|
||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please revert this whitespace change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
! WHEN SURFACE CURRENTS ARE USED AND LLCFLCUROFF IS TRUE | ||
! THEN TRY TO SATISFY THE CFL CONDITION WITHOUT THE CURRENTS | ||
! IF IT WAS VIOLATED IN THE FIRST PLACE | ||
|
@@ -112,8 +122,12 @@ SUBROUTINE CTUWDRV (DELPRO, MSTART, MEND, & | |
& COSPHM1_EXT, DEPTH_EXT, U_EXT, V_EXT ) | ||
ENDIF | ||
ENDIF | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please revert this whitespace change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
|
||
ENDDO | ||
#ifndef _OPENACC | ||
!$OMP END PARALLEL DO | ||
#endif /*_OPENACC*/ | ||
|
||
DO IJ=IJS,IJL | ||
IF (LCFLFAIL(IJ)) THEN | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ | |
! granted to it by virtue of its status as an intergovernmental organisation | ||
! nor does it submit to any jurisdiction. | ||
! | ||
!MODULE CTUWINI_MOD | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please remove the commented out MODULE statements? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
! CONTAINS | ||
|
||
SUBROUTINE CTUWINI (KIJS, KIJL, NINF, NSUP, BLK2GLO, COSPHM1_EXT, & | ||
& WLATM1, WCORM1, DP) | ||
|
@@ -44,18 +46,20 @@ SUBROUTINE CTUWINI (KIJS, KIJL, NINF, NSUP, BLK2GLO, COSPHM1_EXT, & | |
REAL(KIND=JWRB), DIMENSION(NINF:NSUP,4), INTENT(OUT) :: WCORM1 ! 1 - WCOR | ||
REAL(KIND=JWRB), DIMENSION(NINF:NSUP,2), INTENT(OUT) :: DP ! COS PHI FACTOR | ||
|
||
|
||
INTEGER(KIND=JWIM) :: IJ, K, M, IC, ICR, ICL, KY, KK, KKM | ||
INTEGER(KIND=JWIM) :: NLAND | ||
|
||
REAL(KIND=JPHOOK) :: ZHOOK_HANDLE | ||
!REAL(KIND=JPHOOK) :: ZHOOK_HANDLE | ||
|
||
!!$acc routine vector | ||
|
||
! ---------------------------------------------------------------------- | ||
|
||
IF (LHOOK) CALL DR_HOOK('CTUWINI',0,ZHOOK_HANDLE) | ||
!IF (LHOOK) CALL DR_HOOK('CTUWINI',0,ZHOOK_HANDLE) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why have the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reverted |
||
|
||
NLAND = NSUP+1 | ||
|
||
|
||
!$acc parallel loop independent collapse(2) | ||
DO IC=1,2 | ||
DO IJ = KIJS,KIJL | ||
IF (KLAT(IJ,IC,1) < NLAND .AND. KLAT(IJ,IC,2) < NLAND) THEN | ||
|
@@ -74,7 +78,9 @@ SUBROUTINE CTUWINI (KIJS, KIJL, NINF, NSUP, BLK2GLO, COSPHM1_EXT, & | |
ENDIF | ||
ENDDO | ||
ENDDO | ||
|
||
!$acc end parallel | ||
|
||
!$acc parallel loop independent collapse(2) | ||
DO ICR=1,4 | ||
DO IJ = KIJS,KIJL | ||
IF (KCOR(IJ,ICR,1) < NLAND .AND. KCOR(IJ,ICR,2) < NLAND) THEN | ||
|
@@ -88,15 +94,17 @@ SUBROUTINE CTUWINI (KIJS, KIJL, NINF, NSUP, BLK2GLO, COSPHM1_EXT, & | |
ELSE | ||
! ADAPT CORNER POINT INTERPOLATION WEIGHT IF LAND IS PRESENT | ||
! SECOND CLOSEST CORNER POINT IS OVER LAND | ||
IF (WCOR(IJ,ICR) > 0.5_JWRB) WCOR(IJ,ICR)=1.0_JWRB | ||
IF (WCOR(IJ,ICR) > 0.5_JWRB) WCOR(IJ,ICR)=1.0_JWRB | ||
WCORM1(IJ,ICR) = 1.0_JWRB - WCOR(IJ,ICR) | ||
ENDIF | ||
ENDDO | ||
ENDDO | ||
!$acc end parallel | ||
|
||
|
||
! INITIALISATION | ||
|
||
!$acc parallel loop independent collapse(5) | ||
DO ICL=1,2 | ||
DO IC=1,2 | ||
DO M=1,NFRE_RED | ||
|
@@ -108,7 +116,10 @@ SUBROUTINE CTUWINI (KIJS, KIJL, NINF, NSUP, BLK2GLO, COSPHM1_EXT, & | |
ENDDO | ||
ENDDO | ||
ENDDO | ||
!$acc end parallel | ||
|
||
|
||
!$acc parallel loop independent collapse(4) | ||
DO IC=1,2 | ||
DO M=1,NFRE_RED | ||
DO K=1,NANG | ||
|
@@ -118,7 +129,10 @@ SUBROUTINE CTUWINI (KIJS, KIJL, NINF, NSUP, BLK2GLO, COSPHM1_EXT, & | |
ENDDO | ||
ENDDO | ||
ENDDO | ||
!$acc end parallel | ||
|
||
|
||
!$acc parallel loop independent collapse(5) | ||
DO ICL=1,2 | ||
DO ICR=1,4 | ||
DO M=1,NFRE_RED | ||
|
@@ -130,26 +144,32 @@ SUBROUTINE CTUWINI (KIJS, KIJL, NINF, NSUP, BLK2GLO, COSPHM1_EXT, & | |
ENDDO | ||
ENDDO | ||
ENDDO | ||
!$acc end parallel | ||
|
||
|
||
|
||
IF (ICASE == 1) THEN | ||
|
||
!* SPHERICAL GRID. | ||
! --------------- | ||
|
||
! | ||
!* COMPUTE COS PHI FACTOR FOR ADJOINING GRID POINT. | ||
! (for all grid points) | ||
!$acc parallel loop independent collapse(2) private(KY,KK,KKM) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we please guard openacc parallel clauses behind ifdefs? |
||
DO IC=1,2 | ||
! !!!$acc loop private(KY,KK,KKM) | ||
DO IJ = KIJS,KIJL | ||
KY=BLK2GLO%KXLT(IJ) | ||
KK=KY+2*IC-3 | ||
KKM=MAX(1,MIN(KK,NGY)) | ||
DP(IJ,IC) = COSPH(KKM)*COSPHM1_EXT(IJ) | ||
ENDDO | ||
ENDDO | ||
!$acc end parallel | ||
ENDIF | ||
|
||
IF (LHOOK) CALL DR_HOOK('CTUWINI',1,ZHOOK_HANDLE) | ||
|
||
!IF (LHOOK) CALL DR_HOOK('CTUWINI',1,ZHOOK_HANDLE) | ||
|
||
END SUBROUTINE CTUWINI | ||
!END MODULE CTUWINI_MOD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this comment please be restored to its original state?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done