Grid Derived Type

type, public, extends(Object) :: Grid

Grid object storing cell positions of x and v grid, as well as Legendre harmonic data of the grid


Components

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

True only if user explicitly sets it to true

real(kind=rk), private, allocatable, dimension(:) :: xGrid

Positions of x-grid cell centres

real(kind=rk), private, allocatable, dimension(:) :: vGrid

Positions of v-grid cell centres

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

l-numbers of each resolved harmonic

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

m-numbers of each resolved harmonic

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

True if resolved harmonic is imaginary

integer(kind=ik), private :: maxL

Highest l-number resolved on grid

integer(kind=ik), private :: maxM

Highest m-number resolved on grid


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

  • interface

    private pure module function getXGrid(this) result(x)

    Getter for xGrid

    Arguments

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

    Return Value real(kind=rk), allocatable, dimension(:)

procedure, public :: getVGrid

  • interface

    private pure module function getVGrid(this) result(v)

    Getter for vGrid

    Arguments

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

    Return Value real(kind=rk), allocatable, dimension(:)

procedure, public :: getMaxL

  • interface

    private pure module function getMaxL(this) result(maxL)

    Getter for maxL

    Arguments

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

    Return Value integer(kind=ik)

procedure, public :: getMaxM

  • interface

    private pure module function getMaxM(this) result(maxM)

    Getter for maxM

    Arguments

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

    Return Value integer(kind=ik)

procedure, public :: getNumX

  • interface

    private pure module function getNumX(this) result(numX)

    Return number of x points on grid

    Arguments

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

    Return Value integer(kind=ik)

procedure, public :: getNumV

  • interface

    private pure module function getNumV(this) result(numV)

    Return number of v points on grid

    Arguments

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

    Return Value integer(kind=ik)

procedure, public :: getNumH

  • interface

    private pure module function getNumH(this) result(numH)

    Return total number of resolved harmonic on grid

    Arguments

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

    Return Value integer(kind=ik)

procedure, public :: getLGrid

  • interface

    private pure module function getLGrid(this) result(l)

    Getter for lGrid

    Arguments

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

    Return Value integer(kind=ik), allocatable, dimension(:)

procedure, public :: getMGrid

  • interface

    private pure module function getMGrid(this) result(m)

    Getter for mGrid

    Arguments

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

    Return Value integer(kind=ik), allocatable, dimension(:)

procedure, public :: getHarmonicIm

  • interface

    private pure module function getHarmonicIm(this) result(im)

    Getter for imaginaryHarmonic

    Arguments

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

    Return Value logical, allocatable, dimension(:)

procedure, public :: getH

  • interface

    private pure module function getH(this, l, m, im) result(h)

    Return index of harmonic l,m, (if im=true returns the imaginary component)

    Arguments

    Type IntentOptional Attributes Name
    class(Grid), intent(in) :: this
    integer(kind=ik), intent(in) :: l
    integer(kind=ik), intent(in) :: m
    logical, intent(in) :: im

    Return Value integer(kind=ik)

procedure, public :: getL

  • interface

    private pure module function getL(this, ind) result(l)

    Return l number for given harmonic index

    Arguments

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

    Return Value integer(kind=ik)

procedure, public :: getM

  • interface

    private pure module function getM(this, ind) result(m)

    Return m number for given harmonic index

    Arguments

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

    Return Value integer(kind=ik)

procedure, public :: isImaginary

  • interface

    private pure module function isImaginary(this, ind) result(im)

    Return true if harmonic with given index is imaginary

    Arguments

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

    Return Value logical

procedure, public :: init => initGrid

  • interface

    private pure module subroutine initGrid(this, x, v, maxL, maxM)

    Grid initialization routine

    Arguments

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

    Positions of x-grid cell centres

    real(kind=rk), intent(in), dimension(:) :: v

    Positions of v-grid cell centres

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

    Highest resolved l-harmonic

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

    Highest resolved m-harmonic