interp_stencil_gen_class Module

Stencil generator for implicit interpolation/extrapolation between regular and staggered grids


Used by


Interfaces

interface

  • private module subroutine initInterpValGen(this, partitionObj, geometryObj, procRank, staggeredGridMode)

    Central differentiation stencil value generator initialization routine

    Arguments

    Type IntentOptional Attributes Name
    class(InterpStencilGenerator), intent(inout) :: this
    type(Partition), intent(in) :: partitionObj

    Partition object used to determine local number of rows

    type(Geometry), intent(in) :: geometryObj

    Geometry object used to get interpolation/extrapolation coefficients

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

    Current processor rank

    logical, intent(in), optional :: staggeredGridMode

    If true will interpolate from staggered to regular grid.

interface

  • private module subroutine calcInterpVals(this, varCont, res, mbData, hostModel)

    Calculate interpolation stencil values in place (does not depend on varCont)

    Arguments

    Type IntentOptional Attributes Name
    class(InterpStencilGenerator), intent(inout) :: this
    type(VariableContainer), intent(in) :: varCont
    type(RealArray), intent(inout), allocatable, dimension(:) :: res
    class(ModelboundData), intent(in), optional :: mbData
    class(ModelSurrogate), intent(in), optional :: hostModel

Derived Types

type, public, extends(JaggedArrayGenerator) ::  InterpStencilGenerator

JaggedArrayGenerator for calculating implicit interpolation stencil between regular and staggered grids. Expects that the xStencil is [0,1] for regular to staggered grid interpolation, and [-1,0] for staggered to regular. If non-periodic and going from staggered to regular the values are implicitly extrapolated to the first and last cell centres from the edges leading up to the boundary. In this case the generator expects that the left boundary stencil is overriden with [0,1] and the right stencil with [-2,-1]

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

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

real(kind=rk), private :: linExterpR

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

logical, private :: periodicGrid

True if stencil is calculated on periodic grid

logical, private :: staggeredGridMode

If true will interpolate from staggered to regular grid. Defaults to false

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)

Type-Bound Procedures

procedure, public :: isDefined => isDefinedObject
procedure, public :: makeDefined => makeDefinedObject
procedure, public :: makeUndefined => makeUndefinedObject
procedure, public :: calculate
procedure, public :: init => initInterpValGen
procedure, public :: calculateInPlace => calcInterpVals