stdio_m Module

This file renames the ISO input/output units to the standard UNIX names, defines the ANSI escape codes for colored output, and defines a number of auxiliary subroutines for e.g. writing out error and warning messages.



Contents


Variables

TypeVisibility AttributesNameInitial
integer, public :: stdin =input_unit
integer, public :: stdout =output_unit
integer, public :: stderr =error_unit
character(len=*), public, parameter:: color_none =''
character(len=*), public, parameter:: color_red =''
character(len=*), public, parameter:: color_green =''
character(len=*), public, parameter:: color_yellow =''
character(len=*), public, parameter:: color_blue =''
character(len=*), public, parameter:: color_purple =''
character(len=*), public, parameter:: color_cyan =''
character(len=*), public, parameter:: color_white =''

Interfaces

public interface dump

Public interface for functions that dump results to files

  • public impure subroutine dump_arrays(filename, arrays, header)

    This subroutine is used to dump numerical arrays to an output file.

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: filename
    real(kind=real64), intent(in), dimension(:):: arrays
    character(len=*), intent(in), dimension(:):: header
  • public impure subroutine dump_scalar(filename, scalar)

    This subroutine is used to dump a numerical result to an output file.

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: filename
    real(kind=real64), intent(in) :: scalar

Functions

public impure function input(file) result(unit)

This function is used to open an input file for reading.

Arguments

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

Return Value integer

public impure function output(file) result(unit)

This function is used to open an output file for writing.

Arguments

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

Return Value integer


Subroutines

public impure subroutine message(msg)

This subroutine provides a way to report a status message.

Arguments

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

public impure subroutine warning(msg)

This subroutine provides a way to report a warning message.

Arguments

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

public impure subroutine error(msg)

This subroutine provides a way to report an error message and halt the program.

Arguments

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

public impure subroutine status_head(title)

This subroutine is used to write boxed status messages to standard out; in particular, this routine writes out a boxed title with a timestamp.

Arguments

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

public impure subroutine status_body(title, value)

This subroutine is used to write boxed status messages to standard out; in particular, this routine writes out the name and value of a variable.

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: title
class(*), intent(in) :: value

public impure subroutine status_foot()

This subroutine is used to write boxed status messages to standard out; in particular, this routine writes out the bottom edge of such a box.

Arguments

None

public impure subroutine status_box(title)

This subroutine is used to write boxed status messages to standard out.

Arguments

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

public impure subroutine dump_arrays(filename, arrays, header)

This subroutine is used to dump numerical arrays to an output file.

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: filename
real(kind=real64), intent(in), dimension(:):: arrays
character(len=*), intent(in), dimension(:):: header

public impure subroutine dump_scalar(filename, scalar)

This subroutine is used to dump a numerical result to an output file.

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: filename
real(kind=real64), intent(in) :: scalar