The following is a list of useful Fortran 77 subroutines and functions use to numerically solve ordinary differential equations. Feel free to use them if you need them in your work.
rk4.f | Fortran 77 subroutines using the 4th-order Runge-Kutta technique for ODEs. |
ode.f | Fortran 77 subroutines using the Adams method for ODEs.
Note that this file also contains the DE, STEP, and INTRP subroutines. |
de.f | Fortran 77 subroutine of Adams method for ODEs. |
intrp.f | Fortran 77 subroutine called by de.f. |
step.f | Fortran 77 subroutine called by de.f. |
machin.f | Fortran 77 program to calculate data for ode.f and de.f. |
f.f | Sample Fortran 77 subroutine containing the
differential equations that ode.f and de.f are asked to solve. |
The following is a list of useful Fortran 77 subroutines and functions use to numerically solve ordinary differential equations. Feel free to use them if you need them in your work.
fit.f | Fortran 77 subroutine to fit data to a straight line
using the linear least-squares fitting technique. |
gammq.f | Fortran 77 function to calculate the complement of
the incomplete gamma function, Q(a, x) = 1 - P(a, x), where P(a, x) is the incomplete gamma function. |
gser.f | Fortran 77 subroutine to calculate the incomplete gamma
function using a series solution. |
gcf.f | Fortran 77 subroutine to calculate the incomplete gamma
function using a continued fraction technique. |
gammln.f | Fortran 77 function to calculate the natural log of the gamma function. |
Let say we have a Fortran 77 program that contains data representative of a linear function called mylinfit.f and we wish to carry out a linear least-squares fit to this data and print out the parameters of this straight line fit. Once we are in an appropriate subdirectory of a Linux computer, we then issue the following command to compile and link our files into an executable file using
gfortran -o mylinfit.exe mylinfit.f fit.f gammq.f gser.f gcf.f gammln.f
We then run this program using
./mylinfit.exe
Click here to go back to the Computational Physics home page.