Test explicit low storage Runge-Kutta class of ODE solvers.
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.
subroutine test_ls_rk()
!---------------------------------------------------------------------------------------------------------------------------------
!< Test explicit low storage Runge-Kutta class of ODE solvers.
!---------------------------------------------------------------------------------------------------------------------------------
type(integrator_runge_kutta_ls) :: rk_integrator !< Runge-Kutta integrator.
integer, parameter :: rk_stages=5 !< Runge-Kutta stages number.
integer, parameter :: registers=2 !< Runge-Kutta stages number.
type(lorenz) :: rk_stage(1:registers) !< Runge-Kutta stages.
integer(I_P) :: s !< RK stages counter.
integer(I_P) :: step !< Time steps counter.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
print "(A)", 'Integrating Lorenz equations by means of low storage (2N) Runge-Kutta class of solvers'
do s=1, rk_stages
if (s==2) cycle ! 2 stages not yet implemented
if (s==3) cycle ! 3 stages not yet implemented
if (s==4) cycle ! 4 stages not yet implemented
print "(A)", ' RK-'//trim(str(.true.,s))
call rk_integrator%init(stages=s)
call attractor%init(initial_state=initial_state, sigma=sigma, rho=rho, beta=beta)
solution(0, 0) = 0._R_P
solution(1:space_dimension, 0) = attractor%output()
do step = 1, num_steps
call rk_integrator%integrate(U=attractor, stage=rk_stage, dt=dt, t=solution(0, step))
solution(0, step) = step * dt
solution(1:space_dimension, step) = attractor%output()
enddo
call save_results(title='FOODIE test: Lorenz equation integration, explicit low storage Runge-Kutta '//trim(str(.true., s))//&
' stages', filename='lorenz_integration-lsrk-'//trim(str(.true., s)))
enddo
print "(A)", 'Finish!'
return
!---------------------------------------------------------------------------------------------------------------------------------
endsubroutine test_ls_rk