tem_time_module Module

The module contains the time definition of treelm.

It is useful to describe the progress in time of an explicit solver with respect to different measurements. Currently accounted are:

  • iterations (iter)
  • simulation time (sim)
  • running time (clock)

Thus, the time definition takes the following general form:

  {sim = 1.0, iter = 12, clock = 60.0}

Any of these definitions may be left out. If the time definition is not a table the given value is interpreted as simultion time, equivalent to

 {sim = 1.0}

For the handling of time evolution in an explicit solver, a time definition is needed to keep track of the current time. This should be initialized with tem_time_reset, and then advanced in each iteration by tem_time_advance. Time definitions in relation to this main time evolution object can then be defined in the Lua configuration by tem_time_load. For an explicit time stepping solver this would at least require one definition of time, when to stop the simulation. A comparison of such points in time to the current time can be done by tem_time_ge_trigger.


Uses

  • module~~tem_time_module~~UsesGraph module~tem_time_module tem_time_module mpi mpi module~tem_time_module->mpi module~env_module env_module module~tem_time_module->module~env_module module~aot_table_module aot_table_module module~tem_time_module->module~aot_table_module module~aotus_module aotus_module module~tem_time_module->module~aotus_module module~aot_out_module aot_out_module module~tem_time_module->module~aot_out_module module~env_module->mpi module~env_module->module~aotus_module module~flu_binding flu_binding module~env_module->module~flu_binding iso_fortran_env iso_fortran_env module~env_module->iso_fortran_env

Used by

  • module~~tem_time_module~~UsedByGraph module~tem_time_module tem_time_module program~tem_varsys_statevar_test tem_varSys_stateVar_test program~tem_varsys_statevar_test->module~tem_time_module program~tem_varsys_derivevar_test tem_varSys_deriveVar_test program~tem_varsys_derivevar_test->module~tem_time_module module~tem_spacetime_var_module tem_spacetime_var_module module~tem_spacetime_var_module->module~tem_time_module module~hvs_vtk_module hvs_vtk_module module~hvs_vtk_module->module~tem_time_module module~tem_stlb_io_module tem_stlb_io_module module~tem_stlb_io_module->module~tem_time_module module~tem_logical_operation_var_module tem_logical_operation_var_module module~tem_logical_operation_var_module->module~tem_time_module module~hvs_ascii_module hvs_ascii_module module~hvs_ascii_module->module~tem_time_module module~tem_reduction_transient_module tem_reduction_transient_module module~tem_reduction_transient_module->module~tem_time_module program~tem_varsys_test tem_varSys_test program~tem_varsys_test->module~tem_time_module module~tem_surfacedata_module tem_surfaceData_module module~tem_surfacedata_module->module~tem_time_module module~tem_restart_module tem_restart_module module~tem_restart_module->module~tem_time_module module~hvs_output_module hvs_output_module module~hvs_output_module->module~tem_time_module module~tem_varsys_module tem_varSys_module module~tem_varsys_module->module~tem_time_module module~tem_tracking_module tem_tracking_module module~tem_tracking_module->module~tem_time_module module~tem_simcontrol_module tem_simControl_module module~tem_simcontrol_module->module~tem_time_module module~tem_convergence_module tem_convergence_module module~tem_convergence_module->module~tem_time_module module~tem_meshinfo_module tem_meshInfo_module module~tem_meshinfo_module->module~tem_time_module module~tem_temporal_module tem_temporal_module module~tem_temporal_module->module~tem_time_module module~tem_spacetime_fun_module tem_spacetime_fun_module module~tem_spacetime_fun_module->module~tem_time_module program~tem_varsys_stfunvar_test tem_varSys_stfunVar_test program~tem_varsys_stfunvar_test->module~tem_time_module module~hvs_vtk_module~2 hvs_vtk_module module~hvs_vtk_module~2->module~tem_time_module module~tem_timecontrol_module tem_timeControl_module module~tem_timecontrol_module->module~tem_time_module module~tem_balance_module tem_balance_module module~tem_balance_module->module~tem_time_module module~tem_operation_var_module tem_operation_var_module module~tem_operation_var_module->module~tem_time_module program~tem_varsys_opvar_test tem_varSys_opVar_test program~tem_varsys_opvar_test->module~tem_time_module

