Numerical Computing with Modern FortranRichard J. Hanson and Tim Hopkins |
Chapter 3: Generic Subprograms
Source Code:
These executable routines illustrate general packaging of real and complex- valued Airy functions. Use is made of Calgo838 algorithm for the basic source code.
Three executables may be generated using the makefile provided
- testairy uses set_precision.f90, Airy_Module.f90, airy_functions.f90, drive_airy.f90
- testairyInc uses set_precision.f90, drive_airy.f90, Airy_ModuleInc.f90, airy_functions.f90.
- testGeneric uses set_precision.f90, testGeneric.f90, airy.f90, airy_functions.f90.
Sample output from testairy and testairyInc
Airy ODE Wronskian - absolute units of relative error Computed with NVALS random (0,1) values, using NVALS = 1000 Complex values are in the unit square, (0,1) x (0,1). Single Precision: 0.56 Double Precision: 1.43 COMPLEX Single Precision: 1.36 COMPLEX Double Precision: 3.31
Sample output from testGeneric
Single precision argument: 0.314159E+01 Ai and Bi values : 0.508935E-02 -0.938907E-02 0.177473E+02 0.298032E+02 Double precision argument: 0.314159E+01 Ai and Bi values : 0.508935E-02 -0.938907E-02 0.177473E+02 0.298032E+02 Maximum relative difference; 0.343410E-06 Complex single precision argument: 0.314159E+01 0.100000E+01 Ai values (complex) : -0.160031E-02 -0.557314E-02 0.153076E-02 0.107900E-01 Complex double precision argument: 0.314159E+01 0.100000E+01 Ai values (complex) : -0.160031E-02 -0.557314E-02 0.153077E-02 0.107900E-01 Maximum relative difference; 0.425063E-06