Skip to content

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 ​

NameTypeAttributesDescription
INI_SECTION_NAMEcharacter(len=4)parameterINI (config) file section name containing time configs.

Derived Types ​

time_object ​

Time handler class definition.

Inheritance

Components

NameTypeAttributesDescription
it_maxinteger(kind=I4P)Maximum number of integration time steps (<= 0: time-driven run).
time_maxreal(kind=R8P)Maximum integration time.
CFLreal(kind=R8P)CFL number.
itinteger(kind=I4P)Time steps counter.
timereal(kind=R8P)Time.
dtreal(kind=R8P)Time step.

Type-Bound Procedures

NameAttributesDescription
descriptionpass(self)Return pretty-printed object description.
initializepass(self)Initialize time handler.
is_donepass(self)Return true if the run has reached its end.
is_to_savepass(self)Return true if the current step is a save step.
load_from_filepass(self)Load config from file.
print_progresspass(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

NameTypeIntentAttributesDescription
selfclass(time_object)inoutTime handler.
file_parameterstype(file_ini)inSimulation parameters ini file handler.
time_unitreal(kind=R8P)inoptionalUnit of a scaled time: time_max/time_unit is used.
verboselogicalinoptionalTrigger 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

NameTypeIntentAttributesDescription
selfclass(time_object)inoutTime handler.
file_parameterstype(file_ini)inSimulation parameters ini file handler.

Call graph

Print simulation progress.

fortran
subroutine print_progress(self, nodes_number)

Arguments

NameTypeIntentAttributesDescription
selfclass(time_object)inTime handler.
nodes_numberinteger(kind=I4P)inNodes number, global blocks number.

Call graph

Functions ​

description ​

Return a pretty-formatted object description.

Returns: character(len=:)

fortran
function description(self) result(desc)

Arguments

NameTypeIntentAttributesDescription
selfclass(time_object)inTime 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

NameTypeIntentAttributesDescription
selfclass(time_object)inTime 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

NameTypeIntentAttributesDescription
selfclass(time_object)inTime handler.
cadenceinteger(kind=I4P)inSave cadence in time steps.

Call graph