tem_dyn_array_module Module

Module to provide smart growing data structures.

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_dyn_array_module~~UsesGraph module~tem_dyn_array_module tem_dyn_array_module module~env_module env_module module~tem_dyn_array_module->module~env_module module~aotus_module aotus_module module~env_module->module~aotus_module module~flu_binding flu_binding module~env_module->module~flu_binding iso_fortran_env iso_fortran_env module~env_module->iso_fortran_env mpi mpi module~env_module->mpi

Used by

  • module~~tem_dyn_array_module~~UsedByGraph module~tem_dyn_array_module tem_dyn_array_module module~tem_shape_module tem_shape_module module~tem_shape_module->module~tem_dyn_array_module module~tem_surfacedata_module tem_surfaceData_module module~tem_surfacedata_module->module~tem_dyn_array_module module~tem_halo_module tem_halo_module module~tem_halo_module->module~tem_dyn_array_module module~tem_varsys_module~2 tem_varSys_module module~tem_varsys_module~2->module~tem_dyn_array_module module~tem_canonicalnd_module tem_canonicalND_module module~tem_canonicalnd_module->module~tem_dyn_array_module module~tem_face_module tem_face_module module~tem_face_module->module~tem_dyn_array_module module~tem_stencil_module tem_stencil_module module~tem_stencil_module->module~tem_dyn_array_module module~tem_matrix_module tem_matrix_module module~tem_matrix_module->module~tem_dyn_array_module module~tem_arrayofarrays_module tem_arrayofarrays_module module~tem_arrayofarrays_module->module~tem_dyn_array_module module~tem_operation_var_module tem_operation_var_module module~tem_operation_var_module->module~tem_dyn_array_module module~tem_timer_module tem_timer_module module~tem_timer_module->module~tem_dyn_array_module module~tem_spacetime_var_module tem_spacetime_var_module module~tem_spacetime_var_module->module~tem_dyn_array_module module~tem_derived_module tem_derived_module module~tem_derived_module->module~tem_dyn_array_module module~tem_pointdata_module tem_pointData_module module~tem_pointdata_module->module~tem_dyn_array_module module~tem_comm_module tem_comm_module module~tem_comm_module->module~tem_dyn_array_module module~tem_construction_module tem_construction_module module~tem_construction_module->module~tem_dyn_array_module module~hvs_output_module hvs_output_module module~hvs_output_module->module~tem_dyn_array_module module~tem_varsys_module tem_varSys_module module~tem_varsys_module->module~tem_dyn_array_module module~tem_element_module tem_element_module module~tem_element_module->module~tem_dyn_array_module module~tem_subtree_module tem_subTree_module module~tem_subtree_module->module~tem_dyn_array_module module~tem_varmap_module tem_varMap_module module~tem_varmap_module->module~tem_dyn_array_module module~tem_facedata_module tem_faceData_module module~tem_facedata_module->module~tem_dyn_array_module

Contents


Interfaces

public interface init

initialize the dynamic array

  • public subroutine init_da_long(me, length)

    initialization of a dynamic array

    before a dynamic array can be used, it has to be initialized with this routine. the initial length provided here, can avoid reallocations and memory copying, if approximated correctly enough. if none is specified, the provided container initially will be of size 0.

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_longarray_type), intent(out) :: me
    integer, intent(in), optional :: length

public interface destroy

destroy the dynamic array

  • public subroutine destroy_da_long(me)

    destruction of a dynamic array

    this subroutine takes care of a proper destruction of a dynamic array, it frees the allocated memory and resets the internal counts to 0.

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_longarray_type), intent(inout) :: me

public interface append

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

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

    appending a value to the dynamic array

    with this subroutine, a given value can be added to the dynamic array. the actual position of this value in the dynamic array will be returned, so it can be found again easily later. with the wasadded flag, it is indicated,\n wasadded = true, if this entry had to be added,\n wasadded = false, if this was already found in the array.

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_longarray_type) :: me
    integer(kind=long_k), 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_veclong(me, val, length, pos, wasadded)

    appending a sorted list of values to the dynamic array

    with this subroutine, a given list of sorted values can be added to the dynamic array. the actual positions of these values in the dynamic array will be returned, so it can be found again easily later. with the wasadded flag, it is indicated,\n wasadded = true, if this entry had to be added,\n wasadded = false, if this was already found in the array.

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_longarray_type) :: me
    integer(kind=long_k), 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_long(me)

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

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_longarray_type) :: me

