excj Subroutine

public subroutine excj(a, sx, ex, sy, ey, sz, ez)

Arguments

Type IntentOptional Attributes Name
real :: a(sx:ex,sy:ey,sz:ez)
integer :: sx
integer :: ex
integer :: sy
integer :: ey
integer :: sz
integer :: ez

Calls

proc~~excj~~CallsGraph proc~excj modmpi::excj mpi_sendrecv mpi_sendrecv proc~excj->mpi_sendrecv

Called by

proc~~excj~~CalledByGraph proc~excj modmpi::excj proc~bcp modboundary::bcp proc~bcp->proc~excj proc~tderive modpois::tderive proc~tderive->proc~bcp proc~poisson modpois::poisson proc~poisson->proc~tderive program~dalesurban DALESURBAN program~dalesurban->proc~poisson

Contents

Source Code


Source Code

  subroutine excj( a, sx, ex, sy, ey, sz,ez)
    implicit none

  integer sx, ex, sy, ey, sz, ez
  real a(sx:ex, sy:ey, sz:ez)
  integer iiget, status(MPI_STATUS_SIZE)
  integer ii, i, k
  real,allocatable, dimension(:) :: buffj1,buffj2,buffj3,buffj4
  iiget = (ex - sx + 1)*(ez - sz + 1)

  allocate( buffj1(iiget),&
            buffj2(iiget),&
            buffj3(iiget),&
            buffj4(iiget))



  if(nbrtop/=MPI_PROC_NULL)then
    do k=sz,ez
    do i=sx,ex
      ii = i - sx + 1 + (k - sz )*(ex - sx + 1)
      buffj1(ii) = a(i,ey-1,k)
    enddo
    enddo
  endif
  call MPI_SENDRECV(  buffj1,  ii    , MY_REAL, nbrtop, 4, &
                      buffj2,  iiget , MY_REAL, nbrbottom,  4,      &
                      comm3d, status, mpierr )
  if(nbrbottom/=MPI_PROC_NULL)then
    do k=sz,ez
    do i=sx,ex
      ii = i - sx + 1 + (k - sz )*(ex - sx + 1)
      a(i,sy,k) = buffj2(ii)
    enddo
    enddo
  endif

!   call barrou()

  if(nbrbottom/=MPI_PROC_NULL)then
    do k=sz,ez
    do i=sx,ex
      ii = i - sx + 1 + (k - sz )*(ex - sx + 1)
      buffj3(ii) = a(i,sy+1,k)
    enddo
    enddo
  endif
  call MPI_SENDRECV(  buffj3,  ii    , MY_REAL, nbrbottom,  5, &
                          buffj4,  iiget , MY_REAL, nbrtop, 5, &
                          comm3d, status, mpierr )
  if(nbrtop/=MPI_PROC_NULL)then
    do k=sz,ez
    do i=sx,ex
      ii = i - sx + 1 + (k - sz )*(ex - sx + 1)
      a(i,ey,k) = buffj4(ii)
    enddo
    enddo
  endif

!   call barrou()
  deallocate (buffj1,buffj2,buffj3,buffj4)

  return
  end subroutine excj