module helix1_mod  
! DEFINE helix filter type
    implicit none
	type filter  
		real,    dimension( :), pointer :: flt      ! (nh) filter coefficients
		integer, dimension( :), pointer :: lag      ! (nh) filter lags
		logical, dimension( :), pointer :: mis      ! (nd) boundary conditions
	end type
  contains
  subroutine allocatehelix1( aa, nh)             ! allocate a filter
	type( filter) :: aa
	integer       :: nh                         ! count of filter coefs (excl 1)
	allocate( aa%flt( nh), aa%lag( nh))         ! allocate filter and lags.
	nullify( aa%mis)                            ! set null pointer for "mis".
	aa%flt = 0.                                 ! zero filter coef values
  end subroutine 
  subroutine deallocatehelix1( aa)               ! destroy a filter
	type( filter) :: aa
	deallocate( aa%flt, aa%lag)                 ! free memory
	if (associated( aa%mis)) deallocate(aa%mis) ! if logicals were allocated free them
  end subroutine 
end module 

