program main
  use sep
  implicit none

  integer :: nx, nz, ix, iz, jz
  real    :: dz, z
  real, dimension(:,:), allocatable :: vmod
  call initpar()

  call from_history("n1", nz); call from_history("d1", dz)
  call from_history("n2", nx)

  allocate(vmod(nz,nx))

  call sep_read(vmod)

  jz = 1.5 + 11000/dz

  do ix=1, nx
  do iz=1, nz-1
     z = iz*dz 
     if (z<11000.and.vmod(iz,ix)>14000.and.vmod(iz+1,ix)<14000) then 
         vmod(iz+4:jz,ix) = 7000
     end if
  end do
  end do

  call sep_write(vmod)

end program
