flat_nd_data_procedures Submodule

Contains module procedures associated with FlatNDData


Uses


Module Functions

pure module function getDims(this) result(dims)

Return shape of data stored

Arguments

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

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

pure module function getValue(this, indexSet) result(val)

Return multidimensional value for given indexSet (should match array dimension)

Arguments

Type IntentOptional Attributes Name
class(FlatNDData), intent(in) :: this
integer(kind=ik), intent(in), dimension(:) :: indexSet

Return Value real(kind=rk)

pure module function get1DSlice(this, indexSet, sliceIndex) result(val)

Return 1D slice of data at dimension given by sliceIndex and with the other indices set to indexSet

Arguments

Type IntentOptional Attributes Name
class(FlatNDData), intent(in) :: this
integer(kind=ik), intent(in), dimension(:) :: indexSet
integer(kind=ik), intent(in) :: sliceIndex

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

pure module function get1DSliceIndices(this, indexSet, sliceIndex) result(val)

Return 1D slice indices of data at dimension given by sliceIndex and with the other indices set to indexSet

Arguments

Type IntentOptional Attributes Name
class(FlatNDData), intent(in) :: this
integer(kind=ik), intent(in), dimension(:) :: indexSet
integer(kind=ik), intent(in) :: sliceIndex

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


Module Subroutines

pure module subroutine initFlatNDData(this, array)

Initializes the data based on a deferred rank input array

Arguments

Type IntentOptional Attributes Name
class(FlatNDData), intent(inout) :: this
real(kind=rk), intent(in), dimension(..) :: array

pure module subroutine directInit(this, array, dims)

Initializes the data based on an already flat array. Requires dimensions/shape to be explicitly passed

Arguments

Type IntentOptional Attributes Name
class(FlatNDData), intent(inout) :: this
real(kind=rk), intent(in), dimension(:) :: array
integer(kind=ik), intent(in), dimension(:) :: dims