 program mute

 use sep

 implicit none

  type axis
     integer 					:: n
     real    					:: o, d, v ! v=(i-1)*d+o
     real, allocatable				:: all(:)
  end type axis

  real, allocatable				:: data(:,:,:)
  integer					:: ih,ix,iz
  real						:: cx,cz,z1
  type(axis)					:: x,z,h

 call sep_init()
 call sep_begin_prog()

   call from_history("n1",z%n); call from_history("d1",z%d); call from_history("o1",z%o)
   call from_history("n2",h%n); call from_history("d2",h%d); call from_history("o2",h%o)
   call from_history("n3",x%n); call from_history("d3",x%d); call from_history("o3",x%o)

   call to_history("n1",z%n); call to_history("d1",z%d); call to_history("o1",z%o)
   call to_history("n2",h%n); call to_history("d2",h%d); call to_history("o2",h%o)
   call to_history("n3",x%n); call to_history("d3",x%d); call to_history("o3",x%o)

   allocate(data(z%n,h%n,x%n))
   call sreed("in",data, 4*z%n*h%n*x%n)
   do ix=1,x%n
      do iz=1,z%n
         cx=(ix-1)*x%d+x%o
         cz=(iz-1)*z%d+z%o
	 if (cz <= 10500) then
	    data(iz,:,ix)=0.
	 else if (cz > 10500 .and. cx >34500) then
	    z1=0.5*(cx-34500)+10500
	    if (cz < z1 ) then
		data(iz,:,ix)=0.
	    end if
	 end if
      end do
   end do
 
   call srite("out",data, 4*z%n*h%n*x%n)
   deallocate(data)

 call sep_end_prog()
 end program mute
