Go to the documentation of this file.
21 logical,
save ::
unique_per_dump, & !< Whether to make each model dump a unique filename
43 type(model_state_type),
target,
intent(inout) :: current_state
45 character(len=STRING_LENGTH) :: internal_write_mode
48 checkpoint_file=options_get_string(current_state%options_database,
"checkpoint_file")
49 unique_per_dump=options_get_logical(current_state%options_database,
"checkpoint_unique_per_dump")
50 internal_write_mode=options_get_string(current_state%options_database,
"checkpoint_internal_write")
51 if (trim(internal_write_mode) .eq.
"always")
then
53 else if (trim(internal_write_mode) .eq.
"never")
then
60 if (options_has_key(current_state%options_database,
"checkpoint"))
then
61 call read_checkpoint_file(current_state, options_get_string(current_state%options_database,
"checkpoint"))
68 type(model_state_type),
target,
intent(inout) :: current_state
78 type(model_state_type),
target,
intent(inout) :: current_state
87 type(model_state_type),
target,
intent(inout) :: current_state
89 character(len=STRING_LENGTH) :: unique_fn
90 real :: start_dump_time, end_dump_time
93 call cpu_time(start_dump_time)
96 call write_checkpoint_file(current_state, unique_fn)
101 call mpi_barrier(current_state%parallel%monc_communicator, ierr)
102 call cpu_time(end_dump_time)
103 call log_dump_stats(current_state, start_dump_time, end_dump_time)
111 type(model_state_type),
intent(inout) :: current_state
112 real :: start_time, end_time
114 call log_master_newline()
115 call log_master_log(log_info,
"Model dump completed in "//trim(conv_to_string(int((end_time-start_time)*1000)))//
"ms")
123 type(model_state_type),
intent(inout) :: current_state
124 character(len=STRING_LENGTH),
intent(out) :: new_name
129 if (dot_posn .gt. 0)
then
134 new_name=trim(new_name)//
"_"//trim(conv_to_string(current_state%timestep))
135 if (dot_posn .gt. 0)
then
Conversion between common inbuilt FORTRAN data types.
type(component_descriptor_type) function, public checkpointer_get_descriptor()
Provides registry information for the component.
subroutine, public read_checkpoint_file(current_state, filename)
Reads in a NetCDF checkpoint file and uses this to initialise the model.
subroutine timestep_callback(current_state)
The timestep hook will dump out model state_mod to a checkpoint file.
subroutine initialisation_callback(current_state)
Initialisation hook, if appropriate (depends on command line arguments) then will read in an existing...
character(len=string_length), save checkpoint_file
The checkpoint write file base name.
subroutine, public write_checkpoint_file(current_state, filename)
Will write out the current model state_mod into a NetCDF checkpoint file.
integer function, public options_get_integer(options_database, key, index)
Retrieves an integer value from the database that matches the provided key.
subroutine generate_unique_filename(current_state, new_name)
Generates a unique filename based upon the base one specified and the number of completed timesteps.
logical, save unique_per_dump
Whether to make each model dump a unique filename.
integer, parameter, public log_info
Log INFO, WARNING and ERROR messages.
subroutine log_dump_stats(current_state, start_time, end_time)
Will dump out the model dump statistics.
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.
subroutine perform_checkpoint_dump(current_state)
Performs the checkpoint dump and timings. This can be called as part of the timestep or at the end of...
logical function, public options_has_key(options_database, key)
Determines whether a specific key is in the database.
Checkpointing NetCDF functionality.
Converts data types to strings.
Writes out model state_mod to a checkpoint NetCDF file.
The ModelState which represents the current state of a run.
logical function, public options_get_logical(options_database, key, index)
Retrieves a logical value from the database that matches the provided key.
integer, save checkpoint_frequency
subroutine, public log_master_newline()
The master process will log a new line to stdio.
Contains common definitions for the data and datatypes used by MONC.
integer, parameter, public string_length
Default length of strings.
subroutine, public log_master_log(level, message)
Will log just from the master process.
logical, save enable_write
subroutine finalisation_callback(current_state)
Called on termination to write out the status of the model run to checkpoint.
Will read in a NetCDF checkpoint file and initialise the model state_mod based upon this.
Manages the options database. Contains administration functions and deduce runtime options from the c...
Description of a component.
The model state which represents the current state of a run.