program OW_3dslant
! 3D-linear Radon transform

  use sep
  use OW_type
  use OW_sltpar
  use OW_3dslt
  use OW_3drot
  use solver_tiny_mod1
  use solver_prc_mod 
  use igrad1
  use cgstep_mod1

  implicit none

  real, allocatable, dimension (:)		:: in,out
  integer					:: stat,ix,ih,iz,ind
open (unit=2,file="lixo")
  call sep_init()
  call sep_begin_prog()
  call owsltpar()
  allocate(in(sog%z%n*sog%sh%n*sog%xm%n))
  call sreed("in",in,4*sog%z%n*sog%sh%n*sog%xm%n)
  if (teste) then
     if (upshft) then
        allocate(out(nz*sog%sh%n*nah*nax*sog%xm%n))
     else
        allocate(out(nz*nah*nax*sog%xm%n))
     end if
     stat = ow3dslant(.true.,.false.,out,in)
     stat = ow3dslant(.false.,.false.,out,in)
     call srite("out",in,4*sog%z%n*sog%sh%n*sog%xm%n)
  else if (rot) then
     if (upshft) then
        allocate(out(nz*sog%sh%n*nah*nax*sog%xm%n))
     else
        allocate(out(nz*nah*nax*sog%xm%n))
     end if
     stat = ow3dslant(.true.,.false.,out,in)
!     deallocate(in)
!     allocate(in(nz*sog%sh%n*sog%xm%n))
     in=0.
!     allocate(out(nz*sog%sh%n*sog%xm%n))
     stat = ow3drot(.true.,.false.,in,out)
     call srite("out",in,4*nz*sog%sh%n*sog%xm%n)
!     stat = ow3drot(.true.,.false.,out,in)
!     call srite("out",out,4*nz*sog%sh%n*sog%xm%n)
  else
     if (upshft) then
        allocate(out(nz*sog%sh%n*nah*nax*sog%xm%n));out=0
        stat = ow3dslant(.true.,.false.,out,in)
!        write(0,*) nz,sog%sh%n,nah,nax,sog%xm%n
        call srite("out",out,4*nz*sog%sh%n*nah*nax*sog%xm%n)
     else
        allocate(out(nz*nah*nax*sog%xm%n))
        stat = ow3dslant(.true.,.false.,out,in)
!        write(0,*) nz,nah,nax,sog%xm%n
        call srite("out",out,4*nz*nah*nax*sog%xm%n)
     end if
  end if
close(2)
  deallocate(in,out)
  call sep_end_prog()
end program 
