!nbound - find the boundaries of a multi scale filter on given map
!C<call nboundn(nold,nd,na,aa)>
!=item nd    - C<int(:)>      Size of data
!=item na    - int(:)         Size of box surrounding filter
!=item aa    - C<type(filter)>Filter to calculate boundaries for
!mark nhelix filter outputs where input is off data
!=cut
module nbound_mod
! mark helix filter outputs where input is off data.
  use nhelix_mod
  use helicon_mod
  implicit none
  contains 
  subroutine nboundn ( ip, nd, na, aa)
    integer, dimension(:), intent( in) :: nd, na ! (ndim)
    type( nfilter)                     :: aa
    integer, intent (in)               :: ip
    allocate( aa%mis( product (nd)))
    call boundn1 (nd, nd, na, aa%hlx( ip))
    aa%mis = aa%hlx( ip)%mis
    deallocate( aa%hlx( ip)%mis)
    nullify( aa%hlx( ip)%mis)
  end subroutine 


end module 
