    MODULE EXCHM
    CONTAINS
    SUBROUTINE EXCH0(ARR1,LL1,IHALO,JHALO)
!*************************************************************************
!$$$  SUBPROGRAM DOCUMENTATION BLOCK
!                .      .    .
! SUBPROGRAM:    EXCHxxx     FUNDAMENTAL EXCHANGE ROUTINES
!   PRGRMMR: BLACK           ORG: W/NP2      DATE: 97-06-25

! ABSTRACT:
!     SUBROUTINE EXCH0 IS USED TO EXCHANGE HALOS BETWEEN PROCESSORS

!     CURRENTLY SUPPORTED INTERFACES

!     0,00,01,011,0001111
!     1,11,111,1111,11111,111111

!     WHERE 0 REFERS TO A 2-D ARRAY AND 1 REFERS TO A 3-D ARRAY

! PROGRAM HISTORY LOG:
!   97-05-??  MEYS       - ORIGINATOR
!   97-06-25  BLACK      - CONVERTED FROM SHMEM TO MPI
!   98-??-??  TUCCILLO   - REMOVED EXPLICIT EXCHANGES OF CORNERS
!   98-??-??  TUCCILLO   - REWROTE TO USE NON_BLOCKING MPI ROUTINES
!   99-??-??  BLACK      - ADDED VARIABLE HALO SIZES
!   00-03-10  TUCCILLO   - CHANGED TO USE MODULE PROCDURES FOR
!                          INCREASED MESSAGE SIZES AND A UNIFORM
!                          INTERFACE FOR ALL CALLS
!   01-02-25  TUCCILLO   - SOME PERFORMANCE IMPROVEMENTS

! USAGE: CALL EXCH FROM SUBROUTINE GOSSIP
!   INPUT ARGUMENT LIST:
!       ARR - THE ARRAY TO BE EXCHANGED
!       LL  - THE VERTICAL DIMENSION OF ARR
!     IHALO - THE NUMBER OF POINTS IN THE X DIRECTION TO EXCHANGE
!             IN THE HALO
!     JHALO - THE NUMBER OF POINTS IN THE Y DIRECTION TO EXCHANGE
!             IN THE HALO

!   OUTPUT ARGUMENT LIST:
!     NONE

!   OUTPUT FILES:
!     NONE

!   SUBPROGRAMS CALLED:

!     UNIQUE: NONE

!     LIBRARY: NONE

!   COMMON BLOCKS: NONE

! ATTRIBUTES:
!   LANGUAGE: FORTRAN 90
!   MACHINE : IBM SP
!$$$
    USE EXCH_BUF_REAL
!***********************************************************************
    INCLUDE "parmeta.f90"
    INCLUDE "mpif.h"
    INCLUDE "mpp.h"
!-----------------------------------------------------------------------
    INTEGER :: ISTAT(MPI_STATUS_SIZE)
    INTEGER :: IHANDLE(4)
    REAL :: ARR1(IDIM1:IDIM2,JDIM1:JDIM2)

!***********************************************************************

    ITYPE=MPI_REAL

!--------------------------------------------------------------------
!--------------------------------------------------------------------
!***
!***  NORTH/SOUTH
!***
!--------------------------------------------------------------------
!--------------------------------------------------------------------

!--------------------------------------------------------------------
!     RECEIVE FROM NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        CALL MPI_IRECV(BUF0,IBUFEXCH,ITYPE,MY_NEB(1),MY_NEB(1) &
        ,               MPI_COMM_COMP,IHANDLE(1),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     RECEIVE FROM SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        CALL MPI_IRECV(BUF1,IBUFEXCH,ITYPE,MY_NEB(3),MY_NEB(3) &
        ,               MPI_COMM_COMP,IHANDLE(2),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        IBEG = MYIS-IHALO
        IEND = MYIE+IHALO
        IC = 0
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                BUF2(IC)=ARR1(I,MYJE-J)
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF2,IC,ITYPE,MY_NEB(1),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(3),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        IBEG = MYIS-IHALO
        IEND = MYIE+IHALO
        IC = 0
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                BUF3(IC)=ARR1(I,MYJS+J)
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF3,IC,ITYPE,MY_NEB(3),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(4),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     STORE RESULTS FROM SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        IBEG = MYIS-IHALO
        IEND = MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(2),ISTAT,IERR)
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                ARR1(I,MYJS-J-1)=BUF1(IC)
            ENDDO
        ENDDO
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        IBEG = MYIS-IHALO
        IEND = MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(1),ISTAT,IERR)
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                ARR1(I,MYJE+J+1)=BUF0(IC)
            ENDDO
        ENDDO
    ENDIF

    IF(MY_NEB(1) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(3),ISTAT,IERR)
    ENDIF

    IF(MY_NEB(3) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(4),ISTAT,IERR)
    ENDIF

!--------------------------------------------------------------------
!--------------------------------------------------------------------
!***
!***  EAST/WEST
!***
!--------------------------------------------------------------------
!--------------------------------------------------------------------

