diff --git a/src/MNH/rain_ice_fast_ri.f90 b/src/MNH/rain_ice_fast_ri.f90 index 8efd9cf0cfd7a0ba95e0802bfd0b2d4abf7d359f..65d9a1fcefe5a8e5680f47c2b2fdc1f29ebd8dc3 100644 --- a/src/MNH/rain_ice_fast_ri.f90 +++ b/src/MNH/rain_ice_fast_ri.f90 @@ -162,6 +162,7 @@ CALL MNH_MEM_GET( ZLBEXI, SIZE(PRHODREF) ) zzw(:) = 0. GWORK(:) = PRCS(:)>0.0 .AND. PSSI(:)>0.0 .AND. PRIT(:)>XRTMIN(4) .AND. PCIT(:)>0.0 #if !defined(MNH_BITREP) && !defined(MNH_BITREP_OMP) + !$mnh_expand_where(JL=1:JLU) WHERE( GWORK(:) ) ZZW(:) = MIN(1.E8,XLBI*( PRHODREF(:)*PRIT(:)/PCIT(:) )**XLBEXI) ! Lbda_i ZZW(:) = MIN( PRCS(:),( PSSI(:) / (PRHODREF(:)*PAI(:)) ) * PCIT(:) * & @@ -170,6 +171,7 @@ CALL MNH_MEM_GET( ZLBEXI, SIZE(PRHODREF) ) PRIS(:) = PRIS(:) + ZZW(:) PTHS(:) = PTHS(:) + ZZW(:)*(PLSFACT(:)-PLVFACT(:)) ! f(L_f*(RCBERI)) END WHERE + !$mnh_end_expand_where() #else !!$ Le DO concurrent n'est pas bit-reproductible BUG NVHPC 20.7 diff --git a/src/MNH/rain_ice_warm.f90 b/src/MNH/rain_ice_warm.f90 index d6a300b9d2eedd3c0d9494409540d2d9f267e7a2..48ec7a5d07dd5a376f40eccb205e846447495727 100644 --- a/src/MNH/rain_ice_warm.f90 +++ b/src/MNH/rain_ice_warm.f90 @@ -291,6 +291,7 @@ zzw(JL) = 0. !Evaporation only when there's no cloud (RC must be 0) GWORK(:) = PRRT(:)>XRTMIN(3) .AND. PRCT(:)<=XRTMIN(2) #if !defined(MNH_BITREP) && !defined(MNH_BITREP_OMP) + !$mnh_expand_where(JL=1:JLU) WHERE( GWORK(:) ) ZZW(:) = EXP( XALPW - XBETAW/PZT(:) - XGAMW*ALOG(PZT(:) ) ) ! es_w PUSW(:) = 1.0 - PRVT(:)*( PPRES(:)-ZZW(:) ) / ( (XMV/XMD) * ZZW(:) ) @@ -303,6 +304,7 @@ zzw(JL) = 0. PRVS(:) = PRVS(:) + ZZW(:) PTHS(:) = PTHS(:) - ZZW(:)*PLVFACT(:) END WHERE + !$mnh_end_expand_where() #else !$acc loop independent DO CONCURRENT ( JL=1:JLU ) diff --git a/src/MNH/tke_eps_sources.f90 b/src/MNH/tke_eps_sources.f90 index 29ac9391eca93ea12df85436603ea27fab7fce30..0636775b90ea108da8c655e84deaa8faa1166e6f 100644 --- a/src/MNH/tke_eps_sources.f90 +++ b/src/MNH/tke_eps_sources.f90 @@ -423,7 +423,9 @@ CALL MZM_DEVICE(ZKEFF, ZTMP1_DEVICE) !Warning: re-used later CALL MZM_DEVICE(PRHODJ,ZTMP2_DEVICE) !Warning: re-used later !$acc kernels ! present(ZA) #if !defined(MNH_BITREP) && !defined(MNH_BITREP_OMP) +!$mnh_expand_array(JI=1:JIU,JJ=1:JJU,JK=1:JKU) ZA(:,:,:) = - PTSTEP * XCET * ZTMP1_DEVICE(:,:,:) * ZTMP2_DEVICE(:,:,:) / PDZZ(:,:,:)**2 +!$mnh_end_expand_array() #else !$acc_nv loop independent collapse(3) DO CONCURRENT ( JI=1:JIU,JJ=1:JJU,JK=1:JKU) diff --git a/src/MNH/turb_hor_uv.f90 b/src/MNH/turb_hor_uv.f90 index fc112567527ebbae00a5a57de5d6490cecbd2aca..f8aff35b3f6bedd7cf6309c2ebab845e306ce294 100644 --- a/src/MNH/turb_hor_uv.f90 +++ b/src/MNH/turb_hor_uv.f90 @@ -465,13 +465,10 @@ ZFLX(:,:,IKB) = - XCMFS * ZTMP2_DEVICE(:,:,1) * ( ZTMP5_DEVICE(:,:,1) + ZTMP6_DE #endif ! ! extrapolates this flux under the ground with the surface flux -#ifdef MNH_COMPILER_CCE -!$acc kernels present(ZFLX) -#else -!$acc kernels -#endif +!$acc parallel present_cr(ZFLX) #ifndef MNH_BITREP -ZFLX(:,:,IKB-1) = & +!$mnh_expand_array(JI=1:JIU,JJ=1:JJU) + ZFLX(:,:,IKB-1) = & PTAU11M(:,:) * PCOSSLOPE(:,:) * PSINSLOPE(:,:) * PDIRCOSZW(:,:)**2 & +PTAU12M(:,:) * (PCOSSLOPE(:,:)**2 - PSINSLOPE(:,:)**2) * & PDIRCOSZW(:,:)**2 & @@ -481,25 +478,23 @@ ZFLX(:,:,IKB-1) = & 2. * PUSLOPEM(:,:) * PCOSSLOPE(:,:) * PSINSLOPE(:,:) * & PDIRCOSZW(:,:) * ZDIRSINZW(:,:) & +PVSLOPEM(:,:) * (PCOSSLOPE(:,:)**2 - PSINSLOPE(:,:)**2) * ZDIRSINZW(:,:) ) +!$mnh_end_expand_array() #else !PW: BUG: commented 'acc loop independent collapse(2)' to workaround compiler bug (NVHPC 21.1) -#ifdef MNH_COMPILER_NVHPC -!acc loop independent collapse(2) -#endif -DO CONCURRENT ( JI=1:JIU,JJ=1:JJU ) -ZFLX(JI,JJ,IKB-1) = & - PTAU11M(JI,JJ) * PCOSSLOPE(JI,JJ) * PSINSLOPE(JI,JJ) * BR_P2(PDIRCOSZW(JI,JJ)) & - +PTAU12M(JI,JJ) * (BR_P2(PCOSSLOPE(JI,JJ)) - BR_P2(PSINSLOPE(JI,JJ))) * & - BR_P2(PDIRCOSZW(JI,JJ)) & - -PTAU22M(JI,JJ) * PCOSSLOPE(JI,JJ) * PSINSLOPE(JI,JJ) & - +PTAU33M(JI,JJ) * PCOSSLOPE(JI,JJ) * PSINSLOPE(JI,JJ) * BR_P2(ZDIRSINZW(JI,JJ)) & - -PCDUEFF(JI,JJ) * ( & - 2. * PUSLOPEM(JI,JJ) * PCOSSLOPE(JI,JJ) * PSINSLOPE(JI,JJ) * & - PDIRCOSZW(JI,JJ) * ZDIRSINZW(JI,JJ) & - +PVSLOPEM(JI,JJ) * (BR_P2(PCOSSLOPE(JI,JJ)) - BR_P2(PSINSLOPE(JI,JJ))) * ZDIRSINZW(JI,JJ) ) -END DO ! CONCURRENT +!$mnh_expand_array(JI=1:JIU,JJ=1:JJU) + ZFLX(:,:,IKB-1) = & + PTAU11M(:,:) * PCOSSLOPE(:,:) * PSINSLOPE(:,:) * BR_P2(PDIRCOSZW(:,:)) & + +PTAU12M(:,:) * (BR_P2(PCOSSLOPE(:,:)) - BR_P2(PSINSLOPE(:,:))) * & + BR_P2(PDIRCOSZW(:,:)) & + -PTAU22M(:,:) * PCOSSLOPE(:,:) * PSINSLOPE(:,:) & + +PTAU33M(:,:) * PCOSSLOPE(:,:) * PSINSLOPE(:,:) * BR_P2(ZDIRSINZW(:,:)) & + -PCDUEFF(:,:) * ( & + 2. * PUSLOPEM(:,:) * PCOSSLOPE(:,:) * PSINSLOPE(:,:) * & + PDIRCOSZW(:,:) * ZDIRSINZW(:,:) & + +PVSLOPEM(:,:) * (BR_P2(PCOSSLOPE(:,:)) - BR_P2(PSINSLOPE(:,:))) * ZDIRSINZW(:,:) ) +!$mnh_end_expand_array() #endif -!$acc end kernels +!$acc end parallel ! #ifndef MNH_OPENACC ZFLX(:,:,IKB-1:IKB-1) = 2. * MXM( MYM( ZFLX(:,:,IKB-1:IKB-1) ) ) &