program owspline

use sep
use OW_type
use OW_spline_parms
use cgstep_mod
use base_spline_real
use solver_tiny_mod  
use solver_reg1  

implicit none
real,allocatable               :: gspl(:),g(:)
integer                        :: stat

 call sep_init()
 call sep_begin_prog()
 call owparam()
 allocate(g(img%xm%n*img%ym%n*img%z%n));g=0
 allocate(gspl(axk%n*ayk%n*azk%n));gspl=0
 stat = base_spln3d_init(img%xm,img%ym,img%z,axk,ayk,azk)
 call sreed("gradi",g,4*img%xm%n*img%ym%n*img%z%n)
 call solver_reg( m=gspl,d=g, Fop=base_spln3d_oper, Aop=identity, stepper=cgstep, nAop=size(gspl), &
                  niter1=niters, eps1=epss, verb=.true.)
! call solver_tiny( gspl,g, base_spln3d_oper, cgstep, niters)
 g=0
 call base_spln3d(.false., .false., gspl, g)
 call srite("grado",g,4*img%xm%n*img%ym%n*img%z%n)
 deallocate(g,gspl)
 call sep_end_prog()
 end program
