program main
  use sep
  implicit none

  integer :: nx, ny, nz, nhx, nhy, nhz
  integer :: iz
  real, dimension(:,:,:,:), allocatable :: data


  call initpar()

  call from_history("n1", nhx)
  call from_history("n2", nhy)
  call from_history("n3", nx)
  call from_history("n4", ny)
  call from_history("n5", nz)

  allocate(data(nhx,nhy,nx,ny))


  do iz=1, nz
     call sep_read(data)
     data(:,:,1:nx/2 ,:) = 0.
     data(:,:,nx/2+2:,:) = 0.
     call sep_write(data)
  end do

end program