Contents


Variables

TypeVisibilityAttributesNameInitial
integer, public, parameter:: tem_time_n_ids =3

Number of available different time definitions.

integer, public, parameter:: tem_time_sim_id =1

Index for the simulation time.

integer, public, parameter:: tem_time_iter_id =2

Index for the number of iterations.

integer, public, parameter:: tem_time_clock_id =3

Index for the clock time.


Interfaces

public interface operator(+)

  • private elemental function tem_time_add_time(left, right) result(res)

    Add two time definitions to each other (provides the plus operator).

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    type(tem_time_type), intent(in) :: left

    First operant in the addition of times.

    type(tem_time_type), intent(in) :: right

    Second operant in the addition of times.

    Return Value type(tem_time_type)

    Resulting sum of left and right.

public interface operator(-)

  • private elemental function tem_time_subtract_time(left, right) result(res)

    Subtract right time definition from left (provides the minus operator).

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    type(tem_time_type), intent(in) :: left

    First operant in the addition of times.

    type(tem_time_type), intent(in) :: right

    Second operant in the addition of times.

    Return Value type(tem_time_type)

    Resulting sum of left and right.

public interface max

  • private elemental function tem_time_max(left, right) result(res)

    Get the maximum of two time definitions.

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    type(tem_time_type), intent(in) :: left

    First time operant to compare.

    type(tem_time_type), intent(in) :: right

    Second time operant to compare.

    Return Value type(tem_time_type)

    Resulting maximum time of left and right.


Derived Types

type, public :: tem_time_type

Description of time

Read more…

Components

TypeVisibilityAttributesNameInitial
integer, private :: iter

Time in iterations.

real(kind=rk), private :: sim

Time in terms of simulated time.

real(kind=rk), private :: clock

Time passed in seconds of running time.

real(kind=rk), private :: clock_start

Wtime of the last reset.


Functions

public pure function tem_time_default_zero(time, dependency) result(zeroed)

Function to find a default for time, if it is not defined already.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(tem_time_type), intent(in) :: time

The time to find a default 0 for, if not define, but dependency is.

type(tem_time_type), intent(in) :: dependency

A time definition where we set a 0 default in time for, if the corresponding component is defined, but the time component is not.

Return Value type(tem_time_type)

Resulting time, with zeroed components where dependency is defined, but time not.

public pure function tem_time_ge_each(time, trigger) result(ge)

Return the (>=) comparison of each time measurement between the two arguments.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(tem_time_type), intent(in) :: time

A fully defined time definition (all components should have meaningful settings).

type(tem_time_type), intent(in) :: trigger

A comparison time definition, where some entries might be set to never. If any of the time components is larger, the result will be true.

Return Value logical(tem_time_n_ids)

Result of the comparison for each of the time specifications.

public elemental function tem_time_ge_trigger(time, trigger) result(ge)

Compare (>=) a complete time defintion against a trigger.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(tem_time_type), intent(in) :: time

A fully defined time definition (all components should have meaningful settings).

type(tem_time_type), intent(in) :: trigger

A comparison time definition, where some entries might be set to never. If any of the time components is larger, the result will be true.

Return Value logical

Result of the comparison, true if any of the time specifications in time is larger or equal to the ones in trigger.

public elemental function tem_time_gt_trigger(time, trigger) result(gt)

Compare (>) a complete time defintion against a trigger.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(tem_time_type), intent(in) :: time

A fully defined time definition (all components should have meaningful settings).

type(tem_time_type), intent(in) :: trigger

A comparison time definition, where some entries might be set to never. If any of the time components is larger, the result will be true.

Return Value logical

Result of the comparison, true if any of the time specifications in time is larger or equal to the ones in trigger.

public elemental function tem_time_last_interval(now, interval) result(last)

Returns the last full interval before now.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(tem_time_type), intent(in) :: now
type(tem_time_type), intent(in) :: interval

Return Value type(tem_time_type)

public function tem_time_never()

