program main
  use sep
  use laplac2
  use tcai1

  implicit none

  real, dimension(:), pointer :: modl(:), data(:)
  integer                     :: nz, nhx, nax, nmx, imx, iax, ihx, iz, stat
  integer		      :: niter,NAop
  real                        :: z0, hx0, mx0 
  real                        :: dz, dhx, dax, dmx
  real                        :: eps, axmin, axmax, hxmin, hxmax
  real, parameter             :: PI = 3.14159265359
  logical, parameter          :: T = .true. , F = .false.
  logical	              :: adj	
  call initpar()

     call from_history("n1", nz ); call from_history("d1", dz ); call from_history("o1", z0 )
     call from_history("n2", nhx); call from_history("d2", dhx); call from_history("o2", hx0)  
     call from_history("n3", nmx); call from_history("d3", dmx); call from_history("o3", mx0)
 
     call to_history("n1", nz) ; call to_history("d1", dz) ; call to_history("o1", z0)
     call to_history("n2", nhx); call to_history("d2", dhx); call to_history("o2", hx0) 
     call to_history("n3", nmx); call to_history("d3", dmx); call to_history("o3", mx0)

     allocate(modl(nz*nhx), data(nz*nhx))

     call sreed("in", data, 4*nz*nhx)
     call laplac2_init(nz,nhx)
     stat = laplac2_lop(.true.,.false.,modl,data)
     call srite("out", modl, 4*nz*nhx)
!     call srite("out", data, 4*nz*nhx)

end program
