diff --git a/src/ZSOLVER/p_abs.f90 b/src/ZSOLVER/p_abs.f90 index fff6eca846c399cef803583c2bc0b0a9430ec03b..ea09e7646871e26611cfdf8e1cbebd680caafe56 100644 --- a/src/ZSOLVER/p_abs.f90 +++ b/src/ZSOLVER/p_abs.f90 @@ -123,7 +123,7 @@ USE MODE_REPRO_SUM #if defined(MNH_BITREP) || defined(MNH_BITREP_OMP) USE MODI_BITREP #endif -#ifdef MNH_BITREP_OMP +#ifdef MNH_COMPILER_CCE !$mnh_undef(LOOP) !$mnh_undef(OPENACC) #endif @@ -159,6 +159,9 @@ REAL, DIMENSION(:,:,:), INTENT(IN) :: PRVREF ! vapor mixing ratio ! for the reference state REAL, DIMENSION(:,:,:), INTENT(IN) :: PEXNREF! Exner function of the ! reference state +#ifdef MNH_COMPILER_CCE_1403 +REAL, DIMENSION(:,:,:), POINTER , CONTIGUOUS :: PEXNREF_BR +#endif ! REAL, INTENT(INOUT) :: PPHI0 ! PHI0 at t REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PPHIT ! Perturbation of @@ -245,6 +248,9 @@ ALLOCATE (ZRTOT(IIU,IJU,IKU), ZRHOREF(IIU,IJU,IKU), ZWORK(IIU,IJU,IKU)) !Pin positions in the pools of MNH memory CALL MNH_MEM_POSITION_PIN() +#ifdef MNH_COMPILER_CCE_1403 +CALL MNH_MEM_GET(PEXNREF_BR , IIB,IIE , IJB,IJE, IKB,IKE) +#endif CALL MNH_MEM_GET(ZMASS_O_PI_2D , IIB,IIE , IJB,IJE) CALL MNH_MEM_GET(ZMASSGUESS_2D , IIB,IIE , IJB,IJE) CALL MNH_MEM_GET(ZWATERMASST_2D , IIB,IIE , IJB,IJE) @@ -290,23 +296,35 @@ IF ( CEQNSYS=='DUR' .OR. CEQNSYS=='MAE' ) THEN ZWORK(:,:,:)=PRHODJ * XTH00 & / ( PRHODREF * PTHVREF * (1. + PRVREF) ) END IF - ! +#ifdef MNH_COMPILER_CCE_1403 + !$acc loop + !$mnh_do_concurrent(JI=IIB:IIE,JJ=IJB:IJE,JK=IKB:IKE ) + PEXNREF_BR(JI,JJ,JK)=BR_POW((PEXNREF(JI,JJ,JK)+PPHIT(JI,JJ,JK)),ZCVD_O_RD) + !$mnh_end_do() +#endif + !$acc end kernels + !$acc parallel !$acc loop seq DO JK = IKB,IKE - !$mnh_do_concurrent(JI = IIB:IIE , JJ = IJB:IJE ) + !$acc loop independent + DO CONCURRENT ( JJ = IJB:IJE , JI = IIB:IIE ) ZMASSGUESS_2D(JI,JJ) = ZMASSGUESS_2D(JI,JJ) + & #if !defined(MNH_BITREP) && !defined(MNH_BITREP_OMP) (PEXNREF(JI,JJ,JK)+PPHIT(JI,JJ,JK))**ZCVD_O_RD & #else +#ifndef MNH_COMPILER_CCE_1403 BR_POW((PEXNREF(JI,JJ,JK)+PPHIT(JI,JJ,JK)),ZCVD_O_RD) & +#else + PEXNREF_BR(JI,JJ,JK) & +#endif #endif * ZWORK(JI,JJ,JK) / PTHETAV(JI,JJ,JK) ZMASS_O_PI_2D(JI,JJ) = ZMASS_O_PI_2D(JI,JJ) + ZWORK(JI,JJ,JK) / PTHETAV(JI,JJ,JK) ZWATERMASST_2D(JI,JJ) = ZWATERMASST_2D(JI,JJ) + & ZRTOT(JI,JJ,JK) * ZWORK(JI,JJ,JK) * PRHODREF(JI,JJ,JK) - !$mnh_end_do() + END DO END DO - !$acc end kernels + !$acc end parallel ! ELSE DO JK = IKB,IKE @@ -330,9 +348,9 @@ IF ( CEQNSYS=='DUR' .OR. CEQNSYS=='MAE' ) THEN ! ! !$acc update host(ZMASSGUESS_2D,ZMASS_O_PI_2D,ZWATERMASST_2D) - ZMASSGUESS = SUM_DD_R2_ll(ZMASSGUESS_2D) - ZMASS_O_PI = SUM_DD_R2_ll(ZMASS_O_PI_2D) - ZWATERMASST = SUM_DD_R2_ll(ZWATERMASST_2D) + ZMASSGUESS = SUM_DD_R2_ll_DEVICE(ZMASSGUESS_2D) + ZMASS_O_PI = SUM_DD_R2_ll_DEVICE(ZMASS_O_PI_2D) + ZWATERMASST = SUM_DD_R2_ll_DEVICE(ZWATERMASST_2D) ! ZMASS_O_PI = ZMASS_O_PI*ZP00_O_RD*ZCVD_O_RD ZPI0 = (PDRYMASST + ZWATERMASST - ZP00_O_RD*ZMASSGUESS ) / ZMASS_O_PI @@ -349,19 +367,32 @@ IF ( CEQNSYS=='DUR' .OR. CEQNSYS=='MAE' ) THEN !$acc end kernels IF ( CEQNSYS == 'DUR' ) THEN !$acc kernels +#ifdef MNH_COMPILER_CCE_1403 + !$acc loop + !$mnh_do_concurrent(JI=IIB:IIE,JJ=IJB:IJE,JK=IKB:IKE ) + PEXNREF_BR(JI,JJ,JK)=BR_POW((PEXNREF(JI,JJ,JK)+PPHIT(JI,JJ,JK)),ZCVD_O_RD) + !$mnh_end_do() +#endif + !$acc end kernels + !$acc parallel !$acc loop seq DO JK = IKB,IKE - !$mnh_do_concurrent(JI = IIB:IIE , JJ = IJB:IJE ) + !$acc loop independent + DO CONCURRENT ( JJ = IJB:IJE , JI = IIB:IIE ) ZMASSGUESS_2D(JI,JJ) = ZMASSGUESS_2D(JI,JJ) + & #if !defined(MNH_BITREP) && !defined(MNH_BITREP_OMP) (PEXNREF(JI,JJ,JK)+PPHIT(JI,JJ,JK))**ZCVD_O_RD & #else +#ifndef MNH_COMPILER_CCE_1403 BR_POW((PEXNREF(JI,JJ,JK)+PPHIT(JI,JJ,JK)),ZCVD_O_RD) & +#else + PEXNREF_BR(JI,JJ,JK) & +#endif #endif * ZWORK(JI,JJ,JK) / PTHETAV(JI,JJ,JK) - !$mnh_end_do() + END DO END DO - !$acc end kernels + !$acc end parallel ELSE DO JK = IKB,IKE DO JJ = IJB,IJE @@ -379,7 +410,7 @@ IF ( CEQNSYS=='DUR' .OR. CEQNSYS=='MAE' ) THEN END IF ! !$acc update host(ZMASSGUESS_2D) - ZMASSGUESS = SUM_DD_R2_ll(ZMASSGUESS_2D) + ZMASSGUESS = SUM_DD_R2_ll_DEVICE(ZMASSGUESS_2D) ! ZPI0 = (PDRYMASST + ZWATERMASST - ZP00_O_RD*ZMASSGUESS ) / ZMASS_O_PI !$acc kernels