module mis_mod {  
  use tcai1+cgstep_mod+solver_mod
contains
# fill in missing data on 1-axis by minimizing power out of a given filter.
  subroutine mis1 ( niter, mm, aa) {
    integer,             intent (in)      :: niter   # number of iterations
    real, dimension (:), pointer          :: aa      # roughening filter
    real, dimension (:), intent (in out)  :: mm      # in - data with zeroes
                                                     # out - interpolated
    real, dimension (:),allocatable       :: zero    # filter output

		allocate(zero(size(mm)+size(aa)))
    call tcai1_init( aa);                    zero = 0.
    call solver (tcai1_lop,cgstep,mm, zero, niter,x0 =mm,known =(mm/=0.))
    call cgstep_close ()
		deallocate(zero)
    }
}
