diff --git a/src/MNH/tridiag_tke.f90 b/src/MNH/tridiag_tke.f90 index b4fa21b73e7b9f7b468ed74c32474b9fb82b681e..4cf3e15c4018fa0a4ee172a79300894d26694882 100644 --- a/src/MNH/tridiag_tke.f90 +++ b/src/MNH/tridiag_tke.f90 @@ -270,8 +270,12 @@ IF ( PIMPL > 1.E-10 ) THEN ! !$acc loop seq DO JK = IKB+KKL,IKE-KKL,KKL - !$acc loop gang, vector collapse(2) independent +#ifdef MNH_COMPILER_NVHPC + !$acc loop gang, vector collapse(2) independent +#endif + !dir$ concurrent ! collapse(JJ,JI) DO JJ=1,JJU + !dir$ concurrent DO JI=1,JIU ZGAM(JI,JJ,JK) = PIMPL * PA(JI,JJ,JK) / PRHODJ(JI,JJ,JK-KKL) / ZBET(JI,JJ) ! gam(k) = c(k-1) / bet diff --git a/src/MNH/turb_ver_thermo_corr.f90 b/src/MNH/turb_ver_thermo_corr.f90 index ff45f198e39d7939997e2ae5232370c2e9bba802..c6460dcee8af51e0c6dd1f571243bb21fd04ca2e 100644 --- a/src/MNH/turb_ver_thermo_corr.f90 +++ b/src/MNH/turb_ver_thermo_corr.f90 @@ -522,6 +522,7 @@ ZCOEFF(:,:,IKB)= - (PDZZ(:,:,IKB+2*KKL)+2.*PDZZ(:,:,IKB+KKL)) / & #ifndef MNH_OPENACC ZKEFF(:,:,:) = MZM( PLM(:,:,:) * SQRT(PTKEM(:,:,:)) ) #else +!dir$ concurrent ZTMP1_DEVICE(:,:,:) = PLM(:,:,:) * SQRT(PTKEM(:,:,:)) !$acc end kernels CALL MZM_DEVICE(ZTMP1_DEVICE(:,:,:), ZKEFF(:,:,:)) @@ -562,6 +563,7 @@ END IF #else !$acc kernels #ifndef MNH_BITREP + !dir$ concurrent ZTMP1_DEVICE(:,:,:) = PPHI3(:,:,:)*PDTH_DZ(:,:,:)**2 #else #ifdef MNH_COMPILER_NVHPC @@ -850,6 +852,7 @@ END IF ZF (:,:,:) = XCTV*PLM(:,:,:)*PLEPS(:,:,:)*MZF(0.5*(PPHI3(:,:,:)+PPSI3(:,:,:))*PDTH_DZ(:,:,:)*PDR_DZ(:,:,:)) #else !$acc kernels +!dir$ concurrent ZTMP1_DEVICE(:,:,:) = 0.5*(PPHI3(:,:,:)+PPSI3(:,:,:))*PDTH_DZ(:,:,:)*PDR_DZ(:,:,:) !$acc end kernels CALL MZF_DEVICE( ZTMP1_DEVICE(:,:,:), ZTMP2_DEVICE(:,:,:) ) @@ -1228,6 +1231,7 @@ END IF #else !$acc kernels #ifndef MNH_BITREP + !dir$ concurrent ZTMP1_DEVICE(:,:,:) = PPSI3(:,:,:)*PDR_DZ(:,:,:)**2 #else #ifdef MNH_COMPILER_NVHPC diff --git a/src/MNH/turb_ver_thermo_flux.f90 b/src/MNH/turb_ver_thermo_flux.f90 index 3d8ea72169752939f3f03be74cc9f1cc189d15d9..0752d12fd69b685e3175842e4a8e483e642b09b5 100644 --- a/src/MNH/turb_ver_thermo_flux.f90 +++ b/src/MNH/turb_ver_thermo_flux.f90 @@ -914,13 +914,15 @@ ELSE ! No coupling O and A cases !*In 1D, part of energy released in horizontal flux is taken into account in the vertical part IF (HTURBDIM=='3DIM') THEN !$acc kernels - ZF(:,:,IKB) = ( PIMPL*PSFTHP(:,:) + PEXPL*PSFTHM(:,:) ) & + !dir$ concurrent + ZF(:,:,IKB) = ( PIMPL*PSFTHP(:,:) + PEXPL*PSFTHM(:,:) ) & * PDIRCOSZW(:,:) & * 0.5 * (1. + PRHODJ(:,:,KKA) / PRHODJ(:,:,IKB)) !$acc end kernels ELSE !$acc kernels - ZF(:,:,IKB) = ( PIMPL*PSFTHP(:,:) + PEXPL*PSFTHM(:,:) ) & + !dir$ concurrent + ZF(:,:,IKB) = ( PIMPL*PSFTHP(:,:) + PEXPL*PSFTHM(:,:) ) & / PDIRCOSZW(:,:) & * 0.5 * (1. + PRHODJ(:,:,KKA) / PRHODJ(:,:,IKB)) !$acc end kernels @@ -945,6 +947,7 @@ CALL TRIDIAG_THERMO(KKA,KKU,KKL,PTHLM,ZF,ZDFDDTDZ,PTSTEP,PIMPL,PDZZ,& ! Compute the equivalent tendency for the conservative potential temperature ! !$acc kernels +!dir$ concurrent ZRWTHL(:,:,:)= PRHODJ(:,:,:)*(PTHLP(:,:,:)-PTHLM(:,:,:))/PTSTEP !$acc end kernels ! replace the flux by the Leonard terms above ZALT and ZCLD_THOLD @@ -970,6 +973,7 @@ ZFLXZ(:,:,:) = ZF(:,:,:) & + PIMPL * ZDFDDTDZ(:,:,:) * DZM(PTHLP - PTHLM(:,:,:)) / PDZZ(:,:,:) #else !$acc kernels +!dir$ concurrent ZTMP1_DEVICE(:,:,:) = PTHLP(:,:,:) - PTHLM(:,:,:) !$acc end kernels CALL DZM_DEVICE( ZTMP1_DEVICE, ZTMP2_DEVICE ) @@ -1121,6 +1125,7 @@ IF ( KRRL >= 1 ) THEN !$acc end kernels ELSE !$acc kernels + !dir$ concurrent ZTMP1_DEVICE(:,:,:) = PRHODJ(:,:,:) * PATHETA(:,:,:) * 2. * PSRCM(:,:,:) ZTMP2_DEVICE(:,:,:) = ZFLXZ(:,:,:) / PDZZ(:,:,:) !$acc end kernels @@ -1445,9 +1450,10 @@ IF (KRR /= 0) THEN ! ! Compute the equivalent tendency for the conservative mixing ratio ! -!$acc kernels + !$acc kernels + !dir$ concurrent ZRWRNP (:,:,:) = PRHODJ(:,:,:)*(PRP(:,:,:)-PRM(:,:,:,1))/PTSTEP -!$acc end kernels + !$acc end kernels ! ! replace the flux by the Leonard terms above ZALT and ZCLD_THOLD IF (LHGRAD) THEN @@ -1472,6 +1478,7 @@ IF (KRR /= 0) THEN + PIMPL * ZDFDDRDZ(:,:,:) * DZM(PRP - PRM(:,:,:,1)) / PDZZ(:,:,:) #else !$acc kernels + !dir$ concurrent ZTMP1_DEVICE(:,:,:) = PRP(:,:,:) - PRM(:,:,:,1) !$acc end kernels CALL DZM_DEVICE( ZTMP1_DEVICE, ZTMP2_DEVICE ) @@ -1603,10 +1610,11 @@ END DO #else IF ( KRRL >= 1 ) THEN IF ( KRRI >= 1 ) THEN -!$acc kernels + !$acc kernels + !dir$ concurrent ZTMP1_DEVICE(:,:,:) = PRHODJ(:,:,:)*PAMOIST(:,:,:)*2.*PSRCM(:,:,:) ZTMP2_DEVICE(:,:,:) = ZFLXZ(:,:,:)/PDZZ(:,:,:) -!$acc end kernels + !$acc end kernels CALL DZF_DEVICE( ZTMP2_DEVICE, ZTMP3_DEVICE ) !$acc kernels PRRS(:,:,:,2) = PRRS(:,:,:,2) - ZTMP1_DEVICE(:,:,:) * ZTMP3_DEVICE(:,:,:) * (1.0-PFRAC_ICE(:,:,:))