InterpolationDerivation Derived Type

type, public, extends(Derivation) :: InterpolationDerivation

Derivation that interpolates a variable from the original to the dual grid, or vise versa. Distributions are interpolated by assuming that even l harmonics live on the original grid and odd harmonics on the dual 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(:) :: linInterp

Linear interpolation coefficients for inner points

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

Linear interpolation coefficients for inner points on dual grid

real(kind=rk), private :: linExterp

Linear extrapolation coefficients for the right boundary point

real(kind=rk), private :: linExterpRDual

Linear extrapolation coefficient for the right boundary point during inverse interpolation on non-periodic grid

real(kind=rk), private :: linExterpLDual

Linear extrapolation coefficient for the left boundary point during inverse interpolation on non-periodic grid

logical, private :: periodicGrid
logical, private :: inverseInterp

True if interpolating from dual to original grid. Defaults to false

logical, private :: distInterp

True if interpolating a distribution function

logical, private :: containsLeftBoundary

True if the local x-grid contains the left boundary

logical, private :: containsRightBoundary

True if the local x-grid contains the right boundary

integer(kind=ik), private :: locNumX

Size of local grid chunk (without any halos)

integer(kind=ik), private :: numV
integer(kind=ik), private :: numH
logical(kind=ik), public, allocatable, dimension(:) :: oddHarmonic

True for odd l harmonics


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

  • interface

    private module subroutine initInterpDeriv(this, geometryObj, gridObj, minX, maxX, inverseInterp, distInterp)

    Initialize interpolation derivation object

    Arguments

    Type IntentOptional Attributes Name
    class(InterpolationDerivation), intent(inout) :: this
    type(Geometry), intent(in) :: geometryObj
    type(Grid), intent(in) :: gridObj
    integer(kind=ik), intent(in) :: minX
    integer(kind=ik), intent(in) :: maxX
    logical, intent(in), optional :: inverseInterp
    logical, intent(in), optional :: distInterp

procedure, public :: calculate => calculateInterp

  • interface

    private module function calculateInterp(this, inputArray, indices) result(output)

    Arguments

    Type IntentOptional Attributes Name
    class(InterpolationDerivation), intent(inout) :: this
    type(RealArray), intent(in), dimension(:) :: inputArray
    integer(kind=ik), intent(in), dimension(:) :: indices

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