variable_list_class Module

Houses list of variables containing their names and whether they're a distribution function


Used by


Interfaces

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)

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(:)

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

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)

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

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

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

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

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

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

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)

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)

interface

  • private pure module subroutine initVarList(this)

    Variable list initialization routine

    Arguments

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

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

Derived Types

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
procedure, public :: makeDefined => makeDefinedObject
procedure, public :: makeUndefined => makeUndefinedObject
procedure, public :: getVarNames
procedure, public :: getVarName
procedure, public :: getNumVars
procedure, public :: getVarPriority
procedure, public :: addVar
procedure, public :: isVarDist
procedure, public :: isVarSingleHarmonic
procedure, public :: isVarScalar
procedure, public :: isVarNameRegistered
procedure, public :: isVarOnDualGrid
procedure, public :: isVarStationary
procedure, public :: getVarIndex
procedure, public :: combineWith
procedure, public :: init => initVarList