CalculationTreeDerivation Derived Type

type, public, extends(Derivation) :: CalculationTreeDerivation

Derivation object that has a calculation tree component, used to evaluate the derivation result independently of the passed indices. The derivation is constructed using a FlatTree, which needs to be unpacked before the derivation can be used. Note: This derivation should only be used if the passed object is the global VariableContainers variable array.


Components

Type Visibility Attributes Name Initial
logical, public :: userDefined = .false.

True only if user explicitly sets it to true

type(CalculationTree), private, allocatable :: tree
type(FlatTree), private :: flattenedTree
integer(kind=ik), private, pointer :: testPointer => null()

Used to check whether the tree needs to be reconstructed. Should become unassociated if this derivation object goes through a copy/allocation which is pointer unsafe.


Type-Bound Procedures

procedure, public :: isDefined => isDefinedObject

  • interface

    private pure module function isDefinedObject(this) result(defined)

    Getter for userDefined

    Arguments

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

    Return Value logical

procedure, public :: makeDefined => makeDefinedObject

  • interface

    private pure module subroutine makeDefinedObject(this)

    Set userDefined to .true.

    Arguments

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

procedure, public :: makeUndefined => makeUndefinedObject

  • interface

    private pure module subroutine makeUndefinedObject(this)

    Set userDefined to .false.

    Arguments

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

procedure, public :: init => initCalculationTreeDeriv

  • interface

    private module subroutine initCalculationTreeDeriv(this, flattenedTree)

    Initialize calculation tree derivation using flattened tree

    Arguments

    Type IntentOptional Attributes Name
    class(CalculationTreeDerivation), intent(inout) :: this
    type(FlatTree), intent(in) :: flattenedTree

procedure, public :: calculate => calculateTree

  • interface

    private module function calculateTree(this, inputArray, indices) result(output)

    Arguments

    Type IntentOptional Attributes Name
    class(CalculationTreeDerivation), intent(inout) :: this
    type(RealArray), intent(in), dimension(:) :: inputArray
    integer(kind=ik), intent(in), dimension(:) :: indices

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