dbcsr_array_list_methods Module

Representation of arbitrary number of 1d integer arrays with arbitrary sizes. This is needed for generic handling of dimension-specific tensor quantities (such as block index).



Variables

Type Visibility Attributes Name Initial
character(len=*), private, parameter :: moduleN = 'dbcsr_array_list_methods'

Interfaces

private interface get_ith_array

  • private subroutine allocate_and_get_ith_array(list, i, array)

    get ith array

    Arguments

    Type IntentOptional Attributes Name
    type(array_list), intent(in) :: list
    integer, intent(in) :: i
    integer, intent(out), DIMENSION(:), ALLOCATABLE :: array
  • private interface get_ith_array()

    Arguments

    None

Derived Types

type, public ::  array_list

Components

Type Visibility Attributes Name Initial
integer, public, DIMENSION(:), ALLOCATABLE :: col_data
integer, public, DIMENSION(:), ALLOCATABLE :: ptr

Functions

public pure function number_of_arrays(list)

number of arrays stored in list

Arguments

Type IntentOptional Attributes Name
type(array_list), intent(in) :: list

Return Value integer

public pure function get_array_elements(list, indices)

Get an element for each array.

Arguments

Type IntentOptional Attributes Name
type(array_list), intent(in) :: list
integer, intent(in), DIMENSION(number_of_arrays(list)) :: indices

element index for each array

Return Value integer, DIMENSION(number_of_arrays(list))

public function array_sublist(list, i_selected)

extract a subset of arrays

Arguments

Type IntentOptional Attributes Name
type(array_list), intent(in) :: list

list of arrays

integer, intent(in), DIMENSION(:) :: i_selected

array numbers to retrieve

Return Value type(array_list)

public function sizes_of_arrays(list)

sizes of arrays stored in list

Arguments

Type IntentOptional Attributes Name
type(array_list), intent(in) :: list

Return Value integer, ALLOCATABLE, DIMENSION(:)

public function sum_of_arrays(list)

sum of all elements for each array stored in list

Arguments

Type IntentOptional Attributes Name
type(array_list), intent(in) :: list

Return Value integer, ALLOCATABLE, DIMENSION(:)

public function check_equal(list1, list2)

check whether two array lists are equal

Arguments

Type IntentOptional Attributes Name
type(array_list), intent(in) :: list1
type(array_list), intent(in) :: list2

Return Value logical

public pure function array_eq_i(arr1, arr2)

check whether two arrays are equal

Arguments

Type IntentOptional Attributes Name
integer, intent(in), DIMENSION(:) :: arr1
integer, intent(in), DIMENSION(:) :: arr2

Return Value logical


Subroutines

public subroutine create_array_list(list, ndata, data_1, data_2, data_3, data_4)

collects any number of arrays of different sizes into a single array (list%col_data), storing the indices that start a new array (list%ptr).

Arguments

Type IntentOptional Attributes Name
type(array_list), intent(out) :: list

list of arrays

integer, intent(in) :: ndata

number of arrays

integer, intent(in), optional, DIMENSION(:) :: data_1

arrays 1 and 2

integer, intent(in), optional, DIMENSION(:) :: data_2

arrays 1 and 2

integer, intent(in), optional, DIMENSION(:) :: data_3

arrays 1 and 2

integer, intent(in), optional, DIMENSION(:) :: data_4

arrays 1 and 2

public subroutine destroy_array_list(list)

destroy array list.

Arguments

Type IntentOptional Attributes Name
type(array_list), intent(inout) :: list

public subroutine get_arrays(list, data_1, data_2, data_3, data_4, i_selected)

Get all arrays contained in list

Arguments

Type IntentOptional Attributes Name
type(array_list), intent(in) :: list
integer, intent(out), optional, ALLOCATABLE, DIMENSION(:) :: data_1

arrays 1 and 2

integer, intent(out), optional, ALLOCATABLE, DIMENSION(:) :: data_2

arrays 1 and 2

integer, intent(out), optional, ALLOCATABLE, DIMENSION(:) :: data_3

arrays 1 and 2

integer, intent(out), optional, ALLOCATABLE, DIMENSION(:) :: data_4

arrays 1 and 2

integer, intent(in), optional, DIMENSION(:) :: i_selected

array numbers to retrieve (if not present, all arrays are returned)

public subroutine get_ith_array(list, i, array_size, array)

get ith array

Arguments

Type IntentOptional Attributes Name
type(array_list), intent(in) :: list
integer, intent(in) :: i
integer, intent(in) :: array_size
integer, intent(out), DIMENSION(array_size) :: array

private subroutine allocate_and_get_ith_array(list, i, array)

get ith array

Arguments

Type IntentOptional Attributes Name
type(array_list), intent(in) :: list
integer, intent(in) :: i
integer, intent(out), DIMENSION(:), ALLOCATABLE :: array

public subroutine array_offsets(list_in, list_out)

partial sums of array elements.

Arguments

Type IntentOptional Attributes Name
type(array_list), intent(in) :: list_in
type(array_list), intent(out) :: list_out

public subroutine reorder_arrays(list_in, list_out, order)

reorder array list.

Arguments

Type IntentOptional Attributes Name
type(array_list), intent(in) :: list_in
type(array_list), intent(out) :: list_out
integer, intent(in), DIMENSION(number_of_arrays(list_in)) :: order