slabsum Subroutine

public subroutine slabsum(aver, ks, kf, var, ib, ie, jb, je, kb, ke, ibs, ies, jbs, jes, kbs, kes)

Arguments

Type IntentOptional 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

Calls

proc~~slabsum~~CallsGraph proc~slabsum slabsum mpi_allreduce mpi_allreduce proc~slabsum->mpi_allreduce

Called by

proc~~slabsum~~CalledByGraph proc~slabsum slabsum proc~inletgen inletgen proc~inletgen->proc~slabsum proc~inletgennotemp inletgennotemp proc~inletgennotemp->proc~slabsum proc~readinitfiles readinitfiles proc~readinitfiles->proc~slabsum program~dalesurban DALESURBAN program~dalesurban->proc~readinitfiles

Source Code

  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