!*********************************************************************** 
!  Applies new mask from apparent horizon solver to the  
!  grid functions--zeroes interior and extrapolate new values 
!  for points emerging from the horizon. 
!*********************************************************************** 
subroutine remask(g,k,mask,maskold)
implicit none 
integer                       :: nx, ny, nz
real*8,dimension(:,:,:,:)     :: g,k
real*8,dimension(:,:,:)       :: mask,maskold 

   where (mask == 0.0d0) 
      g(1,:,:,:) = 0.0d0 
      g(2,:,:,:) = 0.0d0 
      g(3,:,:,:) = 0.0d0 
      g(4,:,:,:) = 0.0d0 
      g(5,:,:,:) = 0.0d0 
      g(6,:,:,:) = 0.0d0 
      k(1,:,:,:) = 0.0d0 
      k(2,:,:,:) = 0.0d0 
      k(3,:,:,:) = 0.0d0 
      k(4,:,:,:) = 0.0d0 
      k(5,:,:,:) = 0.0d0 
      k(6,:,:,:) = 0.0d0 
	end where 
 
!       if (mask == 1.0d0 & maskold == 0.0d0) then 
!           call extrapolator 
!         end if 
 
 
return 
end 
 
