Skip to content

adam_tree_bucket_object

ADAM, tree bucket class definition. The bucket is implemented as a dictionary based on a double linked list.

Source: src/lib/common/adam_tree_bucket_object.f90

Dependencies

Contents

Derived Types

tree_bucket_object

tree bucket class definition.

Components

NameTypeAttributesDescription
headtype(tree_node_object)pointerThe first node in the tree bucket.
tailtype(tree_node_object)pointerThe last node in the tree bucket.
nodes_numberinteger(kind=I4P)Number of nodes in the tree bucket.
codeinteger(kind=I8P)Minimum and maximum unique code values actually stored.

Type-Bound Procedures

NameAttributesDescription
add_nodepass(self)Add a node pointer to the tree bucket.
destroypass(self)Destroy the tree bucket.
has_codepass(self)Check if the code is present in the tree bucket.
looppass(self)Sentinel while-loop on nodes returning the code.
nodepass(self)Return a pointer to a node.
remove_nodepass(self)Remove a node from the tree bucket, given the code.
traversepass(self)Traverse tree bucket from head to tail calling the iterator procedure.
remove_by_pointerpass(self)Remove node from tree bucket, given pointer to it.
update_codepass(self)Update minimum and maximum unique code values.

Interfaces

len

Overload len builtin for accepting a tree_bucket_object.

Module procedures: tree_bucket_len

Subroutines

add_node

Add a node pointer to the tree bucket.

@note If a node with the same code is already in the tree bucket, it is removed and the new one will replace it.

fortran
subroutine add_node(self, code, refinement_needed, myrank, block_index)

Arguments

NameTypeIntentAttributesDescription
selfclass(tree_bucket_object)inoutThe tree bucket.
codeinteger(kind=I8P)inThe Morton code.
refinement_neededinteger(kind=I4P)inoptionalFlag for refinement/derefinement algorithm.
myrankinteger(kind=I4P)inoptionalMPI rank process.
block_indexinteger(kind=I8P)inoptionalBlock index in the field array.

Call graph

destroy

Destroy the tree bucket.

fortran
subroutine destroy(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(tree_bucket_object)inoutThe tree bucket.

Call graph

remove_node

Remove a node from the tree bucket, given the code.

fortran
subroutine remove_node(self, code)

Arguments

NameTypeIntentAttributesDescription
selfclass(tree_bucket_object)inoutThe tree bucket.
codeinteger(kind=I8P)inThe Morton code.

Call graph

traverse

Traverse tree bucket from head to tail calling the iterator procedure.

fortran
subroutine traverse(self, iterator)

Arguments

NameTypeIntentAttributesDescription
selfclass(tree_bucket_object)inThe tree bucket.
iteratorprocedure(iterator_interface)The iterator procedure to call for each node.

Call graph

remove_by_pointer

Remove node from tree bucket, given pointer to it.

fortran
subroutine remove_by_pointer(self, p)

Arguments

NameTypeIntentAttributesDescription
selfclass(tree_bucket_object)inoutThe tree bucket.
ptype(tree_node_object)inoutpointerPointer to the node to remove.

Call graph

update_code

Update minimum and maximum unique code values.

fortran
subroutine update_code(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(tree_bucket_object)inoutThe tree bucket.

Call graph

Functions

tree_bucket_len

Return the number of nodes of the tree bucket, namely the tree bucket length.

Attributes: elemental

Returns: integer(kind=I4P)

fortran
function tree_bucket_len(self) result(length)

Arguments

NameTypeIntentAttributesDescription
selftype(tree_bucket_object)inThe tree bucket.

has_code

Check if the code is present in the tree bucket.

Returns: logical

fortran
function has_code(self, code)

Arguments

NameTypeIntentAttributesDescription
selfclass(tree_bucket_object)inThe tree bucket.
codeinteger(kind=I8P)inThe Morton code.

Call graph

loop

Sentinel while-loop on nodes returning the code (for tree bucket looping).

Returns: logical

fortran
function loop(self, code) result(again)

Arguments

NameTypeIntentAttributesDescription
selfclass(tree_bucket_object)inThe tree bucket.
codeinteger(kind=I8P)outoptionalThe Morton code.

Call graph

node

Return a pointer to a node in the tree bucket.

Returns: type(tree_node_object)

fortran
function node(self, code) result(p)

Arguments

NameTypeIntentAttributesDescription
selfclass(tree_bucket_object)inThe tree bucket.
codeinteger(kind=I8P)inThe Morton code.

Call graph