logging_base_mod Module Reference

Basic fosite module. More...

Data Types

type  logging_base
 common data structure More...
 

Functions/Subroutines

subroutine initlogging (this, t, n)
 Constructor of common class. More...
 
subroutine finalize (this)
 Destructor of common class. More...
 
pure integer function gettype (this)
 Get the module type number. More...
 
subroutine setprefix (val)
 Set character preceding the info output. More...
 
pure character(len=32) function getname (this)
 Get the module name. More...
 
pure integer function getrank (this)
 Get the MPI rank. More...
 
pure integer function getnumprocs (this)
 Get the total number of MPI processes. More...
 
pure logical function initialized (this)
 Query initialization status. More...
 
subroutine info (this, msg, rank, node_info, tostderr)
 Print information on standard output. More...
 
subroutine warning (this, modproc, msg, rank)
 Print warning message on standard error. More...
 
subroutine error (this, modproc, msg, rank, node_info)
 Print error message on standard error and terminate the program. More...
 

Variables

integer, save default_mpi_real = MPI_REAL
 default real type for MPI More...
 
integer, save default_mpi_2real = MPI_2REAL
 default 2real type for MPI More...
 
integer, save default_mpi_complex = MPI_DOUBLE_COMPLEX
 default real type for MPI More...
 
real, parameter dummy = 1.0
 check default real type More...
 
real, save nan_default_real
 NaN real constant. More...
 
integer, parameter stderr = 0
 fortran stderr unit More...
 
integer, parameter stdout = 6
 fortran stdout unit More...
 
integer, target, save myrank = 0
 MPI rank. More...
 
integer, target, save ppnum = 1
 MPI number of processes. More...
 
logical, target, save parinit = .FALSE.
 MPI initialization status. More...
 
character(len=1), save prefix = ' '
 preceds info output More...
 

Detailed Description

Basic fosite module.

Author
Tobias Illenseer
Manuel Jung

This module defines the basic data types and methods inherited by all fosite modules.

Function/Subroutine Documentation

◆ error()

subroutine logging_base_mod::error ( class(logging_base), intent(in)  this,
character(len=*), intent(in)  modproc,
character(len=*), intent(in)  msg,
integer, intent(in), optional  rank,
logical, intent(in), optional  node_info 
)

Print error message on standard error and terminate the program.

Print the error message given by msg preceded by the name of the module procedure which triggers the error. After that abort program execution.

Parameters
[in]this[in,out] this module type and name
[in]modproc[in] modproc name of module procedure
[in]msg[in] msg warning message
[in]rank[in] rank MPI rank
[in]node_info[in] node_info enable rank output

Definition at line 334 of file logging_base.f90.

◆ finalize()

subroutine logging_base_mod::finalize ( type(logging_base), intent(inout)  this)

Destructor of common class.

Parameters
[in,out]this[in,out] this module type and name

Definition at line 155 of file logging_base.f90.

◆ getname()

pure character(len=32) function logging_base_mod::getname ( class(logging_base), intent(in)  this)

Get the module name.

Returns
module name
Parameters
[in]this[in] this module type and name

Definition at line 189 of file logging_base.f90.

◆ getnumprocs()

pure integer function logging_base_mod::getnumprocs ( class(logging_base), intent(in)  this)

Get the total number of MPI processes.

Returns
number of MPI processes

If the code is compiled for serial execution it returns always 1.

Parameters
[in]this[in] this module type and name

Definition at line 219 of file logging_base.f90.

◆ getrank()

pure integer function logging_base_mod::getrank ( class(logging_base), intent(in)  this)

Get the MPI rank.

Returns
MPI rank

This function returns the MPI rank, i.e. process number, of the current process in parallel mode. If fosite is compiled for serial execution the return value is always 0.

Parameters
[in]this[in] this module type and name

Definition at line 205 of file logging_base.f90.

◆ gettype()

pure integer function logging_base_mod::gettype ( class(logging_base), intent(in)  this)

Get the module type number.

Returns
module type number
Parameters
[in]this[in] this module type and name

Definition at line 166 of file logging_base.f90.

◆ info()

