diff --git a/src/ZSOLVER/advection_metsv.f90 b/src/ZSOLVER/advection_metsv.f90 index 034505c02822ae387020f56a68dd01e87c82c9d3..e7b76ef20d5abcb4f2c7d6d183c1474cf5e8c8bd 100644 --- a/src/ZSOLVER/advection_metsv.f90 +++ b/src/ZSOLVER/advection_metsv.f90 @@ -668,12 +668,24 @@ ZCFLW_MAX = MAX_ll(ZCFLW,IINFO_ll) ZCFL_MAX = MAX_ll(ZCFL,IINFO_ll) #else ! +#ifndef MNH_COMPILER_NVHPC !$acc kernels ZCFLU_MAX = MAXVAL(ZCFLU(IIB:IIE,IJB:IJE,IKB:IKE)) ZCFLV_MAX = MAXVAL(ZCFLV(IIB:IIE,IJB:IJE,IKB:IKE)) ZCFLW_MAX = MAXVAL(ZCFLW(IIB:IIE,IJB:IJE,IKB:IKE)) ZCFL_MAX = MAXVAL(ZCFL (IIB:IIE,IJB:IJE,IKB:IKE)) !$acc end kernels +#else +ZCFLU_MAX = 0.0 ; ZCFLV_MAX = 0.0 ; ZCFLW_MAX = 0.0 ; ZCFL_MAX = 0.0 +!$acc parallel reduction(max:ZCFLU_MAX,ZCFLV_MAX,ZCFLW_MAX,ZCFL_MAX) +!$mnh_do_concurrent (JI=IIB:IIE,JJ=IJB:IJE,JK=IKB:IKE) + ZCFLU_MAX = MAX(ZCFLU_MAX,ZCFLU(JI,JJ,JK)) + ZCFLV_MAX = MAX(ZCFLV_MAX,ZCFLV(JI,JJ,JK)) + ZCFLW_MAX = MAX(ZCFLW_MAX,ZCFLW(JI,JJ,JK)) + ZCFL_MAX = MAX(ZCFL_MAX,ZCFL (JI,JJ,JK)) +!$mnh_end_do() +!$acc end parallel +#endif ! CALL MPI_ALLREDUCE(MPI_IN_PLACE,ZCFLU_MAX,1,MNHREAL_MPI,MPI_MAX,NMNH_COMM_WORLD,IINFO_ll) CALL MPI_ALLREDUCE(MPI_IN_PLACE,ZCFLV_MAX,1,MNHREAL_MPI,MPI_MAX,NMNH_COMM_WORLD,IINFO_ll)