Program SlabCE

Include 'link_fnl_shared.h'

Use IVMRK_INT

Implicit none

Integer i, j, ido, n, np

Parameter (n = 400, np = 50)

real*8 t, tend, y(n), yprime(n), step

External Fcn

! Initial condition.

t = 0.d0

Y(1: n) = 400.d0 ! T0 = Y is the initial temperature.

! Define the final integration time and the integration time step.

! We can modify this time for each simulation.

tend = 600

step = (tend -t)/dble(np)

tend = step

! Create a data output file.

Open(10, file = "Results.txt", status = "unknown")

Write(10,10) t, (y(i), i = 1, n)

! We commonly make the initial call with IDO = 1.

Ido = 1

Do j = 1, np

Call DIvmrk(ido, n, fcn, t, tend, Y, Yprime)

! The subroutine that we use in the calculations is

! Ivmrk, which "calls the subroutine Fcn".

Write(10,10) tend, (Y(i), i = 1, n)

t = tend

tend = t + step

End Do

! Format for printing the results.

10 Format ( (2x, f8.2))

End program