list_callstackentry_peek Function

public function list_callstackentry_peek(list) result(value)

Returns the last element in the list. Is equivalent to: list_callstackentry_get(list, list_callstackentry_size(list))

Arguments

Type IntentOptional Attributes Name
type(list_callstackentry_type), intent(inout) :: list

Return Value type(callstack_entry_type)


Source Code

FUNCTION list_callstackentry_peek(list) RESULT(value)
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_callstackentry.F"
   !! Returns the last element in the list.
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_callstackentry.F"
   !! Is equivalent to: list_callstackentry_get(list, list_callstackentry_size(list))
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_callstackentry.F"

# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_callstackentry.F"
    TYPE(list_callstackentry_type), intent(inout)  :: list
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_callstackentry.F"
    TYPE(callstack_entry_type)  :: value
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_callstackentry.F"

# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_callstackentry.F"
    IF(.not. ASSOCIATED(list%arr)) &
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_callstackentry.F"
       DBCSR_ABORT("list_callstackentry_peek: list is not initialized.")
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_callstackentry.F"
    IF(list%size < 1) &
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_callstackentry.F"
       DBCSR_ABORT("list_callstackentry_peek: list is empty.")
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_callstackentry.F"

# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_callstackentry.F"
    value = list%arr(list%size)%p%value
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_callstackentry.F"
END FUNCTION list_callstackentry_peek