Provides the exit_code type used to represent an exit reason. Also provides a number of specific exit_code instances for regular expected exit reasons.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | private, | parameter | :: | exit_string_len | = | 100 |
Length of the exit message string |
type(exit_code), | public, | parameter | :: | EXIT_NOT_REQUESTED | = | exit_code() |
Type for exiting without specifying a reason, note this uses the default code and message |
type(exit_code), | public, | parameter | :: | EXIT_NSTEP | = | exit_code(code=1, message="nstep timesteps completed.") |
Type for exiting after completing the specified number of timesteps. |
type(exit_code), | public, | parameter | :: | EXIT_LINEAR_CONVERGENCE | = | exit_code(code=2, message="Linear simulation is converged.") |
Type for exiting after a linear simulation has converged. |
type(exit_code), | public, | parameter | :: | EXIT_NONLINEAR_CONVERGENCE | = | exit_code(code=3, message="Nonlinear simulation is converged.") |
Type for exiting after a nonlinear simulation has converged. |
type(exit_code), | public, | parameter | :: | EXIT_MAX_SIM_TIME | = | exit_code(code=4, message="Requested maximum simulation time (knobs::max_sim_time) reached.") |
Type for exiting after reaching the specified simulation time |
type(exit_code), | public, | parameter | :: | EXIT_OUT_OF_TIME | = | exit_code(code=-1, message="GS2 internal time limit exceeded.") |
Type for exiting on running out of CPU time. |
type(exit_code), | public, | parameter | :: | EXIT_STOP_FILE | = | exit_code(code=-2, message="Stop file detected.") |
Type for exiting on detecting a stop file. |
type(exit_code), | public, | parameter | :: | EXIT_SMALL_TIMESTEP | = | exit_code(code=-3, message="Timestep is too small.") |
Type for exiting after detecting that the timestep is too small. |
type(exit_code), | public, | parameter | :: | EXIT_RAPID_TIMESTEP_CHANGE | = | exit_code(code=-4, message="Timestep is changing too rapidly.") |
Type for exiting after detecting that the timestep is changing too rapidly. |
Type providing an exit code and message text for exit reasons
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | private | :: | code | = | 0 |
A numeric exit code used to identify the exit reason. |
|
character(len=exit_string_len), | private | :: | message | = | "No exit reason specified. Code termination may be unexpected." |
A user friendly message explaining the exit reason. |
procedure , public , :: create_message Function | Construct the output message describing the exit reason and return as a string |
procedure , public , :: write_exit_file Subroutine | Ask for the exit reason output message and write to the exit_reason_unit |
procedure , public , :: is_identical Function | Ask if this instance is identical to another passed |
procedure , private :: code_matches_integer Function | Ask if this instance's code matches the passed value. This can
either be another |
procedure , private :: code_matches_instance Function | |
generic, public , :: code_matches => code_matches_integer, code_matches_instance |
Make a string containing the error code and exit reason. This is kept minimal to make it easier for tests to parse.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(exit_code), | intent(in) | :: | self |
Determines if a passed exit_code
instance is identical
to this instance.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(exit_code), | intent(in) | :: | self | |||
type(exit_code), | intent(in) | :: | other |
Determines if a passed exit_code
instance has the same code
as the passed integer.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(exit_code), | intent(in) | :: | self | |||
integer, | intent(in) | :: | code |
Write exit file containing exit code and message
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(exit_code), | intent(in) | :: | self |