Skip to content

Commit

Permalink
Merge pull request #109 from ecmwf-ifs/nams-acc-stack-sp
Browse files Browse the repository at this point in the history
Fix single-precision for manually implemented SCC-STACK OpenACC GPU variant
  • Loading branch information
reuterbal authored Jan 20, 2025
2 parents 767d409 + 7b211ea commit 06dc3f9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
12 changes: 6 additions & 6 deletions src/cloudsc_gpu/cloudsc_driver_gpu_scc_stack_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ SUBROUTINE CLOUDSC_DRIVER_GPU_SCC_STACK (NUMOMP, NPROMA, NLEV, NGPTOT, NGPTOTG,
INTEGER(KIND=8) :: ISTSZ
REAL(KIND=JPRB), ALLOCATABLE :: ZSTACK(:, :)
INTEGER(KIND=8) :: YLSTACK_L
ISTSZ = (NPROMA*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8) + 13*NLEV*NPROMA*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8) + &
& 5*NLEV*NPROMA*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8)*NCLV + NPROMA*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8)*NCLV) / &
& MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8)
IF (.not.(MOD(NPROMA*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8) + 13*NLEV*NPROMA*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8) + &
& 5*NLEV*NPROMA*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8)*NCLV + NPROMA*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8)*NCLV, &
& MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8)) == 0)) ISTSZ = ISTSZ + 1
ISTSZ = (NPROMA*C_SIZEOF(REAL(1, kind=JPRB)) + 13*NLEV*NPROMA*C_SIZEOF(REAL(1, kind=JPRB)) + &
& 5*NLEV*NPROMA*C_SIZEOF(REAL(1, kind=JPRB))*NCLV + NPROMA*C_SIZEOF(REAL(1, kind=JPRB))*NCLV) / &
& C_SIZEOF(REAL(1, kind=JPRB))
IF (.not.(MOD(NPROMA*C_SIZEOF(REAL(1, kind=JPRB)) + 13*NLEV*NPROMA*C_SIZEOF(REAL(1, kind=JPRB)) + &
& 5*NLEV*NPROMA*C_SIZEOF(REAL(1, kind=JPRB))*NCLV + NPROMA*C_SIZEOF(REAL(1, kind=JPRB))*NCLV, &
& C_SIZEOF(REAL(1, kind=JPRB))) == 0)) ISTSZ = ISTSZ + 1
ALLOCATE (ZSTACK(ISTSZ, NGPBLKS))
!$acc data create( ZSTACK )

