************************************************************************** * Instructions for installing and running TOUGH2 Version 2.0 on a PC, * * using Lahey Fortran compiler * * Julio Garcia - Update: Friday, June 15, 2001, 5:27 pm * ************************************************************************** ++++++++++++++++++++++++ Step-by-step instructions +++++++++++++++++++++++ Before using this instructions please read TOUGH2 read.me file. This file provides step-by-step instructions for compiling and linking TOUGH2 on a PC using Lahey Fortran compiler. 1. Preparation --------------- Copy all source files into a working directory, for example c:\tough2 If your are using t2cg1.f as your conjugate gradient module copy the following files to your working directory: t2cg1.f meshm.f eos3.f (or other EOS module) ma28.f t2f.f or if you are using t2cg2.f copy the following files t2cg2.f t2 t2solv.f meshm.f eso3.f (ot other EOS module) ma28.f t2f.f 2. Modify Source Files ----------------------- You might require to do only few minor changes of your source files. a) ma28.f Change Numeric Functions AMAX1 --> DMAX1 (12 invocations) AMIN1 --> DMIN1 (1 invocation) Remember that TOUGH2 requires 64-bit arithmetic for succesful execution. b) meshm.f In FORMAT statement do not specify more that 120 blank spaces change all FORMAT(....,129x,...) --> FORMAT(...,120x,...) 8 times in module I still don't know why it doesn't take 129x! c) t2cg1.f Change all FORMAT(....,129x,...) --> FORMAT(...,120x,...) 2 times in module Replace subroutine SECOND for obtaining and printing CPU time. The PC version of this subroutine can be found at: http://esd.lbl.gov/TOUGH2/PROGRAMS/FREEPROGRAMS.html c) t2cg2.f Change all FORMAT(....,129x,...) --> FORMAT(...,120x,...) 2 times in module Replace subroutine SECOND for obtaining and printing CPU time. The PC version of this subroutine can be found at: http://esd.lbl.gov/TOUGH2/PROGRAMS/FREEPROGRAMS.html 3. Compilation and Linking --------------------------- For sake of efficiency it is recommended the use of makefiles and the lahey tool 'automake'. (see 4. Automake). Compilation in the MS-DOS prompt can be done with the command lf90 t2cg1.f meshm.f eos3.f ma28.f t2f.f -c -dbl -lst Filenames may be specified using the DOS wildcards * and ? lf90 *.f -c -dbl -lst -dbl switch is required to extend all REAL and COMPLEX variables, arrays, constants, and functions to REAL (KIND=8) and COMPLEX (KIND=8). -lst switch is used to create a listing file that contains the source program, compiler options, date and time of compilation, and any compiler diagnostics. By default, listing file names consist of the root of the source file name plus the extension .lst (This switch is not required) -c supresses linking. Creation of .obj files without creating an executable. To compile and link use the command: lf90 *.f -nc -dbl -lst -out t2eos3 -out switch is used to create the executable "t2eos3.exe" Note that it is not necessary to re-compile source files that have been compiled already. If the objet (.obj) files are present in the working directory to link them use the command: lf90 *.obj -out t2eos3 4. Automake ------------ Automake is a tool for re-building a program after changes have been made. To run AUTOMAKE simply type 'am'. If there is a configuration file (AUTOMAKE.FIG) in the current directory, AUTOMAKE reads it. Otherwise, it starts the AUTOMAKE Configuration file editor, AMEDIT.EXE. Sample of automake configuration file automake.fig #========================================================================= # Sample AUTOMAKE configuration file (LF90) # (lines beginning with a # are comments) #========================================================================= # A simple case consists of 6 lines # # QUITONERROR specifies that AUTOMAKE should halt immediately if # there is a compilation error. # DEBUG Cause AUTOMAKE to wirte debugging information to a # file called AUTOMAKE.DBG # FILES= to specify the source files (using wild-cards) # TARGET= to specify the executable file name #========================================================================= QUITONERROR DEBUG FILES=*.for COMPILE=@lf90 -dbl -f90 -lst -c %fi LINK=@lf90 @%rf -exe %ex -fullwarn TARGET=t2eos3.exe #========================================================================= # END OF AUTOMAKE configuration file #========================================================================= For additional details please refer to: Fortran 90 User's Guide, Revision H, Lahey Computer Systems, Inc (http://www.lahey.com)