utility_functions_mod Module

This module contains functions which handle writing messages/errors/warnings on screen, formatting headers, summary of the calculations and a few other supporting functions.


Uses

  • module~~utility_functions_mod~~UsesGraph module~utility_functions_mod utility_functions_mod iso_fortran_env iso_fortran_env module~utility_functions_mod->iso_fortran_env

Used by

  • module~~utility_functions_mod~~UsedByGraph module~utility_functions_mod utility_functions_mod module~pes_matrix_mod pes_matrix_mod module~pes_matrix_mod->module~utility_functions_mod module~physics_utilities_mod physics_utilities_mod module~pes_matrix_mod->module~physics_utilities_mod module~math_utilities_mod math_utilities_mod module~pes_matrix_mod->module~math_utilities_mod module~radial_coupling_terms_mod radial_coupling_terms_mod module~pes_matrix_mod->module~radial_coupling_terms_mod module~physics_utilities_mod->module~utility_functions_mod module~propagator_mod propagator_mod module~propagator_mod->module~utility_functions_mod module~propagator_mod->module~pes_matrix_mod module~propagator_mod->module~physics_utilities_mod module~input_validation input_validation module~input_validation->module~utility_functions_mod module~channels_mod channels_mod module~channels_mod->module~utility_functions_mod module~channels_mod->module~physics_utilities_mod module~array_operations_invert_symmetric_matrix_submod array_operations_invert_symmetric_matrix_submod module~array_operations_invert_symmetric_matrix_submod->module~utility_functions_mod module~array_operations_fill_symmetric_matrix_submod array_operations_fill_symmetric_matrix_submod module~array_operations_fill_symmetric_matrix_submod->module~utility_functions_mod module~math_utilities_mod->module~utility_functions_mod module~radial_coupling_terms_mod->module~utility_functions_mod module~radial_coupling_terms_mod->module~math_utilities_mod module~input_reader_mod input_reader_mod module~input_reader_mod->module~utility_functions_mod module~input_reader_mod->module~physics_utilities_mod module~input_reader_mod->module~input_validation module~unitarity_check_mod unitarity_check_mod module~unitarity_check_mod->module~utility_functions_mod module~save_s_matrix_mod save_s_matrix_mod module~save_s_matrix_mod->module~utility_functions_mod module~state_to_state_cross_sections_mod state_to_state_cross_sections_mod module~state_to_state_cross_sections_mod->module~utility_functions_mod module~state_to_state_cross_sections_mod->module~physics_utilities_mod program~scattering SCATTERING program~scattering->module~utility_functions_mod program~scattering->module~pes_matrix_mod program~scattering->module~physics_utilities_mod program~scattering->module~propagator_mod program~scattering->module~channels_mod program~scattering->module~radial_coupling_terms_mod program~scattering->module~input_reader_mod program~scattering->module~unitarity_check_mod program~scattering->module~save_s_matrix_mod program~scattering->module~state_to_state_cross_sections_mod module~boundary_conditions_mod boundary_conditions_mod program~scattering->module~boundary_conditions_mod module~boundary_conditions_mod->module~physics_utilities_mod module~boundary_conditions_mod->module~math_utilities_mod

Contents


Variables

Type Visibility Attributes Name Initial
character(len=*), private, parameter :: letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
character(len=*), private, parameter :: lowercase = letters(27:)
character(len=*), private, parameter :: uppercase = letters(1:26)

Interfaces

public interface incorrect_value

interface for the following message: incorrect value encountered: variable_name = variable_value

  • private subroutine incorrect_value_ch(name_, value_, unit_)

    incorrect value encountered: variable_name = variable_value

    Arguments

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

    name of the variable

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

    value of the variable

    integer(kind=int32), intent(in), optional :: unit_

    optional, unit where the message will be written

  • private subroutine incorrect_value_int32(name_, value_, unit_)

    incorrect value encountered: variable_name = variable_value

    Arguments

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

    name of the variable

    integer(kind=int32), intent(in) :: value_

    value of the variable

    integer(kind=int32), intent(in), optional :: unit_

    optional, unit where the message will be written

  • private subroutine incorrect_value_sp(name_, value_, unit_)

    incorrect value encountered: variable_name = variable_value

    Arguments

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

    name of the variable

    real(kind=sp), intent(in) :: value_

    value of the variable

    integer(kind=int32), intent(in), optional :: unit_

    optional, unit where the message will be written

  • private subroutine incorrect_value_dp(name_, value_, unit_)

    incorrect value encountered: variable_name = variable_value

    Arguments

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

    name of the variable

    real(kind=dp), intent(in) :: value_

    value of the variable

    integer(kind=int32), intent(in), optional :: unit_

    optional, unit where the message will be written


