Programs in the book The Numerical Method of Lines Integration of Partial Differential Equations (Academic Press, San Diego, 1991, ISBN 0-12-624130-9) by W. E. Schiesser Iacocca Hall, Room D307 Lehigh University 111 Research Drive Bethlehem, PA 18015 USA (215) 758-4264 (office) (215) 758-5297 (fax) WES1@NS.CC.LEHIGH.EDU (Internet) or SSC Laboratory, MS 4003 Cryogenics Department, C329 2550 Beckleymeade Avenue Dallas, TX 75237 USA (214) 708-3505 (office) (214) 708-4804 (fax) WES1@SSCVX1.SSC.GOV (Internet) Please read the following information before using the programs on the diskette, which is written as a series of DOS-formatted files stored in subdirectories according to the chapters in the book (the contents of this printed set of instructions is in file README.1ST in the root directory of the diskette). (1) The diskette was prepared on the assumption that two ODE inte- grators, RKF45 and SDRIV2, would be used primarily for execution of the programs and solution of the problems in the numerical method of lines (NUMOL) book. RKF45 and SDRIV2 are for nonstiff and stiff ODEs, respectively. Other ODE integrators discussed in the NUMOL book are available as part of the DSS/2 software library available from the author (details are available on request); these additional integrators include LSODE, LSODI, LSODES and DASSL. The following routines are in subdirectory LIBRARY on the diskette which contains a library of mathematical routines: (1.1) RKF45 in single and double precision formats, as files RKF45.SP and RKF45.DP, respectively. RKF45 is taken from Forsythe, G. E., M. A. Malcolm and C. B. Moler, Computer Methods for Mathematical Computations, Prentice- Hall, Englewood Cliffs, NJ 1977. Note that these two files, as well as all of the other files on the diskette, are in Fortran 77 source code. (1.2) SDRIV2 discussed in Chapter 4, and used in Program 4.1. The single precision version is file SDRIV2.SP and the set of subordinate routines SGEFS.SP, BLAS.SP, XERROR.SP and MACHCON.SP taken from: Kahaner, D., C. B. Moler and S. Nash, Numerical Methods and Software, Prentice Hall, Englewood Cliffs, NJ 07632, 1989. Note in particular MACHCON.SP requires setting five machine constants; the active values are for a 32-bit computer with single precision Fortran in real function R1MACH: Single precision Fortran (in five-element array RMACH): DATA RMACH/ 1.00E-38, + 1.00E+38, + 0.5E-7, + 1.00E-7, + 0.30102999566/ (1.3) DDRIV2, the double precision version of SDRIV2, and the set of subordinate routines DGEFS.DP, BLAS.DP, XERROR.DP and MACHCON.DP were generously provided by David Kahaner, the first author of the book cited in (1.2). Note that MACHCON.DP requires setting five machine constants; the active values are for a 32-bit computer with double precision Fortran in real function D1MACH: Double precision Fortran (in five-element array DMACH): DATA DMACH/ 2.23D-308, + 1.79D+308, + 1.11D-16, + 2.22D-16, + 0.301029995663981195D0/ Note that the smallest and largest nonzero numbers, 2.23D-308 and 1.79D+308, correspond to a dynamic range of 2*308 = 616 orders of magnitude. Some computers do not have such a large dynamic range, and in some cases, the dynamic range is the same as for single precision, e.g., 2*38 = 76 orders of magnitude. Therefore, some adjustment of the smallest and largest nonzero numbers may be required; however, precise values are not re- quired for the correct operation of DDRIV2. Similarly, the numbers reflecting the machine epsilon (unit round-off), 0.5E-7 and 1.00E-07 for single precis- ion, and 1.11D-16 and 2.22D-16 for double precision, need not be precise for the correct operation of SDRIV2 and DDRIV2. These single precision values (0.5E-07, 1.0E-07), and double precision values (1.11D-16, 2.22D-16), can be used on most 32-bit computers. Finally, despite the appearance of high precision for the fifth number, e.g., 0.30102999566 in single precision, it is not critical to the performance of SDRIV2 and DDRIV2. (1.4) PDE spatial differentiation routines: DSS002.SP, DSS004.SP, DSS012.SP, DSS020.SP, DSS034.SP, DSS036.SP, DSS042.SP, DSS044.SP (single precision) and DSS002.DP, DSS004.DP, DSS012.DP, DSS020.DP, DSS034.DP, DSS036.DP, DSS042.DP, DSS044.DP (double precision). (1.5) ANUGB1 and subordinate routines for the adaptive grid solution of one-dimensional PDEs (files ANUGB1.SP and ANUGB1.DP). (1.6) Utilities: JMAP, EIGEN and subordinate routines for mapping and computing the eigenvalues of an ODE Jacobian matrix (files JMAP.SP and JMAP.DP, EIGEN.SP and EIGEN.DP). TPLOTS and subordinate routines for point plotting of solutions (files TPLOTS.SP and TPLOTS.DP). All of these routines should be readily identifiable from a list of files produced by the DOS command DIR/P on the subdirectory LIBRARY. (2) The programs are organized by chapters in the book. Specifically, subdirectories CHAP1 to CHAP6 contain the programs discussed in Chapters 1 to 6. (3) The files have extensions which identify their types: name.FOR for Fortran source files pertaining to particular application problems. name.DAT for data files associated with name.FOR files with the same name. name.MAI for main programs that call name.FOR and read name. DAT. Thus, in general, a complete program will consist of selected name. MAI, name.FOR and name.DAT files plus the utilities discussed in (1) called by these files (in subdirectory LIBRARY). (4) The file names indicate the particular programs in the book. For example, Program 1.1 (Program 1 in Chapter 1) has the name PRO1P1. FOR (it is a main program that does not read a data file, so it is self-contained except that it calls ODE integrator RKF45 which is file RKF45.SP in subdirectory LIBRARY). Note also that the programs in Chapters 1 to 6 are coded in single precision Fortran; this is due to their development on a long word length computer (64 bits in single precision). However, they should run without modification on a short word length computer (e.g., a 32 bits in single precision); this has has been done by the author. Alternatively, the NUMOL programs can be converted to double precision and run with the double precision library routines of (1). As a second example, Program 1.3 (Program 3 in Chapter 1) has the name PRO1P3.FOR; the associated main program is PRO1P3.MAI which also reads a data file PRO1P3.DAT, and calls RKF45 (i.e., RKF45.SP). As noted previously, Program 4.1 (Program 1 in Chapter 4) calls ODE integrator SDRIV2, along with its set of subordinate routines SGEFS, BLAS, XERROR and MACHON. Thus, to make up a complete pro- gram, use PRO4P1.MAI, PRO4P1.FOR, PRO4P1.DAT, SDRIV2.SP, SGEFS.SP, BLAS.SP, XERROR.SP and MACHCON.SP (with the appropriate machine constants set in MACHCON.SP). Also, SDRIV2 is a quality integrator for both stiff and nonstiff ODEs. Therefore, in principle, it can be used to execute all of the programs in the book by replacing the calls to the various ODE integrators (RKF45, LSODE, LSODES, LSODI and DASSL) with a call to SDRIV2. As noted previously, the programs in Chapter 1 to 6 are in single precision Fortran. There is one exception: Program 6.4 (Program 4 in Chapter 6) is in both single and double precision. Therefore it has the names PRO6P4SP.FOR, PRO6P4SP.DAT and PRO6P4SP. MAI for single precision, and PRO6P4DP.FOR, PRO6P4DP.DAT and PRO6P4DP.MAI for double precision. Also, PRO6P4SP.MAI calls the single precision LSODE (included with DSS/2, Release 4), and PRO6P4DP.MAI calls the double precision LSODE (included with DSS/2, Release 4). (5) The following programs, used to produce the plots in Figures 4.1, 4.2a and 4.2b, pages 157 and 163, are included in subdirectory CHAP4: FIG4P1.FOR - Figure 4.1 FIG4P2A.FOR - Figure 4.2a FIG4P2B.FOR - Figure 4.2b These three programs write the numbers for the plots to a file which can then be sent to a plotting program. Finally, DSS/2, a library of routines for the solution of ODEs/DAEs/PDEs which is available at nominal cost, contains many more routines than could be put on a diskette, e.g., the spatial differentiation routines listed in Appendix B of the NUMOL book. Also, nine sets of applications that run under DSS/2 are available. A list of the application titles for eight sets is given in Appendix C; the ninth set, called DIFFPACK, is a collection of problems in stiff and nonstiff ODEs, and one, two and three dimensional, elliptic, parabolic and hyperbolic PDEs, which is intended to illustrate the NUMOL solution of all of the major classes of ODEs and PDEs within a single software framework. The organization of the series of programs which call different utility routines has been a challenge. I hope the arrangement of the files on the diskette will facilitate the use of the programs in the book. If you encounter any difficulties in using the diskette, please feel free to contact me. W. E. Schiesser 01MAR92