Scrambler  1
TreeDeclarations Module Reference

Module defining tree node structure and basic operations. More...

+ Collaboration diagram for TreeDeclarations:

List of all members.

Data Types

type  NodeBox
 Contains the processor ID and grid dimensions of the data the node represents. More...
type  NodeBoxList
 List of NodeBoxes. More...
type  NodeDef
 Contains information needed to manage nodes. More...
type  NodeDefList
 List of NodeDefs. More...
type  pNodeDef
 Contains a Pointer to a NodeDef. More...
type  pNodeDefList
 Contains a Pointer to a NodeDefList. More...

Public Member Functions

Routines for creating nodes
subroutine, public AddNode (level, box, node, proclist, proctime)
 Create new node structure and add it to the appropriate current nodelist (Nodes(level)p).
subroutine, public AddOldNode (level, box, node, proclist, proctime)
 Create new node structure and add it to the appropriate old nodelist (OldNodes(level)p).
subroutine, public AddFindNode (level, box, node, proclist, proctime)
 Finds or Adds a node structure in the appropriate node list (Nodes(level)p).
subroutine, public AddFindOldNode (level, box, node, proclist, proctime)
 Finds or Adds a node structure in the appropriate node list (OldNodes(level)p).
Node destruction routines
subroutine, public NullifyNodeFields (node)
 Nullifes fields associated with a node.
subroutine, public DestroyNode (node)
 Deallocates structures associated with a node.
subroutine, public BackupNode (original, node, lRestore)
 Routine that duplicates a node.
Routines for adding connections in tree
subroutine, public AddParent (node, parent)
 Assigns the parent of a node.
subroutine, public AddOverlap (node, overlap)
 Singular version of AddOverlaps(), adds one new node to a node's overlaps list.
subroutine, public AddFindOverlap (node, overlap)
 Find or append an overlap to a node's overlap list.
subroutine, public AddNeighbor (node, neighbor)
 Append a single new node to a node's neighbors list.
subroutine, public AddChild (node, child)
 Append new entries to a node's child list.
subroutine, public AddFindChild (node, child)
 Find or append a child to a node's child lsit.
NodeList Operations
subroutine, public AddNodeToList (node, lastnode, nodelist)
 Adds node to nodelist and updates lastnode pointer.
recursive subroutine, public ClearNodeList (nodelist)
 Deallocate all the node objects in a given node list.
recursive subroutine, public DestroyNodeList (nodelist)
 Deallocates and nullifies all links in a NodeList list. Unlike ClearNodeList(),.
subroutine, public BackupNodelist (original, backup, lRestore, lastnode)
 Routine that duplicates a nodelist.
Routines for finding nodes
subroutine, public FindNode (level, box, node)
 Find a node in the appropriate node list (Nodes(level)p)
subroutine, public StrictFindNode (level, box, node, caller)
 Find a node in the appropriate node list or STOP! (Nodes(level)p)
subroutine, public StrictFindAnyNode (level, box, node, caller)
 Find a node in the appropriate node list or STOP - using only mGlobal and not mpi_id.
subroutine, public StrictFindBackupNode (level, box, node, caller)
 Find a node in the appropriate node list or STOP! (Nodes(level)p)
subroutine, public FindOldNode (level, box, node)
 Find a node in the appropriate node list (OldNodes(level)p)
subroutine, public FindBackupNode (level, box, node)
 Find a node in the appropriate node list (OldNodes(level)p)
subroutine, public FindNodeInList (box, nodelist, node)
subroutine, public StrictFindOldNode (level, box, node, caller)
 Find a node in the appropriate node list or STOP! (OldNodes(level)p)
INTEGER function, public GetChildID (node, child)
 Find the position of a child within a node's childlist.
Miscellaneous routines
LOGICAL function, public isAncestor (childmask)
 Checks a childmask to determine whether or not it corresponds to an ancestor cell.
INTEGER function, public GetFinestLevel ()
 Finds the highest level ON THIS PROCESS that has any grids on it. On multiprocessor jobs, this is followed by an MPI_ALLREDUCE to aggregate the results.
INTEGER function, public NodeCount (node_list)
 Counts number of nodes in a nodelist.
