text_mod Module

module~~text_mod~~UsesGraph module~text_mod text_mod module~kinds_mod kinds_mod module~kinds_mod->module~text_mod module~time_mod time_mod module~kinds_mod->module~time_mod module~time_mod->module~text_mod iso_fortran_env iso_fortran_env iso_fortran_env->module~text_mod iso_c_binding iso_c_binding iso_c_binding->module~time_mod
Help

Text processing module

Used By

module~~text_mod~~UsedByGraph module~text_mod text_mod module~objective_mod objective_mod module~text_mod->module~objective_mod module~plplotlib_mod plplotlib_mod module~text_mod->module~plplotlib_mod module~solvers_mod solvers_mod module~text_mod->module~solvers_mod program~testiterate_prg testIterate_prg module~text_mod->program~testiterate_prg module~config_mod config_mod module~text_mod->module~config_mod module~basicsolvers_mod basicSolvers_mod module~text_mod->module~basicsolvers_mod program~testtext_prg testText_prg module~text_mod->program~testtext_prg module~node_mod node_mod module~text_mod->module~node_mod program~testoptimize_prg testOptimize_prg module~objective_mod->program~testoptimize_prg module~plplotlib_mod->module~objective_mod program~testeval_prg testEval_prg module~plplotlib_mod->program~testeval_prg program~logo_prg logo_prg module~plplotlib_mod->program~logo_prg program~basic_prg basic_prg module~plplotlib_mod->program~basic_prg program~testspline_prg testSpline_prg module~plplotlib_mod->program~testspline_prg program~examples_prg examples_prg module~plplotlib_mod->program~examples_prg program~testsparse_prg testSparse_prg module~plplotlib_mod->program~testsparse_prg program~animate_prg animate_prg module~plplotlib_mod->program~animate_prg module~solvers_mod->program~testsparse_prg program~testconfig_prg testConfig_prg module~config_mod->program~testconfig_prg module~basicsolvers_mod->program~testsparse_prg module~treetrigonometric_mod treeTrigonometric_mod module~node_mod->module~treetrigonometric_mod module~treevalue_mod treeValue_mod module~node_mod->module~treevalue_mod module~treeoperator_mod treeOperator_mod module~node_mod->module~treeoperator_mod module~treeexponential_mod treeExponential_mod module~node_mod->module~treeexponential_mod module~expression_mod expression_mod module~node_mod->module~expression_mod module~treetrigonometric_mod->module~expression_mod module~treevalue_mod->module~expression_mod module~treeoperator_mod->module~expression_mod module~treeexponential_mod->module~expression_mod module~expression_mod->program~testeval_prg
Help


Variables

TypeVisibility AttributesNameInitial
integer, public, parameter:: stdin =INPUT_UNIT

Standard input unit

integer, public, parameter:: stdout =OUTPUT_UNIT

Standard output unit

integer, public, parameter:: stderr =ERROR_UNIT

Standard error unit

integer, public, parameter:: strLong =128

Length for long characters

integer, public, parameter:: strShort =32

Length for short characters

character(len=:), public, parameter:: fmtLong ='(1A128)'

Format for long characters

character(len=:), public, parameter:: fmtShort ='(1A32)'

Format for short characters


Functions

public function removeSpaces(s) result(o)

Remove all spaces from a string

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: s

String to remove spaces from

Return Value character(len=:), allocatable

String without spaces

public function startsWith(text, str) result(o)

Test if text starts with str

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: text

Text to search

character(len=*), intent(in) :: str

String to look for

Return Value logical

public function endsWith(text, str) result(o)

Test if text ends with str

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: text

Text to search

character(len=*), intent(in) :: str

String to look for

Return Value logical

public elemental function intToChar(a, f, l) result(o)

Create a string from an integer

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: a

Integer value to convert

character(len=*), intent(in), optional :: f

Format to use

integer, intent(in), optional :: l

Final length of string

Return Value character(len=:), allocatable

public elemental function realToChar(a, f, l) result(o)

Create a string from a real number

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in) :: a

Real value to convert

character(len=*), intent(in), optional :: f

Format to use

integer, intent(in), optional :: l

Final string length

Return Value character(len=:), allocatable

public elemental function realToTime(a) result(o)

Convert a real number to a string

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in) :: a

Time span in seconds

Return Value character(len=:), allocatable

public function charToArray(c) result(o)

Convert a character into an array of character(1)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: c

Character to convert

Return Value character(len=1), dimension(:), allocatable

New array of character(1)

public function arrayToChar(a) result(o)

Convert an array of character(1) into a character

Arguments

Type IntentOptional AttributesName
character(len=1), intent(in), dimension(:):: a

Array to convert

Return Value character(len=:), allocatable

New character

public function colorize(s, c) result(o)

Bracket a string with text to change its color on a terminal

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: s

String to colorize

integer, intent(in), dimension(3):: c

Color to use in [r,g,b] format, where \(r,b,g \in [0,5]\)

Return Value character(len=:), allocatable

public function colorMap(v, r) result(c)

Return the color code for colorize based on the coolwarm color map

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in) :: v

Value to map

real(kind=wp), intent(in), dimension(2):: r

Range over which to scale the colors

Return Value integer, dimension(3)


Subroutines

public subroutine showProgress(m, p, ml)

Create a progress bar through successive calls

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: m

Message to display

real(kind=wp), intent(in) :: p

Progress fraction \(p\in[0,1]\)
0 = start progress
1 = complete progress

integer, intent(in), optional :: ml

Message reserve length (used to align long messages)