Skip to content

Commit

Permalink
ww3_homp: add explicit and implicit homp
Browse files Browse the repository at this point in the history
  • Loading branch information
aronroland committed Dec 20, 2023
1 parent a3b804d commit d2009bf
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion model/src/w3profsmd_pdlib.F90
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,9 @@ SUBROUTINE PDLIB_W3XYPUG_DRIVER ( FACX, FACY, DTG, VGX, VGY, LCALC )
FLUSH(740+IAPROC)
#endif

#ifdef W3_OMPH
!$OMP PARALLEL DO PRIVATE (ISP)
#endif
DO ISP=1,NSPEC
CALL PDLIB_W3XYPUG ( ISP, FACX, FACX, DTG, VGX, VGY, LCALC )
END DO
Expand Down Expand Up @@ -3753,10 +3756,21 @@ SUBROUTINE calcARRAY_JACOBI_VEC(DTG,FACX,FACY,VGX,VGY)
DTK = 0
TMP3 = 0

#ifdef W3_OMPH
!$OMP WORKSHARE
CCOSA = FACX * ECOS(1:NTH)
CSINA = FACX * ESIN(1:NTH)
!$OMP END WORKSHARE
#endif
call print_memcheck(memunit, 'memcheck_____:'//' WW3_JACOBI SECTION 0')


#ifdef W3_OMPH
!$OMP PARALLEL DO PRIVATE (ISP, ITH, IK, CCOS, CSIN, IP, IP_GLOB, CG1, &
!$OMP& CXY, CXYY, FL11, FL12, FL21, FL22, FL31, FL32, &
!$OMP& CRFS, LAMBDA, K, KP, DELTAL, IB1, IB2, IBR, &
!$OMP& I, J, IE, POS, DTK, I1, I2, I3)
#endif
DO ISP = 1, NSPEC

ITH = 1 + MOD(ISP-1,NTH)
Expand Down Expand Up @@ -4581,6 +4595,11 @@ SUBROUTINE calcARRAY_JACOBI_SPECTRAL_1(DTG)
!AR: TODO: check&report if needed ...
LSIG = FLCUR .OR. FLLEV

#ifdef W3_OMPH
!$OMP PARALLEL DO PRIVATE (IP, ITH, IK, ISP, IP_GLOB, ISEA, eSI, CP_SIG, CM_SIG, B_SIG, &
!$OMP& CAS, DMM, CWNB_M2, CWNB_SIG_M2, DWNI_M2, ITH0, eVal, &
!$OMP& CAD, CP_THE, CM_THE)
#endif
DO IP = 1, np
IP_glob=iplg(IP)
ISEA=MAPFS(1,IP_glob)
Expand Down Expand Up @@ -5917,7 +5936,7 @@ SUBROUTINE PDLIB_JACOBI_GAUSS_SEIDEL_BLOCK(IMOD, FACX, FACY, DTG, VGX, VGY, LCAL
IF (IMEM == 2) THEN
CALL calcARRAY_JACOBI4(IP,DTG,FACX,FACY,VGX,VGY,ASPAR_DIAG_LOCAL,ASPAR_OFF_DIAG_LOCAL,B_JAC_LOCAL)
ASPAR_DIAG(1:NSPEC) = ASPAR_DIAG_LOCAL(1:NSPEC) + ASPAR_DIAG_ALL(1:NSPEC,IP)
esum = B_JAC_LOCAL - ASPAR_OFF_DIAG_LOCAL + B_JAC(1:NSPEC,IP)
esum(1:NSPEC) = B_JAC_LOCAL - ASPAR_OFF_DIAG_LOCAL + B_JAC(1:NSPEC,IP)
ELSEIF (IMEM == 1) THEN
eSum(1:NSPEC) = B_JAC(1:NSPEC,IP)
ASPAR_DIAG(1:NSPEC) = ASPAR_JAC(1:NSPEC,PDLIB_I_DIAG(IP))
Expand Down

0 comments on commit d2009bf

Please sign in to comment.