runtime_tests Module

This module is intended to be used for runtime tests which interrogate what is functional/what compile time options were enabled/disabled, and also any enviroment variables which affect what happens at runtime.


Contents


Variables

Type Visibility Attributes Name Initial
type(runtime_info_type), public :: runtime_info

Derived Types

type, private ::  runtime_info_type

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

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 Function

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

procedure , public , nopass :: is_release => is_release_runtime_info Function

Returns whether current version is a release

procedure , public , nopass :: release => release_runtime_info Function

Returns the release number

procedure , public , nopass :: compiler_pgi => compiler_pgi_runtime_info Function

Returns whether a PGI compiler was used

procedure , public , nopass :: get_compiler_name Function

Returns the name of the compiler used

procedure , public , nopass :: get_gk_system Function

Returns the value of the "fedora" environment variable

procedure , public , :: build_identifier => build_identifier_runtime_info Function

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

procedure , public , nopass :: get_git_hash => get_git_hash_runtime_info Function

Returns the git hash

procedure , public , nopass :: get_git_modified => get_git_modified_runtime_info Function

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


Functions

private function compiler_pgi_runtime_info()

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

Arguments

None

Return Value logical

private function get_compiler_name()

Returns the name of the compiler used

Arguments

None

Return Value character(len=9)

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)

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

private function get_gk_system()

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

Arguments

None

Return Value character(len=20)

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)

private function is_release_runtime_info()

Returns whether current version is a release

Arguments

None

Return Value logical

private function release_runtime_info()

Returns the release number

Arguments

None

Return Value character(len=30)

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

public function verbosity()

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Functions provided for backwards compatibility ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! This function is just a call of get_verbosity and is provided for backwards compatibility.

Arguments

None

Return Value integer

public function is_release()

This function is just a call of is_release_runtime_info and is provided for backwards compatibility.

Arguments

None

Return Value logical

public function release()

This function is just a call of release_runtime_info and is provided for backwards compatibility.

Arguments

None

Return Value character(len=30)

public function get_git_hash(length_in)

This function is just a call of get_git_hash_runtime_info and is provided for backwards compatibility.

Arguments

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

Return Value character(len=40)

public function get_git_modified()

This function is just a call of get_git_modified_runtime_info and is provided for backwards compatibility.

Arguments

None

Return Value logical

public function build_identifier()

This function is just a call of build_identifier_runtime_info and is provided for backwards compatibility.

Arguments

None

Return Value character(len=50)

public function compiler_pgi()

This function is just a call of compiler_pgi_runtime_info and is provided for backwards compatibility.

Arguments

None

Return Value logical