public interface empty

empty the array, reset nvals to be 0

  • public subroutine empty_da_long(me)

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

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_longarray_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 subroutine sorttruncate_da_long(me)

    fixing the dynamic array

    truncate the array after the last valid entry and hence cut off the empty trailing empty entries store the array in the sorted order according to the sorted( ) array

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_longarray_type) :: me

public interface expand

increase the size of the container for the array.

  • public subroutine expand_da_long(me, increment, length)

    expanding the dynamic array

    this is a helping subroutine, which doubles the container of the given dynamic array. as the container might be initially 0-sized, a module variable minlength has been introduced, which is used here, to at least create a container of this size.

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_longarray_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_long(me, val, nextifnotfound, lower, upper) result(pos)

    the actual position of a given value in the dynamic array

    most likely this is what you need in codes, using this data structure, it first does the binary search on the sorted values with sortposofval_long and then returns the looked up position in the original unsorted array, which corresponds to the position returned by the append routine.

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_longarray_type), intent(in) :: me
    integer(kind=long_k), 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_long(me, val, nextifnotfound, lower, upper) result(pos)

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

    if the value was not found, - return 0 if nextifnotfound = .false. - return position at the end if nextifnotfound = .true.

    binary search on sorted list

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_longarray_type), intent(in) :: me
    integer(kind=long_k), 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 interface init

initialize the dynamic array

  • public subroutine init_da_int(me, length)

    initialization of a dynamic array

    before a dynamic array can be used, it has to be initialized with this routine. the initial length provided here, can avoid reallocations and memory copying, if approximated correctly enough. if none is specified, the provided container initially will be of size 0.

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_intarray_type), intent(out) :: me
    integer, intent(in), optional :: length

public interface destroy

destroy the dynamic array

  • public subroutine destroy_da_int(me)

    destruction of a dynamic array

    this subroutine takes care of a proper destruction of a dynamic array, it frees the allocated memory and resets the internal counts to 0.

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_intarray_type), intent(inout) :: me

public interface append

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

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

    appending a value to the dynamic array

    with this subroutine, a given value can be added to the dynamic array. the actual position of this value in the dynamic array will be returned, so it can be found again easily later. with the wasadded flag, it is indicated,\n wasadded = true, if this entry had to be added,\n wasadded = false, if this was already found in the array.

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_intarray_type) :: me
    integer, 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_vecint(me, val, length, pos, wasadded)

    appending a sorted list of values to the dynamic array

    with this subroutine, a given list of sorted values can be added to the dynamic array. the actual positions of these values in the dynamic array will be returned, so it can be found again easily later. with the wasadded flag, it is indicated,\n wasadded = true, if this entry had to be added,\n wasadded = false, if this was already found in the array.

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_intarray_type) :: me
    integer, 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_int(me)

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

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_intarray_type) :: me

public interface empty

empty the array, reset nvals to be 0

  • public subroutine empty_da_int(me)

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

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_intarray_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 subroutine sorttruncate_da_int(me)

    fixing the dynamic array

    truncate the array after the last valid entry and hence cut off the empty trailing empty entries store the array in the sorted order according to the sorted( ) array

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_intarray_type) :: me

public interface expand

increase the size of the container for the array.

  • public subroutine expand_da_int(me, increment, length)

    expanding the dynamic array

    this is a helping subroutine, which doubles the container of the given dynamic array. as the container might be initially 0-sized, a module variable minlength has been introduced, which is used here, to at least create a container of this size.

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_intarray_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_int(me, val, nextifnotfound, lower, upper) result(pos)

    the actual position of a given value in the dynamic array

    most likely this is what you need in codes, using this data structure, it first does the binary search on the sorted values with sortposofval_int and then returns the looked up position in the original unsorted array, which corresponds to the position returned by the append routine.

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_intarray_type), intent(in) :: me
    integer, 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_int(me, val, nextifnotfound, lower, upper) result(pos)

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

    if the value was not found, - return 0 if nextifnotfound = .false. - return position at the end if nextifnotfound = .true.

    binary search on sorted list

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_intarray_type), intent(in) :: me
    integer, 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 interface init

