Documentation for module array_list_methods

Representation of arbitrary number of 1d integer arrays with arbitrary sizes.

source: array_list_methods.F
Loading...

public Types:

array_list
...

public Subroutines/Functions:

partial sums of array elements.
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).
destroy array list.
Get all arrays contained in list
FUNCTION
INTEGER
get_array_elements (list, indices)
Get an element for each array.
SUBROUTINE
get_ith_array (list, i, array)
get ith array
FUNCTION
INTEGER PURE
number_of_arrays (list)
number of arrays stored in list
reorder array list.
FUNCTION
INTEGER
sizes_of_arrays (list)
sizes of arrays stored in list
FUNCTION
INTEGER
sum_of_arrays (list)
sum of all elements for each array stored in list

public Types:

TYPE :: array_list

...


INTEGER,
DIMENSION(:), ALLOCATABLE :: col_data ...
INTEGER,
DIMENSION(:), ALLOCATABLE :: ptr ...

SUBROUTINEarray_offsets(list_in, list_out)

partial sums of array elements.

Arguments:
TYPE(array_list),
INTENT(in)
:: list_in ...
TYPE(array_list),
INTENT(out)
:: list_out ...

SUBROUTINEcreate_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(array_list),
INTENT(out)
:: list list of arrays
INTEGER,
INTENT(in)
:: ndata number of arrays
INTEGER,
INTENT(in),
OPTIONAL
:: data_1(:) array 1
INTEGER,
INTENT(in),
OPTIONAL
:: data_2(:) array 2
INTEGER,
INTENT(in),
OPTIONAL
:: data_3(:) ...
INTEGER,
INTENT(in),
OPTIONAL
:: data_4(:) ...

SUBROUTINEdestroy_array_list(list)

destroy array list.

Arguments:
TYPE(array_list),
INTENT(inout)
:: list ...

SUBROUTINEget_arrays(list, data_1, data_2, data_3, data_4, i_selected)

Get all arrays contained in list

Arguments:
TYPE(array_list),
INTENT(in)
:: list ...
INTEGER,
INTENT(out),
ALLOCATABLE, OPTIONAL
:: data_1(:) array 1
INTEGER,
INTENT(out),
ALLOCATABLE, OPTIONAL
:: data_2(:) array 2
INTEGER,
INTENT(out),
ALLOCATABLE, OPTIONAL
:: data_3(:) ...
INTEGER,
INTENT(out),
ALLOCATABLE, OPTIONAL
:: data_4(:) ...
INTEGER,
INTENT(in),
OPTIONAL
:: i_selected(:) array numbers to retrieve (if not present, all arrays are returned)

FUNCTIONget_array_elements(list, indices)

Get an element for each array.

Return Value ::
INTEGER
Arguments:
TYPE(array_list),
INTENT(in)
:: list ...
INTEGER,
INTENT(in)
:: indices(number_of_arrays(list)) element index for each array

SUBROUTINEget_ith_array(list, i, array)

get ith array

Arguments:
TYPE(array_list),
INTENT(in)
:: list ...
INTEGER,
INTENT(in)
:: i ...
INTEGER,
INTENT(out),
ALLOCATABLE
:: array(:) ...

PURE FUNCTIONnumber_of_arrays(list)

number of arrays stored in list

Return Value ::
INTEGER
Arguments:
TYPE(array_list),
INTENT(in)
:: list ...

SUBROUTINEreorder_arrays(list_in, list_out, order)

reorder array list.

Arguments:
TYPE(array_list),
INTENT(in)
:: list_in ...
TYPE(array_list),
INTENT(out)
:: list_out ...
INTEGER,
INTENT(in)
:: order(number_of_arrays(list_in)) ...

FUNCTIONsizes_of_arrays(list)

sizes of arrays stored in list

Return Value ::
INTEGER
Arguments:
TYPE(array_list),
INTENT(in)
:: list ...

FUNCTIONsum_of_arrays(list)

sum of all elements for each array stored in list

Return Value ::
INTEGER
Arguments:
TYPE(array_list),
INTENT(in)
:: list ...