public function tem_timeControl_triggered(me, now) result(hasTriggered)
Returns if the timeControl has triggered since last update.
This is true if now >= me%trigger and with in the bounds of min and max.
Please note that, to allow arbitrary settings of min and interval, this
routine might change the timeControl data given in me, by setting the
trigger to now, when min is reached for the first time.
This is required to allow independent time definitions for min, max and
interval.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Source Code
function tem_timeControl_triggered(me,now)result(hasTriggered)! -------------------------------------------------------------------- !!> Time control to check if it was triggered.type(tem_timeControl_type),intent(inout)::me!> Current time that is to be used as comparison for the trigger check.type(tem_time_type),intent(in)::now!> Result indicating if the time control has triggered.logical::hasTriggered! -------------------------------------------------------------------- !! -------------------------------------------------------------------- !hasTriggered=.false.! Time control intervals *only* are checked every check_iter iteration,! in between the intervals, the triggered status remains false.if(mod(now%iter,me%check_iter)==0)then! As long as the min was not reached yet, we need to do some extra checks,! to ensure that the trigger can be set correctly when min is reached for! first time.if(.not.me%min_reached)thenme%min_reached=tem_time_ge_trigger(now,me%min)! 'Now' has reached min, set the trigger accordingly for all those! entries that are relevant in the interval configuration.if(me%min_reached)thenme%trigger=tem_time_never()if(me%interval%sim<huge(me%interval%sim))thenme%trigger%sim=now%simend if if(me%interval%iter<huge(me%interval%iter))thenme%trigger%iter=now%iterend if if(me%interval%clock<huge(me%interval%clock))thenme%trigger%clock=now%clockend if end if end if if(me%min_reached.and.(.not.tem_time_gt_trigger(now,me%max)))thenhasTriggered=tem_time_ge_trigger(now,me%trigger)end if end if end function tem_timeControl_triggered