avey_ibm Subroutine

public subroutine avey_ibm(aver, var, ib, ie, jb, je, kb, ke, II, IIt)

Arguments

Type IntentOptional Attributes Name
real :: aver(ib:ie,kb:ke)
real :: var(ib:ie,jb:je,kb:ke)
integer :: ib
integer :: ie
integer :: jb
integer :: je
integer :: kb
integer :: ke
integer :: II(ib:ie,jb:je,kb:ke)
integer :: IIt(ib:ie,kb:ke)

Calls

proc~~avey_ibm~~CallsGraph proc~avey_ibm avey_ibm mpi_allreduce mpi_allreduce proc~avey_ibm->mpi_allreduce

Called by

proc~~avey_ibm~~CalledByGraph proc~avey_ibm avey_ibm proc~statsdump statsdump proc~statsdump->proc~avey_ibm program~dalesurban DALESURBAN program~dalesurban->proc~statsdump

Source Code

  subroutine avey_ibm(aver,var,ib,ie,jb,je,kb,ke,II,IIt)
  implicit none
  integer                 :: ib,ie,jb,je,kb,ke
  real                    :: aver(ib:ie,kb:ke)
  real                    :: avero(ib:ie,kb:ke)
  real                    :: var(ib:ie,jb:je,kb:ke)
  integer                 :: II(ib:ie,jb:je,kb:ke)
  integer                 :: IIt(ib:ie,kb:ke)
  logical                 :: lytdump,lnan

  avero = 0.
  aver  = 0.

  avero = sum(var(ib:ie,jb:je,kb:ke)*II(ib:ie,jb:je,kb:ke), DIM=2)

  call MPI_ALLREDUCE(avero(ib:ie,kb:ke), aver(ib:ie,kb:ke), (ke-kb+1)*(ie-ib+1), MY_REAL,MPI_SUM, comm3d,mpierr)

  where (IIt==0)
    aver = -999.
  elsewhere
    aver = aver/IIt
  endwhere

  end subroutine avey_ibm