update_simulation_clock Subroutine

public subroutine update_simulation_clock(delta_t, scheme, dims)

Update the simulation clock

It is sometimes useful to know what the simulation time is at every iteration so that a comparison with an analytical solution is possible. Since, the global timesteps used may not be uniform, we need to track this explicitly.

Of course, it makes sense to track this only if the time stepping is global and not local. If the time stepping is local, the simulation clock is set to -1. If it is global it is incremented according to the time step found.

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(1:dims%imx-1, 1:dims%jmx-1, 1:dims%kmx-1):: delta_t

Local time increment value at each cell center

type(schemetype), intent(in) :: scheme

finite-volume Schemes: time stepping methods

type(extent), intent(in) :: dims

Extent of the domain:imx,jmx,kmx


Called by

proc~~update_simulation_clock~~CalledByGraph proc~update_simulation_clock update_simulation_clock proc~compute_time_step compute_time_step proc~compute_time_step->proc~update_simulation_clock proc~get_next_solution get_next_solution proc~get_next_solution->proc~compute_time_step proc~iterate_one_more_time_step iterate_one_more_time_step proc~iterate_one_more_time_step->proc~get_next_solution program~main main program~main->proc~iterate_one_more_time_step

Contents


Source Code

      subroutine update_simulation_clock(delta_t, scheme, dims)
          !<  Update the simulation clock
          !< 
          !<  It is sometimes useful to know what the simulation time is
          !<  at every iteration so that a comparison with an analytical
          !<  solution is possible. Since, the global timesteps used may
          !<  not be uniform, we need to track this explicitly.
          !< 
          !<  Of course, it makes sense to track this only if the time 
          !<  stepping is global and not local. If the time stepping is
          !<  local, the simulation clock is set to -1. If it is global
          !<  it is incremented according to the time step found.
          !-----------------------------------------------------------

          implicit none
          type(extent), intent(in) :: dims
          !< Extent of the domain:imx,jmx,kmx
          type(schemetype), intent(in) :: scheme
          !< finite-volume Schemes: time stepping methods
          real(wp) , dimension(1:dims%imx-1, 1:dims%jmx-1, 1:dims%kmx-1), intent(in) :: delta_t
          !< Local time increment value at each cell center
          if (scheme%time_stepping_method .eq. 'g' .and. sim_clock >= 0.) then
              sim_clock = sim_clock + minval(delta_t)
          else if (scheme%time_stepping_method .eq. 'l') then
              sim_clock = -1
          end if

      end subroutine update_simulation_clock