program OW_3dslant
! 3D-linear Radon transform

  use sep
  use OW_type
  use OW_sltpar
  use OW_3dsltrt1
  use OW_3dsltrt2
  use OW_3dslt
  use OW_3drot
  use OW_halfder 

  implicit none

  real, allocatable, dimension (:)		:: in,out
  integer					:: stat,iy,ihy
  real                                            :: starty,finishy

  call sep_init()
  call sep_begin_prog()
  call owsltpar()

  if (rot3d) then
     write(0,*) "rot3D"
     allocate(in(sog%z%n*sog%shx%n*sog%xm%n*sog%shy%n*sog%ym%n))
     allocate(out(sog%z%n*sog%shx%n*sog%xm%n*sog%shy%n*sog%ym%n))
     call sreed("in",in,4*sog%z%n*sog%shx%n*sog%xm%n*sog%shy%n*sog%ym%n)
     stat = ow3dslantrt2(.true.,.false.,out,in)
     call srite("out",out,4*sog%z%n*sog%shx%n*sog%xm%n*sog%shy%n*sog%ym%n)
  else
     write(0,*) "rot2D"
     allocate(in(sog%z%n*sog%shx%n*sog%xm%n))
!     allocate(out(sog%z%n*sog%shx%n*sog%xm%n))
     allocate(out(sog%z%n*nahx*nax*sog%xm%n))
     do iy=1, sog%ym%n
        starty=0;finishy=0.
        call owexec_time (starty)
        do ihy=1, sog%shy%n
           call sreed("in",in,4*sog%z%n*sog%shx%n*sog%xm%n)
!           stat = ow3dslantrt(.true.,.false.,out,in)
            call halfdifa(in,1)
            stat = ow3dslant(.true.,.false.,out,in)
            in=0.
            stat = ow3drot(.true.,.false.,in,out)
            call halfdifa(in,-1)
            call srite("out",in,4*sog%z%n*sog%shx%n*sog%xm%n)
        end do
        call owexec_time (finishy)
        if (mod(iy,10).eq.1) write(0,*) "DONE XLINE", iy, " FROM ", sog%ym%n, " in ", (finishy-starty)/60, " min"
     end do
  end if
  deallocate(in,out)
  call sep_end_prog()
end program 
