tem_path_array_module Module

Module to provide dynamic structures for treeID elements

The dynamic arrays provided by this module are capable of handling lists of values, which might need to grow over time. Removal of entries is not possible directly. A ranking list for the indices is maintained to fast lookups of given values by a binary search. This allows for the efficient handling of lists with unique entries. The complete module might be put into a CoCo Text template, to create new modules of this object for different types. For now, two different templates are used for the declaration part and the implementation part.


Uses

  • module~~tem_path_array_module~~UsesGraph module~tem_path_array_module tem_path_array_module module~env_module env_module module~tem_path_array_module->module~env_module module~tem_topology_module tem_topology_module module~tem_path_array_module->module~tem_topology_module mpi mpi module~env_module->mpi module~flu_binding flu_binding module~env_module->module~flu_binding iso_fortran_env iso_fortran_env module~env_module->iso_fortran_env module~aotus_module aotus_module module~env_module->module~aotus_module module~tem_topology_module->module~env_module

Contents


Interfaces

public interface operator(==)

  • public function isEqual(left, right) result(equality)

    This function provides the test for equality of two treeIDs.

    Read more…

    Arguments

    Type IntentOptional AttributesName
    type(tem_path_type), intent(in) :: left

    path to compare

    type(tem_path_type), intent(in) :: right

    path to compare against

    Return Value logical

    is equal??

public interface operator(/=)

  • public function isUnequal(left, right) result(unequality)

    This function provides the test for unequality of two path.

    Arguments

    Type IntentOptional AttributesName
    type(tem_path_type), intent(in) :: left

    path to compare

    type(tem_path_type), intent(in) :: right

    path to compare against

    Return Value logical

    is unequal??

public interface operator(<)

  • public function isSmaller(left, right) result(small)

    This function provides a comparison of two paths.

    Arguments

    Type IntentOptional AttributesName
    type(tem_path_type), intent(in) :: left

    path to compare

    type(tem_path_type), intent(in) :: right

    path to compare against

    Return Value logical

    is smaller??

public interface operator(<=)

  • public function isSmallerOrEqual(left, right) result(small)

    This function provides a comparison of two paths.

    Arguments

    Type IntentOptional AttributesName
    type(tem_path_type), intent(in) :: left

    path to compare

    type(tem_path_type), intent(in) :: right

    path to compare against

    Return Value logical

    is smaller??

public interface operator(>)

  • public function isGreater(left, right) result(great)

    This function provides a comparison of two paths.

    Arguments

    Type IntentOptional AttributesName
    type(tem_path_type), intent(in) :: left

    path to compare

    type(tem_path_type), intent(in) :: right

    path to compare against

    Return Value logical

    is greater??

public interface operator(>=)

  • public function isGreaterOrEqual(left, right) result(great)

    This function provides a comparison of two paths.

    Arguments

    Type IntentOptional AttributesName
    type(tem_path_type), intent(in) :: left

    path to compare

    type(tem_path_type), intent(in) :: right

    path to compare against

    Return Value logical

    is greater??

public interface init

initialize the dynamic array

  • public subroutine init_da_path(me, length)

    Include the subroutines for the dynamic array. initialization of a dynamic array

    Read more…

    Arguments

    Type IntentOptional AttributesName
    type(dyn_patharray_type), intent(out) :: me
    integer, intent(in), optional :: length

public interface destroy

destroy the dynamic array

public interface append

append a value to the dynamic array and return its position.

  • public subroutine append_da_path(me, val, length, pos, wasadded)

    appending a value to the dynamic array

    Read more…

    Arguments

    Type IntentOptional AttributesName
    type(dyn_patharray_type) :: me
    type(tem_path_type), intent(in) :: val
    integer, intent(in), optional :: length

    optional length to expand the array

    integer, intent(out), optional :: pos

    position in the array, if the value is found

    logical, intent(out), optional :: wasadded

    flag to indicate, if val was newly added

  • public subroutine append_da_vecpath(me, val, length, pos, wasadded)

    appending a sorted list of values to the dynamic array

    Read more…

    Arguments

    Type IntentOptional AttributesName
    type(dyn_patharray_type) :: me
    type(tem_path_type), intent(in) :: val(:)
    integer, intent(in), optional :: length

    optional length to expand the array

    integer, intent(out), optional :: pos(:)

    position in the array, the values are found at.

    logical, intent(out), optional :: wasadded(:)

    flag to indicate, if val was newly added

