Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real | :: | aver(ks:kf) | ||||
integer | :: | ks | ||||
integer | :: | kf | ||||
real | :: | var(ib:ie,jb:je,kb:ke) | ||||
integer | :: | ib | ||||
integer | :: | ie | ||||
integer | :: | jb | ||||
integer | :: | je | ||||
integer | :: | kb | ||||
integer | :: | ke | ||||
integer | :: | ibs | ||||
integer | :: | ies | ||||
integer | :: | jbs | ||||
integer | :: | jes | ||||
integer | :: | kbs | ||||
integer | :: | kes |
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 :: averl(ks:kf) real :: avers(ks:kf) integer :: k averl = 0. avers = 0. do k=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) aver = aver + avers return end subroutine slabsum