pf_add_hook Subroutine

public subroutine pf_add_hook(pf, level_ind, hook, proc)

Subroutine to add a procedure to the hook on the given level

Arguments

Type IntentOptional AttributesName
type(pf_pfasst_t), intent(inout) :: pf

main pfasst structure

integer, intent(in) :: level_ind

which pfasst level to add hook

integer, intent(in) :: hook

which hook to add

procedure(pf_hook_p) :: proc

precudre to call from hook


Called by

proc~~pf_add_hook~~CalledByGraph proc~pf_add_hook pf_add_hook proc~pf_logger_attach pf_logger_attach proc~pf_logger_attach->proc~pf_add_hook

Contents

Source Code


Source Code

  subroutine pf_add_hook(pf, level_ind, hook, proc)
    type(pf_pfasst_t), intent(inout) :: pf            !! main pfasst structure
    integer,           intent(in)    :: level_ind     !! which pfasst level to add hook
    integer,           intent(in)    :: hook          !! which hook to add
    procedure(pf_hook_p)             :: proc          !! precudre to call from hook

    integer :: l   !

    if (level_ind == -1) then  ! Do to all levels
       do l = 1, pf%nlevels
          pf%nhooks(l,hook) = pf%nhooks(l,hook) + 1
          pf%hooks(l,hook,pf%nhooks(l,hook))%proc => proc
       end do
    else  ! Do to just level level_ind
       pf%nhooks(level_ind,hook) = pf%nhooks(level_ind,hook) + 1
       pf%hooks(level_ind,hook,pf%nhooks(level_ind,hook))%proc => proc
    end if

  end subroutine pf_add_hook