Science, Faculty of
Earth, Ocean and Atmospheric Sciences, Department of
DSpace
UBCV
Perkins, Ernest Henry
Master of Science - MSc
University of British Columbia
Many geochemical processes involve the reaction of an aqueous phase with minerals with which the aqueous phase is not in equilibrium. Prediction of the change in the composition and in the number of moles of phases and of aqueous species as the system proceeds toward overall equilibrium is made possible by differential equations formed from mass balance, mass action, ionic strength and activity of water equations. The equations developed by Helgeson, Brown, Nigrini and Jones (1970) have been examined and alternate forms of the differential equations which constrain reaction progress have been proposed. These new equations include correct terms for the change in the mass of water, the change in the activity of water and the change in the number of moles of each endmember of the solid solution phases. The equations have been formulated to allow a more efficient algorithm for numerical evaluation. General forms for all equations are presented. A FORTRAN program for the calculation of mass transfer in an isothermal and isobaric system and a description of the program are given.
A REINVESTIGATION OF THE THEORETICAL BASIS FOR THE CALCULATION OF ISOTHERMAL-ISOBARIC MASS TRANSFER IN GEOCHEMICAL SYSTEMS INVOLVING AN AQUEOUS PHASE by ERNEST HENRY PERKINS B.Sc, the University of B r i t i s h Columbia, 1975 A THESIS SUBMITTED IN PARTIAL FULFILMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF SCIENCE in THE FACULTY OF GRADUATE STUDIES Department of Geological Sciences we accept t h i s thesis as conforming to the required standard THE UNIVERSITY OF BRITISH COLUMBIA May 1980 (§) Ernest Henry Perkins, 1980 In presenting this thesis in partial fulfilment of the requirements for an advanced degree at the University of British Columbia, I agree that the Library shall make i t freely available for reference and study. I further agree that permission for extensive copying of this thesis for scholarly purposes may be granted by the Head of my Department or by his representatives. It is understood that copying or publication of this thesis for financial gain shall not be allowed without my written permission. Department of Ge o l o g i c a l Sciences The University of British Columbia 2075 Wesbrook Place Vancouver, Canada V6T 1W5 D a t e May 16, 1980 i i ABSTRACT Many geochemical processes involve the reaction of an aqueous phase with minerals with which the aqueous phase i s not i n equilibrium. Prediction of the change i n the composition and i n the number of moles of phases and of aqueous species as the system proceeds toward o v e r a l l equilibrium i s made possible by d i f f e r e n t i a l equations formed from mass balance, mass action, ionic strength and a c t i v i t y of water equations. The equations developed by Helgeson, Brown, N i g r i n i and Jones (1970) have been examined and alternate forms of the d i f f e r e n t i a l equations which constrain reaction progress have been proposed. These new equations include correct terms for the change i n the mass of water, the change i n the a c t i v i t y of water and the change i n the number of moles of each endmember of the s o l i d solution phases. The equations have been formulated to allow a more e f f i c i e n t algorithm for numerical evaluation. General forms for a l l equations are presented. A FORTRAN program for the calculation of mass transfer i n an isothermal and isobaric system and a description of the program are given. i i i TABLE OF CONTENTS ABSTRACT i i TABLE OF CONTENTS i i i LIST OF EQUATIONS i v LIST OF TABLES V LIST OF SYMBOLS v i ACKNOWLEDGEMENTS v i i i INTRODUCTION 1 CHOICE AND NUMBER OF COMPONENTS 2 THEORETICAL CONCEPTS 6 Mass Balance 8 Mass Action 11 A c t i v i t y Coefficients 13 A c t i v i t y Of Water 17 Sol i d Solution Minerals 19 THE GENERAL SOLUTION 25 The F i r s t Derivative 26 Higher Order Derivatives 32 I n i t i a l Solution Composition 33 Prediction Of Saturation 34 CONCLUDING REMARKS 36 SELECTED REFERENCES 37 APPENDIX 1 39 Ionic Strength 41 Mass Balance 42 A c t i v i t y Of Water 43 Mass Action 46 APPENDIX 2 52 The Program PATH 52 Data Stucture For Unit 3 55 Data Structure For Unit 5 63 Restarting PATH 69 Error Messages 70 Example 72 APPENDIX 3 S3 i v LIST OF EQUATIONS Equation (1) 4 Equation (2) 8 Equation (3) 9 Equation (4) 9 Equation (5) 10 Equation (6) 10 Equation (7) 11 Equation (8) 12 Equation (9) 12 Equation (10) 14 Equation (11) 15 Equation (12) 15 Equation (13) 15 Equation (14) 16 Equation (15) 16 Equation (16) 18 Equation (17) 18 Equation (18) 18 Equation (19) 20 Equation (20) 20 Equation (21) 21 Equation (22) 21 Equation (23) 22 Equation (24) 22 Equation (25) 23 Equation (26) 25 Equation (27) 27 Equation (28) 30 Equation (29) 30 Equation (30) 30 Equation (31) 30 Equation (32) 30 Equation (33) 32 Equation (34) 33 Equation (1-A) 40 Equation (1-B) 40 Equation (1-C) 41 Equation (1-D) 42 Equation (1-E) 43 Equation (1-F) 44 Equation (1-G) 45 Equation (1-H) 47 Equation (1-1) 48 Equation (1-J) 48 Equation (1-K) 48 Equation (1-L) 48 Equation (1-M) 49 Equation (1-N) 49 Equation (1-0) 50 Equation (1-P) 51 V LIST OF TABLES Table I 6 Table I I 46 Table I I I 62 vi LIST OF SYMBOLS A, B Molal Debye-Huckel Parameters a , a ., a Activity of the cth component, of the jth solid ° J s solution species, of the sth aqueous species and of ai,<j> the i t h endmember of the $ th mineral, respectively § Ion size parameter of the sth aqueous species s c The derivative of..^ for the s th aqueous species s e end Number of solid solution species of the cbth solid * phase I True ionic strength of the aqueous solution K Equilibrium constant for the equilibrium reaction s between the sth aqueous species and the components m Molality of the s t h aqueous species s n Total number of moles of the cth component c ,T n. , n , n Number of moles of the i th endmember of the <j> th r s mineral, the r t h reactant, the sth aqueous species, nH2o and of water in the system, respectively NC • Total number of components NC Number of components which are described by solid p solution species NC Number of components described by aqueous species sp NP Number of solid phases in equilibrium with the system NR Number of phases reacting with the system NS Number of aqueous species in the system R Number of non-component mass action equations R Gas Constant T Temperature in Kelvins w For a charged species, the Deviation function; for a e neutral species, a constant which when multiplied by the true ionic strength is equal to the activity coefficient of the species. Typically modeled using the activity coefficients of carbon dioxide. v i i WG\, WG2 Margules excess energy parameters for the first and second solid solution species in a binary solid solution, respectively WGN A, WGO A Margules excess energy parameters for the first and second solid solution species in the <j> th solid phase, respectively 1,§ 2,cj> x., x1 , x2 Mole fraction of the j'th solid solution species and 3 of the first and second solid solution species in the <j>th mineral, respectively Zs Charge on the sth aqueous species J x J 2 Activity coefficients of CO 2 in water at ionic •*co2 ' ^ co2 strengths of ij and 12 , respectively Y S Activity coefficient of the sth aqueous species X. Activity coefficient of the ith solid solution 1'^> species of the <f>th phase 5 Reaction progress variable v. Number of moles of the cth component in one mole of 1'V'C the ith solid solution species of the <pth phase. v Number of moles of the cth component in one mole of r,c the rth reactant phase. v s ,c Number of moles of the cth component in one mole of the sth aqueous species. v i i i ACKNOWLEIXEMENTS The author wishes to express his sincere thanks to Dr. T.H. Brown, under whose supervision t h i s thesis was written. His assistance, helpful comments and c r i t i c i s m s have helped t h i s thesis immensely. Comments by Dr. H.J. Greenwood have also been of benefit. The author i s p a r t i c u l a r l y grateful to his wife, Laurie, for her patience and moral support. This research was funded by Natural Science and Engineering Research Counsel operating grant number A-8842. 1 INTRODUCTION Any chemical system in p a r t i a l equilibrium w i l l tend to approach t o t a l equilibrium by transferring mass among the phases i n the system. The t o t a l amount of mass transferred at any given stage of the reaction i s a measure of the progress of the reaction. I f no k i n e t i c constraints e x i s t , the progress of the system towards equilibrium can be analyzed by equilibrium thermodynamics even though reaction progress i s path dependent and i r r e v e r s i b l e . Although the concept of reaction progress has been present i n the chemical l i t e r a t u r e for many years (De Donder, 1920; De Donder and Van Rysselberghe, 1936; Prigogine and Defay, 1954), only recently has i t been applied to geological systems. Garrels and Mackenzie (1967) simulated the evaporative concentration of spring water by a d i s t r i b u t i o n of species method, a non-linear and i t e r a t i v e approach. Unfortunately, t h i s method has the major disadvantage that complete events (the saturation and subsequent dissol u t i o n of a phase) may be overlooked. Helgeson (Helgeson, 1968; Helgeson, Brown, N i g r i n i and Jones, 1970) recognized that the derivatives of the mass action and mass balance equations which constrain reaction progress form a system of l i n e a r equations. Helgeson modeled reaction progress as a continuous function by a power series i n the derivatives, a method that can be solved by l i n e a r techniques. Subsequent work on mass transfer theory (for example: F o u i l l a c , Michard and Bocquier, 1976) has generally been based on Helgeson's work although Karpov, Kay'min and Kashik (1973) and Parkhurst, Plummer and Thorstenson (1978) have used methods s i m i l a r to Garrels and Mackenzie. 2 Application of mass transfer theory to geological systems (for example: Helgeson, Garrels and Mackenzie, 1969; Helgeson, 1970; F o u i l l a c , Michard and Bocquier, 1976; P f e i f e r , 1977; V i l l a s and Norton, 1977) has shown that many di f f e r e n t geochemical processes can be modeled by mass transfer calculations, thus leading to a better understanding of geochemical systems. The purpose of t h i s paper i s to supplement and to make corrections to the theoretical basis of isothermal-isobaric mass transfer involving an aqueous phase as presented by Helgeson et a l (1970). Modifications of the mass balance and mass action equations to co r r e c t l y allow for the changing mass of water, a simple method to calculate the changing a c t i v i t y of water, and improved methods for the numerical solution of the mass transfer equations w i l l be presented. CHOICE AND NUMBER OF COMPONENTS Generally elements, oxides, simple ionic species and electrons are used as components although any phase or species, real or imaginary, may be used equally w e l l . The only constraint upon the nature and the number of components i s that the components must form an independent basis for the compositional space of a l l possible phases and species i n the system. The maximum number of components needed to describe any system i s the number of elements present i n the system plus one. A reduction i n the number of components (NC) occurs when there i s a li n e a r dependence between any two (or more) members of the component basis or when a component i s not present i n any of the phases or species. 3 Even though there i s no unique choice of components and any independent basis w i l l s u f f i c e to describe the system, a judicious choice of components often s i m p l i f i e s conceptual d i f f i c u l t i e s and shortens computations. For example, we have found that computations are made more e f f i c i e n t i f some or a l l of the components have fixed chemical potentials. This w i l l be discussed below. In any system each stoichiometric phase 1 i n equilibrium with the system w i l l f i x one chemical potential at a given temperature and pressure, and each n component s o l i d solution phase w i l l a r b i t r a r i l y f i x n independent chemical potentials at a given temperature, pressure and composition. In t h i s paper minerals i n equilibrium with the system w i l l be chosen as part of the component basis. Each stoichiometric mineral w i l l be chosen as one of the components, and each n component s o l i d solution mineral w i l l be chosen as n of the NC components that describe the system. For increased accuracy during computations, the remaining components w i l l be chosen from the most abundant independent aqueous species. Water w i l l generally be chosen as a component because of i t s abundance. When a phase or species i s chosen as a component the component has the same composition and a c t i v i t y as that phase or species. I f the bulk composition of the system l i e s outside of the convex space enclosed by the composition of the components, the t o t a l number of moles of some of the components may be negative. This can occur even though the phase, species or endmember which describes that component ^-Throughout t h i s paper the term "stoichiometric phase" or "stoichiometric mineral" w i l l be used to indicate phases that do not exhibit compositional v a r i a t i o n . 4 i s present i n the system. When discussing the properties (number of moles, a c t i v i t y or molality) of a phase or species chosen to describe a component, the phrase "component phase or species" or the phrase "component species" w i l l be used. A "non-component species" i s any species or phase that i s not a descriptor of the component basis. Because a mineral may only be i n equilibrium with the system during a portion of a reaction, the component basis w i l l change each time a new mineral becomes saturated with respect to an aqueous phase or a mineral dissolves completely into the aqueous phase. Matrix operations (Greenwood, 1975) offer a simple method to change from one component basis to another. In any system at equilibrium there are NC mass balance equations, one for each component, and R independent mass actions equations, one for each non-component phase or species i n the system. R i s defined by: NP R = NS - NC + V e n c ? - NC m sp Z-j <j> p y1) <j, = l NS i s the number of aqueous species i n the system and NP is._theL;numberz of minerals i n equilibrium with the system. N C S V and NC are the number of components that are described by aqueous species and by s o l i d solution species of minerals i n equilibrium with the system, respectively, end^ i s the number of s o l i d solution species of the 4>th mineral. I f the <f>th mineral i s stoichiometric, e n d ^ i s equal to one; i f i t i s a binary s o l i d solution, end^ i s equal to two. Generally NC^ i s equal to the t o t a l number of endmembers of minerals present, but i t w i l l not be under two conditions: when any of the minerals have more 5 s o l i d solution species than s o l i d solution components, or when one of the s o l i d solution components i s already present as part of the basis. A l l phases, species and endmembers present i n the system can be e a s i l y related to the components by wri t i n g the system i n a matrix format. Table I i s a simple example i n which the component basis i s potassium feldspar, quartz, potassium ion, hydrogen ion and water. These components have been used,to describe a v a r i e t y of non-component aqueous species. In Table I the s t h column i n the matrix contains the c o e f f i c i e n t s of the components ( v s J in the balanced chemical equation which describes the equilibrium between the component phases and species, and one mole of the s t h species. These c o e f f i c i e n t s are also c o e f f i c i e n t s of the components i n the mass action equation for that species. The l a s t R columns i n the matrix are one set of the R independent mass action equations. The c t h row i n the matrix i n Table I contains the co e f f i c i e n t s for the mass balance equation of the c t h component. The s t h position i n the c t h row i s the number of moles of the cth component in one mole of the s t h species ( v ^ ^ and t h i s i s multiplied by the t o t a l number of moles of the sth species to obtain the t o t a l number of moles of the c t h component present because of that species. 6 Table I CO O CO • H c n CM o • H c n + K A l S i 3 0 8 1 0 0 0 S i 0 2 0 1 0 0 K + 0 0 1 0 H + 0 0 0 1 H 20 0 0 0 0 + CM CO o CM o • H c n j -i j -o • H c n CO KOH A1(0H) Al(OH) A1(0H) 0 0 0 0 i 1 1 1 0 1 1 0 -3 -3 -3 -3 0 0 0 1 -1 -1 -1 -1 0 0 -1 -1 4 3 2 1 1 2 2 1 -2 -1 0 1 The components are potassium feldspar, quartz, potassium ion, hydrogen ion and water. Phases and species considered include F^SiOit, H3Si0i+, KOH, A l + + + , A1(0H)++, A1(0H)£ and Al(0H)3 as well as the components. The c o e f f i c i e n t s for the mass action equation of one mole of any phase or species to the component phases and species can be read from the column of the matrix corresponding to that phase or species. For example, the mass action equation for aluminum ion to the components can be written from the c o e f f i c i e n t s i n the aluminum column. I t i s In K A 1 ^ 3 = -1 I n a A 1 + 3 + l n a ^ . ^ - 3 l n a ^ ^ - 1 I n a K + + 4 I n a R + - 2 I n a ^ In a similar fashion, the c o e f f i c i e n t s for the mass balance equation of each component i s read across the row corresponding to that component. For example, the t o t a l amount of water i n the system i s nH 20,T = 1 n H 2 0 + 2 "H^SIO^ + 1 n H 3 S i O ^ + 1 nKOH " 2 n A l + 3 The symbol for the c o e f f i c i e n t of the cth component phase or species i n the mass action equation for the sth species i s v c s . The symbol for the c o e f f i c i e n t describing the number of moles of'the s t h species i n the mass balance equation of the c t h component i s v s,c« Because the matrix method has been used to obtain these c o e f f i c i e n t s , t h e i r numerical value i s i d e n t i c a l . 7 THEORETICAL CONCEPTS Helgeson showed that the progress of a reaction can be modeled as a Taylor's expansion in the derivatives of the mass action and mass balance equations taken with respect to reaction progress. The progress variable (E) was defined by DeDonder (1920), DeDonder and Van Rysselberghe (1936), and Prigogine and Defay (1954). The change i n the number of moles of the phases and species (dn/d5) i s calculated, and thi s change i s added to the t o t a l number of moles of each phase and species. Various techniques ex i s t to approximate nonlinear equations using t h e i r derivatives (Talyor's expansion, Predictor-Corrector, Runga-Kutta, Gear, etc) and the advantages and disadvantages of each type i s reviewed i n many standard numerical texts. The accuracy of these techniques increases with the number of derivatives used, but for t y p i c a l mass transfer calculations; no more than three derivatives are usually needed. M o l a l i t i e s and a c t i v i t i e s of aqueous species i n hydrothermal systems commonly range from 10" 1 0 to 3, but ranges of i d " 2 5 0 to 6 are not unusual. The derivatives of these m o l a l i t i e s and a c t i v i t i e s with respect to reaction progress (dm/dK, da/dK) w i l l have a si m i l a r range. To avoid i l l - c o n d i t i o n e d matrices these derivatives are solved as logarithmic derivatives. The change i n the number of moles of a mineral with respect to reaction progress (dn/dQ can be calculated either as a "normal" or as a logarithmic derivative, although under cer t a i n conditions which are discussed l a t e r , there i s an advantage using a "normal" derivative. By the use of the i d e n t i t y 11 n din n = d n " the "normal" derivative can be e a s i l y calculated 8 from the logarithmic derivative. Mass Balance The t o t a l number of moles of the c th component (n J in any C ,T geochemical system can be expressed as *=1 i = l s = l + V v n (2) r = i • • r ffiR i s the number of phases reacting with the system. n„ , n and n r are the number of moles of the s t h aqueous species, of the i t h endmember of the <f>th mineral i n equilibrium with the system, and of the r t h reactant, respectively, v , v and v. ± are the number of s ,c r,c i,§,c moles of the cth component i n one mole of the s t h aqueous species, i n one mole of the r t h reactant phase, and i n one mole of the i t h endmember of the cbth phase i n equilibrium with the system, respectively. In a stoichiometric phase the number of endmembers i s one, and the number of moles of that endmember equals the t o t a l number of moles of that phase. The derivative of equation (2) with respect to reaction progress i s 9 NP end^ N S dn _ \ ^ dn . , dn d? <j,= l i = l , dS s = l d? (3) NR E dn V r , c r = l d5 In a system closed with respect to mass equation (3) is equal to zero. If the system is not closed to some or a l l of the components (e.g., i f the f l u i d phase flows through the system), then the change of mass of those components must be specified. This can be done in several ways. For example, the change of these components can be defined as a known function of reaction progress, or an equal number of other variables in the system can be specified. In the third alternative, additional equations which constrain reaction progress in an open system can be added to the system of equations, and then the change of these components with respect to reaction progress can become unknowns to be calculated. The molality of the sth aqueous species (m^) is related to the number of moles of the sth aqueous species and the number of moles of solvent water (n J by n 55.51 m = (4) nH20 Rearranging equation (4) to solve for the number of moles of the aqueous species and taking the logarithmic derivative with respect to the progress variable, gives 10 dn s d£ n„ n m d i n m H90 s s 55.51 ' dg • m nrr n d i n n + s E?0 H?0 55.51 (5) Because solution compositions are generally expressed i n terms of m o l a l i t i e s , equation (5) can be combined with equation (3) and rearranged to obtain Y" v 5 5 ' 5 1 d n r - V V 5 5 - 5 1 v n d l n J r.= l H20 d? ( j ) = 1 i = 1 //20 d5 NS - ^2Vs" d i n n m H oO c s 6— d£ s = l 9 d i n Tn 272 S . C S s=2 d5 (6) Equation (6) i s the general derivative of the mass balance equation with respect to reaction progress. From equation (4) the molality of water i s a constant, and i t s derivative with respect to reaction progress i s zero. Therefore, the l a s t summation begins ats=2 because s=l has been reserved for water. Equations (4) to (6), i n c l u s i v e , can be d i r e c t l y compared to equations (61) to (63), i n c l u s i v e , of Helgeson et a l (1970). In addition to the d i f f e r e n t notation, a conceptual difference exists as w e l l . Helgeson et a l (1970) references m o l a l i t i e s and masses of minerals to a constant amount of solvent water (1000 grams). Thus, 11 during any reaction which changes the amount of solvent water, the number of moles of each component (referenced to 1000 grams of solvent water) must change i n response. The t o t a l number of moles of each s o l i d phase (both reactant phases and those i n equilibrium with the system) and the molality of each aqueous species must also change to remain referenced to 1000 grams of solvent water. The number of moles of solvent water remains constant which results i n an increase i n the t o t a l number of moles of water i n the system. In contrast, the equations presented here assume the number of moles of each component to be constant, and i f solvent water i s removed from the aqueous phase, only the molality of the aqueous species and the number of moles of solvent water w i l l change i n response. Mass Action The a c t i v i t y of any phase, species or endmember can be calculated from the a c t i v i t y of the component phases and species using the Law of Mass Action. For the sth aqueous species, the Law of Mass Action can be written as NC l n K l n a + \ v l n a S S / . C . S c V Ic = l (7) where and a g are the a c t i v i t i e s of the cth component phase or species and the s t h non-component species, respectively. V S / C i s t n e reaction c o e f f i c i e n t of the c t h component phase or species i n the sth reaction. KS i s the equilibrium constant for the reaction between the 12 s t h aqueous species and the component phases and species. The a c t i v i t y of a s o l i d phase or of a s o l i d solution species i n a s o l i d phase i s calculated using an equation i d e n t i c a l i n form to equation (7). The subscript "s" i s replaced by the subscript " i , ? " , where the new subscript indicates the i t h endmember of the 9 t h mineral. The relationship between the a c t i v i t y and the mol a l i t y of an aqueous species i s -a = y m (8) s s s where Y s i s the a c t i v i t y c o e f f i c i e n t of the s t h aqueous species. Equation (7) does not d i f f e r e n t i a t e between the di f f e r e n t types of components. However, i t can be rewritten such that NP minerals are part of the component basis. N C S P ~ 1 aqueous species and water make up the remaining portion of the component basis. Combining equation (8) with t h i s rewritten form of equation (7) and taking the derivative with respect to reaction progress, gives HP end, d i n K d i n Y d i n m <v ^ \. V d i n a * - 2- + * + > > V * / S M-d? dC dt: -—f d? <p=l 1=1 NCsp d i n a V — > d i n m + *H 0 r s 220 + \ v c NCSp yy v dm - Y (9) + ' *- - ° The derivatives of the m o l a l i t i e s of the aqueous component species are summed beginning with c=2 to allow the derivative of the a c t i v i t y of 13 water to be treated separately. I f water i s not a component species, then the water term i s dropped and the aqueous component species are summed beginning with c=i. i f the i t h endmember of the cbth mineral i s not a component species, then v. (the c o e f f i c i e n t of the i t h J. r CD , S endmember of the § th mineral i n the sth reaction) i s zero. I f the number of endmembers of a s o l i d phase i s greater then the number of components of that phase, then a mass action equation s i m i l a r i n form and derivation to equation (9) exists to calculate the derivative of the a c t i v i t y of those endmembers. Although advances have been made in the theoretical treatment of a c t i v i t y c o e f f i c i e n t s of aqueous species as a function of pressure and temperature (Helgeson and Kirkham, 1976), considerable uncertainty s t i l l e x ists about the a c t i v i t y c o e f f i c i e n t s of many aqueous complexes as a function of pressure and temperature. Owing to t h i s only isobaric isothermal mass transfer w i l l be considered. Thus, the derivative of the equilibrium constant with respect to reaction progress i s zero, and equation (9) i s equal to zero. A c t i v i t y Coefficients The a c t i v i t y c o e f f i c i e n t for any aqueous species i s generally some function of the ioni c strength, and as the ionic strength changes, the a c t i v i t y c o e f f i c i e n t of the aqueous species changes. In some geochemical systems the mass transfer between the s o l i d phases and the aqueous phase i s large (for example, rain water f a l l i n g on and reacting with surface material); in others, a s i g n i f i c a n t amount of water may be consumed or released during a reaction. In both of these cases the 14 ionic strength can change s i g n i f i c a n t l y during the reaction, and, thus, necessitate the calculation of the derivative of the a c t i v i t y c o e f f i c i e n t with respect to reaction progress. In some geochemical systems which involve concentrated brines, the ionic strength of the aqueous phase i s e s s e n t i a l l y constant, and, consequently, the derivative of the a c t i v i t y c o e f f i c i e n t with respect to reaction progress i s approximately zero. This derivative should s t i l l be calculated, however, because including i t w i l l minimize numerical errors. Many d i f f e r e n t methods exi s t to calculate a c t i v i t y c o e f f i c i e n t s , each with t h e i r own merits. The extended Debye-Huckel model w i l l be used as an example, however, any other method could be used equally w e l l . Helgeson (1969) proposed that for a given temperature the a c t i v i t y c o e f f i c i e n t for the sth aqueous species could be approximated by -2.303 A z2yjj In Y«. = + 2.303 w I s 1 + a B y[l e (10) Where I i s the true ionic strength of the solution (defined below), and A and B are the molal Debye-Huckel parameters, a and z are the ion size parameter and the charge on the sth aqueous species, respectively. For any neutral aqueous species w& i s a function of the ionic strength of the solution and i s assigned a value such that Y s i s equal to the a c t i v i t y c o e f f i c i e n t of carbon dioxide i n water. For any charged species we i s the deviation function and i s independent of ionic strength. 15 The true ionic strength of any aqueous system i s defined as NS I = 1/2 £ S=2 ,2 Z m s s (11) Again the summation begins at s =2 because s = i has been reserved for water. The derivative of equation (10) with respect to reaction progress i s i ,2 din Y ~~dT~ = 2.303 V s 2v? [i+ i s sVf] 2/ dJ (12) where for the sth charged species C £ i s equal to the deviation function. For the sth neutral species Cs i s the derivative of w e with respect to ionic strength. The nature of t h i s derivative depends on the functional form representing w g . Typically, w& i s interpolated from a matrix of values at di f f e r e n t ionic strengths. Thus for a neutral species equation (12) would reduce to d i n y d? I n Y CO 2 I n Y CO • dl d5 (13) x2 i i Y and y are known a c t i v i t y c o e f f i c i e n t s of carbon dioxide at ionic co2 co2 strengths j 2 and JL , respectively, where j - 2 and.-cj-j bound the ionic strength of the solution. Usually these c o e f f i c i e n t s are modeled using 16 the a c t i v i t y c o e f f i c i e n t for carbon dioxide i n water. Equation (12) for charged species (or (13) for neutral species) can now be substituted for the derivative of the a c t i v i t y c o e f f i c i e n t of a l l aqueous species i n equation (9). This results i n NC< 0 = d i n m + l"^sp d i n ; ~ dS c= 2 c V — + H 2 0 , s d i n a H70 d 5 + 2.303 C + s NCsp c=2 C + s s NCsp 1 + a S s v s c c=2 a B c ^ J 2 d I dt; WP end<j, 9=1 i = l (14) d i n a . , i , <P d5 Thus the derivative of the molality of any non-component species can be written i n terms involving only the m o l a l i t i e s and a c t i v i t i e s of the component species and of the derivative of ionic strength. The derivative of equation (11),. the ionic strength equation, with respect to reaction progress i s NS -*5 / i s s s=2 'o d i n m Z^ m s + d£ d J (15) From t h i s i t can be seen that the derivative of ionic strength with respect to reaction progress i s a function of the mo l a l i t i e s of a l l aqueous species and not just of the component species. 17 Equation (15) could now be substituted for the derivative of ionic strength with respect to reaction progress i n equation (14), the mass balance equation. Rather than make t h i s substitution which results i n a derivation s i m i l a r to that of Helgeson et a l (1970), equation (15) w i l l be introduced as a new constraining equation. The derivative of ionic strength with respect to reaction progress w i l l be treated as a new unknown. By avoiding the substitution of equation (15), the R mass action equations (equation (14)) are functions only of the derivatives of the m o l a l i t i e s , of the number of moles of the components, and of the ionic strength. The implications of t h i s w i l l be discussed below; but b r i e f l y , t h i s allows a more e f f i c i e n t algorithm to be used to predict the progress of the reaction. A c t i v i t y of Water In many geochemical processes a concentrated brine reacts with phases i n the system. During t h i s process the a c t i v i t y of water i s es s e n t i a l l y constant, and i t s derivative with respect to reaction progress i s approximately zero. However, for numerical reasons, t h i s derivative should s t i l l be considered. In those systems where the composition of the aqueous phase changes notably (for example, during the evolution of a s a l t lake), the change i n the a c t i v i t y of water with respect to reaction progress must be known to adequately predict the solution path. The a c t i v i t y of water i n any system i s dependent upon the number of moles of water and on the number of moles and a c t i v i t i e s of a l l 18 other species i n the aqueous phase. A form of the isothermal isobaric Gibbs-Duham equation for the aqueous phase can be written to describe t h i s : NS > n d i n a = 0 h i 5 5 w n g and a are the number of moles and the a c t i v i t y of the s t h aqueous species, respectively. Solving equation (16) for the logarithmic derivative of the a c t i v i t y of water yie l d s NS d i n a r r n v > n din a *2£ + __£ = o d C ^ n H 2 0 d ^ (17) s=2 Combining equations (8), (4) and (12) (or (13). for a neutral species) allows the derivative of the a c t i v i t y of water with respect to reaction progress to be written i n the form NS d i n a m _ d i n m .0 = + 55.51 d C — 2 - ' d € m I A Z2 \ d l s = 2 \Trl + °as B \[l 2 J dZ, (18) The derivative of the a c t i v i t y of water i s a function of the derivative of ion i c strength and of the derivative of the molality of a l l aqueous species. Equation (18) could be substituted for the derivative of the 19 a c t i v i t y of water with respect to reaction progress i n equation (14), the mass action equation. Rather than make t h i s s ubstitution, equation (18) w i l l be introduced as a new constraining equation and the derivative of the a c t i v i t y of water with respect to reaction progress w i l l be treated as a new unknown. The arguement for t h i s i s the same as the reason for including the derivative of ionic strength as a new unknown and w i l l be discussed i n d e t a i l below. So l i d Solution Minerals For the standard state adopted here, at any given temperature and pressure, the a c t i v i t y of any phase i n internal equilibrium and i n equilibrium with the system, i s one. The a c t i v i t y of the component species 1 describing t h i s phase are generally less than or equal to one. An exception occurs when one of the components describing a phase i s an aqueous species. In t h i s case, the standard state used for aqueous species permits these a c t i v i t i e s to equal or exceed one. When a ?A s o l i d solution endmember i s compositionally and c r y s t a l l o g r a p h i c a l l y d i s t i n c t and i s a compositional extreme point i n the set of a l l possible compositions of the s o l i d solution phase. A s o l i d solution species i s compositional d i s t i n c t with a unique structural symmetry i n th i s space. The set of a l l s o l i d solution species includes the set of a l l s o l i d solution endmembers. Solid solution components are the set of components used to describe the s o l i d solution phase. Typically, s o l i d solution endmembers are chosen as descriptors for s o l i d solution components. The number of s o l i d solution species or of s o l i d solution endmembers i s always equal to or greater than the number of s o l i d solution components (Brown and Greenwood, i n preparation). In t h i s paper the s o l i d solution components are chosen as component species to describe the entire system whenever a s o l i d solution phase i s i n equilibrium with the system. The s i t u a t i o n of two or more s o l i d phases in equilibrium with the system and sharing components w i l l not modify the equations developed. I t w i l l modify the method i n which these equations are solved however, and i s discussed below. 20 component has the same composition as the phase i t describes (as with any stoichiometric phase), then the a c t i v i t y of the component i s equal to one. Rather than solve e x p l i c i t l y for the a c t i v i t i e s of the components in a s o l i d phase, these a c t i v i t i e s w i l l be related to the mole fr a c t i o n and, ultimately, to the t o t a l number of moles of the components i n the s o l i d phase. The a c t i v i t y of the j t h s o l i d solution species ( a ) i n a ^-component s o l i d solution mineral i s given by a. = X.X. (19> J J J x. and X . are the mole fr a c t i o n and the a c t i v i t y c o e f f i c i e n t of the i t h J J s o l i d solution species, respectively. The mole fr a c t i o n of the j t h s o l i d solution species i n a ^-component s o l i d solution mineral i s related to the number of moles of each species i n the s o l i d solution by x. = n . J ^ (20) The change i n the a c t i v i t y of the &th s o l i d solution species can be related to the change i n the a c t i v i t y c o e f f i c i e n t of that species and to the change i n the number of moles of a l l s o l i d solution species in the s o l i d solution. By substituting equation (20) for the mole fr a c t i o n term in equation (19) and taking the derivative with respect to reaction progress, y i e l d s 21 d i n a . 2 d i n X . 2 d£ + d i n n . 2 d i n n . i (21) 1 = 1 There i s no generally accepted s o l i d solution model for any mineral with greater then two s o l i d solution species, and in most cases, there i s i n s u f f i c i e n t data to make such models. Data ex i s t s for many binary s o l i d solution minerals and the Margules model (Thompson, 1967) i s commonly used to represent these phases. An asymmetric Margules model w i l l be used to i l l u s t r a t e the derivation of the derivative of the a c t i v i t y c o e f f i c i e n t taken with respect to reaction progress. Any other solution model could be used equally w e l l , including those i n which the number of s o l i d solution species i s greater then the number of s o l i d solution components. In a binary asymmetric s o l i d solution, Thompson (1967, equation 80a) relates the a c t i v i t y c o e f f i c i e n t and the mole fraction of the f i r s t s o l i d solution species by T i s the temperature i n Kelvins and R i s the gas constant, a i s the number of possible mixing s i t e s . viG\ and WG2 are the Margules excess free energy parameters for the f i r s t and second species of a binary s o l i d solution, respectively. Substituting equation (20) into equation (22) and taking the derivative with respect to the progress variable allows the derivative of the a c t i v i t y c o e f f i c i e n t of the f i r s t s o l i d solution species to be written i n terms of the number of moles of both a R T In Xi = X2 (WG2 + 2 (WG2 - WGi) Xx) (22) 22 component species: din Ax 2 X2 Xi a R T 2 AT2 #x a R T 3 *x + f V G i - 3 IVC?! din n2 ~dT~ (23) 3 Xi WG2 + WG1 - 3 Xx IVGx 1 din n i dC The equation for the second species of a binary s o l i d solution i s i d e n t i c a l i n form to equation (23) with only the subscripts "1" and "2" interchanged. Simplifying equation (21) for a binary s o l i d solution and substituting equation (23) for the derivatives of the a c t i v i t y c o e f f i c i e n t s allows the derivative of the a c t i v i t y of the f i r s t s o l i d solution species with respect to reaction progress for a binary s o l i d solution to be written as din a d5 2 X2 *x X2 ~ a R T 3 Xi WG2 + WGi 3 Xi WGi din 72 1 d5 2X$ 2 *1 X2 - a R T 3 .Xx WG2 + WG1 ~ 3 Xl W G l (24) dlri nr Equation (24) can be substituted for the a c t i v i t y of the components formed from species of s o l i d solution phases i n equation (14). The result i s the general mass action equation for any non-component aqueous species when the component basis i s composed of stoichiometric and binary s o l i d solution minerals, aqueous species and water. The resulting equation i s 23 d i n m + d l n ' c=2 dZ ™ d i n a -£ + VH20,S £22 dK + 2.303 C + s NC c s s c=2 + f 1 + a B s ncSp z2 s c c d J d£ iVP end 9=1 i = l *3-i,4> L ^ l a i? T 3 X• , WG_ . , + WG. - 3 X. WG . 1 A 3-1, t) 1,9 A i / f j , * 7 U i / 9 d i n n i / 9" d5 3 - i ,9 3-1 ,9 1 , 9 a i? T 3 X . . WG +•• WG . x • 2 , 9 3-1 ,9 1,9 3 X. , IVG. , 1,9 1,9 d i n n 3 - i , 9 d5 (25) Equation (25) has been derived using a binary solid solution model. If the phase being considered i s a stoichiometric phase, then the solid solution term in equation (25) is zero. This can be accomplished by letting end^ equal one, the mole fraction of the f i r s t solid solution 24 species (X^ ^ equal one, and the second ( x 3_ i ^ equal zero. I t i s important to note that when a s o l i d solution phase i s i n equilibrium with the system a l l s o l i d solution species are needed to calculate the derivative of the unknown aqueous species with respect to reaction progress. This i s the case even though only one of the s o l i d solution species may be involved d i r e c t l y i n the reaction forming that aqueous species. Equation (25) has been derived using the logarithmic derivative with respect to reaction progress for the s o l i d phases. When the phase has reached saturation the logarithmic derivative of the change i n mass of each component of a s o l i d solution phase i s i n f i n i t e . I f the normal derivative i s used, the s o l i d solution term i s divided by the number of moles of that s o l i d solution species present, and t h i s results i n an i n f i n i t e c o e f f i c i e n t . To avoid t h i s d i f f i c u l t y a t r i v i a l amount of the phase i s assumed to be formed when any s o l i d solution phase reaches saturation. This amount i s subtracted from the t o t a l amount of that phase when more of that phase has precipitated. The problem does not ex i s t for any stoichiometric phase i f the "normal" derivative i s used because the a c t i v i t y of these phases i s one and i s not a function of composition. Equation (25) assumes that a l l phases are i n internal equilibrium and i n equilibrium with the system and that a zoned c r y s t a l can not be present. This equation could be modified to allow zoning by assuming each packet of s o l i d solution phase produced was independent of the previous packet. Then as the phase reacts i t would be dissolved i n the reverse order of the p r e c i p i t a t i o n order. A 25 THE GENERAL SOLUTION The derivative of the number of moles or of the molality of a l l phases and species has been treated as only a function of reaction progress. A l l other variables (temperature, pressure and t o t a l number of moles of the components) have been assumed to be constant. Thus, given a known amount of a phase or species i t i s possible to calculate i t s amount at any subsequent stage of reaction by means of a series expansion i n the derivatives with respect to the progress variable. With i n f i n i t e l y precise computations and an i n f i n i t e number of derivatives the Taylor's Expansion i s exact. Lack of these two conditions i s a serious disadvantage shared to some extent by a l l methods. However the c l a r i t y of the Taylor's Expansion and i t s ease of expansion to any number of derivatives are the reasons for using i t here. A Taylor's Expansion i n the number of moles of a phase at a given value of reaction progress can be written as flr+AF = n P + A ? — + + 5 + A S 5 c U 2! c U 2 dn C A £ ) 2 d2n + (26) ( A O J dJn + ; j ! dtJ n^ i s the t o t a l number of moles when the reaction progress variable has a value of 5 ; n w i l l be the number of moles when the progress variable has a value of 5 + A£ . Ag i s equal to the change i n the progress variable. — — i s the j t h derivative of the number of moles with respect to reaction progress evaluated at n = n . Once a l l derivatives are known, the function can be predicted and 26 solved accurately using the Taylor's Expansion. The error produced by considering a f i n i t e number of terms i s less than the value of the f i r s t term not considered. Therefore when following the function, an error l i m i t can be established, and the series evaluated only to the order of derivative whose value i s less than that or the error. This w i l l help optimize calculations within the error l i m i t s established. The F i r s t Derivative The derivatives of the NC mass balance equations, of the ionic strength equation, of the a c t i v i t y of water equation and of the R mass action equations (equations 6, 15, 18, 25, respectively) form a system of NC + 2 + R equations. These equations are li n e a r with respect to the NC derivatives of the number of moles of the components (or of the molality of the components), to the derivative of ionic strength, to the derivative of the a c t i v i t y of water, and to the R derivatives of the molality of the non-component species. Because these equations are lin e a r i n the unknown derivatives, t h i s system of equations and unknowns can be written and solved i n matrix notation. Equation (27) and the following discussion indicates the format. 27 c -1-CM + (27) In matrix A and i n vectors B and C, rows 1 to NC are formed from the derivatives of the Mass Balance equation (equation 6). Row NC + 1 i s formed from the derivative of the Gibbs-Duhem equation constraining the a c t i v i t y of water (equation 18). Row NC + 2 i s formed from the derivative of the equation constraining the ionic strength of the aqueous phase (equation 15). The remaining rows are formed from the R derivatives of the Mass Action equations for every non-component species (equation 25). Matrix A contains the c o e f f i c i e n t s of the derivatives from equations (6), (18), (15) and (25). Columns 1 to NC - l contain the c o e f f i c i e n t s of the derivatives i n the number of moles or molality of the component phases or species. Column NC i s reserved for the 28 c o e f f i c i e n t s of the derivative of the number of moles of water and i t water i s not a component, then the NCth component w i l l be here. Column NC + 1 i s reserved for the c o e f f i c i e n t s of the derivative of the a c t i v i t y of water; column NC + 2 i s reserved for the c o e f f i c i e n t s of the derivative of ionic strength. The remaining R columns contain the c o e f f i c i e n t s of the derivatives of the m o l a l i t i e s of the non-component species. Inspection of eguation (25) shows that p a r t i t i o n Y, dimensioned R by R and located i n lower l e f t of matrix A, i s an i d e n t i t y matrix. Vector B contains a l l of the unknown derivatives that have been taken with respect to the progress variable. The f i r s t NC - i positions i n t h i s vector are the derivatives of the number of moles (d l n n/d 0 or of the m o l a l i t i e s (d l n m/dZ) of the component phases and species. The NC + 1 position i s the derivative of the a c t i v i t y of water (d l n n /d Q . The NC + 2 position i s the derivative of ionic strength (di/dE,). The remaining positions are the derivatives of the log m o l a l i t i e s of the non-component species (d l n m/dK). Vector C contains the constant terms from each equation. The f i r s t NC positons are the change i n the number of moles of each component as a result of the decrease i n the reactant minerals. The remaining positions are zero. The individual terms i n t h i s vector are on the l e f t hand side of the equal sign i n equations (6), (18), (15) and (25). I f two or more phases i n equilibrium with the system share components or i f a s o l i d solution phase has more s o l i d solution species than s o l i d solution components, p a r t i t i o n Y of matrix A w i l l not be the i d e n t i t y matrix. However, by substituting equation (26) for those 29 p a r t i c u l a r non-component s o l i d solution species, p a r t i t i o n Y can be recast into an i d e n t i t y matrix. In.general, recasting i s not possible i f a s o l i d solution phase has two or more non-component species. Under these conditions p a r t i t i o n s U, V and W of matrix A must be expanded to include the c o e f f i c i e n t s of the derivatives of these species and p a r t i t i o n Y w i l l be correspondingly smaller. The unknown derivatives i n vector B can be solved by inverting matrix A and multiplying by vector C (equation 27). Rather than d i r e c t l y inverting matrix A, the inverse can be calculated by a p a r t i t i o n i n g method which only involves the d i r e c t inverse of a matrix of dimensions NC + 2. Because the computer time used to d i r e c t l y invert a matrix i s proportional to the cube of the matrix s i z e , a substantial amount of time i s saved.1- Inversion by p a r t i t i o n i n g i s discussed i n most matrix algebra texts (for example: Hadley, 1961). Equations (28) to (32), i n c l u s i v e , indicate the method of solution. •'•The inverse of the i d e n t i t y matrix i s the i d e n t i t y matrix and any matrix multiplied by the i d e n t i t y matrix remains unchanged. Due to the introduction of the derivatives of the a c t i v i t y of water and of the ionic strength as unknown derivatives, p a r t i t i o n Y of matrix A (equation 26) i s the i d e n t i t y matrix. Equations (29) through (32) i n c l u s i v e , take advantage of t h i s . I f p a r t i t i o n Y was not the i d e n t i t y matrix, then each of these equations would have inverse terms, and would resu l t i n a method of solution which would involve the inverse of a l l elements of matrix A. There would be no savings of computer processing time i n solving the problem. 30 B A - l NC+2 L (28) where: and: and: and: ,J = (U - V W) L = -W J -1 K - J V M = I W K (29) (30) (31) (32) Where I is the identity matrix and the superscript "-1" indicates the inverse of the specified matrix. The derivative of the molalities of the non-component species can be independently calculated from equation (25) after the derivative of the molality and the number of moles of the component phases and species, the ionic strength and the activity of water are known. Thus, the derivatives of the molalities of the non-component species computed 31 from equations (28) to (32) can be compared with those calculated from equation (25) to allow an estimation of the numerical error. Appropriate action can be taken i f t h i s error i s too large. The complete inverse of matrix A does not need to be calculated because only the derivatives of the m o l a l i t i e s and the number of moles of the component species and phases, the derivative of ionic strength and the derivative of the a c t i v i t y of water need to be known to completely determine the system. Instead, i f only the J and K p a r t i t i o n s of the inverse of matrix A are determined, then a l l other derivatives can be calculated from equation (25). This i s the same as the rearrangement and substitution of equation (25) for the derivatives of the m o l a l i t i e s of a l l of the non-component species i n the mass balance, a c t i v i t y of water and ionic strength equations (equations 6, 18, and 15, respectively). This reduces the system to NC + 2 constraining equations and NC + 2 unknown derivatives. If t h i s substitution i s made, and because these N C + 2 equations are l i n e a r and share variables, further rearrangement and substitution can take place to reduce the number of equations. With each l e v e l of reduction less information about the system i s available, to t h i s information must be calculated independently whenever i t i s needed. Because information about a l l of the component phases and species, ionic strength, and the a c t i v i t y of water are needed at each step to t e s t for mineral saturation and to determine the s i z e of the next step, no saving i n the number of calculations are obtained by reducing the system below NC + 2 equations and unknowns. By reducing the system to NC + 2 equations and unknowns considerable reduction i n computer storage i s realized. The 32 disadvantage i n t h i s reduction i s that the numerical error can no longer be estimated. Higher Order Derivatives Higher order derivatives can be obtained by taking the derivative with respect to reaction progress of the preceding order of derivative. For example, to obtain the second derivative of the mass action equation, the derivative of equation (25) with respect to reaction progress i s taken. The general form for any order of derivative of the mass action, mass balance, ionic strength and a c t i v i t y of water equations are given i n appendix 1. The equations constraining the higher order of derivatives can be solved i n a manner i d e n t i c a l to that for the f i r s t derivative. I f the derivative of equation (27) i s taken and rearranged to solve for the second derivative of the number of moles (or molality) of the components, the ionic strength, the a c t i v i t y of water and the molality of the component species (contained i n the vector B'), we have Where 1 indicates the f i r s t derivative of the terms i n that matrix. The derivative of equation (33) can be taken and rearranged to solve for the t h i r d derivatives of the number of moles (or molality) of the components, the ionic strength, the a c t i v i t y of water and the molality of the non-component species (contained i n the vector B " ) . I t i s B' A1 (33) 33 B" A 1 A" B + 2 A' B Where " indicates the second derivative of the terms i n that matrix. Successive derivatives can be found s i m i l a r l y . I t i s important to note that matrix A needs only to be inverted once and i s used to solve any order of the derivatives. Each successive derivative of equation (27) introduces only one new term that must be calculated: the kth derivative of the terms i n matrix A. A l l other terms have been computed or solved i n the previous order of derivatives. Thus evaluating each order of derivatives i s rapid, and, therefore, s u f f i c i e n t terms can be used to accurately represent the function. I n i t i a l Solution Composition Given the t o t a l number of moles or the a c t i v i t y of each of the component phases and species, the molality of each of the aqueous species can be calculated using the Mass Action and Mass Balance equations. Many di f f e r e n t authors (Van Zeggern and Story, 1970; Ting-Po and Nancollas, 1972; Wolery and Walters, 1975) have presented d i f f e r e n t methods to solve this, type of problem. In conjunction with the mass transfer calculations a modification of the method of Wolery and Walters (1975) has been found to be the most convenient for finding the d i s t r i b u t i o n of species. The modification i s the changing of the component basis to include s o l i d phases i n equilibrium with the solution, to include aqueous species whose a c t i v i t i e s are known and fi x e d , and to include constraints on the a c t i v i t y of water. The 34 remaining components are given by a chemical analysis and charge balance r e s t r i c t i o n s . Generally, the i n i t i a l solution composition includes elements from a l l phases i n the system even i f the amount i s t r i v i a l . I f i t does not, then when the f i r s t amount of that element i s dissolved into the aqueous phase a d i s t r i b u t i o n of species calculation must be performed. This i s necessary because on addition of a new element to the system, the function describing reaction progress i s discontinuous i n a l l derivatives at that point. During the mass transfer calculations, error i n the molality of each aqueous species gradually accumulates even though the t o t a l number of moles of each component i s known exactly. This error i s most s i g n i f i c a n t i n species present i n low concentration. When t h i s error becomes too large, a d i s t r i b u t i o n of species can be done to correct the molality of each aqueous species. In addition, when a phase f i r s t becomes saturated with respect to the aqueous phase, a d i s t r i b u t i o n of species can be calculated with that new phase as part of the component basis. This ensures that the solution i s i n equilibrium with the components and that i t i s s t i l l on the function constrained by the reaction. Prediction of Saturation The a c t i v i t y quotient of any stoichiometric phase can be calculated using equation ( 7 ). When t h i s a c t i v i t y quotient i s equal to the equilibrium constant, then the stoichiometric phase has saturated with respect to the aqueous phase. In a si m i l a r manner, the a c t i v i t i e s of a l l s o l i d solution species of a phase can be calculated with 35 equation (7). Then by i t e r a t i v e techniques the entire compositional range of the s o l i d solution must be checked for saturation. The above technique, however i s i t e r a t i v e and i s required at every step. Consequently, t h i s checking consumes considerable computer processing time. A l t e r n a t i v e l y , a modification of the method of Brown and Skinner (1974) can be used and i s much more e f f i c i e n t . When a s o l i d solution phase saturates with respect to an aqueous phase, the chemical potential plane defined by the aqueous phase i s tangential to the Gibbs free energy surface of the s o l i d solution phase. Given t h i s , only the points of the Gibbs free energy surface of the s o l i d solution phase which have a p a r a l l e l tangent to the chemical potential plane of the aqueous phase need to be tested for saturation. The points on the Gibbs free energy surface of the s o l i d solution phase which have tangents p a r a l l e l to the chemical potential plane of the aqueous phase w i l l change change th e i r position on t h i s surface as the composition of the aqueous phase changes. However, once these points of tangency are known for a given value of reaction progress, they can be predicted at any future value using a Taylor's expansion s i m i l a r to equation (26). This i s a line a r problem and i s much faster than i t e r a t i v e l y checking for saturation at each step of reaction prog ress 36 CONCLUDING REMARKS The equations developed above to describe isothermal-isobaric rock water interaction have several major advantages over existing methods. The p r i n c i p a l of these, the correct inclusion of the changing a c t i v i t y and mass of water, allows dehydration reactions and evaporation to be considered correctly. The speed of the computational method presented i s proportional to the number of components plus two (NC + 2) and i s r e l a t i v e l y independent of the number of species and phases i n the system. The method presented by Helgeson et a l (1970) i s proportional to the t o t a l number of species and phases i n the system, which i s often an order of magnitude greater than the number of components. The computation method presented here allows a substantial reduction i n computer processing time and provides a saving i n computer storage for any given problem, thus allowing consideration of more complex problems. A computer program embodying these equations has been written i n the FORTRAN language and i s described i n Appendix 2. A l i s t i n g of the program comprises Appendix 3. 37 SELECTED REFERENCES Brown, T.H., and Greenwood, H.J. 1981. A Reinvestigation of Ideal Solid Solutions. In preparation. Brown, T.H., and Skinner, B.J. 1974. Theoretical Prediction of Equilibrium Phase Assemblages i n Multicomponent Systems. American Journal of Science, 274, p. 961-986. De Donder, Th. 1920. Lecons de Thermodynamique et de Chimie-Physique. Gauthier-Viliars. De Donder, Th., and Van Rysselberghe, P. 1936. The Thermodynamic Theory of A f f i n i t y . Stanford. F o u i l l a c , C , Michard, G., and Bocquier, G. 1977. Une methode de simulation de 1'evolution des p r o f i l e s d'alteration. Geochimica et Cosmochimica Acta, 41, pp. 207-213. Garrels, R.M., and Mackenzie, F.T. 1967. Origin of the Chemical Compositions of Some Springs and Lakes. In Advances i n Chemistry Series, 67, pp. 222-242. Greenwood, H.J. 1975. Thermodynamically Valid Projections of Extensive Phase Relationships. American Mineralogist, 60, pp. 1-8. Hadley, G. 1961. Linear Algebra. Addison-Wesley, 290 p. Helgeson, H.C. 1968. Evaluation of Irreversible Reactions i n Geochemical Processes Involving Minerals and Aqueous S o l u t i o n s — I . Thermodynamic Relations. Geochimica et Cosmochimica Acta, 32, pp. 853-877. Helgeson, H.C. 1969. Thermodynamics of Hydrothermal Systems at Elevated temperatures and Pressures. American Journal of Science, 267, pp. 729-804. Helgeson, H.C. 1970. A Chemical and Thermodynamic Model of Ore Deposition i n Hydrothermal Systems. Mineralogical Society of America Special Paper 3, pp. 155-186. Helgeson, H.C, Brown, T.H., N i g r i n i , A., and Jones, T.A. 1970. Calculation of Mass Transfer i n Geochemical Processes Involving Aqueous Solutions. Geochimica et Cosmochimica Acta, 34, pp. 569-592. Helgeson, H.C, Garrels, R.M., and Mackenzie, F.T. 1969. Evaluation of Irreversible Reactions i n Geochemical Processes Involving Minerals and Aqueous S o l u t i o n s — I I . Applications. Geochemica et Cosmochimica Acta, 33, pp. 455-481. 38 Helgeson, H.C., and Kirkham, D.H. 1976. Theoretical Predictions of the Thermodynamic Properties of Aqueous Electrolytes at High Pressures and Temperatures. III.Equations of State for Aqueous Species at I n f i n i t e D i l u t i o n . American Journal of Science, 276, pp. 97-240. Karpov, I.K., Kaz'min, L.A. And Kashik, S.A. 1973. Optimal Programming for Computer Calculations of Irreversible Evolution i n Geochemical Systems. Geochemistry International, 10, pp. 464-470. Parkhurst, D.L., Plummer, L.N., and Thorstenson, D.C. 1978. Chemical Models i n Ground-Water Systems. Geological Society of America Abstracts, 7, pp. 468. P f e i f e r , H.R. 1977. A Model for Fluids i n Metamorphosed Ultramafic Rocks. Observations at Surface and Subsurface Conditions (High pH Spring Waters). Schweiz. Mineral. Petrogr. M i t t . , 57, pp. 361-396. Prigogine, I., and Defay, R. 1954. Chemical Thermodynamics, translated by D.H. Everett. Longmans Green. 543 p. Thompson, J.B. 1967. Thermodynamic Properties of Simple Solutions. In Researches i n Geochemistry, edited by P.H. Abelson, I I , pp. 340-361, John Wiley. Ting-Po, I., and Nancollas, G.H. 1972. Equil - A General Computational Method For the Calculation of Solution E q u i l i b r i a . A n a l y t i c a l Chemistry, 44, pp. 1940-1950. Van Zeggeren, F., and Storey, S.H., 1970. The Computation of Chemical Equilibrium. Cambridge, England, Cambridge University Press, 176 P-V i l l a s , R.N., and Norton, D. 1977. Irr e v e r s i b l e Mass Transfer Between Cir c u l a t i n g Hydrothermal Fluids and the Mayflower Stock. Economic Geology, 72, pp. 1471-1504. Wolery, T.J., and Walters, L.J., J r . 1975. Calculation of Equilibrium D i s t r i b u t i o n of Chemical Species i n Aqueous Solutions by Means of Monotone Sequences. Journal of Mathematical Geology, 7, pp. 99-115. 39 APPENDIX 1 The main body of t h i s thesis has discussed the developement of the f i r s t derivative of the mass action, mass balance, ionic strength and a c t i v i t y of water equations taken with to reaction progress and the methods used for the numerical solution of these equations. By examination of the Taylor's expansion (equation (26)), i t i s apparent that by increasing the number of derivatives used i n the expansion, the error for a given step size w i l l be smaller. Alternately, a large step s i z e can be taken within a given error l i m i t i f more derivatives are used i n calculating the expansion. For these reasons, the general form for the kth derivative of the mass balance, mass action, ion i c strength and a c t i v i t y of water equations are presented i n t h i s appendix. These equations have been derived and generalized i n the simplest form possible. As a result of th i s s i m p l i f i c a t i o n , many derivatives have been expressed as "normal" derivatives rather than "logarithmic" derivatives. Some of the summation signs i n t h i s appendix use an expression to calculate the upper l i m i t of the summation. Integer arithmetic must be used to calculate these l i m i t s . The general form of many of the equations i n t h i s appendix have been written as functions of other equations. This has been done for reasons of space and c l a r i t y . Thus, to obtain the f u l l general form, one equation must be substituted into another. The f i r s t "normal" derivative can be related to the f i r s t "logarithmic" derivative by 40 A Al ( 1 _ A ) an = n d i n n Higher order "normal" derivatives can be related to the corresponding "logarithmic" derivatives by ,k \ _____ ,k-i ,i . (1-B) d n = 7 d n d l n n v ' (k - i ) ! ( i - 1) ! o k y where d n = n . d n and d "in n are the kth derivative and the kth logarithmic derivative of n taken with respect to the progress variable, respecively. 41 Ionic Strength The f i r s t derivative on ionic strength taken with respect to reaction progress i s given i n equation (15). The kth derivative of ionic strength taken with respect to reaction progress can be written as NS k 0 + (1-C) The "normal" derivative of the m o l a l i t i e s taken with respect to reaction progress can be converted to "logarithmic" derivatives by the substitution of equation (1-B) for the "normal" derivatives. 42 Mass Balance The f i r s t derivative of the mass balance equation taken with respect to reaction progress has been presented previously as equation (6). The general form for the kth derivative of the mass balance equation taken with respect to reaction progress can be written as dkn_ ^^3ft- dkn 1 , 9 , c i , cf> E v 55.51 - = - T^y^ 55.51 v . , n r 9=1 i = l NS k k_i • N S k k-i _7 _ _ _ i U P d ms (1-D) • s = 2 ~ (* - j) ! j ! d^" 7' • d^' As before, the "logarithmic" derivative can be substituted for any "normal" derivative using equation (1-B). 43 Activity of Water The f i r s t derivative of the activity of water taken with respect to reaction progress has been presented previously as equation (18). The general form for the kth derivative can be writen as d L n aH O A 1 V - d ms • o = + > -dtk 55.51 dzk s= 2 2 .303 ^ f JL^ (Jfc - 1) ! d U _ i ) i 7 7 s d 1 f ( j ) 55.51 ^ \ (k - i ) ! C i - 1) 0 « . , V - - / • v - - d£^ 1 d ? 2 s=2 Vi = 1 (1-E) df*( j) corresponds to the kth derivative of the extended Debye-Huckel equation for activity coefficients in an aqueous solution. The following equation describes the J c t h derivative of the Debye-Hiickel model where k is less than or equal to four. The inequality following each term indicates the lowest order of derivative that the term can be used in. 44 f ( ^ ) / d g ( j ) \ d* i c + ic > 1 + d ' g ( j ) d J j d * - j j " " 2 7 J^i Q C J , * - J ) d ? " d ? J d£* J . + + k-i d 3 g ( l ) ^ d1 I " d j 1 d * ^ - 1 - i d? f - f d^ _ d ? J d? J k > 3 k-h k-h-i d ' g ( x ) W d ^ J 3 d i - 2 d j - d * - i - i - h -w ^ h ~ ^ ~ d i ^ ^ Q ( h , i , ' j , k - j - i - h ) (1_ F ) k > 4 + . . . . . P was discussed and defined in the text following equation (12). To be consistent with this definition, second and higher order derivatives of C are zero and have not been included. Q (J,k- i), Q (i,j,k-j-i) and Q ( h , i , j , k - j - i - h ) are numerical constants and are defined in table I I . k — g (J) represents the leading terms of the derivatives of the extended Debye-Huckel equation. It i s defined by 45 k-1 d k g ( i ) A Z' .KCh.Jt) (°a B)h Cl)~h/1 s (~2k) Fl + % B s k+l (1-G) K(h,i) i s a set of numerical constants and i s defined i n table I I . 46 Table II Q(j,k-j) i s defined by the following. j k-j Q ( j , k - j ) j k-j Q(j,k-j) 1 2 3 1 3 4 2 1 2 2 4 3 3 5 10 Q(i, j,k-j-i) i s defined by the following, i j k - j - i Q(i , j , k - j - i ) 1 1 1 2 1 6 j k - j - i Q(i , j , k - j - i ) 1 2 3 2 10 15 Q(l,1,1,1) = 1 Q ( l , l f l , 2 ) = 10 Q(l,1,1,1,1) = 1 [<( h, i) i s defined i n the following matrix. i<( ,D K( ,2) K( ,3) K( ,4) K( ,5) K(0, ) 1 1 3 15 105 Kd, ) - 3 12 75 630 K(2, ) - - 15 141 1530 K(3, ) - - - 105 1830 K(4, ) - - - - 955 47 Mass Action The f i r s t derivative of the mass action equation taken with respect to reaction progress has been presented previously as equation (25). The general form corresponding to the .kth derivative of the mass action equation can be written as d l n ui v—•». d In m d l n a s \ c ' 0 = — + l_J v r - ~ + V ' k - L-J vc,s k H20,s d g k c = 2 NCsp , _ k -— +. 2.303 ^ 2 d C * d ? * NP end./ if k / u-h h 9 = 1 i=A d 5 h = l\ d ? d c d k~ h * 3 _ i t , d*m * 3_ J T,U (i-H) The derivative of f ( r ) with respect to reaction progress i s defined in equations (1-F) and (1-G). The general form for the kth derivative of the activity coefficient taken with respect to reaction progress can be written as 48 d k l n A d M < * - J ^X. , ^ ± = LiA ±A k > 1 2 k/2 ,• > • d Z M ( * ) d J X. , d * ~ J X V-A d- X. d J X. x L, & Q ( i . * - » d5 J - I d ^ d ? J k > 2 k -m d 3 M ( X i m) d 7" X. A d J' X. A ^ r 3 " AC«> £JI 3 j d ? m = i d? j = m d £ J d e * - J - » Q(».^. ( 1 - D Q ( j f ^ - j ) and Q ( i , j , k - j - i ) are numerical constants which are defined in Table II. The f i r s t four derivatives of M(.x ) can be written as d M U ) = -6 ( x ) + 8 P/G7 x. - 2 tfS, d£ 1 1 1 1 1 ( 1 - J ) + 6 ( ^ 1 ) 2 Pi7G2 - 6 WG2 2M(x,) d 3 M U . ) ^ - L - = - 1 2 WG1 + 12 P/G2 D 5 ( 1-L) 49 0 (1-M) The derivatives corresponding to the second solid solution species can be obtained by interchanging the subscripts "1" and "2". All derivatives of M(-Xj) of order four or greater are equal to zero. Therefore, equation (1-1) does not need additional terms to describe any higher order derivatives. The first three derivatives of the mole fraction of the first solid solution species in a binary solid solution phase are defined in equations (1-N), (1-0), and (1-P). To obtain the derivatives of the mole fraction of the second solid solution species, the subscripts "1" and "2" should be interchanged. The first derivative is (1-N) 50 The second derivative is 2 ! ( 2 - i - j ) ! j ! i (-1) ( ( 2 - j - i + I ) ! +• 1) 1) ((j+D + "2,+] (1-0) 51 The third derivative i s d 3 x L i 3 ' A 1 d n, 3 - i d5' £ ^ E l . . . i = 0 V £=0 d n. , d n 1, 4> + 2 > $ j = k dJ n 2 A .,3-k-j-i d n ,3-k-j-i d n dC 3-k-j-i + 2,<j, d5 3-k-j-i 3 ! (3-k-j-i) ! * ! j ! i (-1) ((k+1).! + 1) (-1) ( ( j + D ! + 1) (-D ( ( 3 - k - j - i + l ) ! + 1) (1-P) These derivatives, especially the f i r s t two, would be much simpler i f the expanded form was presented. However, they have been l e f t in this notation to show the difference between each order of derivative and to fa c i l i t a t e the writing of the higher order of derivatives. 52 APPENDIX 2 The Program PATH A computer program based on the equations developed i n the main body of t h i s thesis has been written i n the FORTRAN language. The program PATH calculates the mass transfer between an aqueous solution and minerals which are not i n equilibrium with the solution. I t uses three derivatives i n the Taylor's expansion to predict and follow the mass transfer process. Solid solution phases are not considered by the program. Optionally, the program w i l l perform only a d i s t r i b u t i o n of species c a l c u l a t i o n . The program w i l l terminate before the calculations are completed i f the user has set time or page l i m i t s that are too small. I t w i l l also terminate because of certain error conditions which are discussed below. I f i t i s necessary to continue the calculations, the program can be restarted using the data printed i n the f i n a l execution cycle as the input data for the following run. Approximately 102 pages of v i r t u a l memory (exclusive of I/O f i l e s ) are used to load the program under the MTS (Michigan Terminal System) Operating System executing on an AMDAHL V6 computer. The time used depends on the complexity of the run but w i l l range from seconds to tens of minutes. The program has been run successfully on the following computers: AMDAHL 470 V/6, IBM 370/168, IBM 370/158, CDC 7600, CDC 6600. On the /370-type computers, IBM's FORTRAN G and 53 FORTRAN H compilers have been used. To run the program at the University of B r i t i s h Columbia under the MTS Operating System, the following command i s used. $RUN XXXX:PATH.O 3=FDNAME1 5=FDNAME2 6=FDNAME3 19=FDNAME4 where: PATH.O i s the object code for the program PATH and, i n the example, i s stored on the l.D. XXXX. Fortran Unit 3 i s assigned to the f i l e from which the thermodynamic and the compositional data for a l l minerals, aqueous species and gases are read. The format of t h i s f i l e i s described below and a short example i s given. Fortran Unit 5 i s assigned to the f i l e from which the data s p e c i f i c to each run i s read. I f the program i s executed i n batch mode, then Unit 5 defaults to the card reader. I f the default i s allowed to take place, the data must be punched on cards and must immediately follow the "$RUN" card. In t h i s case the data cards must have as a terminating card, "$ENDFILE". When Unit 5 i s assigned to a f i l e , the "$ENDFILE" i s automatically supplied when a l l of the data has been read and the end of the f i l e has been reached. When executed from a terminal, Unit 5 defaults to the terminal keyboard, however no messages prompting for the input data are sent to the keyboard 54 printer/display. The format of t h i s f i l e i s described i n d e t a i l below and and an example i s given. Fortran Unit 6 i s assigned to a f i l e or a device to which the program results are to be directed. I f the program i s executed i n batch mode, the unit w i l l default such that the results are printed. I f i t i s run from a terminal, the unit w i l l default such that the results w i l l be directed to the terminal's output device. I f a permanent record i s desired, the unit should be assigned to a f i l e stored on disc or on magnetic tape. Fortran Unit 19 i s automatically assigned by the program when running on the MTS system at the University of B r i t i s h Columbia but must be assigned to a f i l e at other i n s t a l l a t i o n s . This unit i s used as a "core-to-core" buffer and i s used to a l t e r the form in which the character data i s stored. When assigned to a f i l e , i t can be thought of as a one l i n e f i l e on which every "WRITE" i s followed by a "REWIND", then by a "READ" and again by a "REWIND". 55 Data Stucture for Unit 3 This f i l e contains a l l of the compositional and thermodynamic data for a l l phases, aqueous species and gases that w i l l be considered by the program. Generally t h i s f i l e does not change from run to run and i s stored on disc or magnetic tape. Record 1: The "A" Debye-Huckel term. One value i s required for each of the temperatures 0.0, 25.0, 50.0, 150.0, 200.0, 250.0, 300.0 9 C . FORMAT(8F8.4) Record 2: The "B" Debye-Huckel term. One value i s required for each of the temperatures 0.0, 25.0, 50.0, 150.0, 200.0, 250.0, 300.0 °C. FORMAT(8F8.4) Record 3: The deviation function (B). One value i s required for each of the temperatures 0.0, 25.0, 50.0, 150.0, 200.0, 250.0, 300.0 °C. FORMAT(8F8.4) Record 4: The a c t i v i t y c o e f f i c i e n t of carbon dioxide i n a NaCl solution at i n f i n i t e d i l u t i o n . I t i s used i n calculating a c t i v i t y c o e f f i c i e n t s of neutral species. One value i s required for each of the temperatures 0.0, 25.0, 50.0, 150.0, 200.0, 250.0, 300.0 '°C. FORMAT(8F8.4) 56 Record 5: The a c t i v i t y c o e f f i c i e n t of carbon dioxide i n a one molal NaCl aqueous solution. I t i s used i n calculating the a c t i v i t y c o e f f i c i e n t s of neutral species. One value i s required for each of the temperatures 0.0, 25.0, 50.0, 150.0, 200.0, 250.0, 300.0 °C. FORMAT(8F8.4) Record 6: The a c t i v i t y c o e f f i c i e n t of carbon dioxide i n a two molal NaCl aqueous solution. I t i s used i n calculating the a c t i v i t y c o e f f i c i e n t s of neutral species. One value i s required for each of the temperatures 0.0, 25.0, 50.0, 150.0, 200.0, 250.0, 300.0 °C. FORMAT(8F8.4) Record 7: The a c t i v i t y c o e f f i c i e n t for carbon dioxide i n a three molal NaCl aqueous solution. I t i s used i n calculating the a c t i v i t y c o e f f i c i e n t s of neutral species. One value i s required for each of the temperatures 0.0, 25.0, 50.0, 150.0, 200.0, 250.0, 300.0 °C. FORMAT(8F8.4) Record 8: The number of d i f f e r e n t chemical elements i n the data records describing the atomic symbols (Record 9) and the atomic weights (Record m). This i s program variable NCTZ. FORMAT(IX,13) Record 9: NCTZ atomic symbols. There i s one for each element which i s 57 to be used i n describing the composition of the phases of the species and of the gases i n the data f i l e . Seven symbols per record: each l e f t j u s t i f i e d i n i t s f i e l d . F0RMAT(7(4A1,4X)) Record m: NCTZ atomic weights for the elements defined i n Record 9. They must be i n the same order as the atomic symbols. Seven values per record. FORMAT(7F10.5) Record n: A control record which w i l l determine the nature of the composition and thermodynamic data following i t . This data may be followed i n turn by another control record and more composition and thermodynamic data. Only the following control records are possible: "**MINERAL DATA**", "**AQUEOUS SPECIES**", "**GASES**", "PREFERENCES**" and "**STOP**". Control records, with the exception of "**STOP**", can be used as often as needed and can occur i n any order. The control records must be exactly as shown and must s t a r t i n character position one. These records w i l l be discussed i n turn below. FORMAT(A1,5A4) **MINERAL DATA** A l l records following t h i s are treated as compositional and thermodynamic data for s o l i d phases u n t i l another control record i s encountered. The data records occur i n pairs and 58 have the form NAME FORMULA ABV REF # DELTA H S A B C V and use the following format statements FORMAT(1A1,25A4) FORMAT(5X.6F10.3) , respectively. For the record NAME FORMULA ABV REF # which has the format (1A1,25A4), NAME i s the name of the mineral and star t s i n character position two. I t can be of any length but only the f i r s t sixteen characters are used. FORMULA i s the mineral formula and i s written i n the form ZN(5)C(2)0(8)H(2). Real numbers (up to 4 figures with a decimal point) can be used instead of integers. The alphabetic characters corresponding to the atomic symbols must have been defined by Record 9. At least four blank spaces must separate NAME and FORMULA. ABV i s a abbreviation of the name and i s used for pl o t t i n g purposes. I t can be any length, but only the f i r s t four characters are used. At least four blank spaces must separate FORMULA and ABV. REF. # i s any alphanumerical s t r i n g for documentation purposes. REF. # i s optional and i s ignored by the program. At least four blank spaces must separate ABV and REF. #. NAME, FORMULA and ABV must use less than one hundred and one 59 character positions. For the record DELTA H S A B C V which has the format (5X,6F10.3) , DELTA H i s the delta enthalpy of formation from the elements for the phase. The units used are joules. I f the enthalpy i s greater than 999999., then the phase w i l l not be considered. S i s the t h i r d law entropy, measured i n joules. A, B and C are the heat capacity terms for the Kelly-Meyer heat capacity function. V i s the volume i n cubic centimeters. **AOUEOUS SPECIES** A l l records following t h i s are treated as compositional and thermodynamic data for the aqueous species u n t i l another control record i s encountered. Aqueous species data records must occur i n pairs and have the form NAME FORMULA REF # 0 DELTA H S A a CHARGE and use the following format statments FORMAT(1A1,25A4) FORMAT (5X,6F10.3) , respectively. The format of these data records i s exactly the same as that for the mineral data, except there i s no abbreviation of the name (ABV) and there are no B and C heat 60 capacity terms. Two new terms have been added: "a5" i s the Debye-Huckel size term for each ion and complex. CHARGE i s the charge on the ion or species. I f the charge i s greater than 9.9, then the charge i s assumed to equal zero, and an a c t i v i t y c o e f f i c i e n t of one i s used for that species. **GASES** A l l records following t h i s are treated as compositional and thermodynamic data for the gas species u n t i l another control record i s encountered. Gas data records must occur i n pairs and have the form NAME FORMULA ABV REF # DELTA H S A B C and use the following format statements FORMAT(1A1,25A4) FORMAT(5X,6F10.3) , respectively. The format of these data records i s exactly the same as for the mineral data. Note that there i s no volume term (V) for gases. PREFERENCES** A l l records following t h i s control record are ignored by the program unless a control record or an $ENDFILE i s encountered. Usually, data references (see example i n Table III) are l i s t e d i n t h i s portion of the f i l e but any information, including blank l i n e s , can be a part of t h i s section. 61 **STOP** When this control record is encountered, reading of the data f i l e i s terminated. This record is optional and, generally, a $ENDFILE is used instead. 62 Table I I I Example of Unit 3 Data S t r u c t u r e 0.4884 0.5095 0.5471 0. 6019 0. 6915 0.8127 0.9907 1. 2979 0.3241 0.3284 0.3347 0. 3425 0. 3536 0.3659 0.3807 0. 4010 0.0174 0.0410 0.0440 0. 0460 0. 0470 0.0470 0.0340 0. 0 1.0000 1.0000 1.0000 1. 0000 1. 0000 1.0000 1.0000 1. 0000 1.3100 1.2700 1.2300 1. 2000 1. 1900 1.2300 1.3400 1. 5000 1.6700 1.5700 1.4900 1. 4400 1. 4000 1.4700 1.6700 2. 0000 2.0600 37 1.9300 1.7800 1. 7400 1. 7000 1.7400 1.8600 2. 2900 0 H NA CA MG FE MN AG AU PB ZN CU HG SI AS S C CL AL K F MO N P NI CO W BA SN U V SR TI I BR CS LI 15.99940 107.87000 74.92160 95.94 118.69 238.03 132.905 6.939 **MINERAL DATA** ALPHA-QUARTZ -910647. HEDENBERGITE -2838826. 1.00797 22.98981 196.96700 207.19000 32.06400 12.01115 14.0067 30.9738 40. 65. 35. 08000 37000 45300 50.942 58.71 87.62 24.31200 63.53999 26.98151 58.9332 47.90 55.84700 200.59 39.10201 183.85 126.9044 54.938 28.086 18.9984 208.980 79.909 SI (1)0(2) 41.338 A-QTZ 63.5060 SI(2)FE(1)CA(1)0(6) 170.289 229.3250 CLINOZOISITE SI(3)AL(3)CA(2)H(1)0(13) -6879419. **AQUEOUS DATA** AL -13.807 -125. 295.558 AL(1) -531326. -321.749 F- F ( l ) -332615. FE+-H- FE(1) -48539. **GASES** CARBON DIOXIDE -393522. STEAM H(2)0(l) -241818. PREFERENCES** REF. #1 HELGESON 1977 REF. #2 BROWN 1976 REF. #3 HELGESON 1969 443.9976 REF. 0.0076034 HED 0.0341833 C-ZO 0.1054953 REF. #3 N #2 -1913257. REF. #1 -6280182. REF. #1 -11357465. 22.687 68.270 136.200 11.7152 9.0C REF. #3 -315.892 C ( l ) 0 ( 2 ) 213.685 188.715 5200 REF. 0920 4.00 H20 C02 44.2249 30.5432 #3 9.00 REF. #1 0.0087864 REF. #1 0.0102926 -1. 3. -861904. 0. SUPCRIT DATA SET CALCULATED A.J.S. VOL. 267, P 729-408 63 A normal data base may consist of hundreds of phases, aqueous species and gases but to si m p l i f y the example i n Table I I I , i t has only three phases, three aqueous species and two gases. The f i r s t eight l i n e images i n the example correspond to program records 1 to 8. The following l i n e image i s the number of chemical elements (NCTZ) and i s followed by s i x l i n e images containing the 37 (NCTZ) atomic symbols. These are followed by s i x l i n e images of the 37 (NCTZ) atomic weights. The atomic symbols and the atomic weights are in the same order and correspond to each other. The data images "**MINERAL DATA**, **AQUEOUS DATA** and ** GASES** and the data images following them are self-explanatory from the data record description. The PREFERENCE** information i s never used or even printed by the program. In t h i s example, however, the REF. # from the data section corresponds to the data sources given i n the PREFERENCE** data images and i s for the investigator's own information. Data Structure for Unit 5 This f i l e contains a l l of the data for a s p e c i f i c execution. Unlike Unit 3 on which the data i s generally s t a t i c , the data i n t h i s f i l e w i l l change from one modeling attempt to another. When executing t h i s program with a given set of data on t h i s unit for the f i r s t time, i t i s recommended that the maximum step size be set to one and the results examined for correctness. Record 1: T i t l e card 1 64 FORMAT(20A4) Record 2: T i t l e card 2 FORMAT(20A4) Record 3: T, P, NRT, AMH20, NDLINC, MAXI, IMX, ISX, IGX FORMAT(2F10.3,I5,F10.3,5I5) T i s the temperature i n degrees Celsius. P i s the pressure i n bars. Use 1 bar because the program does not consider aqueous species at other pressures. NRT i s the number of i n i t i a l reactants. I f NRT i s equal to 0, then only a d i s t r i b u t i o n of species calculation i s done. AMH20 i s currently not used. Leave t h i s f i e l d blank. NDLINC i s the number of steps between each prin t cycle. There w i l l automatically be a report each quarter of a log unit once log i s greater then -6.0. MAXI i s the maximium number of steps i n the execution. I f t h i s f i e l d i s blank, i t defaults to 10000. IMX, ISX, IGX are the number of minerals, aqueous solution species and gases, respectively, from Unit 3 that, w i l l not be considered during t h i s run. The names of the excluded phases and species w i l l be specified i n Records m, n and o. Record 4: NION 65 FORMAT(2A4) The name of the ion used for e l e c t r i c a l balance. This ion must be a charged aqueous species and must be present i n the **AQUEOUS SPECIES** section of the data read from Unit 3. This ion must be one of the component species, and the data for t h i s ion must be given as a molality. Assigning t h i s ion as a component species with a given molality w i l l be discussed i n Record p. The molality given by the user on Record p w i l l be varied by the d i s t r i b u t i o n of species subroutine u n t i l the aqueous solution i s e l e c t r i c a l l y balanced. Thus, the i n i t i a l m o l ality of t h i s ion i s used as a f i r s t guess for deriving the f i n a l , calculated molality. I t must be l e f t j u s t i f i e d i n the "A" format f i e l d . Record 5: RR, AM, NAM FORMAT(F5.3,5X,F10.5,5X,5A4) This record i s repeated NRT times, once for each reactant mineral. I f NRT (see Record 3) i s zero, t h i s record i s not needed. RR i s the reaction rate of the reactant mineral r e l a t i v e to the progress variable. Use 1.0 as a default value. AM i s the amount, i n grams, of the reactant mineral. NAM i s the name of the reactant mineral as i t appears i n the data records on Unit 3. NAM must be l e f t j u s t i f i e d i n the "A" format f i e l d . Record m: IM 66 FORMAT(3(5A4,5X)) Names of the minerals to be suppressed. There must be IMX (see Record 3) names, 3 per record, l e f t j u s t i f i e d i n the "A" format f i e l d . I f IMX i s equal to 0, t h i s record i s not needed. The names must be id e n t i c a l to the names as they appear i n the data records on Unit 3. Record n: IS FORMAT(4(2A4,12X)) Names of the aqueous species to be suppressed. There must be ISX (see Record 3) names, 4 per record, l e f t j u s t i f i e d i n the "A" format f i e l d . I f ISX equal to i s 0, t h i s record i s not needed. The names must be id e n t i c a l to the names of the aqueous species as they appear on Unit 3. Record o: IG FORMAT(3(5A4,5X) Names of the gases to be suppressed. There must be IGX (see Record 3) names, 3 per record, l e f t j u s t i f i e d i n the "A" format f i e l d . I f IGX i s equal to 0, t h i s record i s not needed. The names must be id e n t i c a l to the names of the gases as they appear on Unit 3. Record p: MOA, NDX, TOTM, NAM, FORM FORMAT(212,E10.3,60A1) This set of records sp e c i f i e s the set of component phases, 67 species and gases used during the distribution of species calculation and defines the compositional space of the system. There are NC - l records, where N C is the number of components needed to describe the system. Each of the records describes one component in the system which i s to be constrained. Water is automatically added as a constraint by the program. In a non-redox system composed of N elements, the user must supply N - 1 constraints. In any redox system composed of N elements, the user must supply N constraints. A l l constraints (including water) must be linearly independent! If executing in batch mode, the last record must be an "$ENDFILE". If this data is being read from a f i l e , the "$ENDFILE" w i l l be supplied automatically. The variables are described in an order different than that required for the data record in order to simplify the explanation. NAM is the name of the component phase, species or gas and is l e f t justified in the "A" format f i e l d . It must start in column 15. The name must be identical to the name as given on Unit 3. FORM is the formula of the component phase, species or gas and follows the form given for formulas discussed in the data records for Unit 3 (see Unit 3, **MINERAL DATA**). There must be four blank spaces between NAM and FORM. NDX indicates whether the state of the component i s a aqueous species (NDX = 0), stoichiometric solid phase (NDX = 1), 68 solid solution phase (NDX = 2, this code i s currently not used), or a gas (NDX = 3). See below for the relationship among NDX, TOTM and MOA. TOTM is the number of grams, the molality, the log activity or the log fugacity of the component phase, species or gas. MOA indicates whether the data in TOTM is moles/molality (MOA = 00) or log activity/fugacity (MOA = 01). If NDX is 01, indicating a solid phase, then TOTM is assumed to equal the total number of grams of that phase regardless of the setting of MOA. If NDX is 03, indicating a gas, then MOA must be equal to 01 and TOTM w i l l contain the log fugacity of that gas. The following example i s the data assigned to Unit 5 to model the reaction of potassium feldspar with a one molal sodium chloride solution at 25 C. and one bar total pressure. The i n i t i a l amount of potassium feldpar present i s ten grams. The i n i t i a l pH is 5.5 and the solution i s saturated with respect to quartz (i.e., quartz i s in equilibrium with the solution). This example uses chloride ion to maintain electrical neutrality within the solution. This data deck specifies there w i l l be a print cycle each 100 steps, and that the run wi l l stop after 10000 steps or sooner i f the solution comes to equilibrium. The f i r s t record in the example data deck i s the t i t l e record indicating " TEST RUN " and the last is the record specifying the potassium ion molality. 69 TEST RUN OF DISSOLUTION OF K-FELDSPAR IN ONE MOLAL NACL SOLUTION AT 25 DEGREES 298.15 1.0 1 10010000 CL-1.0 10.0 K-FELDSPAR 00001.0 NA+ NA(1) 00001.0 CL- CL(1) 0100-5.5 H+ H(l) 010110.0 ALPHA-QUARTZ SI (1)0(2) 0000 0.5E-10AL+++ AL(1) 00000.05 K+ K(l) Restarting PATH To restart the program, the data records used for Unit 5 are i d e n t i c a l with the i n i t i a l data used with two major exceptions. The amount i n grams of the reactant phases w i l l have changed, thus i n record 5, AM w i l l be d i f f e r e n t for each reactant phase. One or more of the reactants may have been consumed, i n which case NRT must be decreased by one (or more) i n Record 3 and there w i l l be one (or more) less Record 5's required. The m o l a l i t i e s of the component aqueous species and the number of grams of the component phases w i l l have changed. The component basis has most l i k e l y changed as w e l l . The component basis existing during the f i n a l p r i n t cycle can be read and these components used as data records for Unit 5. Use a c t i v i t i e s i n constraining a l l of the component aqueous species except for the component species chosen for charge balance. I t must be given as a molality. 70 Error Messages The following are error messages commonly encountered while using the program. Possible causes are l i s t e d with the messages. "SINGULAR MATRIX RETURNED FROM INVERSE ROUTINE. THE COMPONENTS PASSED TO IT FOR THE NEW BASIS MUST NOT BE INDEPENDENT. THESE COMPONENTS ARE Check input data because i n i t i a l components chosen by user are not independent. Remember that water i s automatically assigned as a component by the system. "A CONSTRAINING PHASE CONTAINS TWO OXIDATION STATES - BUT THERE IS NO REDOX COUPLE. YOU MUST HAVE A REDOX COUPLE IF YOU HAVE TWO OXIDATION STATES." Check your input data as per error message. "IMPROPERLY FORMATED DATA BANK. LINE IN ERROR IS " Error i n the thermodynamic data f i l e on Unit 3. Line with error i s shown. Correct and rerun. "PHASE BOUNDARY NOT FOUND IN XXXX HALVINGS " This indicates that the program, for reasons due to numerical rounding, can not fi n d the exact point at which the phase has become saturated. Typically t h i s can solved by restarting the program using data from the preceding step. " THE SPECIES " " CHOSEN AS THE ION TO BE BALANCED ON COULD NOT BE FOUND " or 71 " COMPONENT " " COULD NOT BE FOUND. CHECK IF COMPONENT IS PRESENT IN DATA DECK AND THAT YOU HAVE SPELLED IT THE SAME AND THAT IT IS LEFT JUSTIFIED IN THE INPUT FIELD." "ALSO CHECK THAT THIS PHASE DOES NOT HAVE TWO OXIDATION STATES IF THE SOLUTION CONSTRAINS ONLY ONE. " Self explanatory. "CONCENTRATION OF ION DRIVEN NEGATIVE WHILE TRYING TO ACHIEVE ELECTRICAL BALANCE " Choose ion with opposite charge to the present one for the charge balance ion. "IMPOSSIBLE CONSTRAINTS FOR DISTRIBUTION OF SPECIES " " DRIVEN NEGATIVE " or "FAILURE TO CONVERGE ON CONCENTRATION IN 25 CYCLES. " The data defines a solution composition that is impossible. Reconsider Unit 5 data. "STEP SIZE HAS GONE TO SMALL. " The program can no longer follow the mass transfer function, because the error has gotten too large. This is also the result of numerical rounding techniques. By restarting the program at the previous step, this error can be corrected. "THIS RUN HAS BEEN TERMINATED BECAUSE THE INITIAL SOLUTION IS SUPERSATURATED WITH RESPECT TO ONE OR MORE PHASES. " Self explanatory. Examine input data for Unit 5 and lower some of the activities or molalities of the components. 72 Example This example simulates the reaction of potassium feldspar with an aqueous solution i n equilibrium with quartz. I t uses the same input data for Unit 5 as was given above. This example was run on an AMDAHL 470 V/6 Model II computer under the Michigan Terminal System (MTS) and took 2.9 CPU seconds. There may be s l i g h t numerical differences between t h i s example and the same executed on another type of computer because of the possible differences i n word length, exponentiation and rounding. ******** DATA ECHO ********* TEST BUN OF DISSOLUTION OF K-F ELES PAB IN ONE J50L&L NACL SOLUTION AT 25 DEGREES ' IEMPEBATUBE (KELVIN) OF THIS BUN I S ......... .298. 15 PBESSUBE (EABS) CF THIS BUN I S 1.00 MAXIMUM NOMBEB OF STEPS I S .................. 10000 NUMBEE OF STEPS BETWEEN EACH EEINT OUT IS ... 100 ION CHOSEN FOB ELECTB.ICAL EA1ANCE IS ........ CL-MOLES OF SOLVENT H20 IN SYSTEM IS ........... 55.508250 ************* INITIAL BEACTANTS *********** BATIG PIESENT GBAMS PBESENT 8-FELDSPAB 1.00000 10.00000 * * * * * * * * * * * * * i H i i i J i SOLUTION CONSTBAINTS *********** 0. 1C00OGCOE+O 1 MOLALITY NA+ NA(1) 0. 1CO0O00OE+0 1 MOLALITY C I - CL(1) -0.55000COCE+0 1 LOG ACT. H+ H (1) 0. 10000000E+0 1 GBAMS ALPHA- QUABTZ SI (1)0 (2) 0.50000000E-1 0. MOLALITY AI+*+ AL(1) O.5CO0C000E-0 1 MOLALITY K+ K(1) ****************************** 73 (AQUEOUS SPECIES) (AQUEOUS SPECIES) (AQUEOUS SPECIES) (SOLID) (AQUEOUS SPECIES) (AQUEOUS SPECIES) I EST SUN OF DISSOLUTION OF K-FELDSPAR IN ONE MOLAL NACL SCLUTICN AT 25 DEG'BI IS 74 DISTBIEUTICN OF SPECIES CALLED AT STEP AQO'EOOS SPECIES SPECIES . MOLALITY LOG MOL ACTIVITY LOG ACT ACT COEF LG ACT C GHAMS/KGP! H20 PPM LOG PPM AL + + + 0.17413E-10 - 1 0.759 0.13109E-11 -11. 882 0.75284E-01 -1.123 0.46984E-09 . 0.000 -6. 354 K + 0.5000 0E-01 - 1 . 301 0 .3G354E-01 -1.518 0.60708E+00 -0.217 0. 19551E + 01 1840.650 3. 265 NA* 0.10000E+01 0.0 0.66147E+00 -0.179 0.6614 7E+0 0 -0. 179 0.22990E+02 21643.997 4. 335 H4sio4 0.91812E - 0 4 -4 . 0 3 7 0.91812E-04 -4.037 0. 10000E+01 0.0 0.88246E-02 8.308 0. 919 CL- 0. 10.500E + 01 0.021 0.6.3744E + 00 -0.196 0.60708E+00 -0.217 0. 37226E+02 35046.605 4. 545 OH- 0.49256E-08 -8 . 3 0 8 0.31317E-08 -8.504 0.6358GE+00 -0.197 0.83772E-07 0.000 -4. 103 H* 0.38596E-05 . -5.413 0.3 1623E-05 -5.500 0.81932E+00 -0.087 0.38904E-05 0.004 -2. 436 B20 0.55508E+02 1.744 0.96287E+00 -0.016 0.17346E-0 1 -1.761 0. 10000E+04 941460.436 5. 974 AL (CH)*• 0.32490E-10, - 1 0.488 0.72961E-1 1 - 11.137 0.22456E+00 -0.649 0. 14292E-08 0. 000 -5. 871 AL (CH) 4- 0 . S 6 2 47E - 1 3 -13.017 0.63665E-13 -13. 196 0.66147E+00 -0. 179 0.9144 5E-11 0. 000 . -8. 065 H 3 s i o a - 0.55851E-08 - 8 . 2 5 3 0.36944E-08 -8.432 0.66147E+00 -0. 179 0.53118E-06 0.00 1 -3. 30 1 HCL 0. 11462E - 1 1 - 11. 941 0. 147 29E-1 1 -11.832 0.1285 0E+01 0. 109 0.41792E-10 0.000 -7. 405 IONIC STRENGTH = 0.105000E*01 ELECTRICAL BALANCE = 0.732650E-15 GASES NAME LOG K ACTIVITY LOG ACTIVITY STEAK. 1 . 5 0 5 1 7 0. 30088E-01 1.52160 THE LOG K FCS KDSCOVITE HAS BEEN EXCEEDED AT STEP 1 LOG K = 10.3095251 LOG Q- = . 10.7906963 ****** NEB STEP SOMMABY ******* 75 .DEL XI = 0.891276E-08 XI = 0.891276E-08 LOG XI = -8.050 BEACTANTS MINERAL K-FELDSPAR CUMULATIVE LOG CUHDALT CUMULATIVE LOG CUHU1AT REACTION GRAM CHANGE GBAM CHANGE MOLE CHANGE MOLE CHANGE COEFFICIENT -G.248075E-05 -5.60 5 -0. 891276E-08 8.050 0. 100000E+.01 LOG OF SOLUBILITY PRODUCT 0.672030E+01 LOG OF ION PRODUCT 0.609356E+01 PRODUCTS MINERAL ALPHA-C'OABTZ CUMULATIVE GB A 8 CHANGE 0. 100000E+01, LOG. CUMUALT . CUMULATIVE LOG CUHBLAT REACTION GRAM CHANGE MOLE CHANGE MOLE CHANGE COEFFICIENT .0.00 0 0. 166432E-01 -1.77 9 0.299517E*01 LOG OF SOLUBILITY PRODUCT 0.0 LOG OF ION PRODUCT 0.0 MINERALS ALPH A-QUAST;Z ASA1CIBE ANBALUSITE A—CBISTOEALITE 8 ETA-QUABTZ 8CEHMITE B-CBISTOEALITE COESITE COBUNDUM EEHYJ3BATIC ABALCIHE DIASPOBE'* GIEESITE HALITE HIGH SANIEINE HIGH ALBJTE JACEITE KAL S U I T E K AOL IN H E . K YABITE K-FELDSPAR LOW AIEITE MUSCOVITE SEEHELINE IA RAGONITE POTASSIUM OXIDE PYBOPfiYLLITE 5ILIIMANITE LOG K 0.0 9.809 9.674 0.270 0. 138 4. 150 0.376 0^810 10.490 11.516 3.30 5 2.515 1.432 7.920 . 1 0 . 9 4 1 11.249 S.899 4.532 '9.400 6.720 9.623 10.310 12.664 14.069 8 4.316 6.157 10.033 LOG' Q . 0.0 . 7.4154200 4.2324007 0.0 0.0 2. 1079848 0.0 0.0 4.2324007 7.4318511 2.1079848 2.0915537 -0.3750500 6.0935556 7.4318511 7.4318511 6.0935556 4. 1995385 4.2324007 6.0935556 7.4318511 10.3095251 7.4318511 11. 6478206 7.9547105 4.2159696 4.2324007 aa cn CM CT> o i-3 O CN 33 !C CS N t o cc C5 u 6-" U CH O IH vo Pu H «- W W r* CN W O H LO M • CJ H • CJ O «~ pq H <a I CH U ' to « s o o to i-3 EJ O H w u T- o o •-3 .1 w t n un - ^ . CO r- to CO o s r f> o H o . X f"* PO IH c r H c n r— U • M «* o t> * • . M O £-1 1 o m . to I • m © o W | i n sn to I Ci> • << I O (N CN t3 I » 4 . o •3- CN N J . •t vO M i-3 «SJ >A O S O w . . . t o E fH W P H W E M >-1 t* S «C CJ Q i-J «* IM W O >*• 55 £4 CL, tn tn tn to m i n i f i o i i n o o s r v o o t o o o f - t v i m t T H f i r - ^ . O i v O O O C N * •s' n «f o * a <M in o i n cn. p-i " I i i i i o o r*. cc in o =r vo © o © o t o tn o O o o ro © o © © o V O O Y ro- V O o o =r © © o © • • » • • • t • • * o o ro C O V O c o o o © © © sr i t vo C O v O C s r T m- in CN rn s r cn p » * — CN C N C N in sr V O 00 V O o o o O O o o o o o © © l + 4- 1 + i i + 1 1 1 1 pa KI IM w m CH CO W sr O v O V O CN sr © r~ © o © (3s! in CTi sr CN CN o o 00 CN ro r - m cn CN C N 3- v O © vo oo m sr cn CN 00 r - ar 00 o in vD ro T— C O C N C O ro 00 ro rsi tn s r o o o o o o o © o © o © m r~ as r- ' r- t n cn cn cn CN p- cn 00 V O s r r - o T CN o CN *- o r - vC *~ 1 O 1 o i © O 1 o i o 1 r— 1 o o i o 1 o o o o o © r— o o o o o o o o o © © o © o t 4- 4- + + + + 1 + + + w pa FM • w w W m w w w ST 00 o 00 o CN vO v O r - r*- o C O o s r o o 00 ro s r tn sr s r in C N r~ o P> in t n ro- sr «— 00 in o v O o o ro CN v O vo CN r - vo v O V O v O 00 C N v O V O m~ o o O o o o o o O o o o C O t n r - vo ro vo CN cn in co p » ro cn o o 00 ro C N PO V O in *— o in in o 00 cn s r oo • t • • • • * • « 'v • • » 0"! o sr o 00 m o 00 00 1 1 1 l 1 1 l 1 1 I 1 ;| t n o s r o 00 m o C O o 00 o o o o o o o © o r— o r~ 1 1 4- t •4- 1 I + 1 I 1 1 w w c a w m w w w IM w IM o s r r > CN St o © r». r o w— o in co- in sr St v O 00 CO T — m r n rn co in ro C N » — r - C N v O m O v O ro »•» r— V O ro r * s r C M m s O t n V O ro ro cn r— rn • • * * • • t * • * • o o o o o O © o O o o o C O < — o .^ s r =r CN © s r © o o CO ( N o s r ro in in s r in rn- o O ro sr C N C N vr> C O o a- Q oo m C O © 00 T~ 1 1 1 1 I I 1 1 1 1 co « • - oo in C N oo o 00 o o o o O o o O o o 1 1 4- 1 + 1 I + 1 1 ) 1 (M w c a w w w m tu w W V P o o ( N o oo cn 00 i n s r s r s r un o o © rn cn o cn © 00 © o o co i n v O C N tn ro C N r n o o o cn oo tn w V O m CTi sr- n m m mm m • t • f • • • t t • » O o o O o o © . © o o © o + 1 =r 1 s r 4> o •3 ' aa Q 4> N O (j H + .+ to 1 i O to •a ! as + C N m U 55 33 O 33 P C 03 33 O o CO CN © CN 00 CN CO GO © M ro ro T 1 — rn m* T — X + + + + •4- + + + + + 4- + O pq m m w w w w (H P3 \ C N tn o © cn; cn. o cn cn CN E i n t n o c i n © CN © o o © i n rn CO © m © r— m- o T— t— rn S3 rn ro vO vo rn vO r - vO VO' VO VC ro •4 t n cn 00 cn - (N CD T— 00 00 cn • p o o © 1 O o o O I O o o o 1 o i o o CN (N cn CN r - ,_ VO CN © t— o *— © Jx! + + + + + + + 4- + + 4- 4> w w w ( M . \ C N t n i n i n CO cn cr. 00 © cn 00 00 S3 i n VO 00 r> © cn vO sr rn sO r— ro o © © sO © ro sr CN i n 00 00 ro ro 00 o ro vO cn cn t h cn r » s r 1 — a tn' cn i n CN sr CN •~ in- r— t— o o © O o © ! O 1 o o © o © I sr sr CN sr i n CN CN CN s r H O © T— CN o CN o CN o X + * + + + + + + + + a t a w w w IM Pd w P < 3 v r - vO s r o © 00 sr O s r sr r -s i n i n © © m o *— © o o © i n rsj CN m- o CN o CO r— o T— CN » — m o o CO rn o m rO i-^ 00 CO vo s r sr «— vO sr vo vO oo CN • • • •• • # # • • • t Q O o © I o I © © t o 1 o o 1 © © 1 © 1 sr- s r vo VO VO r— sr i n ^ r o vO © o o o o o o o o o o o + + + + 4. + + 4. + 4- + 4-l—l w i a CCS W w w m r - cn VO rn •sr sat- r » s r i n ro sr Q i n < — rn =r CN i n r - CN r— o vO o \ C N r n ro sr sO i n . CN CO I — * cn *—-E r - i n s r CO O t n r~ r - 1—' VO i n CO 00 sr- ro- sr- m m* vO •—*• r -• o o o o o o o 1 O 1 © o o © o I - f VO CN vO SO sO ^ * M O o © O o ' © o o o "X 1 1. + + + 1 + -»• 4- 4> 1 o w w m M fn w Pt3 w W Pd v . m s r vo o vO cn^ CN vO m vo vO i n E . r o ro vO o t n vO vO o VO .sd. ro cn « n ro o cn cn CN rn o ro ro cn S5 rn ro vo o cn cn ro VO o VO vO • m CN CN CO CM i n oo rsj CO oo : CN Q t • t • * • • m t t • t o 1 © i © 1 o © • o o O o .© o 1 . o m~ o O o in.fN CN CN sO © o o o o o o o O o o o 1 1 +• + + + i 1 1 1 1 " 4-pa w w w w w w w pq fcq w P « 3 « * i n © s r CN o VO r— CN VO rn VO c u m rn m 00 CO CN o s r m m t n 00 t n w ro cn 00 to cn m CN CN cn CN ss ro t n ro s r t n =r 00 CN cn CO oo , r o CM CN ro VO t n rn s r s r s r t n W*fi t » • » » » # • t * • ' f t . O o o o o o o © ' O © -Q o I I I VI o CN 00 cn so ro © CM o 00 s r r> cn en so o o ro o 00 o cn r n o C3 O O O © o o cn m oo « - © U t t t » • » • • • • » • * • 4 © O . © o o s r s r CO oo r n so 1 r™ *™ *** r— CN 00 t n vo ro CO s r r - t n t n so m o co o w n ti) o o o o o r - o cn i n oo » - o o » • • * » t t t • • t • i-l o o o o © =r s r ro oo m so o i m» • tn w O 4- 1 E 4» -sr 1 | j tn , . sr s r 33 *- O 33 o o +• O h4 H u 4« 1 4» tn i tn O o w t-l 4. r-3 s r 33 ro o H CN S5 tj 03 «a « 33 O «s 33 33 33 t n - * 4-(« sr V O i n o r—• O I rsi o m 1— • H i n • Ctj ro © C5 Cti CO 1 O # m «* s r H o O 4-(M cn 00 © sO - =r o cn 4> • PH © »-3 O i sr EH sr O Cu sC s r En O J r— o (N 4-w O V O cri i n o • cn o CN • CN O © 33 + t W-<«C E CO tn O 00 © H \ cn. 1 tn CN s CN ' • tn «s » CO ta CKj O vo •-3 C5 S O O CN E t o O •J CN o o i n O EH o CN 6H H o o 00 H4 o-1 " o O «* • w i n a 1-3 o CN - - • H3 Q ( s r t n SKS so to i n CN -••' .to ' © : H m~ o .. E 4-> i-H H .o EH M o o tn fcH 1-3 o o X O <C © o tn © . » •• O o . o IM E 33 (t H . O !23 -H O CC o w m . • m o o ob so m- Pu • o tn O tn pa tn -M w to • i-H IM M O > ' «Kj O M M CLi X! E U O tt «C b <=C CN \ H u -4-33 - H O <e * O CL-H • ALPHA-QUARTZ Al(OH) * + K + H20 0- 1G5000E+01 0,362239E-05 0.918179E-04 0.896216E-08 0.5000GGE-01 0.555084E+02 0.0212 •5.4177 -4.0371 •8.0476 • 1. 3010 1.7444 0.372258E+02 0.385285E-05 0.5516 86E-02 0.394262E-06 0.195510E+01 0. 100000E+04 0.. 350466E + 06 0.3627 31E-01 0.51939 0E+Q2 0.371182E-02 0. 184065E + 05 0.941464E+07 • 5.5446 -1.4404 1.7155 -2.4304 4.2650 6.9738 77 TOTAL MASS TRANS FER IN THE SYSTEM KINEBAL PHASES K-FELDSPAR ALPHA-QUARTZ AMCUNT OF REACT ANT DESTROYED MOLES ' GRAMS :• AMOUNT OF REACTANT PRODUCED MOLES GRAMS -0.8913E-G8-0.2481E-G5 0.0 •' AMOUNT OF PRODUCT PRODUCED MOLES GRAMS 0.0 AMOUNT OF PRODUCT DESTROYED MOLES GRAMS 0.2669E-07 0. 1604E-05 0.0 0.0 NET AMOUNT IN THE SYSTEM MOLES GRAMS 0.3593E-01 0.1000E+02 0. 1664E-0 1 0. 1000E + 01 NUMEEE OF DELXI INCREMENTS FORHARD = IONIC STRENGTHS 0. 105000E + 01 ELECTRICAL BALANCE - 0.6 534 74E-15 TOTAL NUMBER OF PHASE BOUND ARIES PRESENTLY. BEING CONSIDERED = 1 ****** J J E W STEP SUMM SB Y * * * * * * * 78 DELXI ..•''• = 0.570417E-06 XI =0.57933OE-06 LOG XI = -6.237 BEACT ANTS MINER AL K-FELDSPAB CU EOLATIVE GBAK CHANGE -0. 161249E-03 LOG CUMUALT CUMULATIVE LOG CUMULAT REACTION GBAM CHANGE MOLE CHANGE MOLE CHANGE• COEFFICIENT -3.793 -0.579330E-06 -6.237 0.10000QE+01 LOG OF SOLUBILITY PRODUCT 0.328379E+01 LOG OF ION PRODUCT 0. 26 8674E+01 PRODUCTS MINERAL CUMULATIVE GBAM CHANGE LOG CUMUALT GBAM CHANGE CUMULATIVE MOLE CHANGE LOG CUMULAT MOLE CHANGE REACTION COEFFICIENT LOG OF SOLUBILITY PRODUCT LOG OF ION PRODUCT ALPHA-QUARTZ 3USCOVITE 0. 10G007E+01 ' 0.000 0.76C'l90E-04 -4.119 0. 166443E-01 0, 190852E-06 -1.77 9 -6.719 0.199495E+01 0.3 346 97E+00 0.0 0.0 0.0 0. 0 MINERALS LOG K LOG Q USE A- QUARTZ ANALCIME ANDALUSITE A-CBISIOEALITE 3ETA-QUA.ETZ BOEHMITE 3-CBISTOFALITE COESIIE CCBUNEUM CEHYDBATED ANALCIME DIASPOBE GIEESITE HALITE ' HIGH .SANIDINE HIGH AIBITE JADEITE SALSILITE KACIINITE KYANITE K-FELDSPAR LOW ALEITE MUSCOVITE NEPHELINE P ABAGONITE POTASSIUM OXIDE EYBOEHYLLIIE 0.0 6.372 . 2.801 0.270 0. 138 0.714 0.376 C.810 3.617 1 1.079 -0.131 -0*9 22 1.432 4.483 7.504 7.813 6.463 -2.341 2.526 3.284 6. 186 0.0 9.227 3.760 84.316 -0.716 0.0 4.0085973 •2.6703051 0.0 0.0 •1,3433681 0.0 0.0 •2. 6703051 4.0250284 •1.3433681 •1.3597992 •0.3750500 2.6 867362 4.0250284 4.0250284 2.6867362 •2.7031673 •2.6703051 2.6867362 4.0250284 0. 0 4.0250284 1.3382922 8. 0 4 377 76 -2. 6867362 SILLIMANIT E SODI DM OXIDE SY.LVITE 3. 160 67.427 1.223 -2.6703051 10.7203620 -1.7 133422 79 GASES NAME SIEAB LOG K 1. 505 17 ACTIVITY 0.30088E-G1 LOG ACTIVITY -1.5 2160 AQDEOOS SPECIES SPECIES MOLALITY LOG MOL ACTIVITY LOG ACT ACT COEF LG ACT C GBAMS/KGM H20 PPM LOG PPM AL + + + 0.22065E-08 -8.656 0. 166 11E-09 -9.780 0.75284E-01 -1 . 123 0. 59535E-07 0.000 -4. 251 K> 0.5000QE- 01 - 1 . 301 0.30354E-01 -1.518 0.60708E+00 -0.217 0. 19551E+01 1840.664 3. 265 N A t 0. 10000E+01 -0. 000 0.66147E+00 -0.179 0.66147E+00 -0. 179 0. 22990E+02 21643.996 4. 3 35 H4SIC4 0.91812E- 04 -4. 037 0.91812E-04 -4.037 0. 10000E*01 0. 0 0. 88246E-02 8.308 0. 919 Cl-r 0. 10500E + 01 0. 02 1 0.63744E+00 -0.196 0.60708E+00 -0.217 0. 37226E+0 2 35046.605 4. 545 Ofl- 0.54SS3E- 0 8 -8.260 0.34964E-08 -8.456 0.63580E+00 -0.197 0. 93528E-07 0. 000 -4. 055 H + 0.34567E- 05 ' \ - 5 . 461 0.28321E-05 -5. 54 8 0.81932E+00 -0.087 0. 34842E-05 0.003 -2. 484 H20 0.55508E+02 1. 744 0.96287E+00 -0.016 0.17346E-01 -1.761 0.10000E+04 941460.423 5. 974 AL (CH) +• G.459 70E-08 -8.338 0. 10323E-08 -8.986 0.22456E+00 -0.649 0. 20 222E-06 0.000 -3. 720 AL(Ofl)4- 0.18955E- 10 - 10.722 0.12538E-10 - 10.902 0.66147E+00 -0. 179 0. 1801OE-08 0.000 -5. 771 H3SIC4- 0.623 55E-08 -8 . 205 0.41246E-08 -8.385 0.66 147E+00 -0. 179 0. 593 04E-06 0.001 -3. 253 BCL 0. 10265E- 1 1 -11- 98:9 0. 13191E-11 - 11.880 0.12850E+01 0. 109 0. 37429E-10 0.000 -7. 453 SPECIES LGG K LCG C N EAB DL N M/DXI D2 M/DXI D2LN M/DXI D3 M/DXI D3LN M/DXI NA-* 0.0 0.0 0. 15547E-03 0. 15547E-03 -0. 17144E+02 -0. 17144E+02 0. 14587E + 08 0. 14587E+08 CL- 0.0 0.0 0. 16344E-03 0, 15566E-03 -0.18000E+02 -0. 17143E + 02 0.15316E+08 0. 14586E+08 H+ ' 0.0 0.0000 -0. 65354E+G0 --0.17064E+06 -0.29034E+04 -0.29877E+11 0.86284E*09 -0, 10 100E+17 K+ . 0.0 0.0 0. 66531E+00 0. 1 33 06E+02 0.40407E+03 0.79044E+04 -0.55284E+08 -0.11060E+10 AL + + * -8,1746 -8.1746 -0, 17665E-02 -0.56881E+06 0.69551E+03 -0.99589E+11 -0.14833E+09 -0.33668E+17 H4SIC4 4.00 42 4.0042 -0.33584E-07 . -0.36579E-03 0.29540E-02 0.32174E+02 -0.33045E+04 -0.35992E+08 OH- 13.9878 13.9878 0.84703E-03 0. 17064E + 06 0.29284E+03 0.29877E+11 0, 15072E + 09 0. 101O0E+17 AL<OH) *• -3.4 365 -3.4365 -0. 23251E-02 -0,39817E+06 0,51869E+03 -0.697 12E + 1 1 -0.19977E+08 -0.23568E+17 AL (CH) 4- 15.0734 15.0734 0. 20139E-05 0, 1 1376E+06 0.58171E+00 0. 19918E*11 0.26561E+06 0. 67336E-H6 H3SI04- 13.8996 13.8996 0. 9604 3E-03 0.17064E+06 0.33205E+03 0.29877E+11 0. 17090E + 09 0.10100E+17 HCL 6.1363 6.1363 -0. 19408E-06 -0. 1706 4E+06 -0.86223E-Q3 -0.29877E+11 0.25624E+03 -0. 10100E+17 * TOTAL MOLES H2C 0.0 0.0000 -0. 86299E-02 -0. 15547E-G3 0. 95 162E + 03 0. 17144E+02 -0.80968E+09 -0.14587E+08 * ACTIVITIES * H20 0.0 0.0000 -0. 17611E-03 • -0.18290E-03 0. 15490E+02 0. 16087E + 02 -0. 17328E + 08 -0.17996E+08 DI/DXI IS -0.56516E-G2 TOTAL MOLES OF KATEB IN THE SYSTEM IS 55.50825020 MOLES COMPONENTS TOTAL LOG TOTAL . TOTAL TOTAL LOG MOLALITY MOLALITY GBAMS/KGM H20 PPM TOTAL PPM N A * C L -8 U S C C V I T E AL PH A - C.U ART Z B + K + H20 O,100000E+01 0. 1G5Q00E+01 0. 2 274 15E-G8 0.9181171-04 0.346302E-05 0. 500004E-0 1 0.555084E+02 •0.0000 0. 0212 -8.6432 -4.0371 •5.4605 •1.3010 1. 7444 0.229898E+02 0.372258E+02 0.905823E-06 0.551649E-02 0.349062E-0 5 0.195512E+01 0, 100000E+04 0.216440E+06 0.350466E+06 0.852796E-02 0.519355S+02 0.328628E-01 0.184066S+05 0.941464E+07 5.3 353 5.5446 -2.0692 1.7155 -1.4833 4.2650 6.9738 80 TOTAL MASS TRANSFER IN THE SYSTEM K O E B A I EH ASES K-FELDSPAR . ALPHA-QUARIZ MUSCOVITE ' AMOUNT OF •„• REACTANT DESTROYED MOLES' GRAMS AMOUNT OF BEACTANT PRODUCED MOLES GBAMS - 0 . 5793E-06-0. 16 12E-C3 0. 0 0.0 AMOUNT OF PRODUCT PRODUCED MOLES • GRAMS 0. 1 165E-05. Q.6999E-04 0.1909E-06 0.7602E-04 AMOUNT OF PRODUCT DESTROYED MOLES GRAMS 0.0 0.0 0.0 0.0 NET AMOUNT j!N THE SYSTEM MOLES GBAMS 0.3593E-01 0.1000E+02 0. 1664E-01 0.1000E + 01 0.1909E-06 0.7602E-04 SUM EES OF DELXI INCREMENTS F0R8ABD = I O N I C STRENGTH = 0. 105000E+01 ELECTRICAL BALANCE = 0.740647E-15 TOTAL NUMBEfi OF PHASE BOUNDARIES. PRESENTLY BEING CONSIDERED = 2 ****** NEW STEE SUMMARY ******* 81 DELXI XI LOG X I = 0.420670E-06 = 0. 10GQ00E-05 = -6.000 REACTANTS MINERAL 8—FELDSPAR CUMULATIVE LOG CUMU ALT CUMULATIVE LOG CUMUL AT REACTION GRAM CHANGE GRAM CHANGE MOLE CHANGE MOLE CHANGE COEFFICIENT -0.27S337E-03 -3. 555 -0. 100000E-05 •6.000 0.100000E+01 LOG OF SOLUBILITY PRODUCT 0.328379E+01 LOG OF ION PRODUCT 0.27 108 1E+0 1 PRODUCTS MINERAL ALPHA-QUARTZ MUSCOVITE CUMULATIVE GRAB CHANGE 0. 100012E+01 0. 132050E-03 LOG CUMUALT CUMULATIVE LOG CUMULAT REACTION GRAM CHANGE MOLE CHANGE MOLE CHANGE COEFFICIENT 0.000 0. 166451E-01 -1.779 3.879 0.33 1524E-06 -6.479 0.199539E+01 0.334475E+0Q LOG OF SOLUBILITY PRODUCT 0.0 . 0.0 LOG OF ION PRODUCT 0.0 0.0 MINERALS LOG K LOG Q ALEH A-QUAETZ ANALCIME ANDALUSITE A-CR ISTOB AL.ITE BETA-QUAFTZ BOEBMITE B-CBISTCEALITE GOES H E CCEUNDUM DEHYDRATED ANALCIME D.IAS EG BE GIBBSITE HALITE HIGH S ANIDINE HIGH ALETTE JAEEITE KALSILITE 8 AC U N I T E 8YANITE K-FELDS PAR LOW ALBITE MUSCOVITE NEPHELINE PABAGCNITE POTASSIUM OXIDE EYBO PHY LUTE, 0.0 6.372 2.801 0.270 0. 138 0.714 0.376 0.810 3.617 1 1.079 -0.131 -0.922 1.432 4.483 7.504 7. 8 13 6.463 -2. 341: 2.526 3.284 6. 186 0.0 9.227 3.760 84.316 -0.716 0. 0 4.0326672 •2.6943775 0.0 0.0 • 1. 3554043 0.0 0.0 -2.6943775 4.0490983 •1.3554043 • 1. 3718354 •0.3750500 2.7108086 4.0490983 4.0490983 2.7108086 -2.7 272397 -2.6943775 2.7108086 4.049098 3 0.0 4.0490983 1.3382897 8. 1 159946 •2. 71080 86 S ILL IM AN.ITE SODIUM OXIDE S YLV.ITE 3. 160 67.42 7 1.223 -2.6943775 10.7925741 - 1. 7 133398 82 GASES NAME LOG K ACTIVITY LOG ACTIVITY STEAM 1. 505 17 0.30C88E-01 -1.52160 AQUEOUS SPECIES SPECIES MOLALITY LOG MOL ACTIVITY LOG ACT ACT COEF LG ACT C GBAMS/KGM H20 PPM LOG PPM AI+ + + 0. 16724E-08 -8.777 0. 12591E-09 -9. 900 0.75284E-01 -1.123 0.45125E-07 0.000 -4. 372 K + 0. 50001E-01 -1. 301 0. 30354E-01 - 1 . 518 0.60708E+00 -0.217 0. 19551E+01 1840.674 3. 265 NA + 0. 100C0E+01 -0.000 0.66147E+00 -0. 179 0.66 147E+00 -0.179 0.22990E+02 21 643. 996 4. 335 H4S.I04 0. 91812E-04 -4.037 0.9 18 12E-04 -4. 037 0. 10000E + 0 1 0. 0 0.88246E-02 8.3 08 0. 9 19 CL- 0. 105G0E+01 0.021 0.63744E+GG -0. 196 0.60708E+00 -0.217 0.37 226E+0 2 35046.604 4. 545 Ofl- 0. 5S756E-08 -8.224 0.37994E-08 -8.420 0.63580E+00 -0.197 0 . 10 16 3E-06 0.000 -4. 019 H + 0. 31809E-05 -5.497 0.26062E-05 -5. 584 0. 8 1932E+0G -0.087 0.32063E-05 0. 003 -2. 520 H20 0. 55508E+02 1.744 0.96287E+00 -0. 016 0. 17346E-0 1 -1.761 0, 10000E + 04 941460.413 5. 974 AL (OH) • + 0. 378€4E-08 -8.422 0.85027E-09 -9. 070 0.22456E+00 -0.649 0. 16656E-06 0. 000 -3. 805 AL (CH) 4- 0. 20035E-10 -10.698 0. 13253E-10 - 10. 878 0. 66 147E + 00 -0. 179 0. 19036E-08 0.000 -5. 747 H3SIG4- 0. 67758E-08 -8. 169 0.44820E-G8 -8 . 349 0.66147E+00 -0.179 0.644431-06 0.001 -3. 217 HCL c . S4465E-12 -12.025 0.12139E-11 -11. 916 0.12850E+01 0. 109 0.34443E-10 0.000 -7. 489 SPECIES NA + CL-h* K + AL + + + H4SI04 OH-AL (OH)+ + AL (OH) 4-H3SI04-HCL LOG K 0.0 0.0 G.O 0.0 -8.1746 4.0042 13.9878 -3. 4365 15,0734 13.8996 6. 1363 LOG Q 0.0 0.0 0.0000 0.0 - 8 . 1746 4.0042 13.9878 -3.4365 15.0734 13.89 97 6.1363 N E AB 0. 14827E-03 0. 15588E-03 •0.65505E + G0 0.66553E+00 0. 13938E-02 •0.32487E-07 0. 1042 1E-02 G.20327E-02 0.23946E-05 0, 118 16E-02 0. 194 5 3E-G6 DLN M/DXI 0. 14827E-03 O.14846E-03 -0. 18950E+06 0. 1331 1E+02 -0.6316 8E+06 -0.35334E-03 0. 18950E+06 -0.44218E+06 0. 126 3 3E+06 0.1895QE+06 -0.18950E+06 D2 M/DXI •0.76440E+Q1 •0.80255E+01 -0, 23675E + 04 0.37 239E+03 0.61 128E+03 0.78736E-03 0.39874E+03 0.50626E+03 0. 76498E+0 0 0.45212E+03 •0.70309E-03 D 2 LN M/DXI •0.76440E+01 -0. 76433E + 0 1 -0 . 36596E+11 0.72705E+04 -0.12199E+12 0.85758E+01 0.365 96E+11 -0. 85391E + 1 1 0.24398E+11 0.36596E+11 -0. 36596E + 1 1 D3 M/DXI 0. 19106E + 08 0.20061E+08 0. 10298E+10 •0.55763E+08 -0. 14586E + 09 -0. 43843E + 04 0.22719E+09 -0. 23685E + 08 0.38564E+06 0.2576 1E+09 0.30583E+03 D31N M/DXI 0. 19 106E+08 0. 19106E + 08 -0. 13702E+17 -0.11155E+ 10 -0.45674E+17 -0.47753E+08 0. 13702E+17 -0.31971E+17 0.91347E+16 0. 13 702E+17 -0. 13702E + 17 * TOTAL EC1ES * H20 0.0 0.0000 -0.823G4E-02 -0.14827E-03 0.42431E+O3 0.76440E+01 -0.10606E+10 -0.19106E+08 * ACTIVITIES * H2C 0.0 0.0000 -0.17035E-03 -0.17692E-03 0.41287E+01 0.42879E+0 1 -0.22990E+08 -0.23877E+08 DI/DXI IS -0.38321E-02 TOTAI CGIES OF W ATEB IN TEE SYSTEM IS 55. 50825019 MOLES COMPONENTS TOTAL LOG TOTAL TOTAL TOTAL LOG MOLALITY MOLALITY GBAMS/KGM H20 PPM TOTAL PPM NA + CL-MUSCOVITE ALPHA-QUOTS H + K + H20 0. 100-000 E+0 1 0. 105000E+01 0. 182629E-08 0.9181361-04 0. 3.182 57 E- 05 0.500007E-01 0,555084E+02 •0.0000 0. 0212 -8.7384 -4.0371 •5.4972 •1.3010 1. 7444 0.229893E+02 0.372258E+02 0.727435E-06 0.551660E-02 0.320794E-05 0.1955 13E+0 1 0. 100000E+04 0.216440E+06 0.350466E+06 0.684851E-02 0.519366E+02 0,302015E-01 0.184067E+05 0.941464E+07 5,33 53 5.5446 -2. 1644 1.7155 -1.5200 4.2650 6.97 38 83 TOTAL MASS TRANSFERRIN THE SYSTEM MINERAL PHASES K-FELDS PAR ALPHA-COARTZ MUSCOVITE AMOUNT OF SEACTANT DESTROYED MOLES GRAMS AMOUNT OF REACTANT PRODUCED HOLES GRAMS -0.10 00E-05-0.2783E-03 0.0 0.0 AMOUNT OF PRODUCT PRODUCED MOLES GRAMS 0.2004E-05 0.1204E-03 0.3315E-Q6 0.1321E-03 AMOUNT OF PRODUCT DESTROYED MOLES GRAMS 0.0 0.0 0.0 0.0 NET AMOUNT IN THE SYSTEM MOLES GRAMS Q.3593E-0 1 0.1000E+02 0.1665E-01 0.1000E+01 0.3315E-06 0.1321E-03 NUMBER OF DELXI INCREMENTS FOBWARD = IONIC STB £ NGT H •= 0. 105000E*01 ELECTRICAL BALANCE = 0.104628E-14 TOTAL NUMBER OF PHASE ECU NDARIES PRESENTLY BEING CONSIDERED = 2 ****** NEW STEP SUMMARY ******* 84 DELXI = 0.357609E-06 X I . = 0. 177828E-05 LOG XI = -5.750 REACTANTS MINERAL K-FELDSPAB CUMULATIVE GRAM CHANGE -0.494960E-03 LOG CUMUALT CUMULATIVE GBAM CHANGE MOLE CHANGE LOG CUMULAT REACTION MOLE CHANGE COEFFICIENT -3.30 5 -0. 177828E-05 -5. 750 0. 1 00000EJ-01 LOG OF SOLUBILITY PRODUCT 0. 328379E+01 LOG OF ION PRODUCT 0.276151E+01 PRODUCTS MI NEB AL CUMULATIVE GBAM CHANGE LOG CUMUALT GRAM CHANGE CUMULATIVE MOLE CHANGE LOG CUMULAT MOLE CHANGE REACTION COEFFICIENT LOG OF SOLUBILITY PRODUCT LOG OF ION PRODUCT ALPHA—QUAST2 MUSCOVITE 0. 100021E+01 0.000 Q.235650E-03 -3.62 8 0. 166467E-01 0.591619E^-Q6 -1.779 -6.228 0.199578E+01 0.334181E+00 0.0 0.0 0.0 0. 0 HISEBAIS ICG K LOG Q ALPHA-QUARTZ ANALCIME ANDALUSITE A-C fiISTCE ALITE BETA-QUARTZ BCEHMITE B-CBISTO EALITE CGESITE CORUNDUM CEHYEBATEC ANALCIME DIASPOBE GIBESITE HALITE HIGH SANIDINE HIGH ALBITE JADEITE KALSILITE KAOLINITE RYANITE K-FELDSPAR LOW ALEITE MUSCOVITE NEEHELINE PABACONITE POTASSIUM OXIDE P YBOPHYLLITE 0.0 6.372 2.801 0. 27 0 0. 138 0.714 0.376 0.810 3,617 1 1.079 -0. 13 1 -0.922 1.432 4.483 7.50 4 7.813 6.463 -2.341 2.526 3.284 6. 186 0.0 9.227 3.760 84.316 -G.716 0.0 4.0833668 -2.7450815 0.0 0. 0 - 1. 3807563 0.0 0.0 -2.74508 15 4. 099797:9 -1.3807563 -1. 3971874 -0.3750500 2.7615 126 4.0997979 4.0997979 2.7615126 -2.7779437 -2.7450815 2.7615126 4.0997S79 0. 0 4.0997979 1. 3382852 8.2681068 •2.7615126 SILLIMANI1E SODIUM CXIEE SYLVITE 3.160 67.427 1. 223 -2.74508 15 10.9446773 -1.7 133353 85 GASES EAUE STEAM LOG K 1.50517 ACTIVITY 0.30088E-01 LOG ACTIVITY -1,52160 AQUEOUS SPECIES SPECIES MOLALITY LOG MOL ACTIVITY LOG ACT ACT COEF LG ACT C GRAMS/KGM H20 PPM LOG PPM AL + + + 0. 932 92.E-09 -9.030 O.70233E-10 -10. 153 0.75284E-01 -1. 123 0.25171E-07 0.000 -4. 625 K + 0.500 01E-0 1 - 1 . 301 0.30355E-01 - 1 . 518 0.60708E+00 -0. 217 . 0.19551E+01 184 0.6 93 3. 265 NA + 0. 10000E + 01 0.000 0.66 147E+00 -0. 179 0.66147E+00 • -0. 179 0.22990E+02 21643.996 4. 3 35 H4SI04 Q.91812E-04 -4.037 0.918 12E-04 -4, 037 0. 10000E+0 1 0. 0 0.8824 6E-02 8. 308 0. 919 CL- 0. 10500E + 01 0.021 0.63744E+0 0 -0. 196 0.6G708E+00 - o . 217 0. 37226E+02 35046.604 4. 545 OH- 0.71187E-08 -8.148 0.45261E-08 -8. 344 0.63580E+Q0 -0. 197 0. 12107E-06 0. 000 -3. 943 B+ 0.266SSE-05 -5,573 : 0.2 1876E-05 -5. 66 0 0.81932E+00 -0. 087 0.26912E-05 0.003 -2. 596 H20 0.55508E+02 1.74.4 0.96287E + 00 -0. 016 0. 17346E-01 -1. 761 0. 10000E+04 941460.3 96 5. 974 A L { 0 f l ) * 4 0.25164E-0 8 -8.59*9 0.56508E-G9 -9. 248 0.22456E+00 -0. 649 0.11069E-06 0.000 . -3. 982 AL (OH) 4- 0.22515E-10 -10.648 0.14893E-10 - 10. 827 0. 66 147E+00 -0. 179 0.21392E-08 0.000 -5. 696 H3SI04- 0.80718E-08 -8.093 0.53393E-08 -8. 273 0.66 14 7E+00 -0. 179 0.767691-06 0.001 -3. 141 HCL 0.79290E-12 -12. 101 0. 10189.E-11 -11. 992 0. 12850E + 01 0. 109 0.28910E-10 0.000 -7. 565 SPECIES NA* CL-H + •K* AL + + + H4SIC4 OR-AL (OH) + + AL(CH) 4-H3SI04-BCl ICG K " 0-0. 0.0 . 0.0, 0.0 -6.1746 4.0042 13.9878 -3.4365 15.0734 13.8996 6.1363 * TOTAL HOLES * H20 0.0 * ACTIVITIES * H20 0.0 LOG Q 0,0 0.0 O.00G0 OiO -8.1746 4.00 42 13.9879 -3.4365 15.0734 13.89.97 6.1363 N EAR 0. 149 85E-03 0. 15753E-03 •0.65663E+00 0.66583E+00 •0.93109E-03 •0. 33673 E-07 0. 1479 1E-02 •0. 16158E-02 0.32075E-05 0. 16771E-02 •0.19500E-06 D.LN M/DXI 0.149 85E-03 0. 15003E-03 -0. 22605E+06 0. 13316E + 02 -0.75350E + 06 •0, 36676E-03 0.22605E+06 -0.52745E+06 0.15069E+06 0.22605E*06 -G.22605E+06 D2 M/DXI 0. 13244E + 02 0. 13906E + 02 •0. 13254E+04 0.32540E+03 0.48923E+03 •0, 40521E-02 0.67169E+03 0.48376E+03 0. 12149E + 01 0.76162.E*03 •0.39 36 IE-03 D2 LN M/DXI 0. 13244E+02 0. 13244E+02 •0.51554E+11 0.63305E+04 -0. 171 85E+12 •0.44134E+02 0.51554E+11 -0. 12029E+12 0.34369E*11 0.51554E+11 -0. 51554E*1 1 ' D3 M/DXI 0.32449E+08 0.34071E+08 0. 15159E+10 -0. 55775E + 08 -0. 14290E + 09 -0.75749E+04 G.45412E+09 -0. 30023E + 08 0.72835E+06 0.51491E+09 0.45018E+03 D3LN M/DXI 0.32449E+08 0.32449E+08 •0.22889E+ 17 •0. 1 1 157E+10 -0.76296E+17 •0.8.2504E+08 0.22889E+17 •0. 53407E+17 0.15259E+17 0.22889E+17 -0.22889E+17 0.0000 -0.83177E-02 -0. 14985E-03 -0. 73513E + 03 -0. 13244E + 02 -0. 1 80 1 2.E+ 10 -0. 32449E+08 0.0000 -0. 17657E-03 -0. 1 8338E-03 -0.21248E+02 -0.22067E+02 -0.39721E+08 -0.41252E + 08 OI/DXI IS -0.10921E-02 TOTAL MOLES OF WATER IN THE SYSTEM IS 55.50825019 MOLES COMPONENTS TOTAL MOLALITY LOG TOTAL MGLALITY TOTAL GRAMS/KGM H20 TOTAL PPM LOG TOTAL PPl CL-MUSCCVITE ALPHA-QUARTZ H + SC + . B20 0.100000E+Q1 0. 1C50G0E+01 0. 115726E-0 8 0.918169E-Q4 0.266372E-0 5 0. 5000 12E-01 0.555084.E+G2 0.0000 0.0212 -8. 9366 -4.0371 •5,. 5745 • 1.3010 1.7444 0.229898E+02 0.372258E+02 ' 0.460953E-06 0.551680E-Q2 0.268495E-05 0.195515E+01 0. 100000E+04 0.216440E+06 0.350466E+06 0.433969E-02 0.51.9385E + 02 0. 252778E-0.1 0.T84 069E+05 0.941464E + 07 5. 3 35 3 5.5446 -2. 3625 1.7155 -1.5973 4.2650 6.9738 86 TOTAL MASS TRANSFEB IN THE SYSTEM MINERAL . PH ASES 8-FELDSPAB ALPHA-QOABTZ MUSCOVITE AMOUNT OF BEACTANT DESTROYED MOLES GBAMS AMOUNT OF REACTANT PRODUCED MOLES GRAMS -0.1778E-05-0.4950E-03 0.0 0.0 AMOUNT OF ^PRODUCT PRODUCED MOLES GRAMS 0.3557E-05 0.2138E-03 0.5916E-06 0.2356E-03 AMOUNT OF PRODUCT DESTROYED MOLES GRAMS 0.0 0.0 0.0 0.0 . NET AMOUNT IN THE SYSTEM MOLES GRAMS 0. 3593E-01 0. 1000E + 02 0. 1665E-0 1 0. 1000E + 01 0.5916E-06 0.2356E-03 NUMEES OF DELXI INCREMENTS.FORWARD = IONIC STRENGTH = O.1O5000E+01 ELECTRICAL BALANCE = 0.119726E-14 TOTAL NUMBEB. OF PHASE EOUNDABIES PRESENTLY BEING CONSIDERED = 2 ****** NEW STEE SUMMARY ******* 87 DELXI XI LOG XI = 0.9 6 6057E-07 = 0.316228E-05 = -5.500 REACTANTS MINERAL S-FELDS PAR-CUMULATIVE GRAM CHANGE -0.880178E-03 LOG CUMUALT CUMULATIVE LOG CUMULAT REACTION GRAM CHANGE MOLE CHANGE MOLE CHANGE COEFFICIENT -3.055 -0.316228E-05 -5.500 0.100000E+01 LOG OF SOLUBILITY PRODUCT 0.328379E+01 LOG OF ION PRODUCT 0.288200E+01 PRODUCTS MINERAL ALPHA-QUARTZ MUSCOVITE CUMULATIVE GRAM CHANGE 0. 100038E + 01 0.4 197 04 E-0 3 LOG CUMUALT GRAM CHANGE 0.000 -3.377 CUMULATIVE MOLE CHANGE 0. 166495E-01 0. 105370E-05 LOG CUMULAT MOLE CHANGE -1.779 -5.977 REACTION COEFFICIENT 0.199458E+01 0. 33 372 5E + 00 LOG OF SOLUBILITY PRODUCT 0.0 0.0 LOG OF ION PRODUCT 0.0 0.0 MINERALS ALEHA-QU ART2 ANALCIME ANDALUSITE A-CRISTCEALITE BETA-QUARTZ BOEHMITE 8-CR1STOBALITE COESITE COBUNCUM DEHYDRATED ANALCIME DIASPOBE GIBESITE HALITE HIGH SANIDINE HIGH ALEITE J ABEITE KALS1LITE K ACL I NIT E KIANITE 8-FELDSPAR LOW ALBIIE MUSCOVITE NEPHELINE PABAGCNITE POTASSIUM OXIDE EYBOEHYLIITE LOG K 0.0 6. 372 2.801 0.27G 0. 138 0.714 0.37 6 0.81G 3.617 11.079 -0. 131 -0.922 1.432 4.483 7.504 7.81 3 6.463 -2.341 2.526 3.284 6. 186 0.0 . 9.227 3.760 84.316 -0.716 LOG Q 0.0 4.20384 32 •2.8655660 0.0 0.0 • 1.440S985 0.0 0.0 •2.8655660 4.2202743 •1.4409985 •1.4574296 •0.3750500 2. 8819971 4.2202743 4.2202743 2.88 19971 •2.8984282 •2.8655660 2.8819971 4.2202743 0. 0 4.2202743 1. 3382772 8.6295602 •2.8819971 SILLIM AN H E SODIUM OXIDE SYLVITE 3. 160 67.42 7 1.223 -2.8655660 1 1. 30 61 147 - 1. 7133273 88 NAME STEAM GASES LOG K 1. 50517 ACTIVITY 0. 30088E-01 LOG ACTIVITY -1.52160 AQUEOUS SPECIES PECIES MOLALITY LOG KOL ACTIVITY LOG ACT ACT COEF LG ACT C GRAMS/KGM H20 PPM LOG PPM AL >••+ + 0 .23304E- 09 -9. 633 0. 17544E-10 -10.756 0.75284E-01 -1 . 123 0.62878E-08 0. ooo -5. 228 K + 0 .50002E- 01 -1 . 301 0.3 0355E-01 -1.518 0.60708E+00 -0,217 0, 19552E+01 1840.727 3. 265 NA + 0 . 10000E+0 1 0. 000 0.66 147E+00 -0. 179 0. 66 147E+00 -0. 179 0. 22990E+02 21643.995 4. 335 H4SI04 0 .91812E-04 -4. 037 0.91812E-Q4 -4. 0.37 0.10000E+01 0. 0 0. 88246E-02 8.308 0. 919 CL- 0 . 10500E«-01 0. 021 0.63744E+00 -0. 196 0.60708E+00 -0.217 0. 37226E+02 35046.603 4. 545 Gfi- 0 . 10790E-07 -7. 967 0.68600E-08 -8.164 0.63580E+00 -0.197 0. 18350E-06 0.000 -3. 76 3 H* 0 .17611E- 05 - 5 . 754 0. 14429E-05 -5.841 0.81932E+00 -0.087 0. 1775 1E-05 0.002 -2. 777 H20 0 .5550SE+O2 1. 744 0.96287E+00 -0.016 0. 17346E-01 -1.761 0. 10000E+04 941460.364 5. 974 AL (OE) + + 0 .95302E- 09 -9. 021 0.2 1401E-09 -9. 670 0.22456E+00 -0.649 0. 41922E-07 0.000 -4. 404 AL(CH)4- 0 .297G9E- 10 -10.527 0.19652E-10 -10.707 0.66147E+00 -0.179 0. 28 227E-08 0. 000 -5. 576 H3SI0 4- 0 . 1223 4E-07 -7. 912 0.80925E-08 -8.092 0.66147E+00 -0. 179 0. 11635E-05 • 0.001 -2. 960 HCL 0 .523001- 12 -12. 282 0.67205E-12 -12. 173 0. 12850E + 01 0. 109 0. 19Q69E-10 0.000 -7. 746 PECIES IOG F LOG Q N E AH DLN M/DXI D2 M/DXI D2LN M/DXI D3 M/DXI D3LN M/DXI NA + 0.0 0.0 0. 24753E-03 0.24753E-03 0. 140G8E+-03 0. 14008E+03 0. 17134E + 09 0. 17 134E+09 CL- 0.0 0.0 0. 26010E-03 0.2 477 1E-03 0. 14708E + 03 0. 14008E+03 0. 17991E+09 0. 17134E+09 H + 0.0 0.00 00 -0. 65560E+00 - 0. 359 35E + 06 0.38302E+04 -0. 12703E+12 0.65485EM0 -0.86955E+17 K + 0.0 0.0 0.666 29E+00 0. 133 25E + 02 0. 23 704E+0.3 0. 456.30E + 04 -0.48838E+08 -G.97691E+09 AL + + + -8.1746 -8. 1745 - 0 . 31402E-03 -•0. 1 1978E + 07 0.26514E+03 -0.42344E+12 -0. 12764E+Q9 -0.28985E+18 H4SI04 4.0042 4.0042 -0. 58238E-07 - 0.6.34 3 2E-03 -0.34080E-01 -0. 371 19E+0 3 -0.40791E+05 -0.44429E+09 OH- 13.9878 13.9880 0. 37427E-02 0.35935E+06 0.26680E+04 0. 12703E+12 0.28153E+10 0.86955E+17 AI (CH) + + -3.4 3 65 -3.4365 - 0 . 86774E-03 -0.83849E+06 0. 42084E+-03 -0. 2964 1E+12 -0.48427E+08 -0.20290E+18 AL (OH) 4- 15.0734 15.0735 0. 695 16E-05 0.23956E+06 0.41229E+01 0.84689E+11 0.38473E+07 0.57970E+17 H3SI04- 13.8996 1.3.8998 0. 42437E-02 0.35935E+06 0.30252E+04 0. 12703E+12 0.31922E+10 0. 86955E+ 17 HCL 6.1363 6.1363 -o,. 19470.E-06 -0.3 59 35E+06 0. 1 1 375E-02 -0. 12703E+12 0.19447E+04 -0.86955E+17 TGTAL KGIES * H20 0.0 0.0000 -0. 137 40E-01 -0.2475 3E-03 -0.77754E+04 -0. 14008E+03 -0.95109E+-10 -0. 17134E + 09 ACTIVITIES * H20 0.0 0.0000 -0.30538E-03 -0.31716E-03 -0. 17870E*03 -0. 18560E+03 -0.21390E+09 -0.22214E+09 OI/DXI IS 0.64437E-02 TOTAL CCIES OF WATER IN TEE SYSTEM IS .55. 508250 17 MOLES COMPONENTS TOTAL LOG TOTAL TOTAL TOTAL LOG MOLALITY MOLALITY GR AMS/KGM H.20 PPM TOTAL PPM NA + CL-MUSCOVITE ALPHA-QUARTZ a*. 8 + H 2 0 0. 100-000 E+01 0. 10.50 OOE+0 1 0.405255E-09 0.9 182331-04 0.114106E-05 0.500021E-01 0.5550841+02 0.0000 0.0212 -9.3923 -4.0370 •5.7592 •1.3010 1.7444 0.229898E+02 0.372258E+02 0.161419E-06 Q.551718E-02 0. 175493E-05 0.195518E+01 0. 10000GE + 04 0. 216440E+06 0.350466E+06 0.151969E-02 0.51942 1E + 02 0. 165220E-01 0. 184073E+05 0.941463E+07 5.3353 .5. 5446 -2.8182 1.7155 -1.78 19 4.2650 6.9738 89 TOTAL MASS TRANSFEB IN THE SYSTEM . MINERAL EH ASES K-FELDSPAR ALPHA-QUARTZ MUSCOVITE AMOUNT OF . REACTANT DESTROYED MOLES GBAMS AMOUNT OF BEACTANT PRODUCED MOLES "•' GRAMS -0.3162E-05-0.8802E-03 0.0 0.0 AMOUNT OF PRODUCT PRODUCED MOLES GRAMS 0.6319E-05 0.3797E-03 0.1054E-05 0.4 197E-03 AMOUNT OF PRODUCT DESTROYED MOLES GRAMS 0. 0 0.0 0.0 0.0 NET AMOUNT IN THE SYSTEM MOLE'S GRAMS 0.3592E-01 0.9999E+01 0. 1665E-0 1 0..1000E + 01 0. 1054E-05 0.4197E-03 NUMEER OF DELXI INCREMENTS FORWARD = 10 IONIC STBENGTH = 0. 10500OE+01 ELECTRICAL BALANCE - 0.981612E-15 TOTAL NUMBER OF PHASE BOUNDARIES PB ES ENT LY BEING CONSIDERED = 2 DISTRIBUTION OF SPECIES CALLED AT STEP 2 1 THE LOG K FOB K-FELDSPAR LGG K - 3.283794 2 LOG Q HAS BEEN EXCEEDED AT STEP 24 3.3074076 EQUILIBRIUM HAS BEEN ATTAINED AND SOLUTION CHARACTERISTICS A RE OUTLINED BELOW 90 DELXI XI LOG XI 0. 354948E-07 0. 519635E-05 -5.284 PRODUCTS MINERAL ALPHA-QUARTZ MUSCOVITE CUMULATIVE GBAM CHANGE 0. 100062E+01 0.689915E-03 LOG CUMUALT GRAM CHANGE 0.000 -3,161 CUMULATIVE MOLE CHANGE 0.166535E-01 0. 173209E-05 LOG CUMULAT MOLE CHANGE -1.778 -5.76 1 REACTION COEFFICIENT 0.194284E+01 0.3 3 335 6E+00 L O G O F SOLUBILITY P R O D U C T 0.0 0.0 LOG OF ION PRODUCT 0.0 0-. 0 MINE RAIS ALPHA-QUARTZ ANALCIME ANDALUSITE A-CRISTOEALITE 3ETA-QUARTZ 30EHMITE B-CBISTOEALITE COESITE CORUNDUM DEHYDRATED ANALCIME DIASEOFE GIBBSITE HALITE HIGH SANIDINE HIGH ALBITE JADEITE KALSILITE KACLINITE KYANITE K-FELDSPAR LOW ALEITE MUSCOVITE NEEHELINE P ABAGGNITE PGTASSIUS CXIDE EYBOPHYLLITE SILLIMANITE SODIUM OXIDE S YLVITE LOG K 0.0 6.372 2.801 0.27 0 0. 138 0.714 0.376 C.810 3,617 1 1.079 -0.131 -0.9 22 1.432 4.483 7.504 7.813 6.463 -2.341 2.526 3,284 6. 186 0.0 9.227 3.760 84.316 -0.716 3.160 67.427 1.223 LOG Q 0.0 4.6056286 -3.2673631 0.0 0.0 -1. 64 18971 0. 0 0.0 -3.2673631 4.6220597 - 1.6418971 - 1.6583282 -0.3750500 3.2837942 4.6220597 4.6220597 3.2837942 -3.3002253 -3. 2673631 3.2837942 4.6220597 0.0 4.6220597 1.3382655 9.8349515 -3,2837942 -3.2673631 12.51 14825 -1.7133155 GASES NAME STEAM LOG K 1. 50517 ACTIVITY 0.30088E-01 LOG ACTIVITY -1.52160 91 AQUEOUS SPECIES SPECIES MOLALITY LOG MOL ACTIVITY • LOG ACT ACT COEF LG ACT C GR AMS/KGM H20 PPM LOG PPM AL + + + 0.22828E-11 - 11.642 0.17186E-12 -12.765 0.75.284E-0 1 - 1. 123 0.61594E-10 0.00D • -7.237 K + G. 50O0 3E-O 1 -1.301 0. 3C356E-01 -1.518 0.6 0708E+0 0 -0.217 0. 19552E+01 1840.777 3,265 NA + 0. 100 00E+01 0. 000 0.66147E+00 -0.179 0. 66147E+00 -0.179 . 0.22990E+02 21 643,994 4.3 35 H4S.I0 4 C.S1812E-04 -4.037 0.91812E-04 . -4.03 7 0. 10000E+01 0. 0 0.88246E-02 8, 308 0.919 CL- 0.10500E+01 0.021 0.6.3744E+QQ -0. 196 0.60708E+00 -0. 217 0.37 22 6E+02 35046.600 4.545 CH- 0. 43237E-07 ^7.364 0.27490E-07 -7.561 0.63580E+00 -0. 197 0.73535E-06 0.001 -3. 160 fi + 0.43964E-06 -6.357 0.36021E-06 -6.443 0.81932E+00 -0.087 0.44315E-06 0.000 . -3.380 H20 0.555 0 8E+G2 1.744 0.96287E+0G -0.016 0. 17346E-0 1 -1.761 0.10000E+Q4 941460.3 16 5. 974 A l (CH) + + 0.37398E-10 -10.427 0.83982E-11 - 11.076 0.22456E+00 -0,649 0, 16451E-08 0.000 -5. 8 10 AL (OH) 4- 0.749491-10 - 10. 125 0.49576E-10 - 10.305 0.6.6147E+00 -0. 179 0.71209E-08 0.000 -5.174 H3SI04- 0.2J9O2 5E-07 -7.310 0.3 2429E-07 -7.489 0.66147E+00 -0.179 0.46627E-05 0.004 -2,358 HCL 0. 13 0 56 E-12 -12.884 0.16777E-12 -12.775 0. 12850E+01 0. 109 0.47604E-11 0.000 -8.349 SPECIES LOG K LOG Q NA + 0.0 0.0 CL- 0.0 .0.0 H + .0.0 .0.00 00 K* 0.0 0.0 AL+ + + ' -8. 1746 -8.1745 H4SI0 4 . 4.0042 4.0042 OH- 13.9878 1 3,9878 AL(CH)+* -3.4365 -3.4365 AL(CH)4- 15.0734 15.07 34 H3SI04- 13.8996 13.8996 HCl 6. 1363 6.1363 * TOTAL BOIES * H20 0.0 0.0000 * ACTIVITIES * H2G 0.0 0.00 00 DI/BX.I IS 0.1 1G47E+00 • N EAR 0.29687E-02 0.31173E-02 •0.55887E+00 0.66679E+00 0. 107 15E-04 •0.70978E-06 0.50351E-01 •0. 11760E-03 0.59042E-04 0.57O92E-01 •0.16597E-06 DLN M/DXI 0.2 968 7E-0 2 0.2 96 89E-02 -0. 1 2167E+07 0. 13335E+0 2 -0.40557E+07 -0.773 0 8 E-02 0, 12167E+07 -0.28390E + 07 0.81113E+06 0.12167E+0 7 -0, 12167E+07 D2 M/DXI 0.60504E+04 0.63529E+04 0. 21 878 E +06 0.42523E+03 0.34613E+02 •0. 14470E+01 0. 10 281E + 06 0. 23682E+03 0.966142+02 0.11658E+06 0.64973E-01 D2LN M/DXI 0.60504E+04 0.60504E+04 -0. 10040E+13 0.83262E+04 -0. 33468E + 1 3 -0. 15760.E+05 0. 10040E+1.3 -0. 23428E + 13 0.66936E+12 0. 10040E+13 -0. 1Q040E+13 D3 M/DXI 0. 14987E +11 0. 15736E+11 0.54357E+12 0.72562E+0 9 -0.74649E + 08 -0. 3583 5E + 0 7 0.25435E+12 -0. 1 87 05 E+09 0, 19042E+09 0,28841E+12 0. 16143E + 06 D3LN M/DXI 0. 14 987E+11 0.14986S+11 •0.68034E+18 0. 1451 1E+11 -0. 22678E+19 -0.39 0 31E+11 0.68034E+18 -0. 15874E+19 0.45 35 6E+ 18 0.68034E+18 -0.68034E+18 -0. 16479E + 00 -0.29687E-02 -0. 33585E+06 -0. 60504E + 04 -0.83187E+ 12 -0. .14987E+1 1 -0.37219E-02 -0.38654E-O2 -0.75876E+04 -Q.78802E+04 -0.1879 1E+11 -0.19515E+11 TOTAL MOLES OF WATER IN THE SYSTEM IS 55,50825007 MOLES COMPONENTS N A + CL-a u s c o v i T E ALPHA-QUARTZ a* K + H20 TOTAL MOLALITY 0. 1GOO0OE+01 0. 105000E+01 0.382099E-10 0.9 18612E-04 0.347425E-06 G.500035E-01 0.555084E+02 LOG TOTAL MOLALITY 0.0000 0. 0212 -10.4 178 -4.0369 -6.4591 -1.3G10 1. 7444 TOTAL. GRAMS/KGM H20 0.229898E+02 0.372258E+02 0. 152195E-07 0.551946E-02 0.350194E-06 0. 195524E + 01 0. 1000.00E + 04 TOTAL PPM 0.216440E+06 0.350466E+06 0.143286E-03 0.519635E+02 0.329694E-02 0. 184078E + 05 0.941463E+07 LOG TOTAL PPM 5.3353 5.5446 -3.843 8 1.7157 -2.4819 4.2650 6.9738 TOTAL MASS TRANSFER. IN THE SYSTEM g 2 KI FERAL EHASES ALPHA-QUARTZ MUSCOVITE K-FELDSPAR AMOUNT OF REACT ANT DESTROYED MOLES GRAMS AMOUNT OF REACTANT PRODUCED MOLES GRAMS AMOUNT OF PRODUCT PRODUCED MOLES GRAMS AMOUNT OP PRODUCT DESTROYED MOLES GRAMS 0.1035E-04 0.6220E-03 0.0 0.1732E-05 0.5899E-03 0.0 0.0 0. 0 NET AMOUNT IN THE SYSTEM MOLES GRAMS 0.1665E-01 0.1001E+01 0. 1732E-0.5 0.6899E-03 0.0 0.0 -0.5196E-05-0.1446E-02 0.3592E-01 0.9999E+01 NUMEEB OF DELXI INCREMENTS FORWARD = 24 IONIC STRENGTH = 0.105000E+01 ELECTRICAL BALANCE = 0.283738E-15 TOTAL NUMEES OF PHASE BOUNDARIES PRESENTLY BEING CONSIDERED = 2 93 APPENDIX 3 C C c c c c c PATH 94 WRI TEN BY T, H. . BROWN AND E.H. PERKINS., MODIFIED FEBRUARY, 1978 BY M.S. BLOOM UNIVERSITY VANCOUVER, TO COMPILE CDC 6600. OF BRITISH COLUMBIA B.C. AND EXECUTE ON t NPT IK ELICIT REAL*8 (A - H,0 - Z) COMMON /P AT D AT/ NDX (200, 2 ) , COHPH (20 , 200) , AZERO(200), GMIN(200), 1 GSO.L<200), G G A S ( I O ) , COUPS (20, 20 0 ) , 7.(200), RF. ( 2 0 ) , 2 COMPG(20, 10) , WGHTM (200) , HGHTS(200), WGHTG(10), GNEUT (4) , 3 P, T, ADH, BDH, BDOT # AMH20, ALMH20, NAMEM (5, 200) , 4 NAMES (2,200) , NAMEG (5,10) , NAMES ( 5 , 2 0 ) , MOA ( 2 0 ) , 5 I R E A C T ( 2 0 ) , NHT, NST, NC, NGAS, NET, MAXI, NDLINC, INION, .6 NK COMMON /CONC!/ G ( 2 O 0 ) , A L G ( 2 0 0 ) , ACT ( 2 0 0 ) , ALA ( 2 0 0 ) , C (200) , 1 A L C ( 2 0 0 ) , B ( 2 0 , 2 0 0 ) , TOTM (20) , XPPM(200), T N ( 2 0 0 ) , 2 GSP(200), A L G A S ( 2 0 ) , A G A S ( 2 0 ) , X I , ELECT, XIPRT, DELXIT COMMON /CARSAY/ QM(200), QS (200) , BB{20,200), A ( 2 0 , 2 0 ) , DM (200) , 1 CC (200,20), X ( 2 0 0 , 4 ) , C V ( 2 0 0 ) , U C V ( 2 0 ) , C S V E ( 2 0 0 ) , DC (200) 2 WS(20,20), W(2G,200), XD{200,4), A S Y S ( 2 0 0 ) , A MADE (200) 3 ADEST(200), A10, XL, DELXI, IPROD(20), N DEL X I , ISAT, 4 NOD, IF I N , IPBINT DIMENSION GRMTOT(40) , XTPEM (40) I F I N = 0 DELXIT = 0.0 EOO DO 10 1 = 1, 200 AH A DE (I) = 0.0D00 ADEST(I) -= O.ODOO ASYS(I) = O.ODOO 10 CONTINUE XIPRT = -6. CDOO NPI = 0 NDELXI = 0 CALL EAT A IN (IGTM) C ALL PREAD(E, ASYS) DELXI = 1.0D-10 KINC = NDLINC NOD = 1 NC1 = NC - 1 NPI = 0 DO 20 I = 1, NC 1 I F (NDX (1,2) .EQ NPT = NPT + 1 8 = NDX ( I , 1) IP EG D (NPT) •= K ASYS(K) = TOTM (I) / WGHTM (K) 20 CONTINUE I F (NST .LT. 1) GO TO 4 0 DC 30 I = 1, NST K = I BE ACT (I) ASYS(K) = ASYS(K) 30 CONTINUE 40 CALL DIST CALL SATCHK IPHINT = 1 0 .OR. NDX (1,2) . EQ. 3) GO TO 20 / WGHTM (K) IP (NRT .LT. 1 . AND. . NDELXI . EQ. 0) .N BT = -2 IF (NET . I T . 1 .AND. NDELX.I .EQ..0) GO TO 120 I F (ISAT . NE. 0 .AND. N D E L X I . EQ. 0) GO TO 110 IF (NDELXI .NE. 0) GO TO 60 50 CALL FIN DC C ALL ACTIV . CALL SETCOL CALL SETM AT 60 I F (ISAT . NE. 0) CALL REACTN I F ( I F I N . NE-. 0) GO TO 130 -70 CALL HOVE , NDELXI = NDELXI + 1 CALL SATCHK CALL FINMV I F (NINC .EQ. NDELXI) IPRINT = 1 IF (ISAT .NE. 0): IPO INT = 1 . I F (NINC . EQ. NDELXI) NINC = NINC * NDLINC I F i ( N D E L X I .GE. MAXI) GO TO 140 IF (IPEINT .EQ... 1) CALL OUTPUT IF (IPEINT . EQ. 1) GO TO 90 DG 8 0 I = 1, NST ATE MP = GSOL(I) - QS(I) I F (DABS (ATEMP) .GT. 5.QD-4) GO TO 100 80 CONTINUE .90 IPEINT = 0 GO TO 60 100 CALL SCLSP3 (GBMTOT, XTPPM) CALL DIST GO TO 60 .110 CONTINUE NET = -1 •' 120 CALL OUTPUT • • STOP • 130 CONTINUE NRT = 0 140 CALL. OUTPUT . -STOP • END ; SUBROUTINE CIST ;. C THIS SUBBOUTINE CALCULATES THE•DISTRIBUTION OF SPECIES. C • . • v . , IMPLICIT aEBI*8(A - H,0 - Z ) C C TOTM (I) CONTAINS TOTAL '-MOLALITY OF COMPONENT OE LOG ACTIVITY C • OF COMPONENT SPECIES C MOA(I) I S THE SWITCH TO INDICATE MOLALITY OH ACTIVITY C . 0 = TOTAL MOLALITY " 1 .= LOG A C T I V I T Y . ( C DIMENSION CS AVE (200)', ASAVE (200) / CSV (20) , CBG (200) , 1 NDXALL(20Q,2) , 81 (20,200), ND XSGL (200,2) , GSOL1 (200) COMMON /PATBIT/ NDX (200>2) , COH.PH (20 , 200) , AZERO (200) f GHIH (200) , . 1 GSOL (200) , GGAS(10), COMPS (20, 200) , Z ( 2 0 0 ) , EE (20 ) , 2 COMPG(20,10) , WGHTM(200) , WGHTS (200) , WGHTG (1 0) , G NEUT (4 ) , 3 ' • P, T, ADH, BDH, BDCT, ASH20, AIMH20, NAMEM (5, 200) , 4 . •• . NAMES (2,2,00) , NAMEG (5, 10) , NAMES (5,20), MOA (20) , 5 I S E A C T ( 2 0 ) , N MT, NST, NC, NGAS, NBT, MAXI, NDLINC,. INION, 6 NK COMMON./CONCI/ G (200) , 'ALG (200), ACT (200), ALA (200), C ( 2 0 0 ) , . 1 ALC (200), E (20, 200), TOTM (20) , XP.PH (200) , TN(200), 2 • G.S.P (200) ., ALGAS(20) , AGAS(20), X I , ELECT, XIPRT, DELXIT COMMON /CAB-BAY/ QH(20.0)', QS(200), BB(20,200), A(20,20), DN (200) , 1 CC(200,20), X (200,4) , CV (200) , UC V (20) , CSVE ( 200) , DC(200) 2 SS(20,20), W(20,200) , XD(2O0,4) , ASYS(200), A MADE (200) , 3 ADEST{200), A10, XL, DELXI, I PROD (20) , NDELXI, ISAT, NPT, 4 NOD, I F I N , IPRINT DATA 10 2 /»OXYG •/ NC1 = NC - 1 DBD = 10.ODGO ' A 10 - DLOG (LED) WRITE (6,620) NDEIXI NK2 = NK - 2 IF (NDELXI .LT. 1) GO TO 20 . EC 10 I = 1 , NST CBG (I) = A1C (I) .AS AVE (I) = ALA (I) 10 CONTINUE 20 CONTINUE . IF (NDELXI . GT. 1) GO TO 40 CC 3 0 I = 1, NK 2 IP•=. I IF (.INICN .EQ. NDX (1,1) . AND. NDX (1,2) . EQ. .0) GO TO 110 30 CONTINUE ' '-. 40 IF (NGAS .LT. 1) GO TO 8 0 DO 5 0 I" .'= 1 , NGAS IF (102 . NE. NAMEG (1,1) ) GO TO 50 IQ = I GO TO 60 50 CONTINUE. . ' ; GO TO 80 60 ATEMP = 1OO.0DO0 DO 70 I = 1, NC1 I F (NDX (1,2) . NE. 0) GO TO 7 0 IF (DABS (CCMPG(I,IQ)) .LT. 1.0D-13) GO TO 70 LL = NDX (1,1) IF (C (LL) .GT. ATEMP) GO TO 70 ATEMP = C(LL) K = I 70 CONTINUE NDX (K, 1) = IQ NDX (K ,2) = 3 MOA(K) = 1 IRET = -1 CALL TRANS (E,. IRET) C ALL • ACTIV ' 80 ATEMP = O.ODOO DO 100 I = 1, NC 1 IF (NDX (1,2) . NE. 0) GO TO 90 IF (MOA (I) . EQ. 1) GO TO 100 K = NDX ( I , 1) IF (ATEMP .GT. C (K) . 0.8. DABS (2 (K) ) . LE. 1.0D-5 .OR. Z (K) . GT. 1 9.99) GO TO 100 ATEMP = C (K) IF = I INICN = K GO TO 100 90 I F (NDX (1,2) . EQ. 1) MOA (I) = 1 100 CONTINUE 110 I E AL - IP I N I T I A L I Z E IF (NDELXI .GT. 1) GO TO 24 0 DO 120 I = 1, NC CSV }I) = O.ODOO 120 CONTINUE DO 1 3 0 1 = 1, NST CSAVE (I) = 0. 0D00 G( I ) = 1.0D00 ALG (I) •= O.ODOO 130 CONTINUE K = NEX (NC, 1) ACT (K) = 1.0D00 ALA(K) = 0.0100 C(K) = 1.ODG0 / .G1801534D00 ALC(K) = DLOG10(C(K)) G (K) = .01801534000 ALG (K) = DLOG10 (0 (K) ) DO 170 I = 1, NC 1 I F (NDX (1,2) .GT. 0) GO TO 150 K = NDX ( I , 1) IF (MOA(I) .EQ. 1) GO TO 140 C(K) = TOTM (I) ALC (K) = DIOG10 (C (K) ) ACT (K) = C (K) ALA (K) = AIC (K) GO TO 17 0 140 ALC(K) = TOTM (I) C(K) = 10.0D00 ** ALC(K) ACT (K) = C(K) ALA (K) = ALC (K) GO TO 170 150 I F (NDX (1,2) . EQ. 1) GO TO 160 R = NDX ( I , 1) ALG AS (K) = TOTM (I) AGAS(K) = 10.0D00 ** (ALG AS (K) ) GO TO 170 160 CONTINUE 170 CONTINUE IF (NDELXI .GT. 0) GO TO 24 0 DO 180 J = 1, NC NDX ALL ( J , 1) = NDX ( J , 1) NDXALL(J,2) = NDX(J,2) 180 CONTINUE CALL F L I P NK2 = NK - 2 NX1 = NK - NC - 2 DO 190 J = 1, NK2 NDXSOL ( J , 1) = NDX ( J , 1) NDXSOL(J r2) = NDX(J,2) 190 CONTINUE DO 210 J = 1 , NX 1 DO 200 I = 1, NC 8 1 (I,J ) = B ( I , J) 200 CONTINUE 210 CONTINUE DO 22 0 3 = 1, NST GSCL1 (J) = GSOL (J) 220 CONTINUE DO 230 J = 1, NC NDX(J,1) = NDXALL (0,1) NDX (3,2) - NDXALL [J ,2) 2 30 CONTINUE I E ET = - 1 CALL TBANS(E, IBET) 240 CONTINUE NIC = 0 NX = NK - NC - 2 I F (NDELXI .LT. 1) GO TO 280 DG 260 J = 1, N.X1 DO 25 0 I = 1 , NC E1( I , J ) = B<I,J) 250 CONTINUE 260 CONTINUE DO 27G K = 1, NK NDXSOL(K, 1) = NDX (K, 1) NDXSOI(K,2) = NDX(K,2) GSCL1 (K) = GSOL (K) 270 CONTINUE 280 CONTINUE IF (NDELXI .GT. 0) GO TO 300 DO 290 I = 1, SC IF (NDX ( I , 2) .EQ. 1) GO TO 400 290 CONTINUE 300 CONTINUE 310 NSCC = 0 3 20 CONTINUE EO 370 1 = 1 , NCI IF (NDXSOL (1,2) . NE. 0) GO TO 370 K = NDXSOL |I,1) IF (MOA(I) .EQ. 1) GO TO 370 ATEMP = 1.0D00 DC 360 J = 1, NX1 IF (DABS (B1 ( I , J) ) . LT. 1.0D-13) GO TO 360 L = NDXSOL (NC + J , 1) BTEMP = (E1(I,J) - 1.0D00) * ALA (K) BTEMP = BTEMP + ALG (K) - GSOL1(L) - ALG(L) LO 350 J J = 1, NC IF ( J J . EQ. I) GO TO 350 IF (DAES (B1 ( J J , J) ) . LT. 1.0D-13) GO TO 350 IF (NDXSOL (J J , 2) .GT. 0) GO TO 330 MM = NDXSOL ( J J , 1) BTEMP = BTEMP + B 1 ( J J , J ) * ALA(MM) GO TO 350 330 IF (BDXSOL ( J J , 2) .EQ. 3) GO TO 340 GO TO 350 340 BTEMP = ETEMP * B 1 ( J J , J ) * ALG A S{N D X(J J,1)) 350 CONTINUE ATEMP = ATEMP + B1(X,J) * 10.0 ** BTEMP 360 CONTINUE 98 C(K) = TOTM(I) / ATEMP IS = I KI = K IF (C(K) .IT. O.ODOO) GO TO 590 370 CONTINUE 380. XT EST = 1.GE-9 KK = 0 NN - 0 • -DO 3 90 I = 1, SCI IF (NDX (1,2) . NE. 0) GO TO 390 IF (MCA (I) . EC. 1) GO TO 390 K K = K K + 1 K = NIX (1,1) ATEMP = DAES ( (CSV (I) - C(K) ) / C ( K ) ) .' .- IF (ATEMP . I E . XTEST) NN = .NN + 1. ALC (K) = DLOG10(C(K)) : CSV (I) = C (K) ALA(K) = ALC (K) + ALG(K) ACT (K) .= 10.0D00 ** ALA (K) 3 90' CONTINUE • •KSGC = NSOC + 1 IF (KK .NE. NN .AND. NSOC .LT. 50) GO.TO 320 C • CALCULATE ACTIVITIES,MOLA LITIES OF DEPENDENT SPECIES " C . . . •" " 400 DO 440 I = 1 , NX. L = NDX (NC + I , 1) ATEMP = -GECL (I) • DC 430 J = 1, NC I F (NDX (J,2) .GT. 0) GO TO 410 M = NDX ( J , 1'). , . ATEMP = ATEMP + B (3, T) * ' A LA (M) GO TO 430 410 IF (NDX(J,2) .EQ. 3) -GO TO 420 GO 10 430 420 ATEMP = ATEMP + B ( J , I) * ALG AS (NDX (J , 1) ) . 430 CONTINUE ALA (L) = ATEMP ACT (L) = 10.OD00 ** ALA (L) ALC (L) = A l A (L) - ALG (I) C(L) = 10.ODOO ** ALC(L) • 440 CONTINUE CALL XICALC(C, Z, ELECT, NST, XI) CALL GAMMA ( X I , ADA, BDH, BDOT, NST,,NC, AZERO, Z, GNEUT, G, C, 1 ACT, NBX, XL, ALG) ATEMP = O.ODOO CO 460 1 = 1, NC 1 I F (NDX (1,2) .NE. 0) GO TO 460 IF (MOA (I) . EQ. 1) GO TO 450 K = NDX ( I , 1) ALA (K) = AIG (K) + ALC(K) ACT (K) = 10.0 ** ALA (K) ATEMP = ATEMP + C(K) GO TO 460 450 IF. (NDX (1,2) .HE. 0) GO TO 460 K.= NDX (1,1) ALC (K) = ALA (K) - ALG (K) C (K) = 1 O.ODOO ** ALC (K) ATI HP = ATEMP + C(K) 1 0 0 460 CONTINUE DC 470 I = 1, NX . K = NDX (NC + 1,1) AL A (K) = ALC (K) + ALG (K) ACT (K) = .10.0D00 ** ALA (K) AT IB P = A TEMP + C(K) 470 CONTINUE COMPUTE, ACTIVITY. OF H20 IF (NDELXI . G l . 1) GO TO 480 IF (ATE MP . GT. 30) ATE MP '== 30. .* , K = NDX (NC , 1) ALA (K) = —ATEMP * .0 18O1534D0O / A10 ACT ( K) - 1O.0D00 ** ALA (K) G(K) = ACT (K) * .Q1801534D0O ALG (K) = DLOG10 (G (K) ) CORRECT CHARGE EALANCE 480 TOTM(IBAL) = TOTM (IBAL) - ELECT / Z(INION) IF (TOTM (IE Al) .LT. 0.0) GO TO 570 XTES3 = 1 .OD-7 KK = 0 DO 5 00 I = 1, NST IF (C(I)' . EQ. O.ODOO) A TEMP . = CSAVE (I) - C (I) I F (C(I) . EQ. O.ODOO) GO TO 490 ATE ME = (CSAVE (I) - C (I) ) / C (I) 490 IF (DABS (ATEMP) .LT. XTEST) KK = KK .+ 1 CSAVE (I) = C(I) 500 CONTINUE NTC = N I C + 1 IF (KK .NE. NST . AND. NTC .LT. 50) GO TO 310 IF (KK .NE. NST .AND. NTC .GE.,50) GO TO 580 CALL SOLSP1 (NST, C, GSP, ¥GHTS, XPPM) CALL ACTIV I I (NDELXI .LT. 1) GO TO 510 CALL FINDC CALL ACTIV CALL SETCOL CALL SETMAT IF (NDELXI .GT. 1) GO TO 550 510 WRITE (6, 680) DC 530 I = 1, NST XLGM = ALC (I) XLGACT = ALA (I) XLGG = ALG (I) I F (XPPM (I) . EQ. O.ODOO) XLPPM = -1000.0DOO IF (XPPM(I) . EQ. 0,0 D00) GO TO 520 XLPIM = DLOG10 (XPPM (I) ) 520 WRITE (6,690) NAMES (1,1), NAMES (2,1), C ( I ) , XLGM, ACT (I) , 1 XLG ACT, G (I) , XLGG, GSP (I) , XPPM (I) , XLPPM 530 CONTINUE WRITE (6,700) X I , ELECT IE (NGAS .LT, 1) GO.TO 550 WRITE (6,630) DO 540 J = 1, NGAS WRITE (6,640) (NAMEG ( J J ^ J ) , JJ= 1,5) , GGAS(J), AGAS(J), ALG AS (J) 540 CONTINUE 550 DC 560 I = 1, NC MOA (I) = 0 101 560 CONTINUE SEIUEN 570 WHITE (6,670) STOP 580 WHITE (6,660) STOP 590 I F (NDELXI •LT. 1) GO TO 610 DO 600 I = 1, NST ALA ( I ) = ASAVE(I) ALC (I) = CEG(I) C ( I ) = 10.0D00 ** ALC ( I ) 600 CONTINUE MOA (IS) = 1 GO TO 80 610 WHITE (6,650) N A M E S ( 1 , K I ) , NAMES(2,KI) STOP C 620 EG EM AT (» DISTRIBUTION OF SPECIES CALLED AT STEP •, 15) 630 FORMAT (//, 30X, 'GASES', /, 30X, ' ', //, 2X, 'NAME', 24X, 1 'LOG K', 9X, ' A C T I V I T Y ' , 8X, 'LOG A C T I V I T Y ' , //) 640 FORMAT (IX, 5A4, 5X, F 1 2 . 5 , 5 1 , E 1 2 . 5 , 5X, F12.5) 650 FG5MAT (//• IMPOSSIBLE CONSTRAINTS FOR DISTRIBUTION OF S P E C I E S ' / , 1 2A4, ' DRIVEN NEGATIVE•) 660 FORMAT (//• FAILUEE TO CONVERGE ON CONCENTRATION I N 25 CYCLES, 1 ») 670 FORMAT (/,/' CONCENTRATION OF ION DRIVEN NEGATIVE WHILE TRYING TO A 1 CHI EVE ELECTRICAL BALANCE') 680 FORMAT (//55X, * AQUEOUS S P E C I E S ' , //1X, ' S P E C I E S ' , 8X, 'MOLALITY', 1 5X, •LOG MCL* , 4X, ' A C T I V I T Y * , 5 X, 'LOG ACT', 3X, 2 'ACT OGEE' , 5X, ' LG ACT C , 2 X , ' GB AMS/KGM H20', 6X, 'PPM', 3 9X, MOG PPM'/) 690 FORMAT (2X, 2A4, 4X, E 1 2 . 5 , 2X, F 8 . 3 , IX, E 1 2 . 5 , 2X, F8, 3, 2X, 1 E12. 5, 2X, F 8 . 3 , 3X, E 1 2 . 5 , 2X, F 1 2 . 3 , 3X, F9.3) 700 FORMAT (//, ' IONIC STRENGTH = ', E 1 3 . 6 , 15X, 1 'ELECTRICAL BALANCE = ', E13.6) END SUBROUTINE F L I P I M P L I C I T RE AL*8(A - H,0 - Z) COMMON /PAID AT/ N D X ( 2 0 0 , 2 ) , COMPH (20,200) , A Z E R O ( 2 0 0 ) , G M I N ( 2 0 0 ) , 1 GSOL (200) , GGAS(IO), COMPS (20,200) , Z ( 2 0 0 ) , R R ( 2 0 ) , 2 COMPG(20, 10) , WGHTM ( 2 0 0 ) , S G H T S ( 2 0 0 ) , WGHTG(IO), GNEUT (4) , 3 P, T, ADH, BDH, BDCT, AMH20, ALMH20, NAMEM (5,200) , 4 NAMES (2,200) , NAHEG (5 , 1 0) , NAM E B ( 5 , 2 0 ) , MOA (20) , 5 IREACT(20) , NMT, NST, NC, NGAS, NST, HAXI, NDLINC, INION, 6 NK COMMON /CONCT/ €(200), ALG (200) , ACT ( 2 0 0 ) , ALA ( 2 0 0 ) , C (200) , 1 ALC (200) , E ( 2 0 , 2 0 0 ) , TOTM ( 2 0 ) , XPPM (200) , TN (200) , 2 GS P ( 2 0 0 ) ; , A L G A S ( 2 0 ) , AG AS ( 2 0 ) , X I , ELECT, X I P R T , DELXIT NC2 = NC • 2 NX = NK - NC2 NC1 = NC - 1 I BET = 1 10 CONTINUE DG 30 1 = 1 , MCI I F (NDX (1,2) .NE. 1) GO TO 3 0 DO 20 J = 1, NX I F (DAES. (B ( I , J) ) . LT, 1.0D-1O) GO TO 20. K •= NDX (NC + J , 1 ) I I = K .. . NDX (1,1) = I I NDX (1,2) = G ' CALL TRANS(E, IR ET, 520) GC TO 10 20' CONTINUE . GO TO 30 30 CONTINUE RETUSN END SUBROUTINE SCLSP1(NST, C , G S P , WISP, IP.PM) ' C THIS EOUTINE CALCULATES THE GRAMS AND P.PBS OF THE SOLUTION SPECIES I M P L I C I T REAL*8 (A - H,0 - Z) DIMENSION C (200) , GSP (200) , WTSP(200), XPPM(200) SGSF = 0,0E00 DC 10 I = 1, NST G S P ( I ) = C (I) * WTSP (I) 10 SGSP = SGSP * GSP ( I j ARTP = 1. OD06 / (SGSP) DO 20 I = 1, NST X P I M ( I ) = G S P ( I ) * ARTP 20 CONTINUE RETURN . . . END ' - SUBROUTINE G AMM A (XI,< ADH, EDH, BDOT, NST, NC, AZERO, Z, GNEUT, G , 1 C, ACT, NDX, XL, ALG) C -C CALCULATES GARMAS OF AQUEOUS SPECIES - NEUTRAL SPECIES C APPROXIMATED FRCM KNOWN DATA FOR C02 AT VARIOUS IONIC C STRENGTHS C ' H S P I I C I I RE AL*8 (A - H,0 - Z) DIMENSION A Z E E O ( 2 0 0 ) , Z ( 2 0 0 ) , GNEUT(4), G (200) , C(,200), ACT (2 00) , 1 NDX (200,2) , ALG (20 0) MM = 1 I F ( X I , GT. 1.) MM = 2 I F ( X I .GT. 2.) MM = 3 IE ( X I .GT. 3.) MM = 4 IF ( X I •GT. 3) GO TO 10 XG = GNEUT (MR) • (GN EUT (MM + 1) - GNEUT (MM)) * ( X I - MM + 1) GO TO 20 TO XG = GNEUT (MM) (GNEUT (M M) - GNEUT (SM - 1) ) * ( X I - MM + 1) 20 XL =' DLCG10 (XG) SXI = XI ** 5.0D-01 ADT = A CH * S X I BDT = EDH * S X I ,. DO 50 I = 1 , NST ' SXI = Z ( I ) I F (DABS (SXI) . LT. 1.0D-5) GO TO 30 I F ( S X I . GT. 9.99) GO TO 40 G ( I ) = 10. ** (-ADT*S.XI*SXI/(1. + BDT* AZERO (T) ) + BDOT*XI) ALG ( I ) = DICG10 (G ( I ) ) GO TO 50 30 -CONTINUE ' 40 50 . ODOO O.ODOO AND Z) NST', XI) ELECTRICAL BALANCE 10 C C G(I) = XG ALG (I) = DIOG10 |G ( I ) ) GO TO 50 CONTINUE G<I) = 1. ALG ( I ) = CONTINUE K = NDX INC, 1) CALCULATE GAEMA OF H20 G(K) = ACT (K) * .01801534D0Q ALG (K) = DLOG10 (G (K) ) EETU.EN END SUBROUTINE X I C A L C ( C , Z, ELECT, CALCULATES IONIC STRENGTH I M P L I C I T RE AL*8 (A - H,0 -DIMENSION C ( 2 Q 0 ) , Z(2G0) XI = O.ODOO ELECT = 0. DO 10 I = 1, NST B = Z (I) I F (DABS(B) .LT. A = C<I) * B XI = X I + 5.0D-01 ELECT = ELECT + A CONTINUE I F ( X I .GT, 30) X I .= 30 I F (DABS (ELECT) , GT. 30.) ELECT = (DA B S ( E L E C T ) / E L E C T ) * 30. RETURN END SUBROUTINE SOLSP3(GRMTOT, XTPPM) THIS ROUTINE CALCULATES THE TOTAL MOLALITY, TOTAL GRAMS, AND TOTAL PPM OF THE E ARE IONS IN SOLUTION I M P L I C I T S E A I * 8 ( A - H,0 - Z) COMMON /PATDAT/ N D X ( 2 0 0 , 2 ) , COMPM (20,200) , G S O L ( 2 0 0 ) , G G A S ( 1 0 ) , COMPS ( 2 0 , 200) , COMFG (20, 10) , WGHTM ( 2 0 0 ) , WGHTS(200). P. T, ADH, BDH, BDOT,, AMH20, ALMH2G, NAHEM(5 , 2 b 6 ) NAMEG(5 , 1 0 ) , NAMES ( 5 , 2 0 ) , MOA (20) 103 1.0D-5 . O R . B .GT. 9.99) GO TO 10 * A * E AZERO (200) , GMIN (200) Z ( 2 0 0 ) , R R(20) , WGHTG(10), GNEUT (4) NAMES (2,200) N.MT, NST, NC, NGAS, N.BT, MAX.I, NDLINC, INION A L A ( 2 0 0 ) , C ( 2 0 0 ) , TN(200) , X I P R T , DELXIT 10 20 30 IREACT (20) NK COMMON /CONCT/ G ( 2 0 0 ) , ALG ( 2 0 0 ) , ACT ( 2 0 0 ) , ^ M ^ U , ,ALC ( 2 0 0 ) , B ( 2 0 , 2 0 0 ) , TOTM (20) , X P P H ( 2 0 0 ) , G S P ( 2 0 0 ) , A L G A S ( 2 Q ) , A G A S ( 2 0 ) , X I , ELECT, DIMENSION XTPPM ( 4 0 ) , GRMTOT (40) SGSP = O.ODOO DO 10 J = 1, NC XTEEM(J) = O.ODOO TOTM(J) = O.ODOO CONTINUE DO 3 0 I = 1, NSI DO 20 J = 1, SC I F (DABS (COMPS ( J , I) ) .LT. I F (ALC (I) .LT. - 50.) GO TOIM(J) = TCTM(J) CONTINUE CONTINUE 1. Off-13) TO 20 COMPS ( J , I ) * C ( I ) GO TO 2 0 DO 6 0 I = 1 , NC IF (NDX (1,2) m EQ. 0) GO TO 40 GRMTOT (I) = TOTM(I) * WGHTM (NDX ( I , 1)) GO TO 50 40 GSM TOT (I) = TOTM (I) * WGHTS {NDX (1,1)) 50 SGSF = SGSE + GRMTOT (I) 60 CONTINUE ' ABTP = (1O.0D06) / (SGSP) DO 70 I = 1 , NC XT EEM (I) = GRMTOT (I) * ARTP 70 CONTINUE ' • RETURN . ' END SUBROUTINE OUTPUT THIS SUBROUTINE DOES ALL OF THE OUTPUT FOR THE PROGRAM PATH IMPLICIT BE AL*8 (A - H,0 - 2) COMMON /PAT DAT/ NBX(20Q,2), COMPM (20 , 20 0) , AZERO ( 2 0 0 ) , GMIN(200), 1 GSOL (200) , GGAS(10), COMPS (20, 200) , Z (200) , RR(20), 2 COM EG (20 , 1 0) , WGHTM (200), WGHTS (200), WGHTG{10), GNEUT (4 ) , 3 P, T, ADH, BDH, BOOT, AMH20, ALMH20, N AMEM { 5, 200) , ' 4 NAMES (2, 200) , NAMEG (5, 10) , NABEB. (5 , 2 0 ) , MOA(20), 5 IREACT(20), NMT, NST, NC, NGAS, NET, MAXI, NDLINC, INION, 6 NK COMMON /CONCT/ G (200)i, ALG (200) , ACT (200) , ALA ( 2 0 0 ) , C (200) , 1 ALC (200),, B,(20,200), TOTM (20) , XPPM (200) , TN ( 200) , 2 GSP{200), ALGAS{20), AGAS (20) , X I , ELECT, XIPRT, DELXIT COMMON /C ARB AY/ QM(200), OS ( 2 0 0 ),'BB ( 2 0 , 2 0 0 ) , A (20, 20), DN (200) , 1 CC (200,20), X (200,4), CV(200), OCV(20), CSVE(200), DC (200) 2 WS (20,20) > W(2G,200) , XD (200,4) , ASYS (200) , A MADE (200) , 3 . •'• ADEST (200), A10, XL, DELXI; IPROD (20) , NDELXI, IS AT, NPT, 4 NOD, I F I N , IPBINT DIMENSION GRMTOT (40) , XTPPM(40) DATA NHYDSO /«H+ ••/ IE (NRT .GT. Oj WRITE (6,430) I F : (NRT .EQ, 0) WRITE • (6,640) • • ' IF (NRT .LT. 0) GO TO 90 WRITE (6,460) DEL XI XLDEL = DLCG 10 (DEIXIT) WRITE (6,470) DELXIT, XLDEL ' IF (NRT .LT. 1) GO' TO 20 WRITE (6,480) ; WRITE (6,490) REACTANT SUMMARY DO. 10 I = 1, NRT K = IREACT (I) GMNRL = A BEST (K) * WGHTM (K) X.LMNRL = BIGG 10 (DABS (GMNRL) ) XLDELB = CLOG 10 (DABS (ADEST(K))) 10 WRITE (6,500) (NAMEM (J ,K) , J= 1 , 5) , GMNRL, XLMNRL, . ADEST(K), XLDEL R 1RB (I) , GMIN (K) , QM(K) 20 IF (NPT) 90, ,90, 30 30 WRITE (6,520) WRITE (6,490) REACTION PRODUCT SUMMARY DC 80 I = 1, NPT K = IPEOC (I) GMNBL = ASYS(K) * WGHTM (K) IF (GHNBL .IE. 0. ) GO TO 40 XL'HNBl = D1OG10 (GMNRL) XLBIIP = CLOG 10(AS YS(K) ) GO TO 50 40 CONTINUE GMNRL = O.ODOO XLMNBL = O.ODOO XLDELP = O.ODOO 50 CONTINUE NC 1 = NC - 1 DO 60 LL = 1, NC1 IF (K ., NE. NDX(LL,1) .OB. NDX (LL, 2) . NE. 1) GO TO 60 NN = LL GC TO 70 60 CONTINUE 70 WRITE (6,500) ( NAM EM (J , K) , J= 1, 5) , GMNBL, XLMN.RL, ASYS (K) , 1 XLDELP, X(NN,1), GMIN (K) , QM (K) . . 80 CONTINUE .90 CONTINUE W.BITE (6,510) DO 100 NM = 1, NMT C C MINERAL K AND Q C WRITE (6,530) (NAMEM ( J , NM) , J = 1 , 5) , GMIN(NM), QM (NM) 100 CONTINUE 110 CONTINUE IF (NGAS .LT. 1) GO TO 1.30 WRITE (6,360) DO 120 J = 1, NGAS WRITE (6,370) (NA MEG ( J J , J) , J J= 1,5), GGAS (J) , AGAS (J) , ALGA S (J) 120 CONTINUE 130 IF (NET .LT. 0) GO TO 350 CALL S0.LSP1(NST, C, GSP, HGHTS, XPPM) WRITE (6,540) C C SPECIES MOLES ACTIVITIES GAMMAS ETC C DC 150 I = 1, NST IF (XPPM (I) . EQ. O.ODOO) XLPPM = -1000.0DOO IF (XPPM (I) . EQ. 0,0000) GO TO 140 XLPEM = DLCG10 (XPPM (I ) ) 140 WBITE (6,5.50) (NAMES (J , I) , J= 1,2) , C (I) , A L C ( I ) , A C T ( I ) , ALA (I) 1 G ( I ) , ALG ( I ) , GSP ( I ) , X F E M ( I ) , XLPPM 150 CONTINUE C C SPECIES K AND Q AND CEFF C DO 160 K = 1, NST IF (N AM ES (1, K) . EQ. NHYDRO) GO TO' 170 160 CONTINUE 170 IH = K WRITE (6,56C) NC 1 = NC - 1 CO 180 K •= 1, NC 1 IF (NDX(K,2) . NE. 0) GO 10 180 ' I = NDX (K , 1) CZ = Z(I) IF (CZ .GL 9.9) CZ =. O.ODOO CL 2 = ALA (I) - CZ * ALA (IH) WRITE (6,570) (KAMES ( J , I) , J = 1 , 2) , GSOL (I) , QS (I) , X ( K , 1 ) , 1 XD(K,1), X ( K , 2 ) , XD (K,2) , X (K,3) , XD(K,3) 180 CONTINUE NC3 .= NC •+ 3 DO 190 K = NC3, NK J •= K - 2 I = NDX ( J , 1) CZ = Z (I) IF (CZ . GT. 9.9) CZ •= O.ODOO CL2 = ALA (I) - CZ * ALA (IH) WRITE (6,570) (NAMES ( J , I ) , J = 1 , 2 ) , GSOL (I) , . QS (I) , X(K,1), 1 XD (K, 1) , X (K, 2) , XD (K, 2) , X ( K , 3 ) , XD(K,3) 190 CONTINUE' NC2 = NC + 2 WRITE (6,39 0) K = NDX (NC, 1) WRITE (6,570). (NAMES (J,K) ,3= 1,2), GSOL (K) , QS (K) , X(NC,1), 1XE (NC,1), X (KC,2) , XD(NC,2) , X (NC,3) , XD (NC, 3) WRITE (6, 380) WHITE (6,570) (NAMES (J,K) ,J=1,2) , GSOL(K), QS(K), X(NC2,1), 1XD(NC2,1), X(NC2,2), XD (NC2 ,2) , X (NC2 ,3) , XD (NC2, 3) WRITE (€,400) X (NC + 1,1) WRITE (6 , 410). AMH20 ; , WRITE (6,580) C a l l SOLSP3 (GRMTOT, XTPPM) DO 250 J = 1, NC IF (XTPPM.(J) • LE. 0.0) GO TO 200 XLTFPM = DICG10 (XTPPM (J) ) . . GO TO 210 200 XLTEPM = -100C.QD00 .210 I F (TGTH(J) . IE . 0.0) GO TO 220 XLMTOT = CLOG 10 (TOTM ( J ) i . GO TO 230 220 XLMTOT = -1000.0D00 230 IF (NDX(J,2) .NE. 0) GO TO 240. WRITE (6,5.90) (NAMES ( J J ,NDX ( J , 1 ) ) , J J = 1 , 2 ) , TOTM (J) , XLMTOT, 1 GRHTOT(J), XTFPM(J), XLTEPM GO TO 2 50 240 WRITE (6,600) (NAMEM (JJ,NDX ( J , 1 ) ) , J J = 1 , 5 ) , TOTM (J) , XLMTOT, 1 GRMTOT ( J ) , XTPPM ( J ) , XLTPPM 250 CONTINUE C C MASS TRANSFER SUMMARY C WRITE (6,65G) C C EEACT ANTS C IF (NRT . LT. 1) GO TO 2 70 DO 26 0 I = 1, NRT J = IREACT (I) GMNRL = ADEST (J) * WGHTM (J) XGMNBL = A MADE (J) * WGHTM (J) CI = ASYS (J) * WGHTM (J) 260 WHITE (6,660) ( RA MEM (J J , J) , J J = 1, 5) , ADEST(J), GMNBL, A MADE (J) , 1XGMNBL, ASYS (J) , CL 270 IF (NIT .EQ. 0) GO TO 290 DO 280 I = 1, NET J = I PROD (I) c C PRODUCTS EE ING. DESTROYED C GMNRL = AMADE(J) * WGHTM (J) GMNRL A = A LEST (J) * WGHTM (J) GMNRLB = . ASYS (J) * WGHTM (J) WRITE (6,670). (NAMEM ( J J , J) , JJ=1,5) , A MADE (J) , GMNRL, ADEST(J), 1 GMNB.LA, A S Y S ( J ) , GMNRLB \:-. 280 CONTINUE 290 CONTINUE C • ' ::. • C REACTION PRODUCTS C DC 340 1'=. 1, NMT J I F (NRT . LT. 1) GO TO 3 10 . DO 300 I I .= 1, N.BT IF (I . EQ. ISEACT (II) ) GO TO 340 300 CONTINUE 310 IF (NPT ,IT. 1) GO TO 330 DO 320 I I = 1 , NPT : . IF (I . EQ. IPBOD ( I I ) ) GO TO 340. 3 20 CONTINUE 3 30 CONTINUE IF (CAES (AMADE (I) ) .LT. 1.0D-20 ..AND. DABS (ADEST (I) ) . LT. 1. 1 0D-2O) GO TO 34.0 GMNBL A = AMADE (I) *. WGHTM (I) GMNRL = ADEST (I) * WGHTM (I) GMNRLB = ASYS (I) * WGHTM (I) WRITE (6,670) (NAMEM ( J J ,1) ,JJ= 1 ,5) , AMADE(I) , GMNRL A, ADEST (I) , 1 GMNRL, A S Y S ( I ) , GMNRLB' ' 340 CONTINUE WRITE (6, 61C) NDELXI •. WRITE (6,620) X I , ELECT WRITE (6,630)'NET • IF (N.8T . EQ. 0) STOP EETU.EN " 350 CONTINUE IF (NET .EQ. - 1) WRITE (6,420) STOP C 360 FOBMAT (//„ 30X, 'GASES',/, 30X, • ', //, 2X, 'NAME', 24X, 1 * LOG K«, 9X, 'ACTIVITY', 8X, * LOG ACTIVITY *, /) 370 FORMAT (1X, 5A4, 5X, F12.5, 5X, E12.5, 5X, F12.5) 380 FORMAT (/, • * ACTIVITIES *») -390 FG EM AT (/, «* TOTAL MOLES *») 400 FORMAT (///, ' DI/CXI I S E12.5) 410 FOBMAT (/, •TOTAL MOLES OF WATEB IN THE SYSTEM IS *, F12.3, 1 • MOLES') 420 FOEMAT, (//, 6X, 'THIS RUN HAS BEEN TERMINATED' BECAUSE THE INITIAL' 1 , /, 'SOLUTION IS SUPERSATURATED WITH RESPECT TO ONE OB MOB 2E PHASES 1, /) 430 FOEMAT { ' i * * * * * * NEW STEP SUMMARY ********, //) 440 FOBHAT (//, 6X, 'THE ABOVE SOLUTION I S NOW AT EQUILIBRIUM WITH ', 1 2A4, /, 6X, 'LOG K = », E13.6, « LOG Q = E l 3.6, /, 6X, 2. 'IT WILL BE ADDED TO THE MATRIX') 450 FORMAT {//, 6X, A4, A4, « HAS BEEN USED UP AT THE ABOVE STEP', /, 1 24X, 'IT WILL BE REMOVED FROM THE MATRIX') 460 FORMAT (16X, • DELXI' , 22X, ' = ', E12. 6) 470 FOEMAT (16X , * X I ' , 25X, *= ', E13.6, /, 16X, 'LOG XI«, 21X, *= •, 1, ',. F7.3) 480 FOEMAT (////, 64X, .*REACTANTS', /, 64X, »-——--'—', //) 4 90 FORMAT (25X, 'CUMULATIVE*, 3X, * LOG CUMUALT', 2 X , ' •CUMULATIVE•, 1 3X, 'LOG CUMULAT', 2X, 'REACTION', 12X,' '.LOG OF', 12X, 2 - 'LOG GF'/, 4X, 'MINERAL', 14X, 2 {'GRAM CHANGE',2X) , 2{ 3 'MOLE CHANGE',2X) , 'COEFFICIENT', 4X, 'SOLUBILITY PRODUCT *, 4 4X, 'ION PRODUCT', /) 500 FORMAT (1X, 5A4, 2.X, E13.6, 3X, F7.3, *4 X, E13.6, 3X, F7.3, 2X, . 1 E13. 6, 5X, E13.6, 6X, E13.6) 510 FORMAT (///, 3X, 'MINERALS', 16X, 'LOG K', 12X, 'LOG Q,» , /) 520 FOEMAT {//,• €4X , 'PRODUCTS', /64X, • — — ' , //) 530 FOEMAT (1X, 5A4, IX, F10.3, 4X, F15.7) . -540 FORMAT {//55X, 'AQUEOUS SPECIES•, //1X, 'SPECIES', 8X, 'MOLALITY', • 1 5X, 'LOG MOL', 4X, 'ACTIVITY', 5X, * LOG ACT', 3X, 2 ' ACT COEF', 5X, 'LG ACT C , 2X, ' GR AMS/KGM H20', 6X, 'PPM', 3 9X, 'LOG PPM'/) 550 FORMAT (2X, 2A4, 4X, E12.5, 2X, F8.3, 1X, E12.5, 2X, F8. 3, 2X, 1 E12.5, 2X, F8.3, 3X, E12.5, 2X, F 12.3, 3X, F9.3) 560 FORMAT {//, 1,X, 'SPECIES', 9X, ' LOG K •, 5X, ' LOG Q', 7X,.«N BAR', 1 7X, ••BIN M/DXI * , 4X, • D2 M/DXI', 6X, ' D2L N. M/DXI' , 6X, . 2 *D3 M/DXI', 4X, 'D 31N M/DXI') 570 FORMAT (2X, A4 , A4, 3X, 2 (2X ,F8. 4) , 6 (2X , E12. 5) ) 580 FOiflAT (//, 3X, 'COMPONENTS', 16X, 'TOTAL', 8X, 'LOG TOTAL', 8X, 1 «TOTAI», 10X, * TOTAI', 11X, 'IOG', 11X, 2X, /, 27X, 2 'MOIALITY', 6X, •MOLALITY 5X, 'GBAMS/KGM H20», 7X, 'PPM', 3 9X, 'TOTAI PPM', 4X, 5X, /) 590 FORMAT (• ', 2A4, 15X, E13.6, 2X, F1.0.4, 5X, 2 (E13.6 ,3X) , F10.4, 1 5X, F8.4, 6X, E13. 6) 6 00 FGEM AT {' V, 5A4, 3X, E13.6, 4.X, F10.4, 5X, 2 (E13. 6, 3X) , F10.4, 1 5X, F8. 4, ; 6X, . E13. 6) 610 FORMAT |//,6X, ' NUMBER OF DELXI INC1EM ENTS FORW AS D = ' , 14) 620 FOEMAT <//, 6X, 'IONIC STRENGTH = ' , E13.6, 15X, 1 'ELECTRICAL BALANCE = ', E13.6) 630 FORMAT (//, 6X, 'TOTAL NUMBER OF PHASE BOUNDABIES PRESENTLY BEING 1C0NS JEERED •= ', 12, ///) 640 FORMAT (1H1, 30X, 'EQUILIBRIUM HAS BEEN ATTAINED AND SOLUTION CHAR 1 ACTER.ISTICS ARE OUTLINED BELOW • , /, 32X, • -----2 — r : //) 650 FORMAT (////, 50X, 'TOTAL MASS TBANSFER IN THE SYSTEM*, /, 50X, ! i _ _ rf ////^ 27X, 2, * AMOUNT OF*, 13X, 'AMOUNT GF *, 15X, 'AMOUNT OF', 13X, . ' 3 •• 'AMOUNT OF», 10X,. 'NET AMOUNT I N ' , /, 5X, ' MINERAL PHASES', 4 4X, 'REACTANT ', 'DESTROYED', 5X, 'REACTANT PRODUCED', 6X, 5' 'PRODUCT PRODUCED*, 5X, 'PRODUCT DESTROYED', 9X, 6 'THE SYSTEM', /, 24X, 'MOLES', 6X., 'GRAMS',- 6X, 'MOLES', 7 6X ,• ' GRAMS * , 6X, 'MOLES', 6X, ' GRAMS' , 6X, 'MOLES', 6X, 8 • * GRAMS', 8X, 'MOLES', 5X, 'GRAMS') 660 FORMAT {/, IX, 5A4, 1X, 2E11.4, 1X, 2E11.4, 43X, 2E11.4) 670 FCEMAI (/, 1X, 5A4, 43X, 2 E 1 1 . 4 , 1X, 2E11.4, I X , 2E11-4) 6 80 FORM AT (//, 21, * STEP S I Z E HAS GONE TOO SMALL') 1 U y FN E SUBROUTINE ACTIV I M P L I C I T RE BL*8(A - H,0 - Z) COMMON /P AT I" AT/ NDX ( 2 0 0 , 2 ) , COMPM ( 2 0 , 2 0 0 ) , AZERO(200), G H I N ( 2 0 0 ) , 1 GSOL (200) , G G A S ( 1 G ) , COMPS ( 2 0 , 200) , Z (200) , R R ( 2 0 ) , 2 COMPG (20, 10) , WGHTM ( 2 0 0 ) , WGHTS(200), WGHTG(10), GNEOT (4) , 3 P, T, ADH, BDH, BDOT, AMH20, ALMH20, NAMEM (5, 200) , 4 NAMES (2,200) , NAMEG(5,10), N AM ER (5 , 20) , MOA (20) , 5 I R E A C T ( 2 0 ) , NMT, NST, NC, NGAS, NRT, MAXI, NDLINC, I N I O N , 6 NK COMMON /CONCT/ G ( 2 0 G ) , ALG ( 2 0 0 ) , ACT ( 2 0 0 ) , ALA ( 2 0 0 ) , C (200) , 1 ALC ( 2 0 0 ) , B ( 2 0 , 2 0 0 ) , TOTM ( 2 0 ) , XPPM ( 2 0 0 ) , T N ( 2 0 0 ) , 2 G S P ( 2 O 0 ) , A L G A S ( 2 0 ) , A G A S ( 2 0 ) , X I , ELECT, X I P R T , DELXIT COMMON /CARRAY/ QM (200) , QS (200) , B B ( 2 0 , 2 0 0 ) , A (20 , 2 0 ) , D N ( 2 0 0 ) , 1 CC(200,20) , X (200,4), C V ( 2 0 0 ) , U C V ( 2 0 ) , C S V E ( 2 0 0 ) , D C ( 2 0 0 ) , 2 WS(2G,20), ¥(20,200), X D { 2 0 0 , 4 ) , A S Y S ( 2 0 0 ) , AMADE (200) , 3 A D E S T ( 2 0 0 ) , A 1 0 , XL, DEL X I , I P R O D ( 2 0 ) , N D E L X I , I S A T , NPT, 4 NOD, I F I N , I P E I N T COMPUTE HEW A C T I V I T I E S OF AQUEOUS S P E C I E S DO 10 1 = 1, NST ALA (I) = ALC (I) + ALG ( I ) ACT(I) = 10.0E00 ** ALA (I) 10 CONTINUE COMPUTE ACTIVITY OF SPECIES = 0 DO 3 0 I = 1 , NST I F ( C ( I ) . NE. O.ODOO) GO TO 30 ATEMP = -GSOL(I) DO 20 J = 1, NC I F (NDX(J,2) . NE.. 0) GO TO 20 J J = NDX ( J , 1) ATEMP = ATEMP + COMPS ( J , I ) * A L A ( J J ) 20 CONTINUE ALA (I) = ATEMP ALC (I) = ALA (I) - ALG ( I ) C ( I ) = 10.0D00 ** ALC ( I ) ACT ( I ) = 10.0D00 ** ALA (I) 30 CONTINUE COMPUTE ACTIVITY OF GASES DO 70 I = 1, NGAS ATEMP = -GGAS (I) DO 6 0 J = 1, NC J J = NDX ( J , 1) I F (NDX (0,2) . NE. 0) GO TO 40 ATEMP = ATEMP + COMPG ( J , I ) * ALA ( J J ) GO TO 60 40 I F (NDX(J,2) ,.HE, 3) GO TO 50 ATEMP = ATEMP + COE3PG(J,I) * A L G A S ( J J ) GO TO 60 50 CONTINUE ' 60 CONTINUE ALGAS ( I ) = ATEMP AGAS(I) = 10. ODOO ** ALGAS ( I ) 70 CONTINUE CCMPUTE LOG.Q FOR SOLIDS DO 110 1 = 1, NMT = O.ODOO. 80 90 1 CO 1 10 120 130 140 150 10 0 J — 1, NC QM (I) DO 3J = NDX (J , 1) IF (NDX(J,2) Qfl(I) = CM (I) GO TO 10 0 IF (NDX(J,2) QM(I) = CM{I) GO TO 100 CONTINUE CONTINUE CONTINUE COMPUTE LOG Q OF DO 150 I = 1, NST QS (IJ = -ALA (I) DO 140 J = 1, N 33 •= NDX ( J , 1) IF (NDX ( J , 2) QS(I) = CS(I) GO TO 140 IF (NDX(J,2) QS(I) = QS(I) GO TO 14 0 CONTINUE CONTINUE CONTINUE RETURN END SUBROUTINE FINDC , NE. 0) GO TO * CGMPM(J,I) , NE. 3) GO TO + COMPM(J,I) 80 * ALA(JJ) 90 * ALGAS(JJ) AQUEOUS SPECIES . NE. 0) GO TO + CCMPS*(J,I) .NE. 3) GO TO +. CO MPS ( J , I ) 120 * ALA(JJ) 130 * ALGAS(JJ) FIND A NEW SET OF COMPONENTS. FIRST BEHOVE GASES FBOM COMPONENTS THEN SEARCH FOR AQUEOUS SPECIES WITH HIGHEST MOLALITIES SOLID PHASES IN EQOLIBBIOH AND WATER ABE LEFT AS COMPONENTS IMPLICIT REAL*8 (A - H,0 - ' Z) COMMON /PAT DAT/ NBX(200,2), COM PM(20, 20 0) ,. AZERO(200), GM.IN(200) 1 GSOL (200) , GGAS(1G), COMPS (20, 200) , Z (200) , RR{20), 2 COMPG (20, 10) , WGHTM (200) , WGHTS(200), WGHTG(10), G NE0.T (4) 3 P, T, ADH, BDH, BOOT,. AMH20, ALSH20, NAMEM(5,200) , 4 NAMES (2,200) , NAMEG(5,?0), N.AMEB (.5, 20) , MOA (20), 5 IBE.ACT(20), NMT, NST, NC, NGAS, NRT, MAXI, NDLINC, INION, 6 NK COMMON /CONCI/ 6(200)., ALG(200), ACT(200), ALA (200) , C (200) , 1 ALC ( 2 0 0 ) , B (20, 200), TOTM (20), XP.PM (200) , TN (200) , 2 GSP(200), ALGAS(20), AGAS (20) , X I , ELECT, XIPRT, COMMON /C ARB AY/ QM(200), QS (200) , BB(20,20O), A~(20,20), 1 C'C (200,20), X (200, 4) , CV (200) , . UCV (20) , CSVE (200) 2 WS(20,20), W(20,200), XD (200, 4) , AS YS (200) , AM ADE (200) , 3 ADEST (200), A.10, XL,. DELXI, IPSOD (20) , NDELXI, ISAT, NPT 4 NOD, I F I N , IPRINT DELXIT DN(200) , DC (200) REMOVE GASES ( NC2 •= NC + 2 NX = NK - NC2 NC1 = NC - 1 BC 20 I = 1., NC 1 I F (NDX (1,2) . L I . 3) GO TO 20 ATEMP •= O.ODOO DO 10 J - 1, NX I F (DABS <B (1,0) ) .LT. 1.0D-10) GO TO 10 K = NDX <NC + J , 1) IF (C (K) . LE. ,ATEMP) GO TO 10 ' I I = K ATEMP = C(K) 10 CONTINUE NDX ( I , 1) = I I • NDX (1,2) = 0 IB ET = -1 CALL IB AN S (E, IBET) 20 CONTINUE 30 CONTINUE NOW FIND AQUEOUS SPECIES WITH HIGHEST MOLALITY EG 50 I = 1, NC1 IGNORE SOLID PHASES I F (NDX ( I , 2) .NE. 0) GO TO 50 LL = NDX (1,1) ATEMP = C (II ) I I = LL DO 4 0 J = 1, NX I F (DAES (E ( I , J) ) .LT. 1.0D-1G) GO TO 40 K = NDX(NC + J , 1) IF (C(K) .LT. ATEMP) GO TO 40 I I = K ATEMP = C (K) 40 CONTINUE IF ( I I .EQ. LL) GO TO 50 NDX (1,1) = 1 1 IBET = -1 CALL TRANS (E, IBET) GO TO 30 50 CONTINUE RETURN END SUEROUTINE MATSOL IMPLICIT RE AI*8 (A - H,0 - Z) COMMON /P AT DAT/ NDX(200,2), COMPM (20, 200) ; AZEBQ (20.0) , GMIN(200), 1 GSOL (200) , GGAS(10), COMPS (20,200) , Z (200) , RR(20),. 2 COMPG (.20.^ 10) , WGHTM(200), WGHTS(200), WGHTG(IO), GNEUT (4 ) , . 3 P, T, ADH, BDH, BDCT, AMH20, A.LMH20, NAMEM (5, 200) , 4 NAMES (2, 200) , NAHEG(5,10), NA JtEB (5 , 20) , MQA(20), 5 IRE ACT (20) , NMT, NST, NC, NGAS, NBT, MAXI, NDLINC, INION, 6 NK , COMMON /CONCT/ G(200), ALG (200), ACT (200) , ALA (200), C (200) , 1 ALC (200), B (20, 200) , TOTM (20) , XPPM (200) , TN(200) , 2 GSP(200), ALGAS{20), AG AS (20) , XI , ELECT, XIP.RT, DELXIT COMMON /C ARRAY/ QM{200), QS (200), BB (20 , 200) , & (20,20), DN (200) , 1 CC (200,20), X (200,4), CV (200) , UCV(20), CSVE(200), DC (200) 2 WS(20,20), W (20,200) ,. XD (200,4) , ASYS(200), AMADE (200), 3 ADEST (200), A10, XL, DELXI, IPBOD (20) , NDELXI, ISAT, NPT, 4 NOD, I F I N , IPSINT C DIMENSIONS SHOULD BE A (N, N),E (K,M) ,CC (H,N) ,X (N+M) ,CV (N + M) C SS (N,N),,W(N,M) WHERE N SHOULD EE ..LARGER THAN NC+2 C AND B SHOULD. BE LARGER THAN NK-NC-2 C C. NC ~ NO. OF COMPONENTS C NK = NO. OF UNKNOWNS (TOTAL) • C X I S THE NEAR ARRAY TO BE DETERMINED AND RETURNED C C MULTIPLY B TIMES CC AND SUBTRACT FROM A NC.2 = NC + 2 NX = NK - NC2 DO 3 0 I - 1 , NC 2 DC 20 J = 1 , NC 2 ATEMP = O.ODOO ' ' ' . ' CO 10 K = 1, NX ATEMP = ATEMP + BB(.I,K) * CC (K, J) 10 CONTINUE , WS ( I , J) = A ( I , J) - ATEMP 20 CONTINUE 30 CONTINUE C . GET INVERSE OF WS C CALL INVERSE ROUTINE ' CALL INVRT (WS, NC2) CO 60 I = 1, NC2 CO 50 J = 1, NX ATEMP. = O.ODOO CC 40 K = 1, NC2 ATEMP = ATEMP + WS(I,K) * EE (K, J) ' ' ' 40 CONTINUE W ( I , J ) = —ATEMP -50 CONTINUE . 60 CONTINUE NDS = 1. CALL CVSOLV (NDS) RETURN EN C SUBROUTINE MININ IMPLICIT ,BEAL*8 (A. - H,0> Z) . COMMON /.PATDAT/ NDX (200, 2) , CCMPM (20 , 200) , A ZERO (200) , G MIN (200) , 1 GSOL(200), GGAS(10), COMPS (20, 200) , Z (200) , RR (20) , 2 COMFG (20, 10) , WGHTM (200), ^GHTS(200), »GHTG(10), GNEUT (4) , 3 P, T, ADH, BDH, BDCT, AM.H20, ALMH20, NAMEM (5, 200) , 4 NAMES (2,200) , NAMEG (5', 10) , NAMES (5, 20) , MOA(20) ,, ••• 5' IRE ACT (20) , NMT, NST, NC, NGAS, NBT, MAXI, NDLINC, INI ON, 6 NK COMMON /CONCT/ G.(200), ALG ( 2 0 0 ) , ACT(200), ALA (200) , C (200) , 1 ALC(2O0), B(20,200), TOTM(20), XPPH (200) , TN(200), ' . 2 GSP (200) , ALG AS,'(20) , AG AS (20) ,, X I , ELECT, XIPRT, DELXIT COMMON /CARE AY/ QM(200), QS{200), BB(20,200), A(20 ,20), DN (200) , 1 CC (200,20) , X (200, 4) , CV(200), UCV (20) , CSVE (200) , DC (200) , 2 BS ( 2 0 , 2 0 ) , ¥(20,200), XD(200,4), ASYS(200), AMADE (200) , 3 ADEST (200) , A 10, XL, DELXI, I PROD (20) , NDELXI, ISAT,. NPT, 4 . NOD, I F I N , .IP-BINT' ' . ' ' C • FINDS A DELXI CORRESPONDING TO A PHASE BOUNDARY ' NSOC - 100 NC2 = NC + 2 NX = NK - NC2 NC 1 = NC - 1 LOOPS = 0 DEL X I = DELXI * 0..5D00 DIV = DELXI 10 CONTINUE DIV = DIV *. 0.5DOO CALL STEP CALL X I C A L C ( C , Z, ELECT, CALL GAMMA ( X I , ADH, 'BDH, 1 . ACT, NDX, X I , ALG) ACTIV = GMIN(ISAT) - QM (IS AT) DA ES (U'0D-9*GMIN (ISAT) ) •.LT. ES) RETURN O.ODOO) GO TO 20 + DIV 113 NST, X I ) BOOT, NST, NC, AZERO, 'Z, GNEUT, G, C, CALL DIFF ES = IF (DAES(DIFF) I F (DIFF .LT. DELXI = DELXI GO TO 3 0 20 CONTINUE DELXI = DELXI - DIV 30 CONTINUE LOOPS = LOOPS + 1 . I F (LOOPS .LT. NSOC) WRITE (6,40) NSOC STOP GO TO 10 C c c 40 FOBMAT (///, 'PHASE BOUNDARY NOT FOUND I N », .13, ». HALVINGS. * ) INE ••• • , SUBROUTINE MOVE ". I M P L I C I T S E A L * 8 ( A - H,0 - 2 ) COMMON /PAT DAT/ N D X ( 2 0 0 , 2 ) , COMPM (20,20 0) , AZERO(20Q), G M I N ( 2 0 0 ) , 1 GSOL (200) , GGAS (10) , COMPS (20,200) , Z (.200) , RB (20) , 2 COMPG (20,10) , WGHTM ( 2 0 0 ) , WGHTS(200), SGHTG (10) , GNEUT (4) , '3 P, T, ADH, BDH, BDOT, AMH20, ALMH20, NAMEM(5,200) , ; 4 NAMES (2,200) , N A MEG (5,10) , N AMER (5 , 20) , MO A (2 0) , 5 . IRE ACT (20) , NMT, NST,.NC, NGAS, NRT, MAXI, NDLINC, I N I ON-, 6 NK COMMON /CONCT/ G ( 2 0 0 ) , ALG (200) , ACT ( 2 0 0 ) , ALA ( 2 0 0 ) , C (200) , 1 ALC (200) , B ( 2 0 , 2 0 0 ) , TOTM ( 2 0 ) , XPPM (200) , T N ( 2 0 0 ) , 2 GSP ( 2 0 0 ) , ALGAS (20) , AG A S ( 2 0 ) , X I , ELECT, XIPRT, DELXIT COMMON /CARSAY/ QM(200), QS (200) , BB (2 0 , 200) , A ( 2 0 , 2 0 ) , D N ( 2 0 0 ) , 1 CC (200,20) 2 WS (2 0,20) , 3 ADEST (20 0) 4 NOD, I F I N , NC2 = NC + 2 NC 1 = NC - 1 NX = NK NC2 DO 10 1 .= 1, NST 10 CSVE (I) = C (I) CSVE (NST + 1 ) = CSVE(NST + 2) = UPDATE MATRIX CALL UPDMAT 'X (2 0 0 , 4 ) , C V ( 2 0 0 ) , U C V ( 2 0 ) , CSVE ( 2 0 0 ) , DC (20 0) W(20,200) , XD(200,4) , ASYS(200) , AMADE (200) , , A10, XL, 'DELXI, I P B O D ( 2 0 ) , NDELXI, I S A T , NPT, I PRINT ACT (NDX (NC, 1) ) AMH20 SOLVE MATRIX CALL KATSOL NOD = 3 C ALL SECOND ' CALL THIRD CALL DEBIV CALL JUMP RETURN IND . SUBRODTINE RE ACTN 1BEN SATURATED WITH A SOLID PHASES AED I T TO TEE COMPONENTS ' I M P L I C I T EE AL*8(A - H fO - Z) COMMON /PATDAT/ .NDX ( 2 0 0 , 2) , CGMPM (20 , 200) , AZERQ(200), GMIN(200) GSOL (200) , GGAS (10) , COMPS (20, 200) , Z (200) , R R ( 2 0 ) , CGMEG(20, 10) , WGHTM (200) , WGHTS (200) , WGHTG,(10), GNEUT (4) P, I , ADH , BD H, BDQT, AMH20, ALMH20, NAMEM (5,200) , NAMES (2,200) , NAMEG(5,10), NAMER(5,20), MOA(2.0), IR EACT (20) NK COMMON /CONCT/ G(200) NMT, NST, NC, NGAS, NET, MAXI, NDLINC, INION, ALG (200) , ACT (200) , ALA (200) , C (200) ALC(200) , B ( 2 0 , 2 0 0 ) , TOTM(20), XPPM (200) , T N ( 2 0 0 ) , G S P ( 2 0 0 ) , ALG AS ( 2 0 ) , AGAS (20) , X I , ELECT, X I P R T , DELXIT COMMON /CARRAY/ QM ( 2 0 0 ) , QS (200) , BB ( 2 0 , 2 0 0 ) , A (2.0 ,20) , DN (200) , CC (200,20) , X ( 2 0 0 , 4 ) , C V ( 2 0 0 ) , UCV (20) , C S V E ( 2 0 0 ) , DC (200) WS(20,20), W ( 2 0 , 2 0 0 ) , X D ( 2 0 0 , 4 ) , A S Y S ( 2 0 0 ) , AMADE (200) , ADEST (200) , A 10, X L , D E L X I , I PROD (20) , NDELXI, I S AT, MPT, NOD, I F I N , XPHINT . NC1 = NC - 1 NC2 = NC + 2 NX = NK - NC 2 I PROD (NET + 1) = ISAT NET = NPT + 1 . K = IEROD (NET) CO 10 I = 1, NC1 I F (NDX (.1,2) .NE. ,0) I F (DABS (CGMPM (I ,K) ) . L I . 1.0D-9)'GOTO 10 o GO TO 10 D-9) NDX (1,1) = K NDX (1,2) = 1 GO TO 20 10 CONTINUE IRET • = -1 20 CALL TRANS(E, CALL FINDC CALL ACTIV CALL SETCOL ISAT = 0 I F ( I F I N .NE. CALL SETMAT I E E I NT = 1 RETURN • END SUBROUTINE SATCHK IRET) 0) RETURN C SUBROUTINE TO CEECK FOR SUPERSATUBATION OF SOLID PHASES C . I M P L I C I T REAL*8(A ~ H,0 - Z) COMMON /PAT DAT/ NDX ( 2 0 0 , 2)', COS PM (20 , 20 0) , A Z E E O ( 2 0 0 ) , G H I N ( 2 0 0 ) , 1 GSOL (200) , GG AS (10 ) , COMPS (20 , 20 0) , Z (200) , . BE (20) , 2. CGMFG (20,10) , WGHTM (200) , WGHTS(200), WGHTG (10) , GNEUT (4) , . 3 P, T, ADH, BDH, BDOT, AMH20, ALMH20, NAMEM(5,200), 4 NAMES (2,20.0) , NAMEG(5,10), NAMEE(5,20), MOA(20), ;. 5 IE FACT {20) , NMT, NST, NC, NGAS, NRT, MAXI, ND LINC, ' I N I ON, . '• 6 NK COMMON /CONCT/ G (200) , ALG ( 2 0 0 ) , ACT ( 2 0 0 ) , ALA ( 2 0 0 ) , C (200) , 1 A L C ( 2 0 0 ) , B'(20,200), TOTM (20) , XPPM (200) , TN (200) , •. < 2 GSP ( 2 0 0 ) , A L G A S ( 2 0 ) , A G A S ( 2 0 ) , X I , ELECT, XIP R T , DELXIT COMMON /CAES AY/ Q M ( 2 0 0 ) , QS (200') , B B ( 2 0 , 2 0 0 ) , A .(20,20), DN (200) , 1 C C ( 2 0 0 , 2 0 ) , X ( 2 0 0 , 4 ) , C y ( 2 0 0 ) , U C V ( 2 0 ) , C S V E ( 2 0 0 ) , DC ( 2 0 0 ) , 2 W S ( 2 0 , 2 0 ) , W ( 2 0 , 2 0 0 ) , XD (200, U) , ASYS (200) , AMADE (200) , 3 A D E S T ( 2 0 0 ) , A 1 0 , XL, DEL X I , I P E O D ( 2 0 ) , NDELXI, I S AT, NPT, 4 NOD, I F I N , I P E I N T 10 ISAT = 0 I L L = 0 DO 8 0 I .= 1, NMT I F (NPT) 4 0 , 40,, 20 20 DO 30 J = 1, NPT . • . I F ( I PBOD(J) - I ) 30, 80, 30 30 CONTINUE 40 DIFF = GM IN (I) - QM(I) ES = CABS (1.0D-9*GMIN.(I) ) I F (C ABS ( E I F F ) - ES) 70, 7 0 , 50 50 I F (DIFF) 60, 7 0 , 80 60 ' ISAT = 1 N = NDELXI : . • WRITE (6,90) NAMEM ( 1 , 1 ) , NAMEM (2 , 1 ) , NAMEM (3 , 1 ) , NAMEM ( 4 , 1 ) , 1 NA MEM (5 ,1) , N , GMIN (I ) , Qfl(I) I F (N . .'.EQ.' . 0 ) GO TO 70 CALL HININ " GO TO 10 70 ISAT = I • I L L = I L L +. 1 . ( •' 80 CONTINUE " ' BETURN . 90 FORMAT (//, 6X, .»T HE LOG K FOE 5A4 , * HAS BEEN EXCEEDED', 1 * AT STEP V, 1 4 , /, 6X, 1 LOG K = •, F 1 4 . 7 , 2X, 2 » LOG Q '= » , F 1 4. 7, /) END SUBROUTINE SETCCL -C C UPDATE KNOWN COLUMN VECTOR C I K P L I C I T BEAL*8 (A - H,.0 - Z) COMMON /PATDAT/. NDX (200,2) , COMPM (20, 200) , . AZERO (200) , GHIN(200)' 1 0 3 0 1 ( 2 0 0 ) , GGAS ( 10) , COMPS (20,200) , Z (200) , R E ( 2 0 ) , 2 COM EG (20,10) , WGHTM (20.0) , WGHTS (2 00) , WGHTG (10) , GNEUT (4 ) 3 P, T, ADH, BDH, BDOT, AMH20, ALMH20, NAMEM (5, 200) , 4 NAMES ( 2 , 200) , NAMEG ( 5, 10) , NAMEB (5 ,20) , MOA (20) , 5 I E E A C T ( 2 0 ) , NMT, NST, NC, NGAS, NET,.MAXI, NDLINC, INTON, 6 NK COMMON /CONCI/ G(200), ALG (200), ACT (2 0 0 ) , ALA (200), C ( 2 0 0 ) , 1 ALC (200) , B (20,200) , TOTM (20), XPPM(200), TN(200), 2 GSP(200) , ALGAS (20) , AGAS (20) , X I , ELECT, XIPRT, DELXIT COMMON /CAB.B AY/ QM (200) , QS (200) , BB(20,200), A (20,20), DN(200), 1 CC (200,20)., X ( 2 0 0 , 4 ) , CV ( 2 0 0 ) , UCV(2Q), CSVE(200), DC(200) 2 WS{20,20), W(2C,200), X D ( 2 00 , 4) , AS ¥S (200) , A MADE (200) , 3 ADEST ( 2 0 0 ) , A10, XL, DELXI, IPROD(20), NDELXI, ISAT, NPT, 4 NOD, I F I N , IPR INT IF (ISAT .EQ. 0) GO TO 30 NNN = NRT ," DO 2 0 I = 1, NNN IF (I RE ACT (I) . NE. ISAT) GO TO 20 NET •= NRT - 1 I F (NRT . EQ. 0) GO TO 60 DO 10 J = I , NET IRE ACT (J) = I BE ACT {J + 1) RR (J) = RB (J + 1) 10 CONTINUE GO TO 30 20 CONTINUE .-, ; 30 DO 50 I = 1, NC IJCV (I) = 0.0 DO 4 0 J = 1, NRT . K = I BE ACT (J) IF (DABS(COMPM(I,K)) .LT. 1.0D-12) GO TO 40 UCV(I) = UCV(I) + COMPM(I,K) * RR (J) 40 CONTINUE 50 CONTINUE GO TO 7 0 60 ' IFIN = 1 . . . 70. RETURN END SUBROUTINE S ET M AT SUBROUTINE TO SET UP THE NON—CHANGING PARTS OF A AND B ' ARB AYS ..AFTER CHANGE OF COMPONENT BASE. IMPLICIT BEAL*8 (A - H,0 - Z) COMMON /PAT CAT/ NDX(200,2), COMPM(20,20 0 ) , AZERO(200) , GMIN(200), 1 GSOL (200) , 'GGAS (-10) , COMPS (20, 20 0) , Z (200) , RB (20) , 2 . COMPG (20 ,10) , WGHTM (200) , WGHTS (200) , WGHTG(10), GNEUT (4 ) , 3 ' P, T, ADH, BDH, BDOT, AMH20, ALMH20, N AMEM (5, 200) , 4 NAMES (2, 200) , NAMEG(5,10), NAMES (5,20), MOA (20) , 5 IREACT (20) , NMT, NST, NC, NGAS, NRT, MAXI, NDLINC, INION, 6 NK COMMON /CONCT/ G (200) , ALG (200), ACT (200), ALA (200), C (200) , 1 ALC(2O0), B(20,200), TOTM (20) , X.PPM (200) , TN(200) , 2 GSP(200), ALGAS (20) , AGAS (20) , X I , ELECT, XIPRT, DELXIT COMMON /CARRAY/ QM(200), QS(200), BB(20,2O0), A (20,20), DN (2 00) , 1 CC(200,20), X (200,4) ,. CV (200) , UCV (20) , CSVE (200)., DC(200) 2 WS(20,20), W(20,200), XD(200,4), ASYS (200) , A MADE (200) , '3 ADEST(200) , A l p , XL, DELXI, IPROD (20) , NDELXI, ISAT, NPT, 4 . NOD, I F I N , IPRINT NC2 = NC * 2 NX = NK - NC2 NCI '•= NC - .1 SET UP CC MATRIX-. DO 2 0 1 = 1, NX DO 10 J = 1, NC 1 CC ( I , J). = O.ODOO IF (NDX(J,2) ..NE. 0) GO TO 10 CC ( I , J ) = -B ( J , I ) 10 CONTINUE CC (I,NC) = 0. 0 CC(I,NC2) = -B(NC,I) 20 CONTINUE SET UP A MATBIX DO 3 0 I = 1, NC2 DO 30 J = 1, NC2 A (J ,1) = 0. 0 30 CONTINUE A (NC + 1,NC + 1) = 1.0 A(NC2,NC2) = 1.0 RETURN END SUBROUTINE UPDM AT IMPLICIT HEI1*8(A - H,0 - Z) COMMON /P AT C ST/ NDX(200, 2 ) , COMPM (20 , 20 0) , AZERO(200), GMI.N (200) , 1 GSOL (200) , GGAS(IO), COMPS (20, 200) , Z (200) , R.R(.2Q), 2 COM PG (20,10) , WGHTM (200) , WGHTS(200), WGHTG ( 1 0 ) , GNEUT ( 4 ) , 3 P, T, ADH, BDH, BDOT, AMH20, A.LMH20, NAMEM (5,200) , 4 NAMES (2,20 0) , NAMEG(5,10), NAMEB(5,20), MOA(20), 5 I 1 E A C I ( 2 0 ) , NMT, NST, NC, NGAS, NRT, MAXI, NDLINC, INIO.N, 6 NK COMMCN /CONCT/ G(200) , ALG(200), ACT(200), ALA(200) , C ( 2 0 0 ) , 1 ALC (200), 8 ( 2 0 , 2 0 0 ) , TOTM ( 2 0 ) , XPPM (200) , TN (200) , 2 GSP (200), ALGAS(20), AGAS(20), X I , ELECT, XIPRT, DELXIT CCMMCN /CARSAY/ QM(200), QS(200), BB (20,200), A (20,20 ) , DN (200) , 1 CC(200,20), X{200,4), CV(200), UCV(20), CSVE(200), DC(200) 2 WS (20,20), W(20,2O0), X.D(200,4), ASYS(200), AMADE (200), 3 ADEST (200), A 10, XL, DEL X I , IPROD(20), NDELXI, IS AT, NPT, 4 NOD, I F I N , IPBINT SDEBOUTINE TO PUT IN CHANGES TO MATRIX DUE TO CHANGES IN MOLALITIES,NH20,ETC. . NC2 = NC + 2 NCI = NC - 1 NX = NK - NC2 PUT IN CHANGES TO A MATRIX DO 2 0 I = 1, NC1 K = NDX (1,1) IF (NDX (.1,2) . NE. 0) GO TO 10 A (1,1) = C1K) GO TO 20 10 A (1,1) = 1.0 / (.0 1801534D00*AMH2O) 20 CONTINUE DC 6 0 I = 1, NCI K = NDX ( I , 1) IF (NDX (1,2) . NE. 0) GO TO 50 IF (Z (K) .GT. 9.99) GO TO 30 A(NC + 1,1) = -0.5D00 * (Z(K)**2) * C (K) GO TO 4 0 30 A(NC + 1,1) = 0.0 40 A(NC2,I) = C(K) * . 0180 1534D00 00 CN S3 ra > d to o o o H jl o >— —^ NJO w 4. «. ia O (N O SB 3 M Q >w £-( ti> «C KC S3 o u u S3 o •> • *— o II II o r» o E H r-O H CP ~ X P O Sn • U (a s s + x • ss — £3 fe (N w r -» H H <G II u Ss X P S3 u CQ O o o EH o o s T— LTi « -O I o P IH O . o EH 0> »-3 CTi # • II ^ O to o vO E w S CO tr< O MH W tr> H PH H O et H " i Q o p o P-4 Da EH CTi S3 S3 tn ca W S3 • tri EH M EH « ! PC o — » tu r — » 1 II 11 o o ^—' ia • Ij to , a. P , — . o il ra S3 S3 U pa M «s W S3 p !l a tH t~! * S3 O M S3 M H r» w o w EH E »— u fa PM «C S3 W P H H a fcH o u «c o o CO cn un — . o tn w » * 0 * 1 H H - ~ X IH Q ca pa in tSJ • «c a H M U >- 4- P CO O I # • — *~' O M P — CO t s i \ 03 O a U • * P «* H E ia fcH * * o H O CN 33 PM O to W •a o E ss H II II II h*i H"4 u u u ca a Q E fcH ia H O «B tJ3 H p •tt H X HH \ — u t-l X + *• a, £3 O W — H II II ia oi o M E S3 " w H U EH fcH a « ; ss o u O O O « -o o p ^ rn in ia o « CO f* — 33 o u * pa * O t a s P5 pa o fcH en «S U ca H > o CN 33 S3 # O o p =r ro in o CO o » S3 l-H ^ S3 •• * - E » -+ J II O u u w S3 CN fcH CN U <«i-S3 a W P < O <* a P > p ia „ C3 — H t> EH U S3 o u o CN S3 H S3 o S3 O ro pa to o M (H ot a t a S3 H EH U « a <n «s S3 33 EH H X H x 05 S3 EH US » B T ~ U II u H CD O in o o EH O U P cq I 4-u > EH P <-U S3 <* M Q 53 Q o u o ro o o u o ra o ^ I « ~ S3 T~ O CJ « H S3 M II ^ . ^ . ^ »CN T ~ H> •— * ». *~ T T + U II —' * • S3 + X X U ~— r j q p j z w X U S3 53 C3 R S3 O — H 53 S3 St || —• M H <- PH U fcH II — M ^ t-> S3 U O O t»: U w U o VO O EH o * — O in T — u o p ro 4- 1 O P -—- o • .—. X .—s o .4- H • i£ • u EH EH u ia S3 i-3 S3 E t M CQ o . . U CQ , . o M CN U u p H fe % O fe S3 o fe H 1! H X H » •mmr S3 feO — " ra 4- . to 4- 03 « - ia fe II II u u u II to S3 4- S3 S3 , CQ «« 11 '—' p? H «8 i-H ia X u 33 X ». p •> p p S3 pa H » o r» -—• •"3 S3 S3 fe C3 S3 vO ««•» w H H S3 S3 o cu ia H4 fc-i *—' M H CTi II M W S3 PM U fcH t — o o M CJ S3 Q U EH P CH DO p u u * fed »—» Csl # N C J EH * O O C3 O P - ^ m <T\ • o • ! cn II EH W 4. tsj u — S3 O O in o I D COMMON GO TO 18 0 170 BB (NC + 1 ,1) = O.ODOO 180 EB(NC2,I) = C(K) * .G1801534D00 190 CONTINUE RETURN END SUBROUTINE FJNMV I f l E L I C I I RE£1*8 (A - H,0 - Z) COMMON /PAT DAT/ N D X ( 2 0 Q , 2 ) , COMPM (20 , 200 ) , AZERO (200) , GHIN(200), G S G L ( 2 0 0 ) , GGAS ( 1 0 ) , COMPS (20,200) , Z ( 2 0 0 ) , R R ( 2 0 ) , COMES (20, 10) # WGHTM ( 2 0 0 ) , WGHTS ( 2 0 0 ) , WGHTG(10), GN EOT (4 ) , P, T, ADH, BDH, BDOT, AMH20, A LMH 20, NAMEM(5, 200) , NAMES (2,200) , NAHEG (5, 1 0) , NA.MER (5,20) , MO,\ (20) , T R E A C T ( 2 0 ) , NMT, NST, NC, NGAS, NET, MAXI ,< NDLINC, INION, NK /CONCT/ G ( 2 0 0 ) , ALG ( 2 0 0 ) , ACT ( 2 0 0 ) , A L A ( 2 O 0 ) , C (200) , ALC ( 2 0 0 ) , B ( 2 0 , 2 0 0 ) , TOTM (20) , X P P M ( 2 0 0 ) , T N ( 2 0 0 ) , GSP (200) , ALGAS (20) , AGAS (20) , X I , ELECT, X I P R T , DELXIT /C ARB AY/ Q M ( 2 0 0 ) , Q S ( 2 0 0 ) , B B ( 2 0 , 2 0 0 ) , A (20 , 2 0 ) , DN (200) , C C { 2 0 0 , 2 0 ) , X ( 2 0 0 , 4 ) , CV (200) , [ J C V ( 2 0 ) , C S V E ( 2 0 0 ) , DC (200) WS(20,20), W ( 2 0 , 2 0 0 ) , X D ( 2 0 0 , 4 ) , A S Y S ( 2 0 0 ) , A MADE (200) , A D E S T ( 2 0 0 ) , A10, X L , D E L X I , IPROD (20) , NDELXI, ISAT, NPT, NOD, I F I N , I P R I N T DO 3 0 1 = 1, NC IF (NDX (1,2) .EQ. 0) GO TO 30 K = NDX ( I , 1) CALL MO VST (ATEMP , I ) ASYS(K) = ASYS(K) * ATEMP I F ( X D ( I , 1 ) ) 10, 3 0 , 20 ADEST (K) = ADEST(K) + ATEMP GO TO 3 0 AMAEE (K) CONTINUE DO 4 0 I = 1 , NRT K = I R E A C T ( I ) ADEST (K) = ADEST(K) 1 1 9 COMMON 10 20 30 = AMADE (K) + ATEMP 40 A SYS (K) CONTINUE DELXIT = NC 1 = NC NC2 = NC NX = NK -= ASYS(K) -- R R ( I ) BR ( I ) * * DELXI DELXI D E I X I I - 1 + 2 NC 2 + DE L X I 50 60 NNN = NRT DO 90 I = 1, NNN I F ( I .GT. NRT) K = IREACT (I) I F (ASYS(K) .LT, GO TO 90 NRT = NRT - 1 IPRINT = 1 I F (NRT .EQ. 0) I F ( I -GT. NRI) DO 70 J = I , NRT GO TO 100 1. OD-12) GO TO 60 CO GO TO TO 110 80 70 80 IRE ACT(J) = I R E A C T ( J RE (J) = BR ( J + 1) CONTINUE ASYS(K) = O.ODOO D I F ( I . G T . N S T ) GO T O 1 0 0 GO TO 5 0 90 C O N T I N U E 1 0 0 I F ( N N N . E Q . N E T ) GO T O 1 2 0 C A L L S E T C O L G O T O 1 2 0 11 0 I F I N = 1 G O T O 2 6 0 1 2 0 I F ( N P T ) 2 6 0 , 2 6 0 , 1 3 0 1 3 0 NNN = N P T DO 2 5 0 I = 1, NNN K = I P R O D ( I ) co n o J = 1, N C 1 J l = J I E ( N D X ( J , 2 ) . E Q . 0) GO TO 1 4 0 I F ( N D X ( J , 1 ) . E Q . K) GO TO 1 5 0 140 C O N T I N U E 1 5 0 I F ( X D ( J I , 1 ) . G T . O.ODOO) G O T O 2 5 0 I F ( A S Y S ( K ) . L T . 1 . 0 D - 1 2 ) GO T O 1 6 0 GO T O 2 5 0 1 6 0 N P T = N P T - 1 I P 8 I N T = 1 I F ( N P T ) 2 0 0 , 2 0 0 , 1 7 0 1 7 0 I F ( I . G T . N P T ) GO T O 1 9 0 CO 1 8 0 J = I , N P T IIBOD(J) = I P E O D ( J * 1) 183 C O N T I N U E 190 C O N T I N U E • A S Y S ( K ) = O.ODOO 2 0 0 CO 2 1 0 J = 1, N C 1 I F ( N D X ( J , 2 ) , E Q . 0 ) GO T O 2 1 0 I F ( N D X ( J , 1 ) > N E . K) GO TO 2 1 0 L = J GO T O 2 2 0 2 1 0 C O N T I N U E 2 2 0 DO ' 2 3 0 J - 1, NX I F ( D A E S ( C O M P S ( L , J ) ) . L T . 1 . 0 D - 1 0 ) G O T O 2 3 0 NDX ( L , 1 ) = NDX ( N C • J , 1) NDX ( L , 2 ) = 0 ' GG T O 2 4 0 2 3 0 C O N T I N U E I E E T = - 1 2 4 0 C A L L T R A N S ( E , I S E T ) 2 5 0 C O N T I N U E 2 6 0 C A L L F I N DC C A L L A C T I V . C A L L S E T C O L C A L L S E T MAT y-:: ' •' B E T U E N • E N D S U B B C U T I N E S P E C L G (K) I M P L I C I T B E AL * 8 ( A - H,0 - Z) y • COMMON / P A T D A T / N D X ( 2 0 0 , 2 ) , C O M P M ( 2 0 , 2 0 0 ) , A Z E S O ( 2 0 0 ) , G M I N ( 2 0 0 ) , 1 G S O L ( 2 0 0 ) , G G A S ( 1 0 ) , C O M P S ( 2 0 , 2 0 0 ) , Z ( 2 0 0 ) , BR ( 2 0 ) , 2 C O M P G ( 2 0 , 10) , W G H T M ( 2 0 0 ) , W G H T S ( 2 0 0 ) , W G H T G ( 1 0 ) , G N E U T ( 4 ) , 3 P, T , A D H , BD H, B O O T , A M H 2 0 , A L H H 2 0 , • N A M E M ( 5 , 2 0 0 ) , 4 N A M E S ( 2 , 2 0 0 ) , N A M E G ( 5 , 1 0 ) , N AMES ( 5 , 2 0 ) , M O A . ( 2 0 ) , 120 5 TEEACT(20) , N M T , NST, NC, NGAS, NST, MAXI, NDLINC, INION, 6 NK COMMON /CONCT/ G ( 2 0 0 ) , ALG ( 2 0 0 ) , ACT ( 2 0 0 ) , ALA (200) , C (200) , 1 ALC ( 2 0 0 ) , B ( 2 0 , 2 0 0 ) , TOTM ( 2 0 ) , XPPM (200) , TN (200) , 2 G S P ( 2 0 0 ) , ALGAS ( 2 0 ) , AGAS (20) , X I , ELECT, XI P R T , DELXIT COMMON /CAESAY/ QM (200) , QS (200) , B B ( 2 0 , 2 0 0 ) , A (20 , 20) , DN (200) , 1 CC ( 2 0 0 , 2 0 ) , X ( 2 0 Q , 4 ) ; C V ( 2 0 0 ) , U C V { 2 0 ) , CSVE (200) , DC (200) , 2 HS ( 2 0 , 2 0 ) , W ( 2 0 , 2 0 0 ) , XD(20Q,4), ASYS (200) , A MADE (200) , . 3 ADEST (200), A10, XL, D E L X I , I.PROD (20) , NDELXI, ISAT, NPT, a NOD, I F I N , IPRINT ATEMP = -GSOL(K) ./ DC 10 J = 1, NC I F (NDX(J,2) . NE. 0) GO TO 10 ,. J J = NDX (0,1) ATEMP = ATEMP + CO MPS ( J , K) * A L A ( J J ) 10 CONTINUE ALA (K) = ATEMP ALC(K) = ALA (K) - ALG (K) C (K) = 10.0 ** ALC (K) RETURN END v . SUBROUTINE PR EA D(B, ASYS) '• I M P L I C I T REAL*8 (A - H,0 - Z) C C THIS SUBROUTINE READS THE DATA SOURCE FOB "PATH" AND PUTS IT I N C THE COMMON ELOCK "PATI3 AT". C ' . -.. EXTERNAL CAICK ' . ; • . . . . . . INTEGER*2 DUMMY ( 1 0 0 ) , . NCOMP (4 ,4 0) , INPUT (60,20) , DUMMY2(60) INTEGEE*2 • TYPE (4,6) , WATER ( 6 0 ) , STAR, NSW, BLANK " ' DATA WATER /'H', »2*, *0«, 6*» », '«H • , » (• , 1 2» , •)'» ' 0'» '(*» 1 • 1 • , «)«, 43*' '/ DATA STAB /•*•// ELANK /» »/ DATA TYPE /»M', ' I ' , »N', »EV, 'A', • Q» , 'U', ' E* , 'S', fO», »L«, 1 ' ' I ' , 'G 1, 'A'/ 'S', 'E«, 'R', 'E', 'F», «E», 'S', «T', 'O', 2 . 'P V DIMENSION ANCOM (40) , PHC8P (40) , N AM ECO (5 , 20) , NDUM (5) , B ( 2 0 , 200) DIMENSION WEIGHT (40) , ASYS (200) , TEMPER(8) , ZCOM? (40) COMMON /OOP/ A IN IT (2 0) , I M ( 5 , 2 0 ) , I S ( 2 , 2 0 ) , I G ( 5 , 2 0 ) , NIONJ2), 1 - I H X , I S X , I G X , INPUT . . COMMON /PAT DAT/ N D X ( 2 0 0 , 2 ) , COMPM (20, 200) , AZERO'(200) , GM.IN (200) , • 1 G S O L ( 2 0 0 ) , G G A S ( i O ) , COMPS (20, 200) , Z (200) , RR (20) , 2 COMFG (20,, 10) , WGHTM (200) , WGHTS(200), WGHTG { 1 0) , GNEUT (4) , 3 P, T, ADH, B D H, ' BD CT, AMH20, ALMH20, N AMEM (5 , 20,0)', 4 . NAMES ( 2 , 2 0 0 ) , N AM EG ( 5 , 1 0) , N AM ER ( 5 , 20) , MO A (20) , 5 IREACT (20) ,. NMT, NST, NC, NGAS, NET, MAXI, NDLINC, INION, 6 NK C • • ; , ."«'.. C THE FOLLOWING CALL S P E C I F I E S THAT FORTRAN UNIT 19 I S TO BE USE C FOR C MEMORY-TG—MEMORY I/O WITH A BUFFER LENGTH OF 30 BYTES. THIS C .ROUTINE .IS C FOUND ONLY AT MTS INSTALATIONS AND MUST BE REMOVED AND UNIT 19 C ASSIGNED C TO A TEMPEEARY- F I L E . THE REWIND STATEMENTS I N SUBROUTINE DECO , C WILL C HAVE TO HAVE THE 'C* REMOVED.. ' 121 c CALL FTNCMD (» EU.FFER 19 LENG TH=3 0 • , 19). C C BEAD IN THE "A" DEBYE-HUCKEL TEEMS C BEAD (3,920) TEMPEB CALL STB A (TEMPER, T, PAR) ACH = PAR C C READ I N THE E DE E YE- BUCKET TEEMS (X 10E-8) C • READ (3,920) TEMPER CALL STRA(TEMPER, T, PAR) BDH = PAR C C BEAD I N THE EDOT (DEVIATION FUNCTION) TERMS; C BEAD (3,920) TEMPEB CALL STRA (TEMPEB, T, PAB) E COT = PAR C C BEAD IN THE GAMMA OF C02 IN NACL SOLUTIONS C ; DO 10 J = 1 , 4 READ (3,9 20) TEMPER ' CALL STRA (TEMPER, T, PAR) GNEUT (J) = PAR 10 CONTINUE N MI = 0 NST = 0 - ' , NGAS = 0 READ (3,930) NCTZ C . C READ IN THE ELEMENTS OF THE COMPOSITIONAL ARRAY'S TO DUMMY. C READ (3,960) ( (NCOMP ( J , I I ) ,J=1,4) ,11=1, NCTZ) C C READ THE WEIGHT'S OF EACH OF THE COMPONENTS C BEAD (3,970) (WEIGHT (I) ,1=1,NCTZ) C DC 20 J = 1, 40 ANCGM (J) = 0.0 20 CONTINUE' • NC = NC + 1 DO 30 J = 1, 60 INEUT(J,NC) '= WATER (J) .30 • CONTINUE NDX(NC,2) = 0 ' . ' MOA(NC) = 0 DC 7 0 I = 1, NC .. DO 40 J = 1, 60 DUMMY2(J) = I N P U T ( J , I ) .: 40 CONTINUE CALL DECODE (PHCMP, NDUM, NCTZ, NCOMP, DUMMY2, 60)-DO 50 J = 1, NCTZ • " • , ANCOM(J) = PHCMP (J) + ANCOM(J) 50 C O N T I N U E DO 6 0 J = 1, 5 NAM E C O ( J , 1 ) = N D U M ( J ) . 60 C O N T I N U E ~ • • [. 7 0 C O N T I N U E GO TO 1 5 0 80 I = 0 9 0 I = I + 1 I F (DUMMY ( I ) . E Q . S T A R ) GO T O 9 0 1 = 1 - 1 DO 1 1 0 J J = 1, 6 DO 1 0 0 J = 1, 4 I F ( D B M H 3'(I + J ) ' . N E . T Y P E ( J , J J ) ) GO TO/-.I 10 100 C O N T I N U E NPfiS •= J J • ' . GO TO 1 2 0 . ' 1 10 C O N T I N U E • GO T C 1 4 0 12 0 GO T O ( 1 5 0 / 1 5 0 , 1 5 0 , 1 5 0 , 1 3 0 , 3 9 0 ) , N P W S 1 3 0 C A L L R R E A D ( N S W , DUMMY, £390) I F (NSW . E Q . S T A R ) GO T O 8 0 . I F (NSW . N E . B L A N K ) GO T O 1 4 0 ., GO T O 1 3 0 14 0 W R I T E ( 6 , 8 8 0 ) NSW, DUMMY S T O P 1 5 0 C A L L B R E A D ( N S W , DUMMY, S 3 9 0 ) I F (NSW . E Q . S T A R ) G O T O 8 0 I F (NSW • N E . E L A N K ) GO T O 1 4 0 R E A D ( 3 , 9 4 0 ) H, S , A , B B , C , V • I F (fl . G T . S 9 9 9 9 9 . ) GO T O 1 5 0 fl = H / 4 . 1 8 4 S = S / 4 . 1 8 4 A = A / 4 , 1 8 4 B E = BB / 4 . 1 8 4 C = C / 4 . 1 8 4 C A L L D E C O D E ( P H C M P , N DUM,. N C T Z , NCOMP, DUMMY, 1 0 0 ) DG 1 6 G J = 1 , N C T Z I F ( P H C M P ( J ) . G l . .'1. OD- 10 . A N D . A N C O M ( J ) . L T - 1 . 0 D - 1 0 ) 1 GO T O 1 5 0 160 C O N T I N U E GO T O • ( 1 8 0 , 2 7 0 , 1 7 0 , 3 3 0 ) , NPWS 1 7 0 W R I T E ( 6 , 8 9 0 ) GO T O 1 3 0 180 I F ( I M X . E Q , 0) GO T O 2 4 0 DO 2 2 0 K = 1 , I M X DO 1 9 0 J = 1, 5 I F ( I M ( J , K ) . NE. N D U M ( J ) ) GO' T O 2 2 0 19 0 C O N T I N U E I F ( K . E Q . IMX) GO T O 2 3 0 KK = K LOOP; = I M X - 1 : • • " * ' • » DO 2 1 0 J J = K K , L O O P DO 2 0 0 J J J = 1 , 5 I M ( J J J , J J ) = I M ( J J J , J J + 1) 2 0 0 C O N T I N U E 2 1 0 C O N T I N U E . ' GO 10 230 220 CONTINUE GO TO 240 230 I MX = IMX - 1 GC TO 150 240 NMT = NMT + 1 DO 250 J = 1, 5 NAMEM ( J , NMI) = NDUM(J) 250 CONTINUE WGHTM (NMT) = 0. 0 LOOP = 0 CO 260 J = 1, NCTZ WGHTM (NMT) = WGHTM (NMT) + PHCMP (J) * WEIGHT (J) I F (ANCOM(J) .LT. 1. OD- 11) GO TO 260 LOOP = LCOE + 1 COMPM (LQOP.,NHT) = 'PHCMP (J) 260 CONTINUE GMIN (NMT) = CALCK (H,S, A,B.B,C, V,T,P) GC TO 150 270 AZ = EB * 4. 184 ' . 2.7. = C * 4,184 V = 0 • "• I F ( I S X .EQ. 0) GO TO 300 DC 290 K = 1, I S X DO 280 J = 1 , 2 I F ( I S (J,T) . NE. NDUM(J)) GO TO 290 280 CONTINUE GO TO 150 290 CONTINUE 300 NSI = NST + 1 DO 310 J = 1, 2 NAMES (J,NST) = NDUM (J) 3 10 CONTINUE WGHTS (NST) = 0 . 0 LOOP = 0 CO 320 J = 1, NCTZ WGHTS (NST) = IGHTS(NST) +'PHCMP(J) * WEIGHT (J) I F (ANCOM(O) .LT. 1.0D-11) GO TO 320 LOOP = LCOE + 1 COMPS (LOOP,NST) = PHCMP (0) 320 CONTINUE AZERC (NST) = AZ Z (NST) = ZZ . Z1 = 0.0 GSOL (NST) = C A L C K ( H , S , A , Z l , z i , Z l , T , P ) GO TO 150 . , / " 330 V = 0. I F (IGX .EQ. 0) GO TO 360 DO 350 K = 1 , IGX . .'• • •„••••••" DO 340 J = 1, 5 I F ( I G ( 0 , K ) .NE. NDUM(J)) GO TO 350 340 CONTINUE GO TO 150 350 CONTINUE ' 360 NGAS = NGAS • 1 DO 370 J = 1 , 5 NAMEG ( J , NGAS) = NDUM (J) 370 CONTINUE WGHTG (NGAS) = 0. 0 LOOP = 0 DO 38 0 J = 1 , NCTZ WGHTG (NGAS) .= WGHTG (NGAS) .+ PHCMP (J) * WEIGHT(J) IP (ANCOM(J) .IT. 1.0D-11) GO TO 380 1005 = LOOP + 1 COMPG (LOOP,NGAS) = PHCMP (J) 380 CONTINUE V V = 0.0 • GGAS (NGAS) = CALCK (H , S , A , BB ,C , V, T, P) GO TO 150 390 NEEDSW •= -1 400 DO 520 I = 1 , NC IS WIT = NDX (1,2) + 1 GO TO <410, 440, 440, 4 7 0 ) , ISWIT C AC SECTION 4 10 DO 43 0 K •= 1, NST CO 420 J = 1, 2 IF (NAMES (J,K). . NE, NAMECO ( J , I ) ) GO TO 430 420 CONTINUE . LIP = K GO TO 510 430 CONTINUE WRITE (6,990) (NAMECO {J , I) , J= 1 ,2) GO TO 860 4 40 DO 46 0 K = 1, NMT • DC 450 J = 1, 5 •IF (NAMEM (J,K) . NE. NAMECO(J,I)) GOTO 460 450 CONTINUE LIP = K GG TO 5 10 460 CONTINUE \ WRITE (6,980) (NAMECO (J,I ) ,J=1 ,5) GO TO 8 60 470 I F jNGAS .IT. 1) GO TO 500 DO 490 K = 1, NGAS DO 480 J = 1 , 5 IF (NAMEG (J,K) . NE. NAMECO (J,I) ) GO TO 490 480 CONTINUE ' LIP = K GO TO 510 490 CONTINUE 500 WRITE (6,980) ( NAMECO (J ,1) , J= 1, 5) GO TO 860 5 10 NDX (1,1) = L I P 520 CONTINUE IF (LOOP .EC- NC) GO TO 560 NEEDSW = 1 DC 5 30 I = 1, NMT . CO MEM (NC,1) =0.0 530 CONTINUE DO 54 0 I = 1 , NST COMES (NC, I) = -Z (I) IF (Z (I) . GT. 9.9) COMPS(NC,I) = 0.0 540 CONTINUE IF (NGAS .LT. 1) GO TO 560 DO 550 1 = 1 , NGAS CO BIG (NC,I) = 0.0 550 CONTINUE 560 CONTINUE I SET = -1 CALL TRANS(E, IRET) I F (NEEDSW .GT. 0) GO TO 780 LIM = NST - 1 .NCI = NC + 1 LOOP = 1 DO 570 J = 1, NC I F (NDX(J,2) . N I . 0) ZCOMP (J) = O.OD+00 I F (NDX(J,2) . NE. 0) GO TO 570 ZCCKF (J) = Z (NDX ( J , 1) ) I F (DABS (ZCOMP (J) ) .GT. 9.9) ZCOMP (J) = 0.0D + 00 570 CONTINUE DO 6 30 I = 1, NST ATEMP = -Z (100P) I F (DABS (Z (LOOP) ) .GT. 9.9) ATEMP = 0.0 DO 580 J = 1, NC ATEMP = ATEMP + ZCOMP (J) * COMPS ( J , LOOP) 580 CONTINUE I F (DABS (ATEMP) . LT. 1.0D-05) GO TO 620 DO 610 K = LOOP, LIM Z (K) =2 (K + 1) GSOL (K) = GSCI (K + 1) AZEBO (K) = A ZERO (K + 1) WGBIS(K) = WGHTS (K • 1) DO 590 J = 1, NC COMPS (J,K) = COMPS ( J , K + 1) 590 CONTINUE DO 600 J = 1 , 2 NAMES (J,K) = NAMES ( J , K + 1) 6 00 CONTINUE 610 CONTINUE IIH = LIB - 1 I F ( L I B . L I . 1) GO TO 870 GO TO 630 6 20 LOOP = LOOP + 1 630 CONTINUE NST = LOOP - 1 LIM = NMT - 1 LOOP = 1 DO 700 I = 1 , NMT ATEMP = 0.OD+00 DO 640 J •= 1, NC ATEMP = ATEMP + ZCOMP (J) * COMPH ( J , LOOP) 640 CONTINUE I F (CABS (ATEMP) . LT. 1.0D-05) GO TO 690 650 CONTINUE DO 680 K = LOOP, L I M GMIN (K) = GMIN (K- + 1) WGHTM (K) = WGHTM (K + 1) DO 660 J = 1, NC CGMPM <J,K) = COMPM ( J ,K * 1) 6 60 CONTINUE DO 67 0 J = 1, 5 126 NAMEM (J,K) = NAMEM(J,K + 1) 6 70 CONTINUE 680 CONTINUE LIM = L I M - 1 IF (LIM . LT. 1) GO TO 8 7C GO TO 700 6 90 LOOP = LOOP + 1 700 CONTINUE NM = LOOP - 1 IF (NGAS .LT. 1) GO TO 770 LIM = NGAS - 1 LOOP = 1 DO 760 1 = 1 , NGAS ATEMP = 0.OD+OO DO 710 J = 1, NC ATEMP = ATEMP + ZCOMP (J) * COMPG (J/LOOP) 710 CONTINUE I F (DABS (ATEMP) .LT. 1.0D-05) GO TO 750 DO 740 K = LOOP, LIM GGAS (K) = GGAS (K + 1) WGHTG (K) = WGHTG (K + .1) DO 720 J = 1, NC COM PG {J , K) = COMPG (J,K + 1) 720 CONTINUE DO 730 J = 1,5 N AMEG (J,K) = N AMEG {J , K + 1) 730 CONTINUE 740 CONTINUE LIM = LIM - 1 GO TO 760 . 750 LOOP = LOOP + 1 760 CONTINUE NGAS = LOOP - 1 C 770 LGOP = NC • NEEDSW.=, 1 GO TO 4 00 780 I F (NET .LT. 1) GO TO 820 DO 810 K = 1, NET C DO 800. I = 1 , NMT C DO 790 J = 1,5 IF (N AMEE (J , K) . NE. NAMEM (J ,1) ) -GO TO 800 . 790 CONTINUE C IEE ACT (K) = 1 ASYS (I) = A IN IT (K) GC TO 810 800 CONTINUE WEITE (6,900) ' (NAMES (J,K) ,J=1,5) 'WRITE (6, 1000) WRITE (6,1010) STOP C 810 CONTINUE , 820 DO 840 I = 1,, NST 8 30 DO '83 0 J - 1, 2 I F (NAMES ( J , I ) , NE. CONTINUE 128 NION ( J ) ) GO TO 840 INIC N = I GO TO 850 840 CONTINUE WRITE (6,1020) GC TC 860 850 RETURN; 860 WRITE (6,1000) STO P 8 70 WRITE (6,910) STOP (NION (J) ,J=1,2) 880 890 900 910 9 20 930 940 950 960 970 980 990 1000 FO EH AT (1.X, 5 ( « * * * * * » ) , /, 1 ' LINE I N ERROR I S • FORM AT (//, 5 ( ' * * * * * * * * • ) , 'IMPROPERLY FORMATED DATA BANK 1 1HIS VERSION', /, ' ALL SOLID SOLUTION 2 5 (.* * •*•****•*•) ) FORMAT (///, ' I N I T I A L REACTANT '" /, 101A1, //) SOLID'SOLUTION I S PHASES WILL NOT WORKING I N T FORMAT (//,'*', /, 'A CONSTRAINING 10N STATES - BUT TEE.RE IS NO REDOX', 2BEDOX COUPLE'IF YOU HAVE TWO', FOEMAT (8F8.4) 5A4, •" COULD NOT BE FOUND') . PHASE ', 'CONTAINS TWO OXIDATI /, 'COUPLE- : YOU MUST HAVE A OXIDATION STATES. ') FOEMAT FORMAT FOEMAT FORMAT FORMAT FOEMAT FORMAT FORMAT 1010 1020 1 2 1 1 (1X, 2613) (5X , 6F12.3) (1 X , 150A1) ( 7 ( 4 A 1 , 4 X ) ) (7F10.5) (///, •COMPONENT ', 5A4, (///, 'COMPONENT ', 2A4, (' CHECK I F COMPONENT I S * YOU HAVE SPELLED IT THE •J U S T I F I E D IN THE INPUT • COULD NOT BE FOUND!') ' COULD NOT BE FOUNDJ ') ' PRESENT IN DATA DECK AND THAT SAME AND THAT I T I S LEFT. F I E L D ! !! ! •) FORMAT FORMAT ('ALSO CHECK THAT THIS PHASE DOES NOT HAVE TWO OXIDATION ' STATES' , /, ' I F THE SOLUTION ONLY CONSTRAINS ONE ') (///, 'THE SP E C I E S •", 2A4, '» CHOSEN AS THE ION TO BE ', , 'BALANCED', • ON, COULD NOT BE FOUND') END S U B R O U T I N E DECODE (PHCMP, NNDUM, NCTZ, NCOMP, NOUT, I S I Z E ) C c c c c c c c THIS ROUTINE IS CALLED BY PREAD AND DECODES TEE FORMULAS. ON SOME SYSTEMS, THE CALLS TO RWITE AND REEAD WILL NOT WOBK, COMMENT THESE OUT AND REMOVE THE "C" FROM. INFRONT OF TEE REWINDS, WRITE AND READS ON UNIT 19. ' I M P L I C I T RE AL*8(A - H,0 - Z) DIMENSION . PHCMP (4 0) , INDEX ( 4 0 ) , NNDUM (5) INTEGER*2 NCOMP ( 4 , 4 0 ) , N O U T ( I S I Z E ) , NDUM(25) INTEGER*2 NNCOM (5,40) , NFOBH" (2,40) , NBRAC (2) DATA ELANK /• PERIOD /'.'/, NERAC / ' ( ' , DATA NUMBER / • 1 ' , »2«, ' 3 ' , '4», «5», ' 6 ' , » NUMBER (10) PERIOD, BLANK V •8 ! •9' •0'/ DO 10 I = 1, 25 M.D0M(I) = EIAKK 10 CONTINUE DO 4 0 I = 1, NCTZ PHCMP (I) = 0. 0 20 129 DO 20 J = 1,2 NFOBM(J,I) = BLANK CONTINUE C c 30 BO 30 J = 1, 5 NNCGM ( J , I) . = BLANK CONTINUE 40 CONTINUE DO 50 I = 1, I S I Z E IE (MOOT (I) . EQ. BLANK .AND. NOUT(I + 1 1 + 2 ) .EQ. BLANK) GO TO 60 IF (I •GT. 25) GO TC 50 NDUM (I) = MOOT (I) 50 CONTINUE 1) . EQ. BLANK .AND. NOUT ( EQ. BLANK .AND. NOUT (NN + 1) . EQ. BLANK .AND. NOUT ( 60 CONTINUE .. C REWIND 19 C WRITE (19,1)NDUM CALL RWITE (NDUM, 25) C REWIND 19 C READ (19, 2) NNDUM C AIL REEAD (NNDUI? , 5) NN = I 1 = 0 70 NN = NN + 1 I F (NCUT(NN) .EQ. BLANK) GO TO 70 so j = o ; 1 = 1 + 1 90 IF (NCUT(NN) 1 NN + 2) . EQ. , BLANK) GO TO 120 I F (NOUT (NN) .EQ. NBRAC(I)) GO TO 100 J = J + 1 NFGRfi ( J , I ) = NOUT (NN) ' Nfi = MN + 1 GO TO 90 100 J = 0 1 10 NN = NN + 1 NSWIT = - 1 IF (NOUT (NN) .EQ. NB.RAC (2) ) NSW.IT = 1 IF (NSWIT .EQ. 1) NN = NN * 1 I F (NSWIT . EQ. 1) GO TO 80 IF (NOUT(NN) .EQ. BLANK) GC TO 110 J = J + 1 NNCOE ( J , I ) = NOUT (NN) GO TO 1 10 120 L I - 0 EC 15 0 K = ] r 4 0 IE (NFQRM{1r K) .EQ. BLANK) GO TO 16 0 C DO 140 I = 1, NCTZ C DO 130 J = 1, 2 I F (NFQRM (J,K) . NE, NCOMP(J,I)) GO TO 140 130 CONTINUE C INDEX (K) = I L I = L I + 1 GO TO 150 140 ' CONTINUE C 150 CONTINUE C 160 DO 210 I = 1, L I J J = 1 COUNT = 10.0D00 I F (NNCCM(2,I) . EQ. PERIOD . OR, NNCOM(2,I) . EQ. BLANK) 1 COUNT = 1.0D00 ' 170 I F (NNCOM(JJ/I) .EQ. BLANK) GO TO 2 1 0 , v I F (NNCOM(JJ,I) .EQ. PERIOD) GOTO 200 C .. .. DG 180 J = 1, 10 I F (NNC0M(JJ,I) .EQ. NUMBER (J) ) GO TO 190 ' 180 -CONTINUE . •' C ' . • ' 190 I F (J . EQ. 10) J = 0 PHCJSP (INDEX (I) ) = -FLOAT (J) ; * COUNT + PHCMP (INDEX ( I ) ) COUNT = COUNT * ..1.D00 200 J J = J J + 1 5 I F ( J J '.LT. 6) GO TO 170 • • 210 CONTINUE c •..... •'''•" . • •• '•' ' RETURN .. " . •L ' 220' FO EM A3 ( I X , 25A 1) •• , 230 , F0EM.AT',(1X^ 5A4) END ' :- ' \ • ! FUNCTION CALCK(H, S, A , B , C, V, 1, P) c . , ;. • - . • ' • • ' ' . ' . . . C CALCULATE LCG K FROM H , S , A , 3, C , V C ; . • I M P L I C I T ' 8EAL*8 (A - H,0 - Z) . X = 10. A 10 = DLOG (X) TR = 29 8. 15 R = 1.98726 •XI = A * (T - TR) . + B /'"2 * (T**2 - TR**2) - C * (1/T - 1/TR) X2 = A * (DLOG (T/TR) ) + B * (T - .TH) - C / 2 *' ( T * * ( ^ 2 ) "- TB** (-2) 1) . . X3 •=.' (H - (T*S) ) + V ,*.. 02390064 * (P -.1) X4 =" X3 + X1 - T * X2 CALCK = -X4 / ( ( - A 1 0 ) * R * T ) RETURN ... END . SUBROUTINE I ATA IN (TOTM) -BEAD DATA INPUT FOB UNIT 5, DO LIMITED EBBOB CHECKING ECHO CN OUTPUT DEVICE. 131 I M P L I C I T BE AL*8 (A - H,0 - Z) INTEGER*2 INPUT (60,20) : •COMMON /DUP/ ATNIT (20) , IM (5,20) , 15 (2,20)', I G ( 5 , 2 0 ) , NION ( 2 ) , 1 IMX, I S X , IGX, INPUT ' - DIMENSION TITLE (4 0) , TOTM (20) COMMON /PATDAT/ N D X ( 2 0 0 , 2 ) , COMPM (20,20 0) , AZERO{200), GMIN.(200) 1 G S G L ( 2 0 0 ) , GGAS (T O ) , COMPS (20 , 200) , Z (200) , R S ( 2 0 ) , 2 COMPG (20 , 10) , «GHTM(200), WGHTS ( 2 0 0 ) , WGHTG ( 1 0 ) , GNEUT ( 4 ) , 3 P, T, ADH, BDH, BDOT, A.MH20, ALMH20, NAMEM (5, 200) , 4 NAMES (2 , 200) , NAMEG(5,10), NAMEB ( 5 , 20) , MOA (20) , 5 IREAC T ( 2 0 ) , NMT, NST, NC, NGAS, NET, MAXI, NDLINC, INION, '' 6 NK BEAD (5,24 0) (TITLE ( I ) ,1= 1,40) . • , EEAD ( 5 , 200) T, P, NRT, A MH 20, NDLINC, MAXI, IMX, I S X , . I G X I F (A MH 20 . LT. 1,0) AMH20 = 1.0DOO / ,0 18015.34D00 ALMH20 = DLOG10 (AMH20) I F (MAXI .LT. 1) MAXI = 100000 BEAD (5,210) (NION ( I ) ,1=1 ,2) I F (NBI .LT. 1) MAXI = 1 I F (NET ,LT.,1) NDLINC = 0 I F (NET .LT, 1) GO TO 10 BEAD (5,220) (EB (I) , A I N I T (I) , (NAMEB ( J , I ) ,J=1,5) ,1=1, NET) 10 I F (IMX . EQ. 0) GO TO 20 BEAD ( 5 , 230) j (IM (J , I ) , J= 1, 5) , 1= 1 ,IMX). 20 I F (ISX . EQ. 0) GO TO 30 BEAD (5,250) ( (I S (J , I ) , J= 1, 2) , 1 = 1, ISX) 30 CONTINUE I F (IGX .LT. 1) GO TO 40 BEAD (5,230) ( (IG ( J , I ) , J= 1, 5) ,1=1 ,IGX) 40 CONTINUE LIM = 0 50 I = LIM + 1 BEAD ( 5 , 2 6 0 , END=60) M O A ( I ) , NDX (1,2) , TOTM (I) , (INPUT ( J , I) , J= 1 , 60) LIM = LIM • 1 GO TO 50 60 CONTINUE ' ••" NC = LIM • ' ". ' C C I ATA ECHO HEBE . C WHITE ( 6 , 270) WHITE (6,240) ( T I T L E ( I ) , 1 = 1 , 4 0 ) WBITE ( 6 , 280) T, P, MAXI, NDLINC, (NION (I) ,1=1,2), AMH20 • IF (NBT , L T , 1) GO TO 70 WBITE (6,290) WBITE ( 6 , 300) ( (NAMEB ( J , I ) ,J=1,5) ,RR (I) , AINIT (I) ,1=1 ,NRT) 70 I F (IMX .LT. 1) GO TO 80 WRITE (6 ,,320) WRITE (6,3 30) WRITE (6,230) ( ( I M ( J , I ) ,J=1,5),1=1,IMX) 80 IF (ISX .LT. 1) GO TO 90 WHITE ( 6 , 320) WRITE ( 6 , 150) WRITE (6, 250) ( (IS (J , I) , J= 1 , 2) , 1= 1,1 SX) 90 IE (IGX . LT. 1) GO TO 1.00 WRITE (6,320) WRITE (6,130) WRITE (6,230) ( (IG (J ,1) , J= 1 ,5) ,1= 1, IGX) 100 WRITE (6,310) 132 1 10 DG 110 I = 1 , NC IF (HOA(.I) .EQ. 1 .AND. NDX (1,2) ..EQ. 0) WRITE (6,160) TOTW(I), 1 (INPUT (0,1) ,J=1,60) IF (HOA(I) .EQ. 0 .AND. NDX (1,2) . EQ. 0) WRITS (6,170) TOTM(I), 1 (INPUT ( J , I ) ,J=1,60) IF (NDX ( I , 2) . EQ. 1) WRITE (6,180) TOTB(I), (I NP UT (0,1) , J= 1 ,6 0 ) I F (NDX (1,2) .EQ. 3) WRITE (6,190) TOTM (I) , (INPUT ( J , I ) ,J=1,60) CONTINUE • 120 130 140 150 160 170 180 190 200 210 220 230 240 250 2 60 2 70 280 W R I T E .(6,320) WRITE (6,140) (TITLE (I) ,1=1,40) RETURN . FORMAT {/,' «• THE FOLLOWING GAS(ES) HAVE BEEN SUPH ESSED», /) POEHAT (*1», 20A4, / , 2 0 A 4 , //) -FORMAT (/, » THE FOLLOWING AQUEOUS SPECIES HAVE BEEN SUPSESSED', / 1 ) : "•' FORMAT (» ', FORMAT (' «, FOEM AT (' ' , FORMAT {' «, D15.8, * LOG ACT.', 5X, 60A1, • (AQUEOUS SPECIES) ' , /) D15.8, ' MOLALITY • , 5X, 60 A 1, ' (AQUEOUS SPECIES)', /) D15.8, ' G:SAMS •', 5X,,60A1, '(SOLID)', /) 5X, 60A1., 1 2 3 4 5 6 D15.8., ' LOG ACT. ' , 5X, 60A1., ' (GAS) « , /) FORMAT (2F10.3, 15, F10.3, 5 l 5 ) . FORMAT (2A4) • -."' FORMAT (F5.3, 5X, F10.5, 5X, 5A4) FORMAT (3 (5A4,5X) ) ' FORMAT (20A4) FOBMAT (4 (2A4, 12X)) FORMAT (212, E10.3, .60A1) FORMAT ('.,1 - ******** D.ATA ECHO FORMAT (//, ' TEMPERATURE (KELVIN) OF THIS BUNTS /, • PRESSURE , (BABS) OF-THIS BUN IS ...... //, ' MAXIMUM NUMBER OF. STEPS IS .......... , ' NUMBEB•OF STEPS BETWEEN EACH PRINT OUT IS * ION CHOSEN FOR ELECTBICAL BALANCE IS ...... /, • MOLES OF SOLVENT H20 IN" SYSTEM IS ********* t • » » » • * * 4 //) m * .• * F8. 2, F3.2, ' 16, ./ , 16, //, 1X, 2A4, ' , F 10 . 6 , 300 3 10 320 330 290 FOBMAT (/, ************** INITIAL BE ACT ANTS ***********», /, 26X, 1 . . '.RATIO PRESENT'., 8X, ' GBAMS PRESENT' , /,) . FOBMAT (/, 1X, 5A4, 5X, F10..5, 10X, F10.5) .FORMAT (//, ' ************* INITIAL SOLUTION CONSTRAINTS ********** 1* //) FORMAT {/, • ******************************' •) FOBMAT (/, ' THE FOLLOWING MINE R AL (S) HAVE. BEEN SUPRESSED', /) E N D SUEBOUTINE BREAD (NNNI, DIP,*) INTEGER N (25) INTEGEE*2' DIP ( TOO) , OU.( 100) , NN NI LOGICAL*! LTPPY(200), L.LNN(100), ELANK EQUIVALENCE (LLNN (1) , N (1) ) , (LIPPY (1) ,OU (1) ) DATA ELANK /• '/ READ (3,4Q,END=30) NNNI, N DO 10 1= 1 , 100 J = I * 2 - 1 K = I * 2 L I P FY (J) = LL NN (I) L I P P Y (K) = ELS NK 10 CONTINUE C DO 20 I = 1 , 1 0 0 DIP (I) = OU (I ) 20 CONTINUE ' ' C RETURN -30 EETUEN 1 40 FOEMAT ( A l , 40A4) END SUBROUTINE BWITE (NDU M , I S I Z E ) INTEGEE*2 N CUM ( I S I Z E ) WRITE { 19, 10) NDUM • , RETURN 10 FOEMAT (50A1) ' END SDEROUTINE REEAE (NNDUM, I S I Z E ) INTEGER NNDUM(ISIZE) READ (19,10) NNDUM EETUEN 10 FORMAT (20A4) END SUBROUTINE STRA (TEMPER, TK,. PAR) I M P L I C I T REAL*8 (A - H,0 - Z) . C THIS ROUTINE ASSUMES A LINEAR RELATION BETWEEN TWO POINTS AND C FINDS C THE POINT S P E C I F I E D BETWEEN THEM. ' DIMENSION TEMPER ( 8 ) , T E (8) LATA TE /O.ODOO, 25.0D00, 60.0D00, 100. 0D00, 150.0DOO, 200.0DOO, 1 250.ODOG, 300.0D00/ • T = TK - 2.73150D+02 IA A = 0 . IB B = 1 0 0 0 IF (T .GT. TE (8)) J = 8 I F (T .GT. T E ( 8 ) ) GO TO 20 I F (T .LT. TE (1)) J = 1 IF (T .LT. I E (1)) GO TO 20 DC 10 J = 1, 8 I F (T .EQ. TE ( J ) ) GO TO 20 I F . (T . GT. T E ( J ) • AND. IAA .LT. J) IA A = J I F (T .LT. T E ( J ) . AND. IBB .GT. J) IBB = J 10 CONTINUE • SLOPE = '(TEMPER (IAA) - TEMPER (IBB) ) / (TE (IAA) - TE (IBB) ) ' AINTE = TEMPEB (IAA). - SLOPE * TE (IAA) PAR = T * SLOPE • AINTE EETUEN " . • • 20 PAR .= TEMPEB (J) RETURN END SUBBOUTINE TRANS(B, IBET,*) I M P L I C I T REAI*8 (A - H,0 - Z) c e c c c c DIMENSION B (20*200), BASIS (20,20), TEMP(20) COMMON /PATEAT/ NDX (200,2) , COMPM (20 , 200) , AZERO(200), GHIN(200), 1 J 4 1 GSO.L ( 2 0 0 ) , GGAS ( 1 0 ) , COM PS (2 0, 20 0) , Z ( 2 0 0 ) , BR (20), 2 COMPG (20 ,10) , WGHTM (200) , ¥GHTS(200) , WGHTG (10) , GNEUT (4) , . 3 P, T, ADH,' BDH, BDCT, AMH.20, ALMH20, N AM EM (5, 200) , 4 NAMES (2, 200) , NAMEG(5,10), NAMES (5, 20), MOA (20 ) , 5 ISEACT(20), NMT, NST,- NC, NGAS, .NET, MAXI, NDLINC, INION, 6 NK NCZ - NC + 1 DO 80 I = 1, NC ISW = NDX ( 1 , 2 ) + 1 DO 40 J = 1, NC GO TO ( 10, 20, 20, 3 0 ) , I S i ; ; 10 . EASTS ( J , I ) =. COMPS ( J , NDX ( I , 1) ) GO TO 40 20 EASTS (J,.I) = COMPM (J,NDX (.1,1) ) GO TO 4 0 . 30 EASTS (J,.I) =. COMPG ( J , NDX (1,1)) 40 CONTINUE ; GO TO (50, 60, 60, 70), ISW 50 BASIS (NCZ,I) = GSOI (NDX (1,1) ) GO TO 80 60 BASIS (NCZ, I j •= GMIN (NDX ( 1 , 1 ) ) GO 1 0 80 70 . BASIS (HCZ,I) = GGAS (NDX ( I , 1)) 80 CONTINUE " . DO 9 0 J = 1, NC BASIS (J ,NC2) =0.0 90 CONTINUE EASTS (NCZ,NCZ) = 1. CALL INVBT(EASIS, NCZ, 5330)' DO 100 I = 1, NCZ DO 100 J = 1, NCZ ' 7 IE (DABS (BASIS ( I , J) ) • LT. 1.0D-13) BASIS(I,J) = O.ODOO 100 CONTINUE DO 110 J = 1, NST COMPS(NCZ,J) = GSOI(J) 1 10 CONTINUE . . • DO 160 K = 1 , NST DO 120 1 = 1 , NCZ 120 TEMP (I) = 0 . 0 • , ' "' . DO 1 4 0 1 = 1 , NCZ DO 130 J = 1, NCZ " • TEMP(J) = TEMP(J) + BASIS ( J , I) * COMPS (I,K) 130 . CONTINUE o © Q O • o o o Q O t o Ui o o © o o o o o © • -o Ui o o o o • © CU ST, r a H IS) U £ 3 E ca fcH E CU El O u CM B w H • to U S3 cu B (a EH •UJ cu c u H S3 pa-EH i Q O I o o H CO H «* 03 I Q O ro i n o th «* ca l a o » * • . O t EH EH + EH EH fcH t-3. .—. t J 1-3 CN ,—, t-3 • • © f • © • — » © . — . O © H —•» S3 C-3 H , N IH t n w . » « . IS! M u a . *—* tsi <•*' U Cu . , H CM c-3 u S3 • IS) SN S3 C-3 CM CS) u O U> CO CS3 S3 E C-3 H c j S3 U S3 © u C J w u B u S3 U> cn u> t o U u i a U ~" S3 CM pa S3 "-' EH EH S3 S3 fe S3 CM t a - S3 •—" <* S3 S3 fe 53 -CM B EH CM E II B r — E CM ««•». UJ 1! UJ T — E % i a CM E S3 ^5 » o ' fe II . * f a Cw B T — S3 S3 fe O fe • | l •» r a t — EH II B i a T — t II T — EH II E f a «—» • r— 1! « - EH • ^ I U fcH fe r j fe' o m fcH t •> © fe © • II t n «»fe EH T— . fe r* II II rs © Pa II t o —, EH fcH fe II 11 © © i a II cn 03 m »—' II CSJ II © HJ Ui •—» II i-3 IS] II- D CQ t a H % cn II u 1! H H o CM S3 t a H «6 CO » II U II H H o CM S3 r a © Q H CQ —> 53 a> E H © Q H CP S3 i n s M © © S3 © • w r a © c a O H o i a . EH S3 O > » ' * * " " «* fc3 ( a t n © — pa i a © H © CN r a EH S3 o — H i n cn Q © E © oo *- o EH S3 M T— E © — © «6 UJ © ^ * fcH S3 H r -i a U l I—I S3 © P4 S3 o *~ CM CN O o EH' ( N f a CM . *—• S3 S3 UJ o I^ M S3 © CN U J CN o ' O ' ; E H C N i a S3 B o M P- E H C N S © u S3 H E M H 53 ro B H CO ' E © u S3 o o O i a tn E H »— o. EH C N o t a o o o O CM S E - i • CN O EH CN O i a O o o U Q H U) S3 u S3 a EH n u © u H UJ S3 U S3 Q fcH © C J Q o o Q O Q i n O o o u Q U © u M • © u © o o o o o o o o o © o o o i n \ o r» oo OV o • CN m m vO •— «— T — CN CN CN CN C N C N tJ u u C J C J u u N K Q I C O HI*'H si. isawaia.wnwixsw ama " D • . • ' . D ************************* ****************D H ' L = • » o n oa *************************************************************** **#*D D • X I B I Y H s H i N I a a a o i s a a , a a a s o N H n i c e a aaoaa I H I H U M H I Y B o t D a a N H i i i a u a s ? v H S A Q s a n i S H . s i . asaaAST-v, •« ao a s a a A H i am' aoa D 3 A I O S G I o as? T ao s a s f f S A N i a H i 16 H o i i Y O i T a r i m n i a aauoT D . - i O d .(s3Di.s¥» i v i i i s s f i a j , aaaao os¥ Hanoi i i s n I H I a BY n o o i D aaaett) soiiisodwoDaa D M ? N s a a a o H U B V- X I S I V W 3 0 H O I S B 3 A H T D - • • ' • • • • . • . ' / : D ************************************************** ************* ****D ei-ao u = m n . (ozldi Mos'os) ? N o i s s a w i a ( Z - O'H - ¥) 8 * 1 ? 3 H i i D n a w i (*'N 't')iaANT a N i i Q o a a n s . O N I d . :as¥ siNaso-dHOD'asa-Hi ' * i s ¥ G S 3 d a a s i l a ' i o H i z ' i i s n u - s i s f e . . aas 3H£ a o a i r ' o i aasssa SMN3Roawo3 3H £ i t Sasiinoa 3 s a a A s i woaa a a N a n i a a ' X I B I Y H a v i n D N i S i ) £¥waoa 0 9 E ( i r«s) I Y H S O J - O S E d O I S . a i l N I i N O D 0t?E (g'i=rM t t'i)xas'r}f>aii?H> (ose'9)' S I I B H (e "Da* ( j * i ) x a H ) a i tS' t =f.M (t ' I ) XGIf'r) H 3 H Y K ) (ffSE '9) • 3EIBB (L *03* ( Z ' l ) x a H ) 31 (z'i=r-J (Ct' i i ) x a . N ' r ) s 3 K v . i i i ) C O S E ' 9 ) a i i H M Co *Da* ( s ' i ) x a K ) ar DN * I - I 0 tre DO ( 0 9 E ' 9 ) a i l f f f l t •HffD.M.B Co *IO' I Z B I ) 31 O E E N 3 013 3 . WIT +.Z + DS = M 30HIIN0D ' 0 2 E 0 = (Z ' K I T + D N ) X • M" = (t 'WET + DS) X Q N • . • • a n s i i s o D , OLz • ( M ' D sdHOD = ( s n ' r ) a DS 'i = r 01E 03 D L + W I T = H I T D SnSIISOD OOE OSE o i o a (o *oa * (zfr)xa'N •amf • » *0s* ( i ' e ) x a s ) a i . . DN 'L = C 0 0 E 0 0 D i S N * l = M OSE oa D .0 = WIT • , a n s i i s o D OBS aOR'XIKCO 0 8 2 (ZDN)awai; = ( M ) S V O D OOGO'O = ( Z D S ) d W 3 £ ( E t -GO *L ' i l * ( (ZDN) d H I I ) SfffQ) 31. D (l ) d W 3 L = (M.'l)DdWOD OLZ 3 ***********************,****** *********************^ £ * a wax = (r' a ) v . 08 ************************* **************** **** ****************** ****D D ( S ' M I V i f f BOS -HI*X j a i A I T 3 D ***************************************** ***************** *********D . a w a i = ( r ' M) ? oz. (r ' a ) ? = (r'X¥Ki) v 08 01 oo ( x o i "Da" >:) ai (r'xvwi) ¥ '= a w a i *******************************************************************3 • ' • • 0 x v H i - a m » SEOS a s N V H o a a i N i D ***************************************************************#***3 ooi O L oo (y 'Da* c) ar N *i = r ooi oa D 3 UK I I SOD 09 •£ * (a*i.) \f- .= (X'I) ? • N ' l = I 09 oa 0 • oao*l- = (M*H) V (H'M) v = (x'xvwr) (H'XVHI) V / * I = I 05 *******************************************************************D D (M'H) ¥ A3 M08 HI*M B C I I A I O " 3 3 *******************************************************************D X t f H I = (H)cTI ************************************************************** *****D D XVHI asv. a- SMOS; a o M H D a a i o D D ************************************* *:*****************************D t 'SffQias (wnx * n * (xvwvJsevaJ a i ot? ********************************************************** *******:**D 3 i i i s ' v i Q & N i s cioa L s a i D 3 ***************************** ********************* *****************3 3QNIIN03 0£ I =•• XVWI HTV = xvwe oz Oe OI OS (XYRV " E T MI¥) I I C(» Ji) «) sava = »r« N 'an = i OE oa D L + M = d M 01 •017 O i O D (N *Da • a ) a i H = X9RI ( (M'M) s a v a = xsm *************************************************** ** **************3 3 8CT ZD N 'i = a oi oa • , 0*0 = a u i M Z D N ' i = i oe oa (SNfiOHXHQ Z 3 R i S d i a ) *DI3 S8V3N INSNOdRDD EOS 3A10S D I - DN = L DN ZDN - Mtt = X8 Z + D N = ZDR i R i a d i ' H i a r ' a o H i? *id.s J £ v s i ' i x i a a K ' (oz) aoffdi 'ixiaa 'ix ' o i ¥ * ( o o z )isaav c ' (ooz) aasff* '(ooz)sisv. ' (u'ooz)ax ' ( O O Z ' O Z ) M M o z * o z ) s « z '(OOZ)DO ' ( 0 0 Z ) 3 A S 3 *(0Z)AD0 M 0 0 Z ) A D ' ( t r ' OOZ) X ' (OZ ' 00 Z ) 3D t ' (ooz)sa Moz ' oz ) ? ' (ooz'oz)aa '(ooz)sD '(ooz)wo /MEMO/ HOHHOD ' £1X130 J I H d I X '£3313 ' I X ' ( O Z ) S ¥ D ¥ ' ( O Z ) S Y D l ? ''(OOZ) dSS Z '(ooz)Nt ' (ooz)Rddx Moz) wioi ' (ooz'ozJa M O O Z l O U I ' (OOZ) 3 ' ( O O Z ) Y T Y M O O Z ) £DY . 1"(o'OZ>9TI ' ( 0 0 Z ) D '/IDKOOA SOHHOD-xti 9 'NO IK I ' DNT1 GN 'IXVK '1HN 'SYDN 'DM 'ISN 'IWN M0Z)lDVZHT. . ' S ' ( o z ) ¥ O K ' (oz*s)-aaH¥« ' ( o i ' S ) D 3 R Y H * (ooz'z) sa»vir +/ ''(obz-s) uauvH 'QZHWTV ' O Z H H S *ioaff 'HOC 'HOY * I 'a e ' ( f 7)£fi3ND J(0L)'9iH9M ' (00 Z ) SSHDM J (0.0'Z) HIHDM ' (01 ' 0Z> S3 HOD Z '(OZ)SS '(OOZ)Z M O O Z ' O Z ) S3R0D ' (Ot) S ¥ D 9 ' (OOZ) TOSS I ' ( O O Z ) N I W D ' (ooz)oaazv ' Mooz'oz) HdHOD ' (z'ooz) xa's / I \ f a i V d / NOHWOD . (Z - O'H - ¥ ) 8 * T « a a i T D I l d H I . ( S G N ) A T os. AO 3'NiiQoaans . ana .Manias D ao'.Hiinoo 091 D - aONIINOD 0*71 I :=• (a'D ¥ (a'D ¥ > (r'D ¥ (C'D ¥ = I N ' L = I ot? t 00 0£l D osi o i OD (a *Da * r) ai (a) 31 = r oz i MM - H = H IWN ' l = MH 0 5 1 oa 3 t - H = t W S ************************* ************************* ************* ****D 3 3 S H 3 A O 3H£ HI SaQBO -HR(11.03 833083 aa'OXSia D 3 *******************************************************************D 3 0 HI £ NOD O i l D aOSTLHOO 001 ' D SfiHIINOD 06 (a'l>¥ * dU3£ + ( f ' l ) ? = (C'l)¥ 06 0 £ OD (a *03*' I ) a i U ' i - 'I 06 OQ *********************************** D sao a a a H i o wo aa ROE H i * a sawix (a'r)¥ i D s a i a a s D 10 20 30 ATEMP + WS ( I , K) •* CV (K) 1, NX ATE HP + « (.I,K) * CV (NC2 + K) = ATEMP UNKNOWNS 40 50 * XD(I,NDS) ATEMP = CONTINUE DO 2 0 K = AT EBP '•= CONTINUE XD{I,NDS) CONTINUE SOLVE FOR fiEMAINING DO 50 J ,= 1, NX ATEMP = 0.0 > DO 40 I = 1, NC2 • ATEMP = ATEMP + C C ( J , I ) CONTINUE X D { N C 2 + 3, NDS.) •=. C.V-(H'C2 +.3) - ATEMP CONTINUE ' RETURN ,-. , ' • ' END SUBROUTINE. STEP TAKES DELXI STEP FOB AQUEOUS SPECIES I M P L I C I T R E AL * 8 (A - H,0 - Z) COMMON /PAT DAT/ NDX {200, 2) , COM PM (2 0 , 200) , AZEBO(200), GMIN{200). GSOL (200) , GGAS (10). r COMPS (20, 20 0) , Z ( 2 0 0 ) , SR.(20) , COMPG ( 2 0 , 10) , WGHTM(200), WGHTS{200), WGHTG-(IO), GNEUT (4) P , T , ADH, BDH, BDOT, AHH20, A.LBH20, NAMES (5,200) , NAMES (2,200) , NAMEG (5, 1 0) , NAMER ( 5 , 20) , MOA (20) , IREACT (20) , NMT, NST,. N C N G A S , NRT, MAXI, NDLINC, INION, NK ' COMMON /CON.CT/ G ( 2 0 0 ) , ALG (200)', A C T ( 2 0 0 ) , ALA (200) , C (200) , ALC ( 2 0 0 ) , B ( 2 0 , 2 0 0 ) , TOTM ( 2 0 ) , XPPM (200) , TN (200) , GSP (2 00) , ALGAS (20 ) ., AGAS (20) , X I , ' ELECT, XIPRT, COMMON /CARSAY/ QM(200) , QS (200) , BB (20,200)', A (20,20) , CC (200,20) , X ( 2 0 0 , 4) , C V { 2 0 0 ) , U C V { 2 0 ) , CSVE (200) ,.'DC (200) WS(20,20)', W ( 2 0 , 2 0 0 ) , X D { 2 0 0 , 4 ) , ASYS.{200) 13 9 DELXIT DN{200) , AM ADE (200) , A 1 G , X L , I P R I N T • GO TO 20 ADEST {200) NOD, I F I N , NC2 = N C + 2 NC 1 = NC - 1 SX = NK - NC2 -10 DO .20 I = 1 , NC 1 K = NDX ( I , 1) ' IF.' (NDX (1,2) . NE. 0) CALL. MOVST (ATEMP, J ) C(K) '••= CSVE(K) + ATEMP I F (C (K) .LT, O.ODOO) GO TO 40 ALC (K) = DLOG10 (C (K) ) 20 CONTINUE . DO 3 0 I I = 1, NX K = NDX ( I I * NC, 1) I = NC 2 + I I •; -.';.'. CALL MOVST (ATEMP, I ) C (K) = CSVE (K) + ATEMP I F (C (K) . L I . O.ODOO) GO :TO I F (C(K) . IQ. O.ODOO) CALL SPEC.LG I F (C(K) .GT. O.ODOO) ALC (K) 30 CONTINUE CALL MOVST(ATEMP, NC2) ACT (NDX (NC, 1) ) = CSVE (NST * 1) D E L X I , IPROD ( 2 0 ) , NDELXI, I S A T , NPT 40 (K) = DLOG10 (C(K) ) + ATEMP IF (ACT (NDX (NC, 1) ) . I T . O.ODOO) GO TO 40 ALA (NDX (NC, 1) ) = D.IOG 1 0 (ACT (NDX (NC, 1) ) ) CALL MOVST (ATEMP, NC) AMH20 = CSVE (NST + 2) + ATEMP IE (AMH20 .LT. O.ODOO) GO TO 40 ALMH20 = DLOG10(AMH2C) EETUEN 40 DELXI = DELXI / 10.0DO0 GO TO 10 END SUBROUTINE DEBIV ROUTINE TO CONVERT LOG DERIV. TO DERIV. IMPLICIT RE AL*8(A - H,0 - Z) COMMON /PAT DAT/ NCX{200,2), COMPM (20, 200) , , AZERO (200) , GMIN(200), 1 GSOL(2O0), GGAS ( 1 0 ) , COMPS (20, 200) , Z ( 2 0 0 ) , RR(20), 2 COMPG (20 , 10) , WGHTM (200), WGHTS(200), WGHTG (10), GNEUT ( 4 ) , 3 P, T, ADH, 'BDH, BDOT, AMH20, ALMH20, NAflEM (5, 200) , 4 NAMES (2, 200) , NAMEG ( 5, 1 0) , HAHEB(5,20), MOA (20) , 5 IREACT(20), NMT, NST, NC, NGAS, NRT, MAXI, NDLINC, IN ION, 6 NK COMMON /CONCT/ G (200) , ALG (200), ACT (200), ALA (200), C (20.0) , . 1" ALC (200) , B (20,200) , TOTM (20) , XPPM(200), TN(200), 2. GSP(200), ALGAS{20), AGAS (20) , X I , ELECT, XIPRT, DELXIT COMMON /CARRAY/ QM(200), QS (200) , BB{20,200), A (20,20), DN (200) , 1 CC(200,20), X(200,,4), CV.(200), UCV(20), CSVE(200), DC (200) 2 WS(20,20), W(20,2OO), XD(200,4), ASYS (200.), A MADE (200) , 3 ADEST(200), A10, XL, DELXI, IPBOD(20), NDELXI, ISAT, NPT, 4 NOD, IJIN, IPRINT NC2 = NC *• 2 NC1 = NC - 1 NX = NK - NC2 DO 50 J = 1, NOD AJ = J DO 20 I = 1, NC 1 K- •= NDX (1,1) IE (NDX (1,2) .NE. 0) GO TO 10 CALL DTLGD (C (K) , I , J) , GO TO 20 10 X ( I , J) = XD (I,J) 20 CONTINUE .. ' DO 30 I I = 1, NX 1 K = NDX (NC * I I , 1) ' , I = NC2 + I I CALL DTLGD (C (K.) , I , J) 30 CONTINUE X (NC + 1, J) = XD (MC + 1 ,J) I = NC CALL DTLGD(AMH20, I , J) 40. I = NC 2 CALL DTLG.D (ACT (NDX (NC,1) ) , I , J) 50 CONTINUE ' EETUEN END ' SUBROUTINE MOVST (ATEMP, I) I B I L I C I T EE AL*8 (A - H,0 - Z) COMMON /PATEAT/ NDX (200, 2 ) , COMPM (20,200) , AZERO (200) , GMIN(200), 1 GSOL (200), GGAS ( 10) , COM PS (20, 20 0) , Z{200), RR(20), COMPG{20, 10} , WGHTM (200) , WGHTS (200) , P, T, ADH, BDH, BDOT, AMH20, A.LMH 20, WGHTG ( 10) , NAMEM ( 5 , 200) JNEUT (4) 141 . NAMES ( 5 , 2 0 ) , MOA{20) NGAS, NRT, MAXI, NDLINC, INION DELXIT A (20 ,20) , DN (200) , C V { 2 0 0 ) , 0CV-(20), CSVE(200) , DC (200) , W ( 2 0 , 2 0 0 ) , X D ( 2 0 0 , 4 ) , ASYS ( 2 0 0 ) , AMADE ( 2 0 0 ) , , A 10, X L , D E L X I , I P B Q D ( 2 0 ) , N D E L X I , I S A T , NPT, IP E I N T 10 20 * DELXI BTEMP / A N NAMES ( 2 , 200) , NAMEG(5,10) I R E A C I ( 2 0 ) , NMT, NST, NC, NK COMMON /CONCT/ G ( 2 0 0 ) , ALG ( 2 0 0 ) , ACT ( 2 0 0 ) , ALA ( 2 0 0 ) , C (200) ALC ( 2 0 0 ) , B ( 2 0 , 2 0 0 ) , TOTM (20) , X P P M ( 2 0 0 ) , TN(200) GSP ( 2 0 0 ) , A L G A S ( 2 0 ) , AGAS (20) , X I , ELECT, X.IPBT, COMMON /CASE Vi/ Q M ( 2 0 0 ) , QS (200) , B B ( 2 0 , 200) CC (200,20) , X (200,4) , WS(20,20) , ADEST (200) NOD, I f . I N , ATEMP = O.ODOO AN = 1.0DOO DO 2 0 J = 1, NOD AJ = J AN = AN * AJ ETEMP = X ( I , J ) DO 10 I I = 1, J ETEMP = ETEMP CONTINUE ATEMP = ATEMP + CONTINUE RETURN END SUBROUTINE CTLGDJXXX, I , J) I K E L I C I T REAL*8(A - H,0 - Z) COMMON /PATDflT/ NDX ( 2 0 0 , 2 ) , COMPM (20,200) , A Z E E O ( 2 0 0 ) , G M I N ( 2 0 0 ) , 1 GSOL (200) , GGAS ( 1 0 ) , COMPS (20, 200) , Z (200) , BR (20) , 2 COMPG (20 , 10) , WGHTM ( 2 0 0 ) , WGHTS ( 2 0 0 ) , WGHTG ( 1 0 ) , GNEOT (4) , 3 P, T, ADH, BDH, BDOT, AMH20, ALMH20, NAMEM (5,200) , 4 NAMES (2,200) , NAMEG (5,10) , NAMES ( 5 , 20) , MOA( 2 0 ) , 5 I R E A C T ( 2 0 ) , NMT, NST, NC, NGAS, NRT, MAXI, NDLINC, I N I O N , 6 NK COMMON /CONCT/ G ( 2 0 0 ) , ALG ( 2 0 0 ) , ACT (200) , ALA ( 2 0 0 ) , C (200) , 1 ALC ( 2 0 0 ) , B ( 2 0 , 2 0 0 ) , TOTM (20) , XPPM ( 2 0 0 ) , T N ( 2 0 0 ) , 2 GSP (200) , A L G A S ( 2 0 ) , AGAS ( 2 0 ) , X I , ELECT, X I P E T , DELXIT COMMON /CAREAY/ Q M ( 2 0 0 ) , QS (200) , BB(2O, 2 0 0 ) , 5 ( 2 0 , 2 0 ) , DN (200) , 1 CC(20O,2O), X ( 2 0 0 , 4 ) , CV (200) , UCV (20) , C S V E { 2 0 0 ) , DC(200) 2 WS (20,20) , W ( 2 0 , 2 0 0 ) , XD<200,4), ASYS ( 2 0 0 ) , AMADE ( 2 0 0 ) , 3 ADEST ( 2 0 0 ) , A 1 0 , X L , D E L X I , I P E O D ( 2 0 ) , N D E L X I , I S A T , NPT, 4 NOB, I F I N , I P E I N T ATEMP = XXX * XD ( I , 1 ) AJ = J IE { ( J - 1) , EQ. 0.0 .AND. X D ( I , 1 ) . EQ. 0.0) GO TO 10 ATEMP = ATEMP * ( X D ( I , 1 ) * * ( J - 1)) 10 X(.I,J) = ATEMP I P ( J . L E . 1) GO TO 50 ATEMP = XXX * XD (1,2) BTEMP = A J * (AJ - 1.0D00) / 2.0D00 I F ( ( J - 2) .EQ. 0.0 .AND. X D ( I , 1 ) . EQ. 0.0) GO TO 20 ATEMP = ATEMP * ETEMP * ( X D ( I , 1 ) * * ( J - 2 ) ) GO TO 30 20 ATEMP = ATEMP * BTEMP 30 X ( I , J) = X (I» J) + ATEMP I F ( J . L E . 2) GO TO 50 40 ATEMP = XXX *. XD (1/3) IF ( (J - 3) . EQ. 0.0 ..AND. XD(I,1) . EQ. 0.0) GO TO 40 ATEMP =• ATEMP * (XD { I , 1) * * ( J - 3) ) ETEMP = AJ * (AJ - 1.0DOO) * (AJ - 2.OD00) / 6.GD00 X ( I , J ) = X ( I , J ) + BTEM P * ATEMP. . L E . 3) GO TO 50 = ' XXX * XD (1,2) = ATEMP * X D ( I , 2 ) = AJ .* ( A J - 1.0D00) 50 I F ( J AT EM P ATEMP BTEMP 10100 x d , J ) ETEMP ATEMP X ( I , J ) EETUFN END SUBROUTINE JUMP I M P L I C I T EE AL*8 (A - H,0 COMMON /P-ATEAT/ NDX (200,2) G S O L ( 2 0 0 ) , GGAS(10) * (AJ - 2.0D00) * (AJ - 3.0D00) / = X ( I , J ) * BTEMP = BTEMP / 3.0D00 = XXX * XD (1,4) • ' = X ( I , J ) + ATEMP * ATEMP * ETEMP " Z) COMPM (20, 200) COMPS (2 0 , 200) AZERO (200) , GMIN(200) , 1 G S O L { 2 0 0 ) , G G A S f l O ) , 0,2 , Z ( 2 0 0 ) , R R ( 2 0 ) , 2 COM PG (20 , 1 0) , WGHTM ( 2 0 0 ) , WGHTS ( 2 0 0 ) , WGHTG ( 1 0 ) , GNEUT ( 4 ) , . 3 P, T, ADH, BD H, BOOT, AMH20, ALMH20, NAMEM (5, 200) , 4 NAMES ( 2 , 200) , NAMEG(5 , 1 0 ) , NAMEB (5,2 0 ) , MOA (20)., 5 I R E A C T ( 2 0 ) , NMT, NST, NC, NGAS, NBT, MAXI, NDLINC, INION, 6 NK COMMON /CONCT/ 6 (200) , ALG (200) , A C T ( 2 0 0 ) , ALA (200) , 'C (200) , 1 ALC (200) , B ( 2 0 , 2 0 0 ) , TOTM (20) , X P P M ( 2 0 0 ) , T N { 2 0 0 ) , ,2 G S P ( 2 0 0 ) , A L G A S ( 2 0 ) , AGAS (20) , X I , ELECT, XI P R T , DELXIT COMMON /C ARRAY/ QM (200) , QS (200) , B B ( 2 0 , 2 0 0 ) , A ( 2 0 , 2 0 ) , DN (200) , 1 CC (200,20)', X ( 2 0 0 , 4 ) , CV (200) , U C V ( 2 0 ) , CSVE (20 .0 ) , DC<200) 2 WS{20,20), W (20,200) , X D ( 2 0 0 , 4 ) , A S Y S ( 2 0 0 ) , AMADE (200) , 3 ADEST (200):, A10^ XL, DE L X I , I PROD (20) , NDELXI, ISAT, NPT, 4-- NOD, I F I N , I P R I N T DIMENSION SK (200) NC2 = .NC + 2 N NC1 = NC - 1 :' ; ' . NX = NK - NC2 DO 10 I - 1, NST SK (I) = QS (I) 10 CONTINUE 20 CALL STEP • . CALL XICALC (C, Z, ELECT, NST, XI) CALL GAMMA ( X I , ADH,' BDH, BDOT, NST, 1 ACT, NDX, X L , ALG) CALL ACTIV • I I . = 0 , " DO 3.0 !•'=. 1 , NST ATEMP = CAES (QS (I) - SK (I) ) ' I F (ATEMP .GT. 5..0D-5) GO TO 40 IF', (ATEMP .LT. 5.0D-6) 30 CONTINUE GO TO 5 0 40 DELXI = DELXI / 10.0DQ0 ' GO TO 20 50 CONTINUE I F ( I I .NE. NST) GO TO DELXI = DELXI * 2 i 0 D 0 0 NC, AZERO, Z, GNEUT, G, C, I I =' I I + 1 60 0 .08. NDX (1/2) . EQ. 3) GO TO 80 NST, XI) BDOT, NST, SC, AZEBO, Z, GNEUT, G-, C, GO TO 2 0 60 CONTINUE 70 DC 8 0 1 = 1 , NC1 I F (NDX (1,2) .EQ. K = NDX (1,1) IK = I CALL MO VST (ATEMP,. I ) I F ( ( A S Y S ( K ) + ATEMP) . I T . O.ODOO) GO. TO 90 80 CONTINUE GO TO 1 10 90 D E L X I = DELXI / 2..0D00 CIV = DELXI 100 DIV = DIV / 2 i 0 D 0 0 CALL STEP CALL X I C A L C ( C , Z, ELECT, CALL GAMMA ( X I , ADH, BDH, 1 ACT, NDX, XL, ALG) CALL ACTIV CALL MOVST ( ATEMP,' IK) BTEMP = ASYS(K) • ATEMP I F (LABS(BTEMP) .LT. 1.0D-12 .AND. BTEMP..GT. O.ODOO) 1 GO TO 70 I F (ETEMP .LT. O.ODOO) I F (BTEMP . GT. O.ODOO) GO TO 100 110 CONTINUE DO 130 I = 1, NET. • K = IEEACT (I) BTEMP = ASYS(K) - BS (I) * DELXI I F (BTEMP .LT. 0.0D00) GO TO 120 GO TO 130 120 DELXI = ASYS(K) / EE (I) 130 CONTINUE BTEMP = DLOG 10(DELXIT I F (BTEMP .GT. XIPRT) XIPET) XIPET) DELXI = DELXI -DELXI = DELXI + DIV DIV 1 I F (ETEMP .GT. I F (BTEMP. . GT. CALL STEP CALL XICALC (C, CALL GAMMA(XI, ACT, NDX, ACTIV + DELXI) IPEINT = DELXI = (10.0D00** (XIPET) ) - DELXIT XIPBT = XIPET + .2 5D00 NST, XI) BDOT, NST, NC, AZEEO, Z, GNEUT, Z, ELECT, ADH, BDH, 1 CT, XL, ALG) C ALL EETUEN E KD SUBEODTINE DI(ATEMP, NDT) ' . I M P L I C I T SEAL*8(A - H,0 - Z) COMMON / P AT D AT/ N DX { 20 0 , 2) , COMPM (20 , 20 0) , A Z E E O ( 2 0 0 ) , GMIN(200) 1 GSOL (2.00) , GGAS (10) , COM PS (20 , 20 0 ) , Z ( 2 0 0 ) , RB (20) , 2 COMPG (20, 10) , WGHTM (200) , WGHTS ( 2 0 0 ) , WGHTG ( 1 0 ) , GNEUT (4) 3 P, T, ADH, BDH, BDOT, AMH20, ALMH20, NAMEM (5,200) , 4 NAMES (2,200) , NAMEG ( 5 , 10) , NAMES (5,20) , BOA (20),. 5 i a E A C T ( 2 0 ) , NMT, NST, NC, NGAS, NET, MAXI, NDLINC, INION, 6 NK COMMON /CONCT/ G (200) , ALG ( 2 0 0 ) , ACT ( 2 0 0 ) , ALA ( 2 0 0 ) , C (200) , 1 ALC (200) , E (20,200) , TGTM (20) , XPPM (200) , T N ( 2 0 0 ) , 2 GSP(200), ALGAS (20) , AGAS (20) , X I , ELECT, X I P E T , DELXIT COMMON /CARE AY/ Q M ( 2 0 0 ) , Q S ( 2 0 0 ) , B B ( 2 0 , 2 0 0 ) , 4(20 ,20), D N ( 2 0 0 ) , 1 0 0 ( 2 0 0 , 2 0 ) , X ( 2 0 0 , 4 ) , CV (200) , U C V ( 2 0 ) , C S V E ( 2 0 0 ) , DC (200) 2 WS (20,20) , W (20,200) , XD ( 2 0 0 , 4 ) , ASYS (200) , AHADE (200)', 3 ADEST ( 2 0 0 ) , A 1 0 , X I , D E L X I , I P E O D ( 2 0 ) , NDELXI, ISAT, NPT, 4 NOD, I F I N , I P E I N T NC 2 =.NC + 2 NX = NK - NC2 NC 1 - NC - 1 AJ = NDT A J1 = AJ * (AJ - 1.0D00) / 4.0D00 ATEMP = O.ODOO DO 4 0 I = 1, NC1 I F (NDX (.1,2) '.NE. 0) GO TO 40 K = NDX (1,1) I F ( D A B S ( Z ( K ) ) .LT. 1.0D-5 . OR. Z(K) . GT. 9. 99D00) 1 GO TO 40 Z2 = Z (K) * Z (K) * C (K) BTEMP = Z2 * XD ( I , 1) BTEMP = BTEMP * XD ( I , 1) I F ((NDT - 2) .EQ. 0.0 .AND. XD ( I , 1 ) .EQ. 0.0) GO TO.10 BTEMP = BTEMP * (XD ( I , 1) ** (NDT - 2 ) ) 10 ATEMP = ATEMP • BTEMP / 2. 0D00 I F (NDT . L E . 2) GO TO 40 ETEMP = AJ1 * Z2 * XD(1,2) I F ( (NDT — 2) . EQ. 0.0 .AND. XD (1,1) . EQ. 0.0) GO TO 20 BTEMP = BTEMP * (XD (1,1)**(NDT - 2 ) ) 20 ATEMP - ATEMP + BTEM E I F (NDT . L F . 3) GO TO 4 0 BTEMP = 2.0DOO * Z2 *' XD ( I , 3 ) I F ( (NDT -'3) .EQ: 0.0 .AND. X D ( I , 1) . EQ. 0.0) GO TO 30 , ETEMP = ETEMP •* (XD ( I , 1) ** (NDT - 3 ) ) 30 ATEMP = ATEMP + BTEMP . BTEMP = 3.0.D00 * XD (1,2) * (XD (1,2) *Z2) ATEMP = ATEMP + BTEMP / 2.0D00 40 CONTINUE - DC 80 I I = 1, NX , K = NDX ( I I + NC,1) I = I I + NC 2 I F ( D A B S ( Z ( K J ) . LT. 1.0D-5 .OR. Z(K) . GT. 9.99D00) ' 1 GO TO 80 /' . • ' ' Z2 = Z (K) * Z (K) * C (K) BTEMP = Z2 * 'XD (1,1) - ' ' BTEMP = BTEMP * X.D(I,1).. • '. IF ( (NDT - 2) . EQ. 0.0 .AND. XD ( I , 1 ) . EQ,. 0.0) GO TO 50 BTEMP = BTEMP * (XD (1,1) ** (NDT - 2 ) ) ' 50 . AT E MP = ATE BP' + BTEMP / 2. 0D00 '. I F (NDT . L E . 2) GO TO 80 BTEMP = AJ1 * Z2 * X D ( I , 2 ) . I F .((NDT ~ 2) .EQ. .0,0 .AND. XD(I,1) . EQ. 0.0) GO TO 60 ETEMP = BTEMP * ( X D ( I , 1 ) * * ( N D T - 2 ) ) 60 . ATEMP = ATEMP + BTEMP I F .(NDT . LE. 3) GO TO 8 0 BTEMP = 2.0D00 * Z2 * X D ( I , 3 ) I F ((NDT - 3) .EQ. .0.0 .AND. XD(I,1) . EQ. 0.0) GO TO 70 ETEMP = BTEMP * (XD ( I , 1) ** (NDT - 3 ) ) 70 ATEMP = ATEMP + BTEMP ETEMP = 3.0D00 * X D ( I , 2 ) * ( X D ( I , 2 ) * Z 2 ) ATEMP = ATEMP *• BTEMP / 2.OD00 c c c 80 CONTINUE RETURN END SUERCUTTNE 145 SECOND SECOND DERIVATIVE I M P L I C I T E E A L * 8 ( A - H,0 -COMMON /PATDAT/ NDX(200,2) GSOL (200) , GGAS (10) Z) COMPM (20,200) , COMPS (20, 200) , AZERO(200), G M I N ( 2 0 0 ) , •Z (200) , ER (20) , COMPG ( 2 0 , 10) , WGHTM (200) , WGHTS (200) , WGHTG {1 0') , GNEUT (4) , P, T, ADH, BDH, BDOT, AMH2G, ALMH20, NAMEM(5,200), NAMES (2,200) , NAMEG (5,10) , NAMES (5,20) , MOA (20) , I R E A C T ( 2 0 ) , NMT, NST, NC, NGAS, NET, MAXI, NDLINC, I N I O N , NK " ' COMMON /CONCT/ G ( 2 0 0 ) , ALG ( 2 0 0 ) , ACT (200)-, ALA (200) , C (200) , ALC ( 2 0 0 ) , B(20 , 2 0 0 ) , TOTM ( 2 0 ) , XPPM ( 2 0 0 ) , TN (200) , G S P ( 2 0 0 ) , A L G A S ( 2 0 ) , AGAS (20) , X I , ELECT, X I P E T , DELXIT COMMON /C ARE AY/ QM(200), QS (200) , B B ( 2 0 , 2 0 0 ) , A (20 , 2 0 ) , DN (200) , CC(200,20) , X ( 2 0 0 , 4 ) , C V ( 2 0 0 ) , U C V ( 2 0 ) , C S V E ( 2 0 0 ) , DC ( 2 0 0 ) , W S ( 2 0 , 2 0 ) , H(20,200), X D { 2 0 0 , 4 ) , ASYS (200)., AMADE (200) , ADEST (200), A10, XL, D E L X I , I P E O D ( 2 0 ) , NDELXI, ISAT, NPT,. " NOB, I F I N , I P E I N T NC2 = NC *• 2 NX = NK - NC2 NCI = NC - 1 NDT = 2 CALL DI (ATEMP, NDT) CV (NC + 1) = ATEMP O.ODOO DEEIY. MASS BALANCE = 1, NC CTEEM = SECOND DC 40 J ATEEM ETEEM CTEEM DTEEM I F (J K = I F = O.ODOO = O.ODOO = O.ODOO = O.ODOO .EQ. NC) NDX (J , 1) (NDX(J,2) . GO TO 20 NE. . 0) 10 20 30 ATEEM = - (C (K) *XD ( J , BTERM = -C(K) * X D ( J GO TO 20 CTEEM = XD ( J , 1) CONTINUE DO 30 I I = 1, NX I = I I + NC 2 K = NDX (NC + I I , 1) I F (DABS (B ( J ,11) ) ATEEM = ATERM ETEEM = ETERM CONTINUE BTERM = BTEEM * CTEBM '= CTEEM * -DCV (J) ATEEM * GO 1)) TO . 10 * X D (3 , 1) 1.0D-13) GO TO 30 * (C (K) * X D ( I , 1) ) * XD ( I , 1) * C (K) * XD ( I , 1) 40 DTEEM •= CV (J) = CONTINUE DG 50 I = .LT. - E ( J , I I ) - B ( J , I I ) XD(NC,1) XD(NC,1) / (. 0 1801 534D00*AMH2O) * XD(NC, 1) / (. 0180 1534.D00*AMH2O) BTERM + CTEEM + DTEEM. 1 , NST B.N (I) = O.ODOO I F (DABS (Z ( I ) ) .LT. 1.0D-5 . OB. Z ( I ) .GT. 9.99D00) 1 GO TO 50 XID = X I ** ( 1 . 0D00/2. ODOO) •DN (I) = ADH * 2(1) * 2 ( 1 ) * ( 1 . OD0 0 + 3. ODOO*AZERO (I) * BDH* XID) •DN(I) = DN(I) / (4. ODOO* ( X I * * (3 . 0D0 0/2 . ODOO) ) * ( ( 1. 0D00+AZEBO(I) 1 EDH*XID) **3) ) DN (I) = A 10 * DN ( I ) 50 CONTINUE ATEEH = O.ODOO BTERM = O.ODOO CTEEM = O.ODOO DC 60 1 = 1, NC1 I F (N DX (1,2) . NE. 0) GO TO 60 K = NDX (1,1) , ATEEM = ATEEM - C ( K ) , * DN (K), ETEEM = ETEEM - (C (K) *XD ( 1 , 1) ) * XD(I,1) CTEEM = CTEEM - (C (K) *XD ( 1 , 1) ) * DC(K) 60 CONTINUE DC 7 0 I I ' = 1, NX K = NDX (NC + I I , 1) I = NC2 + I I ATEEM = ATERM - C(K) * DN (K) BTERM = BTERM - (C (K) *XD ( 1 , 1 ) ) * XD ( I , 1) CTEEM = CTEEM - (C (K) *XD ( 1 , 1) ) * DC (K) 70 CONTINUE ..... ATEEM •= (ATERM*.Q 180 1534D00*XD (NC ' • 1,1)) * X.D(NC + 1,1) ETEEM = BTEBM * .0180 1534D0O CTEEM = CTEEM * .-01801534DGO * XD (NC + 1,1) CV(NC2) = ATEEM. + BTERM + CTEEM DC 90 I I = 1, NX • •-. • K = NDX (NC *> I I , 1) I = NC2 + I I ATEEM = -EN (K) DO 80 J = 1 , NC 1 I F (NDX (J,2) . NE. 0) GO TO 80 L '•= NDX ( J , 1) I F (DAES (B (J , . I I ) ) .LT, 1.0D-13) GO TO 80 ATEEM = ATEEM • B ( J , I I ) * DN (L) 80 CONTINUE ATEEM = ATEEM * XD (NC + 1,1) * XD(NC•+ 1,1) CV (I) = ATEEM 90 CONTINUE NDS = 2 CALL CVSOLV (NDS) EETUEN . END SDEBOUTINE TEIBD . THIRD DEE IV ATIV E I M P L I C I T EE AL*8 (A - H,0 - Z) COMMON /P ATE AT/ NDX(2G0,2), COM PM (20 , 20 0) , A Z E E O ( 2 0 0 ) , G M I N ( 2 0 0 ) , 1 GSOL ( 2 0 0 ) , GGAS ( 1 0 ) , COMPS (20,200) , Z (200) , RE ( 2 0 ) , 2 COMPG ( 2 0 , 10) , WGHTM (20 0) , WGHTS(200), WGHTG ( 1 0 ) , GNEUT (4) , 3 P, T, ADH, BDH, BDOT, AMH20, ALMH20, NAMEM (5, 200) , 4 NAMES (2,200) , NAMEG(5,10), NAB EB (5 , 20) , MOA(20), IREACT-(20), NMT, NST, NC, NGAS, NET, MAXI, NDLINC, INION, NK COMMON /CGNCT/ G ( 2 0 0 ) , ALG ( 2 0 0 ) , A C T ( 2 0 0 ) , A L A ( 2 0 0 ) , C (200) , ALC ( 2 0 0 ) , E ( 2 0 , 2 0 0 ) , TOTM (20) , X P P M ( 2 0 0 ) , T N ( 2 0 0 ) , G S P ( 2 0 0 ) , ALGAS ( 2 0 ) , AGAS (20) , X I , ELECT, XIP R T , DELXIT COMMON /C ARE AY/ QM(200), QS (200) , B B ( 2 0 , 2 0 0 ) , A ( 2 0 , 2 0 ) , DN (200) , , C V ( 2 0 0 ) , DCV(20), CSVE ( 2 0 0 ) , DC (200) , XD ( 2 0 0 , 4 ) , ASYS ( 2 0 0 ) , A MADE(200) , DE L X I , I P R O D ( 2 0 ) , NDELXI, ISAT, NPT, , X (200,4) W (20,200) A 10, XL, IPRI N T 10 20 30 CC(2 00,20) WS (20,20) , ADEST (200) NOD, I F I N , NC2 = NC + 2 NC1 = NC — 1 NX .= NK - NC2 NET = 3 , CALL DI(ATEMP, NDT) CV(NC + 1) = ATEMP DO 4 0 J = 1 , NO E1 = O.ODOO B2 = 0.0D00 ' B3 O.ODOO B4 = O.ODOO E5 •= 0. 0D00 . . 86 = O.ODOO B7 = O.ODOO B8 = O.ODOO • I F (J . EQ.'. NC) GO TO 20 K = NDX (0,1) ' I F (NDX (0,2) . NE. 0) B1 =;'- (C (K) *XD (0,1) ) E2 = - (C(K ) * X D (0,1) ) £3 = - (C(K) *XD ( J , 1) ) E4 = - (C (K)*XD ( 0 , 1) ) E5 = -C (K) * XD ( J , 2) GO TO 20 B6 = 2.0DOO * XD(J,2) E7 .= XD ( J , 1) - OCV (J) E8 = -87 CONTINUE DO 30 I I = 1, NX I = I I + NC2 K = NDX (NC + I I , 1,) (DABS (B (0,11) ) . GO TO 10 * XD(J,1) * XD (0,2) * XD ( 0 , 1) * XD ( J , 1) I F B1 £2 •B.3 B4 E5 CONTINUE ATEMP ATEMP = ATEM.P ATEMP ET E EM ATEMP ATEMP ATEMP CV ( J ) B1 B2 B3. B».' B5 B ( 0,II) E (0,11) B (0,11) B (J ,11) E (0,11) LT. 1,OD-13) GO (C (K) * X D ( I , 1) ) (C ( K ) * X D ( I , 1 ) ) (C (K) *XD (1,1) ) (C (K) *XD (1,1) ) . C:(K) * XD (0,2) TO 30 * X D ( I , 1) * XD(I,2) * XD(I,1) * XD ( I , 1) E l • B2 ATEMP + ATEMP + ATEMP + 1.0D00 ATEMP • ATEMP + ATEMP • ATEMP * 3. B3 * B4 B5 / (» B6 B7 ' B8 ODOO 2.0D00 * XD(NC,2) * XD (NC, 1) *' XD (NC, 1) 018.01534D00*AMH2O) * XD (NC, 1) '* BTERM * XD(NC,2) * BTEEM *..- XD (NC, 1) * XD (NC, 1) * BTERM 40 CONTINUE DO 50 I = 1, NST TN (I) =. 0. ODOO : • . • . I F (DABS (Z (I) )• .LT. 1.0D-5 .OR. Z ( I ) . GT. 9.99D00) 1 GC.TO 50 , ' ' . • XI D = X I ** ( 1. GD00/2. ODOO) . TN (I) = ADH * 3.0D00 * Z (I) * Z (I) / {8.ODOO* ( X I * * (5.0D00/2. 1 ODOO) ) ) . . TN (I) = T N ( I ) * ( 1 , 0D00+4. 0DOO*AZERQ ( I ) *BDH*XID 5.0DOO*{( 1 AZF.EO ( I ) *BDH) **2)'*XI) TN ( I ) = T N ( I ) / ' ( ( 1 .ODOO + AZERO (I) *BDH*XID) **4) IN (I) = TN (I) * A10 50 CONTINUE . 148 60 70 E1 = 0.ODOO B2 = O.ODOO E3 = 0.. ODOO 84 = O.ODOO E5 = 0.ODOO B6 = O.ODOO E7 = ' O.ODOO B8 = O.ODOO E9 = 0.ODOO DO 60 I = 1 , NC 1 I F (NDX (1,2) .NE. 0) GO TO 60 K •= NDX (1,1) £1 = B1 - C (K) .* DN (K) E2 .= E2 + C (K) * TN (K) S3 = B3 - (C(K) *XD (1,1) ) * X D ( I , 2 ) E4 = E4 - (C (K)*XD (1,1) ) * XD(I,1) E5 = E5 - (C(K) *XD (1,1) ) * DC(K) B6 = B6 - .(C(K) * X D ( I , 1 ) ) * DN (K) B7 = B7 - (C (K)*XD (1,2) ) * DC (K) - E8 =• Ed - ( C ( K ) * X D ( I , 1 ) ) * XD(I,1) * XD ( I , 1) DC (K) CONTINUE DO 70 I I = • 1 , 'NX K = NDX (NC +11,1) I = NC2 + I I B1 = E1 - C (K) * DN'(K) E2 = B2 C (X) * TN (K) E3 = B3 - (C(K) *XD ( I , 1) ) * XD (1,2) B4 = B4 (C (K) *XD (1,1) ) * XD(I,1) E5 • = B5 - (C (K)*XD (1,1) ) * DC (K) E6 = E6 - ('C(K) *XD (1,1) ) * DN (K) B7 = B7 - (C (K) *XD (1,2) ) * DC (K) B8 = B8 - (C (K) *XD (1,1) ) * X D ( I , 1 ) * XD ( I , 1) DC (K) CONTINUE ASH = .O1801534D00 B1 * 3.ODOO * (B2*A¥H*XD (NC B3 * 3.ODOO * E4 * AWIi B5 '* 2. ODOO * B6 * 2.ODOO * B7 * AKH * XD(NC ,E8 * AWH *'XD(NC A l E R f l •= B1 + B.2 • + B3 + CV (NC2) = ATERM E1 E2 B3 E4 B5 B6 E7 E8 AWH + 1 AHH AWH AWH * XD(NC + 1,1) , 1) ) * XD (NC + * XD(NC + 1,2) 1, 1) ** 2 • .XD (NC : XD (NC 1,1) 1,1) • 1,2) + 1,1) * XD (NC + 1,1) B4 + B5 + E6 • B7 • B8 DO 9 0 I I = 1, NX K = NDX {NC + I I , V) . I = NC2 + I I AT EE M = -DN <K) ET EE a = TN (K) DO 80 J = 1, NC1 I E (NDX(J,2) . NE. 0) GO TO 80 I = NDX ( J , 1) I F (DABS {B (3 , I I ) } . LT. 1. 0D-T3) GO TO 80 AT E EM = AT EE H * B ( J , I I ) * DN (L) BTEBM = BTEBM - B ( J , I I ) * TN (L) 80 CONTINUE ATEBM' = ATEBM * 3. 0D0O * XD(NC + 1,1) * XD(NC BTEBM = BTEBM * (XD(NC * 1,1) **3) CV (I) = ATEBM * BTEBM 90 CONTINUE • NDS = 3 CALL CVSOLV(NDS) EETUSN END 149 1/2)
Thesis/Dissertation
eng
Geological Sciences
Vancouver : University of British Columbia Library
For non-commercial purposes only, such as research, private study and education. Additional conditions apply, see Terms of Use https://open.library.ubc.ca/terms_of_use.
Graduate
A reinvestigation of the theoretical basis for the calculation of isothermal-isobaric mass transfer in geochemical systems involving an aqueous phase
Text