cable_array_utils_mod Module

Utility procedures for working with arrays.


Functions

public function array_offset(index, shape) result(offset)

Calculate the memory offset corresponding to a given index in a multi-dimensional array.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: index(:)

The multi-dimensional index for which to calculate the offset.

integer, intent(in) :: shape(:)

The shape of the multi-dimensional array.

Return Value integer

The calculated memory offset corresponding to the given index.


Subroutines

public subroutine array_index(offset_in, shape, index)

Calculate the index corresponding to a given memory offset in a multi-dimensional array.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: offset_in

The memory offset for which to calculate the multi-dimensional index.

integer, intent(in) :: shape(:)

The shape of the multi-dimensional array.

integer, intent(inout) :: index(:)

The calculated multi-dimensional index corresponding to the given offset.