Numerical Computing with Modern FortranRichard J. Hanson and Tim Hopkins |
Chapter 8: Case Study: Documenting the Quadrature Routine qag2003
Source Code:
This is the document example. A single quadrature of a standard normal probablility density function is computed. There are three packaging methods used for the integrand evaluation function. These are a use-associated module routine, a routine contained within the invoking program unit, and an external routine. The modules quadpack2003 and set_precision are use-associated by the other program units.
There is a single main program which may be built using the makefile
- documentExample uses set_precision.f90, fexternal.f90, normalPdf.f90, quadpack2003.f90
Sample Output from documentExample
Normal cumulative for mu = 1.00 sigma = 2.00 within limits [mu-1,m+1] is = 0.383 Packaging methods: fmodule, fexternal and fcontained all agree.