runtime_info_type Derived Type

type, private :: runtime_info_type

Type providing information about the code version, compiler, build environment etc


Contents

Source Code


Components

Type Visibility Attributes Name Initial
integer, private :: verbosity

Integer determining the verbosity of debugging output, with higher values being more verbose. verbosity is read from the GK_VERBOSITY environment variable

logical, private :: verbosity_initialized = .false.

Whether verbosity has already been read from the environment variable. Reading environment variables is moderately expensive, so this is done once and the value stored in verbosity.


Type-Bound Procedures

procedure, public, :: get_verbosity

Get the value of verbosity, reading the enviroment variable GK_VERBOSITY if necessary.

  • private function get_verbosity(self)

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Testing the runtime environment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! This function interrogates the environment variable GK_VERBOSITY and returns its integer value. This is used to control the level of debug output (not diagnostic/physics output). Normal levels range from 0 to 5, with output getting heavier as the value increases. Values higher than 5 can be used for specialised/very heavy output.

    Arguments

    Type IntentOptional Attributes Name
    class(runtime_info_type), intent(inout) :: self

    Return Value integer

procedure, public, nopass :: is_release => is_release_runtime_info

Returns whether current version is a release

  • private function is_release_runtime_info()

    Returns whether current version is a release

    Arguments

    None

    Return Value logical

procedure, public, nopass :: release => release_runtime_info

Returns the release number

  • private function release_runtime_info()

    Returns the release number

    Arguments

    None

    Return Value character(len=30)

procedure, public, nopass :: compiler_pgi => compiler_pgi_runtime_info

Returns whether a PGI compiler was used

  • private function compiler_pgi_runtime_info()

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Tests for compilers !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Returns whether a PGI compiler was used

    Arguments

    None

    Return Value logical

procedure, public, nopass :: get_compiler_name

Returns the name of the compiler used

  • private function get_compiler_name()

    Returns the name of the compiler used

    Arguments

    None

    Return Value character(len=9)

procedure, public, nopass :: get_gk_system

Returns the value of the "fedora" environment variable

  • private function get_gk_system()

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! System info !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Returns the value of the "fedora" environment variable

    Arguments

    None

    Return Value character(len=20)

procedure, public, :: build_identifier => build_identifier_runtime_info

Returns an identifier of the system and build: "system.compiler.githash".

  • private function build_identifier_runtime_info(self)

    Returns an identifier of the system and build: "system.compiler.githash".

    Arguments

    Type IntentOptional Attributes Name
    class(runtime_info_type), intent(inout) :: self

    Return Value character(len=50)

procedure, public, nopass :: get_git_hash => get_git_hash_runtime_info

Returns the git hash

  • private function get_git_hash_runtime_info(length_in)

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Tests for git info !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Returns the git hash

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in), optional :: length_in

    Return Value character(len=40)

procedure, public, nopass :: get_git_modified => get_git_modified_runtime_info

Returns whether the source code has been modified relative to the repository version

  • private function get_git_modified_runtime_info()

    Returns whether the source code has been modified relative to the repository version

    Arguments

    None

    Return Value logical

Source Code

  type :: runtime_info_type

    private
    !> Integer determining the verbosity of debugging output, with higher
    !! values being more verbose. `verbosity` is read from the
    !! GK_VERBOSITY environment variable
    integer :: verbosity
    !> Whether verbosity has already been read from the environment variable.
    !! Reading environment variables is moderately expensive, so this is done
    !! once and the value stored in [[verbosity]].
    logical :: verbosity_initialized = .false.

    contains
    !> Get the value of [[verbosity]], reading the enviroment variable
    !! GK_VERBOSITY if necessary.
    procedure :: get_verbosity
    !> Returns whether current version is a release
    procedure, nopass :: is_release => is_release_runtime_info
    !> Returns the release number
    procedure, nopass :: release => release_runtime_info
    !> Returns whether a PGI compiler was used
    procedure, nopass :: compiler_pgi => compiler_pgi_runtime_info
    !> Returns the name of the compiler used
    procedure, nopass :: get_compiler_name
    !> Returns the value of the GK_SYSTEM environment variable
    procedure, nopass :: get_gk_system
    !> Returns an identifier of the system and build:
    !! "system.compiler.githash".
    procedure :: build_identifier => build_identifier_runtime_info
    !> Returns the git hash
    procedure, nopass :: get_git_hash => get_git_hash_runtime_info
    !> Returns whether the source code has been modified relative to the
    !! repository version
    procedure, nopass :: get_git_modified => get_git_modified_runtime_info

  end type runtime_info_type