Appearance
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
| 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. | |
dt_source | character(len=18) | Origin of dt: CFL (fields) or plasma_frequencies (PIC). | |
omega_dt | real(kind=R8P) | PIC: highest plasma frequency times dt (0: not a PIC run). |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
description | pass(self) | Return pretty-printed object description. |
is_done | pass(self) | Return true if the run has reached its end. |
load_from_file | pass(self) | Load config from file. |
initialize | pass(self) | Initialize time handler (dt = 1e-4 until the first compute_dt). |
is_on_cadence | pass(self) | Return true if the current step is a multiple of a cadence. |
is_to_save | pass(self) | Return true if data are to save. |
print_progress | pass(self) | Print simulation progress. |
prism_time_object%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
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(time_object) | in | Time 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
| 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
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_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 (T0 of the adim models). |
verbose | logical | in | optional | Trigger verbose output (default .true.). |
Call graph
print_progress
Print simulation progress.
fortran
subroutine print_progress(self, nodes_number)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_time_object) | in | Time handler. | |
nodes_number | integer(kind=I4P) | in | Nodes 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_time_object) | in | Time handler. | |
cadence | integer(kind=I4P) | in | Cadence 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_time_object) | in | Time handler. | |
cadence | integer(kind=I4P) | in | Save iterations frequency. |
Call graph