program curve_prg
use sep
use curvature
implicit none

real, allocatable					:: wgcig(:,:,:),semb(:,:,:)
integer						:: i1,i2,i3,stat1,nrad,windx,windz
integer                                                     :: n1,n2,n3,n4
real                                                        :: d1,d2,d3,d4,o1,o2,o3,o4,drad,orad

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 from_param("windx",windx,11)
call from_param("windz",windz,11)
call from_param("nrad",nrad,201)
call from_param("drad",drad,20.)
call from_param("orad",orad,-2000.)
call to_history("n1",n1); call to_history("d1",d1); call to_history("o1",o1)
call to_history("n2",n3); call to_history("d2",d3); call to_history("o2",o3)
call to_history("n3",nrad); call to_history("d3",drad); call to_history("o3",orad)
call to_history("n4",1); call to_history("d4",1.); call to_history("o4",0.)
call to_history("eout",4);call to_history("label3","")

allocate(wgcig(n1,n2,n3),semb(n1,n3,nrad))
call sreed("in",wgcig,4*n1*n2*n3)
call curve_init(n1,n2,n3,d2,d3,o2,o3,nrad,drad,orad,windx,windz)
call curve_exe(wgcig,semb)
call srite("out",semb,4*n1*nrad*n3)
deallocate(wgcig,semb)
call sep_end_prog()
end program
