Integrate field with explicit SSP Runge-Kutta scheme.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrator_runge_kutta_ssp), | intent(inout) | :: | self | Integrator. |
||
class(integrand_object), | intent(inout) | :: | U | Field to be integrated. |
||
real(kind=R_P), | intent(in) | :: | Dt | Time step. |
||
real(kind=R_P), | intent(in) | :: | t | Time. |
||
real(kind=R_P), | intent(out), | optional | :: | new_Dt | New adapted time step. |
subroutine integrate(self, U, Dt, t, new_Dt)
!< Integrate field with explicit SSP Runge-Kutta scheme.
class(integrator_runge_kutta_ssp), intent(inout) :: self !< Integrator.
class(integrand_object), intent(inout) :: U !< Field to be integrated.
real(R_P), intent(in) :: Dt !< Time step.
real(R_P), intent(in) :: t !< Time.
real(R_P), optional, intent(out) :: new_Dt !< New adapted time step.
integer(I_P) :: s !< First stages counter.
integer(I_P) :: ss !< Second stages counter.
! computing stages
do s=1, self%stages
self%stage(s) = U
do ss=1, s - 1
self%stage(s) = self%stage(s) + (self%stage(ss) * (Dt * self%alph(s, ss)))
enddo
self%stage(s) = self%stage(s)%t(t=t + self%gamm(s) * Dt)
enddo
! computing new time step
do s=1, self%stages
U = U + (self%stage(s) * (Dt * self%beta(s)))
enddo
if (present(new_Dt)) new_Dt = Dt
endsubroutine integrate