Professional Documents
Culture Documents
18
18
integer :: i
real :: phis, k, ti
interface
real function func(x,y)
real, intent(in) :: x,y
end function func
end interface
do i = 1,Nt-1
ti = t(i)
! 1st RK
phis = phi(i)
k = func(ti,phis)
! 2nd RK
phis = phis + (1.0/3.0)*dt*k
ti = t(i) + (1.0/3.0)*dt
k = -(5.0/9.0)*k + func(ti,phis)
! 3rd RK
phis = phis + (15.0/16.0)*dt*k
ti = t(i) + (3.0/4.0)*dt
k = -(153.0/128.0)*k + func(ti,phis)