public interface truncate

truncate the array, meaning cut off the trailing empty entries

  • public subroutine truncate_da_path(me)

    truncate the array after the last valid entry and hence cut off the empty trailing empty entries

    Arguments

    Type IntentOptional AttributesName
    type(dyn_patharray_type) :: me

public interface empty

empty the array, reset nvals to be 0

  • public subroutine empty_da_path(me)

    empty all contents of the array without changing the size or status of any array

    Arguments

    Type IntentOptional AttributesName
    type(dyn_patharray_type) :: me

public interface sorttruncate

fix the dynamic array, meaning: store the array in the sorted order and cut off the trailing empty entries

public interface expand

increase the size of the container for the array.

  • public subroutine expand_da_path(me, increment, length)

    expanding the dynamic array

    Read more…

    Arguments

    Type IntentOptional AttributesName
    type(dyn_patharray_type) :: me
    integer, optional :: increment
    integer, intent(in), optional :: length

    optional length to expand the array

public interface positionofval

return the position of a given value in the array val, which is what you usually want to know. it is the index of a given value

  • public function posofval_path(me, val, nextifnotfound, lower, upper) result(pos)

    the actual position of a given value in the dynamic array

    Read more…

    Arguments

    Type IntentOptional AttributesName
    type(dyn_patharray_type), intent(in) :: me
    type(tem_path_type), intent(in) :: val
    logical, intent(in), optional :: nextifnotfound

    flag to indicate, if the position of the next entry in the sorted list should be returned instead, if val is not found.

    integer, intent(in), optional :: lower
    integer, intent(in), optional :: upper

    Return Value integer

public interface sortedposofval

return the position of a given value in the list 'sorted'. this is mainly for internal usage. the sorted list is only a pointer list to the actual values thus, in order to get the index of a given value, you need to look up the entry in the sorted list. this is done by the positionofval routine

  • public function sortposofval_path(me, val, nextifnotfound, lower, upper) result(pos)

    return the sorted position of a value in the given dynamic array

    Read more…

    Arguments

    Type IntentOptional AttributesName
    type(dyn_patharray_type), intent(in) :: me
    type(tem_path_type), intent(in) :: val
    logical, intent(in), optional :: nextifnotfound

    flag to indicate, if the next entry in the list should be returned, if the searched one is not found.

    integer, intent(in), optional :: lower
    integer, intent(in), optional :: upper

    Return Value integer


Derived Types

type, public :: dyn_patharray_type

dynamic array (da) type for type(tem_path_type)

Components

TypeVisibility AttributesNameInitial
integer, public :: nvals =0
integer, public :: containersize =0
type(tem_path_type), public, allocatable:: val(:)
integer, public, allocatable:: sorted(:)

Functions

public function sortposofval_path(me, val, nextifnotfound, lower, upper) result(pos)

return the sorted position of a value in the given dynamic array

Read more…

Arguments

Type IntentOptional AttributesName
type(dyn_patharray_type), intent(in) :: me
type(tem_path_type), intent(in) :: val
logical, intent(in), optional :: nextifnotfound

flag to indicate, if the next entry in the list should be returned, if the searched one is not found.

integer, intent(in), optional :: lower
integer, intent(in), optional :: upper

Return Value integer

public function posofval_path(me, val, nextifnotfound, lower, upper) result(pos)

the actual position of a given value in the dynamic array

Read more…

Arguments

Type IntentOptional AttributesName
type(dyn_patharray_type), intent(in) :: me
type(tem_path_type), intent(in) :: val
logical, intent(in), optional :: nextifnotfound

flag to indicate, if the position of the next entry in the sorted list should be returned instead, if val is not found.

