C*********************************************************************
C*********************************************************************
C
      SUBROUTINE CLWMID
     I   ( U, V, W,
     I     ICL,
     O     UM1, UM2, VM1, VM2, WM1, WM2,
     D     NX, NZ, NXB, NZB, NROT )
C
C*********************************************************************
      IMPLICIT REAL*8 ( A-H, O-Z )
C***************************************************************
C
      DIMENSION
     \    U   ( -2:NXB, -2:NZB ,NROT ),
     \    V   ( -2:NXB, -2:NZB ,NROT ),
     \    W   ( -2:NXB, -2:NZB ,NROT ),
     \    UM1 ( -2:NXB, -2:NZB ),
     \    VM1 ( -2:NXB, -2:NZB ),
     \    WM1 ( -2:NXB, -2:NZB ),
     \    UM2 ( -2:NXB, -2:NZB ),
     \    VM2 ( -2:NXB, -2:NZB ),
     \    WM2 ( -2:NXB, -2:NZB )
C
C===========================================================
C
      DO 11 IZ = 0, NZ
      DO 11 IX = 1, NX
         UM1(IX,IZ) =
     \             0.5D0 * ( U(IX,IZ  ,ICL) + U(IX,IZ-1,ICL) )
C        UM1(IX,IZ) =
C    \    9.0D0 / 16.0D0 * ( U(IX,IZ  ,ICL) + U(IX,IZ-1,ICL) )
C    \  - 1.0D0 / 16.0D0 * ( U(IX,IZ+1,ICL) + U(IX,IZ-2,ICL) )
         VM1(IX,IZ) =
     \             0.5D0 * ( V(IX,IZ  ,ICL) + V(IX,IZ-1,ICL) )
C        VM1(IX,IZ) =
C    \    9.0D0 / 16.0D0 * ( V(IX,IZ  ,ICL) + V(IX,IZ-1,ICL) )
C    \  - 1.0D0 / 16.0D0 * ( V(IX,IZ+1,ICL) + V(IX,IZ-2,ICL) )
         WM1(IX,IZ) =
     \             0.5D0 * ( W(IX  ,IZ,ICL) + W(IX-1,IZ,ICL) )
C        WM1(IX,IZ) =
C    \    9.0D0 / 16.0D0 * ( W(IX  ,IZ,ICL) + W(IX-1,IZ,ICL) )
C    \  - 1.0D0 / 16.0D0 * ( W(IX+1,IZ,ICL) + W(IX-2,IZ,ICL) )
   11 CONTINUE
C
      DO 12 IZ = 0, NZ-1
      DO 12 IX = 1, NX
         UM2(IX,IZ) =
     \             0.5D0 * ( U(IX  ,IZ,ICL) + U(IX+1,IZ,ICL) )
C        UM2(IX,IZ) =
C    \    9.0D0 / 16.0D0 * ( U(IX  ,IZ,ICL) + U(IX+1,IZ,ICL) )
C    \  - 1.0D0 / 16.0D0 * ( U(IX-1,IZ,ICL) + U(IX+2,IZ,ICL) )
         VM2(IX,IZ) =
     \             0.5D0 * ( V(IX  ,IZ,ICL) + V(IX+1,IZ,ICL) )
C        VM2(IX,IZ) =
C    \    9.0D0 / 16.0D0 * ( V(IX  ,IZ,ICL) + V(IX+1,IZ,ICL) )
C    \  - 1.0D0 / 16.0D0 * ( V(IX-1,IZ,ICL) + V(IX+2,IZ,ICL) )
         WM2(IX,IZ) =
     \             0.5D0 * ( W(IX,IZ  ,ICL) + W(IX,IZ+1,ICL) )
C        WM2(IX,IZ) =
C    \    9.0D0 / 16.0D0 * ( W(IX,IZ  ,ICL) + W(IX,IZ+1,ICL) )
C    \  - 1.0D0 / 16.0D0 * ( W(IX,IZ-1,ICL) + W(IX,IZ+2,ICL) )
   12 CONTINUE
C
C-----------------------------------------------------------
C
      CALL BOUND ( UM1, NX, NZ, NXB, NZB, 1, 1, 0, 1 )
      CALL BOUND ( VM1, NX, NZ, NXB, NZB, 1, 1, 0, 1 )
      CALL BOUND ( WM1, NX, NZ, NXB, NZB, 1,-1, 0, 1 )
      CALL BOUND ( UM2, NX, NZ, NXB, NZB, 1, 1, 1, 1 )
      CALL BOUND ( VM2, NX, NZ, NXB, NZB, 1, 1, 1, 1 )
      CALL BOUND ( WM2, NX, NZ, NXB, NZB, 1,-1, 1, 1 )
C
C===========================================================
C
      RETURN
      E N D
