From 85b2be8179eac90029cdab284a371fb881fc461f Mon Sep 17 00:00:00 2001 From: Jisk Attema Date: Thu, 1 Oct 2020 13:57:37 +0200 Subject: [PATCH] Add intent to slabsum arguments --- src/modmpi.f90 | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/modmpi.f90 b/src/modmpi.f90 index fd7cc50b..4c9ae6f8 100644 --- a/src/modmpi.f90 +++ b/src/modmpi.f90 @@ -314,10 +314,11 @@ end subroutine excjs subroutine slabsum(aver,ks,kf,var,ib,ie,jb,je,kb,ke,ibs,ies,jbs,jes,kbs,kes) implicit none - integer :: ks,kf - integer :: ib,ie,jb,je,kb,ke,ibs,ies,jbs,jes,kbs,kes - real :: aver(ks:kf) - real :: var (ib:ie,jb:je,kb:ke) + real, intent(inout) :: aver(ks:kf) + integer, intent(in) :: ks,kf + integer, intent(in) :: ib,ie,jb,je,kb,ke,ibs,ies,jbs,jes,kbs,kes + real, intent(in) :: var(ib:ie,jb:je,kb:ke) + real :: averl(ks:kf) real :: avers(ks:kf) integer :: k @@ -329,12 +330,10 @@ subroutine slabsum(aver,ks,kf,var,ib,ie,jb,je,kb,ke,ibs,ies,jbs,jes,kbs,kes) averl(k) = sum(var(ibs:ies,jbs:jes,k)) enddo - call MPI_ALLREDUCE(averl, avers, kf-ks+1, MY_REAL, & - MPI_SUM, comm3d,mpierr) + call MPI_ALLREDUCE(averl, avers, kf-ks+1, MY_REAL, MPI_SUM, comm3d, mpierr) aver = aver + avers - return end subroutine slabsum subroutine mpi_get_time(val)