VariableList Derived Type

type, public, extends(Object) :: VariableList

Contains a list of variable names and records whether they are distribution functions


Components

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

True only if user explicitly sets it to true

type(StringArray), private, allocatable, dimension(:) :: names

Names of variables

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

True for any variable which is a distribution function

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

True for any distribution variable which represent only a single harmonic

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

True for any scalar variables

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

True for any variable which lives on the dual grid

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

True for any variable which has d/dt = 0

integer(kind=ik), private, allocatable, dimension(:) :: priority

Integer priority for uses such as variable derivation. Defaults to 0.


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 :: getVarNames

  • interface

    private pure module function getVarNames(this) result(names)

    Getter of names

    Arguments

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

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

procedure, public :: getVarName

  • interface

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

    Return variable name at index ind

    Arguments

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

    Return Value character(len=:), allocatable

procedure, public :: getNumVars

  • interface

    private pure module function getNumVars(this) result(numVars)

    Returns number of variables in list

    Arguments

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

    Return Value integer(kind=ik)

procedure, public :: getVarPriority

  • interface

    private pure module function getVarPriority(this, ind) result(priority)

    Return priority of variable with given index

    Arguments

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

    Return Value integer(kind=ik)

procedure, public :: addVar

  • interface

    private pure module subroutine addVar(this, name, isDist, isSingleHarmonic, isScalar, isOnDualGrid, isStationary, priority)

    Add variable with given name to list; isDist determines if variable is a distribution function and is .false. by default; isSingleHarmonic sets whether a given distribution is only a single harmonic - i.e. a function of just x and v isScalar tags variable as a scalar (will be stored as a dimension 1 array) isOnDualGrid marks variable as living on the dual/staggered grid (or having staggered harmonics if it's a distribution) isStationary marks variable as having d/dt=0 priority is an integer governing operations such as variable derivation

    Arguments

    Type IntentOptional Attributes Name
    class(VariableList), intent(inout) :: this
    character(len=*), intent(in) :: name
    logical, intent(in), optional :: isDist
    logical, intent(in), optional :: isSingleHarmonic
    logical, intent(in), optional :: isScalar
    logical, intent(in), optional :: isOnDualGrid
    logical, intent(in), optional :: isStationary
    integer(kind=ik), intent(in), optional :: priority

procedure, public :: isVarDist

  • interface

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

    Check whether variable with given index is a full distribution function

    Arguments

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

    Return Value logical

procedure, public :: isVarSingleHarmonic

  • interface

    private pure module function isVarSingleHarmonic(this, ind) result(singleH)

    Check whether variable with given index is a single harmonic

    Arguments

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

    Return Value logical

procedure, public :: isVarScalar

  • interface

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

    Check whether variable with given index is a scalar

    Arguments

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

    Return Value logical

procedure, public :: isVarNameRegistered

  • interface

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

    Check whether variable with given name is registered

    Arguments

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

    Return Value logical

procedure, public :: isVarOnDualGrid

  • interface

    private pure module function isVarOnDualGrid(this, ind) result(dual)

    Check whether variable with given index is a on dual grid

    Arguments

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

    Return Value logical

procedure, public :: isVarStationary

  • interface

    private pure module function isVarStationary(this, ind) result(stat)

    Check whether variable with given index is stationary

    Arguments

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

    Return Value logical

procedure, public :: getVarIndex

  • interface

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

    Get index of variable with given name

    Arguments

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

    Return Value integer(kind=ik)

procedure, public :: combineWith

  • interface

    private pure module function combineWith(this, other) result(res)

    Combine two lists into one

    Arguments

    Type IntentOptional Attributes Name
    class(VariableList), intent(in) :: this
    type(VariableList), intent(in) :: other

    Return Value type(VariableList)

procedure, public :: init => initVarList

  • interface

    private pure module subroutine initVarList(this)

    Variable list initialization routine

    Arguments

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