4.Fortran Codes This chapter presents the callable routines developed in the course of the research on the integrals of Chapter 3. Executable programs are found in driver files denoted by BECKDRVR.FOR, AMOSDRVR.FOR or RESEARCH.FOR. The main library containing supporting subroutines is formed from AMOSSUBS.FOR+BECKSUBS.FOR. The driver program and the main library must be compiled and linked to form an executable unit. The files listed below are stored as text files on a disk which is attached at the end of this handbook. Disk Contents Callable Subroutines and Functions in File AMOSSUBS.FOR CALLABLE SUBROUTINE: FOLDER DGAUS8(FUN, A, B, ERR, ANS, IERR) SLATEC DQUAD8(DQFUN,INIT,X1,SIG,REL,X2,QANS,IERR) 21 DEXINT(X, N, KODE, M, TOL, EN, NZ, IERR) SLATEC DHEXINT(X, FNH, KODE, M, TOL, EN, NZ, IERR) 18 DGEXINT(X, N, KODE, M, TOL, GN, EN, NZ, IERR) 18 DGHEXINT(X, FNH, KODE, M, TOL, GN, EN, NZ, IERR) 18 DIERFC(X,KODE,ANS,IERR) 10,16 DINERFC(X,N0,KODE,N,REL,Y,NZ) SLATEC DPSIFN(X, N, KODE, M, ANS, NZ, IERR) SLATEC XERROR(MESS,NMESS,NERR,LEVEL) SLATEC XERRWV(MESSG,NMESSG,NERR,LEVEL,NI,I1,I2,NR,R1,R2) SLATEC FDUMP SLATEC CALLABLE FUNCTION: FOLDER DOUBLE PRECISION FUNCTION DRERF(X,KODE,NZ) AMOSLIB DOUBLE PRECISION FUNCTION DFERF(X,REL,IERR) 16 DOUBLE PRECISION FUNCTION DGERFC(X,KODE,REL,IERR) 16 DOUBLE PRECISION FUNCTION DHERFC(X) 23 DOUBLE PRECISION FUNCTION DPSIXN(N) SLATEC DOUBLE PRECISION FUNCTION DGAMLN(Z,IERR) SLATEC DOUBLE PRECISION FUNCTION D1MACH(I) SLATEC INTEGER FUNCTION I1MACH(I) SLATEC REAL FUNCTION R1MACH(I) SLATEC Callable Subroutines and Functions in File BECKSUBS.FOR CALLABLE SUBROUTINE: FOLDER INTEGI1(A,B,T,KODE,REL,ANSI1,IERR) 1,2,10 INTEGI2(A,B,T,KODE,ANSI2,IERR) 9 INTEGI9(A,B,T,KODE,ANSI9,IERR) 9 INTEGI3(A,B,C,T,ANSI3,IERR,KFORM) 7 INTEGI5(A,B,X,ANSI5,IERR) 5 INTEGJ5(A,B,X,ANSJ5,IERR) 5 INTEGV5(A,B,X,ANSV5,IERR) 5 INTEGI6(A,B,T,KODE,ANSI6,IERR) 3,6,15 INTEGP(A,B,T,KODE,REL,PANS,IERR) 11 INTEGQ(A,B,T,REL,QANS,IERR) 11 INTEGW3(A,B,T,KODE,REL,ANSW3,IERR) 10 INTEGI21(A,B,C,T,KODE,ANSI21,I21ERR,KFORM) 21 INTEGJ21(A,B,C,T,ANSJ21,J21ERR,KFORM) 21 INTEGI22(A,B,C,T,ANSI22,I22ERR,KFORM) 22 INTEGJ22(A,B,C,T,ANSJ22,J22ERR,KFORM) 22 INTEGI29(A,B,T,N0,NN,YN,IERR) 29 INTEGS1(A,B,C,T,TOL,S1,IERR,KFORM) 21 INTEGS2(A,B,C,T,TOL,S2,IERR,KFORM) 22 GNSEQ(A,B,CAPT,M,REL,YN) 21 CALLABLE FUNCTION: FOLDER DVOFT(A,B,T,REL,IERR,KFORM) 21 PHIZ(Z) 5 Executable Programs in File BECKDRVR.FOR PROGRAM: OUTPUT: FOLDER PROGRAM I1COMP I1COMP.TXT 1,2,10 PROGRAM I2COMP I2COMP.TXT 9 PROGRAM I9COMP I9COMP.TXT 9 PROGRAM I3COMP I3COMP.TXT 7 PROGRAM I5COMP I5COMP.TXT 5 PROGRAM J5COMP J5COMP.TXT 5 PROGRAM V5COMP V5COMP.TXT 5 PROGRAM I6COMP I6COMP.TXT 3,6,15 PROGRAM W3COMP W3COMP.TXT 10 PROGRAM PCOMP PCOMP.TXT 11 PROGRAM QCOMP QCOMP.TXT 11 PROGRAM I21COMP I21COMP.TXT 21 PROGRAM J21COMP J21COMP.TXT 21 PROGRAM I22COMP I22COMP.TXT 22 PROGRAM J22COMP J22COMP.TXT 22 PROGRAM I29COMP I29COMP.TXT 29 PROGRAM GNCOMP GNCOMP.TXT 21 PROGRAM VTCOMP VTCOMP.TXT 21 Executable Programs in File AMOSDRVR.FOR PROGRAM: OUTPUT: FOLDER PROGRAM GECOMP GECOMP.TXT 18 PROGRAM GHECOMP GHECOMP.TXT 18 PROGRAM DFCOMP DFCOMP.TXT 16 PROGRAM DGCOMP DGCOMP.TXT 16 PROGRAM HERFCOMP HERFCOMP.TXT 23 Executable Programs in File RESEARCH.FOR PROGRAM: OUTPUT: FOLDER PROGRAM I1COMPB I1COMPB.TXT 1,2 PROGRAM I4COMP I4COMP.TXT 8 PROGRAM J4COMP J4COMP.TXT 8 PROGRAM ERFINT ERFINT.TXT 12 PROGRAM I13COMP I13COMP.TXT 13 PROGRAM I14COMP I14COMP.TXT 14 PROGRAM I19COMP I19COMP.TXT 19 PROGRAM I20COMP I20COMP.TXT 20 PROGRAM I24COMP I24COMP.TXT 24 PROGRAM J24COMP J24COMP.TXT 24 PROGRAM V24COMP V24COMP.TXT 24 PROGRAM I25COMP I25COMP.TXT 25 PROGRAM I26COMP I26COMP.TXT 26 PROGRAM I26ACOMP I26ACOMP.TXT 26 PROGRAM DGSCOMP DGSCOMP.TXT 16 FILE DESCRIPTIONS The following files contain the programs and subroutines which were used to check out formulas numerically. BECKSUBS.FOR is a file of subroutines and functions which implement many of the formulae in developed in Chapter 3. These can be regarded as 'complete', which means that these codes were constructed with high accuracy over large ranges of variables in mind and contain parameters which record input and output errors when some condition is violated. AMOSSUBS.FOR is a file which contains codes published in ACM Collected Algorithms or the SLATEC library, codes copied from a personal archive called AMOSLIB, or codes developed as natural extensions of those in the SLATEC Library or AMOSLIB. High accuracy is the dominant consideration in the development of these codes. BECKDRVR.FOR is a file of drivers (PROGRAM…) which exercise the subroutines of BECKSUBS.FOR, and, when successfully completed, show typical relative errors when compared with an alternate method of computation. For integrals, this alternate method is usually a direct quadrature with DGAUS8 or DQUAD8. AMOSDRVR.FOR is a file of driver routines which exercise not previously published subroutines in AMOSSUBS.FOR in the manner of BECKDRVR.FOR. RESEARCH.FOR is a file containing codes which implement a formula or procedure but does not contain error checking nor flags for unusual occurrences. A code with this designation is not to be considered 'complete' or algorithmic (where accurate values over stated ranges of variables are returned). USAGE: To execute a driver program, it must be extracted from BECKDRVR.FOR, AMOSDRVR.FOR, or RESEARCH.FOR, compiled and linked to the compiled files AMOSSUBS.FOR and BECKSUBS.FOR. Each of these files starts with a code consisting of all comment lines with text which describes the contents of the file. These information subroutines are labeled BPRGINFO, APRGINFO, RPRGINFO, AMOSINFO, and BECKINFO, respectively. MACHINE DEPENDANT CONSTANTS: The FORTRAN code distributed with this document contains machine dependant functions INTEGER FUNCTION I1MACH(I), I=1,16 REAL FUNCTION R1MACH(I), I=1,5 DOUBLE PRECISION FUNCTION D1MACH(I), I=1,5 which define important machine constants (File AMOSSUBS.FOR). Some of the codes which were adapted from the SLATEC library require these functions in order to compute properly. These functions have FORTRAN code which returns machine constants for a variety of machines. These are set in comment statements. To define a machine, simply remove the C in column 1 and re-comment any active FORTRAN code from a previous setting. The default settings define the IBM PC which will work for many other personal computers. The prologue of each function defines the value returned for each I. To see the numeric values which will define your machine, simply evaluate each function in a loop and print out the values.