# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "<stdin>"
module nhelicon_chain_mod
  use nhelicon
  use nhelicon2
  use chain_mod
  implicit none
  real, dimension (:),private, allocatable :: tt
  contains
  subroutine nhelicon_chain_init (nd, aa,bb)
    integer, intent (in) :: nd
    type( nfilter), intent (in) :: aa,bb
    allocate(tt(nd))
    call nhelicon_init ( aa)
    call nhelicon2_init (bb)
  end subroutine
  integer function nhelicon_chain_lop (adj,add,xx, yy)
    logical,intent(in) :: adj,add
    real :: xx(:),yy(:)
    call chain(nhelicon2_lop, nhelicon_lop,adj,add,xx,yy,tt)
    nhelicon_chain_lop=0
  end function
  subroutine nhelicon_chain_close()
    call nhelicon_close ()
    call nhelicon2_close ()
    deallocate(tt)
  end subroutine
end module
