MONC
Functions/Subroutines | Variables
modelsynopsis_mod Module Reference

Displays information about the current state_mod of the model run. More...

Functions/Subroutines

type(component_descriptor_type) function, public modelsynopsis_get_descriptor ()
 Provides a description of this component for the core to register. More...
 
subroutine initialisation_callback (current_state)
 
subroutine timestep_callback (current_state)
 Timestep callback hook which performs the halo swapping for each prognostic field. More...
 
subroutine finalisation_callback (current_state)
 Called at the end of the MONC run, will log the reason why the model is terminating. More...
 

Variables

integer previous_ts
 
integer reporting_frequency
 
double precision start_time
 

Detailed Description

Displays information about the current state_mod of the model run.

Function/Subroutine Documentation

◆ finalisation_callback()

subroutine modelsynopsis_mod::finalisation_callback ( type(model_state_type), intent(inout), target  current_state)
private

Called at the end of the MONC run, will log the reason why the model is terminating.

Parameters
current_stateThe current model state

Definition at line 67 of file modelsynopsis.F90.

68  type(model_state_type), target, intent(inout) :: current_state
69 
70  if (log_is_master()) then
71  call log_newline()
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)))
86  else
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)))
89  end if
90  end if
Here is the caller graph for this function:

◆ initialisation_callback()

subroutine modelsynopsis_mod::initialisation_callback ( type(model_state_type), intent(inout), target  current_state)
private

Definition at line 34 of file modelsynopsis.F90.

35  type(model_state_type), target, intent(inout) :: current_state
36 
37  reporting_frequency=options_get_integer(current_state%options_database, "display_synopsis_frequency")
38  previous_ts=current_state%timestep
39  start_time=mpi_wtime()
Here is the caller graph for this function:

◆ modelsynopsis_get_descriptor()

type(component_descriptor_type) function, public modelsynopsis_mod::modelsynopsis_get_descriptor

Provides a description of this component for the core to register.

Returns
The descriptor containing registration information for this component

Definition at line 26 of file modelsynopsis.F90.

27  modelsynopsis_get_descriptor%name="model_synopsis"
28  modelsynopsis_get_descriptor%version=0.1
29  modelsynopsis_get_descriptor%initialisation=>initialisation_callback
30  modelsynopsis_get_descriptor%timestep=>timestep_callback
31  modelsynopsis_get_descriptor%finalisation=>finalisation_callback
Here is the call graph for this function:

◆ timestep_callback()

subroutine modelsynopsis_mod::timestep_callback ( type(model_state_type), intent(inout), target  current_state)
private

Timestep callback hook which performs the halo swapping for each prognostic field.

In parallel this is performed with MPI communication calls and wrapping around. In serial still need to wrap data around

Parameters
current_stateThe current model state_mod

Definition at line 47 of file modelsynopsis.F90.

48  type(model_state_type), target, intent(inout) :: current_state
49 
50  double precision :: end_time
51 
52  if (mod(current_state%timestep, reporting_frequency)==0 .and. log_is_master()) then
53  end_time=mpi_wtime()
54  call log_newline()
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)))
60  previous_ts=current_state%timestep
61  start_time=mpi_wtime()
62  end if
Here is the caller graph for this function:

Variable Documentation

◆ previous_ts

integer modelsynopsis_mod::previous_ts
private

Definition at line 17 of file modelsynopsis.F90.

17  integer :: previous_ts, reporting_frequency

◆ reporting_frequency

integer modelsynopsis_mod::reporting_frequency
private

Definition at line 17 of file modelsynopsis.F90.

◆ start_time

double precision modelsynopsis_mod::start_time
private

Definition at line 18 of file modelsynopsis.F90.

18  double precision :: start_time
optionsdatabase_mod::options_get_integer
integer function, public options_get_integer(options_database, key, index)
Retrieves an integer value from the database that matches the provided key.
Definition: optionsdatabase.F90:217
logging_mod::log_info
integer, parameter, public log_info
Log INFO, WARNING and ERROR messages.
Definition: logging.F90:13
logging_mod::log_log
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...
Definition: logging.F90:75
optionsdatabase_mod::options_get_string
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.
Definition: optionsdatabase.F90:280
optionsdatabase_mod::options_get_real
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.
Definition: optionsdatabase.F90:91