Subroutine to call hooks associated with the hook and level
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(pf_pfasst_t), | intent(inout), | target | :: | pf | main pfasst structure |
|
integer, | intent(in) | :: | level_ind | which pfasst level to call hook |
||
integer, | intent(in) | :: | hook | which hook to call |
subroutine call_hooks(pf, level_ind, hook)
use pf_mod_timer
type(pf_pfasst_t), intent(inout), target :: pf !! main pfasst structure
integer, intent(in) :: level_ind !! which pfasst level to call hook
integer, intent(in) :: hook !! which hook to call
integer :: i !! hook loop index
integer :: l !! level loop index
call start_timer(pf, THOOKS)
pf%state%hook = hook
if (level_ind == -1) then ! Do to all levels
do l = 1, pf%nlevels
do i = 1, pf%nhooks(l,hook)
call pf%hooks(l,hook,i)%proc(pf, pf%levels(l), pf%state)
end do
end do
else ! Do to just level level_ind
do i = 1, pf%nhooks(level_ind,hook)
call pf%hooks(level_ind,hook,i)%proc(pf, pf%levels(level_ind), pf%state)
end do
end if
call end_timer(pf, THOOKS)
end subroutine call_hooks