Update time.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(time_object), | intent(inout) | :: | self | Time object. |
||
| real(kind=R8P), | intent(inout) | :: | global_min_dt | Global (all processes/images, all blocks) minimum time step. |
elemental subroutine update(self, global_min_dt)
!< Update time.
class(time_object), intent(inout) :: self !< Time object.
real(R8P), intent(inout) :: global_min_dt !< Global (all processes/images, all blocks) minimum time step.
if (self%is_unsteady) then
! for an unsteady accurate simulation each cell is updated by means of global minimum time step
! control for the last iterate
if (self%n_max <= 0) then
if ((self%t + global_min_dt) > self%t_max) then
! the global minimum time step is so high that the last iteration will go over t_max
! it is decreased in order to achieve exactly t_max
global_min_dt = abs(self%t_max - self%t)
endif
endif
self%t = self%t + global_min_dt
endif
endsubroutine update