    SUBROUTINE UPDATE(A)
!$$$  SUBPROGRAM DOCUMENTATION BLOCK
!                .      .    .
! SUBPROGRAM:    EXCH2       EXCHANGE TWO HALO ROWS
!   PRGRMMR: TUCCILLO        ORG: IBM

! ABSTRACT:
!     EXCHANGE TWO HALO ROWS
!   .

! PROGRAM HISTORY LOG:
!   00-01-06  TUCCILLO - ORIGINAL

! USAGE:    CALL EXCH2(A)
!   INPUT ARGUMENT LIST:
!      A - ARRAY TO HAVE HALOS EXCHANGED

!   OUTPUT ARGUMENT LIST:
!      A - ARRAY WITH HALOS EXCHANGED

!   OUTPUT FILES:
!     STDOUT  - RUN TIME STANDARD OUT.

!   SUBPROGRAMS CALLED:
!       MPI_SENDRECV
!     UTILITIES:
!       NONE
!     LIBRARY:
!       COMMON - CTLBLK.comm

!   ATTRIBUTES:
!     LANGUAGE: FORTRAN
!     MACHINE : IBM RS/6000 SP
!$$$
    include "parmeta.f90"
    include "COMM_PARA.f90"
    include 'mpif.h'
    include 'mpp.h'
    real :: a ( IM ,MY_JSD:MY_JED )
    integer :: status(MPI_STATUS_SIZE)

    if ( num_procs == 1 ) return

    call mpi_sendrecv(a(1,jend_i-1),2*im,MPI_REAL,iup,1, &
    a(1,jsta_i-2),2*im,MPI_REAL,idn,1, &
    mpi_comm_comp,status,ierr)
    call mpi_sendrecv(a(1,jsta_i  ),2*im,MPI_REAL,idn,1, &
    a(1,jend_i+1),2*im,MPI_REAL,iup,1, &
    mpi_comm_comp,status,ierr)

    END SUBROUTINE UPDATE
