# tem_timeControl_type Derived Type

## type, public :: tem_timeControl_type

Definition of a time control.

The control is active in the range of time between min and max. It will trigger its action after a time interval specified in interval. For all time definitions always the one that occurs first is being used.

## Components

TypeVisibility AttributesNameInitial
type(tem_time_type), public :: min

Minimal point in time, from where on, this control should be active. Whichever time definition happens first will be used.

type(tem_time_type), public :: max

Maximal point in time, after which the control should not be active anymore. Whichever time definition happens first will be used.

type(tem_time_type), public :: interval

A regular interval at which an action should be triggered between min and max.

type(tem_time_type), public :: trigger

Keep track of the next point in time, at which an action should be triggered by this control.

integer, public :: check_iter =1

Trigger checking can involve communication and is potentially hurting the performance.

With this setting, the iteration interval at which these trigger updates should be done, can be controlled. Per default each iteration a check is done, but if this is too frequent, it can be increased here. However, it should be noted, that all trigger checks are only done every check_iter iteration.

logical, public :: needs_reduce

Flag to indicate if this control object needs a MPI_reduce to determine trigger status.

logical, public :: min_reached =.false.

Flag that indicates whether the minimal point in time specified in min has already been reached.

### Source Code

  type tem_timeControl_type
!> Minimal point in time, from where on, this control should be active.
!! Whichever time definition happens first will be used.
type(tem_time_type) :: min

!> Maximal point in time, after which the control should not be active
!! anymore. Whichever time definition happens first will be used.
type(tem_time_type) :: max

!> A regular interval at which an action should be triggered between
!! min and max.
type(tem_time_type) :: interval

!> Keep track of the next point in time, at which an action should be
!! triggered by this control.
type(tem_time_type) :: trigger

!> Trigger checking can involve communication and is potentially hurting
!! the performance.
!!
!! With this setting, the iteration interval at which these trigger
!! updates should be done, can be controlled.
!! Per default each iteration a check is done, but if this is too
!! frequent, it can be increased here.
!! However, it should be noted, that all trigger checks are only done
!! every check_iter iteration.
integer :: check_iter = 1

!> Flag to indicate if this control object needs a MPI_reduce to determine
!! trigger status.
logical :: needs_reduce

!> Flag that indicates whether the minimal point in time specified in min