The following is an incomplete list of installation and simulation issues related to teh TOUGH codes, along with suggestions for how to resolve them.
Issue 1: Wrong estimation of machine precision leads to non-performance (issue arises on 64-bit machines)
Issue 2: Wrong end-of-line character leads to compilation and run-time errors
Issue 3: Installation of TOUGH2-MP with METIS Version 5
Issue 1: Precision
All TOUGH simulators require 64-bit arithmetic for accurate results. The number of significant digits represented by the TOUGH programs is evaluated internally in subroutine FLOP. The result of this evaluation depends on the declaration of data types, chip architecture, and compiler options. The default value for numerically calculating derivatives (DFAC) is also determined by this evaluation. The result of this evaluation is printed to the TOUGH output file. Typically, the number of significant digist is 15, resulting in a default DFAC value of approximately 10-8. The following two deviations from this result may occur:
Issue 1.1 – Not Enough Significant Digits
If the number of significant digits turns out to b too small (e.g., 6), this indicates that default real type is set to a 4 byte wide type (instead of an 8 byte wide type), resulting in insufficient precision of floating-point operations.
Solution 1.1 – Use Appropriate Compiler Option
In some packages (e.g., TOUGH2-MP, TOUGHREACT, iTOUGH2), real numbers are declared as 8 byte wide variables (the issue should not occur); in others (specifically TOUGH2), real numbers are not declared explicitly, resulting in a default 4 byte type. Set an appropriate compiler option to ensure 64-bit arithmetic. The flag to be set depends on the compiler, but is typically -r8; -fdefault-real-8; real-size:64 or similar compiler option. Check the compiler user’s guide.
Issue 1.2 – Too Many Significant Digits
The evaluation of the number of signifcant digits may fail if certain aggressive optimization levels are chosen on certain compilers. As a result, an unrealistic number of significant digits (e.g., 77) is obtained, leading to a wrong value for DFAC.
Solution 1.2.1 – Set DFAC in TOUGH Input File
Overwrite the default value of DFAC by specifying 1.0E-8 in Columns 51-60 of TOUGH input record PARAM.3 (see TOUGH2 Users’ Guide).
Solution 1.2.2 – Change Source Code
In file t2cg22.f (for TOUGH2) or file it2main.f (for iTOUGH2), edit subroutine FLOP and replace the calculation of variables N10 and DF with the following two statements:
The two functions PRECISION() and EPSILON() are intrinsic to FORTRAN90 or later FORTRAN versions.
Issue 2: End-of-Line and Special Characters
Issue 2 – Compilation or Run-Time Errors
Depending on the system, text editor, and file distribution used, files may have invalid end-of-line or other special characters embedded, which leads to compilation errors (for source files) or run-time errors (for input files).
Solution 2 – Check End-of-Line Characters
Make sure each line of the Fortran source-code files and of all TOUGH input files (including files such a CO2TAB) have a proper end-of-line character. Use appropriate conversion script (e.g., dos2unix) or load files into a text editor and save it in a proper text format (for example, open the file using Microsoft Word and then save it as a plain text file, with the box “Insert line break” checked.)
Do not use tabulators in TOUGH input files; use a typewriter font (e.g., Courier New) and the space bar to advance to to appropriate column.
Issue 3: METIS Version for TOUGH2-MP
Issue 3 – TOUGH2-MP Does Not Run with New METIS Version
In June of 2011, a new version of METIS became available.Version 5 of METIS made some API changes (http://glaros.dtc.umn.edu/gkhome/metis/metis/changes), which are not compatible with the API implemented in TOUGH2-MP.
Solution 3.1 – Order the latest version of TOUGH2-MP
Order the latest version of TOUGH2-MP, which also fixes known errors in Aztec as well as other minor bugs.
Solution 3.2 – Use Version 4 of METIS
Solution 3.3 – Adapt METIS Calls to API of METIS Version 5
Note that TOUGH2-MP has not been fully tested with METIS Version 5.