#$ #$=head1 NAME #$ #$mshelix - module containing allocate, deallocation, and extraction mshelix's #$ #$=head1 SYNOPSIS #$ #$C #$ #$C #$ #$C #$ #$ #$=head1 INPUT PARAMETERS #$ #$=over 4 #$ #$=item msaa - type(msfilter) #$ #$ Multi-scale filter #$ #$=item nh - integer #$ #$ Number of coefs in filter #$ #$=item ns - integer #$ #$ Number of scales for the filter #$ #$=item aa - type(filter) #$ #$ A helix filter #$ #$=back #$ #$=head1 DESCRIPTION #$ #$Module that controls creation, destruction, and conversion (helix) #$for multi-scale filters. #$ #$=head1 COMMENTS #$ #$type(msfilter) : #$ #$=over 4 #$ #$=item C filter coefficients #$ #$=item C filter lags #$ #$=item C boundary conditions #$ #$=back #$ #$=head1 SEE ALSO #$ #$L,L #$ #$=head1 LIBRARY #$ #$B #$ #$=cut #$ module mshelix { # multiscale helix filter type use helix type msfilter { real, dimension( :), pointer :: flt # (nh) filter coefficients integer, dimension( :, :), pointer :: lag # (nh,ns) filter (lags,scales) logical, dimension( :, :), pointer :: mis # (nd,ns) boundary conditions } contains subroutine msallocate( msaa, nh, ns) { type( msfilter) :: msaa integer :: nh, ns allocate( msaa%flt( nh), msaa%lag( nh, ns)) msaa%flt = 0.; nullify( msaa%mis) } subroutine msdeallocate( msaa) { type( msfilter) :: msaa deallocate( msaa%flt, msaa%lag) if( associated( msaa%mis)) deallocate( msaa%mis) } function onescale( i, msaa) result (aa) { # Extract single-scale filter. integer, intent (in) :: i type( filter) :: aa type( msfilter) :: msaa aa%flt => msaa%flt aa%lag => msaa%lag( :, i) if( associated( msaa%mis)) aa%mis => msaa%mis( :, i) else nullify( aa%mis) } }