We don't know what you are refering to by subroutines, there is an implication that you are coding this in Fortran but you do not say so.

Also you cannot do this without stating the initial conditions.

By the "improved Euler" method you are refering to the first order predictor corrector method also known as Heun's method.

This tentativly steps forward using the Euler step:

Then refines the derivative estimate to:

and then the final estimate uses an Euler step using the refined derivative estimate:

CB