List of Procedures

A summary of the subroutines and functions in this collection that are based on the originals in the book Computer Methods for Mathematical Computations by Forsythe, Malcolm and Moler.

The original procedure names and lists of dummy arguments have been modified to be more in line with modern Fortran style. Click on a procedure name to see a list of the dummy arguments.

namedescription
Decomp LU-decomposition of a square matrix
Solve Solves a system of linear equations. Use after Decomp.
FMMspline Fit a cubic spline to data. FMM end conditions.
NaturalSpline Same as FMMspline, but with zero second derivatives at endpoints
Seval Evaluate a cubic spline at a given point.
Seval3 Evaluate a cubic spline at a given point. Returns value of spline plus 1st,2nd,3rd derivatives.
Quanc8 Numerical integration of a function.
Rkf45 Solves a system of ordinary differential equations as an initial value problem.
Zeroin Find a zero of a function.
BrentZero Same as Zeroin, but with additional dummy arguments
Fmin Find the minimum of a function.
BrentMin Same as Fmin, but with additional dummy arguments.
SVD Singular Value Decomposition of a matrix

All of the vector and matrix arguments are now assumed-shape arrays, a feature introduced with Fortran 90. With this feature, a procedure can determine the size of the input arrays without requiring separate arguments for the size and shape of the array. If you use the technique of dimensioning for the largest imaginable size, then you must be careful to call the procedure with the appropriate size. For example, if you define the matrix a as a(100,100) and you wish to call Decomp for a matrix of order n stored in a, you would use the following function call:

CALL Decomp(a(1:n,1:n), ipvt(1:n), errCode, cond)

Description of dummy arguments

CALL Decomp(a, ipvt, errCode, cond)
varintentdimdef
ain out: , :matrix to be decomposed
ipvtout:index of pivot rows
errCodeout-error code
condout-condition number

Go back to the top of the page

CALL Solve(a, b, ipvt)
varintentdimdef
ain: , :decomposed matrix (from Decomp)
bin out:right-hand side; replaced with solution
ipvtin:record of row interchanges (from Decomp)

Go back to the top of the page

CALL FMMspline(x, y, b, c, d)
varintentdimdef
xin:abscissas of knots
yin:ordinates of knots
bout:linear coefficients
cout:quadratic coefficients
dout:cubic coefficients

Go back to the top of the page

CALL NaturalSpline(x, y, b, c, d)
varintentdimdef
xin:abscissas of knots
yin:ordinates of knots
bout:linear coefficients
cout:quadratic coefficients
dout:cubic coefficients

Go back to the top of the page

Seval(u, x, y, b, c, d)
varintentdimdef
uin-abscissa where spline is to be evaluated
xin:abscissas of knots
yin:ordinates of knots
bin:linear coefficients
cin:quadratic coefficients
din:cubic coefficients

Go back to the top of the page

CALL Seval3(u, x,y, b, c, d, f, fp, fpp, fppp)
varintentdimdef
uin-abscissa where spline is to be evaluated
xin:abscissas of knots
yin:ordinates of knots
bin:linear coefficients
cin:quadratic coefficients
din:cubic coefficients
fout-value of spline at u
fpout-value of 1st derivative of spline at u
fppout-value of 2nd derivative of spline at u
fpppout-value of 3rd derivative of spline at u

Go back to the top of the page

CALL Quanc8(F, a, b, abserr, relerr, result, errest, nofun, flag)
varintentdimdef
F--function to be integrated
ain-lower limit of integration
bin-upper limit of integration
abserrin-absolute error tolerance
relerrin-relative error tolerance
resultout-approximate value of the integral
errestout-estimate of actual error
nofunout-number of function evaluations
flagout-reliability indicator

Go back to the top of the page

CALL Rkf45 (F, y, t, tout, relerr, abserr, iflag, work, iwork)
varintentdimdef
F--subroutine that computes derivatives
yin out:solution vector at t
tin out-independent variable
toutin out-output point at which solution is desired
relerrin out-relative error tolerance
abserrin-absolute error tolerance
iflagin out-indicator for status of work
workin out:work array
iworkin out:work array

Go back to the top of the page

Zeroin(ax, bx, F, tol)
varintentdimdef
axin-lower endpoint of interval
bxin-upper endpoint of interval
Fin-function to be investigated
tolin-desired interval of uncertainity

Go back to the top of the page

CALL BrentZero(ax, bx, F, tol, maxIter, neval, xZero, fZero)
varintentdimdef
axin-left-hand limit on x-coor
bxin-right-hand limit on x-coor
Fin-the function to be investigated
tolin-user-specified tolerance
maxIterin-user specified limit on the number of iterations
nevalout-number of function evaluations required to find the zero
xZeroout-x-coor of the zero
fZeroout-last evaluation of the function. Should be very small.)

Go back to the top of the page

Fmin(ax, bx, F, tol)
varintentdimdef
axin-lower endpoint of initial interval
bxin-upper endpoint of initial interval
Fin-function to be investigated
tolin-desired interval of uncertainity

Go back to the top of the page

CALL BrentMin(ax, bx, F, tol, maxIter, neval, errCode, xZero, fZero)
varintentdimdef
axin-lower endpoint of initial interval
bxin-upper endpoint of initial interval
Fin-function to be investigated
tolin-desired interval of uncertainity
maxIterin-maximum number of iterations allowed
nevalout-number of function evaluations
errCodeout-errorCode; =0 OK; =1 too many iter
xZeroout-x-coor of the minimum point
fZeroout-f(xZero)

Go back to the top of the page

CALL SVD(a, w, matu, u, matv, v, ierr)
varintentdimdef
ain: , :matrix to be decomposed. On output, a is unaltered (unless overwritten by u or v).
wout:w contains the n (non-negative) singular values of a (the diagonal elements of s). They are unordered. If an error exit is made, the singular values should be correct for indices ierr+1,ierr+2,...,n.
matuin- matu should be set to .TRUE. if the u matrix in the decomposition is desired, and to .FALSE. otherwise.
uout: , : u contains the matrix u of orthogonal column vectors of the decomposition if matu has been set to .TRUE. Otherwise, u is used as a temporary array. u may coincide with a. If an error exit is made, the columns of u corresponding to indices of correct singular values should be correct.
matvin- matv should be set to .TRUE. if the v matrix in the decomposition is desired, and to .FALSE. otherwise.
vout: , : v contains the matrix v (orthogonal) of the decomposition if matv has been set to .TRUE. Otherwise v is not referenced. v may also coincide with a if u is not needed. If an error exit is made, the columns of v corresponding to indices of correct singular values should be correct.
ierrout- zero for normal return, k if the k-th singular value has not been determined after 30 iterations.