program OW_mutmud

use sep

implicit none
real			:: o1,o2,o3,d1,d2,d3,vh2o,vvv
integer			:: i1,i2,i3,n1,n2,n3
integer, allocatable	:: mute(:)
real,allocatable		:: gatin(:,:)

call sep_init()
call sep_begin_prog()

call from_history("n1",n1); call from_history("d1",d1); call from_history("o1",o1)
call from_history("n2",n2); call from_history("d2",d2); call from_history("o2",o2)
call from_history("n3",n3); call from_history("d3",d3); call from_history("o3",o3)

call to_history("n1",n1); call to_history("d1",d1); call to_history("o1",o1)
call to_history("n2",n2); call to_history("d2",d2); call to_history("o2",o2)
call to_history("n3",n3); call to_history("d3",d3); call to_history("o3",o3)
call to_history("eout",4);call to_history("label3","")

allocate(gatin(n1,n2));gatin=0;
allocate(mute(n2));mute=0

open(unit=2,file='mute3d')
do i3=1,n3
write(0,*) i3
   call sreed("in",gatin,4*n1*n2)
   read (2,*) mute
   do i2=1,n2
      gatin(1:mute(i2),i2)=0.
   end do
   call srite("out",gatin,4*n1*n2)
end do
deallocate(gatin,mute)
close(2)
call sep_end_prog()
end program
