Skip to content

adam_prism_time_object ​

ADAM, PRISM time handler class definition.

The library time handler (adam_time_object, issue #80 P3) plus what PRISM needs: the origin of the time step and the plasma-frequency bound of a PIC run (printed with the progress), the initial dt of 1e-4, the cadence predicate and a save predicate that also saves at it == it_max. The adimensional models pass time_unit = T0.

Source: src/app/prism/common/adam_prism_time_object.F90

Dependencies

Contents ​

Derived Types ​

prism_time_object ​

PRISM time handler class definition.

Inheritance

Extends: time_object

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.
dt_sourcecharacter(len=18)Origin of dt: CFL (fields) or plasma_frequencies (PIC).
omega_dtreal(kind=R8P)PIC: highest plasma frequency times dt (0: not a PIC run).

Type-Bound Procedures

NameAttributesDescription
descriptionpass(self)Return pretty-printed object description.
is_donepass(self)Return true if the run has reached its end.
load_from_filepass(self)Load config from file.
initializepass(self)Initialize time handler (dt = 1e-4 until the first compute_dt).
is_on_cadencepass(self)Return true if the current step is a multiple of a cadence.
is_to_savepass(self)Return true if data are to save.
print_progresspass(self)Print simulation progress.

prism_time_object%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

prism_time_object%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

prism_time_object%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

Subroutines ​

initialize ​

Initialize time handler: the library [time] keys, and dt = 1e-4 until the first compute_dt.

fortran
subroutine initialize(self, file_parameters, time_unit, verbose)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_time_object)inoutTime handler.
file_parameterstype(file_ini)inSimulation parameters ini file handler.
time_unitreal(kind=R8P)inoptionalUnit of a scaled time (T0 of the adim models).
verboselogicalinoptionalTrigger verbose output (default .true.).

Call graph

Print simulation progress.

fortran
subroutine print_progress(self, nodes_number)

Arguments

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

Call graph

Functions ​

is_on_cadence ​

Return true if the current step is a multiple of cadence.

A non-positive cadence is never on cadence: it disables the output it drives and never reaches mod(it, 0) (issue #97). The test is nested, not cadence > 0 .and. mod(...), because Fortran does not short-circuit.

Attributes: pure

Returns: logical

fortran
function is_on_cadence(self, cadence)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_time_object)inTime handler.
cadenceinteger(kind=I4P)inCadence in time steps.

Call graph

is_to_save ​

Return true if data are to save: every cadence steps, at it == it_max and at the end of the run.

A non-positive cadence disables saving, end of run included (as FLUME, issue #97).

Returns: logical

fortran
function is_to_save(self, cadence) result(is_to)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_time_object)inTime handler.
cadenceinteger(kind=I4P)inSave iterations frequency.

Call graph