integer, intent(in), optional :: lower
integer, intent(in), optional :: upper

Return Value integer

public function isEqual(left, right) result(equality)

This function provides the test for equality of two treeIDs.

Read more…

Arguments

Type IntentOptional AttributesName
type(tem_path_type), intent(in) :: left

path to compare

type(tem_path_type), intent(in) :: right

path to compare against

Return Value logical

is equal??

public function isUnequal(left, right) result(unequality)

This function provides the test for unequality of two path.

Arguments

Type IntentOptional AttributesName
type(tem_path_type), intent(in) :: left

path to compare

type(tem_path_type), intent(in) :: right

path to compare against

Return Value logical

is unequal??

public function isSmaller(left, right) result(small)

This function provides a comparison of two paths.

Arguments

Type IntentOptional AttributesName
type(tem_path_type), intent(in) :: left

path to compare

type(tem_path_type), intent(in) :: right

path to compare against

Return Value logical

is smaller??

public function isSmallerOrEqual(left, right) result(small)

This function provides a comparison of two paths.

Arguments

Type IntentOptional AttributesName
type(tem_path_type), intent(in) :: left

path to compare

type(tem_path_type), intent(in) :: right

path to compare against

Return Value logical

is smaller??

public function isGreater(left, right) result(great)

This function provides a comparison of two paths.

Arguments

Type IntentOptional AttributesName
type(tem_path_type), intent(in) :: left

path to compare

type(tem_path_type), intent(in) :: right

path to compare against

Return Value logical

is greater??

public function isGreaterOrEqual(left, right) result(great)

This function provides a comparison of two paths.

Arguments

Type IntentOptional AttributesName
type(tem_path_type), intent(in) :: left

path to compare

type(tem_path_type), intent(in) :: right

path to compare against

Return Value logical

is greater??


Subroutines

public subroutine init_da_path(me, length)

Include the subroutines for the dynamic array. initialization of a dynamic array

Read more…

Arguments

Type IntentOptional AttributesName
type(dyn_patharray_type), intent(out) :: me
integer, intent(in), optional :: length

public subroutine destroy_da_path(me)

destruction of a dynamic array

Read more…

Arguments

Type IntentOptional AttributesName
type(dyn_patharray_type), intent(inout) :: me

public subroutine append_da_path(me, val, length, pos, wasadded)

appending a value to the dynamic array

Read more…

Arguments

Type IntentOptional AttributesName
type(dyn_patharray_type) :: me
type(tem_path_type), intent(in) :: val
integer, intent(in), optional :: length

optional length to expand the array

integer, intent(out), optional :: pos

position in the array, if the value is found

logical, intent(out), optional :: wasadded

flag to indicate, if val was newly added

public subroutine append_da_vecpath(me, val, length, pos, wasadded)

appending a sorted list of values to the dynamic array

Read more…

Arguments

Type IntentOptional AttributesName
type(dyn_patharray_type) :: me
type(tem_path_type), intent(in) :: val(:)
integer, intent(in), optional :: length

optional length to expand the array

integer, intent(out), optional :: pos(:)

position in the array, the values are found at.

logical, intent(out), optional :: wasadded(:)

flag to indicate, if val was newly added

public subroutine truncate_da_path(me)

truncate the array after the last valid entry and hence cut off the empty trailing empty entries

Arguments

Type IntentOptional AttributesName
type(dyn_patharray_type) :: me

public subroutine empty_da_path(me)

empty all contents of the array without changing the size or status of any array

Arguments

Type IntentOptional AttributesName
type(dyn_patharray_type) :: me

public subroutine sorttruncate_da_path(me)

fixing the dynamic array

Read more…

Arguments

Type IntentOptional AttributesName
type(dyn_patharray_type) :: me

public subroutine expand_da_path(me, increment, length)

expanding the dynamic array

Read more…

Arguments

Type IntentOptional AttributesName
type(dyn_patharray_type) :: me
integer, optional :: increment
integer, intent(in), optional :: length

optional length to expand the array