You are on page 1of 17
13 GEOCHEM-PC—A Chemical Speciation Program for IBM and Compatible Personal Computers David R. Parker University of California Riverside, California Wendell A. Norvell USDA Plant, Soil, and Nutrition Laboratory Ithaca, New York R.L. Chaney USDA-ARS Beltsville, Maryland GEOCHEM-PC is a descendant of the multipurpose chemical speciation program GEOCHEM (Sposito & Mattigod, 1980) which has been widely used by soil and environmental chemists. GEOCHEM itself was a progeny of the REDEQL series of programs (McDuff & Morel, 1973; Morel & Morgan, 1972), a family of general-purpose geochemical models intended primarily for use with natural surface waters (i.c., total P = 0.1 MPa, Tat or near 298 K). The GEOCHEM differed from its predecessor, REDEQL2, primarily in its greatly expanded data- base, which permitted consideration of more metals, ligands, complexes, and solids of interest to soil chemists, and by the inclusion of models for cation exchange and metal adsorption. Like many similar computerized equilibrium models, GEOCHEM-PC is, comprised of four principal components: (i) a user interface to allow setup of an equilibrium problem, (ii) a database of equilibrium constants selected by the program authors, but alterable by the user, (iii) a numerical algorithm to solve the problem, and (iv) an interface to provide the results in a readable format. Since its introduction some 14 yr ago (Mattigod & Sposito, 1979; Sposito & Mattigod, 1980), GEOCHEM has undergone several modifications to improve the program’s computational accuracy (i.e, Sposito, 1986; Parker et al., 1987). In Copyright © 1995 Soil Science Society of America, American Society of Agronomy, 677 S. Segoe Rad,, Madison, WI 53711, USA. Chemical Equilibrium and Reaction Models, SSSA Special Publication 42. 253 et 254 PARKER ET AL. 1987, the main-frame Fortran code of GEOCHEM was adapted for use on the increasingly powerful and convenient personal computers (D.R. Parker, unpub- lished program). The PC-compatible version of GEOCHEM has evolved through several versions which have been passed from user to user on an informal basis (ie., as shareware”). One unfortunate side effect of these many modifications is that the assertion that *. . . computations were performed using GEOCHEM . . ” no longer specifies the exact computational methods. In addition, numerous versions of the thermodynamic database have been created by individual users according to their specific interests, and to their assessment of the available ther- ‘mochemical data (Sposito & Mattigod, 1980; Baham, 1984; Parker et al., 1987). ‘Accordingly, we do not believe that citation of the program (or this chapter) is an adequate substitute for providing explicit references for the thermodynamic constants employed in a given study. The GEOCHEM-PC has evolved into a functional and increasingly conve- nient research tool that we have distributed to interested users in the USA and abroad. The present program is intended for use on [BM and compatible personal computers running DOS (Version 3.0 ot higher). However, the source code conforms very closely to the FORTRAN-77 standard, and has proved to be readily portable to other hardware and operating systems. Our use of GEOCHEM-PC, as well as the alterations we have made, largely reflect our research interests in plant mineral nutrition, phytotoxic trace elements, soil solution chemistry, and related topics. Thus, we have attempted to develop the program for comparatively painless use by soil and plant scientists who do not have extensive experience in the theory and use of computerized speciation models. Program features and the component species included in the program database are oriented towards such use, as will be any future developments and improvements. As noted later, other speciation programs may be better suited to certain types of research. Our objectives in this chapter are to (i) provide an overview of GEOCHEM- PC in its current form, (ii) highlight some of the differences between GEOCHEM-PC and its predecessors, (iii) clarify some points regarding program conventions and assumptions, and (iv) indicate our plans for future program improvernents. CURRENT PROGRAM CHARACTERISTICS General Objectives and Capabilities GEOCHEM-PC is designed to perform equilibrium speciation computations for soil solutions, hydroponic solutions for the rearing of plants, natural waters, and similar aqueous systems. GEOCHEM-PG, like its predecessors, is intended for equilibrium calculations at constant temperature and total pressure. The exter- nal database file contains equilibrium constants for reactions at 298 K and 0.1 MPa total pressure. The program cannot adjust the thermodynamic data for changes in T and P, although alternative versions of the database could be created for use at other constant temperatures and pressures. GEOCHEM-PC 285 ‘The GEOCHEM-PC rapidly performs computations involving the solution equilibria of simple complexes and the precipitation-dissolution of simple solid phases (complexes and solids which contain no more than one component metal, ‘one component ligand, and H* or OH"). The “case” structure (i.¢., 10 different cases per program run) is convenient for examining the effects of master variables such as pH, pCO,, and pE on the speciation of a given solution. The program output is an ASCII file that can be printed directly or readily accessed using an editor or word processor. It is versatile in that the results are summarized in several ways, and the user can select which format(s) are to be produced. The database of stability constants is quite large and constantly growing, and contains a large complement of polyamino-polyacetate chelating compounds useful in soil chemistry and plant nutrition research (see Chapter 9; Parker et al., 1995). GEOCHEM-PC performs redox computations adequately, although some of the conventions for describing the reactions are awkward and nonintuitive. More complex mineral phases (“mixed solids” in the parlance of GEOCHEM) can also be considered, but other programs such as MINTEQA2 (see Chapter 11; Lindsay & Ajwa, 1995) are better equipped to model complex solid phases and solid solu- tions. Mixed ligand or mixed metal complexes can not be modeled. Programs such as MINTEQA2 (see Chapter 11; Lindsay & Ajwa, 1995) and those from the MINEOL family (see Chapter 1, Mattigod, 1995) are specifically designed to model surface adsorption phenomena, and offer a selection of surface models; GEOCHEM-PC makes no attempt to model these reactions. ‘Computational Methods GEOCHEM-PC is computationally similar to GEOCHEM and REDEQL, and these programs have been adequately described elsewhere (Morel & Morgan, 1972; Sposito & Mattigod, 1980; Sposito, 1984). Briefly, the requirement for mole balance for all component species is coupled with thermodynamic con- straints for all reactions considered. These requirements provide a set of nonlinear equations linking the molar concentrations of component species with the conditional (ionic-strength adjusted) stability constants for the complexes and solids which may form from these components. These equations are solved simultaneously using a variation of the Newton-Raphson method, until the sum of the concentrations of all metal and ligand species agree with their input concentrations to within a degree of precision selected by the user (the conver- gence criterion, usually 0.01%). The program does not impose or require clectroneutrality, nor the closely related proton condition (Stumm & Morgan, 1981). This characteristic minimizes computational difficulties (i.., convergence problems, floating-point errors) when using input data which are incomplete or exhibit poor charge balance (Sposito, 1984), but prevents direct solution of certain types of problems (e.g., systems with open exchange of CO,). Equilibrium calculations by GEOCHEM-PC may be made over a wide range of ionic strengths. For this purpose, the infinite-dilution, activity-based equili- brium constants from the thermodynamic database are converted to conditional stability constants with single-species activity coefficients for each reactant and product species, When the ionic strength is <0.5 mol L“, the Davies (1962) 256 PARKER ET AL. equation is used to estimate activity coefficients of charged species, while a modification of the Helgeson (1969) equation is invoked for systems in which 1 > 0.5 mol L* (Sposito & Mattigod, 1980). Activity coefficients for neutral species are approximated according to Harned and Owen (1958, p. 531-532), with k, fixed at 0.1 (Sposito, 1984). The program permits ionic strength to be stipulated by the user, or to be computed from the input data, In the latter case, the conditional equilibrium constants are recomputed after each program iteration if the current value of J differs from that of the previous iteration by more than 0.5%. Thus, convergence is not reached until the computed speciation, the ionic strength, and the conditional constants are all stable and self-consistent, DIFFERENCES BETWEEN GEOCHEM-PC AND GEOCHEM. It would be impractical to detail all of the changes that have been incor- porated into GEOCHEM-PC, but the more salient features are summarized here. ‘The corrections to the numerical code described by Sposito (1986) have all been incorporated. GEOCHEM-PC properly interprets pH as the negative common logarithm of the proton activity (not the proton concentration), and docs not suf- fer from “drifts” in the conditional stability constants due to truncation errors (Parker et al., 1987; errata in Soil Sci. Soc. Am. J. 51:1092, 1680). A number of other minor coding flaws have been corrected to maximize program accuracy and self consistency. We have attempted to test the program over a broad range of applications, but the experiences and comments of users will nonetheless con- tinue to be an important means of identifying needs for program improvement. Because other programs accommodate surface modeling better, and to help simplify the numerical algorithm, we have removed the cation exchange and metal adsorption models inherited from GEOCHEM. Alll input and output operations have been modified for enhanced user convenience and to reflect compatibility with personal computer operating systems. A configuration file (GEOCHEM.CFG) is included which allows the user to place the program, database file, input files, and output files on any disk drive, and in any subdirectory. A user interface has been constructed so that data input can be provided interactively, or with an ASCII input file. The output tables have been modified to reduce file size, and to provide additional information, including (i) species activities, and (ii) a record of the program version, the time and date, and the database, input, and output files in use for the program run. The format of the thermodynamic database has been altered for better legibility and for greater ease of editing, and it now includes attributions and references for many of the stability constants; these features are detailed in a later section. New features of GEOCHEM-PC include a subroutine that computes the net charge balance after convergence by summing all positive and negative species, thus providing two principal benefits. First, the user is alerted when charge bal- ance is poor, so that the input data may be inspected for errors or omissions. ‘Second, the computed charge balance can be useful for certain problems, such as determining the speciation in some types of solutions which freely exchange CO, with the atmosphere (see below). Another added feature is that stability constants for complexes and simple solids can be interactively altered during a program GEOCHEM-PC 257 run. Sensitivity analyses of the effect of variation in the stability constants on computed speciation (see, e.g., Schecher & Driscoll, 1987) is thus more conve- nient because repeated editing of the thermodynamic database is not required. PROGRAM CAPABILITIES AND CONVENTIONS Soluble Complexes and Simple Solids During a single program run, GEOCHEM-PC can simultaneously consider up to 20 metals and 30 ligands, and perform computations for 10 different “cases” (i.e., 10 sets of input data). For each metal-ligand pair, up to six soluble complexes and up to three different simple solid phases can be considered. The thermodynamic database allows for up to 50 individual metals and 99 different ligands. Note that different oxidation states of the same metal or ligand may count toward these maxima. For example, Fe(IU1) and Fe(II) are both component species in the database, and they are treated as independent species unless explic- itly linked by redox reactions. The conventions followed by GEOCHEM-PC are best gleaned from the example reactions in Table 13-1. Each complex or simple solid formed by a metal ion and a ligand is characterized by three stoichiometric coefficients (e.g., 13.0 or 11 1); the first is the number of metal ions, the second is the number of ligands, and the third is the number of protons consumed (if positive) or released (if negative) in the formation reaction. Inspection of Table 13-1 suggests correctly that GEOCHEM-PC treats the formation of all complexes and solid phases as association reactions. Moreover, all acid-base equilibria and hydrolysis eactions are written as protonation or deprotonation reactions. For example, reactions that could be written as consuming OH" must be written instead as hydrolysis reactions releasing H*. In addition, all reactions must be expressed as simple combinations of the component species specified in the thermodynamic database. Thus, all log K values are for overall, not stepwise, reactions. Last, note that the program is indifferent to characteristics of solid phases other than reac- tion stoichiometry and solubility. For example, the three Fe oxides/hydroxides given in Table 13-1 have identical stoichiometric coefficients (10-3); only the log, K values differentiate between the three solid phases. GEOCHEM-PC allows the user to impose or disallow specific simple solid phases. Imposition of a solid, however, merely includes a likely solid phase at the start of the run. As presently written, the program does not allow the imposition of equilibrium with a specified solid phase. To ensure that a given solid precipi- tates, excess concentrations of the appropriate metal and ligand must be specified during input. It is possible to specifically impose or disallow only one solid for a given metal-ligand pair. Moreover, disallowing one of the three possible solids works with certain limitations. If Solid 1 is disallowed, GEOCHEM-PC will ignore Solids 2 and 3 also, as if all three had been disallowed. If Solid 2 is disal- lowed, Solid 1 will be considered, but Solid 3 is ignored. If Solid 3 is disallowed, Solids 1 and 2 will still be considered. This characteristic can sometimes be uti- lized advantageously by arranging the three possible solids in decreasing order of solubility in the database (Solid 1 is most soluble, 3 is least soluble). Thus, by 258 PARKER ETAL, ‘Table 13-1. Examples of complexation and precipitation reactions considered by GEOCHEM-PC, illustrating the conventions used, Stoichiometric Reactions coefticients tog K 1. Acid-Base equilioria ‘a. Weak acid CH,CO0-+ Ht = CHsCOOH (acetic acid) on 48 b. Weak base NI (aq) + Ht = NH on 93 IL. Complexation reactions a. Simple complex Ct + SOF = CaS no 23 ». Mixed complex—MLH type Cie + POF + 2H = Call,PO} m2 21.0 ‘¢, Mixed complex—-MLOH {ype Felt + DTPA + HO = Fe(OH)DTPA® + Ht na 209 IL, Metal hydrolysis ‘APY + HO = AIOH?* + Ht 10-1 50 AB+ 4 21,0 + AMOH)} + 2H 102 “10.1 IV. Precipitation of simple solids (one metal and one ligand only, except for HOH) 4. Simple solid phase 10 46 Catt + SOF"+ 21,0 = CaS0,2H,0 (gypsum) b. Simple solid MLH type wt 189 Cat + PO} H42H,O = CaH1PO, 21,0 (brushite) «. Simple solid—MLOH type 432 18 4Mg? + 3CO} + SHO = Mga(CO,),(OH)y3H,0 + 24+ (iydromagnesite) V. Precipitation of oxides and hydroxides a. Melal-hydroxide solid phase 103 35 Fe 3H,0 = Fe(OH)3 (amorphous) + 311* b. Metal-oxyhydroxide solid phase 103 0.02 Fe +211,0 = 0-FeOOH (goethite) + 3H" ¢. Metal-oxide solide phase 103 0.09 Felt 4 3H,0 = 1/2 a-Fe,0s(hematite) + 3H* disallowing Solid 2 (and thus 3), one can “force” the program to consider the ‘more soluble solid phase (no. 1) if it is believed to be the more likely phase based on kinetic or other considerations. Similarly, disallowing Solid 3 permits equilib- rium to be established with Solid 2. This feature cannot be utilized blindly, how- ever, because the order of solubility of some solid phases (¢.g., Ca-phosphates of differing stoichiometry) varies with solution composition. Open-System Equilibria with Atmospheric Carbon Dioxide As discussed by Stumm and Morgan (1981) and Lindsay (1979), the solution pH, the pCO,, and the concentrations of carbonate species are linked by the following reactions CO? + 2H" = CO, (g) + H,0 w CO? + 2H* = H,CO; 2) GEOCHEM-PC 259 COz + Ht = HCO, (3) where H,CO; denotes the sum of CO, (aq) and “true” H,CO}. If any two of the parameters pH, pCO,, and a carbonate species are specified, the others are fixed and may be computed from the above equilibria. In the chemical analysis of water samples, the concentrations of individual carbonate species are not ‘determined directly, but rather are determined from measures such as total inorganic carbon (C,) of total inorganic alkalinity. An approximate definition of the latter quantity [Alk] + [HC0;] + 2[CO2] + [OH] - [H*] (41 where, for simplicity, the contributions of carbonate ion paris and complexes have been omitted (but ate understood to contribute to alkalinity in proportion to their degree of protonation). ‘To simplify the computational algorithm, GEOCHEM-PC (like its prede- cessors) treats exchange of gaseous CO, as the mathematical equivalent of the solubility equilibria of a fictitious solid phase, H,CO, (s), whose solubility is pro- portional to the partial pressure of CO,. When H,CO, (s) “precipitates” during a program run, the program has predicted that dissolved CO, has left the solution, ie., escaped info the atmosphere. When H,CO, (s) “dissolves,” CO, has entered the solution, ic., been absorbed from the almosphere. Unfortunately, the amount of inorganic C in the atmosphere cannot be controlled independently, but exists only as the excess of C, above that present in solution at the specified pH and pCO, level. The exchange of CO, with the atmosphere causes C;, to vary. Because neither electroneutrality nor the proton condition are imposed by the program, alkalinity cannot be treated as a conservative quantity, preventing direct solution. of certain types of problems. This limitation can, however, be largely overcome by utilizing new features of the program. GEOCHEM-PC facilitates open-system CO, calculations by computing {Alk] and the charge balance of the solution. The program computes [Alk] from the calculated distribution of dissolved carbonate species, and provides this value in the program output whenever carbonate is included as a component species. ‘The computed [Atk] includes contributions from all carbonate complexes and ion pairs such as NaHCO? and CaCO?, but not from species such as borate. In addi- tion, when run as a closed system (log pCO, = 0), Eq. [1] is solved and the the- oretical pCO, in equilibrium with the carbonate species in solution is included in the program output. These program-computed parameters permit solution of many problems by following the procedures outlined in Table 13-2. In Table 13-2, “input” parameters are values that are known of specified, and “unknown” parameters are the objectives of the computation. For Type 1a and 2a problems, [AIk] is “known,” but cannot be directly input into the program. Note that ‘Type ‘Reactions of carbonic acid are most conveniently formulated to implicitly incorporate the equitib- rium between the predominant, aquated CO, species (CO, (aq)}, and the much less prevalent, “trie” undissociated acid, H,CO, (see Stumm & Morgan, 1981). PARKER ET AL. weifoad 4q andino axe 45 ann pue [atv] pamndwen “(a1eudsoune ‘1 sad089 99) 1p ssaox9 qui uraisns ado se umy umowqun mou anduy anda € andino 512004 pamndwog -wasks pasoyo se um indy - emooyen andy @ ureroud q yndino st god paindwoy -g = sourjeg 2812p 10 ‘[yty] wMoUy = ary] pamedoo aun 4p Sundzen quia woas4s pasos e ung. a sou, ewouyu, nda @ -tvuss Auuseoea 8 [(8) SOF, «parednaid,] 709 yo food auaydsoue yotuin we Hd sx puug “sana pad paxy jasases we worshs ado se ony dy 7 edu uxooUN a “Hd spavi09 aun st ‘9 = souepeg aBeND 10 ‘[4ry] moun = (a1v] paid sen yoru p44 gy “songea Hd poxy eionas we 4p ssoox9 tii unisds ado se uy = sony, indy wxomyun, a amnpoo0r 5 Biv ®ood ad sdk “Dd-WAHOOO Hurst suopeinduios 29D wrawks-uado Sayauopied 1oy suondo owos jo wuNNG “GST AGEL on (GEOCHEM-PC 261 1a, 1b, and 2a problems require that the program be run at several specified pH or pCO, values, and the correct solution found via interpolation. Our experience has been that no more than two program runs are required, the first can identify a sufficiently narrow range in pH or pCO, that the second can locate the correct value exactly. For solutions where no solid phases are predicted to precipitate [other than the fictitious HCO, (s)], eitherthe computed {Alk] or computed charge balance can be used as the criterion for Type 1a and 2a problems. If a solid phase such as calcite is predicted to precipitate, however, alkalinity is effectively lost from the solution phase, and only a computed charge balance of zero is the correct cri- terion for solving the problem. Note also that whenever HCO, (s) is reported by the program to have dissolved, it has done so completely and there is insufficient inorganic C in the system to maintain the specified pCO, level. GEOCHEM-PC alerts the user to this loss, and advises that the case be rerun using a higher input concentration of C,. Oxidation-Reduction Reactions ‘The master variable, pE (see Stumm & Morgan, 1981), is used to specify the redox potential of the system arid is required if redox reactions are to be considered. GEOCHEM-PC is not designed to predict pE (or £,) based on input concentrations of redox reactants and products. The program permits consideration of up to 20 redox reactions in a single program run, and the thermodynamic database may con- tain up to 30 different redox reactions. We reiterate the general ‘caution regarding redox computations with geochemical speciation models—inclu- sion of a redox couple should be based on a reasonable expectation that both reac- tant and product are present in significant amounts (Sposito & Mattigod, 1980). Otherwise, the system is very poorly poised with respect to redox, and the very low ‘concentrations (often <10 mol L~') calculated for the minor species greatly increase the probability of convergence problems and floating-point math errors, The five example reactions presented in Table 13-3 illustrate how GEOCHEM-PC handles redox computations. Class C reactions are the easiest to grasp. These involve two metals (e.g., Fe[IIl] and FefII]) or two ligands (¢.g., S[V1] and S[-II]), and both members of the redox couple are component species in the thermodynamic database. By convention, the program assigns the total concentration of metal or ligand to the reactant species, regardless of how the Table 13-3. Examples of redox reactions considered by GEOCHEM-PC, illustrating the conven- tions used. Reaction class ‘ypet Reaction log K A 4 Dg? + 2e- = Hay" (aa) 308 A 3 VO? + 3H,0 = H,VO; + e+ 4Ht 240 B 2 Ma? + 2H,0 = MnO (pyrolusite) + 4H + 26~ 9 c 10 SO}+ BH + Ser = S* + 4H,0 207 c -10 Felt +e = Fee -130 + A mumerical code used by GEOCHEM-PC to differtiate reaction types. 262 PARKER ET AL. concentration data are entered during input. Thus, the output tables will display a total concentration of zero for the product metal or ligand, but the free concen- trations and activities of both reactant and product are given correctly. Reaction Classes A and B require a more indirect approach. For these reactions, the product species are not component species, nor combinations of ‘component species. They are instead treated by the program as a complex or solid phase formed from component species. For Class B reactions, a solid phase is the reaction product, and it is assigned to the first available “slot” in the array of three possible solids for the reactants (e.g., the new solid phase MnO, is formed from Mn{II] and OH- in the example given in Table 13-2). Thus, if there are two “genuine” Mn(II)-OH solid phases in the database, the predicted quantity of pyrolusite precipitated will be reported in the program output as “Mn +2 OH- Solid #3.” Class A redox reactions are handled by treating the product species as complexes of the reactant and OH” (for metals) or H* (for ligands). For the Hg(I1) — Hg(1) example, where the product is not a component species in the database, the Hg2* species is given as a 20 0 complex of Hg” and OH". For V (IV-V), the oxidation involves conversion of a metal to ligand, which GEOCHEM-PC cannot handle directly. Consequently, even though vanadate is a component species jgand) in the database, the H,VO; species must be treated as a 10-4 complex of the VO" metal and OH. Note that for a ligand such as vanadate, several different redox reactions would need to be specified to account for all possible product species (i.e., H,VO8, H,VO;, and HVO#) if the pH range of interest were broad. Mixed Solids GEOCHEM-PC can consider a maximum of 13 mixed solid phases during a program run, and the database may contain 20 such solids in all. There are two types: those that contain, at most, two metals, two ligands, plus Al, Si, H, and OH, and those that can contain up to four metals, plus Al, Si, H, and OH as the only ligand. The latter type is useful for phyllosilicates and similar mineral phase. The conventions for writing the reactions are similar to those illustrated in Table 13-1. We suggest that users employ this feature with caution, and only use it when there are strong indications that the mixed solid of interest is actually present in the experimental system. Gibbs phase rule violations, lack of convergence, and float- ing-point math errors are all likely to occur during mixed solids computations. Disallowing any simple solids that also might precipitate will often increase the probability of a successful computation. If complex solids are a primary research interest, our general advice is to consider other programs better-suited to this task (c.g., MINTEQA2). Other Options Although solution pH is routinely measured experimentally, GEOCHEM-PC will compute a predicted solution pH based on the total concentrations of metals, ligands, and a parameter termed “TOTH” (for total proton concentration). This feature can be useful for hypothetical cases, such as predicting the final pH after two different waters are mixed (Sposito & Mattigod, 1980). The TOTH parameter is essentially a restatement of the proton condition GHOCHEM-PC 263 TOTH (mol L') + ¥ nfacid] + [H*] — Zm[base] — [OH] {5] where [acid] is the concentration any species containing n dissociable protons, [base] is that of any species containing m dissociable hydroxyls, [II"] is the concentration of protons from strong acids (such as HCI), and [OH] the concen- tration of hydroxyls from strong bases (such as NaOH) (Sposito & Mattigod, 1980). For natural waters, [H*] and [OH"] may be viewed as the quantities of titratable mineral acidity and mineral alkalinity, respectively (Stumm & Morgan, 1981). The TOTH parameter may be cither positive or negative, indicating a net “addition” of either acid or base, respectively. ‘The examples in Table 13-4 help illustrate use of the TOTH parameter in GEOCHEM-PC. The key is that contributions to TOTH are always computed relative to the component species. Thus, although addition of NaHCO, is normally viewed as an addition of base (or alkalinity), it actually constitutes an addition of H* relative to the component species for inorganic carbonate, which is CO. Similarly, an addition of Na,CO, does not change the proton condition with respect to CO, while increasing pCO, (and thus H,CO;) increases TOTH by two protons per dissolved CO,,. Note that the component species for hydrolyz- able metals such as AI(II}) are generally specified as the completely dissociated ion, hence they do not contribute to TOTH (Table 13-3). Vanadate was included in Table 13-4 to illustrate that the component species present in the database need not be fully dissociated. The final pK, for vanadate is so high that the VO} species would seldom be of interest, so HVO2 was selected as the component species. Thus, the contributions of Na,VO, and NaH, VO, to TOTH are —1 and +1 mole per mole of V, respectively. ‘As mentioned previously, GEOCHEM-PC can be run with either computed or fixed ionic strength. The latter option is convenient for complex systems where all of the component species may not be known or experimentally determined (€g,. soil solutions). In such situations, the solution electrical conductivity can be ‘Table 13-4, Examples of how contributions to the TOTH parameter should be computed when solu- tion pH is to be computed by GEOCHEM-PC. ‘Component Compound species added Change in TOTHY AB AIC, ° Al(OH), 3 coy NaCO3 0 NafiCO, 4 C0,(1,005) 2 NHS NH; (aq) or NH,OH 0 NHAC! 4“ CH,COO- (acetate) NaOAC 0 HOAC 4 Hoy Na;VO, 1 NatigVOst 4“ + The coefficient given multiplied by the molarity of the added compound yields the net change in TOTH in moles per liter. +# The salt formed when commercial Na-metavanadate (NaVOs) is dissolved in water. ——— 264 PARKER ETAL. measured and used to estimate J based on empirical relationships (sce, e. Griffin & Jurinak, 1973); the estimate is then entered as the fixed ionic strengtt with GEOCHEM-PC during data input. DATA INPUT AND OUTPUT Data Input GEOCHEM-PC can be run in a strictly interactive mode wherein all input data are entered in response to questions posed by the program. The questions are quite explicit, and give clear instructions as to how the various input items should be formatted (c.g,, the need for negative logarithms of concentrations). For first- time users, the interactive mode forces stepwise consideration of the required input that may make later use of the input file option easier. For large data sets, for flexibility in data entry, for repetitive calculations, and for ease of editing, most users will find the use of ASCII input data files more convenient. This feature is especially valuable for problems of a hypothetical or theoretical nature that require repetitive runs with changes in only selected values, such as pH, pE, or pCO,. In addition, errors in the input data can be cor- rected easily so that problems can be rerun without burdensome retyping of all data. ‘The input data file is an ASCII text file named xxxxxxxx.DAT, where xxxxxxxx is any name of the user’s choice which is < eight characters. As a default, the output file is assigned the same name with the extension .OUT, but the user may override this and enter another name for the output file. The file MASTEXPL.DAT (MASTer EXamPLe file, see Fig. 13-1) illustrates the required format, as well as how the various options are specified during input. Each line of input data is preceded by a numbered line with a descriptive com- ment to assist the user in editing the input file. Note that input items specified by lines 1 through 22 are always read by the program, and must be appropriately edited for every program run, Parameters 23 through 31 are ignored by the program unless the options selected previously require their use. They need not be edited for every run, but it is most convenient to always retain them in their proper order in the file; this ensures that the program can correctly locate all needed data, regardless of the options selected. Output Fites The output file from GEOCHEM-PC always includes two tables: the first summarizes the program run, including all of the input concentrations and master variables (¢.g., pH, pE); the second lists all of the thermodynamic stability constants used, in a format similar to that of the database. Five other tables for each individual case can be generated, if specified. These include: (i) a table of conditional (ionic-strength corrected) stability constants (it will appear only once for a run when K is fixed, but for each individual case in a run wherein J is computed by GEOCHEM-PC). (ii) A table listing the free activity, free concen- tration, and total concentration of each component species, along with pH and other data such as the amounts of precipitated solids. (iii) Tables of GEOCHEM-PC 265 LINE 1. input fle for GEOCHEW-PC, v. 20. A descriptive comment follows. This is a master example data file for GEOCHEM-PG, v. 20. It ILLUSTRATES all LINE 2. Second descriptive comment follows (80 chat. max). options. DO NOT run it: too many options specified for successful calculation. LINE 8 Maximum number of iterations: usually 25 to 50 50 LINE 4. Convergence criterion: usually 1.06-4 ‘Do LINE 5. Number of metals to be considered, including H+ 7 LINE 6 Number of ligands to be considered, including OH — 5 LINE 7. Number of cases to be run (t to 10) 2 LINE 8, O=solids can ppt.; ~ none allowed; n= number to be imposeditisallowed 2 LINE 9. pH control: { = fixed pH; c = pH is calculated by GEOCHEM ° LINE 10. Redox reactions to be considered? y = yes n= no y LINE 11, Mixed solids to be considered? (y or n) y LINE 12. lonic strength to be fixed? y = Q LUNE 13, Interaction output: 0=none; 0 LINE 14, Output case progress table (y or n)? xed; n = calculated by GEOCHEM =capacitios; intensities; 3=both y LINE 1. Output for complexes? =none; 1 =concentrations; 2=activties; 3=both LINE 18. Output ovoral speciation table fy or nj? LINE 17. Output primary percentage distribution of species table (yor n)? LINE 18, Output tbls) of conditional og K's fy orn)? n LINE 19. Fixed or guessed i 0010 LINE 20, Metals: code no, —log of free metal guess (1st case), and each case 1.31 8000 3000 527 2678 2678 6 80 4699 4699, 763 4.699 4699 9.80 5000 5000 33.63.5301 5301 LINE 21. Ligands: code no., —log of free ligand guess (1st case), and each case 140 2301 2301 3.27 2.699 2.699 9.80 4301 4301 57 2.7 2699 2.699 LINE 22. pH for each case: measured; or guesses when pH calculated by GEOCHEM-PC 7000 8000 LINE 23. TOTH: total H+ (molfL); used only for calculated pH (neg. value = OH-) 50004 —500e-4 LINE 24, pCO2: —log partial CO2 pressure (0 for closed); used only with COS ‘3500 3500 LINE 28. pE data: —log electron activity; used only for redox calculations 8000 8000 nic strength (mol/L) Fig, 13-1, Master input data file (MASTEXPL DAT) for use with GEOCHEM-PC. | 266 PARKER ET AL. LINE 26. pN2 data: —log partial N2 pressure; used only for redox cales. w/ NO3~ 0096 0096 LINE 27. Imposedidisallowed solid phases: see manual (neg. value = disallow) 19199-1 LINE 28, Number of redox reactions to consider; used only if item 10 = 'y’ 2 LINE 29. Redox reaction code numbers separated by a space. See manual for list 122 LINE 90, Number of mixed solids to consider; used only if item 11 2 LINE 31. Mixed solids code numbers: see manual for list (neg. value = disallow). 1013 y Fig. 13-1(continued). Master input data file (MASTEXPL.DAT) for use with GEOCHEM-PC. concentrations and/or activities of soluble complexes in both negative common logarithm and exponential format. (iv) A pair of tables giving the concentrations of free metals, free ligands, and metal-ligand complexes—they differ in that the first expresses the concentration of metal-ligand complexes as the total concen- tration of each metal complexed with a given ligand, while the second gives the total concentration of each ligand complexed by a given metal. This dichotomy is necessary to accommodate the stoichiometry of complexes with multiple metal or ligand moieties, such as M,L or ML,. For 1:1 complexes, these tables are iden- tical. (v) A summary table giving the distribution of each metal and ligand among, its main species, expressed as a percentage of the total metal or ligand present. Only values of 0.01% or greater are included for simplicity. ‘THE THERMODYNAMIC DATABASE Our objectives in modifying the structure of the thermodynamic database were severalfold. First, we wanted to make the selection of component species flexible and readily alterable by the user. The six-character names (which arc reproduced in the output tables) are now specified in the first section of the data- base file, rather than as part of the source code. Users may thus add, delete, or substitute metals or ligands, up to a maximum of 50 metals and 99 ligands, and ‘may edit the six-character code names to suit their preferences. For each metal and ligand in this list, space for additional annotation is available on the same line that can provide formal or IUPAC names; these are for internal documentation and do not appear in the program output. Second, we wished to make the database easier to read and to edit without error. We have expanded this ASCII file from 80 to 132 column format. This has permitted more space between the entries, and the inclusion of actual values of log K with explicit decimal point (rather than as integer values equal to 10log K as in prior versions). The log K values may now be entered with two decimal places, when such precision is justified. In addition, extra comment lines are included at the beginning of each section of the database to provide space for user notes and internal documentation of formats and database restrictions. Also, the program, not the user, now keeps track of the total numbers of metals, ligands, AL non ions the zen- the lyis alor fen- wong ‘ent. base -cies are fata- 2, 0r and retal line tion hout + has sof gk imal sare user , the nds, (seme (GEOCHEM-PC 267 and metal-ligand pairs for which complex and simple solid phase stability con- stants have been included, thus eliminating a frequent source of error encountered when editing and counting lines in earlier versions of the database. Last, we felt it was crucial to provide attributions for all stability constants that we have altered, added, or checked. Our attributions include: (i) brief (35- character maximum) annotations at the end of each line of data, (ii) footnotes (referenced by metal and ligand code numbers) when more explanation is required, (iii) a list of literature references including a short-hand code for each reference, and (iv) a list of the people (coded by their initials) who have con- tributed to the selection of data. An example of the first item appearing at the end of a line for a metal-ligand pair is WAN:Li79(solids); DRP:St81(cmplxs) indicating that one of us (WAN) has selected log K values for all simple solids from Lindsay (1979), while another (DRP) has chosen values for all of the com- plexes from Stumm and Morgan (1981). If no end-of-line annotation is present, the log K values on that line have not yet been checked or evaluated by us. We have relied mainly on published compilations such as those of Martel! and Smith (1974-1989), Baes and Mesmer (1976), and Lindsay (1979), as sources of thermodynamic data. We have scrutinized original research reports in cases of special interest to us, but in general our selection of log K values should not be viewed as a critical assessment of the original literature. Rather, we have sought to correctly identify the immediate sources of the data included. This provides users with the opportunity to locate and evaluate original research reports if they wish. A section of footnotes is included to further explain certain selections and to identify solid phases when their identity is not readily apparent. We have taken pains to ensure that our values represent log K’s at zero ionic strength as required by the program. When needed, the Davies equation (or Helgeson’s if / > 0.5 mol L") was used to adjust log K values to zero ionic strength, because this relationship is the one used by GEOCHEM-PC to compute conditional constants from the database. FUTURE DEVELOPMENTS Many of the features that we have incorporated into GEOCHEM-PC have been in response to comments and requests from program users. We expect that these will continue to influence any future modifications and improvements. Our assessment of long-term needs includes: (i) a “master” output table that would summarize the speciation for all 10 cases from a program run, (ii) a more conve- nient and intuitive user-interface (ie., a better “front-end”), and (iii) continued improvement of the thermodynamic database via careful selection and attribution of equilibrium constants. We welcome suggestions from users and, for the third objective especially, we would appreciate assistance from others. The database presently contains equilibrium constants for over 1100 metal-ligand pairs; sel tion of the best available stability constants is necessarily an on-going process, 268 PARKER ET AL. PROGRAM SPECIFICATIONS AND AVAILABILITY ‘The source code for GEOCHEM-PC is in the public domain and is available upon request. It is writen in FORTRAN, and conforms closely to the FORTRAN-77 standard. The executable program for GEOCHEM-PC, Version 2.0, has been compiled using MicroSoft Fortran (V. 5.0), and occupies about 150 kB of disk space. It should run successfully on any IBM or compatible personal ‘computer (PC) operating under the DOS 3.0 program or higher. At least 512 kB of main (board) memory is recommended. The executable version does not require a math coprocessor, but will utilize one if it is present. On computers without a coprocessor, an emulator is invoked for floating-point math, but the program is slowed. A hard disk is highly recommended, but the program can be run using one or two floppy disk drives. The thermodynamic database is an ASCII file that presently occupies about 140 kB of disk space. It can be edited with any ASCII editor or ASCU- compatible word processor capable of handling a file of this size with a 132- character line length. New users are urged to proceed cautiously when editing, and to back up the database file frequently. Corruption of the file by embedding tabs or control characters, or by “wrapping” of the 132 column lines, will cause program failure. The configuration file (GEOCHEM.CFG) and the example input file (MASTEXPL.DAT) are small, 80-column ASCII files. They are intended for editing by all users. Alll requests for the program and documentation should be addressed to Dr. David R, Parker Department of Soil & Environmental Sciences University of California Riverside, CA 92521 Requestors are asked to send a formatted floppy disk of their preference (5.25 or 3.5 in.; high or low density) on which we will supply the executable version of the program, the database, and other needed files, including a set of example input files. The source code also is available on request. There is presently no charge for providing the software and files. ACKNOWLEDGMENTS We are grateful to Dr. Lee Sommers, Colorado State University, for his pro- gramming contributions to the program. We would also like to thank W.P. Inskeep, PF. Bell, D.L. Suarez, W.J. Horst, U. Grauer, C. Amrhein, and a number of other program users for their helpful comments and criticisms of earlier versions of GEOCHEM-PC. : REFERENCES Bacs, CR, Jr, and RE. Mesmer. 1976. The hydrolysis of cations. John Wiley & Sons, New York: Baham, J. 1984. Prediction of ion activities in soil solutions: Computer equilibrium modeling. Soil Sci. Soe. Am. J. 48:525-53. Davies, C.W. 1962, lon association, Butterworths, London. at L 8 8 xe ut o P. ot or GEOCHEM-PC 269 Griffin, G.P, and J, Jurinak. 1973. Estimation of activity coefficients from the electrical conductiv- ‘ty of natural aquatic systems and soil extracts. Soil Sei. 116:26-30, Harned, H.S, and B.B, Owen, 1958. The physical chemisiry of electrolytic solutions. Reinhold, New ‘York. Helgeson, H.C. 1969. Thermodynamics of hydrothermal systems at elevated temperatures and pres- Soures.Am. J Sci 267°729-608, - ” Lindsay, W.L. 1979. Chemical equilibria in sols. John Wiley & Sons, New York. Lindsay, WL, and FLA. Ajwa. 1995, Use of MINTEQA2 for teaching soil chemisty. p. 219-239, In fl, Loepper etal (e¢.) Chemical equilibrium and reaction models. SSSA Spec. Publ. 42. ASA and SSSA, Madison, Wi Martell, AE., and RM, Smith. 1976-1989, York. Mautigod, $.V. 1995. Chemical equilibrium and reaction models. Applications and future trends. 5. In RH Locppert et al. (ed) Chemical equilibriam and reaction models. SSSA Spec, Publ. 42.ASA and SSSA, Madison, Wi. S.V,, and G. Sposito. 1979. Chemical modeling of trace metal equilibria in contaminated oil ‘sofuions using the. compuisr program GEOCHEM. p. 837-836. fa EA. Jenne (ed) Chemical modeling in aqueous systems. ACS Symp, Ser. no. 93. ACS, Washington, DC. McDuff, RE, and FM.M. Morel. 1973. Description and use of the chemical equilibrium program REDEOL2. Tech. Rep. EQ-73-02. California Inst. Technol., Pasadena, CA. Morel, FMM, and J.J. Morgan, 1972. A numerical method for computing equilibria in aqueous chemical systems. Environ. Sci, Technol. 6:58-67. Parker, D.R., RL. Chaney, and W.A, Norvell. 1995. Chemical equilibrium models: Applications to ‘lant nutrition research. p. 163-300. x RLH. Loeppert eta. (ed.) Chemical equilibrium and reac- tion models. SSSA Spec. Publ. 42. ASA and SSSA, Madison, WI Parker, D.R., LW. Zelazny, and". Kinraide. 1987. Improvements tothe program GEOCHEM. Soil ‘Sei, Soe. Am. J. 51:488-491. Schecher, WD., and C.T, Driscoll, 1987, An evaluation of uncertainty associated with aluminum equi- librium calculations. Water Resour. Res. 23:525-534 Spostg,G, 1984. Chemical models of inorganic pollutant in soils. CRC Ct. Rev. Environ, Cont. 15-24, Sposito, G. 1986, Corrections tothe program GEOCHEM. Soil Sci. Soe. Am. J. $0:270. Sposito,G., and S.Y. Maltigod. 1980. GEOCHEM: A computer program forthe ealcuation of chemi cal equilibria in soil solution and other natural water systems. Kearney Found. Soil Sci, Univ of California, Riverside. ‘Stumm, W, and J.J. Morgan, 1981, Aquatic chemistry. nd ed. John Wiley & Sons, New York ical stability constants. 6 vols, Plenum Press. New

You might also like