 program rewri

 use sep
 use ext_mod 

 implicit none

 real, allocatable				:: data(:,:)
 integer					:: is,it,ix,iz,ixw,iwav,stat,ih,ixm
 type(axis)					:: xs,xh,xm,xwrk,z,t,wav,vx,vz

 call sep_init()

 call from_history("n1",t%n); call from_history("d1",t%d); call from_history("o1",t%o)
 call from_history("n2",xh%n); call from_history("d2",xh%d); call from_history("o2",xh%o)  
 call from_history("n3",xs%n); call from_history("d3",xs%d); call from_history("o3",xs%o)

 call to_history("n1",t%n); call to_history("d1",t%d); call to_history("o1",t%o)
 call to_history("n2",xh%n); call to_history("d2",xh%d); call to_history("o2",xh%o)  
 call to_history("n3",xs%n); call to_history("d3",xs%d); call to_history("o3",xs%o)  

  allocate(data(t%n,xh%n))

  do is=1,xs%n
      data=0
      call sreed("in", data,4*t%n*xh%n)
      call srite("out",data,4*t%n*xh%n)
  end do

end program
