ModelboundDataVarlike Derived Type

type, public, extends(ModelboundData) :: ModelboundDataVarlike

Modelbound data object containing variable-like data updated using a variable container


Components

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

True only if user explicitly sets it to true

type(RealArray), private, allocatable, dimension(:) :: data

Values of modelbound data for each variable-like entry

type(VariableList), private :: dataVarList

List of names of data

type(CalculationRule), private, allocatable, dimension(:) :: derivationRules

Calculation rules for contained data

type(IntArray), private, allocatable, dimension(:) :: requiredDerivationIndices

Lists of required variable indices for each calculation

logical, private, allocatable, dimension(:) :: derivedFromMBData

True for those modelbound variables where derivation rules use other modelbound data

integer(kind=ik), private :: maxDataPriority

Highest priority value among data (lowest priority)


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

  • interface

    private pure module subroutine initModelboundDataVarlike(this, dataList, derivationRules, partitionObj, indexingObj, xHaloWidth, varCont, procRank, dataDerivIndices)

    Varlike modelbound data initialization routine

    Arguments

    Type IntentOptional Attributes Name
    class(ModelboundDataVarlike), intent(inout) :: this
    type(VariableList), intent(in) :: dataList

    Variable list object storing names of data

    type(CalculationRule), intent(in), dimension(:) :: derivationRules

    Calculation rules for each 1D data

    type(Partition), intent(in) :: partitionObj

    Partition object used to initialize arrays

    type(Indexing), intent(in) :: indexingObj

    Indexing object used to get numV and numH

    integer(kind=ik), intent(in) :: xHaloWidth

    Halo width in the x direction

    type(VariableContainer), intent(in) :: varCont

    Reference variable container for required derivation vars

    integer(kind=ik), intent(in) :: procRank

    Rank of the current process

    integer(kind=ik), intent(in), optional, dimension(:) :: dataDerivIndices

    Data indices for which derivations require other modelbound data

procedure, public :: update => updateDataVarlike

  • interface

    private module subroutine updateDataVarlike(this, hostModel, inputVars, updatePriority)

    Update modelbound data based on input variable container

    Arguments

    Type IntentOptional Attributes Name
    class(ModelboundDataVarlike), intent(inout) :: this
    class(ModelSurrogate), intent(in) :: hostModel

    Host model - unused

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

    Variable container used to calculate modelbound data

    integer(kind=ik), intent(in), optional :: updatePriority

    Priority for this update call (determines which variables are updated)

procedure, public :: copyData => copyDataVarlike

  • interface

    private module subroutine copyDataVarlike(this, name, container)

    Copy named modelbound data to passed container

    Arguments

    Type IntentOptional Attributes Name
    class(ModelboundDataVarlike), intent(in) :: this
    character(len=*), intent(in) :: name

    Name of data

    real(kind=rk), intent(inout), allocatable, dimension(..) :: container

    Container to copy into - must be rank 1

procedure, public :: getDataDim => getDataDimVarlike

  • interface

    private module function getDataDimVarlike(this, name) result(dim)

    Get data dimensionality (1 if fluid, 2 if single harmonic, 3 if distribution)

    Arguments

    Type IntentOptional Attributes Name
    class(ModelboundDataVarlike), intent(in) :: this
    character(len=*), intent(in) :: name

    Name of data

    Return Value integer(kind=ik)