Skip to content

Commit

Permalink
including sams review
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasm91 committed Oct 17, 2024
1 parent 91b2759 commit 9be2c89
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/trans/gpu/external/gpnorm_trans_gpu.F90
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,14 @@ SUBROUTINE GPNORM_TRANS_GPU(PGP,KFIELDS,KPROMA,PAVE,PMIN,PMAX,LDAVE_ONLY,KRESOL)
IBEG=1
IEND=D%NDGL_FS

ASSOCIATE(D_NSTAGTF=>D%NSTAGTF,D_NPTRLS=>D%NPTRLS,G_NLOEN=>G%NLOEN)
ASSOCIATE(D_NSTAGTF=>D%NSTAGTF,D_NPTRLS=>D%NPTRLS,G_NLOEN=>G%NLOEN,F_RW=>F%RW)

CALL GSTATS(1429,0)
IF( IF_FS > 0 )THEN

#ifdef ACCGPU
!$ACC DATA &
!$ACC& COPY(D,D_NSTAGTF,D_NPTRLS,G_NLOEN) &
!$ACC& COPY(D,D_NSTAGTF,D_NPTRLS,G_NLOEN,F,F_RW) &
!$ACC& PRESENT(ZGTF,ZAVE,ZMINGL,ZMAXGL,ZMINGPN,ZMAXGPN)
#endif
#ifdef OMPGPU
Expand Down Expand Up @@ -274,7 +274,7 @@ SUBROUTINE GPNORM_TRANS_GPU(PGP,KFIELDS,KPROMA,PAVE,PMIN,PMAX,LDAVE_ONLY,KRESOL)
DO JGL=IBEG,IEND
IGL = D_NPTRLS(MYSETW) + JGL - 1
DO JF=1,IF_FS
ZAVE(JF,JGL)=ZAVE(JF,JGL)*F%RW(IGL)/G_NLOEN(IGL)
ZAVE(JF,JGL)=ZAVE(JF,JGL)*F_RW(IGL)/G_NLOEN(IGL)
!write(iunit,*) 'aver inside ',JF,IF_FS,IGL,ZAVE(JF,JGL), F%RW(IGL), G_NLOEN(IGL),ZMINGPN(JF),ZMAXGPN(JF)
ENDDO
ENDDO
Expand Down
2 changes: 1 addition & 1 deletion src/trans/gpu/internal/cdmap_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ SUBROUTINE CDMAP(KM,KMLOC,KSL,KSLO,PEPSNM, KDIR, KDGNH, KDGNHD,&

! ------------------------------------------------------------------

CALL MPL_ABORT("this routine is not supported right now")
CALL MPL_ABORT("CDMAP not yet supported in ecTrans GPU version")

!* 1. PERFORM LEGENDRE TRANFORM.
! --------------------------
Expand Down
4 changes: 2 additions & 2 deletions src/trans/gpu/internal/fsc_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ SUBROUTINE FSC(ALLOCATOR,HFSC,PREEL_COMPLEX, KF_FS, KF_UV, KF_SCALARS, KUV_OFFSE
#endif
#ifdef ACCGPU
!$ACC PARALLEL LOOP COLLAPSE(3) DEFAULT(NONE) PRIVATE(IGLG,IOFF_LAT,IOFF_UV,IOFF_UV_EWDER,RET_REAL,RET_COMPLEX,ZACHTE2,JM,JF,KGL) &
!$ACC& FIRSTPRIVATE(IBEG,IEND,IINC,OFFSET_VAR,KF_UV,KUV_EWDER_OFFSET,KUV_OFFSET,KF_FS) ASYNC(1)
!$ACC& FIRSTPRIVATE(IBEG,IEND,IINC,OFFSET_VAR,KF_UV,KUV_EWDER_OFFSET,KUV_OFFSET,KF_FS,ILOEN_MAX) ASYNC(1)
#endif
DO KGL=IBEG,IEND,IINC
DO JF=1,2*KF_UV
Expand Down Expand Up @@ -231,7 +231,7 @@ SUBROUTINE FSC(ALLOCATOR,HFSC,PREEL_COMPLEX, KF_FS, KF_UV, KF_SCALARS, KUV_OFFSE
#endif
#ifdef ACCGPU
!$ACC PARALLEL LOOP COLLAPSE(3) DEFAULT(NONE) PRIVATE(IGLG,IOFF_LAT,IOFF_SCALARS_EWDER,IOFF_SCALARS,ZACHTE2,RET_REAL,RET_COMPLEX) &
!$ACC& FIRSTPRIVATE(IBEG,IEND,IINC,KF_SCALARS,OFFSET_VAR,KSCALARS_EWDER_OFFSET,KSCALARS_OFFSET,KF_FS) ASYNC(1)
!$ACC& FIRSTPRIVATE(IBEG,IEND,IINC,KF_SCALARS,OFFSET_VAR,KSCALARS_EWDER_OFFSET,KSCALARS_OFFSET,KF_FS,ILOEN_MAX) ASYNC(1)
#endif
DO KGL=IBEG,IEND,IINC
DO JF=1,KF_SCALARS
Expand Down
7 changes: 3 additions & 4 deletions src/trans/gpu/internal/spnsde_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ SUBROUTINE SPNSDE(KF_SCALARS,PEPSNM,PF,PNSD)
USE PARKIND_ECTRANS, ONLY: JPIM, JPRB, JPRBT
USE TPM_DIM, ONLY: R
USE TPM_DISTR, ONLY: D
USE TPM_FIELDS_GPU, ONLY: FG

!**** *SPNSDE* - Compute North-South derivative in spectral space

Expand Down Expand Up @@ -82,7 +81,7 @@ SUBROUTINE SPNSDE(KF_SCALARS,PEPSNM,PF,PNSD)
! LOCAL INTEGER SCALARS
INTEGER(KIND=JPIM) :: IJ, ISKIP, J, JN, JI, IR, II

ASSOCIATE(D_NUMP=>D%NUMP, R_NTMAX=>R%NTMAX, D_MYMS=>D%MYMS, ZEPSNM=>FG%ZEPSNM)
ASSOCIATE(D_NUMP=>D%NUMP, R_NTMAX=>R%NTMAX, D_MYMS=>D%MYMS)

#ifdef ACCGPU
!$ACC DATA &
Expand All @@ -91,7 +90,7 @@ SUBROUTINE SPNSDE(KF_SCALARS,PEPSNM,PF,PNSD)
#endif
#ifdef OMPGPU
!$OMP TARGET DATA &
!$OMP& MAP(PRESENT,ALLOC:ZN)
!$OMP& MAP(PRESENT,PEPSNM,ALLOC:ZN)
#endif

! ------------------------------------------------------------------
Expand All @@ -105,7 +104,7 @@ SUBROUTINE SPNSDE(KF_SCALARS,PEPSNM,PF,PNSD)
#ifdef OMPGPU
!$OMP TARGET TEAMS DISTRIBUTE PARALLEL DO
!! DEFAULT(NONE) PRIVATE(IJ) &
!!$OMP& SHARED(KM,ZN,ZEPSNM,KMLOC)
!!$OMP& SHARED(KM,ZN,KMLOC)
#endif
#ifdef ACCGPU
!$ACC PARALLEL LOOP DEFAULT(NONE) COLLAPSE(3) PRIVATE(KM,IR,II,JI) &
Expand Down
2 changes: 1 addition & 1 deletion src/trans/gpu/internal/trmtol_pack_unpack.F90
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ SUBROUTINE TRMTOL_UNPACK(ALLOCATOR,HTRMTOL_UNPACK,FOUBUF,PREEL_COMPLEX,KF_CURREN
#endif
#ifdef ACCGPU
!$ACC PARALLEL LOOP PRIVATE(IGLG,IOFF_LAT,ISTA,RET_REAL,RET_COMPLEX) FIRSTPRIVATE(KF_CURRENT,&
!$ACC& KF_TOTAL,OFFSET_VAR) DEFAULT(NONE) &
!$ACC& KF_TOTAL,OFFSET_VAR,ILOEN_MAX) DEFAULT(NONE) &
!$ACC& ASYNC(1) TILE(32,16,1)
#endif
DO KGL=1,D_NDGL_FS
Expand Down

0 comments on commit 9be2c89

Please sign in to comment.