# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "<stdin>"
module npolydiv_chain_mod
  use npolydiv
  use npolydiv2
  use chain_mod
  implicit none
  real, dimension (:),private, allocatable :: tt
  contains
  subroutine npolydiv_chain_init (nd, aa,bb)
    integer, intent (in) :: nd
    type( nfilter), intent (in) :: aa,bb
    allocate(tt(nd))
    call npolydiv_init (nd, aa)
    call npolydiv2_init (nd, bb)
  end subroutine
  integer function npolydiv_chain_lop (adj,add,xx, yy)
    logical, intent(in) :: adj,add
    real :: xx(:),yy(:)
    call chain(npolydiv_lop, npolydiv2_lop,adj,add,xx,yy,tt)
!npolydiv_chain_lop=npolydiv_lop(adj,add,xx,yy)
    npolydiv_chain_lop=0
  end function
  subroutine npoly_chain_close()
    call npolydiv_close ()
    call npolydiv2_close ()
    deallocate(tt)
  end subroutine
end module