Functions

public function float_to_character(f, format_string) result(res)

Converts a floating-point number to a character string.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: f

input floating-point number

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

Optional format string.

Return Value character(len=64)

Output character string.

public function integer_to_character(i, format_string) result(res)

transfers integer to a character

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: i

input integer

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

Optional format string.

Return Value character(len=32)

output character

public function to_lowercase(str) result(low_str)

forces lowercase on given string

Arguments

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

input string

Return Value character(len=len)

output (lowercase) string

private function char_to_lowercase(s) result(l_s)

forces lowercase on a single character

Arguments

Type IntentOptional Attributes Name
character(len=1), intent(in) :: s

input character

Return Value character(len=1)

output (lowercase) character


Subroutines

public subroutine alloc_status(istat_, message_, op_, unit_)

check the status after allocation

Arguments

Type IntentOptional Attributes Name
integer(kind=int32) :: istat_

result of stat=istat in (de)allocate

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

a message to be written

character(len=1), intent(in) :: op_

'a' for allocation, 'd' for deallocation

integer(kind=int32), intent(in), optional :: unit_

optional, unit where the message will be written

public subroutine file_io_status(istat_, iomsg_, channel_, op_, unit_)

check the status during various io operations on files

Arguments

Type IntentOptional Attributes Name
integer(kind=int32) :: istat_

result of iostat in open/read/write/close

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

result of iomsg in open/read/write/close

integer(kind=int32), intent(in) :: channel_

name of the file

character(len=1), intent(in) :: op_

'o' for opening of the file, 'r' for reading, 'w' for writing, 'c' for closing

integer(kind=int32), intent(in), optional :: unit_

optional, unit where the message will be written

public subroutine no_open_channels_message(block_number_)

print a short message that there are no open channels in given block

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: block_number_

block number

public subroutine time_count_summary(start_, stop_, time_, message_)

print the message about the time it took to complete a single task

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: start_

initial time

real(kind=dp), intent(in) :: stop_

final time

real(kind=dp), intent(out) :: time_

stop_ - start_

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

(optional) a message to print instead of a default "Completed in ... s"

public subroutine write_error(message_, unit_)

writes an error message on a chosen unit

Arguments

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

a message to be written

integer(kind=int32), intent(in), optional :: unit_

optional, unit where the message will be written

public subroutine write_header(header_type, opt_integer_)

writes headers on screen

Arguments

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

specifies the type of the header: 'main', 'input_read', 'input_check', 'input_summary', 'initialization', 'check_norm', 'save_basis', 'save_pes', 'radial_terms', 'save_radial_terms', 'reconstruction'

integer(kind=int32), intent(in), optional :: opt_integer_

optional integer used in case "block" to pass jtot value

public subroutine write_message(message_, unit_)

writes a message on a chosen unit

Arguments

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

a message to be written

integer(kind=int32), intent(in), optional :: unit_

optional, unit where the message will be written

public subroutine write_warning(message_, unit_)

writes a warning message on a chosen unit

Arguments

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

a message to be written

integer(kind=int32), intent(in), optional :: unit_

optional, unit where the message will be written

private subroutine incorrect_value_ch(name_, value_, unit_)

incorrect value encountered: variable_name = variable_value

Arguments

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

name of the variable

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

value of the variable

integer(kind=int32), intent(in), optional :: unit_

optional, unit where the message will be written

private subroutine incorrect_value_dp(name_, value_, unit_)

incorrect value encountered: variable_name = variable_value

Arguments

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

name of the variable

real(kind=dp), intent(in) :: value_

value of the variable

integer(kind=int32), intent(in), optional :: unit_

optional, unit where the message will be written

private subroutine incorrect_value_int32(name_, value_, unit_)

incorrect value encountered: variable_name = variable_value

Arguments

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

name of the variable

integer(kind=int32), intent(in) :: value_

value of the variable

integer(kind=int32), intent(in), optional :: unit_

optional, unit where the message will be written

private subroutine incorrect_value_sp(name_, value_, unit_)

incorrect value encountered: variable_name = variable_value

Arguments

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

name of the variable

real(kind=sp), intent(in) :: value_

value of the variable

integer(kind=int32), intent(in), optional :: unit_

optional, unit where the message will be written