calculation_tree_procedures Submodule

Contains module procedures associated with calculation tree and node classes


Uses


Module Functions

pure recursive module function evaluateNode(this, inputArray) result(res)

Recursively evaluate nodes, using the inputArray variables for leaf values

Arguments

Type IntentOptional Attributes Name
class(CalculationNode), intent(in) :: this
type(RealArray), intent(in), dimension(:) :: inputArray

Return Value real(kind=rk), allocatable, dimension(:)

pure module function evaluateTree(this, inputArray) result(res)

Call tree's root node evaluate

Arguments

Type IntentOptional Attributes Name
class(CalculationTree), intent(in) :: this
type(RealArray), intent(in), dimension(:) :: inputArray

Return Value real(kind=rk), allocatable, dimension(:)

module function flattenTree(this) result(res)

Flatten tree into FlatTree object

Arguments

Type IntentOptional Attributes Name
class(CalculationTree), intent(in) :: this

Return Value type(FlatTree)


Module Subroutines

module subroutine initNode(this, additiveMode, constant, leafVarIndex, unaryRealParams, unaryIntParams, unaryLogicalParams, unaryTransformTag)

Calculation node initialization routine

Arguments

Type IntentOptional Attributes Name
class(CalculationNode), intent(inout) :: this
logical, intent(in), optional :: additiveMode
real(kind=rk), intent(in), optional :: constant
integer(kind=ik), intent(in), optional :: leafVarIndex
real(kind=rk), intent(in), optional, dimension(:) :: unaryRealParams
integer(kind=ik), intent(in), optional, dimension(:) :: unaryIntParams
logical, intent(in), optional, dimension(:) :: unaryLogicalParams
character(len=*), intent(in), optional :: unaryTransformTag

module subroutine initTree(this, additiveMode, constant, leafVarIndex, unaryRealParams, unaryIntParams, unaryLogicalParams, unaryTransformTag)

Calculation tree initialization routine

Arguments

Type IntentOptional Attributes Name
class(CalculationTree), intent(inout) :: this
logical, intent(in), optional :: additiveMode
real(kind=rk), intent(in), optional :: constant
integer(kind=ik), intent(in), optional :: leafVarIndex
real(kind=rk), intent(in), optional, dimension(:) :: unaryRealParams
integer(kind=ik), intent(in), optional, dimension(:) :: unaryIntParams
logical, intent(in), optional, dimension(:) :: unaryLogicalParams
character(len=*), intent(in), optional :: unaryTransformTag

module subroutine addChild(this, additiveMode, constant, leafVarIndex, unaryRealParams, unaryIntParams, unaryLogicalParams, unaryTransformTag)

Initialize a child node of this node with given properties

Arguments

Type IntentOptional Attributes Name
class(CalculationNode), intent(inout), target :: this
logical, intent(in), optional :: additiveMode
real(kind=rk), intent(in), optional :: constant
integer(kind=ik), intent(in), optional :: leafVarIndex
real(kind=rk), intent(in), optional, dimension(:) :: unaryRealParams
integer(kind=ik), intent(in), optional, dimension(:) :: unaryIntParams
logical, intent(in), optional, dimension(:) :: unaryLogicalParams
character(len=*), intent(in), optional :: unaryTransformTag

module subroutine initFromFlatTree(this, fTree)

Calculation tree initialization routine using a FlatTree object

Arguments

Type IntentOptional Attributes Name
class(CalculationTree), intent(inout) :: this
type(FlatTree), intent(in) :: fTree

pure recursive module subroutine destroyNode(this)

Arguments

Type IntentOptional Attributes Name
class(CalculationNode), intent(inout) :: this

elemental module subroutine finalizeCalculationTree(this)

Arguments

Type IntentOptional Attributes Name
type(CalculationTree), intent(inout) :: this