C**********************************************************************
C**********************************************************************
C
      SUBROUTINE BOUND
     M   ( Q,
     D     NX, NZ, NXB, NZB, NROT,
     I     ISZ, ICZ, IR            )
C
C**********************************************************************
      IMPLICIT REAL*8 ( A-H, O-Z )
C**********************************************************************
C
      DIMENSION Q( -2:NXB, -2:NZB, NROT )
C
C======================================================================
C
      IF ( ICZ .NE. 0  .AND.  ICZ .NE. 1 ) THEN
         WRITE(6,*) ' ICZ is invalid in subroutine BOUND'
      END IF
C
         DO 11 IX = 1, NX
            Q (IX,  -2,IR) = ISZ * Q (IX,   2-ICZ, IR)
            Q (IX,  -1,IR) = ISZ * Q (IX,   1-ICZ, IR)
            Q (IX,NZ  ,IR) = ISZ * Q (IX,NZ  -ICZ, IR)

c            Q (IX,NZ  ,IR) = ISZ * Q (IX,NZ      , IR)

            Q (IX,NZ+1,IR) = ISZ * Q (IX,NZ-1-ICZ, IR)
            Q (IX,NZ+2,IR) = ISZ * Q (IX,NZ-2-ICZ, IR)
   11    CONTINUE
C
C
      DO 21 IZ = -2, NZ+2
         Q (  -2,IZ,IR) = Q (NX-2,IZ,IR)
         Q (  -1,IZ,IR) = Q (NX-1,IZ,IR)
         Q (   0,IZ,IR) = Q (NX  ,IZ,IR)
         Q (NX+1,IZ,IR) = Q (   1,IZ,IR)
         Q (NX+2,IZ,IR) = Q (   2,IZ,IR)
   21 CONTINUE
C
C====================================================================
C
      RETURN
      E N D