INTEGER function, public CellCount (node_list)
 Counts number of nodes in a nodelist.
subroutine, public traverse (node_list)
 Traverses a nodelist printing out useful information.
Routines for manipulating node box indices
INTEGER function, dimension(3,
2), public 
GetChildMGlobal (node, mB, level)
 Get indices of parent box in node's level.
INTEGER function, dimension(3,
2), public 
GetChildMBounds (node, childmGlobal, level)
 Transform indices of node child box into node's level.
Routines for manipulating node boxes
subroutine, public CreateNodeBox (box_array, node_box, proc_id)
 Creates a node box.
subroutine, public DestroyNodeBox (node_box)
 Destroys a node box.
LOGICAL function, public MatchBox (box1, box2)
 Routine to match two boxes.
Routines for manipulating nodeboxlists
subroutine, public AddNodeBoxToList (last_box, first_box, current_box)
 Adds a new NodeBoxList structure to the the block list passed in.
recursive subroutine, public ClearNodeBoxList (box_list)
 Deletes elements from a NodeBox list structure, starting with the referenced element.
INTEGER function, public NodeBoxCount (box_list)
subroutine, public FindParent (level, mGlobal, parent)
 Locates the parent node of the specified box, or returns null.
subroutine, public StrictFindParent (level, mGlobal, parent, caller)
 Seeks the parent node for the specified grid, but kills the program if it can't be found.

Public Attributes

TYPE(pNodeDefList), dimension(:),
pointer, public 
Nodes
TYPE(pNodeDefList), dimension(:),
pointer, public 
OldNodes
TYPE(pNodeDefList), dimension(:),
pointer, public 
ExternalNodes
TYPE(pNodeDefList), dimension(:),
pointer, public 
OldExternalNodes
TYPE(pNodeDefList), dimension(:),
pointer, public 
BackupNodes
TYPE(pNodeDefList), dimension(:),
pointer, public 
BackupExternalNodes
TYPE(pNodeDefList), dimension(:),
pointer, public 
LastLocalNode
TYPE(pNodeDefList), dimension(:),
pointer, public 
LastExternalNode
TYPE(pNodeDefList), dimension(:),
pointer, public 
LastOldLocalNode
TYPE(pNodeDefList), dimension(:),
pointer, public 
LastOldExternalNode

Private Attributes

INTEGER nNodes = 0

Routines for determining necessary connections in tree

LOGICAL function, public ChildCanBeNeighbor (node, child, level)
 Determines whether or not a child needs to be communicated to neighboring nodes.
LOGICAL function, public NephewCanBeNeighbor (neighbor, child, neighborlevel)
 Determines whether or not a child could neighbor the children of a neighbor.
LOGICAL function, public NephewCanBeOverlap (overlap, child, level)
 Determines whether or not a child could overlap the children of an overlap.
LOGICAL function, public Overlaps (child, overlapchild, level)
 Determines whether or not a child could overlap the child of an overlap.
LOGICAL function, public Neighbors (child, neighborchild, level)
 Determines whether or not a child could neighbor the child of a neighbor.
LOGICAL function Within (mGlobal1, mGlobal2)
 Determines whether or not box1 is entirely within box 2.

Detailed Description

Module defining tree node structure and basic operations.

Definition at line 39 of file tree_declarations.f90.


Member Function/Subroutine Documentation