subroutine logging_base_mod::info ( class(logging_base), intent(in)  this,
character(len=*), intent(in)  msg,
integer, intent(in), optional  rank,
logical, intent(in), optional  node_info,
logical, intent(in), optional  tostderr 
)

Print information on standard output.

Print the string given in msg preceded by the character previously set by setprefix . If the optional parameter tostderr is .TRUE. the information is printed to STDERR instead of STDOUT.

In parallel mode it prints information only on the MPI process given by rank (defaults to 0 if omitted). In addition it prints the MPI rank if node_info is .TRUE.

Parameters
[in]this[in] this module type and name
[in]msg[in] msg info message
[in]rank[in] rank MPI rank
[in]node_info[in] node_info enable rank output
[in]tostderr[in] tostderr enable STDERR output

Definition at line 260 of file logging_base.f90.

◆ initialized()

pure logical function logging_base_mod::initialized ( class(logging_base), intent(in)  this)

Query initialization status.

Returns
initialization status

It returns .TRUE. for initialized modules otherwise .FALSE.

Parameters
[in]this[in] this module type and name

Definition at line 233 of file logging_base.f90.

◆ initlogging()

subroutine logging_base_mod::initlogging ( class(logging_base), intent(inout)  this,
integer, intent(in)  t,
character(len=*), intent(in)  n 
)

Constructor of common class.

Sets the module type (number) and name. In addition it initializes other internal variables including those related to parallel execution mode such as the MPI rank and the total number of MPI processes. The default MPI real data types are determined.

Parameters
[in,out]this[out] this module type and name
t[in] t module type identification number
n[in] n module type name

Definition at line 114 of file logging_base.f90.

◆ setprefix()

subroutine logging_base_mod::setprefix ( character(len=1), intent(in)  val)

Set character preceding the info output.

Parameters
[in]val[in] val preceding character

Definition at line 178 of file logging_base.f90.

◆ warning()

subroutine logging_base_mod::warning ( class(logging_base), intent(in)  this,
character(len=*), intent(in)  modproc,
character(len=*), intent(in)  msg,
integer, intent(in), optional  rank 
)

Print warning message on standard error.

Print the warning message given by msg preceded by the name of the module procedure which triggers the warning.

Parameters
[in]this[in] this module type and name
[in]modproc[in] modproc name of module procedure
[in]msg[in] msg warning message
[in]rank[in] rank MPI rank

Definition at line 316 of file logging_base.f90.

Variable Documentation

◆ default_mpi_2real

integer, save logging_base_mod::default_mpi_2real = MPI_2REAL
private

default 2real type for MPI

Definition at line 81 of file logging_base.f90.

◆ default_mpi_complex

integer, save logging_base_mod::default_mpi_complex = MPI_DOUBLE_COMPLEX
private

default real type for MPI

Definition at line 82 of file logging_base.f90.

◆ default_mpi_real

integer, save logging_base_mod::default_mpi_real = MPI_REAL
private

default real type for MPI

Definition at line 80 of file logging_base.f90.

◆ dummy

real, parameter logging_base_mod::dummy = 1.0
private

check default real type

Definition at line 83 of file logging_base.f90.

◆ myrank

integer, target, save logging_base_mod::myrank = 0
private

MPI rank.

Definition at line 88 of file logging_base.f90.

◆ nan_default_real

real, save logging_base_mod::nan_default_real
private

NaN real constant.

Definition at line 85 of file logging_base.f90.

◆ parinit

logical, target, save logging_base_mod::parinit = .FALSE.
private

MPI initialization status.

Definition at line 90 of file logging_base.f90.

◆ ppnum

integer, target, save logging_base_mod::ppnum = 1
private

MPI number of processes.

Definition at line 89 of file logging_base.f90.

◆ prefix

character(len=1), save logging_base_mod::prefix = ' '
private

preceds info output

Definition at line 91 of file logging_base.f90.

◆ stderr

integer, parameter logging_base_mod::stderr = 0
private

fortran stderr unit

Definition at line 86 of file logging_base.f90.

◆ stdout

integer, parameter logging_base_mod::stdout = 6
private

fortran stdout unit

Definition at line 87 of file logging_base.f90.