TermEvaluator Derived Type

type, public, extends(Manipulator) :: TermEvaluator

Manipulator that evaluates a specific model,term pairs and writes the total result into variable with given index Optionally accumulates the values in the variable instead of overriding them. Optionally performs its own update calls on the models/terms


Components

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

True only if user explicitly sets it to true

integer(kind=ik), private :: resultVarIndex
integer(kind=ik), private, allocatable, dimension(:) :: evaluatedModelIndex
type(StringArray), private, allocatable, dimension(:) :: evaluatedTermName
logical, private :: accumulate = .false.

If true will accumulate values instead of overriding them

logical, private :: update = .false.

Update the model and terms being accessed


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 => initEvaluator

  • interface

    private pure module subroutine initEvaluator(this, resultVarIndex, modelIndices, termNames, accumulate, update)

    TermEvaluator initialization routine

    Arguments

    Type IntentOptional Attributes Name
    class(TermEvaluator), intent(inout) :: this
    integer(kind=ik), intent(in) :: resultVarIndex

    Index of variable to write the result in

    integer(kind=ik), intent(in), dimension(:) :: modelIndices

    Indices of models whose named term should be evaluated

    type(StringArray), intent(in), dimension(:) :: termNames

    Name of evaluated term corresponding to each model

    logical, intent(in), optional :: accumulate

    Optional flag to make the evaluator accumulate values instead of overriding them

    logical, intent(in), optional :: update

    Optional flag to make the evaluator update the model and terms being accessed

procedure, public :: affect => evaluate

  • interface

    private module subroutine evaluate(this, manipulatedModeller, outputVars, inputVars)

    Implementation of abstract manipulate routine for the evaluator

    Arguments

    Type IntentOptional Attributes Name
    class(TermEvaluator), intent(inout) :: this
    class(ModellerSurrogate), intent(inout) :: manipulatedModeller

    Modeller to be used in callbacks during manipulation

    class(VariableContainer), intent(inout) :: outputVars

    VariableContainer object to store the manipulation output

    class(VariableContainer), intent(in) :: inputVars

    VariableContainer object housing input data for the manipulation routine