subroutine boundaries(g,rb,lb,t,nx,ny)
!---------------------------------------------------
! set boundary conditions after grid update
!---------------------------------------------------

use types
real(SP), dimension(:,:)   :: g
integer(I4B), dimension(2) :: rb,lb
real(SP)                   :: t
integer(I4B)               :: nx,ny


g(1,:)=g(2,:)
g(nx,:)=g(2,:)

! the following condition is imposed only when the edge of the
! grid g on a given level of refinement coincide with 
! edges of the base grid

if(lb(1)==1) g(:,1)=sin(0.5*t)

write(6,*) '::::::::  t=',t,g(5,1),lb
write(6,*) '::::::::  s=',sin(0.15*t) 

return
end