Go to the documentation of this file.
10 use mpi,
only : mpi_wtime
35 type(model_state_type),
target,
intent(inout) :: current_state
37 reporting_frequency=options_get_integer(current_state%options_database,
"display_synopsis_frequency")
48 type(model_state_type),
target,
intent(inout) :: current_state
50 double precision :: end_time
55 call log_log(log_info,
"Number of completed timesteps "//conv_to_string(current_state%timestep))
56 call log_log(log_info,
"Completed "//trim(conv_to_string((current_state%timestep-
previous_ts)+1))//&
57 " timesteps in "//trim(conv_to_string(int((end_time-
start_time) * 1000)))//
"ms")
58 call log_log(log_info,
"Model time "//trim(conv_to_string(current_state%time, 5))//
" seconds; dtm="//&
59 trim(conv_to_string(current_state%dtm, 5)))
68 type(model_state_type),
target,
intent(inout) :: current_state
70 if (log_is_master())
then
72 if (current_state%termination_reason == time_termination_reason)
then
73 call log_log(log_info,
"Model run complete due to model time "//&
74 trim(conv_to_string(current_state%time, 2))//
" exceeding limit of "//&
75 trim(conv_to_string(options_get_real(current_state%options_database,
"termination_time"), 2)))
76 else if (current_state%termination_reason == timestep_termination_reason)
then
77 call log_log(log_info,
"Model run complete due to timestep completion, model time is "//&
78 trim(conv_to_string(current_state%time, 2)))
79 else if (current_state%termination_reason == message_termination_reason)
then
80 call log_log(log_info,
"Model run complete due to messages file containing termination command, model time is "//&
81 trim(conv_to_string(current_state%time, 2)))
82 else if (current_state%termination_reason == walltime_termination_reason)
then
83 call log_log(log_info,
"Model run complete due to walltime limit of '"//&
84 trim(options_get_string(current_state%options_database,
"walltime_limit"))//
"' reached, model time is "//&
85 trim(conv_to_string(current_state%time, 2)))
87 call log_log(log_info,
"Model run complete due to unknown reason, model time is "//&
88 trim(conv_to_string(current_state%time, 2)))
Conversion between common inbuilt FORTRAN data types.
double precision start_time
subroutine initialisation_callback(current_state)
subroutine, public log_newline()
Will log a new line to the stdout.
integer, parameter, public timestep_termination_reason
integer function, public options_get_integer(options_database, key, index)
Retrieves an integer value from the database that matches the provided key.
integer, parameter, public log_info
Log INFO, WARNING and ERROR messages.
subroutine, public log_log(level, message, str)
Logs a message at the specified level. If the level is above the current level then the message is ig...
type(component_descriptor_type) function, public modelsynopsis_get_descriptor()
Provides a description of this component for the core to register.
Displays information about the current state_mod of the model run.
Interfaces and types that MONC components must specify.
character(len=string_length) function, public options_get_string(options_database, key, index)
Retrieves a string value from the database that matches the provided key.
integer reporting_frequency
Converts data types to strings.
The ModelState which represents the current state of a run.
integer, parameter, public time_termination_reason
The constants defining the reason why the model has terminated.
logical function, public log_is_master()
Determines whether the process is the master logging process. This might be preferable rather than ca...
integer, parameter, public walltime_termination_reason
Contains common definitions for the data and datatypes used by MONC.
subroutine timestep_callback(current_state)
Timestep callback hook which performs the halo swapping for each prognostic field.
subroutine finalisation_callback(current_state)
Called at the end of the MONC run, will log the reason why the model is terminating.
integer, parameter, public message_termination_reason
Manages the options database. Contains administration functions and deduce runtime options from the c...
Description of a component.
real(kind=default_precision) function, public options_get_real(options_database, key, index)
Retrieves a real value from the database that matches the provided key.
integer, parameter, public default_precision
MPI communication type which we use for the prognostic and calculation data.
The model state which represents the current state of a run.