diff --git a/src/MNH/turb.f90 b/src/MNH/turb.f90 index 0c23b9dda34c4bd7706fae017cf0e0d47fce0029..ce9dcaf0ce9f90a64fcbb1386f23308e9862c62e 100644 --- a/src/MNH/turb.f90 +++ b/src/MNH/turb.f90 @@ -1084,11 +1084,11 @@ ZTAU33M(:,:) =ZTAU11M(:,:) ! ------------------------------------------------------------------ ! ! -ZMWTH = 0. ! w'2th' -ZMWR = 0. ! w'2r' -ZMTH2 = 0. ! w'th'2 -ZMR2 = 0. ! w'r'2 -ZMTHR = 0. ! w'th'r' +ZMWTH(:,:,:) = 0. ! w'2th' +ZMWR(:,:,:) = 0. ! w'2r' +ZMTH2(:,:,:) = 0. ! w'th'2 +ZMR2(:,:,:) = 0. ! w'r'2 +ZMTHR(:,:,:) = 0. ! w'th'r' !$acc end kernels IF (HTOM=='TM06') THEN @@ -1133,11 +1133,11 @@ IF (HTOM=='TM06') THEN !$acc end kernels ELSE !$acc kernels - ZFWTH = 0. - ZFWR = 0. - ZFTH2 = 0. - ZFR2 = 0. - ZFTHR = 0. + ZFWTH(:,:,:) = 0. + ZFWR(:,:,:) = 0. + ZFTH2(:,:,:) = 0. + ZFR2(:,:,:) = 0. + ZFTHR(:,:,:) = 0. !$acc end kernels ENDIF ! @@ -2537,10 +2537,33 @@ ELSE ENDIF ! IF (LOCEAN) THEN +#if 0 +!PW: bug: crash with nvhpc 21.11 (OK with 21.9) ZWORK2D(:,:)=XG*(XALPHAOC*ZDTHLDZ(:,:,KKB)-XBETAOC*ZDRTDZ(:,:,KKB)) +#else +!PW: bug: nvhpc 21.11 does not parallelize this loop even with loop independent directive! +#ifdef MNH_COMPILER_NVHPC +!$acc loop independent collapse(2) +#endif + DO CONCURRENT( JI = 1 : JIU, JJ = 1 : JJU ) + ZWORK2D(JI,JJ)=XG*(XALPHAOC*ZDTHLDZ(JI,JJ,KKB)-XBETAOC*ZDRTDZ(JI,JJ,KKB)) + END DO +#endif ELSE +#if 0 +!PW: bug: crash with nvhpc 21.11 (OK with 21.9) ZWORK2D(:,:)=XG/PTHVREF(:,:,KKB)* & (ZETHETA(:,:,KKB)*ZDTHLDZ(:,:,KKB)+ZEMOIST(:,:,KKB)*ZDRTDZ(:,:,KKB)) +#else +!PW: bug: nvhpc 21.11 does not parallelize this loop even with loop independent directive! +#ifdef MNH_COMPILER_NVHPC +!$acc loop independent collapse(2) +#endif + DO CONCURRENT( JI = 1 : JIU, JJ = 1 : JJU ) + ZWORK2D(JI,JJ)=XG/PTHVREF(JI,JJ,KKB)* & + (ZETHETA(JI,JJ,KKB)*ZDTHLDZ(JI,JJ,KKB)+ZEMOIST(JI,JJ,KKB)*ZDRTDZ(JI,JJ,KKB)) + END DO +#endif END IF WHERE(ZWORK2D(:,:)>0.) PLM(:,:,KKB)=MAX(XMNH_EPSILON,MIN( PLM(:,:,KKB), & diff --git a/src/ZSOLVER/turb.f90 b/src/ZSOLVER/turb.f90 index 7915e786000ca06b35d7c3674e957e5cb6e3e760..bb9d6007e3192be746fe6a74994fc9e597a564b8 100644 --- a/src/ZSOLVER/turb.f90 +++ b/src/ZSOLVER/turb.f90 @@ -1084,11 +1084,11 @@ ZTAU33M(:,:) =ZTAU11M(:,:) ! ------------------------------------------------------------------ ! ! -ZMWTH = 0. ! w'2th' -ZMWR = 0. ! w'2r' -ZMTH2 = 0. ! w'th'2 -ZMR2 = 0. ! w'r'2 -ZMTHR = 0. ! w'th'r' +ZMWTH(:,:,:) = 0. ! w'2th' +ZMWR(:,:,:) = 0. ! w'2r' +ZMTH2(:,:,:) = 0. ! w'th'2 +ZMR2(:,:,:) = 0. ! w'r'2 +ZMTHR(:,:,:) = 0. ! w'th'r' !$acc end kernels IF (HTOM=='TM06') THEN @@ -1133,11 +1133,11 @@ IF (HTOM=='TM06') THEN !$acc end kernels ELSE !$acc kernels - ZFWTH = 0. - ZFWR = 0. - ZFTH2 = 0. - ZFR2 = 0. - ZFTHR = 0. + ZFWTH(:,:,:) = 0. + ZFWR(:,:,:) = 0. + ZFTH2(:,:,:) = 0. + ZFR2(:,:,:) = 0. + ZFTHR(:,:,:) = 0. !$acc end kernels ENDIF ! @@ -2547,10 +2547,33 @@ ELSE ENDIF ! IF (LOCEAN) THEN +#if 0 +!PW: bug: crash with nvhpc 21.11 (OK with 21.9) ZWORK2D(:,:)=XG*(XALPHAOC*ZDTHLDZ(:,:,KKB)-XBETAOC*ZDRTDZ(:,:,KKB)) +#else +!PW: bug: nvhpc 21.11 does not parallelize this loop even with loop independent directive! +#ifdef MNH_COMPILER_NVHPC +!$acc loop independent collapse(2) +#endif + DO CONCURRENT( JI = 1 : JIU, JJ = 1 : JJU ) + ZWORK2D(JI,JJ)=XG*(XALPHAOC*ZDTHLDZ(JI,JJ,KKB)-XBETAOC*ZDRTDZ(JI,JJ,KKB)) + END DO +#endif ELSE +#if 0 +!PW: bug: crash with nvhpc 21.11 (OK with 21.9) ZWORK2D(:,:)=XG/PTHVREF(:,:,KKB)* & (ZETHETA(:,:,KKB)*ZDTHLDZ(:,:,KKB)+ZEMOIST(:,:,KKB)*ZDRTDZ(:,:,KKB)) +#else +!PW: bug: nvhpc 21.11 does not parallelize this loop even with loop independent directive! +#ifdef MNH_COMPILER_NVHPC +!$acc loop independent collapse(2) +#endif + DO CONCURRENT( JI = 1 : JIU, JJ = 1 : JJU ) + ZWORK2D(JI,JJ)=XG/PTHVREF(JI,JJ,KKB)* & + (ZETHETA(JI,JJ,KKB)*ZDTHLDZ(JI,JJ,KKB)+ZEMOIST(JI,JJ,KKB)*ZDRTDZ(JI,JJ,KKB)) + END DO +#endif END IF WHERE(ZWORK2D(:,:)>0.) PLM(:,:,KKB)=MAX(XMNH_EPSILON,MIN( PLM(:,:,KKB), &