initialize the dynamic array

  • public subroutine init_da_real(me, length)

    initialization of a dynamic array

    before a dynamic array can be used, it has to be initialized with this routine. the initial length provided here, can avoid reallocations and memory copying, if approximated correctly enough. if none is specified, the provided container initially will be of size 0.

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_realarray_type), intent(out) :: me
    integer, intent(in), optional :: length

public interface destroy

destroy the dynamic array

  • public subroutine destroy_da_real(me)

    destruction of a dynamic array

    this subroutine takes care of a proper destruction of a dynamic array, it frees the allocated memory and resets the internal counts to 0.

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_realarray_type), intent(inout) :: me

public interface append

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

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

    appending a value to the dynamic array

    with this subroutine, a given value can be added to the dynamic array. the actual position of this value in the dynamic array will be returned, so it can be found again easily later. with the wasadded flag, it is indicated,\n wasadded = true, if this entry had to be added,\n wasadded = false, if this was already found in the array.

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_realarray_type) :: me
    real(kind=rk), 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_vecreal(me, val, length, pos, wasadded)

    appending a sorted list of values to the dynamic array

    with this subroutine, a given list of sorted values can be added to the dynamic array. the actual positions of these values in the dynamic array will be returned, so it can be found again easily later. with the wasadded flag, it is indicated,\n wasadded = true, if this entry had to be added,\n wasadded = false, if this was already found in the array.

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_realarray_type) :: me
    real(kind=rk), 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_real(me)

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

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_realarray_type) :: me

public interface empty

empty the array, reset nvals to be 0

  • public subroutine empty_da_real(me)

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

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_realarray_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 subroutine sorttruncate_da_real(me)

    fixing the dynamic array

    truncate the array after the last valid entry and hence cut off the empty trailing empty entries store the array in the sorted order according to the sorted( ) array

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_realarray_type) :: me

public interface expand

increase the size of the container for the array.

  • public subroutine expand_da_real(me, increment, length)

    expanding the dynamic array

    this is a helping subroutine, which doubles the container of the given dynamic array. as the container might be initially 0-sized, a module variable minlength has been introduced, which is used here, to at least create a container of this size.

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_realarray_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_real(me, val, nextifnotfound, lower, upper) result(pos)

    the actual position of a given value in the dynamic array

    most likely this is what you need in codes, using this data structure, it first does the binary search on the sorted values with sortposofval_real and then returns the looked up position in the original unsorted array, which corresponds to the position returned by the append routine.

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_realarray_type), intent(in) :: me
    real(kind=rk), 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_real(me, val, nextifnotfound, lower, upper) result(pos)

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

    if the value was not found, - return 0 if nextifnotfound = .false. - return position at the end if nextifnotfound = .true.

    binary search on sorted list

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_realarray_type), intent(in) :: me
    real(kind=rk), 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 interface init

initialize the dynamic array

  • public subroutine init_da_label(me, length)

    initialization of a dynamic array

    before a dynamic array can be used, it has to be initialized with this routine. the initial length provided here, can avoid reallocations and memory copying, if approximated correctly enough. if none is specified, the provided container initially will be of size 0.

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_labelarray_type), intent(out) :: me
    integer, intent(in), optional :: length

public interface destroy

destroy the dynamic array

  • public subroutine destroy_da_label(me)

    destruction of a dynamic array

    this subroutine takes care of a proper destruction of a dynamic array, it frees the allocated memory and resets the internal counts to 0.

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_labelarray_type), intent(inout) :: me

