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)))
integer, parameter, public message_termination_reason
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.
Displays information about the current state_mod of the model run.
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, parameter, public default_precision
MPI communication type which we use for the prognostic and calculation data.
Contains common definitions for the data and datatypes used by MONC.
The ModelState which represents the current state of a run.
Conversion between common inbuilt FORTRAN data types.
Converts data types to strings.
Description of a component.
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...
integer, parameter, public timestep_termination_reason
subroutine initialisation_callback(current_state)
Interfaces and types that MONC components must specify.
type(component_descriptor_type) function, public modelsynopsis_get_descriptor()
Provides a description of this component for the core to register.
double precision start_time
integer, parameter, public time_termination_reason
The constants defining the reason why the model has terminated.
integer reporting_frequency
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.
logical function, public log_is_master()
Determines whether the process is the master logging process. This might be preferable rather than ca...
integer function, public options_get_integer(options_database, key, index)
Retrieves an integer value from the database that matches the provided key.
Manages the options database. Contains administration functions and deduce runtime options from the c...
integer, parameter, public log_info
Log INFO, WARNING and ERROR messages.
integer, parameter, public walltime_termination_reason
subroutine, public log_newline()
Will log a new line to the stdout.
The model state which represents the current state of a run.