Skip to content

Commit

Permalink
Add intent to slabsum arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Jisk Attema authored and fjansson committed Oct 9, 2020
1 parent 5887bd0 commit 85b2be8
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/modmpi.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 85b2be8

Please sign in to comment.