public interface append

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

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

    appending a value to the dynamic array

    with this subroutine, a given value can be added to the dynamic array. the actual position of this value in the dynamic array will be returned, so it can be found again easily later. with the wasadded flag, it is indicated,\n wasadded = true, if this entry had to be added,\n wasadded = false, if this was already found in the array.

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_labelarray_type) :: me
    character(len=*), 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_veclabel(me, val, length, pos, wasadded)

    appending a sorted list of values to the dynamic array

    with this subroutine, a given list of sorted values can be added to the dynamic array. the actual positions of these values in the dynamic array will be returned, so it can be found again easily later. with the wasadded flag, it is indicated,\n wasadded = true, if this entry had to be added,\n wasadded = false, if this was already found in the array.

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_labelarray_type) :: me
    character(len=*), 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_label(me)

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

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_labelarray_type) :: me

public interface empty

empty the array, reset nvals to be 0

  • public subroutine empty_da_label(me)

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

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_labelarray_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 subroutine sorttruncate_da_label(me)

    fixing the dynamic array

    truncate the array after the last valid entry and hence cut off the empty trailing empty entries store the array in the sorted order according to the sorted( ) array

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_labelarray_type) :: me

public interface expand

increase the size of the container for the array.

  • public subroutine expand_da_label(me, increment, length)

    expanding the dynamic array

    this is a helping subroutine, which doubles the container of the given dynamic array. as the container might be initially 0-sized, a module variable minlength has been introduced, which is used here, to at least create a container of this size.

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_labelarray_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_label(me, val, nextifnotfound, lower, upper) result(pos)

    the actual position of a given value in the dynamic array

    most likely this is what you need in codes, using this data structure, it first does the binary search on the sorted values with sortposofval_label and then returns the looked up position in the original unsorted array, which corresponds to the position returned by the append routine.

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_labelarray_type), intent(in) :: me
    character(len=*), 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_label(me, val, nextifnotfound, lower, upper) result(pos)

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

    if the value was not found, - return 0 if nextifnotfound = .false. - return position at the end if nextifnotfound = .true.

    binary search on sorted list

    Arguments

    Type IntentOptional Attributes Name
    type(dyn_labelarray_type), intent(in) :: me
    character(len=*), 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_longarray_type

dynamic array (da) type for integer(kind=long_k)

Components

Type Visibility Attributes Name Initial
integer, public :: nvals = 0
integer, public :: containersize = 0
integer(kind=long_k), public, allocatable :: val(:)
integer, public, allocatable :: sorted(:)

type, public ::  dyn_intarray_type

dynamic array (da) type for integer

Components

Type Visibility Attributes Name Initial
integer, public :: nvals = 0
integer, public :: containersize = 0
integer, public, allocatable :: val(:)
integer, public, allocatable :: sorted(:)

type, public ::  dyn_realarray_type

dynamic array (da) type for real(kind=rk)

Components

Type Visibility Attributes Name Initial
integer, public :: nvals = 0
integer, public :: containersize = 0
real(kind=rk), public, allocatable :: val(:)
integer, public, allocatable :: sorted(:)

type, public ::  dyn_labelarray_type

dynamic array (da) type for character(len=labellen)

Components

Type Visibility Attributes Name Initial
integer, public :: nvals = 0
integer, public :: containersize = 0
character(len=labellen), public, allocatable :: val(:)
integer, public, allocatable :: sorted(:)

Functions

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

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

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_longarray_type), intent(in) :: me
integer(kind=long_k), 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_long(me, val, nextifnotfound, lower, upper) result(pos)

the actual position of a given value in the dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_longarray_type), intent(in) :: me
integer(kind=long_k), 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 sortposofval_int(me, val, nextifnotfound, lower, upper) result(pos)

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

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_intarray_type), intent(in) :: me
integer, 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_int(me, val, nextifnotfound, lower, upper) result(pos)

the actual position of a given value in the dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_intarray_type), intent(in) :: me
integer, 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 sortposofval_real(me, val, nextifnotfound, lower, upper) result(pos)

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

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_realarray_type), intent(in) :: me
real(kind=rk), 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_real(me, val, nextifnotfound, lower, upper) result(pos)

the actual position of a given value in the dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_realarray_type), intent(in) :: me
real(kind=rk), 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 sortposofval_label(me, val, nextifnotfound, lower, upper) result(pos)

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

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_labelarray_type), intent(in) :: me
character(len=*), 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_label(me, val, nextifnotfound, lower, upper) result(pos)

