variable_container_procedures Submodule

Contains module procedures associated with the variable container class


Uses


Module Functions

pure module function getVarIndex(this, name) result(ind)

Get index of variable with given name

Arguments

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

Return Value integer(kind=ik)

pure module function isVarDist(this, ind) result(distf)

Check whether variable with given index is a distribution function

Arguments

Type IntentOptional Attributes Name
class(VariableContainer), intent(in) :: this
integer(kind=ik), intent(in) :: ind

Return Value logical

pure module function isVarScalar(this, ind) result(scal)

Check whether variable with given index is a scalar

Arguments

Type IntentOptional Attributes Name
class(VariableContainer), intent(in) :: this
integer(kind=ik), intent(in) :: ind

Return Value logical

pure module function isVarNameRegistered(this, name) result(reg)

Check whether variable with given name is registered in either the implicit or derived list

Arguments

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

Return Value logical

pure module function isVarImplicit(this, name) result(imp)

Check whether variable with given name is registered in either the implicit list

Arguments

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

Return Value logical

pure module function isVarOnDualGrid(this, name) result(dual)

Check whether variable with given name is on dual grid

Arguments

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

Return Value logical

pure module function getVarName(this, ind) result(name)

Return variable name at index ind

Arguments

Type IntentOptional Attributes Name
class(VariableContainer), intent(in) :: this
integer(kind=ik), intent(in) :: ind

Return Value character(len=:), allocatable

pure module function getAllVarNames(this) result(names)

Return all variable names in this container

Arguments

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

Return Value type(StringArray), allocatable, dimension(:)

pure module function getImplicitVarNames(this) result(names)

Return all implicit variable names in this container

Arguments

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

Return Value type(StringArray), allocatable, dimension(:)

pure module function getVarDepth(this, name) result(depth)

Get depth of variable with given name

Arguments

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

Return Value integer(kind=ik)

pure module function getMaxDepth(this) result(depth)

Get max of derivationDepth

Arguments

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

Return Value integer(kind=ik)

pure module function isStationary(this, name) result(stationary)

Check whether variable with given name is stationary

Arguments

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

Return Value logical


Module Subroutines

pure module subroutine initCalculationRule(this, deriv, names)

Calculation rule object initialization routine

Arguments

Type IntentOptional Attributes Name
class(CalculationRule), intent(inout) :: this
class(Derivation), intent(in), optional :: deriv

Derivation component

type(StringArray), intent(in), optional, dimension(:) :: names

Required variable names

pure module subroutine initVarContainer(this, implicitVars, derivedVars, derivationRules, indexingObj, partitionObj, xHaloWidth, procRank)

Variable container initialization routine

Arguments

Type IntentOptional Attributes Name
class(VariableContainer), intent(inout) :: this
type(VariableList), intent(in) :: implicitVars

List of implicit variables

type(VariableList), intent(in) :: derivedVars

List of derived variables

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

Derivation rules corresponding to derived variables

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

Reference indexing object used to map between variables and implicit vectors

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

Reference partition object

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

Width of halo in x-direction

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

Current processor rank

module subroutine calculateDerivedVars(this, derivPriority, derivDepth)

Calculate derived variables from implicit variables using derivation rules. If derivPriority is supplied only those variables with priority <= derivPriority will be derived. If derivDepth is present only variables at that derivation depth are calculated, otherwise all variables are calculated in derivation depth order

Arguments

Type IntentOptional Attributes Name
class(VariableContainer), intent(inout) :: this
integer(kind=ik), intent(in), optional :: derivPriority
integer(kind=ik), intent(in), optional :: derivDepth

pure module subroutine extractImplicitVars(this, vec)

Extract implicit variables from a locally linearly indexed real vector

Arguments

Type IntentOptional Attributes Name
class(VariableContainer), intent(inout) :: this
real(kind=rk), intent(in), dimension(:) :: vec

pure module subroutine copyImplicitVarsToVec(this, vec, ignoreStationary)

Copy variables into a locally linearly indexed real vector. If ignoreStationary is true copies any stationary variables as 0

Arguments

Type IntentOptional Attributes Name
class(VariableContainer), intent(inout) :: this
real(kind=rk), intent(inout), dimension(:) :: vec
logical, intent(in), optional :: ignoreStationary