Representation of a point in time, that should never happen.

Arguments

None

Return Value type(tem_time_type)

A time that represents never in all definitions.

public elemental function tem_time_needs_reduce(me) result(needs_reduce)

This function returns, if the given time definition requires a reduction operation if used as a trigger.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(tem_time_type), intent(in) :: me

Time definition to check of its need of a reduction.

Return Value logical

Flag indicating, if this time setting requires a reduction.

public pure function tem_time_isDefined(me) result(isDefined)

This function returns true if tem_time_type is defined either as iter, sim or clock.

Arguments

TypeIntentOptionalAttributesName
type(tem_time_type), intent(in) :: me

Return Value logical

public function tem_time_sim_stamp(time) result(timeStamp)

Generate a time stamp from the simulation time in the given time definition.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(tem_time_type), intent(in) :: time

Time definition to create the stamp off.

Return Value character(len=12)

String representation of the given simulation time.

public function tem_time_iter_stamp(time) result(timeStamp)

Generate a time stamp from the iteration in the given time definition.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(tem_time_type), intent(in) :: time

Time definition to create the stamp off.

Return Value character(len=labelLen)

String representation of the given simulation time.

private elemental function tem_time_add_time(left, right) result(res)

Add two time definitions to each other (provides the plus operator).

Read more…

Arguments

TypeIntentOptionalAttributesName
type(tem_time_type), intent(in) :: left

First operant in the addition of times.

type(tem_time_type), intent(in) :: right

Second operant in the addition of times.

Return Value type(tem_time_type)

Resulting sum of left and right.

private elemental function tem_time_subtract_time(left, right) result(res)

Subtract right time definition from left (provides the minus operator).

Read more…

Arguments

TypeIntentOptionalAttributesName
type(tem_time_type), intent(in) :: left

First operant in the addition of times.

type(tem_time_type), intent(in) :: right

Second operant in the addition of times.

Return Value type(tem_time_type)

Resulting sum of left and right.

private elemental function tem_time_max(left, right) result(res)

Get the maximum of two time definitions.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(tem_time_type), intent(in) :: left

First time operant to compare.

type(tem_time_type), intent(in) :: right

Second time operant to compare.

Return Value type(tem_time_type)

Resulting maximum time of left and right.


Subroutines

public subroutine tem_time_load(me, conf, key, parent, clock_start)

Reading a time description from a Lua script given by conf.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(tem_time_type), intent(out) :: me

Time to be read from the Lua script

type(flu_state), intent(inout) :: conf

Handle to the Lua script.

character(len=*), intent(in), optional :: key

Name of the table containing the time definition. Default: 'time'.

integer, intent(in), optional :: parent

Handle to the parent table.

real(kind=rk), intent(in), optional :: clock_start

Reference MPI_Wtime mark to use for computation of wallclock

This is basically only useful to update the time object for a read in restart without distorting the clock measurement.

public subroutine tem_time_out(me, conf, key)

Write the time into a Lua table

Read more…

Arguments

TypeIntentOptionalAttributesName
type(tem_time_type), intent(in) :: me

The time descritpion to write out as Lua table.

type(aot_out_type), intent(inout) :: conf

Output handle for the script to write to.

character(len=*), intent(in), optional :: key

Name for the tabel to write this time description to.

public subroutine tem_time_dump(me, outUnit)

Dump the given time to outUnit.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(tem_time_type), intent(inout) :: me

The time that should be written to outunit.

integer, intent(in) :: outUnit

The unit to write to.

public subroutine tem_time_reset(me)

Reset the time definition.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(tem_time_type), intent(out) :: me

Time type to reset

public subroutine tem_time_set_clock(me)

Update the clock measurement in the time description.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(tem_time_type), intent(inout) :: me

Time setting to update.

public subroutine tem_time_advance(me, sim_dt, iter)

Advance the time definition.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(tem_time_type), intent(inout) :: me

Time definition to advance

real(kind=rk) :: sim_dt

Increment in simulation time to add

integer, optional :: iter

If the number of iterations should not be increased by one, this optional parameter can be used to define the increment for the iterations. Default: 1.