Appearance
adam_time_object
ADAM, time handler class definition: the step counter, the time, the time step and the
[time]limits.
The state every application integrates in time and the keys of the [time] section, it_max, time_max and CFL, all required (issue #80 P3: FLUME, PRISM and RIPPLE each carried a copy). An application extends it with its own state and overrides the predicates whose semantics it needs (PRISM's is_to_save also saves at it == it_max). time_unit divides time_max for a model that integrates in a scaled time (PRISM's adimensional models).
Source: src/lib/common/adam_time_object.F90
Dependencies
Contents
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
INI_SECTION_NAME | character(len=4) | parameter | INI (config) file section name containing time configs. |
Derived Types
time_object
Time handler class definition.
Inheritance
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
it_max | integer(kind=I4P) | Maximum number of integration time steps (<= 0: time-driven run). | |
time_max | real(kind=R8P) | Maximum integration time. | |
CFL | real(kind=R8P) | CFL number. | |
it | integer(kind=I4P) | Time steps counter. | |
time | real(kind=R8P) | Time. | |
dt | real(kind=R8P) | Time step. |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
description | pass(self) | Return pretty-printed object description. |
initialize | pass(self) | Initialize time handler. |
is_done | pass(self) | Return true if the run has reached its end. |
is_to_save | pass(self) | Return true if the current step is a save step. |
load_from_file | pass(self) | Load config from file. |
print_progress | pass(self) | Print simulation progress. |
Subroutines
initialize
Initialize time handler: load the [time] keys; time_unit (if present) divides time_max.
fortran
subroutine initialize(self, file_parameters, time_unit, verbose)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(time_object) | inout | Time handler. | |
file_parameters | type(file_ini) | in | Simulation parameters ini file handler. | |
time_unit | real(kind=R8P) | in | optional | Unit of a scaled time: time_max/time_unit is used. |
verbose | logical | in | optional | Trigger verbose output (default .true.). |
Call graph
load_from_file
Load config from file; every key is required.
fortran
subroutine load_from_file(self, file_parameters)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(time_object) | inout | Time handler. | |
file_parameters | type(file_ini) | in | Simulation parameters ini file handler. |
Call graph
print_progress
Print simulation progress.
fortran
subroutine print_progress(self, nodes_number)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(time_object) | in | Time handler. | |
nodes_number | integer(kind=I4P) | in | Nodes number, global blocks number. |
Call graph
Functions
description
Return a pretty-formatted object description.
Returns: character(len=:)
fortran
function description(self) result(desc)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(time_object) | in | Time handler. |
Call graph
is_done
Return true if the run has reached its end: it_max steps (iteration-driven) or time_max (time-driven).
Returns: logical
fortran
function is_done(self) result(done)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(time_object) | in | Time handler. |
Call graph
is_to_save
Return true if the current step is a save step: every cadence steps and at the end of the run.
A non-positive cadence disables saving (it never reaches mod(it, 0)). Every save site uses this predicate only, so the gate and the write cannot disagree.
Returns: logical
fortran
function is_to_save(self, cadence) result(is_to)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(time_object) | in | Time handler. | |
cadence | integer(kind=I4P) | in | Save cadence in time steps. |
Call graph