module pef2
! Find prediction-error filter (helix magic)
  use hconest
  use cgstep_mod
  use solver_smp_mod
  implicit none
  contains
  subroutine find_pef( dd, aa, niter,i2,i3,i4)
    integer, intent( in) :: niter,i2,i3,i4
    ! number of iterations
    type( filter) :: aa ! filter
    real, dimension(:), pointer :: dd ! input data
    call hconest_init( dd, aa)
    call solver_smp(m=aa%flt, d=-dd, Fop=hconest_lop, stepper=cgstep,&
      & niter=niter, t1=i2,t2=i3,t3=i4,m0=aa%flt)
    call cgstep_close()
  end subroutine
end module
