error_msg_class Module Reference

Error handling routines. More...

Functions/Subroutines

subroutine, private write_header ()
 Write the header of the standard output (usually OUT) More...
 
subroutine, public write_final_stats_rate_creation
 Write the final stats for rate creation. More...
 
subroutine, public write_data_to_std_out (str_msg, value_str, unit)
 Write data to the standard output (usually OUT) More...
 
integer function, public str_to_int (input_string)
 Converts a string to an integer. More...
 
real(r_kind) function, public str_to_float (input_string)
 Converts a string to a float. More...
 
character(:) function, allocatable, public num_to_str (num)
 Converts a given real to a string with format "(1pE10.2)". More...
 
character(:) function, allocatable, public int_to_str (num)
 Converts a given integer to a string. More...
 
subroutine, public raise_exception (msg, sub, error_code)
 Raise a exception with a given error message. More...
 

Variables

integer, parameter error_id =0
 Default standard error unit in fortran. More...
 
logical, private write_header_init =.True.
 Init flag for write_data_to_std_out. More...
 
logical, public data_creation_mode =.False.
 Flag for rate creation mode. More...
 

Detailed Description

Error handling routines.

Author
Darko Mocelj, Christian Winteler
Date
31.07.2003

Edited:

  • MR 11.01.2020 - Rewrote the module

Function/Subroutine Documentation

◆ int_to_str()

character(:) function, allocatable, public error_msg_class::int_to_str ( integer, intent(in)  num)

Converts a given integer to a string.

This function is often used in error messages as it is useful to convert a number to a string in the message directly.

Author
Moritz Reichert
Parameters
[in]numInput integer
Returns
converted integer

Definition at line 223 of file error_msg_class.f90.

◆ num_to_str()

character(:) function, allocatable, public error_msg_class::num_to_str ( real(r_kind), intent(in)  num)

Converts a given real to a string with format "(1pE10.2)".

This function is often used in error messages as it is useful to convert a number to a string in the message directly

Author
Moritz Reichert
Parameters
[in]numInput float
Returns
converted float

Definition at line 204 of file error_msg_class.f90.

◆ raise_exception()

subroutine, public error_msg_class::raise_exception ( character(len=*), intent(in)  msg,
character(len=*), intent(in), optional  sub,
integer, intent(in), optional  error_code 
)

Raise a exception with a given error message.

This subroutine is called when some inconsistency occured. It prints a message to the OUT file that an error occured and prints the rest to the standard error unit (usually file ERR in WinNet). This subroutine also terminates the program.

Author
Moritz Reichert
Parameters
[in]msgError message
[in]subin which subroutine [opt]
[in]error_codeErrorcode, see Error codes

Definition at line 244 of file error_msg_class.f90.

Here is the call graph for this function:

◆ str_to_float()

real(r_kind) function, public error_msg_class::str_to_float ( character(len=*), intent(in)  input_string)

Converts a string to a float.

If the string is not a valid integer, an error message is raised.

Author
Moritz Reichert
Date
01.06.22
Parameters
[in]input_stringString from param file
Returns
Converted integer value from input string

Definition at line 178 of file error_msg_class.f90.

Here is the call graph for this function:

◆ str_to_int()

integer function, public error_msg_class::str_to_int ( character(len=*), intent(in)  input_string)

Converts a string to an integer.

If the string is not a valid integer, an error message is raised.

Author
Moritz Reichert
Date
01.06.22
Parameters
[in]input_stringString from param file
Returns
Converted integer value from input string

Definition at line 154 of file error_msg_class.f90.

Here is the call graph for this function:

◆ write_data_to_std_out()

subroutine, public error_msg_class::write_data_to_std_out ( character(len=*), intent(in)  str_msg,
character(len=*), intent(in)  value_str,
character(len=*), intent(in), optional  unit 
)

Write data to the standard output (usually OUT)

This subroutine formats the output to a uniform design. an example line is:

 Network size                             :       6545         
Author
Moritz Reichert
Date
27.01.21
Parameters
[in]str_msgMessage oriented to the left
[in]value_strValue represented as a string
[in]unitunit string

Definition at line 121 of file error_msg_class.f90.

Here is the call graph for this function:

◆ write_final_stats_rate_creation()

subroutine, public error_msg_class::write_final_stats_rate_creation

Write the final stats for rate creation.

This subroutine writes the final stats when only creating a folder with prepared binary data.

Author
M. Reichert
Date
22.07.23

Definition at line 97 of file error_msg_class.f90.

◆ write_header()

subroutine, private error_msg_class::write_header
private

Write the header of the standard output (usually OUT)

This subroutine writes the first header of the out file. This looks e.g., like:

 WinNet - Nuclear reaction network
 

Option : Value Unit --------------------------------------------------------------

Edited:

  • 08.08.22, M.R: Implemented git version
Author
Moritz Reichert
Date
27.01.21

Definition at line 51 of file error_msg_class.f90.

Here is the call graph for this function:

Variable Documentation

◆ data_creation_mode

logical, public error_msg_class::data_creation_mode =.False.

Flag for rate creation mode.

Definition at line 23 of file error_msg_class.f90.

◆ error_id

integer, parameter error_msg_class::error_id =0
private

Default standard error unit in fortran.

Definition at line 20 of file error_msg_class.f90.

◆ write_header_init

logical, private error_msg_class::write_header_init =.True.
private

Init flag for write_data_to_std_out.

Definition at line 22 of file error_msg_class.f90.