init2decomp Subroutine

public subroutine init2decomp()

Uses

  • proc~~init2decomp~~UsesGraph proc~init2decomp init2decomp decomp_2d decomp_2d proc~init2decomp->decomp_2d module~modglobal modglobal proc~init2decomp->module~modglobal module~modmpi modmpi proc~init2decomp->module~modmpi mpi mpi module~modmpi->mpi

Arguments

None

Calls

proc~~init2decomp~~CallsGraph proc~init2decomp init2decomp decomp_2d_init decomp_2d_init proc~init2decomp->decomp_2d_init mpi_cart_coords mpi_cart_coords proc~init2decomp->mpi_cart_coords mpi_cart_shift mpi_cart_shift proc~init2decomp->mpi_cart_shift

Called by

proc~~init2decomp~~CalledByGraph proc~init2decomp init2decomp program~dalesurban DALESURBAN program~dalesurban->proc~init2decomp

Source Code

   subroutine init2decomp
     use decomp_2d
     use modglobal, only : itot, jtot, ktot, BCxm, BCym, BCxm_periodic, Bcym_periodic
     use modmpi,    only : comm3d, myid, myidx, myidy, cmyidx, cmyidy, nprocx, nprocy, &
                           nbreast, nbrwest, nbrnorth, nbrsouth, mpierr
     implicit none

     logical, dimension(3) :: periodic_bc
     integer, dimension(2) :: myids

     if (BCxm .eq. BCxm_periodic .and. nprocx > 1) then
       periodic_bc(1) = .true.
     else
       periodic_bc(1) = .false.
     end if

     if (BCym .eq. BCym_periodic .and. nprocy > 1) then
       periodic_bc(2) = .true.
     else
       periodic_bc(2) = .false.
     end if

     periodic_bc(3) = .false.

     call decomp_2d_init(itot,jtot,ktot,nprocx,nprocy,periodic_bc)

     comm3d = DECOMP_2D_COMM_CART_Z

     call MPI_CART_COORDS(comm3d,myid,2,myids,mpierr)

     myidx = myids(1)
     myidy = myids(2)

     write(cmyidx,'(i3.3)') myidx
     write(cmyidy,'(i3.3)') myidy

     call MPI_CART_SHIFT(comm3d, 0,  1, nbrwest,  nbreast ,   mpierr)
     call MPI_CART_SHIFT(comm3d, 1,  1, nbrsouth, nbrnorth,   mpierr)

   end subroutine init2decomp