sdr_node_neighbors Function

public function sdr_node_neighbors(me, level_offset, iNode, coord) result(neighbors)

This routine identifies the 6 direct neighbors of a node in the prototree

Todo

We could cut the lookups of neighbors in the complete tree by one half, if we set the siblings within the same direct parent by their in-node relation (all 8 siblings within a parent either exist or do not exist at all). We than would have to iterate only over the remaining three outer sides of each node here.

Arguments

Type IntentOptional Attributes Name
type(sdr_protoTree_type), intent(in) :: me

neighbors are identified for this tree and neighbor of each node are stored at link_pos of each node in node_data type

integer(kind=long_k), intent(in), optional :: level_offset

First treeID on level

integer, intent(in) :: iNode

Node position in protoTree

integer, intent(in), optional :: coord(4)

if coord is present, no need to compute using tem_coordOfID

Return Value integer, (6)