Partition Derived Type

type, public, extends(Object) :: Partition

Object responsible for storing the x-h domain decomposition


Components

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

True only if user explicitly sets it to true

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

First x-index in each partition

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

Last x-index in each partition

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

First h-index in each partition

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

Last h-index in each partition

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

Number of x-grid points for each partition

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

Number of h-grid points for each partition


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

  • interface

    private pure module function getMinX(this) result(minX)

    Getter for minX

    Arguments

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

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

procedure, public :: getMinXAtInd

  • interface

    private pure module function getMinXAtInd(this, ind) result(minX)

    Return minX at index ind

    Arguments

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

    Return Value integer(kind=ik)

procedure, public :: getMinH

  • interface

    private pure module function getMinH(this) result(minH)

    Getter for minH

    Arguments

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

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

procedure, public :: getMinHAtInd

  • interface

    private pure module function getMinHAtInd(this, ind) result(minH)

    Return minH at index ind

    Arguments

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

    Return Value integer(kind=ik)

procedure, public :: getMaxX

  • interface

    private pure module function getMaxX(this) result(maxX)

    Getter for maxX

    Arguments

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

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

procedure, public :: getMaxXAtInd

  • interface

    private pure module function getMaxXAtInd(this, ind) result(maxX)

    Return maxX at index ind

    Arguments

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

    Return Value integer(kind=ik)

procedure, public :: getMaxH

  • interface

    private pure module function getMaxH(this) result(maxH)

    Getter for maxH

    Arguments

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

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

procedure, public :: getMaxHAtInd

  • interface

    private pure module function getMaxHAtInd(this, ind) result(maxH)

    Return maxH at index ind

    Arguments

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

    Return Value integer(kind=ik)

procedure, public :: getLocNumX

  • interface

    private pure module function getLocNumX(this) result(locX)

    Getter for locX

    Arguments

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

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

procedure, public :: getLocNumH

  • interface

    private pure module function getLocNumH(this) result(locH)

    Getter for locH

    Arguments

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

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

procedure, public :: findProc

  • interface

    private pure module function findProc(this, xInd, hInd) result(procInd)

    Return partition index which contains xInd and hInd

    Arguments

    Type IntentOptional Attributes Name
    class(Partition), intent(in) :: this
    integer(kind=ik), intent(in) :: xInd
    integer(kind=ik), intent(in) :: hInd

    Return Value integer(kind=ik)

procedure, public :: filterCoords

  • interface

    private pure module function filterCoords(this, ind, coords, normalize) result(res)

    Filters coordinate list of shape 1,: or 3,: based on partition data. If normalize is true will shift all values in each dimension to so that the smallest value is 1

    Arguments

    Type IntentOptional Attributes Name
    class(Partition), intent(in) :: this
    integer(kind=ik), intent(in) :: ind
    integer(kind=ik), intent(in), dimension(:,:) :: coords
    logical, intent(in), optional :: normalize

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

procedure, public :: initSimplePartition

  • interface

    private module subroutine initSimplePartition(this, numProcsX, numProcsH, numX, numH)

    Partition initialization routine - assuming even distributions in x and h directions

    Arguments

    Type IntentOptional Attributes Name
    class(Partition), intent(inout) :: this
    integer(kind=ik), intent(in) :: numProcsX

    Number of processes in x direction

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

    Number of processes in h direction

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

    Total number of x grid points

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

    Total number of h grid points

procedure, public :: init => initPartition

  • interface

    private pure module subroutine initPartition(this, minX, maxX, minH, maxH)

    Partition initialization routine - general

    Arguments

    Type IntentOptional Attributes Name
    class(Partition), intent(inout) :: this
    integer(kind=ik), intent(in), dimension(:) :: minX

    First x-index in each partition

    integer(kind=ik), intent(in), dimension(:) :: maxX

    Last x-index in each partition

    integer(kind=ik), intent(in), dimension(:) :: minH

    First h-index in each partition

    integer(kind=ik), intent(in), dimension(:) :: maxH

    Last x-index in each partition