module OW_io

use sep
use OW_type
use OW_sltpar
implicit none
contains

subroutine owio(x,L)
real		:: x(:)
integer		:: L
  if (L==0) then
     call to_history("n1",sog%z%n);call to_history("d1",sog%z%d);call to_history("o1",sog%z%o)
     call to_history("n2",sog%xm%n);call to_history("d2",sog%xm%d);call to_history("o2",sog%xm%o)  
     call to_history("n3",1.);call to_history("d3",1.);call to_history("o3",0.)  
     call to_history("n4",1.);call to_history("d4",1.);call to_history("o4",0.)  
     call to_history("label1","z");call to_history("label2","x")
     call to_history("esize",4)
     call srite("out",x,4*sog%z%n*sog%xm%n)
  else if (L==1) then 
     call to_history("n1",sog%z%n);call to_history("d1",sog%z%d);call to_history("o1",sog%z%o)
     call to_history("n2",sog%xm%n);call to_history("d2",sog%xm%d);call to_history("o2",sog%xm%o)  
     call to_history("n3",1.);call to_history("d3",1.);call to_history("o3",0.)  
     call to_history("n4",1.);call to_history("d4",1.);call to_history("o4",0.)  
     call to_history("label1","z");call to_history("label2","x")
     call to_history("esize",4)
     call srite("out",x,4*sog%z%n*sog%xm%n)
  else if (L==2) then 
     call to_history("n1",sog%z%n);call to_history("d1",sog%z%d);call to_history("o1",sog%z%o)
     call to_history("n2",nax);call to_history("d2",dax);call to_history("o2",oax)
     call to_history("n3",sog%xm%n);call to_history("d3",sog%xm%d);call to_history("o3",sog%xm%o)  
     call to_history("n4",1.);call to_history("d4",1.);call to_history("o4",0.)  
     call to_history("label1","z");call to_history("label2","ax");call to_history("label3","x")
     call to_history("esize",4)
     call srite("out",x,4*sog%z%n*nax*sog%xm%n)
  else if (L==3) then 
     call to_history("n1",sog%z%n);call to_history("d1",sog%z%d);call to_history("o1",sog%z%o)
     call to_history("n2",sog%xm%n);call to_history("d2",sog%xm%d);call to_history("o2",sog%xm%o)  
     call to_history("n3",1.);call to_history("d3",1.);call to_history("o3",0.)  
     call to_history("n4",1.);call to_history("d4",1.);call to_history("o4",0.)  
     call to_history("label1","z");call to_history("label2","x")
     call to_history("esize",4)
     call srite("out",x,4*sog%z%n*sog%xm%n)
  else if (L==4) then 
     call to_history("n1",sog%z%n);call to_history("d1",sog%z%d);call to_history("o1",sog%z%o)
     call to_history("n2",sog%xm%n);call to_history("d2",sog%xm%d);call to_history("o2",sog%xm%o)  
     call to_history("n3",1.);call to_history("d3",1.);call to_history("o3",0.)  
     call to_history("n4",1.);call to_history("d4",1.);call to_history("o4",0.)  
     call to_history("label1","z");call to_history("label2","x")
     call to_history("esize",4)
     call srite("out",x,4*sog%z%n*sog%xm%n)
  else if (L==5) then 
     call to_history("n1",sog%z%n);call to_history("d1",sog%z%d);call to_history("o1",sog%z%o)
     call to_history("n2",nrad);call to_history("d2",drad);call to_history("o2",orad)
     call to_history("n3",sog%xm%n);call to_history("d3",sog%xm%d);call to_history("o3",sog%xm%o)  
     call to_history("n4",1.);call to_history("d4",1.);call to_history("o4",0.)  
     call to_history("label1","z");call to_history("label2","radius");call to_history("label3","x")
     call to_history("esize",4)
     call srite("out",x,4*sog%z%n*nrad*sog%xm%n)
  end if
end subroutine
end module
