TOUGH Bugs & Fixes

The TOUGH codes are continually updated in response to new scientific challenges and user needs. While the TOUGH codes are thoroughly tested before release, exhaustive testing is not possible. Consequently, developers and users occasionally detect programming bugs in a released code version. These bugs are fixed as they become known. However, such bug fixes cannot immediately be distributed to all licensed users due to the intricate review, approval, licensing, and distribution process at Berkeley Lab.

This page contains a living list of known bugs. Certain bugs may be ignored, as they only affect (often rarely used) program options or combination of features; others may be fixed with only a few code changes; yet others may require more subtantial recoding.

Please consult the list to see whether the identified issues affect your work. If so, please follow the instructions or request an updated version of the code. If you suspect there is a bug in TOUGH, please contact the developers and provide them with a detailed description of the error as well as the conditions and computing environment under which the error occurs.

Please also consult the following pages:

#

Date

Title

Description

Affected

Module/File

Proposed Fix
8

11/17

CO2 solubility model in ECO2N V2.0

In TOUGH2/ECO2N V2.0 there is a bug wherein variables TEMP1 and TEMP2 are not defined. These variables control the transition from a low-temperature CO2 solubility model to a high-temperature model. When they are not defined, on most computers they will be assumed to be zero, which implies that the high-temperature solubility model will be used for all temperatures, which will lead to small inaccuracies for low-temperature systems (T below 99 deg C). Also, the option IE(16)=1 (invoke the ECO2N V1 CO2 solubility model) will not work.

TOUGH2 V2.1, CO2Proper_new.f (Option 1) In the section “Block Data Thermodata” add the line

DATA TEMP1,TEMP2/99.0D0,109.0D0/

(Option 2) Request& the updated version of the executable

7

10/15

Phase change in ECO2N V2.0

Bug in specifying DELX when phase change to single-phase gas. Note this bug may only affect the convergence behavior in cases where no NaCl is present and a grid blcok dries our completely.

TOUGH2 V2.1, eco2n_v20.f (Option 1) Make the following changes to SUBROUTINE EOS, file eco2n.f, Lines 1551 and 1553:

case (4)
if(SX > 1.0-dfac-SS) then
DELX(NLOC+3)=-DFAC
else
DELX(NLOC+3)=DFAC
endif
SX=SX+DELX(NLOC+3)
end select

(Option 2) Download the updated version of eco2.f and recompile

(Option 3) Request& the updated version of the executable

6

05/15

Hysteresis Restart

When doing a restart using the hysteresis module with MOP(13)=2, history parameters for hysteresis (read in the INCON file) are not assigned correctly if the keyword START is present in the input file

TOUGH2 V2.1, t2fm.f (only if IRP=ICP=12)

iTOUGH2/hysteresis module, t2f.f (only if IRP=ICP=12)

(Option 1) Make the following changes to SUBROUTINE RFILE, file t2f.f (for iTOUGH2) of t2fm.f (for TOUGH2 V2.1):

DO 2005 J=1,NEL
...unchanged material not shown...

CFiHysteresisB
IF (IHYSTER.LT.0) THEN
SOLDH(J)=SLD
HOLD(J)=HLD
ICURV(J)=ICRV
SOROLD(J)=SORE
STRN1OLD(J)=STR1
STRN2OLD(J)=STR2
STRN3OLD(J)=STR3
HTRN1OLD(J)=HTR1
HTRN2OLD(J)=HTR2
HTRN3OLD(J)=HTR3
SCMP1OLD(J)=SCM1
SCMP2OLD(J)=SCM2
BB2OLD(J)=BBB2
HMINOLD(J)=HMIN2
SHMINOLD(J)=SHMIN2
HMINPOLD(J)=HMINP2
ENDIF
CFiHysteresisE
GOTO 2002
2005 CONTINUE

(Option 2) Download the updated version of t2fm.f and recompile (for TOUGH2 V2.1 only)

(Option 3) Request& the updated version of the executable

5

06/15

AZTEC Option Broadcast

AZTEC options were not being broadcast to all ranks

TOUGH2.01-MP

File Paral_Subs.f90

Download file Paral_Subs.f90 and recompile

4

06/15

MOLES/SEC vs. KG/S

The header preceding the printout of diffusive fluxes shows units of MOLES/SEC. This is only correct for EOS modules that are based on molar fractions (e.g., TMVOC); for modules that are based on mass fractions, the correct units are KG/S. This is a reporting error; the calculations are correct.

TOUGH2 V2.1

All EOS modules (except TMVOC)

File t2fm.f

Subroutine OUTDF

(Option 1) Since this is a reporting error rather than a computational issue, it may be sufficient for the user to be aware of the correct units

(Option 2) Make following changes to SUBROUTINE OUTDF, file t2fm.f:

C-----PRINT A SHORT HEADER.
C
IF(EOSN(1).EQ.'TMVOC1') THEN
PRINT 5000,H1,TITLE,KCYC,ITER,SUMTIM,'MOLES'
ELSE
PRINT 5000,H1,TITLE,KCYC,ITER,SUMTIM,'KG'
ENDIF
C

...

5000 FORMAT(A1/10X,A80//80X,'KCYC =',I5,' - ITER =',I5,
& ' - TIME =',E12.6/
&' MASS FLOW RATES (',A,'/S) FROM DIFFUSION'/)

(Option 3) Download the updated version of t2fm.f and recompile (for TOUGH2 V2.1 only)

(Option 4) Request& the updated version of the executable

3

06/15

T2WELL-ECO2N Heat Flow Calculation

(1) Heat flow between the wellbore and surrounding formation calculated using Ramey’s solution was not correctly scaled into the energy balance equation.

(2) Accounting for potential energy required all wellbore elements to be connected monotonically downward, leading to errors if U-shaped boreholes are defined.

(3) See Notes for additional changes and capability enhancements.

T2WELL-ECO2N Request& the updated version of T2WELL-ECO2N

2

02/15

TOUGH2-MP

Minor clean-up, bug fixes, and updates; see Notes; implemented in TOUGH2.01-MP (includes Fix #1)

TOUGH2-MP Request& the updated version of TOUGH2-MP

1

02/15

AZTEC Memory Operation

A faulty memory operation in the AZTEC library caused premature run termination

AZTEC (external library to TOUGH2-MP)

File az_zort.c

(Option 1) In the Aztec2.1 source, edit file az_sort.c (Aztec2.1/lib/az_sort.c).

Change line 1433:
memcpy(ptr1, ptr2, thelength);

to:
memmove(ptr1, ptr2, thelength);

(Option 2) Download the updated file az_sort.c and recompile

& To request an updated version of the code, please send an e-mail to MTReagan@lbl.gov with the following information:

  • License or order number, or other information verifying the validity of your TOUGH license
  • Module requested
  • Source code or executable