!************************************************************ !* TEST PROGRAM OF SUBROUTINE ODEINT OF MODULE EQUDIF * !* (Runge-Kutta Method with Time Step Control) * !* -------------------------------------------------------- * !* SAMPLE RUN: * !* Integrate ODE First Order System: * !* Y1' = Y2 * !* Y2' = (3-C)*Y1+2*Y4-q1 * !* Y3' = Y4 * !* Y4' = -2*Y2-C*Y3 * !* Y5' = Y6 * !* Y6' = -(1+C)*Y5 * !* from t1=0 to t2=10 with additional data: * !* Y start = (0,0,0,0,1,0) * !* Starting integration step = 0.01 * !* Desired precision = 1E-8 * !* Minimum integration step = 0.001 * !* C=1, q1=2 * !* * !* At time = 10.0000000000000 * !* Y(1) = -0.121038E+04 * !* Y(2) = -0.908048E+03 * !* Y(3) = 0.116298E+04 * !* Y(4) = 0.870537E+03 * !* Y(5) = -0.496866E-02 * !* Y(6) = -0.141420E+01 * !* * !* Final time step = 2.175370624046558E-002 * !* * !* F90 Release By J-P Moreau, Paris. * !* (www.jpmoreau.fr) * !************************************************************ Program Tequdif USE Equdif !For subroutine odeint real*8 Y(6) real*8 h,t1,t2 nvar=6 !number of equations do i=1, nvar !starting values for Y Y(i) = 0.d0 end do Y(5) = 1.d0 t1=0.d0 !starting time t2=10.d0 !ending time h=0.01d0 !starting integration step call odeint(Y,nvar,t1,t2,1.d-8,h,0.001d0,nok,nbad) print *,' ' print *,' At time = ', t2 do i=1, nvar write(*,10) i, Y(i) end do print *,' ' print *,' Final time step = ', h stop 10 format(' Y(',I1,') = ',E13.6) END !end of file teqdif.f90