Time management utility
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | public | :: | dt |
Timestep |
|||
| logical, | public | :: | finish | = | .false. |
Instructs simulation to end |
|
| real(kind=wp), | public | :: | freq_output | = | huge(1.0_wp) | ||
| real(kind=wp), | public | :: | freq_write | = | huge(1.0_wp) |
Frequency of restart writes |
|
| integer, | public | :: | iter | = | 0 |
Current iteration |
|
| integer, | public | :: | iter_max | = | huge(1) |
Maximum iterations |
|
| real(kind=wp), | public | :: | itertime |
Wall clock time at beginning of iteration (in seconds) |
|||
| real(kind=wp), | public | :: | lasttime |
Wall clock time at last update (in seconds) |
|||
| type(parallel_obj), | public, | pointer | :: | parallel |
Parallel object |
||
| type(parser_obj), | public, | pointer | :: | parser |
Parser object |
||
| real(kind=wp), | public | :: | starttime |
Wall clock time at initialization (in seconds) |
|||
| real(kind=wp), | public | :: | time | = | 0.0_wp |
Time at the n-th timestep |
|
| real(kind=wp), | public | :: | time_max | = | huge(1.0_wp) |
Maximum simulation time |
|
| real(kind=wp), | public | :: | time_wall | = | huge(1.0_wp) |
Wall time (in hours) |
|
| real(kind=wp), | public, | allocatable | :: | timing(:) |
Timing array |
||
| type(hashtbl_obj), | private | :: | tbl |
Hash table for timing info |
Adds timing info.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(timer_obj), | intent(inout) | :: | this |
Timer |
||
| character(len=*), | intent(in) | :: | name |
Name of timing data |
Determines whether simulation is over.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(timer_obj), | intent(inout) | :: | this |
Timer |
Result
Changes run status to finished.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(timer_obj), | intent(inout) | :: | this |
Timer |
Finalizes and frees memomry.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(timer_obj), | intent(inout) | :: | this |
Timer |
Returns timing information for data given by name.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(timer_obj), | intent(in) | :: | this |
Timer |
||
| character(len=*), | intent(in) | :: | name |
Name of timing data |
Timing
Initializes the timer.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(timer_obj), | intent(inout) | :: | this |
Timer |
||
| type(parallel_obj), | intent(in), | target | :: | parallel |
Parallel structure to link with |
|
| type(parser_obj), | intent(in), | target | :: | parser |
Input file parsing tool |
Moves timer from n to n+1
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(timer_obj), | intent(inout) | :: | this |
Timer |
Determine whether it is time to write visualization files.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(timer_obj), | intent(in) | :: | this |
Timer |
Result
Determine whether it is time to write restart files.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(timer_obj), | intent(in) | :: | this |
Timer |
Result
Updates timing info with elapsed time since beginning of current iteration.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(timer_obj), | intent(inout) | :: | this |
Timer |
||
| character(len=*), | intent(in) | :: | name |
Name of timing data |
type :: timer_obj !> Time management utility type(parallel_obj),pointer :: parallel !! Parallel object type(parser_obj), pointer :: parser !! Parser object real(wp) :: starttime !! Wall clock time at initialization (in seconds) real(wp) :: itertime !! Wall clock time at beginning of iteration (in seconds) real(wp) :: lasttime !! Wall clock time at last update (in seconds) real(wp) :: dt !! Timestep real(wp) :: time = 0.0_wp !! Time at the n-th timestep real(wp) :: time_max = huge(1.0_wp) !! Maximum simulation time real(wp) :: time_wall = huge(1.0_wp) !! Wall time (in hours) real(wp) :: freq_write = huge(1.0_wp) !! Frequency of restart writes real(wp) :: freq_output = huge(1.0_wp) integer :: iter = 0 !! Current iteration integer :: iter_max = huge(1) !! Maximum iterations logical :: finish = .false. !! Instructs simulation to end real(wp), allocatable :: timing(:) !! Timing array type(hashtbl_obj), private :: tbl !! Hash table for timing info contains procedure :: Initialize => timer_obj_Init procedure :: Finalize => timer_obj_Final procedure :: StepForward => timer_obj_StepForward procedure :: Done => timer_obj_Done procedure :: EndRun => timer_obj_EndRun procedure :: TimeToWriteRestartData => timer_obj_TimeToWriteRestartData procedure :: TimeToWriteOutputData => timer_obj_TimeToWriteOutputData procedure :: AddTiming => timer_obj_AddTiming procedure :: UpdateTiming => timer_obj_UpdateTiming procedure :: GetTiming => timer_obj_GetTiming end type timer_obj