program OW_dso

use sep 
use dso_mod

implicit none

real, allocatable                             :: B_image(:,:,:)
integer                                                     :: n1,n2,n3,n4
real                                                        :: d1,d2,d3,d4,o1,o2,o3,o4,shift

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 call sep_init()
 call sep_begin_prog()
call from_param("shift",shift,0.)
call from_history("n1",n1);call from_history("o1",o1);call from_history("d1",d1)
call from_history("n2",n2);call from_history("o2",o2);call from_history("d2",d2)
call from_history("n3",n3);call from_history("o3",o3);call from_history("d3",d3)
call from_history("n4",n4);call from_history("o4",o4);call from_history("d4",d4)
write(0,*) n1,n2,n3,n4
write(0,*) d1,d2,d3,d4
write(0,*) o1,o2,o3,o4
call to_history("n1",n1,"out");call to_history("o1",o1,"out");call to_history("d1",d1,"out")
call to_history("n2",n2,"out");call to_history("o2",o2,"out");call to_history("d2",d2,"out")
call to_history("n3",n3,"out");call to_history("o3",o3,"out");call to_history("d3",d3,"out")
call to_history("n4",n4,"out");call to_history("o4",o4,"out");call to_history("d4",d4,"out")

allocate(B_image(n1,n2,n3));B_image=0.
call sreed("in",B_image,4*n1*n2*n3)
call owdso(B_image,n1,n2,o2,d2,n3,shift)
call owdso(B_image,n1,n2,o2,d2,n3,shift)
call srite("out",B_image,4*n1*n2*n3)
deallocate(B_image)
call sep_end_prog()
end program 
