init_entry Function

public function init_entry(name, hash, num_calls, parent) result(entry)

Initializer of a stack entry

Arguments

TypeIntentOptionalAttributesName
character(len=*), intent(in) :: name

Name of a function

integer, intent(in) :: hash

Hash ID

integer, intent(in) :: num_calls

Current number of calls

type(mimic_stack_entry), pointer:: parent

Parent entry

Return Value type(mimic_stack_entry)


Contents

Source Code


Source Code

function init_entry(name, hash, num_calls, parent) result(entry)

    !> Name of a function
    character(len=*), intent(in) :: name
    !> Hash ID
    integer, intent(in) :: hash
    !> Current number of calls
    integer, intent(in) :: num_calls
    !> Parent entry
    type(mimic_stack_entry), pointer :: parent

    type(mimic_stack_entry) :: entry

    entry%name = name
    entry%hash = hash
    entry%num_calls = num_calls
    allocate(entry%start_times(num_calls))
    allocate(entry%end_times(num_calls))
    entry%num_children = 0
    entry%parent => parent

end function init_entry