subroutine rb(a2d_rb, b2d_rb, x2d_rb, cc, sps, spe, ired, iblk)

  real, dimension(:,:,:,:), intent(in)    :: a2d_rb
  real, dimension(:,:,:  ), intent(in)    :: b2d_rb
  real, dimension(:,:,:  ), intent(in)    :: x2d_rb
  real, dimension(:,:    ), intent(inout) :: cc
  integer, intent(in) :: sps, spe, ired, iblk

  do iy = 1, spe
    do ix = 1, spe
      cc(ix, iy)  = b2d_rb(ix,  iy,ired)                           &
                  - a2d_rb(ix,2,iy,ired) * x2d_rb(ix  ,iy-1, iblk) &
                  - a2d_rb(ix,3,iy,ired) * x2d_rb(ix-1,iy  , iblk) &
                  - a2d_rb(ix,4,iy,ired) * x2d_rb(ix  ,iy  , iblk) &
                  - a2d_rb(ix,5,iy,ired) * x2d_rb(ix  ,iy+1, iblk)
    end do
  end do

! do ix = 1, spe
!   cc(ix, 1)   = b2d_rb(  ix,iy,ired) * cc(ix,1)
! end do
end subroutine
