FishMet: Fish feeding and appetite model, OPEN EDITION  0.1
FishMet: Fish feeding and appetite model, OPEN EDITION
runtime Module Reference

Module that defines the runtime behaviour of the model. More...

Functions/Subroutines

impure subroutine system_init
 This procedure performs basic initialisation of the system: More...
 
impure subroutine system_run_main ()
 This subroutine starts and schedules the model. More...
 
impure subroutine read_parameters ()
 The subroutine read_parameters reads global parameters defined in the commondata module from configuration file commondata::param_file_name_def. More...
 
impure subroutine exit_with_error (message, no_exit)
 A wrapper subroutine that will produce error message and halt. More...
 
character(len=:) function, allocatable parse_svn_version (svn_version_string)
 Parse and cut revision number in form of string from the whole SVN revision string. SVN revision number can therefore be included into the model outputs and output file names. This is convenient because the model version is identified by a single SVN revision number. More...
 
elemental logical function check_stomach_transport_emptying_agree ()
 Check if the stomach pattern matrix agrees with the stomach emptying partameter matrix, i.e. the difference is less than one hour. More...
 

Detailed Description

Module that defines the runtime behaviour of the model.

Function/Subroutine Documentation

◆ system_init()

impure subroutine runtime::system_init

This procedure performs basic initialisation of the system:

  • read environment variables determining global behaviour of the model
  • call ::read_parameters_file() to get global model parameters from the configuration file

Command line parameters and environment variables

The behaviour of the model program can be controlled using command line parameters and environment variables.

Help screen

Help screen: if the program is executed with one of these command line parameters -h --help -help /h /help, a short screen help is printed on the terminal and the program halts.

Set the output mode

There are two output modes: normal and "quiet," in the later case only requested information is written to the screen, no accessory information is written.

Parameters file

The main parameter file is kept in commondata::global_param_file_name and is defined by the environment variable FFA_MODEL_PARAMETER_FILE.

The environment variable FFA_MODEL_OUTPUT_DEST can set the output destination directory in addition to the output_dest parameter in the model configuration file. The value set by the environment variable takes priority over the configuration file.

Definition at line 34 of file m_runtime.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ system_run_main()

impure subroutine runtime::system_run_main

This subroutine starts and schedules the model.

  • Print param,eters
  • Run the model
  • Print basic output stats
  • Save model stats row

Definition at line 112 of file m_runtime.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_parameters()

impure subroutine runtime::read_parameters

The subroutine read_parameters reads global parameters defined in the commondata module from configuration file commondata::param_file_name_def.

Definition at line 178 of file m_runtime.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exit_with_error()

impure subroutine runtime::exit_with_error ( character(len=*), intent(in)  message,
logical, intent(in), optional  no_exit 
)

A wrapper subroutine that will produce error message and halt.

Parameters
[in]messageThe error message that is printed to the standard error device or appear as a warning window depending on the interface type.
[in]no_exitOptional parameter that dictates NOT to stop the program and just print the error message. This may be useful if the program must check a series of conditions and then exit at the last one.

Definition at line 554 of file m_runtime.f90.

Here is the caller graph for this function:

◆ parse_svn_version()

character(len=:) function, allocatable runtime::parse_svn_version ( character(*), intent(in)  svn_version_string)

Parse and cut revision number in form of string from the whole SVN revision string. SVN revision number can therefore be included into the model outputs and output file names. This is convenient because the model version is identified by a single SVN revision number.

Returns
revision number from Subversion.
Warning
STRINGS module uses unsafe coding prone to bugs, e.g. does not clearly state dummy parameters intent and doesn't work correctly with parameters.
Parameters
[in]svn_version_stringThe standard revision string as defined by the
Revision
XXX

keyword from Subversion.

Implementation notes

Subversion has a useful feature: various keywords can be inserted and automatically updated in the source code under revision control, e.g. revision number, date, user etc. The character string parameter constant commondata::svn_version_string keeps the Subversion revision tag. This subroutine parses the tag striping all other characters out.

Definition at line 587 of file m_runtime.f90.

◆ check_stomach_transport_emptying_agree()

elemental logical function runtime::check_stomach_transport_emptying_agree

Check if the stomach pattern matrix agrees with the stomach emptying partameter matrix, i.e. the difference is less than one hour.

Definition at line 616 of file m_runtime.f90.