program eps_modo
use sep
use sep3d_struct_mod
use basic_util_mod
type(sep3d) :: dat,func
real, allocatable :: array(:,:,:),vec(:)
integer :: n(5),i1,i2,i3,ia
real :: o(5),d(5),eps0,eps_grad,z,eps_2

call sep_init(SOURCE)
call init_sep3d("in",dat,"INPUT")
call init_sep3d("func",func,"INPUT")
n=1
n(1:sep3d_ndims(dat))=dat%n(1:sep3d_ndims(dat))
o(2)=dat%o(2)
d(2)=dat%d(2)

allocate(vec(n(1)))
call sreed("func",vec,size(vec)*4)
allocate(array(n(1),n(2),n(3)))
array=0.
do i1=1,n(1)
  ia=max(min(n(2),nint((vec(i1)-o(2))/d(2)+1.5)),1)
  array(i1,1:ia,:)=1
end do
do i5=1,n(5)
do i4=1,n(4)
call srite("out",array,size(array)*4)
end do
end do

end program






