Integrate field with explicit low storage Runge-Kutta scheme.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrator_runge_kutta_ls), | 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 low storage Runge-Kutta scheme.
class(integrator_runge_kutta_ls), 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), intent(out), optional :: new_Dt !< New adapted time step.
integer(I_P) :: s !< First stages counter.
! computing stages
self%stage(1) = U
self%stage(2) = U * 0._R_P
do s=1, self%stages
self%stage(2) = (self%stage(2) * self%A(s)) + (self%stage(1)%t(t=t + self%C(s) * Dt) * Dt)
self%stage(1) = self%stage(1) + (self%stage(2) * self%B(s))
enddo
U = self%stage(1)
if (present(new_Dt)) new_Dt = Dt
endsubroutine integrate