subroutine, public AddNode ( INTEGER  level,
TYPE(NodeBox box,
TYPE(NodeDef), pointer  node,
INTEGER, dimension(:), optional, pointer  proclist,
REAL, dimension(:), optional, pointer  proctime 
)

Create new node structure and add it to the appropriate current nodelist (Nodes(level)p).

Parameters:
levellevel of new node
boxnew node's box
nodepointer to added node
proclistnew node's processor list (optional)
proctimenew node's processor times (optional)

Definition at line 150 of file tree_declarations.f90.

subroutine, public AddOldNode ( INTEGER  level,
TYPE(NodeBox box,
TYPE(NodeDef), pointer  node,
INTEGER, dimension(:), optional, pointer  proclist,
REAL, dimension(:), optional, pointer  proctime 
)

Create new node structure and add it to the appropriate old nodelist (OldNodes(level)p).

Parameters:
levellevel of new node
boxnew node's box
nodepointer to added node
proclistnew node's processor list (optional)
proctimenew node's processor times (optional)

Definition at line 220 of file tree_declarations.f90.

subroutine, public AddFindNode ( INTEGER  level,
TYPE(NodeBox box,
TYPE(NodeDef), pointer  node,
INTEGER, dimension(:), optional, pointer  proclist,
REAL, dimension(:), optional, pointer  proctime 
)

Finds or Adds a node structure in the appropriate node list (Nodes(level)p).

Parameters:
levellevel of node
boxnode's box
nodepointer to added/found node
proclistnode's processor list (optional)
proctimenode's processor times (optional)

Definition at line 294 of file tree_declarations.f90.

subroutine, public AddFindOldNode ( INTEGER  level,
TYPE(NodeBox box,
TYPE(NodeDef), intent(out), pointer  node,
INTEGER, dimension(:), optional, pointer  proclist,
REAL, dimension(:), optional, pointer  proctime 
)

Finds or Adds a node structure in the appropriate node list (OldNodes(level)p).

Parameters:
levellevel of node
boxnode's box
nodepointer to added/found node
proclistnode's processor list (optional)
proctimenode's processor times (optional)

Definition at line 335 of file tree_declarations.f90.

subroutine, public NullifyNodeFields ( TYPE(NodeDef), pointer  node)

Nullifes fields associated with a node.

Parameters:
nodenode object

Definition at line 376 of file tree_declarations.f90.

subroutine, public DestroyNode ( TYPE(NodeDef), pointer  node)

Deallocates structures associated with a node.

Parameters:
nodenode object

Definition at line 394 of file tree_declarations.f90.

subroutine, public BackupNode ( TYPE(NodeDef), pointer  original,
TYPE(NodeDef), pointer  node,
LOGICAL  lRestore 
)

Routine that duplicates a node.

Parameters:
originaloriginal node
nodebackup node

Definition at line 431 of file tree_declarations.f90.

subroutine, public AddParent ( TYPE(NodeDef), pointer  node,
TYPE(NodeDef), pointer  parent 
)

Assigns the parent of a node.

Parameters:
nodecurrent node
parentparent node

Definition at line 462 of file tree_declarations.f90.

subroutine, public AddOverlap ( TYPE(NodeDef), pointer  node,
TYPE(NodeDef), pointer  overlap 
)

Singular version of AddOverlaps(), adds one new node to a node's overlaps list.

Parameters:
nodecurrent node
overlapoverlap node

Definition at line 475 of file tree_declarations.f90.

subroutine, public AddFindOverlap ( TYPE(NodeDef), pointer  node,
TYPE(NodeDef), pointer  overlap 
)

Find or append an overlap to a node's overlap list.

Parameters:
nodecurrent node
overlapThe overlap node being found or added.

Definition at line 487 of file tree_declarations.f90.

subroutine, public AddNeighbor ( TYPE(NodeDef), pointer  node,
TYPE(NodeDef), pointer  neighbor 
)

Append a single new node to a node's neighbors list.

Parameters:
nodecurrent node
neighborneighbor node

Definition at line 508 of file tree_declarations.f90.

subroutine, public AddChild ( TYPE(NodeDef), pointer  node,
TYPE(NodeDef), pointer  child 
)

Append new entries to a node's child list.

Parameters:
nodecurrent node
childchild nodes

Definition at line 520 of file tree_declarations.f90.

subroutine, public AddFindChild ( TYPE(NodeDef), pointer  node,
TYPE(NodeDef), pointer  child 
)

Find or append a child to a node's child lsit.

Parameters:
nodecurrent node
childchild to find or add

Definition at line 531 of file tree_declarations.f90.

subroutine, public AddNodeToList ( TYPE(NodeDef), pointer  node,
TYPE(NodeDefList), pointer  lastnode,
TYPE(NodeDefList), optional, pointer  nodelist 
)

Adds node to nodelist and updates lastnode pointer.

Parameters:
nodenode object to add
lastnodepointer to last node of nodelist
nodelistnodelist to add to

Definition at line 558 of file tree_declarations.f90.

recursive subroutine, public ClearNodeList ( TYPE(NodeDefList), pointer  nodelist)

Deallocate all the node objects in a given node list.

Parameters:
nodelistnodelist to clear

Definition at line 609 of file tree_declarations.f90.

recursive subroutine, public DestroyNodeList ( TYPE(NodeDefList), pointer  nodelist)

Deallocates and nullifies all links in a NodeList list. Unlike ClearNodeList(),.

DestroyNodeList() also destroys the Node object associated with each list entry.

Parameters:
nodelistThe pointer to a NodeList object

Definition at line 620 of file tree_declarations.f90.

subroutine, public BackupNodelist ( TYPE(NodeDefList), pointer  original,
TYPE(NodeDefList), pointer  backup,
LOGICAL  lRestore,
TYPE(NodeDefList), optional, pointer  lastnode 
)

Routine that duplicates a nodelist.

Parameters:
originaloriginal nodelist
backupbackup nodelist

Definition at line 634 of file tree_declarations.f90.

subroutine, public FindNode ( INTEGER  level,
TYPE(NodeBox box,
TYPE(NodeDef), pointer  node 
)

Find a node in the appropriate node list (Nodes(level)p)

Parameters:
levellevel to search
boxbox to match
nodepointer to found node

Definition at line 664 of file tree_declarations.f90.

subroutine, public StrictFindNode ( INTEGER  level,
TYPE(NodeBox box,
TYPE(NodeDef), pointer  node,
CHARACTER(*)  caller 
)

Find a node in the appropriate node list or STOP! (Nodes(level)p)

Parameters:
levellevel to search
boxbox to match
nodepointer to found node
callerstring passed in by calling routine

Definition at line 683 of file tree_declarations.f90.

subroutine, public StrictFindAnyNode ( INTEGER  level,
TYPE(NodeBox box,
TYPE(NodeDef), pointer  node,
CHARACTER(*)  caller 
)

Find a node in the appropriate node list or STOP - using only mGlobal and not mpi_id.

Parameters:
levellevel to search
boxbox to match
nodepointer to found node
callerstring passed in by calling routine

Definition at line 708 of file tree_declarations.f90.

subroutine, public StrictFindBackupNode ( INTEGER  level,
TYPE(NodeBox box,
TYPE(NodeDef), pointer  node,
CHARACTER(*)  caller 
)

Find a node in the appropriate node list or STOP! (Nodes(level)p)

Parameters:
levellevel to search
boxbox to match
nodepointer to found node
callerstring passed in by calling routine

Definition at line 749 of file tree_declarations.f90.

subroutine, public FindOldNode ( INTEGER  level,
TYPE(NodeBox box,
TYPE(NodeDef), pointer  node 
)

Find a node in the appropriate node list (OldNodes(level)p)

Parameters:
levellevel to search
boxbox to match
nodepointer to found node

Definition at line 771 of file tree_declarations.f90.

subroutine, public FindBackupNode ( INTEGER  level,
TYPE(NodeBox box,
TYPE(NodeDef), pointer  node 
)

Find a node in the appropriate node list (OldNodes(level)p)

Parameters:
levellevel to search
boxbox to match
nodepointer to found node

Definition at line 791 of file tree_declarations.f90.

subroutine, public FindNodeInList ( TYPE(Nodebox)  box,
TYPE(NodeDefList), pointer  nodelist,
TYPE(NodeDef), pointer  node 
)

Definition at line 808 of file tree_declarations.f90.

subroutine, public StrictFindOldNode ( INTEGER  level,
TYPE(NodeBox box,
TYPE(NodeDef), pointer  node,
CHARACTER(*)  caller 
)

Find a node in the appropriate node list or STOP! (OldNodes(level)p)

Parameters:
levellevel to search
boxbox to match
nodepointer to found node
callerstring passed in by calling routine

Definition at line 835 of file tree_declarations.f90.

INTEGER function, public GetChildID ( TYPE(NodeDef), pointer  node,
TYPE(NodeDef), pointer  child 
)

Find the position of a child within a node's childlist.

Parameters:
nodenode object
childchild to find

Definition at line 855 of file tree_declarations.f90.

LOGICAL function, public isAncestor ( INTEGER  childmask)

Checks a childmask to determine whether or not it corresponds to an ancestor cell.

Parameters:
childmaskvalue of childmask

Definition at line 881 of file tree_declarations.f90.

INTEGER function, public GetFinestLevel ( )

Finds the highest level ON THIS PROCESS that has any grids on it. On multiprocessor jobs, this is followed by an MPI_ALLREDUCE to aggregate the results.

Definition at line 888 of file tree_declarations.f90.

INTEGER function, public NodeCount ( TYPE(NodeDefList), pointer  node_list)

Counts number of nodes in a nodelist.

Parameters:
node_listnodelist object

Definition at line 913 of file tree_declarations.f90.

INTEGER function, public CellCount ( TYPE(NodeDefList), pointer  node_list)

Counts number of nodes in a nodelist.

Parameters:
node_listnodelist object

Definition at line 932 of file tree_declarations.f90.

subroutine, public traverse ( TYPE(NodeDefList), pointer  node_list)

Traverses a nodelist printing out useful information.

Parameters:
node_listnodelist object

Definition at line 947 of file tree_declarations.f90.

LOGICAL function, public ChildCanBeNeighbor ( TYPE(NodeDef node,
TYPE(NodeDef child,
INTEGER  level 
)

Determines whether or not a child needs to be communicated to neighboring nodes.

Parameters:
nodenode object
childnode's child
levellevel

Definition at line 978 of file tree_declarations.f90.

LOGICAL function Within ( INTEGER, dimension(3,2)  mGlobal1,
INTEGER, dimension(3,2)  mGlobal2 
) [private]

Determines whether or not box1 is entirely within box 2.

Parameters:
mGlobal1box 1
mGlobal2box 2

Definition at line 1011 of file tree_declarations.f90.

LOGICAL function, public NephewCanBeNeighbor ( TYPE(NodeDef neighbor,
TYPE(NodeDef child,
INTEGER  neighborlevel 
)

Determines whether or not a child could neighbor the children of a neighbor.

Parameters:
neighborneighboring node
childchild node
neighborlevellevel of neighbor node

Definition at line 1021 of file tree_declarations.f90.

LOGICAL function, public NephewCanBeOverlap ( TYPE(NodeDef overlap,
TYPE(NodeDef child,
INTEGER  level 
)

Determines whether or not a child could overlap the children of an overlap.

Parameters:
overlapoverlapping node
childchild node
levellevel of overlap node

Definition at line 1061 of file tree_declarations.f90.

LOGICAL function, public Overlaps ( TYPE(NodeDef child,
TYPE(NodeDef overlapchild,
INTEGER  level 
)

Determines whether or not a child could overlap the child of an overlap.

Parameters:
childchild node
overlapchildchild of overlap node
levellevel of child and overlapchild

Definition at line 1105 of file tree_declarations.f90.

LOGICAL function, public Neighbors ( TYPE(NodeDef child,
TYPE(NodeDef neighborchild,
INTEGER  level 
)

Determines whether or not a child could neighbor the child of a neighbor.

Parameters:
childchild node
neighborchildchild of neighbor node
levellevel of child and neighborchild

Definition at line 1145 of file tree_declarations.f90.

INTEGER function, dimension(3,2), public GetChildMGlobal ( TYPE(NodeDef), pointer  node,
INTEGER, dimension(3,2)  mB,
INTEGER  level 
)

Get indices of parent box in node's level.

Parameters:
nodenode object
mBparent box's bounds
levellevel of node's parent

Definition at line 1191 of file tree_declarations.f90.

INTEGER function, dimension(3,2), public GetChildMBounds ( TYPE(NodeDef), pointer  node,
INTEGER, dimension(3,2)  childmGlobal,
INTEGER  level 
)

Transform indices of node child box into node's level.

Parameters:
nodenode object
childmGlobalchild box indices
levelnode's level

Definition at line 1205 of file tree_declarations.f90.

subroutine, public CreateNodeBox ( INTEGER, dimension(3,2)  box_array,
TYPE(NodeBox), pointer  node_box,
INTEGER, optional  proc_id 
)

Creates a node box.

Parameters:
box_arrayindices of new box
node_boxreturns pointer to created box
proc_idprocessor location of new box

Definition at line 1234 of file tree_declarations.f90.

subroutine, public DestroyNodeBox ( TYPE(NodeBox), pointer  node_box)

Destroys a node box.

Parameters:
node_boxbox to destroy

Definition at line 1267 of file tree_declarations.f90.

LOGICAL function, public MatchBox ( TYPE(NodeBox box1,
TYPE(NodeBox box2 
)

Routine to match two boxes.

Parameters:
box1box 1
box2box 2

Definition at line 1281 of file tree_declarations.f90.

subroutine, public AddNodeBoxToList ( TYPE(NodeBoxList), pointer  last_box,
TYPE(NodeBoxList), optional, pointer  first_box,
TYPE(NodeBoxList), optional, pointer  current_box 
)

Adds a new NodeBoxList structure to the the block list passed in.

Parameters:
last_boxThe NodeBox list to which the new block will be appended.
first_boxAn optional MessageBlock pointer that will point to a freshly-created MessageBlock list.
current_boxAnother optional MessageBlock pointer that will point to a freshly-created MessageBlock list.

Definition at line 1296 of file tree_declarations.f90.

recursive subroutine, public ClearNodeBoxList ( TYPE(NodeBoxList), pointer  box_list)

Deletes elements from a NodeBox list structure, starting with the referenced element.

Parameters:
box_listA reference to a node box list list.

Definition at line 1335 of file tree_declarations.f90.

INTEGER function, public NodeBoxCount ( TYPE(NodeBoxList), pointer  box_list)

Definition at line 1351 of file tree_declarations.f90.

subroutine, public FindParent ( INTEGER  level,
INTEGER, dimension(max_dims, 2)  mGlobal,
TYPE(NodeDef), pointer  parent 
)

Locates the parent node of the specified box, or returns null.

Parameters:
levelThe level of the grid whose parent is being sought.
mGlobalThe dimensions of the grid whose parent is being sought.
parentA pointer that will be associated with a parent node.

Definition at line 1375 of file tree_declarations.f90.

subroutine, public StrictFindParent ( INTEGER  level,
INTEGER, dimension(max_dims, 2)  mGlobal,
TYPE(NodeDef), pointer  parent,
CHARACTER(LEN=*)  caller 
)

Seeks the parent node for the specified grid, but kills the program if it can't be found.

Parameters:
levelThe level of the grid whose parent is being sought.
mGlobalThe dimensions of the grid whose parent is being sought.
parentA pointer that will be associated with a parent node.
callerA string containing the calling process (used only if a parent node isn't found).

Definition at line 1418 of file tree_declarations.f90.


Member Data Documentation

TYPE(pNodeDefList), dimension(:), pointer, public Nodes

Definition at line 133 of file tree_declarations.f90.

TYPE(pNodeDefList), dimension(:), pointer, public OldNodes

Definition at line 133 of file tree_declarations.f90.

TYPE(pNodeDefList), dimension(:), pointer, public ExternalNodes

Definition at line 133 of file tree_declarations.f90.

TYPE(pNodeDefList), dimension(:), pointer, public OldExternalNodes

Definition at line 133 of file tree_declarations.f90.

TYPE(pNodeDefList), dimension(:), pointer, public BackupNodes

Definition at line 133 of file tree_declarations.f90.

TYPE(pNodeDefList), dimension(:), pointer, public BackupExternalNodes

Definition at line 133 of file tree_declarations.f90.

TYPE(pNodeDefList), dimension(:), pointer, public LastLocalNode

Definition at line 134 of file tree_declarations.f90.

TYPE(pNodeDefList), dimension(:), pointer, public LastExternalNode

Definition at line 134 of file tree_declarations.f90.

TYPE(pNodeDefList), dimension(:), pointer, public LastOldLocalNode

Definition at line 134 of file tree_declarations.f90.

TYPE(pNodeDefList), dimension(:), pointer, public LastOldExternalNode

Definition at line 134 of file tree_declarations.f90.

INTEGER nNodes = 0 [private]

Definition at line 136 of file tree_declarations.f90.


The documentation for this module was generated from the following file:
 All Classes Files Functions Variables