Subroutine to add a procedure to the hook on the given level
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
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