!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
     Subroutine Bococ (H)  
!     ******************************************************************
!     *                                                                *
!     *  Boundary conditions for the cube                              *
!     *                                                                *
!     ******************************************************************
!-----------------------------------------------------------------------
      include 'param_o.h'  
!-----------------------------------------------------------------------
      Parameter (kstrd =4, lstrd = kstrd, km = (im - 1) * kstrd+1)  
!-----------------------------------------------------------------------

      Dimension H (1 - kstrd:km + kstrd, 1 - lstrd:km + lstrd, nm)  
!-----------------------------------------------------------------------
!-----------------------------------------------------------------------
!                Lateral Faces
!-----------------------------------------------------------------------
!
! Lateral Conditions
!
      Do n = 1, 4  
        nl = n - 1 + 4 * ( (5 - n) / 4)  
        nr = n + 1 - 4 * (n / 4)  
      Do l = 1, km  
      Do i = 1, kstrd  
        H (1 - i, l, n) = H (km - i, l, nl)  
        H (km + i, l, n) = H (1 + i, l, nr)  
      EndDo  
      EndDo  
      EndDo  
!
! Lower and Upper Conditions
!
     Do k = 1, km  
       l = k  
     Do i = 1, kstrd  
                                              !     Face 1
H (k, km + i, 1) = H (k, 1 + i, 5)  
                                              !
H (k, 1 - i, 1) = H (k, km - i, 6)  
                                              !     Face 2
H (k, km + i, 2) = H (km - i, l, 5)  
                                              !
H (k, 1 - i, 2) = H (km - i, km + 1 - l, 6)  
                                              !     Face 3
H (k, km + i, 3) = H (km + 1 - k, km - i, 5)  
                                              !
H (k, 1 - i, 3) = H (km + 1 - k, 1 + i, 6)  
                                              !     Face 4
H (k, km + i, 4) = H (1 + i, km + 1 - l, 5)  
                                              !
H (k, 1 - i, 4) = H (1 + i, l, 6) 
EndDo  
EndDo  
!-----------------------------------------------------------------------
!                Upper and Lower Faces
!-----------------------------------------------------------------------
!
! Lateral Conditions
!
Do l = 1, km  
k = l  
Do i = 1, kstrd  
                                               !     Face 5
H (1 - i, l, 5) = H (km + 1 - k, km - i, 4)  
                                               !
H (km + i, l, 5) = H (k, km - i, 2)  
                                               !     Face 6
H (1 - i, l, 6) = H (k, 1 + i, 4)  
                                               !
H (km + i, l, 6) = H (km + 1 - k, 1 + i, 2)  
EndDo  
EndDo  
!
! Lower and Upper Conditions
!
Do k = 1, km  
Do i = 1, kstrd  
                                                !     Face 5
H (k, km + i, 5) = H (km + 1 - k, km - i, 3)  
                                                !
H (k, 1 - i, 5) = H (k, km - i, 1)  
                                                !     Face 6
H (k, km + i, 6) = H (k, 1 + i, 1)  
                                                !
H (k, 1 - i, 6) = H (km + 1 - k, 1 + i, 3)  
EndDo  
EndDo  
!-----------------------------------------------------------------------
!
! Put zeros in the corners
!
Do j = 1, lstrd  
Do i = 1, kstrd  
H ( - kstrd+i, - lstrd+j, n) = 0.  
H (km + i, - lstrd+j, n) = 0.  
H ( - kstrd+i, km + j, n) = 0.  
H (km + i, km + j, n) = 0.  
EndDo  
EndDo  
!-----------------------------------------------------------------------
		Return  
END 