Expand Down
36 changes: 18 additions & 18 deletions src/cloudsc_gpu/cloudsc_gpu_scc_stack_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -674,41 +674,41 @@ SUBROUTINE CLOUDSC_SCC_STACK (KIDIA, KFDIA, KLON, KLEV, PTSPHY, PT, PQ, TENDENCY
POINTER(IP_ZFOEELIQT, ZFOEELIQT)
YLSTACK_L = YDSTACK_L
IP_ZFOEALFA = YLSTACK_L
YLSTACK_L = YLSTACK_L + KLON*(KLEV + 1)*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8)
YLSTACK_L = YLSTACK_L + KLON*(KLEV + 1)*C_SIZEOF(REAL(1, kind=JPRB))
IP_ZTP1 = YLSTACK_L
YLSTACK_L = YLSTACK_L + KLON*KLEV*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8)
YLSTACK_L = YLSTACK_L + KLON*KLEV*C_SIZEOF(REAL(1, kind=JPRB))
IP_ZLI = YLSTACK_L
YLSTACK_L = YLSTACK_L + KLON*KLEV*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8)
YLSTACK_L = YLSTACK_L + KLON*KLEV*C_SIZEOF(REAL(1, kind=JPRB))
IP_ZA = YLSTACK_L
YLSTACK_L = YLSTACK_L + KLON*KLEV*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8)
YLSTACK_L = YLSTACK_L + KLON*KLEV*C_SIZEOF(REAL(1, kind=JPRB))
IP_ZAORIG = YLSTACK_L
YLSTACK_L = YLSTACK_L + KLON*KLEV*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8)
YLSTACK_L = YLSTACK_L + KLON*KLEV*C_SIZEOF(REAL(1, kind=JPRB))
IP_ZLIQFRAC = YLSTACK_L
YLSTACK_L = YLSTACK_L + KLON*KLEV*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8)
YLSTACK_L = YLSTACK_L + KLON*KLEV*C_SIZEOF(REAL(1, kind=JPRB))
IP_ZICEFRAC = YLSTACK_L
YLSTACK_L = YLSTACK_L + KLON*KLEV*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8)
YLSTACK_L = YLSTACK_L + KLON*KLEV*C_SIZEOF(REAL(1, kind=JPRB))
IP_ZQX = YLSTACK_L
YLSTACK_L = YLSTACK_L + KLON*KLEV*NCLV*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8)
YLSTACK_L = YLSTACK_L + KLON*KLEV*NCLV*C_SIZEOF(REAL(1, kind=JPRB))
IP_ZQX0 = YLSTACK_L
YLSTACK_L = YLSTACK_L + KLON*KLEV*NCLV*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8)
YLSTACK_L = YLSTACK_L + KLON*KLEV*NCLV*C_SIZEOF(REAL(1, kind=JPRB))
IP_ZPFPLSX = YLSTACK_L
YLSTACK_L = YLSTACK_L + KLON*(KLEV + 1)*NCLV*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8)
YLSTACK_L = YLSTACK_L + KLON*(KLEV + 1)*NCLV*C_SIZEOF(REAL(1, kind=JPRB))
IP_ZLNEG = YLSTACK_L
YLSTACK_L = YLSTACK_L + KLON*KLEV*NCLV*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8)
YLSTACK_L = YLSTACK_L + KLON*KLEV*NCLV*C_SIZEOF(REAL(1, kind=JPRB))
IP_ZQXN2D = YLSTACK_L
YLSTACK_L = YLSTACK_L + KLON*KLEV*NCLV*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8)
YLSTACK_L = YLSTACK_L + KLON*KLEV*NCLV*C_SIZEOF(REAL(1, kind=JPRB))
IP_ZQSMIX = YLSTACK_L
YLSTACK_L = YLSTACK_L + KLON*KLEV*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8)
YLSTACK_L = YLSTACK_L + KLON*KLEV*C_SIZEOF(REAL(1, kind=JPRB))
IP_ZQSLIQ = YLSTACK_L
YLSTACK_L = YLSTACK_L + KLON*KLEV*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8)
YLSTACK_L = YLSTACK_L + KLON*KLEV*C_SIZEOF(REAL(1, kind=JPRB))
IP_ZQSICE = YLSTACK_L
YLSTACK_L = YLSTACK_L + KLON*KLEV*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8)
YLSTACK_L = YLSTACK_L + KLON*KLEV*C_SIZEOF(REAL(1, kind=JPRB))
IP_ZFOEEWMT = YLSTACK_L
YLSTACK_L = YLSTACK_L + KLON*KLEV*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8)
YLSTACK_L = YLSTACK_L + KLON*KLEV*C_SIZEOF(REAL(1, kind=JPRB))
IP_ZFOEEW = YLSTACK_L
YLSTACK_L = YLSTACK_L + KLON*KLEV*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8)
YLSTACK_L = YLSTACK_L + KLON*KLEV*C_SIZEOF(REAL(1, kind=JPRB))
IP_ZFOEELIQT = YLSTACK_L
YLSTACK_L = YLSTACK_L + KLON*KLEV*MAX(C_SIZEOF(REAL(1, kind=JPRB)), 8)
YLSTACK_L = YLSTACK_L + KLON*KLEV*C_SIZEOF(REAL(1, kind=JPRB))
!$acc data present( PT, PQ, TENDENCY_TMP_T, TENDENCY_TMP_Q, TENDENCY_TMP_A, TENDENCY_TMP_CLD, TENDENCY_LOC_T, TENDENCY_LOC_Q, &
!$acc & TENDENCY_LOC_A, TENDENCY_LOC_CLD, PVFA, PVFL, PVFI, PDYNA, PDYNL, PDYNI, PHRSW, PHRLW, PVERVEL, PAP, PAPH, PLSM, LDCUM, &
!$acc & KTYPE, PLU, PLUDE, PSNDE, PMFU, PMFD, PA, PCLV, PSUPSAT, PLCRIT_AER, PICRIT_AER, PRE_ICE, PCCN, PNICE, PCOVPTOT, &
Expand Down

0 comments on commit 06dc3f9

Please sign in to comment.