!--------------------------------------------------------------------
!     RECEIVE FROM WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        CALL MPI_IRECV(BUF0,IBUFEXCH,ITYPE,MY_NEB(4),MY_NEB(4) &
        ,               MPI_COMM_COMP,IHANDLE(1),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     RECEIVE FROM EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        CALL MPI_IRECV(BUF1,IBUFEXCH,ITYPE,MY_NEB(2),MY_NEB(2) &
        ,               MPI_COMM_COMP,IHANDLE(2),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        IBEG = MYIE-IHALO+1
        IEND = MYIE
        IC = 0
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                BUF2(IC)=ARR1(I,J)
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF2,IC,ITYPE,MY_NEB(2),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(3),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        IBEG = MYIS
        IEND = MYIS+IHALO-1
        IC = 0
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                BUF3(IC)=ARR1(I,J)
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF3,IC,ITYPE,MY_NEB(4),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(4),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        IBEG = MYIS-IHALO
        IEND = MYIS-1
        IC = 0
        CALL MPI_WAIT(IHANDLE(1),ISTAT,IERR)
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                ARR1(I,J)=BUF0(IC)
            ENDDO
        ENDDO
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        IBEG = MYIE+1
        IEND = MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(2),ISTAT,IERR)
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                ARR1(I,J)=BUF1(IC)
            ENDDO
        ENDDO
    ENDIF

    IF(MY_NEB(4) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(4),ISTAT,IERR)
    ENDIF

    IF(MY_NEB(2) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(3),ISTAT,IERR)
    ENDIF

!--------------------------------------------------------------------
    END SUBROUTINE

    SUBROUTINE EXCH1(ARR1,LL1,IHALO,JHALO)
    USE EXCH_BUF_REAL
    INCLUDE "parmeta.f90"
    INCLUDE "mpif.h"
    INCLUDE "mpp.h"
!-----------------------------------------------------------------------
    INTEGER :: ISTAT(MPI_STATUS_SIZE)
    INTEGER :: IHANDLE(4)
    REAL :: ARR1(IDIM1:IDIM2,JDIM1:JDIM2,*)

!***********************************************************************

    ITYPE=MPI_REAL

!--------------------------------------------------------------------
!--------------------------------------------------------------------
!***
!***  NORTH/SOUTH
!***
!--------------------------------------------------------------------
!--------------------------------------------------------------------

!--------------------------------------------------------------------
!     RECEIVE FROM NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        CALL MPI_IRECV(BUF0,IBUFEXCH,ITYPE,MY_NEB(1),MY_NEB(1) &
        ,               MPI_COMM_COMP,IHANDLE(1),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     RECEIVE FROM SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        CALL MPI_IRECV(BUF1,IBUFEXCH,ITYPE,MY_NEB(3),MY_NEB(3) &
        ,               MPI_COMM_COMP,IHANDLE(2),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        IBEG = MYIS-IHALO
        IEND = MYIE+IHALO
        IC = 0
        DO K=1,LL1
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR1(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF2,IC,ITYPE,MY_NEB(1),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(3),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        IBEG = MYIS-IHALO
        IEND = MYIE+IHALO
        IC = 0
        DO K=1,LL1
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR1(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF3,IC,ITYPE,MY_NEB(3),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(4),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     STORE RESULTS FROM SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        IBEG = MYIS-IHALO
        IEND = MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(2),ISTAT,IERR)
        DO K=1,LL1
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR1(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        IBEG = MYIS-IHALO
        IEND = MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(1),ISTAT,IERR)
        DO K=1,LL1
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR1(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

    IF(MY_NEB(1) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(3),ISTAT,IERR)
    ENDIF

    IF(MY_NEB(3) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(4),ISTAT,IERR)
    ENDIF

!--------------------------------------------------------------------
!--------------------------------------------------------------------
!***
!***  EAST/WEST
!***
!--------------------------------------------------------------------
!--------------------------------------------------------------------

!--------------------------------------------------------------------
!     RECEIVE FROM WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        CALL MPI_IRECV(BUF0,IBUFEXCH,ITYPE,MY_NEB(4),MY_NEB(4) &
        ,               MPI_COMM_COMP,IHANDLE(1),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     RECEIVE FROM EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        CALL MPI_IRECV(BUF1,IBUFEXCH,ITYPE,MY_NEB(2),MY_NEB(2) &
        ,               MPI_COMM_COMP,IHANDLE(2),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        IBEG = MYIE-IHALO+1
        IEND = MYIE
        IC = 0
        DO K=1,LL1
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR1(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF2,IC,ITYPE,MY_NEB(2),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(3),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        IBEG = MYIS
        IEND = MYIS+IHALO-1
        IC = 0
        DO K=1,LL1
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR1(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF3,IC,ITYPE,MY_NEB(4),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(4),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        IBEG = MYIS-IHALO
        IEND = MYIS-1
        IC = 0
        CALL MPI_WAIT(IHANDLE(1),ISTAT,IERR)
        DO K=1,LL1
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR1(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        IBEG = MYIE+1
        IEND = MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(2),ISTAT,IERR)
        DO K=1,LL1
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR1(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

    IF(MY_NEB(4) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(4),ISTAT,IERR)
    ENDIF

    IF(MY_NEB(2) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(3),ISTAT,IERR)
    ENDIF

!--------------------------------------------------------------------
    END SUBROUTINE

    SUBROUTINE EXCH01(ARR1,LL1,ARR2,LL2,IHALO,JHALO)
    USE EXCH_BUF_REAL
    INCLUDE "parmeta.f90"
    INCLUDE "mpif.h"
    INCLUDE "mpp.h"
!-----------------------------------------------------------------------
    INTEGER :: ISTAT(MPI_STATUS_SIZE)
    INTEGER :: IHANDLE(4)
    REAL :: ARR1(IDIM1:IDIM2,JDIM1:JDIM2)
    REAL :: ARR2(IDIM1:IDIM2,JDIM1:JDIM2,*)

!***********************************************************************

    ITYPE=MPI_REAL

!--------------------------------------------------------------------
!--------------------------------------------------------------------
!***
!***  NORTH/SOUTH
!***
!--------------------------------------------------------------------
!--------------------------------------------------------------------

!--------------------------------------------------------------------
!     RECEIVE FROM NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        CALL MPI_IRECV(BUF0,IBUFEXCH,ITYPE,MY_NEB(1),MY_NEB(1) &
        ,               MPI_COMM_COMP,IHANDLE(1),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     RECEIVE FROM SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        CALL MPI_IRECV(BUF1,IBUFEXCH,ITYPE,MY_NEB(3),MY_NEB(3) &
        ,               MPI_COMM_COMP,IHANDLE(2),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        IBEG = MYIS-IHALO
        IEND = MYIE+IHALO
        IC = 0
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                BUF2(IC)=ARR1(I,MYJE-J)
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR2(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF2,IC,ITYPE,MY_NEB(1),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(3),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        IBEG = MYIS-IHALO
        IEND = MYIE+IHALO
        IC = 0
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                BUF3(IC)=ARR1(I,MYJS+J)
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR2(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF3,IC,ITYPE,MY_NEB(3),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(4),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     STORE RESULTS FROM SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        IBEG = MYIS-IHALO
        IEND = MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(2),ISTAT,IERR)
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                ARR1(I,MYJS-J-1)=BUF1(IC)
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        IBEG = MYIS-IHALO
        IEND = MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(1),ISTAT,IERR)
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                ARR1(I,MYJE+J+1)=BUF0(IC)
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

    IF(MY_NEB(1) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(3),ISTAT,IERR)
    ENDIF

    IF(MY_NEB(3) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(4),ISTAT,IERR)
    ENDIF

!--------------------------------------------------------------------
!--------------------------------------------------------------------
!***
!***  EAST/WEST
!***
!--------------------------------------------------------------------
!--------------------------------------------------------------------

!--------------------------------------------------------------------
!     RECEIVE FROM WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        CALL MPI_IRECV(BUF0,IBUFEXCH,ITYPE,MY_NEB(4),MY_NEB(4) &
        ,               MPI_COMM_COMP,IHANDLE(1),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     RECEIVE FROM EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        CALL MPI_IRECV(BUF1,IBUFEXCH,ITYPE,MY_NEB(2),MY_NEB(2) &
        ,               MPI_COMM_COMP,IHANDLE(2),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        IBEG = MYIE-IHALO+1
        IEND = MYIE
        IC = 0
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                BUF2(IC)=ARR1(I,J)
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR2(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF2,IC,ITYPE,MY_NEB(2),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(3),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        IBEG = MYIS
        IEND = MYIS+IHALO-1
        IC = 0
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                BUF3(IC)=ARR1(I,J)
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR2(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF3,IC,ITYPE,MY_NEB(4),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(4),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        IBEG = MYIS-IHALO
        IEND = MYIS-1
        IC = 0
        CALL MPI_WAIT(IHANDLE(1),ISTAT,IERR)
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                ARR1(I,J)=BUF0(IC)
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        IBEG = MYIE+1
        IEND = MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(2),ISTAT,IERR)
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                ARR1(I,J)=BUF1(IC)
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

    IF(MY_NEB(4) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(4),ISTAT,IERR)
    ENDIF

    IF(MY_NEB(2) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(3),ISTAT,IERR)
    ENDIF

!--------------------------------------------------------------------
    END SUBROUTINE

    SUBROUTINE EXCH00(ARR1,LL1,ARR2,LL2,IHALO,JHALO)
    USE EXCH_BUF_REAL
    INCLUDE "parmeta.f90"
    INCLUDE "mpif.h"
    INCLUDE "mpp.h"
!-----------------------------------------------------------------------
    INTEGER :: ISTAT(MPI_STATUS_SIZE)
    INTEGER :: IHANDLE(4)
    REAL :: ARR1(IDIM1:IDIM2,JDIM1:JDIM2)
    REAL :: ARR2(IDIM1:IDIM2,JDIM1:JDIM2)

!***********************************************************************

    ITYPE=MPI_REAL

!--------------------------------------------------------------------
!--------------------------------------------------------------------
!***
!***  NORTH/SOUTH
!***
!--------------------------------------------------------------------
!--------------------------------------------------------------------

!--------------------------------------------------------------------
!     RECEIVE FROM NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        CALL MPI_IRECV(BUF0,IBUFEXCH,ITYPE,MY_NEB(1),MY_NEB(1) &
        ,               MPI_COMM_COMP,IHANDLE(1),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     RECEIVE FROM SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        CALL MPI_IRECV(BUF1,IBUFEXCH,ITYPE,MY_NEB(3),MY_NEB(3) &
        ,               MPI_COMM_COMP,IHANDLE(2),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                BUF2(IC)=ARR1(I,MYJE-J)
            ENDDO
        ENDDO
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                BUF2(IC)=ARR2(I,MYJE-J)
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF2,IC,ITYPE,MY_NEB(1),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(3),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                BUF3(IC)=ARR1(I,MYJS+J)
            ENDDO
        ENDDO
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                BUF3(IC)=ARR2(I,MYJS+J)
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF3,IC,ITYPE,MY_NEB(3),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(4),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     STORE RESULTS FROM SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(2),ISTAT,IERR)
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                ARR1(I,MYJS-J-1)=BUF1(IC)
            ENDDO
        ENDDO
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                ARR2(I,MYJS-J-1)=BUF1(IC)
            ENDDO
        ENDDO
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(1),ISTAT,IERR)
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                ARR1(I,MYJE+J+1)=BUF0(IC)
            ENDDO
        ENDDO
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                ARR2(I,MYJE+J+1)=BUF0(IC)
            ENDDO
        ENDDO
    ENDIF

    IF(MY_NEB(1) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(3),ISTAT,IERR)
    ENDIF

    IF(MY_NEB(3) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(4),ISTAT,IERR)
    ENDIF

!--------------------------------------------------------------------
!--------------------------------------------------------------------
!***
!***  EAST/WEST
!***
!--------------------------------------------------------------------
!--------------------------------------------------------------------

!--------------------------------------------------------------------
!     RECEIVE FROM WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        CALL MPI_IRECV(BUF0,IBUFEXCH,ITYPE,MY_NEB(4),MY_NEB(4) &
        ,               MPI_COMM_COMP,IHANDLE(1),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     RECEIVE FROM EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        CALL MPI_IRECV(BUF1,IBUFEXCH,ITYPE,MY_NEB(2),MY_NEB(2) &
        ,               MPI_COMM_COMP,IHANDLE(2),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        IBEG=MYIE-IHALO+1
        IEND=MYIE
        IC = 0
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                BUF2(IC)=ARR1(I,J)
            ENDDO
        ENDDO
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                BUF2(IC)=ARR2(I,J)
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF2,IC,ITYPE,MY_NEB(2),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(3),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        IBEG=MYIS
        IEND=MYIS+IHALO-1
        IC = 0
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                BUF3(IC)=ARR1(I,J)
            ENDDO
        ENDDO
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                BUF3(IC)=ARR2(I,J)
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF3,IC,ITYPE,MY_NEB(4),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(4),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIS-1
        IC = 0
        CALL MPI_WAIT(IHANDLE(1),ISTAT,IERR)
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                ARR1(I,J)=BUF0(IC)
            ENDDO
        ENDDO
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                ARR2(I,J)=BUF0(IC)
            ENDDO
        ENDDO
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        IBEG=MYIE+1
        IEND=MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(2),ISTAT,IERR)
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                ARR1(I,J)=BUF1(IC)
            ENDDO
        ENDDO
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                ARR2(I,J)=BUF1(IC)
            ENDDO
        ENDDO
    ENDIF

    IF(MY_NEB(4) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(4),ISTAT,IERR)
    ENDIF

    IF(MY_NEB(2) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(3),ISTAT,IERR)
    ENDIF

!--------------------------------------------------------------------
    END SUBROUTINE

    SUBROUTINE EXCH11(ARR1,LL1,ARR2,LL2,IHALO,JHALO)
    USE EXCH_BUF_REAL
    INCLUDE "parmeta.f90"
    INCLUDE "mpif.h"
    INCLUDE "mpp.h"
!-----------------------------------------------------------------------
    INTEGER :: ISTAT(MPI_STATUS_SIZE)
    INTEGER :: IHANDLE(4)
    REAL :: ARR1(IDIM1:IDIM2,JDIM1:JDIM2,*)
    REAL :: ARR2(IDIM1:IDIM2,JDIM1:JDIM2,*)

!***********************************************************************

    ITYPE=MPI_REAL

!--------------------------------------------------------------------
!--------------------------------------------------------------------
!***
!***  NORTH/SOUTH
!***
!--------------------------------------------------------------------
!--------------------------------------------------------------------

!--------------------------------------------------------------------
!     RECEIVE FROM NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        CALL MPI_IRECV(BUF0,IBUFEXCH,ITYPE,MY_NEB(1),MY_NEB(1) &
        ,               MPI_COMM_COMP,IHANDLE(1),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     RECEIVE FROM SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        CALL MPI_IRECV(BUF1,IBUFEXCH,ITYPE,MY_NEB(3),MY_NEB(3) &
        ,               MPI_COMM_COMP,IHANDLE(2),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        IBEG = MYIS-IHALO
        IEND = MYIE+IHALO
        IC = 0
        DO K=1,LL1
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR1(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR2(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF2,IC,ITYPE,MY_NEB(1),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(3),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        IBEG = MYIS-IHALO
        IEND = MYIE+IHALO
        IC = 0
        DO K=1,LL1
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR1(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR2(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF3,IC,ITYPE,MY_NEB(3),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(4),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     STORE RESULTS FROM SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        IBEG = MYIS-IHALO
        IEND = MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(2),ISTAT,IERR)
        DO K=1,LL1
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR1(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        IBEG = MYIS-IHALO
        IEND = MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(1),ISTAT,IERR)
        DO K=1,LL1
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR1(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

    IF(MY_NEB(1) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(3),ISTAT,IERR)
    ENDIF

    IF(MY_NEB(3) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(4),ISTAT,IERR)
    ENDIF

!--------------------------------------------------------------------
!--------------------------------------------------------------------
!***
!***  EAST/WEST
!***
!--------------------------------------------------------------------
!--------------------------------------------------------------------

!--------------------------------------------------------------------
!     RECEIVE FROM WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        CALL MPI_IRECV(BUF0,IBUFEXCH,ITYPE,MY_NEB(4),MY_NEB(4) &
        ,               MPI_COMM_COMP,IHANDLE(1),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     RECEIVE FROM EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        CALL MPI_IRECV(BUF1,IBUFEXCH,ITYPE,MY_NEB(2),MY_NEB(2) &
        ,               MPI_COMM_COMP,IHANDLE(2),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        IBEG = MYIE-IHALO+1
        IEND = MYIE
        IC = 0
        DO K=1,LL1
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR1(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR2(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF2,IC,ITYPE,MY_NEB(2),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(3),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        IBEG = MYIS
        IEND = MYIS+IHALO-1
        IC = 0
        DO K=1,LL1
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR1(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR2(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF3,IC,ITYPE,MY_NEB(4),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(4),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        IBEG = MYIS-IHALO
        IEND = MYIS-1
        IC = 0
        CALL MPI_WAIT(IHANDLE(1),ISTAT,IERR)
        DO K=1,LL1
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR1(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        IBEG = MYIE+1
        IEND = MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(2),ISTAT,IERR)
        DO K=1,LL1
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR1(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

    IF(MY_NEB(4) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(4),ISTAT,IERR)
    ENDIF

    IF(MY_NEB(2) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(3),ISTAT,IERR)
    ENDIF

!--------------------------------------------------------------------
    END SUBROUTINE

    SUBROUTINE EXCH111(ARR1,LL1,ARR2,LL2,ARR3,LL3,IHALO,JHALO)
    USE EXCH_BUF_REAL
    INCLUDE "parmeta.f90"
    INCLUDE "mpif.h"
    INCLUDE "mpp.h"
!-----------------------------------------------------------------------
    INTEGER :: ISTAT(MPI_STATUS_SIZE)
    INTEGER :: IHANDLE(4)
    REAL :: ARR1(IDIM1:IDIM2,JDIM1:JDIM2,*)
    REAL :: ARR2(IDIM1:IDIM2,JDIM1:JDIM2,*)
    REAL :: ARR3(IDIM1:IDIM2,JDIM1:JDIM2,*)

!***********************************************************************

    ITYPE=MPI_REAL

!--------------------------------------------------------------------
!--------------------------------------------------------------------
!***
!***  NORTH/SOUTH
!***
!--------------------------------------------------------------------
!--------------------------------------------------------------------

!--------------------------------------------------------------------
!     RECEIVE FROM NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        CALL MPI_IRECV(BUF0,IBUFEXCH,ITYPE,MY_NEB(1),MY_NEB(1) &
        ,               MPI_COMM_COMP,IHANDLE(1),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     RECEIVE FROM SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        CALL MPI_IRECV(BUF1,IBUFEXCH,ITYPE,MY_NEB(3),MY_NEB(3) &
        ,               MPI_COMM_COMP,IHANDLE(2),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        DO K=1,LL1
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR1(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR2(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR3(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF2,IC,ITYPE,MY_NEB(1),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(3),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        DO K=1,LL1
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR1(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR2(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR3(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF3,IC,ITYPE,MY_NEB(3),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(4),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     STORE RESULTS FROM SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(2),ISTAT,IERR)
        DO K=1,LL1
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR1(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR3(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(1),ISTAT,IERR)
        DO K=1,LL1
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR1(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR3(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

    IF(MY_NEB(1) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(3),ISTAT,IERR)
    ENDIF

    IF(MY_NEB(3) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(4),ISTAT,IERR)
    ENDIF

!--------------------------------------------------------------------
!--------------------------------------------------------------------
!***
!***  EAST/WEST
!***
!--------------------------------------------------------------------
!--------------------------------------------------------------------

!--------------------------------------------------------------------
!     RECEIVE FROM WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        CALL MPI_IRECV(BUF0,IBUFEXCH,ITYPE,MY_NEB(4),MY_NEB(4) &
        ,               MPI_COMM_COMP,IHANDLE(1),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     RECEIVE FROM EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        CALL MPI_IRECV(BUF1,IBUFEXCH,ITYPE,MY_NEB(2),MY_NEB(2) &
        ,               MPI_COMM_COMP,IHANDLE(2),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        IBEG=MYIE-IHALO+1
        IEND=MYIE
        IC = 0
        DO K=1,LL1
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR1(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR2(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR3(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF2,IC,ITYPE,MY_NEB(2),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(3),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        NEBPE=MY_NEB(4)
        IBEG=MYIS
        IEND=MYIS+IHALO-1
        IC = 0
        DO K=1,LL1
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR1(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR2(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR3(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF3,IC,ITYPE,MY_NEB(4),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(4),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIS-1
        IC = 0
        CALL MPI_WAIT(IHANDLE(1),ISTAT,IERR)
        DO K=1,LL1
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR1(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR3(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        IBEG=MYIE+1
        IEND=MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(2),ISTAT,IERR)
        DO K=1,LL1
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR1(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR3(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

    IF(MY_NEB(4) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(4),ISTAT,IERR)
    ENDIF

    IF(MY_NEB(2) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(3),ISTAT,IERR)
    ENDIF

!--------------------------------------------------------------------
    END SUBROUTINE

    SUBROUTINE EXCH1111(ARR1,LL1,ARR2,LL2,ARR3,LL3, &
    ARR4,LL4,IHALO,JHALO)
    USE EXCH_BUF_REAL
    INCLUDE "parmeta.f90"
    INCLUDE "mpif.h"
    INCLUDE "mpp.h"
!-----------------------------------------------------------------------
    INTEGER :: ISTAT(MPI_STATUS_SIZE)
    INTEGER :: IHANDLE(4)
    REAL :: ARR1(IDIM1:IDIM2,JDIM1:JDIM2,*)
    REAL :: ARR2(IDIM1:IDIM2,JDIM1:JDIM2,*)
    REAL :: ARR3(IDIM1:IDIM2,JDIM1:JDIM2,*)
    REAL :: ARR4(IDIM1:IDIM2,JDIM1:JDIM2,*)

!***********************************************************************

    ITYPE=MPI_REAL

!--------------------------------------------------------------------
!--------------------------------------------------------------------
!***
!***  NORTH/SOUTH
!***
!--------------------------------------------------------------------
!--------------------------------------------------------------------

!--------------------------------------------------------------------
!     RECEIVE FROM NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        CALL MPI_IRECV(BUF0,IBUFEXCH,ITYPE,MY_NEB(1),MY_NEB(1) &
        ,               MPI_COMM_COMP,IHANDLE(1),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     RECEIVE FROM SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        CALL MPI_IRECV(BUF1,IBUFEXCH,ITYPE,MY_NEB(3),MY_NEB(3) &
        ,               MPI_COMM_COMP,IHANDLE(2),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        DO K=1,LL1
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR1(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR2(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR3(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR4(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF2,IC,ITYPE,MY_NEB(1),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(3),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        DO K=1,LL1
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR1(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR2(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR3(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR4(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF3,IC,ITYPE,MY_NEB(3),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(4),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     STORE RESULTS FROM SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(2),ISTAT,IERR)
        DO K=1,LL1
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR1(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR3(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR4(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(1),ISTAT,IERR)
        DO K=1,LL1
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR1(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR3(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR4(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

    IF(MY_NEB(1) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(3),ISTAT,IERR)
    ENDIF

    IF(MY_NEB(3) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(4),ISTAT,IERR)
    ENDIF

!--------------------------------------------------------------------
!--------------------------------------------------------------------
!***
!***  EAST/WEST
!***
!--------------------------------------------------------------------
!--------------------------------------------------------------------

!--------------------------------------------------------------------
!     RECEIVE FROM WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        CALL MPI_IRECV(BUF0,IBUFEXCH,ITYPE,MY_NEB(4),MY_NEB(4) &
        ,               MPI_COMM_COMP,IHANDLE(1),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     RECEIVE FROM EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        CALL MPI_IRECV(BUF1,IBUFEXCH,ITYPE,MY_NEB(2),MY_NEB(2) &
        ,               MPI_COMM_COMP,IHANDLE(2),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        NEBPE=MY_NEB(2)
        IBEG=MYIE-IHALO+1
        IEND=MYIE
        IC = 0
        DO K=1,LL1
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR1(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR2(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR3(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR4(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF2,IC,ITYPE,MY_NEB(2),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(3),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        IBEG=MYIS
        IEND=MYIS+IHALO-1
        IC = 0
        DO K=1,LL1
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR1(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR2(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR3(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR4(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF3,IC,ITYPE,MY_NEB(4),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(4),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIS-1
        IC = 0
        CALL MPI_WAIT(IHANDLE(1),ISTAT,IERR)
        DO K=1,LL1
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR1(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR3(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR4(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        IBEG=MYIE+1
        IEND=MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(2),ISTAT,IERR)
        DO K=1,LL1
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR1(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR3(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR4(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

    IF(MY_NEB(4) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(4),ISTAT,IERR)
    ENDIF

    IF(MY_NEB(2) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(3),ISTAT,IERR)
    ENDIF

!--------------------------------------------------------------------
    END SUBROUTINE

    SUBROUTINE EXCH11111(ARR1,LL1,ARR2,LL2,ARR3,LL3, &
    ARR4,LL4,ARR5,LL5,IHALO,JHALO)
    USE EXCH_BUF_REAL
    INCLUDE "parmeta.f90"
    INCLUDE "mpif.h"
    INCLUDE "mpp.h"
!-----------------------------------------------------------------------
    INTEGER :: ISTAT(MPI_STATUS_SIZE)
    INTEGER :: IHANDLE(4)
    REAL :: ARR1(IDIM1:IDIM2,JDIM1:JDIM2,*)
    REAL :: ARR2(IDIM1:IDIM2,JDIM1:JDIM2,*)
    REAL :: ARR3(IDIM1:IDIM2,JDIM1:JDIM2,*)
    REAL :: ARR4(IDIM1:IDIM2,JDIM1:JDIM2,*)
    REAL :: ARR5(IDIM1:IDIM2,JDIM1:JDIM2,*)

!***********************************************************************

    ITYPE=MPI_REAL

!--------------------------------------------------------------------
!--------------------------------------------------------------------
!***
!***  NORTH/SOUTH
!***
!--------------------------------------------------------------------
!--------------------------------------------------------------------

!--------------------------------------------------------------------
!     RECEIVE FROM NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        CALL MPI_IRECV(BUF0,IBUFEXCH,ITYPE,MY_NEB(1),MY_NEB(1) &
        ,               MPI_COMM_COMP,IHANDLE(1),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     RECEIVE FROM SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        CALL MPI_IRECV(BUF1,IBUFEXCH,ITYPE,MY_NEB(3),MY_NEB(3) &
        ,               MPI_COMM_COMP,IHANDLE(2),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        DO K=1,LL1
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR1(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR2(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR3(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR4(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL5
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR5(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF2,IC,ITYPE,MY_NEB(1),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(3),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        DO K=1,LL1
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR1(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR2(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR3(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR4(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL5
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR5(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF3,IC,ITYPE,MY_NEB(3),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(4),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     STORE RESULTS FROM SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(2),ISTAT,IERR)
        DO K=1,LL1
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR1(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR3(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR4(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL5
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR5(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(1),ISTAT,IERR)
        DO K=1,LL1
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR1(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR3(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR4(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL5
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR5(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

    IF(MY_NEB(1) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(3),ISTAT,IERR)
    ENDIF

    IF(MY_NEB(3) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(4),ISTAT,IERR)
    ENDIF

!--------------------------------------------------------------------
!--------------------------------------------------------------------
!***
!***  EAST/WEST
!***
!--------------------------------------------------------------------
!--------------------------------------------------------------------

!--------------------------------------------------------------------
!     RECEIVE FROM WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        CALL MPI_IRECV(BUF0,IBUFEXCH,ITYPE,MY_NEB(4),MY_NEB(4) &
        ,               MPI_COMM_COMP,IHANDLE(1),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     RECEIVE FROM EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        CALL MPI_IRECV(BUF1,IBUFEXCH,ITYPE,MY_NEB(2),MY_NEB(2) &
        ,               MPI_COMM_COMP,IHANDLE(2),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        IBEG=MYIE-IHALO+1
        IEND=MYIE
        IC = 0
        DO K=1,LL1
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR1(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR2(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR3(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR4(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL5
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR5(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF2,IC,ITYPE,MY_NEB(2),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(3),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        IBEG=MYIS
        IEND=MYIS+IHALO-1
        IC = 0
        DO K=1,LL1
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR1(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR2(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR3(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR4(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL5
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR5(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF3,IC,ITYPE,MY_NEB(4),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(4),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIS-1
        IC = 0
        CALL MPI_WAIT(IHANDLE(1),ISTAT,IERR)
        DO K=1,LL1
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR1(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR3(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR4(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL5
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR5(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        IBEG=MYIE+1
        IEND=MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(2),ISTAT,IERR)
        DO K=1,LL1
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR1(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR3(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR4(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL5
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR5(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

    IF(MY_NEB(4) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(4),ISTAT,IERR)
    ENDIF

    IF(MY_NEB(2) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(3),ISTAT,IERR)
    ENDIF

!--------------------------------------------------------------------
    END SUBROUTINE

    SUBROUTINE EXCH111111(ARR1,LL1,ARR2,LL2,ARR3,LL3,ARR4,LL4 &
    ,                     ARR5,LL5,ARR6,LL6,IHALO,JHALO)
    USE EXCH_BUF_REAL
    INCLUDE "parmeta.f90"
    INCLUDE "mpif.h"
    INCLUDE "mpp.h"
!-----------------------------------------------------------------------
    INTEGER :: ISTAT(MPI_STATUS_SIZE)
    INTEGER :: IHANDLE(4)
    REAL :: ARR1(IDIM1:IDIM2,JDIM1:JDIM2,*)
    REAL :: ARR2(IDIM1:IDIM2,JDIM1:JDIM2,*)
    REAL :: ARR3(IDIM1:IDIM2,JDIM1:JDIM2,*)
    REAL :: ARR4(IDIM1:IDIM2,JDIM1:JDIM2,*)
    REAL :: ARR5(IDIM1:IDIM2,JDIM1:JDIM2,*)
    REAL :: ARR6(IDIM1:IDIM2,JDIM1:JDIM2,*)

!***********************************************************************

    ITYPE=MPI_REAL

!--------------------------------------------------------------------
!--------------------------------------------------------------------
!***
!***  NORTH/SOUTH
!***
!--------------------------------------------------------------------
!--------------------------------------------------------------------

!--------------------------------------------------------------------
!     RECEIVE FROM NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        CALL MPI_IRECV(BUF0,IBUFEXCH,ITYPE,MY_NEB(1),MY_NEB(1) &
        ,               MPI_COMM_COMP,IHANDLE(1),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     RECEIVE FROM SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        CALL MPI_IRECV(BUF1,IBUFEXCH,ITYPE,MY_NEB(3),MY_NEB(3) &
        ,               MPI_COMM_COMP,IHANDLE(2),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        DO K=1,LL1
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR1(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR2(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR3(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR4(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL5
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR5(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL6
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR6(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF2,IC,ITYPE,MY_NEB(1),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(3),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        DO K=1,LL1
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR1(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR2(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR3(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR4(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL5
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR5(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL6
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR6(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF3,IC,ITYPE,MY_NEB(3),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(4),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     STORE RESULTS FROM SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(2),ISTAT,IERR)
        DO K=1,LL1
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR1(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR3(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR4(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL5
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR5(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL6
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR6(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(1),ISTAT,IERR)
        DO K=1,LL1
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR1(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR3(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR4(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL5
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR5(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL6
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR6(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

    IF(MY_NEB(1) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(3),ISTAT,IERR)
    ENDIF

    IF(MY_NEB(3) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(4),ISTAT,IERR)
    ENDIF

!--------------------------------------------------------------------
!--------------------------------------------------------------------
!***
!***  EAST/WEST
!***
!--------------------------------------------------------------------
!--------------------------------------------------------------------

!--------------------------------------------------------------------
!     RECEIVE FROM WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        CALL MPI_IRECV(BUF0,IBUFEXCH,ITYPE,MY_NEB(4),MY_NEB(4) &
        ,               MPI_COMM_COMP,IHANDLE(1),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     RECEIVE FROM EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        CALL MPI_IRECV(BUF1,IBUFEXCH,ITYPE,MY_NEB(2),MY_NEB(2) &
        ,               MPI_COMM_COMP,IHANDLE(2),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        IBEG=MYIE-IHALO+1
        IEND=MYIE
        IC = 0
        DO K=1,LL1
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR1(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR2(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR3(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR4(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL5
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR5(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL6
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR6(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF2,IC,ITYPE,MY_NEB(2),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(3),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        IBEG=MYIS
        IEND=MYIS+IHALO-1
        IC = 0
        DO K=1,LL1
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR1(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR2(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR3(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR4(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL5
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR5(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL6
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR6(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF3,IC,ITYPE,MY_NEB(4),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(4),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIS-1
        IC = 0
        CALL MPI_WAIT(IHANDLE(1),ISTAT,IERR)
        DO K=1,LL1
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR1(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR3(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR4(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL5
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR5(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL6
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR6(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        IBEG=MYIE+1
        IEND=MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(2),ISTAT,IERR)
        DO K=1,LL1
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR1(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR3(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR4(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL5
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR5(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL6
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR6(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

    IF(MY_NEB(4) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(4),ISTAT,IERR)
    ENDIF

    IF(MY_NEB(2) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(3),ISTAT,IERR)
    ENDIF

!--------------------------------------------------------------------
    END SUBROUTINE

    SUBROUTINE EXCH011(ARR1,LL1,ARR2,LL2,ARR3,LL3,IHALO,JHALO)
    USE EXCH_BUF_REAL
    INCLUDE "parmeta.f90"
    INCLUDE "mpif.h"
    INCLUDE "mpp.h"
!-----------------------------------------------------------------------
    INTEGER :: ISTAT(MPI_STATUS_SIZE)
    INTEGER :: IHANDLE(4)
    REAL :: ARR1(IDIM1:IDIM2,JDIM1:JDIM2)
    REAL :: ARR2(IDIM1:IDIM2,JDIM1:JDIM2,*)
    REAL :: ARR3(IDIM1:IDIM2,JDIM1:JDIM2,*)

!***********************************************************************

    ITYPE=MPI_REAL

!--------------------------------------------------------------------
!--------------------------------------------------------------------
!***
!***  NORTH/SOUTH
!***
!--------------------------------------------------------------------
!--------------------------------------------------------------------

!--------------------------------------------------------------------
!     RECEIVE FROM NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        CALL MPI_IRECV(BUF0,IBUFEXCH,ITYPE,MY_NEB(1),MY_NEB(1) &
        ,               MPI_COMM_COMP,IHANDLE(1),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     RECEIVE FROM SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        CALL MPI_IRECV(BUF1,IBUFEXCH,ITYPE,MY_NEB(3),MY_NEB(3) &
        ,               MPI_COMM_COMP,IHANDLE(2),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                BUF2(IC)=ARR1(I,MYJE-J)
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR2(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR3(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF2,IC,ITYPE,MY_NEB(1),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(3),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                BUF3(IC)=ARR1(I,MYJS+J)
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR2(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR3(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF3,IC,ITYPE,MY_NEB(3),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(4),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     STORE RESULTS FROM SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(2),ISTAT,IERR)
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                ARR1(I,MYJS-J-1)=BUF1(IC)
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR3(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(1),ISTAT,IERR)
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                ARR1(I,MYJE+J+1)=BUF0(IC)
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR3(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

    IF(MY_NEB(1) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(3),ISTAT,IERR)
    ENDIF

    IF(MY_NEB(3) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(4),ISTAT,IERR)
    ENDIF

!--------------------------------------------------------------------
!--------------------------------------------------------------------
!***
!***  EAST/WEST
!***
!--------------------------------------------------------------------
!--------------------------------------------------------------------

!--------------------------------------------------------------------
!     RECEIVE FROM WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        CALL MPI_IRECV(BUF0,IBUFEXCH,ITYPE,MY_NEB(4),MY_NEB(4) &
        ,               MPI_COMM_COMP,IHANDLE(1),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     RECEIVE FROM EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        CALL MPI_IRECV(BUF1,IBUFEXCH,ITYPE,MY_NEB(2),MY_NEB(2) &
        ,               MPI_COMM_COMP,IHANDLE(2),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        IBEG=MYIE-IHALO+1
        IEND=MYIE
        IC = 0
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                BUF2(IC)=ARR1(I,J)
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR2(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR3(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF2,IC,ITYPE,MY_NEB(2),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(3),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        IBEG=MYIS
        IEND=MYIS+IHALO-1
        IC = 0
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                BUF3(IC)=ARR1(I,J)
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR2(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR3(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF3,IC,ITYPE,MY_NEB(4),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(4),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIS-1
        IC = 0
        CALL MPI_WAIT(IHANDLE(1),ISTAT,IERR)
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                ARR1(I,J)=BUF0(IC)
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR3(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        IBEG=MYIE+1
        IEND=MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(2),ISTAT,IERR)
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                ARR1(I,J)=BUF1(IC)
            ENDDO
        ENDDO
        DO K=1,LL2
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR2(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL3
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR3(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

    IF(MY_NEB(4) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(4),ISTAT,IERR)
    ENDIF

    IF(MY_NEB(2) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(3),ISTAT,IERR)
    ENDIF

!--------------------------------------------------------------------
    END SUBROUTINE

    SUBROUTINE IEXCH(ARR1,LL1,IHALO,JHALO)
    USE EXCH_BUF_INTEGER
    INCLUDE "parmeta.f90"
    INCLUDE "mpif.h"
    INCLUDE "mpp.h"
!-----------------------------------------------------------------------
    INTEGER :: ISTAT(MPI_STATUS_SIZE)
    INTEGER :: IHANDLE(4)
    INTEGER :: ARR1(IDIM1:IDIM2,JDIM1:JDIM2)

!***********************************************************************

    ITYPE=MPI_INTEGER

!--------------------------------------------------------------------
!--------------------------------------------------------------------
!***
!***  NORTH/SOUTH
!***
!--------------------------------------------------------------------
!--------------------------------------------------------------------

!--------------------------------------------------------------------
!     RECEIVE FROM NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        CALL MPI_IRECV(BUF0,IBUFEXCH,ITYPE,MY_NEB(1),MY_NEB(1) &
        ,               MPI_COMM_COMP,IHANDLE(1),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     RECEIVE FROM SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        CALL MPI_IRECV(BUF1,IBUFEXCH,ITYPE,MY_NEB(3),MY_NEB(3) &
        ,               MPI_COMM_COMP,IHANDLE(2),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                BUF2(IC)=ARR1(I,MYJE-J)
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF2,IC,ITYPE,MY_NEB(1),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(3),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                BUF3(IC)=ARR1(I,MYJS+J)
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF3,IC,ITYPE,MY_NEB(3),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(4),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     STORE RESULTS FROM SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(2),ISTAT,IERR)
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                ARR1(I,MYJS-J-1)=BUF1(IC)
            ENDDO
        ENDDO
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(1),ISTAT,IERR)
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                ARR1(I,MYJE+J+1)=BUF0(IC)
            ENDDO
        ENDDO
    ENDIF

    IF(MY_NEB(1) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(3),ISTAT,IERR)
    ENDIF

    IF(MY_NEB(3) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(4),ISTAT,IERR)
    ENDIF

!--------------------------------------------------------------------
!--------------------------------------------------------------------
!***
!***  EAST/WEST
!***
!--------------------------------------------------------------------
!--------------------------------------------------------------------

!--------------------------------------------------------------------
!     RECEIVE FROM WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        CALL MPI_IRECV(BUF0,IBUFEXCH,ITYPE,MY_NEB(4),MY_NEB(4) &
        ,               MPI_COMM_COMP,IHANDLE(1),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     RECEIVE FROM EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        CALL MPI_IRECV(BUF1,IBUFEXCH,ITYPE,MY_NEB(2),MY_NEB(2) &
        ,               MPI_COMM_COMP,IHANDLE(2),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        IBEG=MYIE-IHALO+1
        IEND=MYIE
        IC = 0
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                BUF2(IC)=ARR1(I,J)
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF2,IC,ITYPE,MY_NEB(2),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(3),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        IBEG=MYIS
        IEND=MYIS+IHALO-1
        IC = 0
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                BUF3(IC)=ARR1(I,J)
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF3,IC,ITYPE,MY_NEB(4),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(4),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIS-1
        IC = 0
        CALL MPI_WAIT(IHANDLE(1),ISTAT,IERR)
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                ARR1(I,J)=BUF0(IC)
            ENDDO
        ENDDO
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        IBEG=MYIE+1
        IEND=MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(2),ISTAT,IERR)
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                ARR1(I,J)=BUF1(IC)
            ENDDO
        ENDDO
    ENDIF

    IF(MY_NEB(4) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(4),ISTAT,IERR)
    ENDIF

    IF(MY_NEB(2) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(3),ISTAT,IERR)
    ENDIF

!--------------------------------------------------------------------
    END SUBROUTINE

    SUBROUTINE EXCH0001111(ARR1,LL1,ARR2,LL2,ARR3,LL3, &
    ARR4,LL4,ARR5,LL5, &
    ARR6,LL6,ARR7,LL7,IHALO,JHALO)
    USE EXCH_BUF_REAL
    INCLUDE "parmeta.f90"
    INCLUDE "mpif.h"
    INCLUDE "mpp.h"
!-----------------------------------------------------------------------
    INTEGER :: ISTAT(MPI_STATUS_SIZE)
    INTEGER :: IHANDLE(4)
    REAL :: ARR1(IDIM1:IDIM2,JDIM1:JDIM2)
    REAL :: ARR2(IDIM1:IDIM2,JDIM1:JDIM2)
    REAL :: ARR3(IDIM1:IDIM2,JDIM1:JDIM2)
    REAL :: ARR4(IDIM1:IDIM2,JDIM1:JDIM2,*)
    REAL :: ARR5(IDIM1:IDIM2,JDIM1:JDIM2,*)
    REAL :: ARR6(IDIM1:IDIM2,JDIM1:JDIM2,*)
    REAL :: ARR7(IDIM1:IDIM2,JDIM1:JDIM2,*)

!***********************************************************************

    ITYPE=MPI_REAL

!--------------------------------------------------------------------
!--------------------------------------------------------------------
!***
!***  NORTH/SOUTH
!***
!--------------------------------------------------------------------
!--------------------------------------------------------------------

!--------------------------------------------------------------------
!     RECEIVE FROM NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        CALL MPI_IRECV(BUF0,IBUFEXCH,ITYPE,MY_NEB(1),MY_NEB(1) &
        ,               MPI_COMM_COMP,IHANDLE(1),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     RECEIVE FROM SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        CALL MPI_IRECV(BUF1,IBUFEXCH,ITYPE,MY_NEB(3),MY_NEB(3) &
        ,               MPI_COMM_COMP,IHANDLE(2),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                BUF2(IC)=ARR1(I,MYJE-J)
            ENDDO
        ENDDO
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                BUF2(IC)=ARR2(I,MYJE-J)
            ENDDO
        ENDDO
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                BUF2(IC)=ARR3(I,MYJE-J)
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR4(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL5
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR5(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL6
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR6(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL7
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR7(I,MYJE-J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF2,IC,ITYPE,MY_NEB(1),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(3),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                BUF3(IC)=ARR1(I,MYJS+J)
            ENDDO
        ENDDO
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                BUF3(IC)=ARR2(I,MYJS+J)
            ENDDO
        ENDDO
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                BUF3(IC)=ARR3(I,MYJS+J)
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR4(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL5
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR5(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL6
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR6(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL7
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR7(I,MYJS+J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF3,IC,ITYPE,MY_NEB(3),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(4),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     STORE RESULTS FROM SOUTH
!--------------------------------------------------------------------

    IF(MY_NEB(3) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(2),ISTAT,IERR)
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                ARR1(I,MYJS-J-1)=BUF1(IC)
            ENDDO
        ENDDO
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                ARR2(I,MYJS-J-1)=BUF1(IC)
            ENDDO
        ENDDO
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                ARR3(I,MYJS-J-1)=BUF1(IC)
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR4(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL5
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR5(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL6
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR6(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL7
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR7(I,MYJS-J-1,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM NORTH
!--------------------------------------------------------------------

    IF(MY_NEB(1) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(1),ISTAT,IERR)
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                ARR1(I,MYJE+J+1)=BUF0(IC)
            ENDDO
        ENDDO
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                ARR2(I,MYJE+J+1)=BUF0(IC)
            ENDDO
        ENDDO
        DO J=0,JHALO-1
            DO I=IBEG,IEND
                IC = IC + 1
                ARR3(I,MYJE+J+1)=BUF0(IC)
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR4(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL5
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR5(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL6
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR6(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL7
            DO J=0,JHALO-1
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR7(I,MYJE+J+1,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

    IF(MY_NEB(1) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(3),ISTAT,IERR)
    ENDIF

    IF(MY_NEB(3) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(4),ISTAT,IERR)
    ENDIF

!--------------------------------------------------------------------
!--------------------------------------------------------------------
!***
!***  EAST/WEST
!***
!--------------------------------------------------------------------
!--------------------------------------------------------------------

!--------------------------------------------------------------------
!     RECEIVE FROM WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        CALL MPI_IRECV(BUF0,IBUFEXCH,ITYPE,MY_NEB(4),MY_NEB(4) &
        ,               MPI_COMM_COMP,IHANDLE(1),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     RECEIVE FROM EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        CALL MPI_IRECV(BUF1,IBUFEXCH,ITYPE,MY_NEB(2),MY_NEB(2) &
        ,               MPI_COMM_COMP,IHANDLE(2),IRECV)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        IBEG=MYIE-IHALO+1
        IEND=MYIE
        IC = 0
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                BUF2(IC)=ARR1(I,J)
            ENDDO
        ENDDO
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                BUF2(IC)=ARR2(I,J)
            ENDDO
        ENDDO
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                BUF2(IC)=ARR3(I,J)
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR4(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL5
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR5(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL6
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR6(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL7
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF2(IC)=ARR7(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF2,IC,ITYPE,MY_NEB(2),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(3),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     SEND TO WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        IBEG=MYIS
        IEND=MYIS+IHALO-1
        IC = 0
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                BUF3(IC)=ARR1(I,J)
            ENDDO
        ENDDO
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                BUF3(IC)=ARR2(I,J)
            ENDDO
        ENDDO
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                BUF3(IC)=ARR3(I,J)
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR4(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL5
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR5(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL6
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR6(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL7
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    BUF3(IC)=ARR7(I,J,K)
                ENDDO
            ENDDO
        ENDDO
        CALL MPI_ISEND(BUF3,IC,ITYPE,MY_NEB(4),MYPE &
        ,               MPI_COMM_COMP,IHANDLE(4),ISEND)
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM WEST
!--------------------------------------------------------------------

    IF(MY_NEB(4) >= 0)THEN
        IBEG=MYIS-IHALO
        IEND=MYIS-1
        IC = 0
        CALL MPI_WAIT(IHANDLE(1),ISTAT,IERR)
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                ARR1(I,J)=BUF0(IC)
            ENDDO
        ENDDO
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                ARR2(I,J)=BUF0(IC)
            ENDDO
        ENDDO
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                ARR3(I,J)=BUF0(IC)
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR4(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL5
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR5(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL6
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR6(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL7
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR7(I,J,K)=BUF0(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

!--------------------------------------------------------------------
!     STORE FROM EAST
!--------------------------------------------------------------------

    IF(MY_NEB(2) >= 0)THEN
        IBEG=MYIE+1
        IEND=MYIE+IHALO
        IC = 0
        CALL MPI_WAIT(IHANDLE(2),ISTAT,IERR)
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                ARR1(I,J)=BUF1(IC)
            ENDDO
        ENDDO
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                ARR2(I,J)=BUF1(IC)
            ENDDO
        ENDDO
        DO J=MYJS-JHALO,MYJE+JHALO
            DO I=IBEG,IEND
                IC = IC + 1
                ARR3(I,J)=BUF1(IC)
            ENDDO
        ENDDO
        DO K=1,LL4
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR4(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL5
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR5(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL6
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR6(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
        DO K=1,LL7
            DO J=MYJS-JHALO,MYJE+JHALO
                DO I=IBEG,IEND
                    IC = IC + 1
                    ARR7(I,J,K)=BUF1(IC)
                ENDDO
            ENDDO
        ENDDO
    ENDIF

    IF(MY_NEB(4) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(4),ISTAT,IERR)
    ENDIF

    IF(MY_NEB(2) >= 0)THEN
        CALL MPI_WAIT(IHANDLE(3),ISTAT,IERR)
    ENDIF

!--------------------------------------------------------------------
    END SUBROUTINE
    END MODULE