the actual position of a given value in the dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_labelarray_type), intent(in) :: me
character(len=*), 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


Subroutines

public subroutine init_da_long(me, length)

initialization of a dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_longarray_type), intent(out) :: me
integer, intent(in), optional :: length

public subroutine destroy_da_long(me)

destruction of a dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_longarray_type), intent(inout) :: me

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

appending a value to the dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_longarray_type) :: me
integer(kind=long_k), 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_veclong(me, val, length, pos, wasadded)

appending a sorted list of values to the dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_longarray_type) :: me
integer(kind=long_k), 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_long(me)

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

Arguments

Type IntentOptional Attributes Name
type(dyn_longarray_type) :: me

public subroutine empty_da_long(me)

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

Arguments

Type IntentOptional Attributes Name
type(dyn_longarray_type) :: me

public subroutine sorttruncate_da_long(me)

fixing the dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_longarray_type) :: me

public subroutine expand_da_long(me, increment, length)

expanding the dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_longarray_type) :: me
integer, optional :: increment
integer, intent(in), optional :: length

optional length to expand the array

public subroutine init_da_int(me, length)

initialization of a dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_intarray_type), intent(out) :: me
integer, intent(in), optional :: length

public subroutine destroy_da_int(me)

destruction of a dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_intarray_type), intent(inout) :: me

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

appending a value to the dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_intarray_type) :: me
integer, 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_vecint(me, val, length, pos, wasadded)

appending a sorted list of values to the dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_intarray_type) :: me
integer, 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_int(me)

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

Arguments

Type IntentOptional Attributes Name
type(dyn_intarray_type) :: me

public subroutine empty_da_int(me)

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

Arguments

Type IntentOptional Attributes Name
type(dyn_intarray_type) :: me

public subroutine sorttruncate_da_int(me)

fixing the dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_intarray_type) :: me

public subroutine expand_da_int(me, increment, length)

expanding the dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_intarray_type) :: me
integer, optional :: increment
integer, intent(in), optional :: length

optional length to expand the array

public subroutine init_da_real(me, length)

initialization of a dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_realarray_type), intent(out) :: me
integer, intent(in), optional :: length

public subroutine destroy_da_real(me)

destruction of a dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_realarray_type), intent(inout) :: me

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

appending a value to the dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_realarray_type) :: me
real(kind=rk), 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_vecreal(me, val, length, pos, wasadded)

appending a sorted list of values to the dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_realarray_type) :: me
real(kind=rk), 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_real(me)

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

Arguments

Type IntentOptional Attributes Name
type(dyn_realarray_type) :: me

public subroutine empty_da_real(me)

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

Arguments

Type IntentOptional Attributes Name
type(dyn_realarray_type) :: me

public subroutine sorttruncate_da_real(me)

fixing the dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_realarray_type) :: me

public subroutine expand_da_real(me, increment, length)

expanding the dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_realarray_type) :: me
integer, optional :: increment
integer, intent(in), optional :: length

optional length to expand the array

public subroutine init_da_label(me, length)

initialization of a dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_labelarray_type), intent(out) :: me
integer, intent(in), optional :: length

public subroutine destroy_da_label(me)

destruction of a dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_labelarray_type), intent(inout) :: me

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

appending a value to the dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_labelarray_type) :: me
character(len=*), 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_veclabel(me, val, length, pos, wasadded)

appending a sorted list of values to the dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_labelarray_type) :: me
character(len=*), 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_label(me)

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

Arguments

Type IntentOptional Attributes Name
type(dyn_labelarray_type) :: me

public subroutine empty_da_label(me)

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

Arguments

Type IntentOptional Attributes Name
type(dyn_labelarray_type) :: me

public subroutine sorttruncate_da_label(me)

fixing the dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_labelarray_type) :: me

public subroutine expand_da_label(me, increment, length)

expanding the dynamic array

Read more…

Arguments

Type IntentOptional Attributes Name
type(dyn_labelarray_type) :: me
integer, optional :: increment
integer, intent(in), optional :: length

optional length to expand the array