csv_utilities Module

Utility routines.


Uses

  • module~~csv_utilities~~UsesGraph module~csv_utilities csv_utilities module~csv_kinds csv_kinds module~csv_utilities->module~csv_kinds module~csv_parameters csv_parameters module~csv_utilities->module~csv_parameters iso_fortran_env iso_fortran_env module~csv_kinds->iso_fortran_env module~csv_parameters->module~csv_kinds

Used by

  • module~~csv_utilities~~UsedByGraph module~csv_utilities csv_utilities module~csv_module csv_module module~csv_module->module~csv_utilities

Variables

Type Visibility Attributes Name Initial
integer, private, parameter :: max_size_for_insertion_sort = 20

max size for using insertion sort.

character(len=*), private, parameter :: upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

uppercase characters

character(len=*), private, parameter :: lower = 'abcdefghijklmnopqrstuvwxyz'

lowercase characters


Functions

public function unique(vec, chunk_size) result(ivec_unique)

Returns only the unique elements of the vector.

Arguments

Type IntentOptional Attributes Name
integer, intent(in), dimension(:) :: vec

a vector of integers

integer, intent(in) :: chunk_size

chunk size for adding to arrays

Return Value integer, dimension(:), allocatable

unique elements of ivec

public pure function lowercase_string(str) result(s_lower)

Returns lowercase version of the string.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str

input string

Return Value character(len=len=(len(str)))

lowercase version of the string


Subroutines

public pure subroutine expand_vector(vec, n, chunk_size, val, finished)

Add elements to the integer vector in chunks.

Arguments

Type IntentOptional Attributes Name
integer, intent(inout), dimension(:), allocatable :: vec
integer, intent(inout) :: n

counter for last element added to vec. must be initialized to size(vec) (or 0 if not allocated) before first call

integer, intent(in) :: chunk_size

allocate vec in blocks of this size (>0)

integer, intent(in), optional :: val

the value to add to vec

logical, intent(in), optional :: finished

set to true to return vec as its correct size (n)

public subroutine sort_ascending(ivec)

Sorts an integer array ivec in increasing order. Uses a basic recursive quicksort (with insertion sort for partitions with 20 elements).

Arguments

Type IntentOptional Attributes Name
integer, intent(inout), dimension(:) :: ivec

private pure elemental subroutine swap(i1, i2)

Swap two integer values.

Arguments

Type IntentOptional Attributes Name
integer, intent(inout) :: i1
integer, intent(inout) :: i2