Version 3.8.1: August 23, 2024

  	-----------------
	August 20, 2024
  	-----------------
	PhreeqcRM (Python): Expanded documentation in BMI Python example notebook for
	PHREEQC example 11 (ex11-advect.ipynb), courtesy of LimnoTech.
	
	-----------------
	August 14, 2024
	-----------------
	IPhreeqc: Pull request for modifications of class definition order and header file to 
	accommodate Clang 15 on Mac.

	-----------------
	August 13, 2024
	-----------------

	IPhreeqc: This resolves an issue when building shared libraries (DLLs) on Windows with
	BUILD_SHARED_LIBS=ON and BUILD_TESTING=ON enabled in CMake.

	Sets BUILD_SHARED_LIBS=OFF when building the googletest framework.
	Adds ctest-shared.cmake for testing shared library builds.

	It also resolves a build error that occurred when building shared libraries (DLLs) on
	Windows using the Ninja generator.

	Adds the _WINDLL preprocessor definition for shared Windows builds.
	
	-----------------
	August 8, 2024
  	-----------------
	PhreeqcRM (Python): Fixed one docstring. Added code to handle numpy arrays 
	in yamlphreeqc.
	
  	-----------------
	July 11, 2024
  	-----------------
	PHREEQC: Fixed a bug in the DUMP routines. Under some circumstances
	erroneous output was dumped for a user number.  In most cases, the
	correct output was dumped following the erroneous output, which
	caused the erroneous output to be ignored.
	
Version 3.8.0: July  3, 2024

  	-----------------
	May 18, 2024
  	-----------------
	DATABASES:
	sit.dat was updated to version 12a (Aug 22, 2023) from www.thermochimie-tdb.com.

	Amm.dat, iso.dat, llnl.dat, minteq.dat, minteq.v4.dat, phreeqc.dat, 
	phreeqc_rates.dat, pitzer.dat. Tipping_Hurley.dat, and wateq4f.dat were 
	reformatted by using the lsp utility by David Kinniburgh from phreeplot.org.

  	-----------------
	May 3, 2024
  	-----------------
	PHREEQC: The -dw identifier of SOLUTION_SPECIES now has up to 7 items.
	
	-dw Dw(25C) dw_T a a2 visc a3 a_v_dif  
	
	where,
	Dw(25C)--Tracer diffusion coefficient for the species at 25 °C, m 2 /s. 
	dw_T--Temperature dependence for diffusion coefficient.
	a--Debye-Hückel ion size.
	a2--exponent.
	Visc--Viscosity exponent.
	a3--Ionic strength exponent.
	A_v_dif--Exponent for (viscosity_0/viscosity).
	
	The diffusion coefficient is calculated as follows:
	Dw = Dw(25C) * exp(dw_T / T - dw_T / 298.15)
	ka = DH_B * a2 * I0.5/ (1 + a3)
	av = (viscos_0/viscos)a_v_diff
	ff = av * exp(-a * DH_A * z * I0.5 / (1 + ka))
	Dw = Dw * ff
	Where T is temperature in Kelvin, DH_B is the Debye-Hückel B parameter, 
	I is ionic strength, viscos_0 is the viscosity of pure water at T, viscos is 
	the viscosity of the solution at T, DH_A is the Debye-Hückel A parameter,
	and z is the charge on the species,the viscosity of the solution. 
	See Robinson and Stokes, 2002, Chpt 11 for examples. 
	The Dw and a_v_dif can be set in a USER_ program with 
	setdiff_c("name", Dw, a_v_dif), for example: 
	  10 print setdiff_c("H+", 9.31e-9, 1). 
	The diffusion coefficient of H+ is handled differently with 
	Falkenhagen equations. 

  	-----------------
	May 3, 2024
  	-----------------
    PHREEQC: The ionic strength correction is for electromigration calculations 
	(Appelo, 2017, CCR 101, 102). The correction is applied when the 6th parameter
	option is set to true for -multi_D in TRANSPORT:
    
	-multi_d true/false 1e-9 0.3 0.05 1.0 true/false # multicomponent diffusion
	
	true/false, multicomponent diffusion is used,
	default tracer diffusion coefficient (used in case -dw is not defined for a species), 
	porosity (por = 0.3), 
	limiting porosity (0.05) below which diffusion stops, 
	exponent n (1.0) used in calculating the effect of tortuosity on the 
	porewater diffusion coefficient	Dp = Dw * por^n, 
	true/false: correct Dw for ionic strength (false by default). 
	
  	-----------------
	May 3, 2024
  	-----------------
	Database: Added new database phreeqc_rates.dat. The database augments
	phreeqc.dat with rate parameters from Palandri and Kharaka (2004),
	Sverdrup, Oelkers, Lampa, Belyazid, Kurz, and Akselsson (2019) (only 
	Albite and quartz), and Hermanska, Voigt, Marieni, Declercq, 
    and Oelkers (2023). Parameters are defined in data blocks
	RATE_PARAMETERS_PK, RATE_PARAMETERS_SVD, and RATE_PARAMETERS_HERMANSKA.
	All minerals with rate parameters have been added in a PHASES
	data block. Example RATES definitions using the different RATE_PARAMETERS_
	parameters are provided for Albite and Quartz. 

  	-----------------
	April 27, 2024
  	-----------------
	Databases: Added new keyword data block MEAN_GAMMAS. Each line 
	of the data block defines how to calculate the mean activity
	coefficient for a salt with a series of pairs of 
	aqueous species and stoichiometric coefficient. Phreeqc.dat, 
	Amm.dat, pitzer.dat, and phreeqc_rates.dat have this data block.
	
	MEAN_GAMMAS
	MgCl2  Mg+2 1 Cl 2
	
	A new Basic function MEANG will calculate mean activity coefficients
	for salts listed in the MEAN_GAMMAS data block.
	
	10 g_MgCl2 = MEANG("MgCl2")
	
	
  	-----------------
	April 27, 2024
  	-----------------
	PHREEQC: Added new keyword data blocks RATE_PARAMETERS_PK, RATE_PARAMETERS_SVD,
	and RATE_PARAMETERS_HERMANSKA and Basic functions RATE_PK, RATE_SVD, and
	RATE_HERMANSKA
	
	RATE_PARAMETERS_PK
#               Acid                       Neutral           Base
#               log K    E        n(H+)    log K    E        log K    E        n(OH-)
#               ======== ======== ======== ======== ======== ======== ======== ========
Quartz          -30      0        0        -13.4    90.9     -30      0        0        # Table 4
#               Acid                       Neutral           P_CO2
#               log K    E        n(H+)    log K    E        log K    E        n(P_CO2) Table
#               ======== ======== ======== ======== ======== ======== ======== ======== ========
calcite         -0.3     14.4     1        -5.81    23.5     -3.48    35.4     1        33       # specify Table number for P_CO2^n(P_CO2)
#               Acid and Fe+3                       Neutral and O2             Base
#               log K    E        n(H+)    n(Fe+3)  log K    E        n(O2)    log K    E        n(OH-)   Table
#               ======== ======== ======== ======== ======== ======== ======== ======== ======== ======== ========
pyrite          -7.52    56.9    -0.5      0.5      -4.55    56.9     0.5      -30      0        0        35       # specify Table number for Fe+3 and O2

	Three rate equations from Palandri and Kharaka (2004) can be entered. Most minerals use
	use the first form above with 8 parameters. Table 33 has a term for CO2 as in 
	the calcite example above; parameters from table 33 are identified with a 33 in the 9th
	field following 8 parameters. Table 35 has additional terms and data from this table
	is identified with 35 in field 11 following 10 rate parameters. The rates for the 
	the minerals listed in the data block can be calculated with the Basic function RATE_PK.
	The calculated rate does not include factors for surface area or affinity.
	
	10 rate = RATE_PK("Calcite")
	
	RATE_PARAMETERS_SVD
#        Table 4: E's                    Table 3: H+-reaction                H2O-reaction                        CO2-reaction    Organic_acids        OH--reaction                                Table 5
#        H+     H2O    CO2    Org_acids OH-    pkH    nH     yAl    CAl    xBC    CBC    pkH2O  yAl    CAl    xBC    CBC    zSi    CSi    pkCO2  nCO2   pkOrg  nOrg   COrg  pkOH-  wOH-   yAl    CAl    xBC    CBC    zSi    CSi    #      Num    Mineral Formula
#        ====== ====== ====== ========= ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ===== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ======= ======
Albite   3350    2500  1680   1200      3100   14.6   0.5    0.4    0.4    0.4    0.5    16.8   0.15   4      0.15   200    3      900    16.05  0.6    14.7   0.5    5     15.4   0.3    0.1    12     0.5    5      3      900    #      1.6    Albite  NaAlSi3O8

	Rate parameters from Sverdrup, Oelkers, Lampa, Belyazid, Kurz, and Akselsson (2019)
	can be specified with the RATE_PARAMETERS_SVD data block. A total of 31 parameters 
	are entered for each mineral. The rates for minerals minerals listed in the data 
	block can be calculated with the Basic function RATE_SVD. The calculated rate does 
	not include factors for surface area or affinity.
	
	10 rate = RATE_SVD("Albite")
	
RATE_PARAMETERS_HERMANSKA
#               Acid mechanism                       Neutral mechanism           Basic mechanism
#               logk25   Aa       Eaa      n(H+)     logk25   Ab        Eab      logk25   Ac        Eac      n(OH)    #    Formula
#               ======== ========= ======== ======== ======== ========= ======== ======== ========= ======== ======== =========================================
# Amphiboles
Anthophyllite   -12.4    5.70E-04  52       0.4      -13.7    5.00E-06  48       0        0         0        0

	Rate parameters from Hermanska, Voigt, Marieni, Declercq, and Oelkers (2023) can 
	be specified with the RATE_PARAMETERS_HERMANSKA data block. A total of 11 parameters 
	are entered for each mineral. The rates for minerals listed in the data block can 
	be calculated with the Basic function RATE_HERMANSKA. The calculated rate does not 
	include factors for surface area or affinity.
	
	10 rate = RATE_HERMANSKA("Anthophyllite")


  	-----------------
	April 21, 2024
  	-----------------
	PHREEQC: Added Basic functions GET$ and PUT$. They are are the same as
	GET and PUT, except the first argument for PUT$ is a character string, 
	and GET$ returns a character string. You may use one or more indices as
	needed to identify the value that is saved (PUT$) or retrieved (GET$).
	
	PUT$("MgCl2", 1, 1, 1)
	x$ = GET$(1, 1, 1)

  	-----------------
	April 19, 2024
  	-----------------
	DATABASE: Kinec.v2.dat is a new llnl.dat style database from the 
	CarbFix2 and GECO projects that is included in new distributions of 
	PHREEQC. This database contains the parameters for calculating mineral 
	dissolution rates for primary and secondary silicate minerals using the 
	equations and parameters reported by Hermanska et al. (2022, 2023)  
	and dissolution rates for other non-silicate mineral systems using the 
	equations and parameters reported by Oelkers and Addassi (2024, in 
	preparation).

  	-----------------
	April 15, 2024
  	-----------------
	PHREEQC: Fixed a memory error with iso.dat because it uses H3O+ instead of 
	H+. The SC variable was uninitialized in that situation.
	
	DATABASES: Amm.dat, phreeqc.dat, and pitzer.dat were updated with 
	revisions to viscosity and specific conductance.
	
	PhreeqcRM and IPhreeqc: Fixed bug with the temperature grid for llnl. Some 
	internal testing and list generators used the default temperature of 25C, 
	which caused an error if the temperature grid did not span 25C.
	
  	-----------------
	March 25, 2024
  	-----------------
	DATABASES phreeqc.dat, Amm.dat, and pitzer.dat: The calculation of the 
	specific conductance can now be done with a Debye-Hückel-Onsager equation 
	that has both the electrophoretic and the relaxation term. (The standard 
	phreeqc calculation uses a simple electrophoretic term only.) For 
	individual ions, the equation can be multiplied with the viscosity ratio of 
	the solvent and the solution, and the ion-size a in the Debye-Hückel term 
	kappa_a can be made a function of the apparent molar volume of the ion. The 
	options are described and used in the databases. The additions extend the 
	applicability of the DHO equation to concentrations in the molar range, 
	reducing AARD (average of the absolute relative deviations) for SC and 
	transference numbers to less than 1% in many cases. For high KHCO3 
	concentrations, the SCs indicate the presence of a KHCO3 complex that was 
	added to phreeqc.dat and Amm.dat. The AARD's are 0.18 % for NaCl, 0.48 % 
	for KCl, 0.51 % for MgCl2 and 0.89 % for CaCl2. More example files are 
	available at http://hydrochemistry.eu.  
	
	PHREEQC Bug-fix: Option -density c[alculate] in SOLUTION_SPREAD was 
	corrected to give the iterated density of the solutions. 
	
	PHREEQC: A new option has been added. The viscosity of the EDL 
	layer on SURFACE(s) can now be calculated and will then be used to 
	modify the diffusion coefficients. It is set by adding c(alculate) 
	after viscosity, for example, "-donnan 1e-8 viscosity calc". 
	
	PHREEQC Bug-fix: Viscosity of the EDL layer on SURFACE(s), defined with, for 
	example, "-donnan 1e-8 viscosity 3", was omitted in Version 3.4.2. It is 
	now re-introduced in the calculations. 
	
	PHREEQC Bug-fix: Basic now returns the contributions to the specific conductance 
	(t_sc("H+")) and the viscosity (f_visc("H+")) only when the species is present 
	in the solution. In previous versions a dummy value was returned when the 
	species was predefined, but absent in the actual solution calculation. 
	
	PHREEQC Bug-fix: Limits for fugacity coefficients were set to be 0.01 < phi < 85 in 
	Peng-Robinson calculations. The limits were removed in version 3.7 (when calculating 
	H2S(g) solubilities). However, without the limits, all water turned into H2O(g) in some 
	cases and calculations failed. 
	
  	-----------------
	November 15, 2023
  	-----------------
	PHREEQC programs: Fixed a couple malloc checks, some compiler warnings, and removed
	some deprecated calls to strcpy and strcat.
	
  	-----------------
	November 5, 2023
  	-----------------
	PHREEQC programs: Automatic testing was expanded to include MPI and additional compilers.

  	-----------------
	November 1, 2023
  	-----------------
	PHREEQC: Logical statement in k_temp was modified to work with Intel optimization.
	The statement at the beginning of the routine was not handled correctly when some 
	values were NaN. 

  	-----------------
	August 29, 2023
  	-----------------
	PhreeqcRM: Fixed bug in memory allocation for selected output. One array accumulated lines 
	indefinitely, leading to ever increasing memory use. Memory use should now be relatively
	constant once all selected output has been defined and used. 

  	-----------------
	June 1, 2023
  	-----------------	
	PhreeqcRM: Finalizing a Python version of PhreeqcRM that includes the BMI capabilities.
	Methods are documented in Python style and two test cases are available, one
	of which uses every Python method that is available. 

  	-----------------
	May 22, 2023
  	-----------------
	PhreeqcRM: Revised all F90 methods that return arrays to use allocatable arrays,
	so that, getter arrays are automatically dimensioned to the correct sizes
		
  	-----------------
	May 22, 2023
  	-----------------
	PHREEQC: (See https://hydrochemistry.eu/ph3/release.html for html version of changes.)
	Added Basic function f_visc("H+") that returns the fractional contribution of a species to 
	viscosity of the solution when parameters are defined for the species with -viscosity. 
	Actually, it gives the contribution of the species to the B and D terms in the Jones-Dole 
	eqution, assuming that the A term is small. The fractional contribution can be negative, for 
	example f_visc("K+") is usually less than zero.
	
	Bug-fix: When -Vm parameters of SOLUTION_SPECIES were read after -viscosity parameters, the 
	first viscosity parameter was set to 0.

	Defined -analytical_expression and -gamma for Na2SO4, K2SO4 and MgSO4 and Mg(SO4)2-2 species in 
	phreeqc.dat and Amm.dat, fitting the activities from pitzer.dat from 0-200 °C, and the solubilities of 
	mirabilite/thenardite (Na2SO4), arcanite (K2SO4), and epsomite, hexahydrite, kieserite (MgSO4 
	and new species Mg(SO4)2-2). The parameters for calculating the apparent volume (-Vm) and the 
	diffusion coefficients (-Dw) of the species were adapted using measured data of density and 
	conductance (SC). Example files are available at http://hydrochemistry.eu

	Removed the NaCO3- species in PHREEQC.dat since it is not necessary for the calculation of 
	the specific conductance (SC) and its origin is unknown. 
	
	Defined parameters in the -analytical_expression, -gamma, -dw, -Vm and -viscosity for 
	the NaHCO3 species in phreeqc.dat and Amm.dat, using the data in Appelo, 2015, Appl. Geochem. 
	55, 62-71. (These data were used for defining interaction parameters in 
	pitzer.dat.) The parameters for the apparent volume (-Vm), the 	diffusion 
	coefficient (-Dw) and the viscosity of CO3-2 and HCO3- were adapted using measured 	
	data of density, conductance and viscosity of binary solutions.

	The viscosity of the solution at P, T is now calculated and printed in the output file, and can 
	be retrieved in Basic programs with the function viscos (in previous versions, viscos returned 
	the viscosity of pure water at P, T).

	The calculation uses a modified Jones-Dole equation which sums the contributions of individual 
	solutes:

		eta / eta0 = 1 + A sqrt(0.5 sum(zi*mi)) + sum fan (Bi*mi + Di*mi*ni),
		
	where eta is the viscosity of the solution (mPa s), eta0 is viscosity of pure water at the 
	temperature and pressure of the solution, mi is the molality of species i, made dimensionless 
	by dividing by 1 molal, and zi is the absolute charge number. A is derived from Debye-Hückel 
	theory, and fan, B, D and n are coefficients that incorporate volume, ionic strength and 
	temperature effects. 
	
	The coefficients are:

		B = b0 + b1 exp(-b2 tC)
		
	where b0, b1, and b2 are coefficients, and tC is the temperature in °C. The temperature is 
	limited to 200 °C.

		fan = (2 - tan * Van / VCl-)
		
	for anions, with tan a coefficient and Van the P, T and I dependent, apparent volume of the 
	anion relative to the one of Cl-, which is used as reference species. For cations, fan = 1 
	and tan need not be defined.

		D = d1 exp(-d2 tC)
	where d1 and d2 are coefficients.

		n = ((1 + fI)^d3 + ((zi^2 + zi) / 2 * mi)^d3 / (2 + fI)
		
	where fI averages ionic strength effects and d3 is a coefficient.
	
	The coefficients are fitted on measured viscosities of binary solutions and entered 
	with item -viscosity under keyword SOLUTION_SPECIES, for example for H+:

		  SOLUTION_SPECIES
		  H+ = H+
		  -viscosity 9.35e-2 -8.31e-2 2.487e-2 4.49e-4 2.01e-2 1.570    0
		  #           b0       b1       b2      d1       d2      d3     tan
		  
	When the solute concentrations are seawater-like or higher, the viscosity is different 
	from pure water (see figure at). To obtain a valid model for natural waters with phreeqc.dat, 
	the complexes of SO42- with the major cations were redefined, as noted above.
	The A parameter in the Jones-Dole equation needs temperature dependent diffusion coefficients 
	of the species, and therefore the parameters for calculating the I and T dependency of the 
	diffusion coefficients (-dw parameters of SOLUTION_SPECIES) were refitted for SO42- and CO32- 
	species. Example files are available at http://hydrochemistry.eu.

	Implicit calculations with option -fix_current will now account for changing concentrations in 
	the boundary solutions of the column.

	Activated the print of statements defined in USER_PRINT when the initial EXCHANGE, SURFACE and 
	GAS_PHASE are calculated.

	Changed the dw_t parameter for CO3-2 to 30 (was 0) and for HCO3- to -150 (was 0) to better fit 
	McCleskey's data

	Bug fix: removed the factor (TK / 298.15) from the calculation of the temperature dependence of 
	the diffusion coefficient. For an example, see the calculation of Dw(TK) of H+ in the next 
	paragraph.

	Bug fixes in printing/punching of diffusion coefficients with diff_c and setdiff_c: the numbers 
	are now corrected for I and T effects when the appropriate factors are defined in keyword 
	SOLUTION_SPECIES, item -dw. For example:

	H+ = H+
		-gamma 9.0 0
		-dw 9.31e-9 1000 0.46 1e-10 # The dw parameters are defined in Appelo, 2017, CCR 101, 102-113.

	It will set Dw(TK) = 9.31e-9 * exp(1000 / TK - 1000 / 298.15) * viscos_0_25 / viscos_0_tc
	and Dw(I) = Dw(TK) * exp(-0.46 * DH_A * |zi| * I 0.5 / (1 + DH_B * I 0.5 * 1e-10 / (1 + I 0.75))),

	where viscos_0_25 is the viscosity of pure water at 25 °C, viscos_0_tc is the viscosity of pure 
	water at the temperature of the solution. DH_A and DH_B are Debye-Hückel parameters, 
	retrievable with PHREEQC Basic.


	The temperature correction is always applied in multicomponent, diffusive transport and for 
	calculating the viscosity.

	The ionic strength correction is for electromigration calculations (Appelo, 2017, CCR 101, 102). 
	The correction is applied when the option is set true in TRANSPORT, item -multi_D:
		-multi_d true 1e-9 0.3 0.05 1.0 true # multicomponent diffusion
		
	# true/false, default tracer diffusion coefficient (Dw = 1e-9 m2/s) in water at 25 °C (used in 
	case -dw is not defined for a species), porosity (por = 0.3), limiting porosity (0.05) below 
	which diffusion stops, exponent n (1.0) used in calculating the porewater diffusion coefficient 
	Dp = Dw * por^n, true/false: correct Dw for ionic strength (false by default). 

  	-----------------
	May 19, 2023
  	-----------------
	PhreeqcRM:
	Changed documentation of GetDensity and related functions to GetDensityCalculated. 
		(GetDensity still exists for backward compatibility.)
	Changed documentation of SetDensity and related functions to SetDensityUser. 
		(SetDensity still exists for backward compatibility.)
	
	Density is used to convert user-model concentrations to module solution definitions only if the
	units of the user-model concentrations are specified to be parts per million. The density specified by 
	SetDensityUser is used by SetConcentrations to convert from per kg of solution to 
	per L of solution. For GetConcentrations, two options are available to convert from module solutions 
	to user-model concentrations, depending on the value used for the method SetUseSolutionDensityVolume: 
	(1) the module-calculated density is used to convert from the calculated volume of solution
	to the mass (kg) of solution, or (2) the user-specified value of density is used to make the conversion.
	Again, density is only used if the user-model concentration units are ppm.
	
	The change in method names is intended to emphasize the difference between the user-specified densities
	and the module-calculated densities. 
	
	Changed documentation of GetSaturation and related functions to GetSaturationCalculated.
		(GetSaturation still exists for backward compatibility.)
	Changed documentation of SetSaturation and related functions to SetSaturationUser.
		(SetSaturation still exists for backward compatibility.)
	
	The values specified by SetSaturationUser are used to convert user-model concentrations to module solution definitions.
	For SetConcentrations, the volume of solution is calculated to be the user-specified saturation * porosity * 
	representative volume. For GetConcentrations, two options are available to determine the solution volume, depending 
	on the value specified for SetUseSolutionDensityVolume: (1) the solution volume is calculated by the reaction module 
	and used to convert to user-model concentrations, or (2) the solution volume is again calculated by 
	user-specified saturation * porosity * representative volume, and those values are used to convert to user-model
	concentrations. In either case, the values returned by GetSaturationCalculated are the calculated solution volume divided
	by (porosity * representative volume).
		
	The change in method names is intended to emphasize the difference between the user-specified saturations and 
	and the module-calculated saturations.
	
  	-----------------
	April 16, 2023
  	-----------------
	PhreeqcRM: Added new methods to simplify getting and setting component and 
	aqueous species concentrations.
	
	New methods:
	GetIthConcentration(int i, std::vector<double>& c)--Gets the ith component concentration as
		of the last RunCells calculation. Total number of components is retrieved with GetComponentCount.
	GetIthSpeciesConcentration(int i, std::vector<double>& c)--Gets the ith aqueous species concentration as
		of the last RunCells calculation. Total number of aqueous species is retrieved with GetSpeciesCount.
		This method is for use with multicomponent diffusion, and SetSpeciesSaveOn must be set to true.
	SetIthConcentration(int i, std::vector<double>& c)--Sets the ith component concentration; done after
		transport calculations and before RunCells calculation. Total number of components is retrieved 
		with GetComponentCount. SetIthConcentration must be run for every component before RunCells is called.
	SetIthConcentration(int i, std::vector<double>& c)--Sets the ith aqueous species concentration; done after
		transport calculations and before RunCells calculation. Total number of aqueous species is 
		retrieved with GetSpeciesCount. This method is for use with multicomponent diffusion, 
		and SetSpeciesSaveOn must be set to true. SetIthSpeciesConcentration must be run for every aqueous
		species before RunCells is called.
		
	Fortran versions are
	RM_GetIthConcentration(id, i, c)
	RM_GetIthSpeciesConcentration(id, i, c)
	RM_SetIthConcentration(id, i, c)
	RM_SetIthSpeciesConcentration(id, i, c)

  	-----------------
	April 14, 2023
  	-----------------
	PhreeqcRM: Added new methods to simplify setting initial conditions.
	
	New initial conditions methods:
	InitialEquilibriumPhases2Module(equilibrium_phases);
	InitialExchanges2Module(exchanges);
	InitialGasPhases2Module(gas_phases);
	InitialKinetics2Module(kinetics);
	InitialSolutions2Module(solutions);
	InitialSolidSolutions2Module(solid_solutions);
	InitialSurfaces2Module(surfaces);
	
	These methods are an alternative to InitialPhreeqc2Module, which used a 7 x nxyz array to
	set all initial conditions in one method call. The new methods set only one reactant at a
	time, and all methods use a single array of index numbers (referring to definitions in 
	the InitialPhreeqc instance) of length nxyz (the number of user grid cells). The methods
	copy definitions from the InitialPhreeqc instance to define initial conditions in the
	model cells.
	
	Fortran implementation is as follows:
	RM_InitialEquilibriumPhases2Module(id, equilibrium_phases);
	RM_InitialExchanges2Module(id, exchanges);
	RM_InitialGasPhases2Module(id, gas_phases);
	RM_InitialKinetics2Module(id, kinetics);
	RM_InitialSolutions2Module(id, solutions);
	RM_InitialSolidSolutions2Module(id, solid_solutions);
	RM_InitialSurfaces2Module(id, surfaces);

  	-----------------
	February 28, 2023
  	-----------------
	PhreeqcRM: 	Revised names for PhreeqcRM test case source and output 
	files (Tests subdirectory of distribution). Added tests SimpleAdvect_cpp,  
    SimpleAdvect_c and SimpleAdvect_f90. All transport results are the same for
	Advect_cpp, Advect_c, and Advect_f90, SimpleAdvect_cpp,  
    SimpleAdvect_c and SimpleAdvect_f90; however, the SimpleAdvect cases use
    a minimal set of method calls, whereas the other cases demonstrate most
    of the features of PhreeqcRM. 	

  	-----------------
	February 26, 2023
  	-----------------
	PhreeqcRM: 	Added method InitializeYAML to initialize a PhreeqcRM
	instance.
	
	It is possible to use a YAML  file to initialize the PhreeqcRM instance. 
	If a GUI is used to define model input, a YAML file could be used to 
	transfer the data from the GUI to a PhreeqcRM instance. The YAML file 
	contains names of PhreeqcRM	methods and associated data, for example:
	
	RunFile:
      workers: true
      initial_phreeqc: true
      utility: true
      chemistry_name: advect.pqi
		
	InitializeYAML can be used to process the directives defined in 
	the YAML file. The method InitializeYAML is equivalent to BMI_Initialize.
	
	A C++ class named YAMLPhreeqcRM is included in the Tests subdirectory
	of the PhreeqcRM distribution, which provides the capability to generate
	a PhreeqcRM YAML file. The file WriteYAMLFile.cpp generates a YAML file
	and advection_bmi_cpp.cpp reads and processes the file to initialize
	a PhreeqcRM instance. 

  	-----------------
	February 26, 2023
  	-----------------
	PhreeqcRM: Added a BMI (Basic Model Interface) for C++ and Fortran. 
	The interface is a repackaging of the available methods of 
	PhreeqcRM. All PhreeqcRM methods are available in addition
	to the BMI methods.
	
	New capabilities include (1) the capability to
	retrieve units for the variables for BMI_GetValues and BMI_SetValues,
	(2) the capability to use YAML (YAML ain't Markup Language)
	to initialize a PhreeqcRM instance with the method BMI_Initialize
	(which is equivalent to the method InitializeYAML), and (3) the availability
	of pointers that always point to current variable values. 
	
	The YAML capability would be especially useful if a GUI (Graphical User Interface)
	is used to set up model initial conditions. The GUI could write a YAML file
	that contains directives for PhreeqcRM methods that need to be run and 
	the corresonding data needed to initialize a PhreeqcRM instance--for example, 
	setting units; running a PHREEQC input	file to define initial and 
	boundary conditions; distribution of initial conditions to the model cells; 
	setting initial porosity, saturation, temperature, and pressure. 
	When a PhreeqcRM instance is created by the simulator, it can process 
	the YAML file with BMI_Initialize to execute the specified PhreeqcRM methods 
	to apply the data specified in the YAML file. 
	
	The following represents the way BMI methods would be used to implement
	a sequential, noniterative transport calculation:
	
	    PhreeqcRM phreeqc_rm(nxyz, nthreads);
        phreeqc_rm.Initialize("myfile.yaml");
        int ncomps;
        phreeqc_rm.GetValue("ComponentCount", &ncomps);
        int ngrid;
        phreeqc_rm.GetValue("GridCellCount", ngrid);
        std::vector c(ngrid*ncomps, 0.0);
        phreeqc_rm.GetValue("Concentrations", c.data());
        phreeqc_rm.SetValue("TimeStep", 86400);
        for(double time = 0; time < 864000; time+=86400)
        {
            // Take a transport time step here and update the vector c.
			your_transport(c);
            phreeqc_rm.SetValue("Time", time);
            phreeqc_rm.SetValue("Concentrations", c.data());
            phreeqc_rm.Update();
            phreeqc_rm.GetValue("Concentrations", c.data());
        }
		
	The set of BMI methods is as follows:
	
	std::string GetComponentName()
		Returns "PhreeqcRM".
		
	double GetCurrentTime()
		Returns current time that has been set by the user.
		
	double GetEndTime()
		Returns current time plus the time step.
		
	int GetInputItemCount()
		Returns the number of variables that it is possible to set
		with SetValue.
		
	std::vector<std::string> GetInputVarNames()
		Returns a list of the names of variables that can be set
		with SetValue.
		
	int GetOutputItemCount()
		Returns the number of variables that it is possible to retrieve
		with GetValue.
		
	std::vector<std::string> GetOutputVarNames()
		Returns a list of the names of variables that can be retrieved
		with GetValue.
		
	double GetTimeStep()
		Returns the current time step that has been set by the user.
		
	std::string GetTimeUnits()
		Returns "seconds".
		
	void GetValue(std::string name, void* dest)
		Returns a value or vector of values for the variable identified by name
		
	void GetValuePtr(std::string name, void* dest)
		Returns a pointer to current values of a variable. This method
		is available for selected variables.
		
	int GetVarItemsize(std::string name)
		Returns the number of bytes needed for one element of the variable
		identified by name.
		
	int GetVarNbytes(std::string name)
		Returns the total number of bytes neded to store the value or vector
		of values identified by name.
		
	std::string GetVarType(std::string name)
		Returns the type of the variable identified by name: "int", "double", or
		"string".
		
	std::string GetVarUnits(std::string name)	
		Returns the units associated with the variable identified by name.
		
	void Initialize(std::string config_file)
		Same as InitializeYAML discussed above.

	void SetValue(std::string name, void* src)
		Sets the value or vector of values for the variable identified by name.
		
	void Update(void)
		Calculates chemical reactions for a time step. It is equivalent to
		the method RunCells. Equilibrium will be calculated between the solution 
		and all equilibrium reactants (EQUILIBRIUM_PHASES, EXCHANGE, etc), and
		KINETICS will be integrated for the time step.
		
	BMI is implemented in Fortran with USE BMIPhreeqcRM. Methods are nemed with a
	prefix "bmif" and have an additional initial argument to identify the instance of
	BMIPhreeqcRM that is being used. 
		
  	-----------------
	February 26, 2023
  	-----------------
	PHREEQC: Fixed bug with Basic functions PR_P and PR_PHI. Values
	were incorrect after the first step when INCREMENTAL_REACTIONS
	was set to true.
	
	-----------------
	February 25, 2023
  	-----------------
	ALL PROGRAMS: Added the latest version of the database Thermoddem to 
	the distributions of PHREEQC programs. The database was downloaded
	from https://thermoddem.brgm.fr/.
	
	-----------------
	March 23, 2022
  	-----------------
	PHREEQC: "MacInnes" was misspelled in one of the warning messages.

  	-----------------
	December 18, 2021
	-----------------
	PHREEQC: Fixed transport bug where the end cell should not have
	been processed in part of the calculation.

Version 3.7.3: December  2, 2021

  	-----------------
	November 27, 2021
	-----------------
	PHREEQC: Fixed a recently introduced bug in the options 
	-print_cells and -punch_cells of the ADVECTION data block. 
	Ranges of cells using "-", such as
	
	ADVECTION
	-punch_cells 1-10 11 12-20
	
	were not read properly. Ranges of cells are now read 
	correctly.

  	----------------
	November 7, 2021
	----------------
	PHREEQC: Modified the initial guess for the potential terms
	when a surface related to a phase comes into existence; that is
	when the phase begins to precipitate. 

  	----------------
	October 25, 2021
	----------------
	PHREEQC: The Basic function DIFF_C returned an incorrect value at 
	temperatures other than 25 C. The value returned was missing a 
	factor TK/298.15, where TK is the current temperature in Kelvin. The 
	factor has now been added and the function returns the correct 
	value. Note that previous documentation indicated the returned 
	value was for 25 C, but the value returned is actually for the 
	current temperature of the system. 
	
	The return value for SETDIFF_C was also missing the factor TK/298.15.
	This Basic function now returns the correct value for the current 
	temperature of the system (TK). 
	
	The Basic functions are provided only for user output, so all TRANSPORT 
	calculations used the correct temperature-dependent diffusion coefficients.
	
  	----------------
	October 25, 2021
	----------------
	PHREEQC: Revised a bug fix from May 28, 2021 making Fe(+3) and Fe(3) 
	equivalent names in SELECTED_OUTPUT and Basic functions TOT and TOTMOL.
	The previous fix had unintended consequences for element names like [Fe+3], 
	causing this definition to fail. The revised bug fix should eliminate the
	unintended problem.
	
---------------------------------------------------------------------------------------------
Version 3.7.1: September 21, 2021	
---------------------------------------------------------------------------------------------

  	--------------
	August 25, 2021
	--------------
	PHREEQC: Added new Basic functions MCD_JTOT and MCD_JCONC that return
    multicomponent diffusion fluxes. MCD_JTOT returns the value of equation
    10 in the description of the TRANSPORT keyword in the PHREEQC 3 manual
    for an aqueous species. MCD_JCONC returns the flux calculated by the
    first term of equation 10. The functions ignore interlayer diffusion
	and only apply to multicomponent diffusion. Here are Basic examples.
	Uphill diffusion occurs when the two functions have opposite signs.

	10 jtot = MCD_JTOT("Cl-")
	20 jconc = MCD_JCONC("Cl-")

  	--------------
	July 30, 2021
	--------------
	PHREEQC: Modified the numerical method for Pitzer calculations when using
	Peng-Robinson  gases. The calculation of numerical derivatives was 
	modified to account for the sequence of calculations, particularly that
	the mole fractions of gases are calculated within the molalities method. 

  	-------------
	June 14, 2021
	-------------
	PhreeqcRM: Added capability to save the chemical state of the module in memory to 
	allow resetting at a later point in the calculation. The capability would be useful
	for implementing an SIA (sequential iterative approach) for iterating the transport
	rate terms between the transport code and the chemistry in PhreeqcRM. Three new
	methods have been added to save, apply, and delete a chemical state.
	
	status = phreeqcrm.StateSave(i);
	...
	status = phreeqcrm.StateApply(i);
	status = phreeqcrm.StateDelete(i);
    
  	--------------
	May 28, 2021
	--------------
	PHREEQC: Fixed SELECTED_OUTPUT feature where Fe(+3) (and others) were not identified
	as legitimate redox states. Absence of "+" worked as expected. Same fix
	for Basic functions TOT and TOTMOL.

  	--------------
	April 10, 2021
	--------------
	PHREEQC: Fixed -add_constant for phases and aqueous, exchange, surface species.
	
	PHREEQC: Caught NULL pointer when a SURFACE was defined with a surface not 
	defined in SURFACE_MASTER_SPECIES or SURFACE_SPECIES.
	
	PHREEQC: Fixed a catastrophic error under some conditions when a surface was used 
	with a SIT database. Also enabled EDL calculation for SIT databases; the EDL is 
	calculated, but the results have not been tested for correctness.
	
---------------------------------------------------------------------------------------------
Version 3.7.0: April 29, 2021	
---------------------------------------------------------------------------------------------

Summary of Basic functions not include in PhreeqcI help:

ADD_HEADING("NewHeading")           Append a new heading to the list of -headings defined
                                    in USER_PUNCH. Note: only useful in PhreeqcRM and takes effect 
                                    at next RunString, RunFile, or RunCells.

DEBYE_LENGTH                        Value of the Debye length.

DELTA_H_PHASE("Calcite")            Delta H in KJ/mol. If an analytic expression exists,
                                    Delta H is at reaction temperature; otherwise
                                    Delta H at 25 C.

DELTA_H_SPECIES("CaHCO3+")          Delta H in KJ/mol. If an analytic expression exists,
                                    Delta H is at reaction temperature, otherwise
                                    Delta H at 25C.

DH_A0(Na+")                         Debye-Hückel species-specific ion size parameter.

DH_BDOT("Na+")                      Debye-Hückel species-specific ionic strength coefficient.

EOL_NOTAB$                          Omits the tab that is normally printed after EOL$.

ITERATIONS                          Total number of iterations for the calculation.

NO_NEWLINE$                         Omits the new line normally written after printing a USER_PUNCH block.
                                    This function can be used to completely eliminate a line for a cell 
                                    (assuming no SELECTED_OUTPUT fields are defined).

SETDIFF_C("CO3-2", 1.18e-9)         Sets dw for a species (see SOLUTION_SPECIES), returns
                                    calculated diffusion coefficient at reaction temperature.

SYS("element", count , name$,       Sixth argument is new and determines the sort order,
type$ , moles, 1)                   0 sorted by 5th argument, 1, sorted by 3rd argument.

	-------------
	April 6, 2021
	-------------
	PHREEQC: Code was revised to make greater use of C++ template classes (vector and map) for 
	memory management
	
	PhreeqcI: More comprehensive documentation of Basic functions.

	-------------
	March 10, 2021
	-------------
	PHREEQC: New Basic functions return (1) delta H of species,
	(2) delta H of a phase, (3) Debye Hückel a0 (species-specific
	ion size), and (4) Debye Hückel bdot (species-specific ion
	strength coefficient).

DELTA_H_PHASE("Calcite")    		Delta H in KJ/mol. If an analytic expression exists,
									Delta H is at reaction temperature; otherwise
									Delta H at 25 C.

DELTA_H_SPECIES("CaHCO3+")			Delta H in KJ/mol. If an analytic expression exists,
									Delta H is at reaction temperature, otherwise
									Delta H at 25C.

DH_A0(Na+")         				Debye-Hückel species-specific ion size parameter. 

DH_BDOT("Na+")  					Debye-Hückel species-specific ionic strength coefficient.

  	-------------
	March 10, 2021
	-------------
	PHREEQC: Merged changes from Tony Appelo's version.
	
	Bug fix of removal of Donnan layer calculations when kinetic 
	reactions are zero in Runge-Kutta calculations.
	
	SIs of phases are now printed with the phase mole transfers 
	found by INVERSE_MODELING. This is useful for checking that 
	dissolving and precipitating phases are sub- and 
	supersaturated, respectively.
	
	Modified the -analytical_expression for calcite in 
	phreeqc.dat, with data from Ellis (1959) and Plummer and 
	Busenberg (1982) used in pitzer.dat.

	Modified the -analytical_expression for dolomite in 
	phreeqc.dat and pitzer.dat, using data at 25 °C from Hemingway 
	and Robie (1994) and 50-175 °C from Bénézeth et al. (2018), GCA 
	224, 262-275. 

  	-------------
	March 2, 2021
	-------------
	PhreeqcRM: Added new methods to retrieve and set the volumes
	of the gas phases in the cells. GetGasPhaseVolume retrieves
	the volume of the gas phase in each cell. The value is set
	to -1.0 for cells that do not have a gas phase.
	
	SetGasPhaseVolume only applies to fixed-volume gas phases.
	An array of gas volumes is applied to the gas phases in the
	cells. If the volume is negative for a cell, the gas volume
	in the cell remains unchanged. If the volume is greater or
	equal to zero, the volume is applied to the cell, and the
	gas phase is forced to be a fixed-volume gas phase.

    C++:
	IRM_RESULT GetGasPhaseVolume(std::vector<double>& gas_pressure);
	IRM_RESULT setGasPhaseVolume(const std::vector<double>& gas_pressure);
	
	Size of the vector is nxyz, the number of cells in the 
	transport model.
	
    C: 
	IRM_RESULT RM_GetGasPhaseVolume(int id, double* gas_volume);
	IRM_RESULT RM_SetGasPhaseVolume(int id, double* gas_volume);
	
	Size of the array is nxyz*sizeof(double), where nxyz is the 
	number of cells in the transport model.
	
    Fortran90: 
	IRM_RESULT RM_GetGasPhaseVolume(int id, double precision gas_volume(:));
	IRM_RESULT RM_SetGasPhaseVolume(int id, double precision gas_volume(:));
	
	The array is dimensioned nxyz, the number of cells in the 
	transport model.
	
	See HTML documentation of PhreeqcRM in download distributions or 
	https://water.usgs.gov/water-resources/software/PHREEQC/documentation/phreeqcrm/.
 
	
  	-----------------
	February 26, 2021
	-----------------
	
	PhreeqcRM: Added new methods to retrieve values for 
	gas components in each cell--moles, pressures, and 
	fugacity coefficients (phi). A list of gas components is 
	accumulated by call(s) to FindComponents, and retrieved 
	by the method GetGasComponents. An array containing 
	moles of components for each cell in the transport model 
	is retrieved with GetGasCompMoles; similarly for 
	GetGasCompPressures, and GetGasCompPhi. If GAS_PHASE is not 
	defined for a cell or a GAS_PHASE does not contain a component, 
	the array will contain the value -1.0 in those positions. 
	Fugacities of gas components can be calculated as the product
	of the pressure and fugcity coefficient.
	
	Moles of gas components in the chemistry cells can be set 
	with the method SetGasCompMoles. A negative value is used to 
	represent components that are absent from a cell.	

	C++:
	IRM_RESULT GetGasCompMoles(std::vector<double>& gas_moles);
	IRM_RESULT GetGasCompPressures(std::vector<double>& gas_pressure);
	IRM_RESULT GetGasCompPhi(std::vector<double>& gas_phi);
	IRM_RESULT SetGasCompMoles(const std::vector<double>& gas_moles);
	
	The argument of each method is a vector of size nxyz*ngcomps, where 
	nxyz is the number of cells in the transport model and ngcomps is
	the number of gas components returned by GetGasComponentCount. 
	
	C:
	IRM_RESULT RM_GetGasCompMoles(int id, double* gas_moles);
	IRM_RESULT RM_GetGasCompPressures(int id, double* gas_pressure);
	IRM_RESULT RM_GetGasCompPhi(int id, double* gas_phi);
	IRM_RESULT RM_SetGasCompMoles(int id, double* gas_moles);
	
	For each function, the first argument(id) is an integer, and 
	the second argument is an array of size nxyz*ngcomps*sizeof(double),
	where nxyz is the number of cells in the transport model and 
	ngcomps is the number of gas components returned by 
	RM_GetGasComponentCount. 
	
	Fortran90:
	INTEGER FUNCTION RM_GetGasCompMoles(id, gas_moles)
	INTEGER FUNCTION RM_GetGasCompPressures(id, gas_pressures)
	INTEGER FUNCTION RM_GetGasCompPhi(id, gas_phi)
	INTEGER FUNCTION RM_SetGasCompMoles(id, gas_moles)
	
	For each function, the first argument (id) is an integer, and 
	the second argument is a two dimensional array dimensioned 
	(nxyz,ngcomps), where nxyz is the number of cells in the transport 
	model and ngcomps is the number of gas components returned by 
	RM_GetGasComponentCount. 

	See HTML documentation of PhreeqcRM in download distributions or 
	https://water.usgs.gov/water-resources/software/PHREEQC/documentation/phreeqcrm/.
 
  	-----------------
	February 21, 2021
	-----------------
	PhreeqcRM: Added a new method to retrieve log10 molality (mol/kgw)
	of aqueous species.
	
	C++:
	IRM_RESULT  GetSpeciesLog10Molalities (std::vector< double > &species_log10molalities) 
	
	C:
	IRM_RESULT RM_GetSpeciesLog10Molalities(int id, double * species_log10molalities)  

    Fortran90:	
	integer function RM_GetSpeciesLog10Molalities(id, species_log10molalities) 
	
	The first argument (id) is an integer, and the second argument is a 
	two dimensional array dimensioned (nxyz,nspecies). 

	See HTML documentation of PhreeqcRM in download distributions or 
	https://water.usgs.gov/water-resources/software/PHREEQC/documentation/phreeqcrm/.
 
  	-----------------
	February 20, 2021
	-----------------
	Phreeqc: Added optional 6th argument to Basic function SYS that 
	controls the sort order of the output. If the argument is absent or
	equal to 0, the sort order of species is from highest to lowest
	based on the 5th field. If the 6th argument is a nonzero integer,
	then the sort order is alphabetically based on the 3rd field. 
	
	Sort by 5th field (moles):
	SYS("element", count , name$ , type$ , moles)
	SYS("element", count , name$ , type$ , moles, 0)

	Sort by 3rd field (name$):
    SYS("element", count , name$ , type$ , moles, 1)

 
 	-----------------
	February 19, 2021
	-----------------
	PhreeqcRM: Fixed zero divide dumping one-cell model.
	.
  	----------------
	November 24, 2020
	----------------
	PHREEQC: Added new Basic functions to control USER_PUNCH output.
	
	EOL_NOTAB$ omits the tab that is normally printed after EOL$.
	NO_NEWLINE$ omits the new line normally written after printing 
	            a USER_PUNCH block. This function can be used to completely
				eliminate a line for a cell (assuming no SELECTED_OUTPUT fields
				are defined.
				
				Example:
USER_PUNCH 2
100  IF (STEP_NO = 2 OR STEP_NO = 4) THEN GOTO 200
110    PUNCH NO_NEWLINE$
120    GOTO 300
200 REM
210   PUNCH TC, TK, EOL_NOTAB$
220   PUNCH TK, TC
300 END
				
	IPhreeqc: Added new Basic function ADD_HEADING to append a new heading to the list
	          of -headings defined in USER_PUNCH. The function returns the total
			  number of headings. This function is only helpful when using IPhreeqc.
			  
			  Example:
 USER_PUNCH 2
-heading A
10  if (GET(999) > 0) THEN GOTO 100 # define only once
20  n = ADD_HEADING("B")
30  PUT(999,1)
100 REM

  	----------------
	August 17, 2020
	----------------
	PHREEQC: Changes to implicit Nernst Planck calculations for electro-migration.
	Concentration-oscillations in 3 cells at the column boundary are now dampened,
	which improves the stability of the calculations.

 	----------------
	August 17, 2020
	----------------
	PHREEQC: A new Basic function DEBYE_LENGTH was added to return the 
	value of the Debye length, typically notated kappa^-1. The value is 
	related to the decay of the surface potential with distance from the 
	surface. Theory says that the potential at distance d from the surface 
	is equal to psi0*exp(d/DL), where psi0 is the surface potential and DL is 
	the Debye length. The lengh is inversely related to ionic strength.
	Example: 
	
	10 DL = DEBYE_LENGTH

 	----------------
	August 11, 2020
	----------------
	PHREEQC: SURFACE and EXCHANGE were not updated correctly when related
	to a mineral and the moles of mineral were changed with EQUILIBRIUM_PHASES,
	EQUILIBRIUM_PHASES_MODIFY, EQUILIBRIUM_PHASES_RAW, or EQUILIBRIUM_PHASES_MIX.
	Incorrect updating also occurred when related to a kinetic reaction and 
	the moles of kinetic reaction were changed with KINETICS, KINETICS_MODIFY,
	KINETICS_RAW, or KINETICS_MIX. Now, the correct proportional relation should 
	be maintained if the moles in EQUILIBRIUM_PHASES or KINETICS are changed.
	
	An error message will result if, for example, EQUILIBRIUM_PHASES is modified
	to remove the phase that EXCHANGE is related to. 
	
 	----------------
	July 22, 2020
	----------------
	PhreeqcRM: Added new method PhreeqcRM::SetErrorOn(bool tf). This method controls
	whether error messages are written or not. A value of true will print error 
	messages; false will eliminate error messages. Print control (PhreeqcRM's 
	PHRQ_io::Set_error_on) is set for the PhreeqcRM instance and for each of the 
	IPhreeqc workers (each worker's PHRQ_io::Set_error_on). Messages include 
	PHREEQC "ERROR" messages, and any messages written with PhreeqcRM::ErrorMessage.
	
 	----------------
	June 7, 2020
	----------------
	PhreeqcRM: Modified the OpenMP version to allow retrieval of strings from
	selected output through the worker IPhreeqc instances. The PhreeqcRM
	method GetSelectedOutput retrieves only numerical values from selected
	output. Formerly, selected output was not available through the 
	IPhreeqc worker instances in the case when the output file was written
	[SetPrintChemistryOn(true)]. Now, complete selected output values (strings
	and numeric values) are always available through IPhreeqc methods on
	the workers. String values of selected output are not available in the
	MPI version. 

 	----------------
	May 24, 2020
	----------------
	
	PHREEQC:  Code was revised to remove temperature and pressure limits for 
	llnl-type databases. Previously, limits of 350 C and 1500 atm were applied to 
	all databases. These limits were removed for databases that define 
	LLNL_AQUEOUS_MODEL_PARAMETERS. It is assumed that for llnl-type databases all 
	temperature and pressure effects are defined by the 
	LLNL_AQUEOUS_MODEL_PARAMETERS data block and the temperature expressions for 
	log10(K)s of the aqueous species and phases. Implicitly, pressure for an 
	llnl-type database is either fixed or a function of temperature.
	
	In addition, the molar volume of water was set to zero for llnl-type 
	databases. The molar volume of water was calculated as a non-zero value for 
	all databases. Thus, there was a pressure dependence for log10(K) for 
	reactions involving water. For llnl-type databases, all molar volumes should 
	be zero, and all temperature and pressure dependence should be defined 
	through LLNL_AQUEOUS_MODEL_PARAMETERS and log10 Ks.  	
	
	PHREEQC: Added extra information for some ERROR messages related to -formula 
	definitions in KINETICS. Fixed some C++ 2011 compiler warnings about casts 
	and initialization of classes. 	

Version 3.6.2: January 28, 2020	
	
 	----------------
	January 28, 2020
	----------------
	PhreeqcRM: Documenation for Fortran RM_RunString had incorrect order for instances.
	The order is workers, initial_phreeqc, utilities.
	
 	----------------
	January 23, 2020
	----------------

    Updated documentation in phreeqc.chm and online 
https://water.usgs.gov/water-resources/software/PHREEQC/documentation/phreeqc3-html/phreeqc3.htm

	PHREEQC: Added silicate sorption to Hfo_w from Swedlund, P.J. and Webster, J.G., 1999, 
	Water Research 33, 3413-3422 for Amm.dat, phreeqc.dat, pitzer.dat, and wateq4f.dat.
	
	PHREEQC: Fixed memory error in TRANSPORT if number of porosities exceeded the number of cells.


Version 3.6.1: January 7, 2020
 	---------------
	January 2, 2020
	---------------

	PHREEQC: Fixed bug in TRANSPORT. The function GFW was used in a Basic program
	on elements that were not found in the database. This led to increasing the
	count of elements. The original number of elements was used to allocate space
	for transport, but the incremented number was used to free space, which caused
	a segmentation fault.

 	-----------------
	November 20, 2019
	-----------------

	PHREEQC:
	SURFACE 8 Constant capacitance model
        Ha_aH		3.70E-06 1500  0.010
        -ccm		3.196
		
	-ccm indicates that the surfaces in the surface assemblage use the 
	constant-capacitance model. The single parameter is the 
	capacitance in F/m2 (farad per square meter).	
				
	PHREEQC:
	Implicit calculation of multicomponent diffusion was extended with 1 
	stagnant layer in the column, and options were added: 

	-- When the mixing factor (defined with keyword MIX) is omitted for the 
	boundary solution and the adjacent stagnant cell, the implicit model 
	calculates a mixing factor for the boundary stagnant cell, multiplying 
	the mixing factor for the mobile cell (this is cell 1 or cell 'cells') 
	with the ratio of the kgs of water in the stagnant cell and the mobile 
	cell, see e.g. Fig. 2 of Appelo et al., 2010, GCA 74, p. 1205. Diffusion 
	into the stagnant cell can be omitted, defining a mixing factor of 0. For 
	example for a column with 'cells' = 4, stagnant cell = 6, boundary 
	solution 0: MIX 0; 6 0. 

	-- Thermal diffusion with the stagnant cells will be calculated when 
	temperatures differ by more than 0.1 °C. Multicomponent diffusion 
	coefficients decrease with the viscosity of the solution, markedly 
	affecting the results. File ex12b.phr in c:\phreeqc\exmpls compares 
	traditional and multicomponent diffusive transport of heat and solutes 
	with temperatures changing from 0 to 25 °C.

	TRANSPORT
	-implicit false/true 1 -30

	Added an option to define the minimal log10(molality) of a species for 
	inclusion in multicomponent diffusion. The definition is done with option 
	-implicit false/true 1 -30 under keyword TRANSPORT, where 1 and -30 are 
	the default max_mixf and default minimal log10(molality) (= min_dif_LM), 
	respectively. The value for min_dif_LM could be as large as -12.

	PHREEQC:
	Removed the limit that transported moles had to be > 1e-15 in 
	multicomponent diffusion.

	PHREEQC:
	Bug fix where calculation of diffusion through the Donnan layer could 
	be bypassed.

	PHREEQC:
    TRANSPORT
	-same model 2-5 8-11
	
	Added an option to use the chemical model structure of the previous 
	calculation for specific cells with option -same_model under keyword 
	TRANSPORT. For example, -same_model 2-5 8-11 will use for cells 2-5 the 
	model defined for cell 1, and for cells 8-11 the model defined for cell 
	7. For cells 0 and 1, and 6 and 7, the model is set-up with the default 
	'check_same_model' in prep.cpp.

	PHREEQC:
	Corrected memory leaks in implicit calculations of diffusive transport.

	-----------------
	October 31, 2019
	-----------------

	PhreeqcI: Fixed bug in TRANSPORT that caused lengths and dispersivities
	to be incorrect when editing through the TRANSPORT dialog.

 	-----------------
	May 31, 2019
	-----------------
	
	PHREEQC: A new option for TRANSPORT invokes an implicit method for 
	multicomponent diffusion-only systems. In multicomponent diffusion, 
	each aqueous species diffuses according to its individual diffusion 
	coefficient. The new method allows greater time steps and thus speeds 
	the overall calculation. There is one parameter for the implicit 	
	method, which is the maximum mixing factor (max_mixf) that is allowed, 
	max_mixf = D * delta_t / delta_x^2. The default value of max_mixf = 1, 
	but it can be increased often to > 4 (depending on the required 
	accuracy and the chemistry of the system), with possible speedups of 
	about an order of magnitude relative to the default method. If max_mixf 
	is too large, calculations may not converge. With implicit true, 
	electro-migration calculations are more stable and usually (possibly) 
	avoid disturbing warnings of 'negative moles'. The implicit 
	calculations have been implemented for a regular (equally spaced) 
	column, not for stagnant cells, and not for interlayer diffusion. 	
	
	TRANSPORT
	-implicit true 2.0
	
	The activity-coefficient effect for multicomponent diffusion was 
	modified, previous versions could give an erroneously large correction.
	
	The column boundary cells 0 and count_cells + 1 are now 
	print-/punched by default when the boundary conditions are not 
	'closed'.

 	-----------------
	May 7, 2019
	-----------------
	
	PHREEQC: Added Alkalinity to iso.dat. Added error message if Alkalinity is
	missing for inverse modeling.

 	-----------------
	February 4, 2019
	-----------------
	
	PHREEQC: Fixed bug in MIX_GAS_PHASE. Formula for mixing pressures was incorrect.
	
 	-----------------
	February 4, 2019
	-----------------
	PHREEQC: A series of new keyword data blocks are available to mix reactants. Input
	is parallel to the input for the keyword MIX, which is a series of user number and
	fraction pairs. Mixtures can be formed of solutions, exchangers, equilibrium_phases, 
	gas phases, kinetic reactions, solid solutions, and surfaces. 	Synonyms of keywords 
	are in parentheses.

	SOLUTION_MIX           (MIX_SOLUTION)
	EXCHANGE_MIX           (MIX_EXCHANGE)
	EQUILIBRIUM_PHASES_MIX (MIX_EQUILIBRIUM_PHASES, EQUILIBRIUM_PHASE_MIX, MIX_EQUILIBRIUM_PHASE)
	GAS_PHASE_MIX          (MIX_GAS_PHASE)
	KINETICS_MIX           (MIX_KINETICS)
	SOLID_SOLUTIONS_MIX    (MIX_SOLID_SOLUTIONS, SOLID_SOLUTIONS_MIX, MIX_SOLID_SOLUTION)
	SURFACE_MIX            (MIX_SURFACE) 
	
	These _MIX keywords do not invoke any type of speciation or reaction calculation 
	and mostly involve a summation of moles of the various reactants. Thus, MIX differs 
	from SOLUTION_MIX in that MIX produces a reaction calculation and a distribution of 
	species, whereas SOLUTION_MIX does not. The final events of a simulation occur in the 
	order of RUN_CELLS, _MIX, COPY, DUMP, and DELETE. 
	
	Here is an example of SOLUTION_MIX, which creates a mixture of previously defined 
	solutions: 
	
	SOLUTION_MIX 2-4 # new solutions 2, 3 and 4: 
    1 0.5      # solution number, fraction 
    4 1.5      # solution number, fraction 
    6 0.3      # etc. 

 	-----------------
	January 31, 2019
	-----------------
	
	PHREEQC: Revised numerical method for solid solutions to respond better to
	KNOBS -step and -pe_step convergence parameters.
	
 	-----------------
	January 28, 2019
	-----------------
	
	PHREEQC: Bug fix of incorrect mass added in solid solutions with a component 
    containing an element not present initially, but added with 
    INCREMENTAL_REACTIONS.

	PHREEQC: Enabled active_fraction factors for EXCHANGE_SPECIES in Pitzer activity 
    models, and generally improved the convergence of exchange calculations with 
    active_fraction factors.
    
	Active_fraction factors are useful for modeling non-ideal ion exchange, see 
    https://hydrochemistry.eu/exmpls/a_f.html for an example of active 
    fraction model for varying exchange selectivity.

	The aquia example https://hydrochemistry.eu/exmpls/aquia.html </A></I> now runs 3 
	times faster.
	
 	-----------------
	November 6, 2018
	-----------------
	
	PHREEQC: The Basic function SURF returned the incorrect value under some conditions
	when surface species used -mole_balance definition.

 	-----------------
	November 4, 2018
	-----------------

	PHREEQC: Fixed potential integer overflow of calculated number of mixes
	for a diffusion calculation. Now gives an error message.

 	-----------------
	October 18, 2018
	-----------------

	PHREEQC: Fixed bug with diffusion calculation if porosity was changed.

 	-----------------
	August 22, 2018
	-----------------

	PHREEQC: Completed an "operator =" method for the C++ class Phreeqc. In
	C++ programming, it is now possible to set new_phreeqc = old_phreeqc, 
	where all definitions and variables of old_phreeqc are copied to the 
	new_phreeqc instance.

 	-----------------
	August 22, 2018
	-----------------

	PHREEQC: Increased the number of iterations (100000) allowed for the solver in 
	INVERSE_MODELING calculations. Should rarely need this many iterations.

 	-----------------
	July 17, 2018
	-----------------

	PHREEQC: Fixed bug where an element name like "1W" in SOLUTION or SOLUTION_SPREAD 
	was interpreted as an isotope, but caused a NULL pointer if the ISOTOPE definitions
	did not exist.
	
 	-----------------
	July 8, 2018
	-----------------

	PHREEQC: Added option -ddl to SURFACE. Sets surface type to 
	diffuse double layer, which is the default if -no_edl and -cd_music
	are not defined.
	
 	-----------------
	June 27, 2018
	-----------------

	PhreeqcRM: Added methods to provide lists of exchange species, surface species,
	reactants, and relevant minerals and gases defined in the reaction module. The lists
	are derived from the SOLUTION, EXCHANGE, SURFACE, EQUILIBRIUM_PHASES, GAS_PHASES,
	and KINETICS definitions in the "initial phreeqc" IPhreeqc object. 
	See documentation of PhreeqcRM in download distributions.

	-----------
	C++ methods
	-----------

	EXCHANGE
	--------
	Number of exchange species
	   int GetExchangeSpeciesCount(void)
	Names of all exchange species (for example, NaX)
	   const std::vector<std::string> & GetExchangeSpeciesNames(void)
	Name of exchanger in exchange species (for example, X)
	   const std::vector<std::string> & GetExchangeNames(void)

	Surface
	-------
	Number of surface species 
	   int                              GetSurfaceSpeciesCount(void)
	Names of all surface species (for example Hfo_wOH)
	   const std::vector<std::string> & GetSurfaceSpeciesNames(void)
	Surface type for surface species (for example Hfo_w)
	   const std::vector<std::string> & GetSurfaceTypes(void)
	Surface name for surface species (for example Hfo)
	   const std::vector<std::string> & GetSurfaceNames(void)
	   
	Equilibrium phases
	------------------
	Number of equilibrium phases 
	   int                              GetEquilibriumPhasesCount(void)
	Names of equilibrium phases; suitable for definitions of -equilibrium_phases
	in SELECTED_OUTPUT
	   const std::vector<std::string> & GetEquilibriumPhases(void)

	Gas phase components
	--------------------
	Number of gas phase components
	   int                              GetGasComponentsCount(void)
	Names of gas phase components; suitable for definitions of -gas
	in SELECTED_OUTPUT
	   const std::vector<std::string> & GetGasComponents(void)

	Kinetics
	--------
	Number of kinetic reactions
	   int                              GetKineticReactionsCount(void)
	Names of kinetic reactions; suitable for definitions of -kinetics
	in SELECTED_OUTPUT
	   const std::vector<std::string> & GetKineticReactions(void)

	Solid solutions
	---------------
	Number of solid solution components
	   int                              GetSolidSolutionComponentsCount(void)
	Names of solid solution components; suitable for definitions of 
	-solid_solution in SELECTED_OUTPUT
	   const std::vector<std::string> & GetSolidSolutionComponents(void)
	Solid solution name containing the solid solution component
	   const std::vector<std::string> & GetSolidSolutionNames(void)
	   
	Saturation index phases
	-----------------------
	Number of phases appropriate for the elements defined in the reaction module
	   int                              GetSICount(void)
	Names of phases in the reaction module; suitable for definitions of
	-si in SELECTED_OUTPUT
	   const std::vector<std::string> & GetSINames(void)
   
	---------------
	Fortran methods
	---------------

	Exchange
	--------
	Number of exchange species
	   integer function RM_GetExchangeSpeciesCount(id)
	Name of exchange species (for example, NaX)
	   integer function RM_GetExchangeSpeciesName(id, i, line)
	Name of exchanger in exchange species (for example, X)
	   integer function RM_GetExchangeName(id, i, line1)

	Surface
	-------
	Number of surface species 
	   integer function RM_GetSurfaceSpeciesCount(id)
	Name of all surface species (for example Hfo_wOH)
	   integer function RM_GetSurfaceSpeciesName(id, i, line)
	Surface type for surface species (for example Hfo_w)
	   integer function RM_GetSurfaceType(id, i, line1)
	Surface name for surface species (for example Hfo)
	   integer function RM_GetSurfaceName(id, i, line2)
	   
	Equilibrium phases
	------------------
	Number of equilibrium phases 
	   integer function RM_GetEquilibriumPhasesCount(id)
	Name of equilibrium phase; suitable for definitions of -equilibrium_phases
	in SELECTED_OUTPUT
	   integer function RM_GetEquilibriumPhasesName(id, i, line)

	Gas phase components
	--------------------
	Number of gas phase components
	   integer function RM_GetGasComponentsCount(id)
	Name of gas phase component; suitable for definitions of -gas
	in SELECTED_OUTPUT
	   integer function RM_GetGasComponentsName(id, i, line)

	Kinetics
	--------
	Number of kinetic reactions
	   integer function RM_GetKineticReactionsCount(id)
	Name of kinetic reaction; suitable for definitions of -kinetics
	in SELECTED_OUTPUT
	   integer function RM_GetKineticReactionsName(id, i, line)

	Solid solutions
	---------------
	Number of solid solution components
	   integer function RM_GetSolidSolutionComponentsCount(id)
	Name of solid solution component; suitable for definitions of 
	-solid_solution in SELECTED_OUTPUT
	   integer function RM_GetSolidSolutionComponentsName(id, i, line)
	Solid solution name containing the solid solution component
	   integer function RM_GetSolidSolutionName(id, i, line1)
	   
	Saturation index phases
	-----------------------
	Number of phases appropriate for the elements defined in the reaction module
	   integer function RM_GetSICount(id)
	Name of phase in the reaction module; suitable for definitions of
	-si in SELECTED_OUTPUT
	   integer function RM_GetSIName(id, i, line)

	---------------
	C methods
	---------------

	Exchange
	--------
	Number of exchange species
	   int RM_GetExchangeSpeciesCount(id)
	Name of exchange species (for example, NaX)
	   IRM_RESULT RM_GetExchangeSpeciesName(id, i, line1, length)
	Name of exchanger in exchange species (for example, X)
	   IRM_RESULT RM_GetExchangeName(id, i, line1, length)

	Surface
	-------
	Number of surface species 
	   int RM_GetSurfaceSpeciesCount(id)
	Name of all surface species (for example Hfo_wOH)
	   IRM_RESULT RM_GetSurfaceSpeciesName(id, i, line, length)
	Surface type for surface species (for example Hfo_w)
	   IRM_RESULT RM_GetSurfaceType(id, i, line1, length)
	Surface name for surface species (for example Hfo)
	   IRM_RESULT RM_GetSurfaceName(id, i, line2, length)
	   
	Equilibrium phases
	------------------
	Number of equilibrium phases 
	   int RM_GetEquilibriumPhasesCount(id)
	Name of equilibrium phase; suitable for definitions of -equilibrium_phases
	in SELECTED_OUTPUT
	   IRM_RESULT RM_GetEquilibriumPhasesName(id, i, line, length)

	Gas phase components
	--------------------
	Number of gas phase components
	   int RM_GetGasComponentsCount(id)
	Name of gas phase component; suitable for definitions of -gas
	in SELECTED_OUTPUT
	   IRM_RESULT RM_GetGasComponentsName(id, i, line, length)

	Kinetics
	--------
	Number of kinetic reactions
	   int RM_GetKineticReactionsCount(id)
	Name of kinetic reaction; suitable for definitions of -kinetics
	in SELECTED_OUTPUT
	   IRM_RESULT RM_GetKineticReactionsName(id, i, line, length)

	Solid solutions
	---------------
	Number of solid solution components
	   int RM_GetSolidSolutionComponentsCount(id)
	Name of solid solution component; suitable for definitions of 
	-solid_solution in SELECTED_OUTPUT
	   IRM_RESULT RM_GetSolidSolutionComponentsName(id, i, line, length)
	Solid solution name containing the solid solution component
	   IRM_RESULT RM_GetSolidSolutionName(id, i, line1, length)
	   
	Saturation index phases
	-----------------------
	Number of phases appropriate for the elements defined in the reaction module
	   int RM_GetSICount(id)
	Name of phase in the reaction module; suitable for definitions of
	-si in SELECTED_OUTPUT
	   IRM_RESULT RM_GetSIName(id, i, line, length)
	   
 	-----------------
	June 24, 2018
	-----------------
	PHREEQC:
	Made the solid solution calculation with the Pitzer-model similar to the numerical 
	derivatives used in ion-association calculations.

	Bug-fix for porosities, which could be set incorrectly when porosities were not 
	defined in TRANSPORT simulations with more cells than before.

	Modified the diffusion properties for (possible) boundary cells in stagnant 
	calculations with enhanced transport through a Donnan layer. In version 3.4.2, 
	the harmonic mean of all the diffusional properties was introduced for all the 
	stagnant cells. However, many models use cell 3 and cell [2 + stagnant cells] 
	as outer, well-mixed reservoir solutions, and diffusion is then determined by 
	the properties of the boundary cells in the column (similar to the regular column, 
	where cells 0 and [cells + 1] are well-mixed). If cells 3 and [2 + stagnant cells] 
	are without a surface with a Donnan layer, they are taken as well-mixed now. 

	Thus:
	--cell 3 without donnan layer, cell 4 with a donnan layer: diffusion is determined 
	by the properties of cell 4.

	--cell 3 without donnan layer, cell 4 without a donnan layer: diffusion is determined 
	by the harmonic mean of the properties of cells 3 & 4.

	PHREEQC's choice can be manipulated, adding a surface with a very small number of sites 
	and a tiny Donnan layer in cell 3 and/or the cells it diffuses into, and similar 
	for cell [2 + stagnant cells]. See example opa_col3.phr (http://www.hydrohemistry.eu).

	A Donnan layer on SURFACEs can now be calculated with the Pitzer database.

	Bug-fixes for option -numerical_derivatives in KNOBS, setting it true may 
	improve convergence of donnan layer calculations 
	(for example, try it in http://www.hydrochemistry.eu/exmpls/membrane.phr).
	Overall iterations (this is, all the calls to CLI in a reaction step) are 
	printed in the output file if different from the iterations in the final set. 
	It can be USER_PRINTED/PUNCHED with the variable 'iterations'.

	Streamlined the output of -debug_prep in KNOBS. Added options 
	-debug_mass_balance (total moles of elements), and -debug_mass_action 
	(species data: log_k, dz, reaction stoichiometry).

	The numbers in the matrix for CLI can be inspected in 
	my_array[row * (count_unknowns + 1) + col].

 	-----------------
	May 1, 2018
	-----------------
	PhreeqcRM: Added new methods to retrieve log10 activity coefficients
	of aqueous species.
	
	C++ method:
	IRM_RESULT  GetSpeciesLog10Gammas (std::vector< double > &species_log10gammas) 
	
    Fortran method:	
	integer function RM_GetSpeciesLog10Gammas(integer, intent(in) id,  
       double precision, dimension(:,:), intent(out)  species_log10gammas) 

	C method:
	IRM_RESULT RM_GetSpeciesLog10Gammas(int id, double * species_log10gammas)  

	See documentation of PhreeqcRM in download distributions.

	-----------------
	April 28, 2018
	-----------------
	PHREEQC: Fixed bugs and inconsistencies (between RK and CVODE) when using 
	REACTION and KINETICS simultaneously.
	
	-----------------
	April 28, 2018
	-----------------
	DATABASE: Updated to latest version of core10.dat by Marc Neveu, which fixed
	a couple errors in the database.
	 
	-----------------
	March 9, 2018
	-----------------
	Bug fix in TRANSPORT: solutions were not updated when mixing was not 
	defined for the highest number of the stagnant cells.

	Bug fix in TRANSPORT: a SURFACE without any charged-surface component 
	could give a segmentation fault.

	-----------------
	March 7, 2018
	-----------------
	Input files with experimental data obtained at high T, P, and 
	salinity are installed by the phreeqc-installer in c:\phreeqc\high_P_T.

	Multicomponent diffusion in stagnant zones now uses the harmonic mean of 
	the cell properties, where earlier versions took the average. If the 
	properties are equal, the results will be identical; if the properties 
	vary, the cells with slow diffusion are now given stronger weight.
	In Example 21 (radial diffusion of tracers through Opalinus Clay), the 
	clay has other properties than the filters that hold the sample. For 
	matching the experimental results, the fit parameters were adapted 
	(CEC, EDL enrichment of 22Na+ and Cs+, tortuosity of 36Cl-, and the 
	geometrical factor for interlayer diffusion). For neutral species like 
	HTO, the calculations are not affected.

	The multicomponent diffusion function was rewritten to include diffusion 
	through the EDL's of differently charged surfaces. (Earlier versions 
	calculated diffusion through one EDL only, of the first surface in 
	alphabetical order.)

	Bug fix with pitzer database, when running with McInnes scaling, but without 
	Cl in the solution.

	-----------------
	February 20, 2018
	-----------------
	Phreeqc: Fixed a segmentation fault when Cl was absent from a 
	Pitzer calculation, but MacInnes scaling was used; further,
	the calculation was a redox calculation.
	
	-----------------
	February 17, 2018
	-----------------
	PhreeqcRM: 
	
	Removed obsolete header malloc.h from example
	files advection_c.c and species_c.c.
	
	Fixed bug in InitialPhreeqc2Module that did not properly
	account for representative volume not equal to one.
	
	Fixed pointer error in RMF_GetComponent.
	
	-----------------
	February 17, 2018
	-----------------
	PHREEQC: 
	
	Bug fix for calculating density of initial solution.
	
	Eliminated prints  of Total Carbon and Total CO2 in 
	"Description of solution" when values are zero.
	
	Print and punch of cells in transport calculations with 
	stagnant zones follows the order of the cell numbers.
	
	Enabled multicomponent diffusion among boundary and stagnant 
	cells, and of cells within a stagnant layer.
	For example, with 2 cells in the column, 1 stagnant layer:
	MIX 0; 4 0.5; MIX 4; 5 0.1
	
	Bug fix for electro-migration through a column (membrane) 
	that contains pure water.
	
	-----------------
	February 15, 2018
	-----------------
	
	PHREEQC: In agreement with IAPWS data 0-250 C, changed 
	the temperature damping coefficient of Dw for H+ to 1000 in 
	SOLUTION_SPECIES for Amm.dat, phreeqc3.dat, and pitzer.dat. 
	-dw 9.31e-9 1000 0.46 1e-10
	
	Added Hfo CO3-2 species to Pitzer.dat.
	
	Added new database for organic-ligand binding approximating WHAM by Tipping
	and Hurley.
	

Version 3.4.0: November 9, 2017 (svn 12927)

	The effect of an electrical field on multicomponent diffusion (electro-migration) is
	calculated with the Nernst-Planck equation if one of the 2 column end-cell solutions has
	a potential different from 0 (SOLUTION 0, SOLUTION cells + 1). For examples of electro-
	migration, see http://www.hydrochemistry.eu/exmpls/electro_dif.html. 
	
	A number of new features have been implemented for electro-migration.

	(1) The electric potential can be defined in keyword SOLUTION:
	
	SOLUTION 1
		-potential 3 # Volt
	

	(2) The electric current in a column experiment can be defined in keyword TRANSPORT:
	
	TRANSPORT
		-current 1e-3 # Ampere

	(3) When using -multi_d and -interlayer_d in TRANSPORT, the
	porosity for calculating interlayer diffusion is added to the porosity 
	defined with -porosities or -multi_d. For example:
	
	-porosities 0.3 0.29 0.28 ...
		-multi_d true 1e-9 0.3 0.05 1.0 false
		-interlayer_d true 0.07 0.01 250

	The total porosities will be 0.37, 0.36, 0.35, ... in cells 1, 2, 3, ...
	In previous versions, the interlayer porosity was subtracted from the porosity 
	defined with -multi_d.

	(4) If the properties in a regular column (surface areas, lengths, double layers,
	tortuosities, diffusion coefficients) are different for the two cells, the harmonic mean
	is used for calculating the mass transfer (Appelo et al., 2010, Geochim. Cosmochim. Acta
	74, 1201-1219).
	
	(5) The following Basic functions have been added:
	
	CURRENT_A      # the current through the column, amps.
	POT_V          # potential in a cell, volts.
	T_SC("Cl-")    # The transport- or transference-number of the ion, equal to the 
	               # fraction of the specific conductance contributed by the species(-).
	VISCOS         # At present, returns the viscosity of a pure water solution, same as
	               # VISCOS_0, milliPascal second.
	VISCOS_0       # Returns the viscosity of a pure water solution at current conditions
	               # milliPascal second.

	
	(6) A temperature damping factor and two parameters for ionic strength dependence were added for
	the calculation of the diffusion coefficient of a solute species:

	SOLUTION_SPECIES
	H+ = H+
		-dw	9.31e-9  763  0.46  1e-10
		
	where the first number is the diffusion coeficient at 25 C, and the second number is a damping
	factor for the temperature correction, as proposed by Smolyakov, according to Anderko and Lencka,
	1997, Ind. Chem. Eng. Res. 36, 1932-1943:
	
	Dw(TK) = 9.31e-9 * exp(763 / TK - 763 / 298.15) * TK * 0.89 / (298.15 * viscos).
	
	The ionic strength correction is as follows:
	Dw(I) = Dw(TK) * exp(-0.46 * DH_A * |z_H+| * I^0.5 / (1 + DH_B * I^0.5 * 1e-10 / (1 + I^0.75)))

	
	---------
	svn 12839
	---------
	PHREEQC: ColdChem.dat database has been expanded to include sulfate and sulfate
	salts. The database is described in a new journal article by Toner and Catling:
	Journal of Chemical & Engineering Data, 2017, 
	http://pubs.acs.org/doi/full/10.1021/acs.jced.7b00265.
	
	---------
	svn 12814
	---------
	PHREEQC: Error in dist_x function and in counting of cells for some transport
	problems.
	
	---------
	svn 12774
	---------	
	Added new database, core10.dat, contributed by Marc Neveu. The database
	is derived from phreeqc.dat and llnl.dat, with careful data checking,
	use of SUPCRT for temperature dependence, and addition of molar volumes
	for pressure dependence. 
	
	Downloaded July 18, 2017 from the following URL
	https://github.com/MarcNeveu/IcyDwarf/blob/master/IcyDwarf/PHREEQC-3.1.2/core10.dat
	
	Please see the following report for details:
	Neveu, Marc, Desch, S.J., and Castillo-Rogez, J.C., 2017, Aqueous geochemistry in 
	icy world interiors: Equilibrium fluid, rock, and gas compositions, 
	and fate of antifreezes and radionuclides, Geochimica et Cosmochimica Acta,
	v. 212, p. 324-371, http://dx.doi.org/10.1016/j.gca.2017.06.023
	
	---------
	svn 12758
	---------	
	PHREEQC: Changed the first parameter in the analytical expression for ethane C2H6.
	The negative sign was apparently omitted. 
	
	---------
	svn 12712
	---------	
	PHREEQC: GAMMA and LG functions were not correct
	for exchange species. 

	---------
	svn 12702
	---------	
	PHREEQC: Bug fix for when -no_check followed mineral
	name in PHASES. Now catches error if equation does not
	the next line following the mineral name. 
	
	---------
	svn 12683
	---------	
	PHREEQC: Bug fix for -donnan, -debye, and surface related
	to mineral that has zero moles.
	
	---------
	svn 12623
	---------	
	PHREEQC: Added a new option for a density calculation to SOLUTION
	and SOLUTION_SPREAD. The speciation calculation for a solution is
	iterated until the density used in the conversion of units is the
	same as the density calculated for the solution. It affects solutions 
	with concentrations defined as per liter (mg/L, for example).
	
	Here are three examples for specifying the calculation, where \t
	indicates a tab.
	
	SOLUTION
	-density 1.1 calculate
	
	SOLUTION_SPREAD
	-density 1.2 calculate
	
	SOLUTION_SPREAD
	pH\t        density\t
	charge\t    calculate\t
	7.0\t       1.03\t
	
	If the calculation is performed, the density in the description of
	solution part of the output will be identified with "(Iterated)".
	
	---------
	svn 12540
	---------	
	PHREEQC: Added new Basic function TITLE, which returns the last
	definition by a TITLE keyword data block.

Version 3.3.11: March 10, 2017 (svn 12535)
	---------
	svn 12480
	---------	
	PHREEQC: Added the ColdChem.dat database developed by Toner and
	Catling, Journal of Chemical & Engineering Data, 2017, DOI: 10.1021/
	acs.jced.6b00812. It is a comprehensive Pitzer model in the Na-K-Ca-Mg-
	Cl system valid for low temperature, from 298.15 to < 200 K.
	PHREEQC was modified to allow definition of the temperature dependence
	of A(phi) in the Pitzer formulation through a new option, -APHI, in 
	the PITZER keyword. The coefficients of the APHI expression are the
	same as the temperature dependence of other Pitzer parameters.
	A new Basic function, APHI, has been added to give the value of 
	the parameter in the current calculation.
	
	---------
	svn 12475
	---------	
	PHREEQC: Added logic to limit the range of the fugacity	coefficient.
	
	---------
	svn 12462
	---------	
	PHREEQC: Change to avoid potential NULL pointer in -multi_D
	calculations.
	
	---------
	svn 12439
	---------
	PHREEQC: Error check that the same element name was not used for
	both a SURFACE and and EXCHANGEr, which caused a NULL pointer. 
	Some variables in the unknown structure are now initialized.
	
	---------
	svn 12319
	---------
	PhreeqcRM: The Fortran version of RM_SpeciesConcentrations2Module did
	not provide the correct return value. Generally, -3 was returned
	(IRM_INVALIDARG), even if the method worked properly and should have
	returned 0 (IRM_OK).

Version 3.3.10: January 12, 2017 (svn 12220)
	---------
	svn 12204
	---------
	PHREEQC: Updated Basic function SYS("equi"...). The function now gives
	the correct amounts of equilibrium phases at the end of a reaction. 
	Previously, the function erroneously gave the amounts of equilibrium
	phases before reactions.
	
Version 3.3.9: November 15, 2016 (svn 11951)
	---------
	svn 11942
	---------
	PHREEQC: Updated sit.dat to version 9b0 from www.thermochimie-tdb.com. Changed
	documentation of some RATES definitions in Amm.dat to have the correct diameter
	assumed for mineral grains.

	---------
	svn 11915
	---------
	Phreeqc: Bug when surface was related to kinetics and the proportion of sites to
	kinetic reactant was zero (not common). The bug caused a segmentation-fault crash.
	
	---------
	svn 11914
	---------
	PhreeqcRM: Previously, the guess for the unknown for mass of water was the value
	from the last time step. For widely varying saturaations, the old value
	caused nonconvergence for the cell. Now the mass of water is estimated from the
	updated value of the moles of oxygen in the cell.

Version 3.3.8: September 13, 2016 (svn 11728)

	---------
	svn 11559
	---------
	PhreeqcRM: Added comment to output that user-grid cell numbers are 0 based (C-like).
	
	---------
	svn 11471
	---------
	PhreeqcRM: Removed tabs from RM_interface.F90.
	
	---------
	svn 11412
	---------
	PHREEQC: Fixed a potential bug where memcpy target and source locations
	overlapped.

	---------
	svn 11408
	---------
	PHREEQC: Implemented some changes for redox calculations with the Pitzer model.
	Revising master variable values when large concentrations occur, and basis
	switching between redox environments. Algorithm for initial estimates of 
	variables was also changed, as well as removing activity coefficient equations
	when not needed. 

	---------
	svn 11304
	---------
	PHREEQC: The file dw.cpp was removed from the source code. It contained obsolete
	code inherited from PHRQPITZ to calculate the density of water.
	
	---------
	svn 11284
	---------
	PhreeqcRM: Order of header files was changed to put mpi.h first to avoid potential header 
	conflicts with some MPI implementations.
	
	---------
	svn 11255
	---------
	PHREEQC: The Peng-Robinson gas calculation failed with very smally gas partial pressures. 
	Code was modified to set a minimum of 1e-10 atm for the calculation.
	
	---------
	svn 11255
	---------
	PhreeqcI: File/registry virtualization was disabled. Windows allowed users to write into
	system directories (Program Files for instance) even though they did not have sufficient
	permissions. The files were actually stored in another directory in the user's profile. 
	The files are difficult to find, and, under some conditions, PhreeqcI would fail. Now,
	it is not allowed to write into directories for which the user does not have write
	permission.
	
	---------
	svn 11201
	---------
	PHREEQC: Added new Basic function PHASE_VM("Calcite"). The function returns the molar volume
	for a mineral. The molar volume is defined for the mineral in PHASES with the -vm option. 
	Use the Basic function GAS_VM for gas components.
	
	---------
	svn 11152
	---------
	PHREEQC: Added two new Basic functions related to KINETICS.
	
	n$ = KINETICS_FORMULA$("Albite", count, elt$, coef)
	
	This function searches for a kinetic reaction definition (Albite, in the example). If found, n$
	is set equal to the first argument (Albite), otherwise an empty string is returned. The
	function returns these values: count is the number of items in the arrays elt$ and coef; elt$
	is a list of element names in the formula for the kinetic reaction; and coef is a numeric
	array containing the number of atoms of each element in the kinetic-reaction formula, in the
	order defined by elt$, which is alphabetical by element.
	
	m = SYS("kin", count , name$ , type$ , moles)
	
	This function identifies all of the kinetic reactants in the current KINETICS definition
	and returns the sum of moles of all kinetic reactants. Count is number of kinetic
	reactants. Name$ contains the kinetic reactant names. Type$ is "kin". Moles contains the
	moles of each kinetic reactant. The chemical formula used in the kinetic reaction can be
	determined by using a reaction name from Name$ as the first argument of the
	KINETICS_FORMULA$ Basic function.
	
	---------
	svn 11106
	---------
	Updated the online manual 
	(http://wwwbrr.cr.usgs.gov/projects/GWC_coupled/phreeqc/phreeqc3-html/phreeqc3.htm)
	to have revisions noted in italic text and better graphics for figures.

Version 3.3.7 (11094): April 21, 2016

	---------
	svn 11091
	---------
	Cerussite misspelled in 5 databases (Amm, minteq, minteq.v4, phreeqc, and wateq4f. 
	Modified Calcite RATES to handle M0=0. Added rate for quartz to wateq4f.dat.

	---------
	svn 11073
	---------
	PhreeqcI: The selected-output file was missing headers under some conditions, for example
	: SOLUTION;SELECTED_OUTPUT;END.
	
	---------
	svn 11072
	---------
	PhreeqcI: Fixed bug that overwrote selected output files when (re-)opening a .pqi file

Version 3.3.6 (11064): April 18, 2016
	---------
	svn 10952
	---------
	PhreeqcRM: InitialPhreeqcCell2Module method had incorrect indexing when using a mapping of model
	cells to chemistry cells that was not 1-to-1. The result was incorrect values for porosity, rv, and
	saturation.
	
	---------
	svn 10932
	---------
	PHREEQC: Additional error checking. In SOLUTION_MASTER_SPECIES the master species must contain the
	element name.

	---------
	svn 10929
	---------
	PHREEQC: If an aqueous species lacked a molar volume parameter (Vm), then the change in molar volume
	for reactions involving that species were not calculated correctly. Now summations of molar volumes,
	including zero for the species, are calculated.

	---------
	svn 10892
	---------
	PHREEQC: Added Vm values for Gibbsite, Kaolinite, Albite, Anorthite, K-feldspar, Ca-Montmorillonite,
	Talc, Illite, Chrysotile, Sepiolite, Hematite, Goethite, Pyrite, and Mackinawite for the phreeqc.dat
	and Amm.dat databases.
	
	---------
	svn 10877
	---------
	PHREEQC and PhreeqcI: PhreeqcI has updated documentation through the Help menu. All entries in green
	font are modifications, corrections, or new features.

	Corrected description of "EQUI" option of the SYS function. 
	
	-porosities is now an option in TRANSPORT for defining a heterogeneous distribution of porosity for
	-multi_d calculations.
	
	RHO_0 is a new Basic function that gives the density of pure water at the current temperature.
	
	EDL_SPECIES(surf$, count, name$, moles, area, thickness)
	
	Returns the total number of moles of species in the diffuse layer. The arguments to the function are
	as follows: surf$ is the name of a surface, such as "Hfo", excluding the site type (such as "_s");
	count is the number of species in the diffuse layer; name$ is an array of size count that contains
	the names of aqueous species in the diffuse layer of surface surf$; moles is an array of size count
	that contains the number of moles of each aqueous species in the diffuse layer of surface surf$;
	area is the area of the surface in m^2; thickness is the thickness of the diffuse layer in m. The
	function applies when -donnan or -diffuse_layer is defined in SURFACE calculations.
	
	Corrected description of "EQUI" option of the SYS function. 
	
	---------
	svn 10874
	---------
	
	PHREEQC: Corrected description of "EQUI" option of the SYS function. PhreeqcI has updated
	documentation through the help. All entries in green font are modifications, corrections, or new
	features.
	
	---------
	svn 10844
	---------
	PhreeqcI: Changed the way the current working directory is set. Now, the current working directory
	is not changed when browsing for and changing the database.
	
	---------
	svn 10843
	---------
	PhreeqcI: SOLUTION_SPREAD did not import correctly when using the P4W tab of PhreeqcI to generate
	the an example problem.
	
	---------
	svn 10834
	---------
	PHREEQC: In converting units of mass to moles per kilogram of water, it is possible to calculate a negative
	mass of water. This problem is now trapped, and an error message is issued.

Version 3.3.5 (10806): February 3, 2016

	---------
	svn 10804
	---------
	PHREEQC: Created an option to enter cell porosities in keyword TRANSPORT, which was
	motivated by the need to define porosities for a variable-porosity multicomponent diffusion 
	problem. Previously the Basic function CHANGE_POR had to be used to allow variable porosity.

		-porosities 0.3 0.29 0.28  # porosities of cells 1, 2, 3-n, used for calculating
					   # tortuosity in multicomponent diffusion calculations. The
					   # numbers entered here take precedence over the value given
					   # with -multi_D. If one stagnant layer is defined together with
					   # an exchange-factor > 0 ('-stagnant 1 4e-6 0.3 0.1'), the
					   # mobile (here = 0.3) and immobile (here = 0.1) porosities
					   # defined with -stagnant are used.
					   
	---------
	svn 10770
	---------
	IPhreeqc: Added optional argument sl to GetSelectedOutputValue in Fortran. The revised method
	is as follows, where sl is a new optional argument. 
	
	CHARACTER(LEN=40) :: sv
	status = GetSelectedOutputValue(id, i, j, vt, dv, sv, sl)
	
	In the example, if the character string generated in IPhreeqc and stored in sv is 40 characters or
	less, the value of sl will be 0. If the character string generated in IPhreeqc was greater than
	40 characters, the truncated string is stored in sv, but the value of sl will contain the length
	of the string before truncation.

	---------
	svn 10668
	---------
	All programs: Now using Jenkins for continuous integration. 
	
	---------
	svn 10664
	---------
	PHREEQC: Erroneous input could cause a segmentation fault for surfaces
	related to minerals or kinetics.

        ---------
        svn 10644
        ---------
	PHREEQC: Minor format change for specific conductance.

        ---------
        svn 10640
        ---------
	PhreeqcRM: Advection example in C and C++ had wrong MPI type for integer transfers.
	Example code in documentation also had wrong MPI type for some integer transfers. 
	Integer transfers in Fortran should use MPI_INTEGER, while integer transfers in 
	C and C++ should use MPI_INT.
	
        ---------
        svn 10632
        ---------
	PhreeqcRM: Revised transfer of data for MPI when rebalancing. Serializes lists of
	characters, integers, and doubles, instead of writing full "dump" version of each
	reaction. Is much faster for cell transfers when rebalancing among processes.
	
        ---------
        svn 10630
        ---------
	PhreeqcRM: Fixed bug when transferring data for MPI. Surface related to kinetics lost
	concentrations of sorbed elements.
	
        ---------
        svn 10585
        ---------
	Phreeqc: New set of convergence parameters that delay the removal of an unstable
	phase by 1 iteration. Also new KNOBS identifier, -equi_delay n, where n is the 
	number of iterations to retain an unstable phase.
	
        ---------
        svn 10537
        ---------
	Phreeqc: Comments for K-spar and Albite RATEs were incorrect for phreeqc.dat and
	wateq4f.dat
	
        ---------
        svn 10521
        ---------
	PhreeqcRM: Provided better error message for CreateMapping errors.
	
Version 3.3.3 (10424): October 23, 2015 
        ---------
        svn 10409
        ---------
	PhreeqcRM: C function clock() does not provide sufficient resolution. Efficiency calculation
	generated NaN, and rebalancing was poor. Revised to use MPI and OpenMP timers when available.
	
        ---------
        svn 10393
        ---------
	PhreeqcRM: Efficiency calculation generated NaN for OpenMP calculations.
	
        ---------
        svn 10385
        ---------
	PHREEQC: Fixed formula for pressure dependence of B1, B2, F1, F2 in the Pitzer formulation. 
	Previously had a limit of -10C; temperatures less than -10 produced a floating point exception
	and convergence failure.

        ---------
        svn 10364
        ---------
	IPhreeqc and PhreeqcRM: Debug version asserted when trying to write an error message to std::cerr.
	
        ---------
        svn 10359
        ---------
	PhreeqcRM: Added methods and documentation for RM_GetEndCell and RM_GetStartCell for C and Fortran.
	C++ methods already existed. The methods give the range of chemistry cell numbers that are assigned
	by each worker (OpenMP) or process (MPI). If rebalancing is enabled, these numbers may change as
	cells are shifted among workers or processes.

Version 3.3.2 (10335): October 2, 2015 
        ---------
        svn 10332
        ---------
        PhreeqcRM: Bug in configure scripts required developer zlib to be installed. Now
        zlib is only needed if the --with-zlib option is given in order to write compressed
        dump files (USE_GZ).

        ---------
        svn 10327
        ---------
        PHREEQC: Fixed bug with SOLUTION_SPREAD. Element names starting with "[" were
        not handled correctly.
        
	---------
	svn 10317
	---------
	PHREEQC: Handled case where GAS_PHASE components were not defined in PHASES. 
        
        ---------
        svn 10311
        ---------
        New R version submitted.

        ---------
        svn 10255
        ---------
        PhreeqcRM: Added new method SetScreenOn (RM_SetScreenOn) to control messages
        about rebalancing and any messages written with ScreenMessage (RM_ScreenMessage).
        
Version 3.3.0: September 15, 2015 	

	---------------
	svn 10160-10244
	---------------
	PhreeqcRM: Revised code to minimize memory footprint for MPI. Revised the logic
	so that some variables, like porosity and saturation, have only the values
	related to the cells that are defined to each worker. Previously, each worker
	had lists of these variables for all nxyz cells in the model. The changes
	should decrease the total amount of memory needed for MPI runs using PhreeqcRM.

        ---------------
        svn 10231&10237
        ---------------
        IPhreeqc: Fixed a bug in the Fortran module, where logical variables (such as
	print control) could be set to true, but not back to false.

        ---------
        svn 10177
        ---------
        PHREEQC: Additional print for Donnan layer.

        ---------
        svn 10176
        ---------
        Pitzer.dat: Updates to CO2 and CH4 in pitzer.dat affecting gas solubilities.

Version 3.2.2: August 24, 2015 
        ---------
        svn 10118
        ---------
        PhreeqcRM: Fixed same "feature" in C RM_GetBackwardMapping that
        resulted in very slow callback function response.
        
        ---------
        svn 10112
        ---------
        Modified exceptions IPhreeqcStop and PhreeqcRMStop to 
        compile on Linux.
        
        ---------
        svn 10107
        ---------
        Modified exceptions IPhreeqcStop and PhreeqcRMStop to 
        allow them to be caught with other std::exceptions.
        
        ---------
        svn 10089
        ---------
        Modified open_output_files and close_output_files so that
        stderr, stdout, and stdlog cannot be closed.
        
        ---------
        svn 10072
        ---------
        PhreeqcRM: Fixed a "feature" in Fortran RM_GetBackwardMapping that
        resulted in very slow callback function response.
        
        
        ---------
        svn 10053
        ---------
        Moved files to /common directory for files that are used in both
        phreeqc and phastinput.
        
        ---------
        svn 10047
        ---------
        In PhreeqcRM, made default rebalance fraction 0.0.
        
        ---------
        svn 10040
        ---------
        Bug in solution constructor caused PhreeqcRM debug tests to fail.
        
        ---------
        svn 10030
        ---------
        Null pointer if K-Cl interaction parameters (b0, b1, c0) were not defined.
        
        ---------
        svn 10013
        ---------
        The enrichment factor for diffusion in the diffuse layer was incorrectly
        implemented.

        ---------
        svn 10006
        ---------
        Fix rare instance where mu = 0 caused a divide by zero.
        
        --------
        svn 9998
        --------
        Pitzer.dat was adjusted to fit CO2 pressure and density by changing
        Vm, analytical expression, and adding a CO2-CO2 iteraction parameter.
                
        --------
        svn 9995
        --------
        Pressure of a gas phase mixture was calculated incorrectly in some 
        elevated T,P cases.
        
        --------
        svn 9915
        --------
        New Basic function EDL_SPECIES returns the moles of
        species in the electrical double layer. Applies when -DONNAN or 
        -DIFFUSE_LAYER are defined in SURFACE calculations.


	EDL_SPECIES(surf$, count, name$, moles, area, thickness)
	
	The function returns the total number of moles of species in the 
	diffuse layer. The arguments to the function are as follows:
	
	surf$ is the name of a surface, such as "Hfo", excluding
		the site type (such as "_s").
	count is the number of species in the diffuse layer.
	name$ is an array of size count that contains the
		names of aqueous species in the diffuse layer
		of surface surf$.
	moles is an array of size count that contains the number
		of moles of each aqueous species in the diffuse layer
		of surface surf$.
	area  is the area of the surface in m^2.
	thickness is the thickness of the diffuse layer in m.
	
	The volume of the diffuse layer is area * thickness, and
	the concentrations of the species in the diffuse layer are
	the number of moles divided by the volume.
        
        Example:
10 t = EDL_SPECIES("Hfo", count, name$, moles, area, thickness)
20 PRINT "Surface: Hfo"
30 PRINT "Area:       ", area
40 PRINT "Thickness:  ", thickness
45 PRINT "Volume:     ", area * thickness
50 for i = 1 to count
60   PRINT PAD(name$(i),20), moles(i)
70 next i	

Version 3.2.1: July 7, 2015 

        --------
        svn 9930
        --------
        PhreeqcRM had a serious error in the convertion of units from transport 
        to themodule. The error occurred when using H2O as a component and mg/L 
        as the transport unit. 


Version 3.2.0: June 10, 2015 

        --------
        svn 9809
        --------
        Pitzer calculations were optimized. The etheta calculation was improved
        thans to Wouter Falkena and the MoReS team. Inefficient loops were also
        rewritten.

        --------
        svn 9665
        --------
        See README.IPhreeqc.TXT for additional information about the IPhreeqc Module.

        The IPhreeqc module has been updated to use CMake (build process manager)
        for Visual Studio builds. CMake can be downloaded from http://www.cmake.org.
     
        Fortran, you will need to include the source file IPhreeqc_interface.F90
        in your project files. This file defines the IPhreeqc Fortran module.
     
        For example:

        USE IPhreeqc
        INTEGER(KIND=4) id
        id = CreateIPhreeqc()
        
        This replaces the need to use the include files IPhreeqc.f.inc/IPhreeqc.f90.inc.

        You will need to link to the IPhreeqc(d).lib/libiphreeqc.a that is created
        during the build process.

        --------
        svn 9639
        --------
        After reading a dumped surface (SURFACE_RAW), it was later processed 
        incorrectly, resulting in a mass loss of the elements that were attached 
        to the surface.
        
        --------
        svn 9639
        --------
        Revised SIT database from www.thermochimie-tdb.com (sit.dat). Version 9a, 
        released 7/28/2014. 
        
        --------
        svn 9639
        --------
        Revised numerical method for SIT aqueous model. Optimized processing of lists
        of SIT parameters, revised method to obtain initial values of master variables,
        added basis switching. 

        --------
        svn 9462
        --------
        RATES definitions were revised in all databases. The area parameter
        was changed to specific area (area per mole of reactant). Also, for aqueous kinetic
        reactions, the solution volume was added explicitly. The changes
        were made to facilitate a new version of PHAST that uses a representative
        volume that does not have one liter of water. 
        
        --------
        svn 9434
        --------
        Basic function lk_phase did not account for pressure properly. 
        
        --------
        svn 9424
        --------
        IPhreeqc Basic callback was modified to use ISO_C_BINDING. IPhreeqc
        will ultimately be a Fortran module.
        
        --------
        svn 9386
        --------
        Basic function SYS was missing the "equi" option to return
        the equilibrium phases in the current system.
        
	USER_PRINT
	10 t = SYS("equi", count, name$, type$, moles)
	15 PRINT "Number of equilibrium phases: ", count
	20 for i = 1 to count
	30   PRINT PAD(name$(i),20), moles(i)
	40 next i
	END
        
        t     is the total number of moles of equilibrium phases
        count is the number of equilibrium phases
        name$ is an array with the names of the equilibrium phases
        type$ is an array with "equi" for each equilibrium phase
        moles is an array with the number of moles of each equilibrium phase
        

        --------
        svn 9386
        --------
        New frezchem.dat database from Jonathon Toner and the 
        developers of the frezchem code (Toner and Sletten (2013),
        Marion and coworkers). Frezchem is a Pitzer model for temperatures
        of 0 C and below. 
        
        --------
        svn 9345
        --------
        Initial solution number for a reaction calculation is now assigned 
        for SOLUTION_SPREAD in all cases.
        
        --------
        svn 9345
        --------
        Adjustment to the Peng-Robinson calculation for example with SO2.
        
        --------
        svn 9324
        --------
        Fixed divide by zero if gas phase components had all zero partial
        pressures.
        
        --------
        svn 9309
        --------
        The function SURF gave incorrect results for O and H if O and H
        were in the master species (SurfOH, for example).

        --------
        svn 9308
        --------
        Bug with case dependence of mineral names when running transport. If
        case differed in adjacent cells for an EQUILIBRIUM_PHASE name, it could 
        lead to a program failure. Revised to remove case dependence.
        
        --------
        svn 9302
        --------
        Fixed Visual Studio static checker warnings.

        --------
        svn 9250
        --------
        Revised parameters for pitzer.dat. Additional temperature dependence,
        element Si was added, calcite parameters adjusted for higher temperature.



Version 3.1.7: February 10, 2015 
        --------
        svn 9203
        --------
        Fixed IPhreeqc. An error occurred when an empty string was sent to
        IPhreeqc from Fortran.



Version 3.1.6: January 21, 2015 
        --------
        svn 9191
        --------
        IPhreeqc "any" distribution was missing file fimpl.h for Windows builds.

        --------
        svn 9084
        --------
        Fixed initialization of cxxPPassemblage.
        
        --------
        svn 9165
        --------
        Fixed initialization of NameDouble.

Version 3.1.5: December 18, 2014 
        --------
        svn 9084
        --------
        Fixed warnings identified by CRAN.
        
        --------
        svn 9073
        --------
        Aqueous species H+ was missing from the list of species returned by
        SYS("aq", count, name$, type$, moles).
        
        --------
        svn 9072
        --------
        Added Basic function diff_c, which returns the diffusion coefficient
        for a species at 25 C.
        
        For example,
        d = DIFF_C("CO3-2")
        
        --------
        svn 9029
        --------
        In inverse modeling, the writing of input files for NetpathXL was 
        incorrect. Revisions to the program had eliminated a speciation
        calculation necessary to provide the correct values. 
        
        --------
        svn 9000
        --------
        Kinetic names were not saved correctly to allow unique retrival by name. 
        The error could have lead to misidentification of kinetic reactions for a
        cell.
        
        --------
        svn 8957
        --------
        Uninitialized variable for commands of USER_PUNCH.

Version 3.1.4: August 20, 2014 
        --------
        svn 8925
        --------
        
        Molar volume was not calculated correctly in mixing a gas. 
        
        --------
        svn 8923
        --------
        
        Acentric factor for H2(g) had positive sign. Corrected to 
        negative for H2(g) and Hdg(g) in phreeqc.dat, Amm.dat, and pitzer.dat.

        --------
        svn 8919
        --------
        
        When a batch kinetic reaction was simulated, followed by a transport 
        simulation with kinetics, the time was not reset between the 
        two simulations.


Version 3.1.3: August 6, 2014        
        --------
        svn 8895
        --------
        
        Missing initializations in class_main.
        
        --------
        svn 8879
        --------
        
        Pressure was incorrect in mix of GAS_PHASE. Also fixed
        a NULL pointer when the element in a gas phase was missing
        from the system.
        
        --------
        svn 8875
        --------
        
        Error reading dump of SURFACE when using no_edl option. 
        
        --------
        svn 8847
        --------
        
        Series of changes to correct memory leaks, uninitialized
        variables, variables set but not used, and other warnings 
        detected by Valgrind and Visual Studio.
        
        --------
        svn 8756
        --------
        
        Relative dielectric constant was not calculated correctly.
        
        --------
        svn 8755
        --------
        
        Basic function LK_SPECIES was changed to use the
        the log K as found in the SOLUTION_SPECIES
        definition. Previously, the log K was for the
        equations rewritten to the current master species.
        
        --------
        svn 8741
        --------
        
        Handling of isotopes uncertainty was inconsistent with 
        documentation in INVERSE_MODELING. Also missing 
        defaults for O and H redox states. 
        
        --------
        svn 8628
        --------
        
        Entities with negative user numbers are not dumped.
        
        --------
        svn 8622
        --------
        
        Modifications to meet R requirements. 
        
        --------
        svn 8576
        --------
        
        Fixed error when Pitzer or SIT parameter was redefined.
        
Version 3.1.2: March 1, 2014

        --------
        svn 8532
        --------
        
        Changed the way the pressure is assigned to a fixed-pressure
        gas phase in a reaction calculation. Previously, pressure
        of the gas phase did not change (unless GAS_PHASE_MODIFY
        was used). Now, if REACTION_PRESSURE is defined, it is
        used for the fixed pressure of the gas.
        

        --------
        svn 8520
        --------
        
        Changes in MCD to accomodate unequal cell lengths.
        
        --------
        svn 8502
        --------
        
        Modified not to DUMP temporary entities with negative user numbers.        

        --------
        svn 8484
        --------
        
        Modified to allow diffusion calculations in TRANSPORT with unequal
        cell lengths.

        --------
        svn 8469
        --------
        
        Logic for connecting points in USER_GRAPH was revised.

        --------
        svn 8453
        --------
        
        Error where punch file was deleted twice if there was a Basic error.
        No longer an error if you try to modify a non-existing entity (SOLUTION,
        EXCHANGE, etc), only a warning.
        
        --------
        svn 8378
        --------
        
        Removed yellow from colors for graphing; it was sometimes hard to see.
        Changed Li molar volume in pitzer.dat, Amm.dat, and phreeqc.dat.

        -------------
        svn 8371-8375
        -------------
        
        Multiple bug fixes pointed out by Marco De-Vroed. Set basic_interpreter 
        to NULL after deleting. Revised handling of initial data for initial-solution
        calculations. Revised logic for switching to numerical derivatives for 
        high-pressure calculations, the variable switch_numerical was removed.
        
        --------
        svn 8356
        --------
        
        Fixed bug with solution volume in initial solutions
        containing Alkalinity.

        --------
        svn 8301
        --------

        Density was not stored with the solution after a calculation.
        
        --------
        svn 8293
        --------
        
        Solution volume was not initialized in zero(), and pressure was not set correctly
        when mixing solutions.
        

Version 3.1.1: December 6, 2013

        --------
        svn 8203
        --------
        
        Updated more molar volumes in phreeqc.dat, Amm.dat, and
        pitzer.dat. Mn+2, Al+3, PO4-3, F-, Li+, Br-, Zn+2, Cd+2, 
        Cu+2, NH4+, HPO4-2, H2PO4-, and H3PO4, and other related
        ion pairs or complexes. Also estimated more ion size parameters
        for pairs and complexes. Molar volume approach is published
        in Appelo, Parkhurst, and Post, 2013, Geochimica et Cosmochimica 
        Acta, v. 125, p. 49-67.
	
        --------
        svn 7997
        --------
        
        Modified chart handling for PhreeqcI to allow charts from
	multiple runs to remain open for comparison. Charts will
	remain visible until closed.

        --------
        svn 7992
        --------
        
        Identifier -high_precision was added to the PRINT data
	block to allow higher precision for the PRINT Basic
	command, which is generally used in USER_PRINT
	definitions.

        --------
        svn 7987
        --------
        
        Now can have multiple SELECTED_OUTPUT n and USER_PUNCH n.
	SELECTED_OUTPUT 1 has the same functionality as previous
	versions of SELECTED_OUTPUT, with a set of default print
	definitions. SELECTED_OUTPUT n, where n is not equal to 1,
	has no fields initially defined; it is equivalent to an
	automatic -reset false.
        
        A file may be defined for each SELECTED_OUTPUT n that will
	recieve the output from the data block. Using i to
	represent a specific integer, USER_PUNCH i will write to
	the file defined for SELECTED_OUTPUT i. If USER_PUNCH i is
	defined, but SELECTED_OUTPUT i is not, then no data will
	be written from USER_PUNCH i.
        
        Printing to the selected-output files is controlled 
        by three identifiers. PRINT; -selected_output true/false
        will enable/disable printing of all selected-output 
        files. For an individual SELECTED_OUTPUT i definition,
        -active true/false will enable/disable both 
        SELECTED_OUTPUT i and USER_PUNCH i. Again for 
        SELECTED_OUTPUT i, -user_punch true/false will enable/
        disable the USER_PUNCH i data (rarely used).
        
        If SELECTED_OUTPUT i has been defined, a new data block
        of SELECTED_OUTPUT i will retain the previous definition
        if only -active and (or) -user_punch are defined. Defining
        any other identifier will cause the old definiton
        to be removed and its file closed; the data for 
        SELECTED_OUTPUT i will be defined entirely by the new 
        data block. 

        --------
        svn 7962
        --------
        
        Database modifications:
        
        pitzer.dat: Parameters have been reordered to alphabetical order.

        phreeqc.dat and Amm.dat: Vm refit for aqueous species Na+, CO3-2, SO4-2, NO3-, 
        HCO3-, NaCO3-, NaHCO3, NaSO4, KSO4. Analytical expression adjusted for gypsum, 
        anhydrite, and sylvite (delta H).        
        
        --------
        svn 7916
        --------
        
        Addition of a temperature-dependent pressure correction for the Debye-Hueckel term
	for the Pitzer formulation. An empirical, temperature-dependent pressure correction
	has been introduced in the Debye-Hueckel part of Pitzer's equation for gamma
	(activity coefficient), which lets the factor B vary from 1.2 to 1. Pitzer defined
	this number to be 1.2 for all pressures and temperatures.
        
        For monovalent species the correction is:
	     pap = (7e-5 + 1.93e-9 * (TK - 250)^ 2.0) * patm_x
	For divalent species the correction is:
	     pap = (9.65e-10 * (TK - 263)^ 2.773) * (patm_x^0.623)
	In both cases, pap is limited to less than 0.2.
	
	The factor B in the Debye-Hueckel factor is
	     B = 1.2 - pap
	     
	The Debye-Hueckel factor is
	     F = = -A0 * (DI / (1.0 + B * DI) + 2.0 * log(1.0 + B * DI) / B)
	where DI is the square root of the ionic strength.

        --------
        svn 7972
        --------
        
        A revised version of the manual is now  distributed as a
	compiled HTML file (phreeqc3.chm). It has corrections and
	new features highlighted in forest green.        
        
        --------
        svn 7920
        --------
        
        GAS_PHASE processing was incorrect for fixe-volume gas with
        multiple components. The wrong number of moles of gas 
        some gas components was calculated.
	
        --------
        svn 7896
        --------
        
        The manual wording was wrong or confusing in some places
	regarding the difference between fugacity (F) and
	(partial) pressure (P) of a gas. For ideal gases, P = F.
	However for Peng-Robinson gases F = P * phi / 1 atm
	(unitless).
        
        In EQUILIBRIUM_PHASES, the target saturation index for a
	gas is log10(P). In SELECTED_OUTPUT -saturation_index, for
	gases, the value printed will be the fugacity. For Basic
	functions SI and SR, the values are based on the fugacity.
	P and phi can be obtained with the Basic functions 
	PR_P and PR_PHI.
	
	For the Saturation Index block of the output file,
	the SI for a gas is its fugacity. However, for
	Peng-Robinson gases, P and phi are appended to the
	output line.
        
        --------
        svn 7884
        --------
        IPHREEQC: added a Basic function, CALLBACK, which
        allows data be passed to and from the calling
        program. The new IPhreeqc method is 
        
        for C,
        iresult = SetBasicCallback(ID, function name, cookie)
        
        and for Fortran,
        iresult = SetBasicFortranCallback(ID, function name)
        
        The two methods are necessary because arguments
        are handled differenctly between C and Fortran.
        The void pointer cookie in the C callback can be 
        used to allow the user-defined callback function 
        to find necessary data.
        
        The user-defined function for C must be of the form
        double my_callback(double, double, const char *, void *)
        
        For Fortran the function must be of the form
        double precision my_callback(double precision,
        double precision, character(*))
        
        As an example, to get the current time for 
        a calculation, the callback could be used as follows:
        
        Basic:
        10 date = CALLBACK(dummy, dummy, "Year")
        
        Fortran after registering my_callback by using
        SetBasicFortranCallback
        
        double precision function my_callback(x1, x2, string)
        USE date_module, only: year
        double precision x1, x2, my_callback
        character(*) string
        if (string .eq. "Year") then
        	return dble(year)
        endif
        end
        
        A usage of the callback feature has been added to the
	IPhreeqc example advect for Fortran, C, and C++.
	Additional documentation is in the .chm documentation
	files for IPhreeqc.

        --------
        svn 7867
        --------
        
        SOLUTION_MODIFY and SOLUTION_RAW were missing the 
        -pressure identifier. It has now been added.
 
        --------
        svn 7857
        --------
         
        Trapped error when solid-solution components were
        not defined correctly.
 
        --------
        svn 7855
        --------
        
        Error in pressure dependence when Pitzer or SIT 
        aqueous model was used. The pressure dependence
        was not calculated if the pressure was changed, 
        but the temperature was not. 
        
        --------
        svn 7829
        --------
        
        Added Basic fuction EQUIV_FRAC that returns the
        equivalent fraction of a surface or exchange
        species. The three arguments are
        (1) Species name (input),
        (2) Equivalents of exchange or surface sites
            per mole of the species (output),
        (3) The name of the surface or exchange site
            (output).
        For example,
        
        10 f = EQUIV_FRAC("AlX3", eq, x$)
        
        f = equivlalent fraction of AlX3 relative to 
            total equivalents of X sites.
        eq = 3.0
        x$ = "X"
        
        If the species name is not found to be a surface
        or exchange species, the return value is 0,
        the second argument is set to 0, and the third
        argument is set to an empty string.
        
        Also added synonyms for Basic functions 
        PHASE_FORMULA and SPECIES_FORMULA with trailing
        $ signs--PHASE_FORMULA$ and SPECIES_FORMULA$. 
        To be consistent with Basic, the functions should 
        have $ signs because they return strings.
        
        
        --------
        svn 7828
        --------
        
        Added Basic fuction SPECIES_FORMULA that returns the
        stoichiometry of an aqueous, exchange, or surface 
        species. The function returns a string: "aq" for 
        aqueous, "ex" for exchange, "surf" for surface, 
        and "none" if there is no species of that name.
        The four arguments are
        (1) the name of the species (input),
        (2) the number of elements, including charge (output),
        (3) an string array of element names (output),
        (4) a number array of coefficients corresponding to the elements (output).
        The following example:
        
10   name$ = "AlX3"        
20   ty$ = SPECIES_FORMULA(name$, count_s, elt$, coef)
20   print pad(name$, 15), ty$
30   for j = 1 to count_s
40     print pad(blank$, 5), pad(elt$(j),5), str_f$(coef(j), 5, 0)
50   next j       
	
	Produces the following output:
	
AlX3            ex 
      Al        1 
      X         3 
      charge     0 	
	
        --------
        svn 7781
        --------
        
        Basic function SYS("phases",...) returned 0.0, rather
	than the maximum saturation index if the maximum
	saturation index was less than zero. Now returns the
	maximum saturation index even if it is less than zero.
        
        Added new Basic function STR_E$(x, w, d) that produces
	a string with exponential format from a number with a
	given width (w) and number of decimal places (d). w is
	the minimum width of the string. The string is padded
	with spaces to the left to produce a string of the
	specified width (w); however, the string will be wider
	than w characters, if the number does not fit in the
	specified width. If x = 123456.789, then STR_E$(x,15,5)
	produces the following on a Windows computer:
	
	   1.23457e+005
	
        --------
        svn 7766
        --------
        
        Added new Basic function STR_F$(x, w, d) that produces
	a string from a number with a given width (w) and
	number of decimal places (d). w is the minimum width of
	the string. The string is padded with spaces to the
	left to produce a string of the specified width (w);
	however, the string will be wider than w characters, if
	the number does not fit in the specified width. If x =
	123456.789, then STR_F$(x,15,5) produces the following
	on a Windows computer:
	
	   123456.78900
	
        --------
        svn 7763
        --------
        
        Fixed bug with isotopes. Moles and molalities were
	incorrect if the mass of water in the SOLUTION was not
	1.0.


Version 3.0.6: June 4, 2013
        --------
        svn 7757
        --------
        
        Fixed bug introduced in version 3.0.5 if two DELETE
	keywords were used in a run. Fixed a bug with fixed-
	pressure gas, where the volume was 1.0 even when no
	moles of gas were present in the gas phase. Minor
	optimizations for initialization of Peng-Robinson gas
	data.
        
Version 3.0.5: May 31, 2013
        --------
        svn 7748
        --------
        
        Optimizations for equilibrium phases, using pointers
	instead of lookup function. Other optimizations for
	SURFACE calculations to limit uses of std::map find,
	eliminate strcmps, and skip inverse setup when not
	needed. Minor fix to Peng Robinson. Fixed bug with
	SOLUTION_MODIFY when a concentration was set to zero.
	Removed lower limit on ionic strength.

Version 3.0.4: May 14, 2013
        --------
        svn 7703
        --------
        Fixed bug in PhreeqcI that caused no warnings to be 
        included in the output file.

        --------
        svn 7677
        --------
        Gas-phase volume was not correct in SELECTED_OUTPUT
        -gas printout for Peng-Robinson calculations.
	
        --------
        svn 7677
        --------
        Added KIN_TIME Basic function, which gives the
        time interval in seconds of the last kinetic 
        integration. KIN_DELTA("xxx")/KIN_TIME will give
        the average rate over the time interval for 
        reaction xxx.
        
        For example,
        
        KINETICS
        Calcite
        	-m 1
        -step  864 8640
        
        KIN_TIME will return 864 after the first
        step and 8640 after the second. The result of
        KIN_TIME will be the same whether INCREMENTAL_
        REACTIONS is true or false (although TOTAL_
        TIME will differ).
        

       
Version 3.0.3: April 30, 2013

	Fixed errors in GAS_PHASE, -fixed_pressure used the
	sum of the input pressures instead of the defined
	total pressure in some cases, set upper limits in PR
	calculations; revised Basic function LK_SPECIES;
	logic for printing status line revised; fixed bug in
	SOLUTION_SPREAD, mass of water was not read properly;
	fixed problem with spaces in output file name;
	revised logic for checking if opening files was
	successful, old C-style check was incorrect; revised
	molar volume definitions and selected parameters in
	databases phreeqc.dat, Amm.dat, and pitzer.dat

Version 3.0.2: April 4, 2013

	Fixed an initialization error for activity of water
	that caused slow convergence. Dump wrote a file that
	caused read errors when some names exceeded 21
	characters. Gas_phase_modify did not work correctly.

Version 3.0.1: March 21, 2013

	Fixed bug in printing of solid solutions that caused
	a crash. The pressure dependence of log K in the
	printout of the equilibrium phases assemblage in the
	saturation index list was incorrect.

Version 3.0.0: February 1, 2013

	PHREEQC Version 3 is finally released. Major new
	features include pressure dependence for geochemical
	reactions, the nonideal gas formulation of Peng and
	Robinson, and charting. All features of PHREEQC
	Version 3 are documented in U.S. Geological Survey
	Techniques and Methods 6-A43, "Description of input
	and examples for PHREEQC Version 3--A computer
	program for speciation, batch-reaction, one-
	dimensional transport, and inverse geochemical
	calculations", available at
	http://pubs.usgs.gov/tm/06/a43/. Features not
	previously documented include Pitzer and SIT aqueous
	models, CD-MUSIC surface complexation, isotopic
	capabilities, and new keyword data blocks to
	manipulate reactants, such as RUN_CELLS, DELETE,
	COPY, _MODIFY, _RAW, and DUMP.

************************************************************
************************************************************
*        All features of PHREEQC Version 3 are             *
*        documented in Techniques and Methods 6-A43.       *
************************************************************
************************************************************

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!PREVIOUS RELEASE NOTES!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!PREVIOUS RELEASE NOTES!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!PREVIOUS RELEASE NOTES!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!PREVIOUS RELEASE NOTES!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!PREVIOUS RELEASE NOTES!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

************************************************************
*        Features in PHREEQC++ Not in PHREEQC version 2    *
*        PHREEQC++ is used only in IPhreeqc Modules        *
*        Revisions and Bug Fixes                           *
************************************************************
	
------------------------------------------------------------
Version 2.18.2: April  9, 2011
------------------------------------------------------------ 
        --------
        svn 5471
        --------
        Added PHASE_FORMULA and LIST_S_S Basic functions.
        
        PHASE_FORMULA returns a string value with the 
        chemical formula for the phase as defined in 
        PHASES data. If 4 arguments are provide, a list 
        of the elements and stoichiometric coefficients for 
        elements are returned.
        
        USER_PRINT
        10 min$ = "Calcite"
        20 form$ = PHASE_FORMULA(min$)
	30 print min$, form$
	40 form$ = PHASE_FORMULA(min$, count, elts$, coefs)
	50 for i = 1 to count
	60 print "   ", PAD(elts$[i], 20), coefs[i]
	70 next i 
	
	This example produces the following output:
	
Calcite CaCO3 
	C                               1 
	Ca                              1 
	O                               3 

        LIST_S_S returns the sum of moles of all components
        in a specified solid solution. Lists of the components
        and the number of moles of each component are also
        returned. 

   
	SOLID_SOLUTIONS 1
	Calcite_s_s
           -comp Calcite 0.01
           -comp Smithsonite 0.001
           -comp Strontianite 0.02
	USER_PRINT
        10 name$ = "Calcite_s_s"
	20 total = LIST_S_S(name$, count, comp$, moles)
	30 print PAD(name$, 20), total
	40 for i = 1 to count
	50 print "   ", PAD(comp$[i], 20), moles[i], moles[i]/total
	60 next i

        This example produces the following output:
        
Calcite_s_s           3.0876e-002 
    Calcite               9.9316e-003  3.2166e-001 
    Smithsonite           9.6666e-004  3.1308e-002 
    Strontianite          1.9978e-002  6.4704e-001 
    
        --------
        svn 5455
        --------
        REACTION_MODIFY keyword was added to the modules. Previously,
        REACTION_MODIFY was not recognized as a keyword.
        
        --------
        svn 5453
        --------     
        Fixed bug with in READ_SOLUTION_RAW. A read error occurred
        when -isotopes was encountered.
        
        --------
        svn 5448
        -------- 
        Reading of default user number, but specified description
        was in error under some conditions.
 
        --------
        svn 5431
        --------  
        RUN_CELLS was rewritten to perform multiple calculations
        if multiple steps are defined in REACTION, REACTION_TEMPERATURE,
        or KINETICS. It now operates in the same way that a 
        series of USE and SAVES would operate. Previously, only
        one step of a series of reaction steps was taken. If a 
        time step is provided in RUN_CELLS for kinetic reactions and
        nmax is the maximum number of steps defined for REACTION,
        REACTION_TEMPERATURE, and KINETICS, the time step is divided 
        into nmax equal increments. It is equivalent to the following
        definition in kinetics: -step time_step in nmax steps.
        
        --------
        svn 5324
        --------   
        Modified solution method for solid solutions so that
        mole transfers were limited to the total amount
        available in the system.
        
------------------------------------------------------------
Version 2.18.0: April  9, 2011
------------------------------------------------------------  

        --------
        svn 5281
        -------- 
        If SOLUTION_MODIFY is used to change a total for an element,
        the activities for the master species of the element are
        automatically updated by the ratio of the new total to the 
        old total, unless activities are specifically set for the
        element with -activities. All valence states of redox elements
        are adjusted.

        --------
        svn 5270
        --------
	Added logic to update estimates of log activity when
	modifying totals in SOLUTION_MODIFY. The initial 
	guesses for activities are adjusted proportionally
	to the change in total moles of elements (as defined
	by SOLUTION_MODIFY; -totals). 

	This automatic adjustment is suggested rather than
	explicit definition of the initial guesses through
	SOLUTION_MODIFY; -activities. However, the -activities
	identifier may be used and will supercede the automatic
	adjustment.  

	The adjustment of the initial guesses for activities
	should reduce the number of iterations needed to solve 
	a given set of equations and, consequently, should
	lessen the total CPU time for a simulation.
	
        --------
        svn 4897
        --------
        Added capability to include files within the input
        file. Files included in include files are also 
        included. Files are included verbatim and need not
        contain complete keyword datablocks; however, the
        combination of included files must result in a
        legal PHREEQC input file. Files are included as
        simulations are proceeding, so it is possible to
        write a file at one point of a run that is included
        later in the same run. Included files can contain
        INCLUDE$ directives.
        
        SOLUTION
        INCLUDE$ file_name
        END
        
        where "file_name" contains:
        EQUILIBRIUM_PHASES
        	Calcite 0 10
        
        is the same as a single file with 
        SOLUTION
        EQUILIBRIUM_PHASES
        	Calcite 0 10
        END
        
        --------
        svn 4856
        --------
        Revised logic of searching pitzer parameters so that
        order of ions in a parameter definition does not 
        matter. 
        
        --------
        svn 4823
        --------
        Added -cells to DUMP and DELETE; cell option to COPY.
        Example:
        
        COPY cell 1 4
        COPY cell 1 5-10
        DUMP 
         	-cell 1 2-3  10
        DELETE
        	-cell 1-3 4 8-10
        
        COPY cell n range
        
        The cell option of the COPY keyword causes all reactants
        defined with identifying number n to be copied to a single 
        range of numbers. The range of numbers can be a single 
        number or a range of numbers given by an integer, a 
        hyphen, and an integer, with no intervening spaces.
        
        DUMP
        	-cell list
        
        The  -cell option writes _RAW formatted output to a 
        specified file(see below for more details) for each 
        reactant that is defined in the list.
        
        DUMP
        	-cell list
        The -cell deletes from memory all reactants that are 
        defined with identifying numbers in the list.
        
        The list of numbers for DUMP and DELETE are
        more flexible than for COPY. A list of ranges can be 
        given for DUMP and DELETE, where each element of 
        the list can be a single number or a range of numbers
        defined by an integer, a hyphen, and an ingeger, with 
        no intervening spaces. 
        
        --------
	svn 4816
	--------
	Added compile capability to use #include file_name
	in input and database files. PHREEQCPP process the 
	files at the start of the run, possibly following
	multiple layers of include files, to produce a stream 
	that is then used as input. Compile define is
	MERGE_INCLUDE_FILES; PHREEQC_CLASS also must be defined.
	
	Input file:
	SOLUTION 1 
	#INCLUDE t2		  	 
	#include t4
	END 
	
	File t2:
	REACTION
		NaCl
		1 mmol
	#include t3
	
	File t3:
	REACTION_TEMPERATURE
	10 20 30
	
	File t4:
	SAVE solution 1
	
	When compiled with the include file #defines, the above 
	set of files produces the following input for PHREEQC:
	
	SOLUTION 1 
	REACTION
		NaCl
		1 mmol
	REACTION_TEMPERATURE
	10 20 30	
	SAVE solution 1	
	END 

	--------
	svn 4800
	--------
	
	Added capability to dump REACTIONs, REACTION_TEMPERATUREs,
	and MIXes.
	
	DUMP
		-mix  1 4 6
		-reaction 1-5
		-reaction_temperature 1 3-9
		
	List of numbers may be formatted as described for DUMP.
	Data are written in a format suitable for an input file
	to PHREEQCPP.
	
	Example of dumped keywords:
	
	MIX        1 
	  1     0.33
	  2     0.33
	  3     0.34
	REACTION_RAW        1 
	  -units              Mol
	  -reactant_list      
	    Ba   1
	    Br   2
	  -element_list       
	  -steps              
	    0.01 
	  -equal_increments   1
	  -count_steps        2
	REACTION_TEMPERATURE_RAW        1 
	  -count_temps        3
	  -equal_increments   1
	  -temps              
    		25 45 
	
	--------
	
	Added -cells option to DUMP.
	
	DUMP
		-cells 1-19 20
		
	This -cells option will dump any reactant with numbers
	between 1 and 20, including SOLUTIONs, EXCHANGERs,
	GAS_PHASEs, KINETICS, SOLID_SOLUTIONs, SURFACEs, REACTIONs, 
	REACTION_TEMPERATUREs, and MIXes.
	
	
	--------
	svn 3730
	--------
	
	Added keyword RUN_CELLS. 
	
	RUN_CELLS 
		-cells 1 2
		       5-6
		       7
		-time_step   10000
		-start_time  100
		
	
	For each i listed in -cells
	it is the equivalent of the following:
	
	USE solution i
	USE equilibrium_phases i
	USE exchange i
	USE surface i
	USE solid_solution i
	USE gas_phase i
	USE kinetics i
	USE reaction i
	USE reaction_temperature i
	SAVE solution i
	SAVE equilibrium_phases i
	SAVE exchange i
	SAVE surface i
	SAVE solid_solution i
	SAVE gas_phase i
	
	If MIX i is defined, it is used in place of USE solution i.
	A MIX i or SOLUTION i must be defined to use RUN_CELLS; -cells i.
	All other entities are used only if they are defined. 
	
	-start_time and -time_step are needed if any kinetic reactions
	are calculated. -start_time is the time at the start of the 
	calculation, and -time_step is the length of time over which 
	to integrate the kinetic reactions. 
	
	--------
	svn 3727
	--------
	Added keywords to allow modification of each reactant.
	A reactant must have been defined previously, but then
	each data item of the reactant can be changed and new
	components added. Data items read are changed, all 
	other data items remain the same. Input format is the 
	same as the RAW formats produced by DUMP. 
	
	
	New keywords are as follows:
	
	SOLUTION_MODIFY
	EQUILIBRIUM_PHASES_MODIFY
	EXCHANGE_MODIFY
	SURFACE_MODIFY
	SOLID_SOLUTIONS_MODIFY
	GAS_PHASE_MODIFY
	KINETICS_MODIFY
	
	The example below is indented to indicate which 
	information is necessary to change a data item.
	Working back through the indention levels for
	and item, each heading of a lower order is 
	necessary to define the data item. In the example
	below, to change the number of moles of barite from
	10 to 5 in the equilibrium phase assemblage, it 
	is necessary to define EQUILIBRIUM_PHASES_MODIFY 1; 
	-component; -name Barite; -moles 5. 
	
	Items identified by an asterisk are most likely to
	consider for redefinition. Items with (*) are
	marked to indicate that care is needed to maintain
	charge balance relations. Unwanted redox and pH
	reactions may result from incorrect redefinition
	of these quantities. Items not marked are either
	initial estimates of variables calculated in the
	simulation, or are parameters thought not likely
	to be changed.
	
	The MODIFY data blocks change the data in the
	PHREEQC storage structures. They do not cause
	any initial composition calculations. Neither 
	do they generate default reactions to be simulated.
	USE statements are needed to specify explicitly
	the desired reactions.

	
SOLUTION_MODIFY       1                                
  -temp              25                                *
  -total_h           111.01243359981                   (*)
  -total_o           55.506216800086                   (*)
  -cb                -3.6579285790756e-010             (*)
  -totals                                               
    Cl   0.0010000000000003                            (*)
    H(0)   1.4155655514601e-025                        (*)
    Na   0.0010000000000003                            (*)
  -Isotopes
  -pH                7
  -pe                4
  -mu                0.0010001035690258
  -ah2o              0.99996599647757
  -mass_water        1
  -total_alkalinity  3.6579283856577e-010
  -activities
    Cl   -3.0155266404974
    E   -4
    H(0)   -25.15
    Na   -3.0153891985103
    O(0)   -42.080029535586
  -gammas
EQUILIBRIUM_PHASES_MODIFY       1                      
  -eltList       
    Ba   1
    O   4
    S   1
  -component                                           *
    -name                  Barite
      -si                    0                         *
      -moles                 10                        *
      -delta                 0
      -initial_moles         0                         
      -force_equality        0
      -dissolve_only         0
      -precipitate_only      0
EXCHANGE_MODIFY       1                                
  -pitzer_exchange_gammas 1
  -component
    -formula               X
      -totals
        Na   1.0000000058717                           (*)
        X   1.0000000058717                            (*)
      -charge_balance        0
      -moles                 0
      -la                    3.0000000302372
      -phase_proportion      0
      -formula_z             0
      -formula_totals
        X   1
SURFACE_MODIFY       1 .
  -type 2
  -dl_type 0
  -sites_units 0
  -only_counter_ions 0
  -thickness 1e-008
  -debye_lengths 0
  -DDL_viscosity 1
  -DDL_limit 0.8
  -transport 0
  -component
    -formula               Hfo_s
      -formula_z             0
      -moles                 0
      -la                    -0.11486188676541
      -charge_balance        3.7853465372651e-005
      -phase_proportion      0
      -Dw                    0
      -formula_totals
        Hfo_s   0.01                                    
      -totals
        H   0.01003785346547                           (*)
        Hfo_s   0.010000000000097                      (*)
        O   0.010000000000097                          (*)
  -charge_component 
    -name                  Hfo
      -specific_area         600
      -grams                 1
      -charge_balance        3.7853465372651e-005      (*)
      -mass_water            0
      -la_psi                0.55146269389617
      -la_psi1               0
      -la_psi2               0
      -capacitance0          1
      -capacitance1          5
      -diffuse_layer_totals
SOLID_SOLUTIONS_MODIFY       1 
  -solid_solution
    -name                  Calcite
      -a0                    0
      -a1                    0
      -ag0                   0
      -ag1                   0
      -miscibility           0
      -xb1                   0.0
      -xb2                   0.0
      -component             
        calcite   0.1                                  *
        siderite   0.001                               *
GAS_PHASE_MODIFY       1 
  -type               0
  -total_p            1
  -volume             1
  -component
    CO2(g)   1.4305508698401e-005                      *
KINETICS_MODIFY      1 
  -step_divide       1
  -rk                1
  -bad_step_max      500
  -use_cvode         0
  -cvode_steps       100
  -cvode_order       5
  -component
    -rate_name             Calcite
      -tol                   1e-008
      -m                     0.9999999999991           *
      -m0                    1
      -moles                 8.9805940461929e-013
      -namecoef
        CaCO3   1
      -d_params
        1 1 1 1                                        *
  -totals         
    C   8.9801193858101e-013
    Ca   8.9801193858101e-013
    O   2.694035815743e-012
  -steps                 	
	
	--------
	svn 3719
	--------
	Added DELETE keyword to delete any numbered reactant, as
	listed in the example below. A list of single numbers and 
	number ranges are used to define the reactants to delete
	from PHREEQC memory. Lists may continue on subsequent 
	lines. Deletion occurs as the last step of simulation
	calculations, after all other calculations (initial 
	compositions, reactions, transport, inverse modeling) and
	COPYing have occurred. 

		
	DELETE
		-solution 2 	3
		-equilibrium_phases	2-3
		-exchange		2
			3
		-surface
			2-3
		-solid_solution
			2 3
		-gas_phase	2-3
		-kinetics	3 2
		-mix		2 
		-mix		3
		-reaction       2-3
		-temperature    
			2
			3
	--------
	svn 3704
	--------
	Added DUMP keyword. Writes complete data for solution,
	equilibrium_phases, exchange, surface, solid solution,
	gas phase, and kinetics classes. The format of the
	output is suitable for data input to the C++ version
	of PHREEQC. This feature allows the chemical state 
	of a simulation	to be saved and read back in as 
	initial conditions for subsequent model runs.
	
	Examples:
	DUMP
		-all
		-file    myfile.dmp
	END	
	DUMP
		-file	 myfile.dmp
		-append  true
		-solution	1-2 3
		-equi		3 1-2
		-exch		1 2 3
		-surf		1
				2
				3
	
		-s_s		1
				2-3
		-gas		1
		-gas		2
		-gas		3
		-kin		1-3
	END	
		
	Explanation:
	The first DUMP datablock will write the compositions at 
	the end of the simulation (after all simulation calculations,
	TRANSPORTs, SAVEs, and COPYs are complete) for 
	every solution,	equilibrium_phases, exchange, surface, 
	solid solution, gas phase, and kinetics entities that have
	been defined or produced in the run. This write includes
	internally saved entities (usually assigned negative numbers).
	
	The second DUMP data appends the compositions of items
	numbered 1-3 to myfile.dmp, if they exist. The second example
	shows multiple ways to define the entities to be dumped to
	file.

	------
	Begin
	------
	PHREEQC++ has classes that are equivalent to the PHREEQC C 
	structures. Each class has a method to "dump_raw" the 
	entire set of class data. The lines generated by dump_raw
	can be read as keyword data blocks in an input file. The following
	keywords are available in PHREEQC++: SOLUTION_RAW, 
	EQUILIBRIUM_PHASES_RAW, EXCHANGE_RAW, SURFACE_RAW, 
	SOLID_SOLUTIONS_RAW, GAS_PHASE_RAW, and KINETICS_RAW. 
	PHAST uses these classes and data blocks to dump the chemical
	state of a simulation and read it back in as a starting
	point for subsequent simulations. 
	
	Examples of raw output are given below. Some of the fields
	are required and some are not. 
	
	SOLUTION_RAW       1 
	  -temp              25
	  -pH                7
	  -pe                4
	  -mu                0.0010001035690258
	  -ah2o              0.99996599647757
	  -total_h           111.01243359981
	  -total_o           55.506216800086
	  -cb                -3.6579285790756e-010
	  -mass_water        1
	  -total_alkalinity  3.6579283856577e-010
	  -totals
	    Cl   0.0010000000000003
	    H(0)   1.4155655514601e-025
	    Na   0.0010000000000003
	  -activities
	    Cl   -3.0155266404974
	    E   -4
	    H(0)   -25.15
	    Na   -3.0153891985103
	    O(0)   -42.080029535586
	  -gammas
	  -Isotopes
	EQUILIBRIUM_PHASES_RAW       1 
	  -eltList       
	    Ba   1
	    O   4
	    S   1
	  -component
	    -name                  Barite
	    -si                    0
	    -moles                 10
	    -delta                 0
	    -initial_moles         0
	    -force_equality        0
	    -dissolve_only         0
	    -precipitate_only         0
	EXCHANGE_RAW       1 Exchange assemblage after simulation 3.
	  -pitzer_exchange_gammas 1
	  -component
	    -formula               X
	    -moles                 0
	    -la                    3.0000000302372
	    -charge_balance        0
	    -phase_proportion              0
	    -formula_z                     0
	    -totals
	      Na   1.0000000058717
	      X   1.0000000058717
	    -formula_totals
	      X   1
	SURFACE_RAW       1 Surface assemblage after simulation 4.
	  -type 2
	  -dl_type 0
	  -sites_units 0
	  -only_counter_ions 0
	  -thickness 1e-008
	  -debye_lengths 0
	  -DDL_viscosity 1
	  -DDL_limit 0.8
	  -transport 0
	  -component
	    -formula               Hfo_s
	    -formula_z             0
	    -moles                 0
	    -la                    -0.11486188676541
	    -charge_balance        3.7853465372651e-005
	    -phase_proportion      0
	    -Dw                    0
	    -formula_totals
	      Hfo_s   0.01
	    -totals
	      H   0.01003785346547
	      Hfo_s   0.010000000000097
	      O   0.010000000000097
	  -charge_component 
	    -name                  Hfo
	    -specific_area         600
	    -grams                 1
	    -charge_balance        3.7853465372651e-005
	    -mass_water            0
	    -la_psi                0.55146269389617
	    -la_psi1               0
	    -la_psi2               0
	    -capacitance0          1
	    -capacitance1          5
	    -diffuse_layer_totals
	SOLID_SOLUTIONS_RAW       1 
	  -solid_solution
	    -name                  Calcite
	    -a0                    0
	    -a1                    0
	    -ag0                   0
	    -ag1                   0
	    -miscibility           0
	    -xb1                   -6.2774385622042e+066
	    -xb2                   -6.2774385622042e+066
	    -component             
	      calcite   0.1
	      siderite   0.001
	GAS_PHASE_RAW       1 
	  -type               0
	  -total_p            1
	  -volume             1
	  -component
	    CO2(g)   1.4305508698401e-005
	KINETICS_RAW       1 
	  -step_divide       1
	  -rk                3
	  -bad_step_max      500
	  -use_cvode         0
	  -cvode_steps       100
	  -cvode_order       5
	  -component
	    -rate_name             Calcite
	    -tol                   1e-008
	    -m                     1
	    -m0                    1
	    -moles                 0
	    -namecoef
	      CaCO3   1
	    -d_params
	      1 1 1 1 
	  -totals         
	  -steps         
	    




************************************************************
*        Features in PHREEQC version 2 not                 *
*        documented in WRIR 99-4259.                       *
************************************************************

------------------------------------------------------------
Version 2.18.3: April  10, 2011
------------------------------------------------------------         
        --------
        svn 5570
        -------- 
        If -high_precision is set to true in SELECTED_OUTPUT,
	convergence tolerance is set to 1e-12. If 
	-high_precision is set to false, convergence tolerance
	is not changed. KNOBS; -convergence_tolerance sets the
	convergence tolerance to a specified number. The last
	definition (-high_precision true or
	-convergence_tolerance) takes precedence for a
	calculation.
        
------------------------------------------------------------
Version 2.18.0: April  9, 2011
------------------------------------------------------------        
        --------
        svn 5212
        --------
        Added gfm (gram formula mass) as a synonym to gfw in 
        reading concentration data for SOLUTION.
        
        S(6)  1 gfm 96
        
        is equivalent to
        
        S(6)  1 gfw 96.

        --------
        svn 5170
        --------
        Added ceil and floor Basic functions. Ceil(x) is the 
        smallest integer greater than or equal to x. Floor(x)
        is the largest integer less than or equal to x. Note
        that all numbers in Basic are of type double in C. 
        
        USER_PRINT
        10 print ceil(2.8), floor(2.8), ceil(-2.8), floor(-2.8)  
        
        This USER_PRINT Basic program has the following output:
        
        3            2           -2           -3 


        --------
        svn 4988
        --------
        Added EOL$ Basic function. EOL$ is the end of line
        character for whatever operating system you are
        running. 
        
        USER_PRINT
        10 PRINT "line 1"+EOL$+"line 2"+EOL$
        
        The result of this USER_PRINT is
        
        line 1
	line 2
       
        --------
        svn 4942
        --------
        Added additional parameter in PRINT for status. Writing
        the status line to the screen can slow calculations
        substantially under some conditions.
        
        PRINT
        -status (t|f|n)
        
        t--Print status line.
        f--Do not print status line.
        n--Print status line every n milliseconds.
        
        -status 1000 would print the status line every 
        second.
        
        --------
        svn 4830
        --------
        Changed default for exchange species activty 
        coefficients to be equal to the Pitzer
        aqueous activity coefficients when using Pitzer
        aqueous model. Default is
        -pitzer_exchange_gammas true.


------------------------------------------------------------
Version 2.17.5: September  7, 2010
------------------------------------------------------------

------------------------------------------------------------
Version 2.17.4: September  2, 2010
------------------------------------------------------------

        --------
        svn 4771
        --------
        Added synonyms to TOTMOLE: TOTMOL, TOTMOLES
        
------------------------------------------------------------
Version 2.17.3: August 12, 2010
------------------------------------------------------------

        --------
        svn 4191
        --------
        Added new Basic functions:
        
        10 total_Ca_in_moles = TOTMOLE("Ca")
        
        TOTMOLE provides the total number of moles of an element
	or element valence state in solution. Special values are
	"water", which gives number of moles of water, and
	"charge", which gives total equivalents of charge
	imbalance in solution (same as Basic function
	CHARGE_BALANCE). In contrast, the Basic function TOT
	returns moles per kilogram of water, or equivalents per
	kilogram of water for TOT("charge").
        
        10 O18_permil = ISO("[18O]")
        
       
        ISO gives an isotopic composition in the input units for
	an isotope--permil, pmc, or TU in current version of
	iso.dat. The string argument can be an isotope name, or
	any item defined in the ISOTOPE_RATIOS data block, For
	example, ISO("R(13C)_Calcite") will return the carbon-13
	composition of the calcite solid solution in permil
	because of the definitions in iso.dat.
        
        10 D_units$ = ISO_UNITS("D")
        
        ISO_UNITS gives the input units for the isotope, D_units$ =
	"permil" in the example. The string argument can be an
	isotope name or an item defined in the ISOTOPE_RATIOS data
	block as explained for the Basic function ISO.
        
------------------------------------------------------------
Version 2.17.0: February 25, 2010
------------------------------------------------------------

        --------
        svn 4006
        --------

        Changed the calculation of Specific Conductance (SC, uS/cm)
        to be for the actual temperature of the SOLUTION (in output
        and in BASIC function SC).
        Previous versions calculated SC for 25 °C, whereas the
        complexation model is done at the actual temperature.
        To obtain SC at 25 °C, use keyword REACTION_TEMPERATURE,
        for example:
        
           SOLUTION 1; K 1; Cl 1; -temp 99
           REACTION_TEMPERATURE; 25
           END
           
        The following example prints to the selected output
        file the equivalent conductance in (mmho/cm / eq/L) at
        20 degrees C for a 1:1 chloride salt solution:

        USER_PUNCH
                -head conc eq_EC_20
                -start
        10 punch tot("Cl"), SC / tot("Cl") * 1e-3
                -end

        where 1e-3 converts from microSiemens/cm to mmho/cm.
        (The example given with svn 2448 multiplies SC's incorrectly
        with the ratio of the temperatures.)
        --------
        svn 3986
        --------
        Added an option for time-substepping in multicomponent
        diffusion (-multi_D true), keyword TRANSPORT:
        
        -time_step 3600 3.0  # 3 time-substeps of 1200 seconds
         
        This option is useful to avoid a warning about negative 
        concentrations that may occur in MCD simulations.
        
        --------
        svn 3902
        --------
        Added four basic functions for use only with PHAST. The
        functions are related to the volume, porosity, and 
        water saturation of a PHAST finite-difference cell:
         
        CELL_VOLUME--The total volume of the cell in liters.
        CELL_PORE_VOLUME--The void volume of the cell in liters.
        CELL_SATURATION--The fraction of the void volume filled
                with water, unitless.
        CELL_POROSITY--The porosity of the cell, equal to 
                CELL_PORE_VOLUME / CELL_VOLUME, unitless.
                
                
        For example, in a USER_PUNCH program for a PHAST run,
        the number of moles of dissolved chloride in a cell is
        TOT("Cl")*CELL_PORE_VOLUME for confined flow simulations.
        More generally, the number of moles of dissolved chloride
        is TOT("Cl")*CELL_SATURATION*CELL_PORE_VOLUME, for confined
        or unconfined flow.
         
        For solids, the number of moles of calcite in the 
        saturated part of a cell is 
        EQUI("Calcite")*CELL_SATURATION*CELL_PORE_VOLUME. For 
        unconfined flow, the solid reactants are distributed 
        between the saturated and unsaturated part of a water- 
        table cell. It is a limitation of PHAST that it is not 
        possible to determine the amounts of solid reactants 
        in the unsaturated part of a cell. Note that for 
        steady-state, unconfined flow, the saturation of cells is 
        constant and the unsaturated part of a water-table cell 
        is never part of the active domain.
        
        --------
        svn 3600
        --------
        A new 1/T^2 term (A5 coefficient) was added for all Pitzer-parameter 
        temperature expressions.
        
        P = A0 + A1*(1/TK - 1/TR) + A2log(TK/TR) + A3*(TK-TR) +
                A4*(TK*TK - TR*TR) + A5*(1/(TK*TK) - 1/(TR*TR))
        
        where TK is temperature in Kelvin. The optional A5 parameter
        is read following A4.

        --------
        svn 3591
        --------        
        Added T^2 term to analytical expressions for log k. A T^2 term
        can now be used in the analytical expressions for any log K. 
        The analytical expression is as follows:
        
        log10(K) = A1 + A2*TK + A3/TK + A4*log10(TK) + A5/TK^2 + A6*TK^2,
        
        where TK is in Kelvin. The A6 term is the new addition. The optional 
        A6 parameter is read following A5.
        
        --------
        svn 3485
        --------        
        Added the active fraction model for calculating exchanger
        compositions described by Appelo (1994), Water Resour. Res. 30,
        2793-2805. The active fraction model is useful for calculating
        the decrease of selectivity when concentrations increase (more
        specific sites being filled first). In the active fraction model,
        log(K) of an exchange-half reaction depends on the equivalent
        fraction on the exchanger:

                log(K) = log_k + a_f * (1 - x_i)

        where log_k is the log of the equilibrium constant when all the 
                        sites are occupied by ion i,
                a_f is an empirical coefficient, and
                x_i is the equivalent fraction of i.

        a_f can be defined in EXCHANGE_SPECIES with -gamma after the WATEQ
        Debye-Hueckel parameters.
        Example:

                EXCHANGE_SPECIES
                 Na+ + X- = NaX; log_k -0.5
                 -gamma 4.0 0.075 0.50

        The association constant for NaX becomes:
                  log(K) = -0.5 + 0.50 * (1 - x_Na)
                  
        --------
        svn 3453
        --------
        Added Specific ion Interaction Theory (SIT) activity coefficient
        model as described in Grenthe, Ingmar, Plyasunov, A.V., and
        Spahiu, Kastriot, 1997, Estimations of medium effects on
        thermodynamic data, in Modelling in Aquatic Chemistry,
        Grenthe, Ingmar, and Puigdomenech, Inasi, eds, OECD
        Publications, ISBN 92-64-15569-4, 724 p. 

        Implementation is similar to the PITZER implementation, a
        database with the SIT keyword invokes the SIT activity
        coefficient model. Currently, No database is provided.

        The SIT keyword has two identifiers,
        -epsilon and -epsilon1, where -epsilon gives the pairwise
        interaction parameters and -epsilon1 gives the linear ionic
        strength dependency of epsilon, if available. Both parameters
        allow for temperature dependence with the same expression used
        in PITZER. The five-term expression for temperature dependence is 
        as follows:

        P = A0 + A1*(1/TK - 1/TR) + A2log(TK/TR) + A3*(TK-TR) +
                A4*(TK*TK - TR*TR),

        where TK is Kelvin and TR is 298.15.

        Example:
        SIT
                -epsilon
                Na+             Br-             0.05    #   0.01
                Na+             Cl-             0.03    #   0.01

                -epsilon1 # not currently used


        --------
        svn 3288
        --------

        Additional arguments for the EDL function for the CD_MUSIC 
        surface complexation model. The values of charge, sigma, and psi 
        for the 0, 1, and 2 planes can be obtained from the EDL function.

                EDL("element", "surface") gives the amount of 
                        element in the diffuse layer for "surface".
                        not including sorbed species. "surface" should 
                        be the surface name, not the surface-site name 
                        (that is, no underscore).

                Special values for "element" include:
                        "charge" - surface charge, equivalents. 
                                   For CD_MUSIC "charge" refers to plane 0.
                        "charge1"- surface charge on plane 1, equivalents
                                   (CD_MUSIC only).
                        "charge2"- surface charge on plane 2, equivalents
                                   (CD_MUSIC only).                                    
                        "sigma"  - surface charge density, C/m**2.
                                   For CD_MUSIC "sigma" refers to plane 0.                       
                        "sigma1" - surface charge density on plane 1, 
                                   equivalents (CD_MUSIC only).
                        "sigma2" - surface charge density on plane 2, 
                                   equivalents (CD_MUSIC only).  
                        "psi"    - potential at the surface, Volts.
                                    For CD_MUSIC "psi" refers to plane 0. 
                        "psi1"   - surface charge density on plane 1, 
                                   equivalents (CD_MUSIC only). 
                        "psi2"   - surface charge density on plane 2, 
                                   equivalents (CD_MUSIC only).
                        "water"  - mass of water in the diffuse layer, kg.        
        --------
        svn 3189
        --------
        Density of solutions is now calculated from the concentrations
        of dissolved species. The algorithm has been described by Millero 
        (1974), Millero (2000), Millero (2001) and has been used 
        successfully by Millero and Lepple (1973), Millero et al (1976), 
        Fernendez et al. (1982) and Millero (2000) to calculate the 
        density of seawater, estuaries, lagoons and lakes. 
        
        The calculation relies on apparent molar volumes phi(i),
        for individual aqueous species according to the following formula:
        
        phi(i) = phi(i,inf) + s(t)I^0.5 + beta(i)I
        
        where phi(i,inf) is the apparent molar volume of species i at 
        infinite dilution, s(t) is the Debije-Hückel limiting slope, beta(i)
        is an empirical constant, and I is the ionic strength.
        
        s(t) is calculated as a function of temperature. Parameterizations of
        phi(i,inf) and beta(i) use the following formulas:
        
        phi(i,inf) = a + bt +ct^2
        beta(i) = d + et + ft^2
        
        where a, b, c, d, e, and f are empirical constants and t in Celcius.
        Data input of the constants are in the keyword data block SOLUTION_SPECIES
        using the new identifier -millero.
        
        Example:
        
        SOLUTION_SPECIES
        Na+ = Na+
        log k 0.0
        -gamma 4.0 0.075
        -dw 1.33e-9
        -millero -3.46 0.1092 -0.000768 2.698 -0.106 0.001651
        
        Apparent molar volume parameters have been included in the database
        phreeqd.dat. Calculations made with this database will include
        the calculated density in the "Description of solution".
        
        A new basic function, RHO, can be used to obtain the density in 
        USER_PRINT, USER_PUNCH, and RATES data blocks.
        
        Example:
        
        USER_PUNCH
        -heading density
        10 PUNCH RHO
        
        --------
        svn 3183
        --------
        Added option for an equilibrium-phase to precipitate only,
        parallel to dissolve_only option.
        "pre" is added at the end of a line defining an equilibrium-
                phase. No data fields may be omitted. Should not
                be used when adding an alternative reaction.        
        Example:
                EQUILIBRIUM_PHASES
                Dolomite 0  0.1   dissolve_only
                Quartz   0  1.5   precipitate_only 
        
        --------
        svn 3160
        --------        

        Surface charge must be higher than -3000 equivalents,
        when the diffuse double layer composition is
        calculated with option -donnan.

        --------
        svn 3149
        --------
        
        Diffusion through DDL water is multiplied with c_DDL,i / c_i
        with option -only_counter false. c_DDL,i is the concentration in
        DDL water, c_i is the concentration in free porewater. (Previous
        versions used a multiplier of 1).

        Added -erm_ddl as parameter for aqueous species, to be defined
        with keyword SOLUTION_SPECIES. erm_ddl (> 0) is an
        enrichment factor in DDL water calculated with option -donnan:
                c_DDL,i = c_i * Boltzmann_factor * erm_ddl
        Example:
        SOLUTION_SPECIES; Cs+ = Cs+; log_k 0; -erm_ddl 2.1
        Default: erm_ddl = 1.0.

        Added optional multicomponent diffusion of cations in interlayer
        space of montmorillonite to keyword TRANSPORT.
        In the example,
                interlayer diffusion is true (default = false), 
                interlayer porosity is 0.09 (default = 0.1),
                the porosity where interlayer diffusion stops is 0.01
                 (default is 0),
                the tortuosity factor is 150 (default = 100).

                TRANSPORT
                -interlayer_D true 0.09 0.01 150

        With interlayer_D true, also -multi_D true (and other
        parameters) must be set, for example:
                 -multi_d true 1e-9 0.3 0.05 1.0
        Interlayer diffusion is calculated for the cations associated with X-,
        defined with keyword EXCHANGE.
                Mass_transfer = -A * (Dw' / t_f) * c_CEC * grad(beta)
        A is surface area, A_porewater * (interlayer porosity / free
                porewater porosity),
        Dw' is the temperature corrected diffusion coefficient of the
                aqueous species (defined in SOLUTION_SPECIES),
                corrected to zero charge transfer,
        t_f is the interlayer tortuosity factor (-),
        c_CEC is concentration of total X-, mol(X-) / (L interlayer
                water). L interlayer water = (L porewater + L DDL-
                water) * (interlayer porosity / free porewater porosity),
        grad(beta) is the gradient of the equivalent fraction.

        --------
        svn 2969
        --------
        Added basic functions that return the activity coefficient of
        an aqueous species (gamma) and the log base 10 of the activity
        coefficient of an aqueous species (lg).

        USER_PUNCH
                -start
        10 punch gamma("H+")    # activity coefficient
        20 punch lg("H+")       # log base 10 activity coefficient
                -end

        The functions return zero if the species is not defined for
        the aqueous model or if the species is an exchange or surface
        species.

------------------------------------------------------------
Version 2.15.0: February 5, 2008
------------------------------------------------------------

        --------
        svn 2680
        --------

        Identifiers for paramaters controlling the integration by
        CVODE have been added in the KINETICS data block. 
        
        -bad_step_max     bad_steps
        -cvode_steps      steps
        -cvode_order      order

        -bad_step_max bad_steps--This option was used only in the
        Runge-Kutta method. Now, the value of this option is used for
        CVODE as well. The value entered is the number of times that
        PHREEQC will invoke CVODE to try to integrate a set of
        rates over a time interval. Default is 500.

        -cvode_steps steps--The value given is the maximum number of
        steps that will taken during one invocation of CVODE.   
        Default is 100.

        -cvode_order order--CVODE uses a specified number of terms in
        an extrapolation of rates using the BFD method. Legal values
        are 1 through 5. A smaller value (2) may be needed if the rate
        equations are poorly behaved. The default is 5. 

        --------
        svn 2457
        --------
        Added options to inverse modeling to translate current
        solution definitions in PHREEQC to a Netpath .lon file and
        (or) to .pat and model files.

        INVERSE_MODELING
           -lon_netpath  prefix

        At the beginning of the inverse modeling calculation, each
        solution that has been defined (or saved) to PHREEQC, is
        written to the file prefix.lon in a format readable by 
        DBXL (NetpathXL distribution).

        INVERSE_MODELING
           -pat_netpath  prefix

        A NETPATH model file is written for each inverse model that is
        found. The model files are named prefix-n.mod, where n refers
        to the sequence number of the model. In addition, a file named
        prefix.pat is written that contains the solutions associated
        with each model. The solutions are adjusted in accordance with
        the deltas calculated for the inverse model. Thus, a solution
        could be used for model 1 and model 2, but the concentrations
        could be slightly different for the two models. The solutions
        are identified by an initial integer corresponding to the
        sequence number of the model, followed by the solution description.

        --------
        svn 2448
        --------
        Added calculation of specific conductance. Requires the
        use of phreeqd.dat, which contains the diffusion coefficients
        of aqueous species. If phreeqd.dat is used, the specific 
        conductance (uS/cm at 25 C) is printed in the 
        "Description of solution". 

        The Basic function SC returns the value of the specific
        conductance for the solution at 25 C. The following example 
        would print to the selected output file the equivalent conductance 
        in (mmho/cm / eq/L) at 20 degrees C for a 1:1 chloride salt
        solution:

        USER_PUNCH
                -head conc eq_EC_20
                -start
        10 punch tot("Cl"), SC / tot("Cl") / 1e3 * .89 * 298 / 293
                -end

        where 1e-3 converts from microSiemens/cm to mmho/cm, .89 
        accounts for the viscosity at 20 C, and 298/293 
        accounts for the temperature of 20 C.

------------------------------------------------------------
Version 2.14.3: November 17, 2007
------------------------------------------------------------
        --------
        svn 2312
        --------
        Added new option to PITZER datablock, use_etheta t/f.
        If true, the nonsymmetric mixing terms--cation/cation and
        anion/anion of different charge--are included; if false
        these terms are excluded from all equations. Default is true.

        PITZER
                -use_etheta true


        --------
        svn 2270
        --------
        Added additional parameters Pitzer activity formulation for
        neutral species, MU and ETA. MU applies to nnn, nnn', nn'n'',
        nna, nn'a, nnc, nn'c interactions, where n, n', and n'' are
        neutral species, a is an anion and c is a cation. ETA applies
        to ncc' and naa' interactions. Also modified LAMDA for the
        special case of nn interactions (coefficients in osmotic and
        ln equations are different than other interaction types).
        Source of equations is Clegg and Whitfield, 1991, Activity
        coefficients in natural waters, Chapter 6, in Pitzer, K.S.
        (Ed.) Activity Coefficients in Electrolyte Solutions, 2nd
        Ed. CRC Press, Boca Raton. Removal of the 6 coefficient in
        last two terms of eq 35 and 36 (p. 2404) per Cleg and
        Whitfield, 1995, Geochimica et Cosmochemica Acta, v. 59,
        no. 12, pp 2403-2421.  Order of species in definitions should
        not matter.

        PITZER
        -MU
                CO2     CO2     CO2     ?     # nnn
                CO2     CO2     NH3     ?     # nnn'
                CO2     B(OH)3  NH3     ?     # nn'n''
                CO2     CO2     Ca+2    ?     # nnc
                CO2     CO2     Cl-     ?     # nna
                CO2     NH3     Ca+2    ?     # nn'c
                CO2     NH3     Cl-     ?     # nn'a
        -ETA
                CO2     Ca+2    Mg+2    ?     # ncc'
                CO2     Cl-     SO4-2   ?     # naa'

        As with all other Pitzer parameters, a five-term expression 
        for temperature dependence is available:
        
        P = A0 + A1*(1/TK - 1/TR) + A2log(TK/TR) + A3*(TK-TR) +
                A4*(TK*TK - TR*TR),
                
        where TK is Kelvin and TR is 298.15. A0 through A4 are
        defined in order. Any undefined values are assumed to 
        be zero.

        -MU
                CO2     CO2     CO2     ? ? ? ? ? # nnn

------------------------------------------------------------
Version 2.14.2: September 17, 2007
------------------------------------------------------------

        Fixed logic of memory checking for PhreeqcI. This serious
        bug makes versions 2.14.0 and 2.14.1 unusable.

------------------------------------------------------------
Version 2.14.1: September 5, 2007
------------------------------------------------------------

        No new features.

------------------------------------------------------------
Version 2.14.0: August 30, 2007
------------------------------------------------------------

        No new features.

------------------------------------------------------------
Version 2.13.3: February 15, 2007
------------------------------------------------------------

        No new features.

------------------------------------------------------------
Version 2.13.2: February 1, 2007
------------------------------------------------------------

        No new features.

------------------------------------------------------------
Version 2.13.1: January 16, 2007
------------------------------------------------------------

        No new features.

------------------------------------------------------------
Version 2.13.0: November 3, 2006
------------------------------------------------------------

        --------
        svn 1368
        --------
(1)     Added multicomponent diffusion (MCD) to transport
        capabilities. MCD allows different tracer diffusion
        coefficients for species, but calculates charge balanced
        transport. In the example, MCD is specified to be true,
        default tracer diffusion coefficient for species (Dw) is 1e-9,
        porosity is set to 0.3, porosity limit is set to 0.05, and an
        exponent of porosity (n) is set to 1.0. Effective diffusion
        coefficient is defined by the equation: De = Dw * porosity^n.
        Diffusion stops when the porosity falls below the porosity
        limit.

        TRANSPORT
                -multi_d true 1e-9 0.3 0.05 1.0

        Added tracer diffusion coefficient to SOLUTION_SPECIES
        definitions, -dw identifier.

        SOLUTION_SPECIES
        H+ = H+
                log_k   0.0
                -gamma  9.0     0.0
                -dw     9.31e-9

(2)     Added phreeqd.dat database with diffusion coefficients (-dw)
        defined for aqueous species in database directory.

(3)     Added BASIC functions to obtain and modify the porosity
        in a cell. The functions can be used in BASIC programs
        defined with keyword RATES, USER_PRINT, USER_PUNCH and
        USER_GRAPH.

          get_por(cell_no)              # returns the porosity in cell
                                        # 'cell_no'

          change_por(0.21, cell_no)     # porosity of cell 'cell_no'
                                        # becomes 0.21

(4)     Mobile surface and Donnan option in SURFACE. Mobile surfaces
        are meant for modeling transport of colloids. Only surfaces with
        a diffuse double layer can be transported (the ensemble must be
        electrically neutral). Surfaces related to equilibrium-phases
        and kinetics cannot be transported.

        Example 1: Use donnan assumption to calculate the explicit
        composition of the diffuse layer of surfaces. Thickness of the
        diffuse layer is defined to be 1e-7 meters. (Default thickness
        is 1e-8 meters.) Hfo (both sites Hfo_w and Hfo_s) is a surface
        that is transported with advection and dispersion. The diffusion
        coefficient of 1e-13 m^2/s is used with option -multi_d true in
        TRANSPORT. Sfo is an immobile surface (Dw = 0).

        SURFACE
                -donnan 1e-7
                Hfo_w 97.5e-5 600 88e-3 Dw 1e-13
                Hfo_s 2.5e-5
                Sfo_w 97.5e-5 600 88e-3 Dw 0
                Sfo_s 2.5e-5


        Example 2: Define Donnan calculation information. Thickness
        of the diffuse layer is 1e-8 meters, and relative viscosity is
        0.5. Relative viscosity only applies to multicomponent diffusion
        of solutes in the diffuse layer. (Default viscosity is 1.0.)

        SURFACE
                -donnan 1e-8 viscosity 0.5

        Example 3: Define Donnan calculation information. Thickness
        of the diffuse layer is 1.5 Debye lengths, maximum fraction of
        water that can be in the diffuse layer is 0.9. (Default
        thickness in Debye lengths is 1, default limit is 0.8.)

        SURFACE
                -donnan debye_lengths 1.5 limit_ddl 0.9

        When option '-only_counter_ions' is used in conjunction with
        with '-donnan', all the co-ions (with the same sign of charge as
        the surface) will be excluded from the DDL, and will be given a
        concentration of (near) zero in the DDL.

(5)     Added special BASIC function to change the diffusion
        coefficient of (part of) a SURFACE, and hence to change the
        status from mobile to immobile or immobile to mobile.

        Example 1: take a fraction 0.2 of 'Hfo', rename it to
        'Sorbedhfo', with a diffusion coefficient of 0, in cell 'cell_no'

        USER_PRINT
                10 print 'Changing surface in cell ', cell_no
                20  change_surf("Hfo", 0.2, "Sorbedhfo", 0, cell_no)


        Example 2: change the diffusion coefficient of 'Hfo' to  1e-12
        m2/s in cell 'cell_no'

                10 change_surf("Hfo", 1, "Hfo", 1e-12, cell_no)

        This function can be used in BASIC programs defined with keywords
        RATES, USER_PRINT, USER_PUNCH and USER_GRAPH. For correct
        operation of 'change_surf', the surface components must have
        been defined with the same surface species (the association
        constants may differ) and the same diffuse layer thickness or
        Debye length. The surfaces will be adapted at the end of a
        calculation step. The result of change_surf does not show up in
        print or punch results of that step, but the reformatting is
        effective in the next timestep calculations.


        --------
        svn 1337
        --------
        Added -add_logk to NAMED_EXPRESSIONS keyword.

        NAMED_EXPRESSIONS
        Log_alpha_14C_CO3-2/CO2(aq)
        -add_logk       Log_alpha_14C_CO3-2/CO2(g)      1
        -add_logk       Log_alpha_14C_CO2(aq)/CO2(g)   -1

        --------
        svn 1281
        --------
        Added new option to PITZER data block to allow definition of
        alpha1 and alpha2 for specific electrolytes. Entries are 
        following -ALPHAS are Ion1, Ion2, alpha1, alpha2. Both
        alpha1 and alpha2 should be defined. Default is 0.0 for
        undefined values following Ion1 and Ion2.

        Example:

        PITZER
        -ALPHAS
        #
        # Defaults for ion valences in salts
        #
        #   1-N (only B1): alpha1 = 2 
        #   2-2:           alpha1 = 1.4  alpha2 = 12.0
        #   3-2, 4-2:      alpha1 = 2    alpha2 = 50
        #
        #Ion1     Ion2      Alpha1   Alpha2
        Fe+2      Cl-       2        1
        Fe+2      SO4-2     1.559    5.268

        --------
        svn 1279
        --------
        Added new Basic function OSMOTIC that returns the
        osmotic coefficient if the Pitzer model (PITZER keyword data
        block) is used or 0.0 if the ion-association model is used.

        Example:

        USER_PRINT
        10 PRINT "Osmotic coefficient: ", OSMOTIC


        --------
        svn 1245 
        --------
        Enabled redox in Pitzer model with option in
        PITZER keyword. Typically, the option will be included
        in the pitzer database file. 

        Example:

        PITZER
        -redox  TRUE

        The default database for the Pitzer model does not contain 
        any redox definitions and the default value for the option 
        is FALSE. At a minimum, species O2 and H2 must be defined 
        in the database or input file to allow redox calculations.
        
        --------
        svn 1207 
        --------
        Added option to force an equilibrium phase to be 
        included in the equality constraints. Normally, the SIs of 
        equilibrium phases are optimized to be negative and the
        sum of SIs is minimized. If -force_equality is used, then
        the phase must reach its target SI or the calculation fails
        with an error.

        Example: 

        EQUILIBRIUM_PHASES
        Fix_pH  -7  NaOH
             -force_equality
        Calcite  0
        Dolomite 0
        CO2      -3.5

        One example of using the new option would be to ensure that 
        a target pH is attained, as in the example above. 

        --------
        svn 1179 
        --------
        New option (-sites_units or -sites) allows alternative
        units (sites/nm^2) for definition of number of sites for a
        surface. This approach requires better consistency among the
        parameters as both the number of sites and the surface area
        are based on the mass. It makes more sense than the default,
        which requires the number of sites (first numeric item in a
        line) to be defined in units of moles, independently of the
        number of grams of sorbent. Units descriptor is either DENSITY, 
        for defining number sites/nm^2, or ABSOLUTE, for defining 
        number of sites in moles. Optionally, sites, sites_units, or 
        -s[ites_units]. ABSOLUTE is the default for backward 
        compatibility with input files.

        Example:

        SURFACE 1
        -sites_units     DENSITY
        SurfOH  2.6    600.    1.0
        SurfaOH 2.6    30.     2.0

        Explanation: 

        In this example, Surf has a site density of 2.6 sites per
        nanometer squared, a specific area of 600 meters squared per
        gram, and a mass of 1 gram. Surfa has a site density of 2.6
        sites per nanometer squared, a specific area of 30 meters
        squared per gram, and mass of 2 grams.


        --------
        svn 1096 
        --------

        Allows solids and gases in the equations for PHASES. This
        capability simplifies the definitions for gas and solid
        isotopic components. Solids must be identified with "(s)" and
        gases with "(g)". The first entity on the left- hand-side of
        the equation must be the stoichiometric formula of the solid
        or gas component being defined, optionally with (g) or (s). In
        turn gases and solids included in the equation must be defined
        with reactions that ultimately allow the defined species
        (C[18O]2(g) in this case) in terms of aqueous species.

        Example:

        PHASES
        C[18O]2(g)
                C[18O]2(g) + CO2(g) = 2CO[18O](g) 
                log_k          0.602059991327962396        # log10(4)

        --------
        svn 1092 
        --------
        CD_MUSIC sorption model has been implemented.
        Still missing logic for surfaces related to equilibrium-
        phases and kinetics. Has explicit calculation of diffuse
        layer composition with Donnan assumption. Old diffuse-layer
        calculation will not be implemented.
        
        Example:

        SURFACE
        Goe_uniOH .000552 96.387 1
             -capacitance    1.1   5
        Goe_triO  .000432
        -cd_music
        -donnan

        Explanation:

        1.1 5 are capacitances for the cd-music model for 0-1 and 1-2
            planes, respectively. 
        -cd_music specifies that the surface is a cd-music surface.
        -donnan optionally calculates the diffuse layer composition
                with the Donnan model.

        Example:

        SURFACE_SPECIES
        Goe_uniOH-0.5 + H+ + AsO4-3 = Goe_uniOAsO3-2.5 + H2O
             log_k     20.1                 # eq 7   K1, Kin1
             -cd_music  -1 -6 0 0.25 5

        Explanation:

        -cd_music--this option is used to specify the change in charge
        by the reaction for three planes, 0 (specific sorption at the
        surface), 1 (Stern layer), and 2 (or d, the diffuse layer).
        The five numbers in the form above are (1) the change
        in charge for plane 0 due to loss or gain of hydrogen and
        oxygen at plane 0, (2) the change in charge for plane 1 due to
        the hydrogen and oxygen in the ligand that are located at
        plane 1, (3) the change in charge in diffuse layer, plane 2,
        (4) the fraction of the central ion charge that is
        associated with plane 0, and (5) the charge on the central
        ion.

        In this example the change in charge at plane 0 is (delta z0) =
        -1 (loss of one hydrogen) + 0.25*5 (contribution from As+5) =
        0.25. The charge at plane 0 becomes -0.5 + 0.25 = -0.25.
        The change in charge at plane 1 is (delta z1) = -6 (3 oxygens of
        the ligand are located at plane 1) + (1-0.25)*5 (contribution
        from As+5) = -2.25. The charge at plane 1 becomes 0 + (-2.25) =
        -2.25. There is no change in charge associated with plane 2.
        The total charge of the species is -0.25 (plane 0) + -2.25
        (plane 1) + 0 (plane 2) = -2.5.

        Alternatively to the form above, the changes in charge 
        on the three planes can be entered directly as the first 
        three numbers in the option, followed by two zeros. Thus, the
        following is equivalent to the -cd_music definition above, and
        consistent with more recent papers which would list
        delta z0 = 0.25, delta z1 = -2.25 and delta z2 = 0:

        SURFACE_SPECIES
        Goe_uniOH-0.5 + H+ + AsO4-3 = Goe_uniOAsO3-2.5 + H2O
             log_k     20.1                 # eq 7   K1, Kin1
             -cd_music 0.25  -2.25  0  0  0

        --------
        svn 675:
        --------
        Added PRINT option to print the species that contribute
        to alkalinity. Alkalinity distribution is printed in
        the output file following the distribution of species.
        Default at program startup is false.

        Example:

        PRINT
                -alkalinity true

------------------------------------------------------------
Version 2.12:
------------------------------------------------------------

*       Made aqueous activity coefficients the default activity
        coefficients for exchange species when using the 
        Pitzer formulation. New option in EXCHANGE is
        -pitzer_exchange_gammas T/F, default is true; 
        defining "false" sets exchange activity coefficients
        to 1.0. Option has no effect for ion-association
        model (non-Pitzer).


*       Added multiplier format to REACTION steps and KINETICS steps, 
        which simplifies definition of multiple equal reaction increments.

            This definition:

                   INCREMENTAL_REACTIONS true
                   REACTION
                        H2O 1
                        -36 3*-4 2*-.25 -0.19 4*-0.1 3*-0.05 moles

            is equivalent to this definition:

                   INCREMENTAL_REACTIONS true
                   REACTION
                        H2O 1
                        -36 -4 -4 -4 -.25 -.25 -0.19 -0.1 -0.1 -0.1
                        -0.1  -0.05 -0.05 -0.05  moles

        

*       Added Pitzer activity formulation. Use pitzer.dat database
        to invoke the Pitzer model. Should have same capabilities
        as ion-association model except explicit diffuse layer 
        calculation is not implemented with the Pitzer model.
        New keyword is PITZER with following options:

        PITZER
        -MacInnes   T/F   # uses MacInnes assumption or unscaled for
                          # individual activities and activity coefficients
        -B0
          Na+       Cl-       0.0765     -777.03     -4.4706        0.008946   -3.3158E-6
        -B1                                              
          Na+       Cl-       0.2664        0           0           6.1608E-5   1.0715E-6
        -B2
          Mg+2      SO4-2    -37.23         0           0          -0.253
        -C0
          Na+       Cl-       0.00127     33.317      0.09421    -4.655E-5
        -THETA
          K+        Na+      -0.012
        -LAMDA
          Na+       CO2       0.1
        -ZETA
          H+        Cl-       B(OH)3    -0.0102
        -PSI
          Na+       K+        Cl-       -0.0018

        A five-term expression for temperature dependence is available
        for all Pitzer parameter values: 
            P = A0 + A1*(1/TK - 1/TR) + A2log(TK/TR) + A3*(TK-TR) +
                A4*(TK*TK - TR*TR),
        where TK is Kelvin and TR is 298.15.

*       Cl1mp is a new multiple precision version of routine cl1,
        a simplex-based optimization routine. Cl1mp was develeped
        by using the Gnu Multiple Precision package (gmp).
        Calculations are carried out to about 30 significant
        digits. Cl1mp may help in some situations where roundoff 
        errors are a problem, but it is still possible that roundoff 
        errors will cause cl1mp to fail to find a solution to an 
        optimization problem. The mp version has the following 
        options in INVERSE_MODELING:

                -multiple_precision T/F--causes the mp version 
                        to be used in inverse modeling calculations.
                -mp_tolerance 1e-12--tolerance for mp version of
                        cl1. As in cl1, numbers less than the
                        tolerance are considered to be zero. 
                        1e-12 is the default.
                -censor_mp 1e-20--as calculations occur in the
                        linear equation array, elements less
                        than this value are set to zero. Default
                        is 1e-20. A value of 0.0 causes no
                        censoring to occur.

------------------------------------------------------------
Version 2.11:
------------------------------------------------------------

*       A new database, minteq.v4.dat, has been translated from
        version 4.02 of MINTEQA2 and is included in all
        distributions. The database minteq.dat from earlier
        version of MINTEQA2 has been slightly revised and is 
        also included.

------------------------------------------------------------
Version 2.10:
------------------------------------------------------------

        No new features.

------------------------------------------------------------
Version 2.9:
------------------------------------------------------------
*       Added new keyword COPY that allows a data entity 
                to be copied from one index to a new index 
                or to a range of indicies. Format is 

        COPY keyword index index_start[-index_end]

        where keyword may be    SOLUTION
                                EQUILIBRIUM_PHASES
                                EXCHANGE
                                GAS_PHASE
                                KINETICS
                                MIX
                                REACTION
                                REACTION_TEMPERATURE
                                SOLID_SOLUTION
                                SURFACE

*       Added new Basic functions
        b$ = PAD(a$, 20)   pads a$ to a total of 20 characters
                with spaces and stores result in b$. PAD returns
                a copy of a$ if a$ is more than 20 characters.
        i = INSTR(a$, b$)  sets i to the character position of
                string b$ in a$, 0 in not found.
        b$ = LTRIM(a$)     trims white space from beginning of 
                string a$ and stores result in b$.
        b$ = RTRIM(a$)     trims white space from end of string 
                a$ and stores result in b$.
        b$ = TRIM(a$)     trims white space from beginning and
                end of string a$ and stores result in b$.


*       Added new Basic function SYS that calculates the
        total amount of an element in all phases (solution,
        equilibrium_phases, surfaces, exchangers, solid solutions, 
        and gas phase). KINETIC reactions are not included.
        The function has two forms: (1) one element name as an
        argument (variable names are user specified)

        10 t = SYS("As")

        the function will return the total arsenic in the system.
        (2) 5 argumens

        10 t = SYS("As", count_species, names$, types$, moles)

        will return the total arsenic in the system to t; count_species--
        the number of species that contain arsenic, including
        solution, equilibrium_phases, surfaces, exchangers, solid solutions, 
        and gas phase species; names$--a character array that has the
        name of each species; type$--a character array that specifies the
        type of phase for the species, aq, equi, surf, ex, s_s, gas, diff. 
        Diff refers to the amount of the element in the diffuse layer of 
        a surface when the explicit diffuse layer calculation is used; 
        moles--an array containing the number of moles of the element in 
        the species. The sum of moles(i) is equal to tot.

        SYS has several special arguments for the form 
        SYS("arg", count, names$, types$, values)
                arg     is one of the options listed below.
                count   is a single numeric value and is the number of elements
                                in the following arrays.
                name$   is an array of string values.
                type$   is an array of string values.
                values  is an array of numeric values.

        Values of arg:

        elt_name        returns total number of moles of element in system.
                        count is the number of species for the element in
                                the system, including aqueous, exchange, surface,
                                equilibrium_phase, solid solution component, and
                                gas phase "species".
                        Arrays are filled for each "species"; values are moles.
        "elements"      returns total number of moles of dissolved elements other
                                than H and O.
                        count is number of elements, valence states, 
                                exchangers, and surfaces.
                        Arrays are filled for each element and valence state,
                                type is "dis"; exchanger, type is "ex",
                                and surface, type is "surf". Values are moles.
        "phases"        returns maximum saturation index of all phases.
                        count is number of phases in system.
                        Arrays are filled for each phase; values are
                                saturation indexes.
        "aq"            returns sum of moles of all aqueous species.
                        count is number of aqueous species in system.
                        Arrays are filled with each aqueous species;
                                values are moles.
        "ex"            returns sum of moles of all exchange species.
                        count is number of exchange species in system.
                        Arrays are filled with each exchange species;
                                values are moles.
        "surf"          returns sum of moles of all surface species.
                        count is number of surface species in system.
                        Arrays are filled with each surface species;
                                values are moles.
        "s_s"           returns sum of moles of all solid solution components.
                        count is number of solid solution components in system.
                        Arrays are filled with each solid solution component;
                                values are moles.
        "gas"           returns sum of moles of all gas components.
                        count is number of gas components in system.
                        Arrays are filled with each gas component;
                                values are moles.

*       Added new Basic function, DESCRIPTION, that has the value
        defined for the description field of the SOLUTION keyword line. 

*       Added alternative ordinary differential equation solver
        called CVODE, a set of C routines from the Lawrence 
        Livermore National Labs. CVODE is part of the SUNDIALS
        package. CVODE is used in place of the Runge Kutta method
        when "-cvode true" is used within a KINETICS data block.

        KINETICS
                -cvode true

------------------------------------------------------------
Version 2.8:
------------------------------------------------------------

        No new features.

------------------------------------------------------------
Version 2.7:
------------------------------------------------------------
Changed format of selected output file:
        Removed quotations surrounding strings in headings.
        Removed quotations surrounding strings in state variable.
        All fields are 12 or 20 places depending on 
                -high_precision.
        Headings are not truncated even if longer than 
                specified precision.
        For isotopes, missing value is -9999.9
        Selected output is updated each simulation.
                If a species or phase is defined
                subsequent to the simulation where SELECTED_OUTPUT
                was defined it will appear in the selected output
                file in the simulation in which it is defined and
                in subsequent simulations.

Added strings for each file, which can be extracted from the
        executable file with the "ident" command.

Fixed null pointer for isotope_ratios if Basic routine 
        was undefined.

Fixed problem in C++ if structure name is same as member name.
        logk member of logk structure was renamed to log_k.

Added identifier -add_constant to PHASES, EXCHANGE_SPECIES,
        SOLUTION_SPECIES, and SURFACE_SPECIES. 

        -add_constant  -0.301  

        log K is augmented by the specified constant. 


Theory and implementation of isotopes in PHREEQC is documented in:

Thorstenson, D.C., and Parkhurst, D.L., 2002, Calculation of
individual isotope equilibrium constants for implementation in
geochemical models: U.S. Geological Survey Water-Resources
Investigations Report 02-4172, 129 p.

Added KEYWORDS:

ISOTOPES
        Element
        -isotope  isotope_name units standard_ratio
        -total_is_major  T/F (OPTION IS DISABLED!!)

CALCULATE_VALUES
        Name
        -start
        Basic statements, must have SAVE
        -end

ISOTOPE_RATIOS (for printing)
        Name=Calculate_values_name      Isotope_name

ISOTOPE_ALPHAS (for printing)
        Name=Calculate_values_name      Named_logk=named_expression_name

Basic functions:
        calc_value("calc_value_name")           evaluates a definition of CALCULATE_VALUES
        lk_named("name")                        log10(K) of definition in NAMED_EXPRESSIONS
        lk_phase("name")                        log10(K) of definition in PHASES
        lk_species("name")                      log10(K) of definition in (SOLUTION, EXCHANGE, SURFACE)_SPECIES
        sum_gas("template","element")           Sum of element in gases with specified template, moles.
                                                Example:
                                                template="{C,[13C],[14C]}{O,[18O]}2" includes all CO2 gases
        sum_species("template","element")       Sum of element in aqueous, exchange, and surface species with
                                                specified template (moles)
        sum_s_s("s_s_name","element")           Sum of element in a specified solid solution (moles)

PRINT keyword:
        -initial_isotopes  T/F
        -isotope_ratios    T/F
        -isotope_alphas    T/F
        -censor_species    1e-8   # omit species from Distribution of Species if less than 
                                  # relative minimum of an element or element redox state
                                  # total concentration

SELECTED_OUTPUT keyword:
        -calculate_values  name1 name2 ...
        -isotopes minor_isotope1 minor_isotope2 ....

Added functions LK_SPECIES, LK_NAMED, LK_PHASE for Basic
        interpreter. LK_SPECIES("CaHCO3+") returns the
        log k for the association reaction for the ion pair
        CaHCO3+ at the current temperature. The log K is 
        for the reaction as defined in the database or 
        input file. Similarly, 
        LK_NAMED("Log_alpha_18O_CO2(aq)/CO2(g)") returns the 
        value for the log K at the current temperature using
        expressions defined in NAMED_LOG_K data block; 
        LK_PHASE("Calcite") returns the value of log K 
        for calcite at the current temperature for the 
        dissociation reaction defined in the database or 
        input file. Values are "log10" values.
Example for Basic program:
        10 PRINT "Log10 KCalcite: ", LK_PHASE("Calcite")
        20 PRINT "Log10 KCaHCO3+: ", LK_SPECIES("CaHCO3+")
        30 PRINT " 1000ln(alpha): ", LK_NAMED("Log_alpha_18O_CO2(aq)/CO2(g)")*LOG(10)*1000

NAMED_EXPRESSION--New keyword data block.

        This data block was implemented to facilitate isotopic
        calculations.  It allows analytical expressions that
        are functions of temperature to be defined. The purpose
        is to separate the fractionation factors from the log
        K, so that the fractionation factor or its temperature
        dependence can be easily modified. The named expression
        can be added to a log K for a species or phase by the
        -add_logk identifier in SOLUTION_SPECIES
        EXCHANGE_SPECIES, SURFACE_SPECIES, or PHASES data
        block. Log K, Delta H, and analytical expressions for a 
        log K can be defined with identifiers -log_k, -delta_h,
        and -analytical_expression as described in SOLUTION_SPECIES
        in WRIR 99-4259. Fractionation factors are often defined
        as 1000*ln(alpha). The identifier -ln_alpha1000 can be used
        to enter data in this form. The analytical expression is the
        same as defined in SOLUTION_SPECIES, but the result of the 
        expression is converted to log10(alpha) by dividing by 
        1000*ln(10) before it is summed into log K values.

NAMED_EXPRESSIONS
        Log_K_calcite           #       CaCO3 + 2H3O+ = Ca+2 + 3H2O + CO2
                log_k           8.201   
                delta_h         -8.035  kcal
                -analytic       292.29  0.015455        -24146.841      -94.16451       2248628.9 

        Log_alpha_18O_CO2(aq)/Calcite
                -ln_alpha1000   3.8498  0.0     10.611e3        0.0     -1.8034e6

        Log_alpha_13C_CO2(aq)/Calcite           
                -ln_alpha1000   2.72    0.0     0.0     0.0     -1.1877e6

------------------------------------------------------------
Added identifier -add_logk to SOLUTION_SPECIES
        EXCHANGE_SPECIES, SURFACE_SPECIES, and PHASES data
        block.

        Allows a named expression to be added to the definition
        of the log K for a species or phase. In the following
        example, the log K for the phase Ca[14C][18O]3 is summed from
        four parts, one defined with the log_k identifier and the
        other three parts from expressions defined in NAMED_EXPRESSIONS.
        The named expression is multiplied by the coefficient at the
        end of the line before it is summed into the log K. A missing
        coefficient is 1.0 by default.

PHASES
        Ca[13C][18O]3
        Ca[13C][18O]3 + 3CO2 + 2H3O+ = Ca+2 + 3H2O + 3CO[18O] + [13C]O2
        log_k           0.903089986991                          # 3*log10(2)
        -add_logk       Log_K_calcite                           1.0
        -add_logk       Log_alpha_13C_CO2(aq)/Calcite           1.0
        -add_logk       Log_alpha_18O_CO2(aq)/Calcite           3.0


SOLUTION keyword:
        At present, can only define isotopes in the units defined in ISOTOPES.

------------------------------------------------------------
Version 2.6:
------------------------------------------------------------

        No new features.

------------------------------------------------------------
Version 2.5:
------------------------------------------------------------
Added the capability to use square brackets to define an
        "element" name. The brackets act like quotation marks
        in that any character string can be used within the 
        brackets as an element name. For example, [Fe3], [13C],
        and [N5] are now legal "element" names. All element 
        names without brackets must begin with a capital letter, 
        followed by zero or more lower case letters and underscores.

Added identifier -activity_water for a species in SOLUTION_SPECIES
        data block. This identifier has been added for future updates
        that will allow isotopic calculations. It is intended to be
        used only for isotopic variations of H2O, like D2O or 
        H2[O18]. It forces the activity coefficient for the 
        species to be activity(water)/55.5. This effectively sets 
        the activity of the species to the mole fraction in 
        solution.

Added identifier -bad_step_max to KINETICS data block.
        An integer following -bad_step_max gives the maximum number 
        of times a rate integration may fail before execution of the
        program is terminated. Default is 500.

------------------------------------------------------------
Version 2.4:
------------------------------------------------------------

------------------------------------------------------------
Added identifier -warnings to PRINT keyword. 

        An integer following -warnings gives the maximum number 
        of warnings to print into the output file. A negative 
        number allows all warnings to be printed.

        Example:        -warnings 20

------------------------------------------------------------
Changed the results of the function CELL_NO in Basic programs.

        Function cell_no in Basic now prints a number equivalent 
        to -solution in SELECTED_OUTPUT data block. It gives the 
        solution number for initial solution calculations and the 
        solution being used in batch reaction calculations. 
        Result is the same as previous versions for ADVECTION or 
        TRANSPORT calculations.

------------------------------------------------------------
Version 2.3:
------------------------------------------------------------
DATABASE--New keyword data block

        It must be the first keyword in the input file. 
        The character string following the keyword is 
        the pathname for the database file to be used
        in the calculation. The file that is specified
        takes precedence over any default database
        name, including environmental variable
        PHREEQC_DATABASE and command line arguments.

LLNL_AQUEOUS_MODEL_PARAMETERS--New keyword data block

        Added new keyword to make aqueous model similar to
        EQ3/6 and Geochemists Workbench when using
        llnl.dat as the database file. Values
        of Debye-Hückel a and b and bdot (ionic strength
        coefficient) are read at fixed temperatures.
        Linear interpolation occurs between temperatures.

        New options for SOLUTION_SPECIES are
                -llnl_gamma  a   , where a is the ion-size parameter.
                -co2_llnl_gamma  , indicates the temperature dependent
                        function for the bdot term given in 
                        -co2_coefs of LLNL_AQUEOUS_MODEL_PARAMETERS
                        will be used. Applies to uncharged
                        species only.

LLNL_AQUEOUS_MODEL_PARAMETERS
-temperatures
         0.0100   25.0000   60.0000  100.0000
       150.0000  200.0000  250.0000  300.0000
#debye huckel a (adh)
-dh_a
         0.4939    0.5114    0.5465    0.5995
         0.6855    0.7994    0.9593    1.2180
#debye huckel b (bdh)
-dh_b
         0.3253    0.3288    0.3346    0.3421
         0.3525    0.3639    0.3766    0.3925
-bdot
         0.0394    0.0410    0.0438    0.0460
         0.0470    0.0470    0.0340    0.0000
#cco2   (coefficients for the Drummond (1981) polynomial)
-co2_coefs
        -1.0312              0.0012806
          255.9                 0.4445
      -0.001606

------------------------------------------------------------
Added function SURF to Basic.

        SURF("element", "surface") gives the amount of element 
        sorbed on "surface". "surface" should be the surface 
        name, not the surface-site name (that is, no underscore).

------------------------------------------------------------
Allow decimals in definition of secondary master species.

        Some redox states do not average to integers,
        for convenience in identifying them, decimal numbers
        may be used within the parentheses that define the 
        redox state, example S(0.3) could be used in the
        MASTER_SPECIES data block for the valence state of
        aqueous species S6-2.

------------------------------------------------------------
Eliminate echo of input file in PRINT data block. 

        -echo_input T/F turns echoing on and off. 
        Default is true, initial value is true.
        
------------------------------------------------------------
Added option for an equilibrium-phase to dissolve only. 
        "dis" is added at the end of a line defining an equilibrium-
                phase. No data fields may be omitted. Should not
                be used when adding an alternative reaction.
        Example:
                EQUILIBRIUM_PHASES
                Dolomite 0.0  0.001 dis

------------------------------------------------------------
Version 2.2:
------------------------------------------------------------
Added function EDL to Basic.
        EDL("element", "surface") gives the amount of 
        element in the diffuse layer for "surface", not
        including sorbed species. "surface" should be 
        the surface name, not the surface-site name 
        (that is, no underscore).

        Special values for "element" include:
                "charge" - gives surface charge, equivalents.
                "sigma"  - surface charge density, C/m**2.
                "psi"    - potential at the surface, Volts.
                "water"  - mass of water in the diffuse layer, kg.

------------------------------------------------------------
End of Features not documented in WRIR 99-4259.
------------------------------------------------------------



************************************************************
************************************************************
*               Revisions and Bug Fixes                    *
************************************************************
************************************************************

------------------------------------------------------------
Version 3.8.1: August 23, 2024
------------------------------------------------------------
        --------
        svn 5570
        -------- 
        In SELECTED_OUTPUT; -totals, a redox state defined 
        with a "+" sign, such as Fe(+3), was not recognized
        ("Fe(3)" worked correctly). Now Fe(+3) is 
        synonymous with Fe(3).
        
------------------------------------------------------------
Version 2.18.0: April  9, 2011
------------------------------------------------------------          
        --------
        svn 5212
        --------
        Subscript error in solver (ineq) when reseting deltas 
        after optimization failed.
        
        --------
        svn 4996
        --------
        Had conversion conversion to Kelvin as 273.16 in Basic
        function TK, should be 273.15. 
        
        --------
        svn 4955
        --------
        Changed O2(g) constant in Amm.dat and iso.dat to
        definition from llnl.dat.
        
        --------
        svn 4954
        --------
        Added two more parameter sets in series of attempts
        to converge: tolerance/100 and tolerance/1000.
        
        --------
        svn 4943
        --------
        Added separate As(3) in sit.dat.
        
        --------
        svn 4854
        --------
        Added two additional convergence parameter sets:
        ineq_tol/100 and ineq_tol/1000.
        
        --------
        svn 4840
        --------
        Added missing -dw parameters to MgCO3, MgHCO3, and
        MgSO4 aqueous species in phreeqc.dat.
        
------------------------------------------------------------
Version 2.17.5: September  7, 2010
------------------------------------------------------------
        --------
        svn 4793
        --------
	Revised fix for exponential of negative number
	in Basic. Error message for negative number raised
	to a fractional power.
	
    
------------------------------------------------------------
Version 2.17.4: September  2, 2010
------------------------------------------------------------
        --------
        svn 4771
        --------
        Added synonyms to TOTMOLE: TOTMOL, TOTMOLES
        Fixed bug with negative exponential in basic, 
        for example  -0.006^0.9

------------------------------------------------------------
Version 2.17.3: August 12, 2010
------------------------------------------------------------

        --------
        svn 4727
        --------
        Increased maximum iterations in cl1 solver. One test
        case failed after new compiler was installed.
        
        --------
        svn 4700
        --------
        Initialized (nearly) all variables in class.
        
        --------
        svn 4697
        --------
        Fixed bug with second PITZER data block, parameters
        were not updated if temperature was not changed.        
        
        --------
        svn 4698
        --------
        Modified PHRQ_malloc and PHRQ_free logic. These routines
        are used in almost all cases.
   
        --------
        svn 4694
        -------- 
        Initialized variables for V_M structure, rxn->dz (for CD_MUSIC),
        Fixed problem where definitions in second SIT data block were
        not added to model.
        
        --------
        svn 4677
        --------
        Renamed all variables that "shadowed" class variables.
	
        --------
        svn 4643
        --------
        Made isfinite a macro.
        
        --------
        svn 4539
        --------
        Fixed bug with long file names in inverse modeling files
        netpath.fil or model.fil. 
        
        --------
        svn 4490
        --------
	Redox had never been enabled for the SIT formulation.
	Added the switch to include the hydrogen balance 
        equation for SIT.

        --------
        svn 4458
        --------
        Tweaked the convergence parameters for Pitzer log
        gamma unknowns. Set a maximum step size for these
        unknowns. Also changed usage of internal flags
        for Pitzer calculations related to initial solution
        calculations. Corrected print of Gamma iterations.
        
        --------
        svn 4399
        --------
        Error in PHRQ_calloc. Size of allocated block was
        not set. Under some situations, could cause serious
        errors and a crash.
        
        --------
        svn 4376
        --------
        Error in logic for removing unstable phases for Pitzer
        and SIT.
        
        --------
        svn 4233
        --------
        Removed duplicate parameter for Na+ -- Cl- in sit.dat.
        Value of 0.03 was entered erroneously for both Na/Cl and Cl/Na.
        
------------------------------------------------------------
Version 2.17.0: February 25, 2010
------------------------------------------------------------
        --------
        svn 4115
        --------
        Fixed bugs with unititialized strings in Basic, which 
        caused an error in renumbering with PhreeqcI. Tested
        most Basic functions. Fixed bugs with LG and GAMMA 
        functions, which did not return the correct values
        for H+. GET_POR now returns 0 if it is not a TRANSPORT
        calculation.


        --------
        svn 4066
        --------
        Fixed bug with SIT calculations (and Pitzer). The
        number of solver iterations was too few (200). With
        SIT and Pitzer, each species has an unknown, so the
        number of unknowns is large for a system with many
        elements. Now set the maximum iterations to be 
        equal to the number of unknows plus the number of
        equations/inequalities. 

        --------
        svn 4023
        --------
        Trapped error when -mole_balance option was used in
        SOLUTION_SPECIES and one of the stated elements was 
        not defined. 
        
        --------
        svn 4022
        --------   
        Redefined CN- and SCN- to be new elements Cyanide and
        thiocyanate in llnl.dat. Former definitions were not 
        useful because cyanide and thiocyanate were never
        stable and defining a master species as CN- caused
        problems with mole balances, appearing in solutions
        without any carbon. 
        
        --------
        svn 3901
        --------
        Error with equations that included (s) or (g). The
        equation and log K were correct only for the simulation
        when initially read. Now equations an log Ks are correct
        for all simulations. Calculates saturation index from
        the equation after (s) and (g) are eliminated. 
        
        
        --------
        svn 3695
        --------
        For transport calculations, fixed step_fraction when 
        nmix == 1 and ishift == 0.
        
        --------
        svn 3684
        --------
        Added more precision in writing dump file fields.
        
        Multiple REACTIONS were not sorted correctly. Added sort
        routine to tidy.c.

        --------
        svn 3640
        --------
        Print correct temperature for gas phase dump.
        
        Correct total moles of exchanger for function sys("X").
        
        --------
        svn 3568
        --------
        minteq.dat: Changing log K of gypsum to minteq version 
        4 value (-4.61). Old value (-4.848) is too stable.

        --------
        svn 3483
        --------
        Alkalinity is now printed to the selected output file 
        when the Alkalinity is used with -totals.
        
        SELECTED_OUTPUT; -totals Alkalinity 
        
        Modified numerical method to attempt to produce a numerical 
        solution when complexes are extremely strong. llnl.dat As and F
        complexes caused PHREEQC to fail on an initial solution 
        calculation. The terms of the As and F mass balance equations
        were identical to machine precision. One unknown log activity
        was adjusted but the other was not. Now attempts an adjustment 
        for the unadjusted log activity.
        

        --------
        svn 3463
        --------
        Modified handling of not-a-number in places that 
        affected the adjustment of log activities (reset and 
        revise guesses). Uses isfinite function that is available 
        on Linux and is ifdef'd in global.h for Visual Studio. 
        The NaN problem occurred rarely and was related to 
        bad results from the solver and when poor estimates were
        available in revise_guesses. Also insured that log activity
        for new master species was well defined in switch_bases.

        --------
        svn 3446
        --------
        Fixed errors in casting for long double version.

        --------
        svn 3440
        --------
        Adjusted numerical calculation to avoid extremely large
        calculated specific conductances in high ionic strength
        waters.

        --------
        svn 3433
        --------
        -dw and -millero added to phreeqc.dat, which allows
        calculation of specific conductance and density.
        phreeqd.dat is now redundant and removed from distribution.

        --------
        svn 3425
        --------
        Added error message to require -multi_d for transport of
        surfaces.

        --------
        svn 3424
        --------
        Checked for misspellings in EXCHANGE definitions, which
        previously caused crash.

        --------
        svn 3423
        --------
        -dw and -millero added to pitzer.dat, which allows
        calculation of specific conductance and density.

        --------
        svn 3292
        --------
        Removed redundant warnings related to transport of exchanger
        and surface.

        --------
        svn 3287
        --------
        Fixed error in CD_MUSIC surface complexation model. 
        If reaction equation for a surface species was not
        written with the primary surface species, the calculation
        was incorrect. The logic to accumulate the change in
        charges on the planes was erroneously not included when
        rewriting the equations to the master species. 

        --------
        svn 3247
        --------
        Revised donnan layer calculation with CD_MUSIC. Fixed
        a bug related to moles versus concentration and stream
        lined calculation. Minor differences in relevant test
        cases.
        
        --------
        svn 3207
        --------
        Modifications to convergence criteria for surfaces
        related to minerals, when moles of mineral is near
        zero (<= 1e-14).

        --------
        svn 3100
        --------
        Error when multiple surfaces were used. Sometimes the
        surface area from one surface was used for another.
        Results were probably incorrect if the surfaces were
        not in alphabetical order in their definition in 
        SURFACE.

        --------
        svn 2711
        --------
        Cleaned up compiler warnings for functions called 
        with constant strings.
------------------------------------------------------------
Version 2.15.0: February 5, 2008
------------------------------------------------------------
        --------
        svn 2386
        --------
        Fixed bug for SELECTED_OUTPUT; -activities H2O. The
        resulting value was -30; now produces the correct
        result.

------------------------------------------------------------
Version 2.14.3: November 17, 2007
------------------------------------------------------------

        --------
        svn 2386
        --------
        Fixed bug in routine find_Jstag. Incorrect index (cell_no)
        caused segmentation violation in rare instances.

        --------
        svn 2312
        --------
        Added new option to PITZER datablock, use_etheta t/f.

        --------
        svn 2279
        --------
        Error lost 200 moles of mineral. Should only be a problem
        in some cases where moles of mineral is greater than 200.

        --------
        svn 2270
        --------
        Added additional parameters Pitzer activity formulation for
        neutral species, MU and ETA. 

        --------
        svn 2269
        --------
        Fixed buffer overrun in SOLUTION_SPREAD when pasting.

        --------
        svn 2268
        --------
        Fixed error in prep.c where realloc was called instead
        of PHRQ_realloc, which eliminated a memory leak.

------------------------------------------------------------
Version 2.14.2: September 17, 2007
------------------------------------------------------------
        
        --------
        svn 2267
        --------
        Fixed logic of memory checking for PhreeqcI. This serious
        bug makes versions 2.14.0 and 2.14.1 unusable.

------------------------------------------------------------
Version 2.14.1: September 5, 2007
------------------------------------------------------------
        --------
        svn 2219
        --------
        Updated transport.c to adjust transport in diffuse 
        layer to be charge balanced for MCD calculation.

------------------------------------------------------------
Version 2.14.0: August 30, 2007
------------------------------------------------------------
        -------------
        svn 2203-2204
        -------------
        Revised logic for using phqalloc memory checker. Compiler
        option USE_PHRQ_ALLOC now turns on memory checker. If
        USE_PHRQ_ALLOC is defined and NDEBUG is not defined, file name
        and line number are also used in memory checking. Model.c
        now uses same compile options as all other files.

        --------
        svn 2199
        --------
        Initialized variables that caused problems when rerunning
        simulations in PfW and PhreeqcI.

        --------
        svn 2138
        --------
        Fixed bugs in MCD calculation related to saving solutions
        after initialization.

        --------
        svn 2055
        --------
        Profiled and optimized of code. Automatic string in Basic
        factor saves many mallocs. Reordered to minimize call to
        strcmp_nocase in basicsubs.c and xsolution_save. Minimized
        mallocs for solver.

        --------
        svn 2051
        --------
        Fixed bugs in MCD calculation.

        --------
        svn 2040
        --------
        Fixed warnings for type-punned with new gcc. 

        Reverted to 2.12 for infilling solutions for transport. 
        Only solutions are used, not additional reactants for solution
        0 and n+1.

        Added digits to printout of REACTION stoichiometry.

        --------
        svn 1852
        --------
        Fixed error in CDMUSIC surface related to a phase.
        Stoichiometry of H was calculated incorrectly.

        --------
        svn 1837
        --------
        Initialize flag for MCD calculation. PhreeqcI would
        do MCD calculation after TRANSPORT was redefined not
        to do MCD calculation.

------------------------------------------------------------
Version 2.13.2: February 1, 2007
------------------------------------------------------------
        --------
        svn 1700
        --------
        Fixed bug with redox elements in multi_diffusion
        stagnant zones.

        --------
        svn 1683
        --------
        Worked on convergence problems when optimizer fails to
        find a solution. Censored values greater than 1e8.

        --------
        svn 1637
        --------
        Fixed bug with dissolve only in ADVECTION calculations.

        --------
        svn 1629
        --------
        Fixed bug with redox elements in multi_diffusions. Added
        Phreeqc For Windows changes from 2.13.1.

------------------------------------------------------------
Version 2.13.1: January 16, 2007
------------------------------------------------------------
        --------
        svn 1600
        --------
        Fixed logic error that required rebuilding aqueous model
        when not necessary. Now runs faster (sometimes 3X) than
        version 2.13.0.

        --------
        svn 1590
        --------
        Removed porosity from one statement to eliminate oscillations
        in multicomponent diffusion calculation.

        --------
        svn 1558
        --------
        Dissolve-only option did not work correctly for stagnant cells
        in TRANSPORT calculations. The moles of equilibrium phases,
        kinetics, gas_phase, and solid solutions were not initialized
        at the beginning of each transport step. Thus, the printed values
        for delta moles for the step in the output and punch file were 
        incorrect for stagnant-zone cells. "Dissolve only" was
        always tested relative to the number of moles initially in the
        cells, not the amount remaining at a given time step.

        --------
        svn 1485
        --------
        Pitzer version with gas_phase did not work. Added
        gas_phase and cd_music to numerical derivative routine.



        svn 1368: (1) Added multicomponent diffusion in transport and
        SOLUTION_SPECIES. (2) Added BASIC functions to obtain and
        modify the porosity in a cell. (3) Aded mobile surface and Donnan
        option in SURFACE.  (4) Added special BASIC function to change
        the diffusion coefficient of a SURFACE, and hence to
        change the status from mobile to immobile or immobile to
        mobile.

        svn 1337: Added -add_logk to NAMED_EXPRESSIONS keyword.

        svn 1306: Revised printing of distribution of species,
        pure phase assemblages, and solid solutions to use 
        longer fields for names. More revisions to logic
        for using gases and solids in equations for phases.
        Revised logic for solid solutions with small (1e-25) amounts
        of component.

        svn 1282: Fixed bug when gas phase had no gas components.
        Looked the same as not having a gas phase at all.

        svn 1245: Enabled redox in Pitzer model with option in
        PITZER keyword. Typically, the option will be included
        in the pitzer database file. 

PITZER
    -redox  TRUE

        The default database for the Pitzer model does not contain 
        any redox definitions and the default value for the option 
        is FALSE. At a minimum, species O2 and H2 must be defined 
        in the database or input file to allow redox calculations.

        svn 1179: New option (-sites_units density) allows alternative
        units (sites/nm^2) for definition of number of sites for a
        surface. This approach requires better consistency among the
        parameters as both the number of sites and the surface area
        are based on the mass. It makes more sense than the default,
        which requires the number of sites (first numeric item in a
        line) to be defined in units of moles, independently of the
        number of grams of sorbent.

SURFACE 1
        -sites     DENSITY
        SurfOH  2.6    600.    1.0
        SurfaOH 2.6    30.     2.0

        In this example, Surf has a site density of 2.6 sites per
        nanometer squared, a specific area of 600 meters squared per
        gram, and a mass of 1 gram. Surfa has a site density of 2.6
        sites per nanometer squared, a specific area of 30 meters
        squared per gram, and mass of 2 grams.

        svn 1128: Fixed bug with value of time printed to selected
        output file when using cvode. Value printed was an
        intermediate integration time step, not time at end 
        of integration.
        
        svn 1096: Allows solids and gases in the equations for
        PHASES. This capability simplifies the definitions for
        gas and solid isotopic components. Solids must be identified
        with "(s)" and gases with "(g)". The first entity on the left-
        hand-side of the equation must be the stoichiometric formula
        of the solid of gas component being defined, optionally with
        (g) or (s). In turn gases and solids included in the equation
        must be defined with reactions that ultimately allow the
        defined species (C[18O]2(g) in this case) in terms of aqueous
        species.

C[18O]2(g)
        C[18O]2(g) + CO2(g) = 2CO[18O](g) 
        log_k           0.602059991327962396                   # log10(4)

        svn 1092: CD_MUSIC sorption model has been implemented.
        Still missing logic for surfaces related to equilibrium-
        phases and kinetics. Has explicit calculation of diffuse
        layer composition with Donnan assumption. Old diffuse-layer
        calculation will not be implemented.
        
        Example:

SURFACE
        Goe_uniOH .000552 96.387 1
                  -capacitance    1.1   5
        Goe_triO  .000432
        -cd_music
        -donnan

        1.1 5 are capacitances for the cd-music model for 0-1 and 1-2
            planes, respectively. 
        -cd_music specifies that the surface is a cd-music surface.
        -donnan optionally calculates the diffuse layer composition
                with the Donnan model.

SURFACE_SPECIES
        Goe_uniOH-0.5 + H+ + AsO4-3 = Goe_uniOAsO3-2.5 + H2O
             log_k     20.1                 # eq 7   K1, Kin1
             -cd_music  -1 -6 0 0.25 5

        -cd_music gives the charge contribution of the surface
                  species to the three planes. Plane 0 is
                  -1 + 0.25*5; Plane 1 is -6 + (1-0.25)*5; 
                  Plane 2 (or d) is 0.


        svn 1030: Fixed bug in tranport. Mixing was not printed
        when using -cvode in kinetics.

        svn 984: Fixed bug in transport when cell without a
        surface followed a cell with a diffuse-layer surface.
        Fixed bug in TOTAL function; code ran of the end of
        the list of master species; changed logic to recognize
        the end of the list.

        svn 874: Fixed bug in check_same_model. Thought surface
        calculation was the same even though -edl switch was
        different, which gave irratic results and possible 
        crash. Now checks more carefully to make sure calculation
        for surfaces is really the same and reinitializes if
        not.

        svn 847: Fixed bug with DESCRIPTION function. Did not
        give correct solution description for reactions.

        svn 826: Update tally.c to avoid conflicts in C++
        version of phast.

        svn 801: Wrote around underflow in fabs in subroutine 
        reset. 

        svn 794: Errors in minteq.v4.dat database. Several redox
        reactions had delta H listed as kcal instead of kJ. kcal
        is correct only for the following species H2, NO2-, and
        NH4+.

        svn 675:
        Added PRINT option to print the species that contribute
        to alkalinity. Alkalinity distribution is printed in
        the output file following the distribution of species.
        Default at program startup is false.

        PRINT
                -alkalinity true
        
        svn 655:
        IAP and log K printed in Phase assemblage data 
        block were calculated from reactions rewritten to
        new master species. Now the original data base 
        reaction is used to calculate IAP and log K.
        Also fixed check that ensured all elements of 
        phase in are in solution before SI is calculated.

        svn 631:
        Fixed bug with alternate formula for equilibrium phase,
        nothing happened if all other equations were satisfied
        at beginning of reaction calculation.

        svn 603:
        Link gmp library statically.

        svn 601:
        Fixed statement on multiprecision.

        svn 581:
        Fixed bug in PhreeqcI that did not reinitialize
        Chebyschev parameters leading to incorrect results
        with Pitzer activity coefficients. Results were
        correct on first run, but erroneous on subsequent 
        runs.

        Added statement to identify multiprecision or
        standard solver for inverse modeling. 

        svn 578:

        Distribution changes. Fixed names in README file.
        Modified Makefile to use specified version. Split
        Linux and source distribution procedure.

------------------------------------------------------------
Version 2.12 Date: Wed September 28, 2005
------------------------------------------------------------

        Executables and output files for Sun operating systems
        are no longer provided.

        Limited log activities of master species to be greater
        than the smallest machine precision exponential number.
        Avoids a matherr exception and allows trial of additional
        parameter sets to attempt to solve the system of 
        equations.

        Made aqueous activity coefficients the default activity
        coefficients for exchange species when using the 
        Pitzer formulation. New option in EXCHANGE is
        -pitzer_exchange_gammas T/F, default is true; 
        defining "false" sets exchange activity coefficients
        to 1.0. Option has no effect for ion-association
        model (non-Pitzer).

        Edited phreeqc.dat to add -gamma expression for 
        CdX2 and PbX2. 

        Replaced O2(g) log K in phreeqc.dat and wateq4f.dat
        with data from llnl.dat, which appears to be better.

        Added multiplier format to REACTION increments, which
        simplifies definition of multiple equal reaction increments.

                   REACTION
                        H2O 1
                        -36 3*-4 2*-.25 -0.19 4*-0.1 3*-0.05 moles

        Added Pitzer activity formulation. Use pizer.dat database
        to invoke the Pitzer model. Should have same capabilities
        as ion-association model except explicit diffuse layer 
        calculation is not implemented with the Pitzer model.


        Fixed bug in surface sites related to mineral and exchange
        sites related to mineral. Did not have complete logic to 
        handle redox valence states in formula for species.

        Modified to remove non standard usage of va_list.

        Removed exchange master species from SYS("ex",..)
        list of species. This species is fictive and should
        not be included in the list.

        Changed -redox in SOLUTION so that if one of the
        redox states of a couple is not defined, then 
        redox defaults to pe.

        Fixed buffer overrun in PhreeqcI with SOLUTION_SPREAD, 
        caused segmenatation fault with lines greater than 
        500 characters.

        Added bigger string for some error messages to avoid 
        access violation in cvode.

        Changed output_msg to warning_msg for combinations
        of convergence parameters so that message would
        be controlled by -warnings identifier.

        Carriage returns are now stripped from Basic program 
        statements. Switching files from Windows to Unix sometimes
        leaves extra carriage returns at the ends of lines, which
        caused a syntax error for some Basic commands.

        Two bugs were fixed in inverse modeling. (1) Potential 
        models are now checked for all equality and inequality
        constraints. Previously some constraints were not checked.
        (2) One loop of cl1 did not include the last row when 
        checking for the pivot element. Also printing of headers
        was slightly modified for inverse modeling.

        A new multiple precision version of cl1 was develeped by 
        using the Gnu Multiple Precision package (gmp). Calculations 
        are carried out to about 30 significant digits. The mp 
        version may help in some situations where roundoff errors are
        a problem, but it is still possible that roundoff errors will 
        cause cl1mp to fail to find a solution to the optimization
        problem. The mp version has the following options in 
        INVERSE_MODELING:
                -multiple_precision T/F--causes the mp version 
                        to be used in inverse modeling calculations.
                -mp_tolerance 1e-12--tolerance for mp version of
                        cl1. As in cl1, numbers less than the
                        tolerance are considered to be zero. 
                        1e-12 is the default.
                -censor_mp 1e-20--as calculations occur in the
                        linear equation array, elements less
                        than this value are set to zero. Default
                        is 1e-20. A value of 0.0 causes no
                        censoring to occur.

------------------------------------------------------------
Version 2.11 Date: Mon February 7, 2005
------------------------------------------------------------

        Fixed error in selected output file with mixing reaction. 
        MIX number was written to two columns, should be one.

        Fixed memory leak with PAD function.

        New database minteq.v4.dat has been translated from version
        4.02 of MINTEQA2. An older version of the MINTEQA2 database is
        retained in file minteq.dat.

        Switched version control to subversion. Simplified,
        reorganized makefiles. 

        Fixed bug with PRINT; -warnings n. Use of this option 
        generally eliminated all warning messages instead of
        all messages after the nth. Default number of warning 
        messages printed in now 100 per simulation.

        Fixed memory leaks in cvode that caused phreeqci to crash.
        Now uses PHRQ_malloc in case of other memory leaks. Also
        fixed potential memory error with PAD Basic function.

        Saturation index phases that included water had wrong
        value if distribution of species, exchange, or surface 
        not written also.

        Fixed error message in cvode, if max iterations exceeded
        the error caused a segmentation fault.

        Made printing of parameter combination message a warning
        message so that it could be turned off.

------------------------------------------------------------
Version 2.10 Date: Tue November 2, 2004
------------------------------------------------------------

        Rearranged i/o for PHREEQC and reorganized driver
        subroutine. The object of these changes is to make 
        the program more functional as a module for other 
        programs (PHAST) and eventually to produce a callable 
        C and Fortran module.

        Fixed a problem with surface related to a phase, when
        phase was not part of system (for example, Fe(OH)3a when
        there is no iron in system.

        Added convergence parameter set that requires mineral
        transfers to produce positive concentrations in the 
        event that negative concentrations have been produced in
        the prior Newton-Raphson iteration. (Fluorite example).

        Fixed bug with kinetics formulas; did not account for
        stoichiometric coefficient correctly when using
        phase names. Generalized to allow multiple phase
        names in the -formula definition.

------------------------------------------------------------
Version 2.9 Date: Wed September 15, 2004
------------------------------------------------------------

        In inverse modeling, program terminates if sum of initial
        solutions and phases is > 32.

        Fixed bug with isotopes. Log activity estimate after initial
        solution calculation was inf under some conditions. An initial
        surface calculation failed when using D.

        Changed saturation index print out to use reaction and log K
        defined in PHASES definition. Previously, reaction could be 
        rewritten to predominant redox species.

        Fixed incorrect print of elapsed time for kinetics in advection.

        Added phrqproto.h prototype file and phrqtype.h for
        switching compilation to long double.

        Fixed incorrect printout of kinetics delta moles with
        advection.

        Added convergence parameter set that skips mineral
        equations for first 5 iterations. 

        Added entity_exists for module.

        Tried to fix bug with mix index incorrect (-2) for
        mixing with kinetics.

        Added new keyword COPY that allows a data entity 
                to be copied from one index to a new index 
                or to a range of indicies. Format is 

                COPY keyword index index_start[-index_end]
        
                where keyword is one of the following:
                                SOLUTION
                                EQUILIBRIUM_PHASES
                                EXCHANGE
                                GAS_PHASE
                                KINETICS
                                MIX
                                REACTION
                                REACTION_TEMPERATURE
                                SOLID_SOLUTION
                                SURFACE

        Numerical method had a bug with ionic strength, if
                mass of water was not approximately 1. Routine
                revise_guesses did not divide by the mass of 
                water. Also changed check in routine molalities
                to check by molality, not moles.

        Fixed a null pointer when surface was related to a
                mineral and mineral was not in database.

        Added new Basic functions
        i = INSTR(a$, b$)  sets i to the character position of
                string b$ in a$, 0 in not found.
        b$ = LTRIM(a$)     trims white space from beginning of 
                string a$ and stores result in b$.
        b$ = RTRIM(a$)     trims white space from end of string 
                a$ and stores result in b$.
        b$ = LTRIM(a$)     trims white space from beginning and
                end of string a$ and stores result in b$.

        Added new Basic function SYS that calculates the to
        total amount of an element in all phases (solution,
        equilibrium_phases, surfaces, exchangers, solid solutions, 
        and gas phase). KINETIC reactions are not included.
        The function has two forms: (1) one element name as an
        argument (variable names are user specified)

        10 t = SYS("As")

        the function will return the total arsenic in the system.
        (2) 5 argumens

        10 t = SYS("As", count_species, names$, types$, moles)

        will return the total arsenic in the system to tot; count_species--
        the number of species that contain arsenic, including
        solution, equilibrium_phases, surfaces, exchangers, solid solutions, 
        and gas phase species; names$--a character array that has the
        name of each species; type$--a character array that specifies the
        type of phase for the species, aq, equi, surf, ex, s_s, gas, diff. 
        Diff refers to the amount of the element in the diffuse layer of 
        a surface when the explicit diffuse layer calculation is used; 
        moles--an array containing the number of moles of the element in 
        the species. The sum of moles(i) is equal to tot.

        SYS has several special arguments for the form 
        SYS("arg", count, names$, types$, values)
                arg     is one of the options listed below.
                count   is a single numeric value and is the number of elements
                                in the following arrays.
                name$   is an array of string values.
                type$   is an array of string values.
                values  is an array of numeric values.

        Values of arg:

        elt_name        returns total number of moles of element in system.
                        count is the number of species for the element in
                                the system, including aqueous, exchange, surface,
                                equilibrium_phase, solid solution component, and
                                gas phase "species".
                        Arrays are filled for each "species"; values are moles.
        "elements"      returns total number of moles of all elements, 
                                valence states, exchangers, and surfaces.
                        count is number of elements, valence states, 
                                exchangers, and surfaces.
                        Arrays are filled for each element, valence state,
                                exchanger, and surface; values are moles.
        "phases"        returns maximum saturation index of all phases.
                        count is number of phases in system.
                        Arrays are filled for each phase; values are
                                saturation indexes.
        "aq"            returns sum of moles of all aqueous species.
                        count is number of aqueous species in system.
                        Arrays are filled with each aqueous species;
                                values are moles.
        "ex"            returns sum of moles of all exchange species.
                        count is number of exchange species in system.
                        Arrays are filled with each exchange species;
                                values are moles.
        "surf"          returns sum of moles of all surface species.
                        count is number of surface species in system.
                        Arrays are filled with each surface species;
                                values are moles.
        "s_s"          returns sum of moles of all solid solution components.
                        count is number of solid solution components in system.
                        Arrays are filled with each solid solution component;
                                values are moles.
        "gas"           returns sum of moles of all gas components.
                        count is number of gas components in system.
                        Arrays are filled with each gas component;
                                values are moles.

        Added new Basic function, DESCRIPTION, that has the value
        defined for the description field of the SOLUTION keyword line. 

        Added alternative ordinary differential equation solver
        called CVODE, a set of C routines from the Lawrence 
        Livermore National Labs. CVODE is part of the SUNDIALS
        package. CVODE is used in place of the Runge Kutta method
        when "-cvode true" is used within a KINETICS data block.

        KINETICS
                -cvode true

        Fixed error in SOLUTION_SPREAD, defining -redox
        did not set the default redox for the solutions
        that were defined; pe was always used as default.

        Modified code to allocate space differently for
        pp_assemblage, exchange, surface, gas_phase, 
        kinetics, and s_s_assemblage. Enough space is allocated
        at beginning of distribute_initial_conditions.
        May speed up phast initialization and make better
        use of available memory.

        Changed gfw of water to 18 if isotopes of water are 
        included. Solvent is [1H]2[16O].

        Fixed a bug in surface integration where order of ions
        in the list of g's was incorrect.

        Pyrite rate was not 0 if supersaturated in phreeqc.dat
        and wateq4f.dat

        Segmentation error if a surface species was not 
        defined with an equation that contained another surface
        species. In this case, the surface master species
        had been redefined to be an aqueous species (SOLUTION_SPECIES).

------------------------------------------------------------
Version 2.8 Date: Tue April 15, 2003
------------------------------------------------------------

        Updated arsenic data in wateq4f.dat to be consistent with
        Archer and Nordstrom (2002).

        Revised Basic interpreter to allow lines of any length
        and character strings of any length.

        Renumbering basic statement that included the function
        SURF in PhreeqcI caused SURF to be omitted and generated
        a syntax error. SURF and other functions had not been
        implemented in PhreeqcI.

        Fixed a bug in the Basic Interpreter. If elements of
        a dimensioned variable (character or number) were used on 
        both sides of an equation, the result was erroneously 
        stored in the last element of the variable used on the 
        right-hand side instead of the element specified on the 
        left-hand side.

        Using comma in some fields caused an infinite loop.

        Fixed bug with SOLUTION_SPREAD, Phreeqc was not
        calculating solution numbers for solution_spread 
        solutions without solution numbers.

        Fixed bug with stagnant zone calculations. If solutions
        not defined for stagnant cells, PhreeqcI crashed.

        Added new state for calculations, PHAST. Previously
        phast used the state TRANSPORT, which caused some
        erroneous results with temperature when TRANSPORT was
        used in the PHREEQC part of the calculation.

        Trying to define dump file in TRANSPORT caused a file 
        opening error. Fixed logic so now can open a file
        and the name can include blanks.

------------------------------------------------------------
Version 2.7 Date: Fri February 14, 2003
------------------------------------------------------------

        Initialized gfw in elements structure.

        Fixed bug where "time" would be wrong for initial
                solution calculation. Needed to initialize
                rate variables for PhreeqcI.

        Added print of simulation number to error file for
                phreeqci

        Limited printing of cell numbers to output file in advection
                calculations. Cell numbers only printed if results
                for cell are going to be printed.

        PhreeqcI captured status messages for kinetics, which
                made a very large error file in some cases and
                a long wait to view the output file in PhreeqcI.
                Now PhreeqcI does not capture these intermediate
                status messages.

        Removed old code related to redirecting error file


        Corrected error in transport where wrong time step was used
        for integration.

        Changes to speed up transport algorithm.

        Allow file names with spaces in selected_output file name and
                dump_file name.

        Modifications to work with RC1 phast log file.

        Allow any characters in square brackets for element name.
                - and + and perhaps others caused problems before.

        Fixed log molality of water in species printout, was
                equal to log activity of water. Also fixed
                basic function for LM.

        Changed solid solution prints to print 0 if solid solution
                is not present.

        Fixed bug if no rate name was defined before options
                in RATES.

        Fixed warning on Mac compilation in fpunchf.

        Fixed bug if isotopes were used but H and O isotopes 
                were not defined.

        Fixed bug where special initial solution calculations
                were done at later calculation stages.
                Needed to set initial_solution_isotopes = FALSE;

        Fixed problem in C++ if structure name is same as member name.
                logk member of logk structure was renamed to log_k.

        Added identifier -add_constant to PHASES, EXCHANGE_SPECIES,
                SOLUTION_SPECIES, and SURFACE_SPECIES. 

                -add_constant  -0.301  

                log K is augmented by the specified constant. 


        Added punch_isotopes and punch_calculate_values to allow
                printing isotope ratios and any CALCULATE_VALUES result.

        Added KEYWORDS:

        ISOTOPES
        Element
        -isotope  isotope_name units standard_ratio
        -total_is_major  T/F (OPTION IS DISABLED!!)

        CALCULATE_VALUES
        Name
        -start
        Basic statements, must have SAVE
        -end

        ISOTOPE_RATIOS (for printing)
        Name=Calculate_values_name      Isotope_name

        ISOTOPE_ALPHAS (for printing)
        Name=Calculate_values_name      Named_logk=named_expression_name

        Basic functions:
        calc_value("calc_value_name")           evaluates a definition of CALCULATE_VALUES
        lk_named("name")                        log10(K) of definition in NAMED_EXPRESSIONS
        lk_phase("name")                        log10(K) of definition in PHASES
        lk_species("name")                      log10(K) of definition in (SOLUTION, EXCHANGE, SURFACE)_SPECIES
        sum_gas("template","element")           Sum of element in gases with specified template
                                                template="{C,[13C],[14C]}{O,[18O]}2" includes all CO2 gases
        sum_species("template","element")       Sum of element in aqueous, exchange, and surface species with
                                                specified template
        sum_s_s("s_s_name","element")           Sum of element in a specified solid solution

        PRINT keyword:
        -initial_isotopes T/F
        -isotope_ratios   T/F
        -isotope_alphas   T/F
        -censor_species   1e-8    # Omits print of species if less than relative criterion

        SELECTED_OUTPUT keyword:
        -calculate_values  name1 name2 ...
        -isotopes minor_isotope1 minor_isotope2 ....

        Added functions LK_SPECIES, LK_NAMED, LK_PHASE for Basic
                interpreter. LK_SPECIES("CaHCO3+") returns the
                log k for the association reaction for the ion pair
                CaHCO3+ at the current temperature. The log K is 
                for the reaction as defined in the database or 
                input file. Similarly, 
                LK_NAMED("Log_alpha_18O_CO2(aq)/CO2(g)") returns the 
                value for the log K at the current temperature using
                expressions defined in NAMED_LOG_K data block; 
                LK_PHASE("Calcite") returns the value of log K 
                for calcite at the current temperature for the 
                dissociation reaction defined in the database or 
                input file. Values are "log10" values.
                Example for Basic program:

                10 PRINT "Log10 KCalcite: ", LK_PHASE("Calcite")
                20 PRINT "Log10 KCaHCO3+: ", LK_SPECIES("CaHCO3+")
                30 PRINT " 1000ln(alpha): ", LK_NAMED("Log_alpha_18O_CO2(aq)/CO2(g)")*LOG(10)*1000

        Added NAMED_EXPRESSIONS data block. This data block was
                implemented to facilitate isotopic calculations.
                It allows analytical expressions that are functions
                of temperature to be defined. The purpose is to 
                separate the fractionation factors from the log K, 
                so that the fractionation factor or its temperature 
                dependence can be easily modified. The named 
                expression can be added to a log K for a species
                or phase by the -add_logk identifier in SOLUTION_SPECIES
                EXCHANGE_SPECIES, SURFACE_SPECIES, or PHASES data
                block.

------------------------------------------------------------
Version 2.6 Date: Mon April 22, 2002
------------------------------------------------------------

        PhreeqcI  released.

        All selected_output is routed through a single routine.

        Allow "_" inside square brackets, [A_bcd].

        Fixed bug match_elts_in_species, check for "e-" was wrong.

        Modified minteq.dat to put CuS4S5-3, Cu(S4)2-3 in
                in Cu(1) mole balance equations instead of
                Cu(2). Before the change, the program would 
                not converge if Cu(2) were defined in an 
                initial solution.
                
        Made revisions hopefully to improve SOLID_SOLUTIONS
                convergence with small numbers of moles of
                solids.

        Made changes related to dump file and PhreeqcI.

        Iterations now sums iterations in all kinetics calculations

        Fixed bug with LA("H2O"), which was returning natural log
                of activity of water.
        

------------------------------------------------------------
Version 2.5  Date: Mon October 1, 2001
------------------------------------------------------------

        In llnl.dat, fixed sign errors in RRE (rare earth elements) 
                for some redox reactions and removed some redundant 
                species, generally ReeO2- was retained and Ree(OH)4- 
                was removed.

        Added the capability to use square brackets to define an
                "element" name. The brackets act like quotation marks
                in that any character string can be used within the 
                brackets as an element name. This was introduced to
                simplify expansion of the model to isotopic species.
                [13C], [14C], and [18O] are legal element names.

        Added identifier -activity_water for a species in 
                SOLUTION_SPECIES data block. This identifier has been 
                added for future updates that will allow isotopic 
                calculations. It is intended to be used only for 
                isotopic variations of H2O, like D2O or H2[O18]. It
                forces the activity coefficient for the species to be
                activity(water)/55.5. This effectively sets the activity 
                of the species to the mole fraction in solution.

        Fixed bug in checking solid solutions for presence or
                absence of elements in the system. Programming
                error caused segmentation fault if an error
                was detected under certain conditions.

        Changed return value of MOL to be molality of water
                if argument is "H2O". Also changed return value
                of LA to be activity of water if argument is 
                "H2O".

        Diffuse layer calculation was incorrect if aqueous phase did not
                have 1 kilogram of water. Eq. 74 of manual has molality,
                but code used moles. The code was corrected by adding
                the mass of water to the formulation.

        Stagnant zones with first-order exchange approximation (1 stagnant 
                cell, exchange factor, and porosities defined) did not work 
                correctly if mobile and immobile cells did not have equal 
                volumes of water. The mixing factors were revised to account
                for the masses of water in the stagnant and mobile zones.

        A fatal error was erroneously detected if the database file
                had a DATABASE data block. DATABASE data block is
                now ignored while reading the database file.

        Added identifier -bad_step_max to KINETICS data block.
                An integer following -bad_step_max gives the maximum number 
                of times a rate integration may fail before execution of the
                program is terminated. Default is 500.

------------------------------------------------------------
Version 2.4.2: Date: Fri June 15, 2001
------------------------------------------------------------

        Fixed spreadsheet bug. Program was not ignoring columns
                that could not be identified as either element 
                names or allowed data (ph, pe, number, description, 
                etc). Also, the program failed if a spreadsheet solution
                number was negative.

------------------------------------------------------------
Version 2.4.1: Date: Mon June 4, 2001
------------------------------------------------------------

        Fixed spreadsheet bugs with isotopes.

------------------------------------------------------------
Version 2.4: Date: Fri June 1, 2001
------------------------------------------------------------

        Added structure for spreadsheet for use by PhreeqcI.

        Isotope value initialized incorrectly if only an -uncertainty was 
                defined in SOLUTION_SPREAD.

        Fixed segmentation violation when primary and secondary master
                species were defined improperly.

        Corrected enthalpies of reaction in llnl.dat. Previous release had
                erroneously had enthalpies of formation in -delta_H
                parameter; the values should be enthalpies of reaction.
                Enthalpies of reaction were calculated from the
                enthalpies of formation and these values are now included
                in the -delta_H parameter. This change will have very
                little impact on calculations because the analytical
                expression has precedence over -delta_H in calculating
                temperature dependence of log K, and nearly all species
                and minerals have an analytical expression or lack both
                an analytical expression and an enthalpy of reaction.

        Corrected bugs in punch of solid solution components that caused
                both selected output and output file errors:  moles
                were incorrect in selected output, and total moles and
                mole fraction were incorrect in output file.

        Added surface complexation constants for Fe+2; two complexes for 
                weak sites and one complex for strong sites.  phreeqc.dat
                and wateq4f.dat modified.

        Comment for units of parameters for calcite rate equation was
                wrong. Rate equation now uses cm^2/L for area parameter. 
                Previously the correct units would have been 1/decimeter. 
                phreeqc.dat and wateq4f.dat modified.

        Fixed a bug when rates were equal within tolerance, but negative
                concentrations occurred because of small initial
                concentrations.

        Added -warnings to PRINT keyword for specification of maximum
                number of warnings to print. Negative number allows
                all warnings to be printed.

        Function CELL_NO in Basic now prints a number equivalent to
                -solution in SELECTED_OUTPUT data block. This does not
                change printing for ADVECTION or TRANSPORT calculations.

        Kinetics time is halved for advective part of reaction in 
                transport; time incorrectly accounted for before.

        -punch_ identifiers printed -1 instead of the correct solution 
                number for batch-reaction calculations.

        -high_precision is no longer reset to false with every 
                SELECTED_OUTPUT data block.

        SELECTED_OUTPUT file name stored for use by PhreeqcI.

        Alkalinity for NH3 corrected to 1.0 in llnl.dat.

        Fixed bug with USER_PRINT of kinetics. Did not find correct
                kinetics information in some cases. 

        Fixed bug in default values for SOLUTION_SPREAD. Cannot use phase 
                name and SI for pH or pe, and bug did not allow PHREEQC
                to run. Now PHREEQC runs, but warns that this is not
                allowed.

------------------------------------------------------------
Version 2.3: Date: Tue January 2, 2001
------------------------------------------------------------

        Added new keyword DATABASE. It must be the first keyword in
                the input file. The character string following the
                keyword is the pathname for the database file to
                be used in the calculation. The file that is 
                specified takes precedence over any default
                database name, including environmental variable
                PHREEQC_DATABASE and command line arguments.

        Fixed bug in SOLUTION_SPREAD. If first heading in
                the spread-sheet input was an identifier--pH,
                pe, units, etc--then the headings were interpreted
                as an identifier and bad things happened.

        Added new keyword to make aqueous model similar to
                LLNL and Geochemists Workbench when using
                llnl.dat as the database file. Values
                of Debye-Hückel a and b and bdot (ionic strength
                coefficient) are read at fixed temperatures.
                Linear interpolation occurs between temperatures.

        New options for SOLUTION_SPECIES are
                -llnl_gamma  a   , where a is the ion-size parameter.
                -co2_llnl_gamma  , indicates the temperature dependent
                                function for the bdot term given in 
                                -co2_coefs of LLNL_AQUEOUS_MODEL_PARAMETERS
                                will be used. Applies to uncharged
                                species only.

LLNL_AQUEOUS_MODEL_PARAMETERS
-temperatures
         0.0100   25.0000   60.0000  100.0000
       150.0000  200.0000  250.0000  300.0000
#debye huckel a (adh)
-dh_a
         0.4939    0.5114    0.5465    0.5995
         0.6855    0.7994    0.9593    1.2180
#debye huckel b (bdh)
-dh_b
         0.3253    0.3288    0.3346    0.3421
         0.3525    0.3639    0.3766    0.3925
-bdot
         0.0394    0.0410    0.0438    0.0460
         0.0470    0.0470    0.0340    0.0000
#cco2   (coefficients for the Drummond (1981) polynomial)
-co2_coefs
        -1.0312              0.0012806
          255.9                 0.4445
      -0.001606
        

        Fixed bug in basic interpreter. A number like "..524" would
                cause an infinite loop.

        Added function SURF to Basic.
                SURF("element", "surface") gives the amount of 
                        element sorbed on "surface". "surface" 
                        should be the surface name, not the 
                        surface-site name (that is, no underscore).

        Fixed option to "runge_kutta" from "runge-kutta" to match
                documentation for KINETICS.

        Fixed UO2+2 and Mn+2 reaction stoichiometry for Hfo surface complexation
                in wateq4f.dat.

        Added option for an equilibrium-phase to dissolve only. 
                "dis" is added at the end of a line defining an equilibrium-
                        phase. No data fields may be omitted. Should not
                        be used when adding an alternative reaction.
                Example:
                EQUILIBRIUM_PHASES
                        Dolomite 0.0  0.001 dis
        R-K integration failed when only the final rate generated
                negative concentrations.
        Allow decimals in definition of secondary master species, for
                example S(0.3).
        Fixed bug if description was more than about 85 characters;
                now allows about 400 characters.
        Fixed bug for surface/exchange sites related to phases. Was
                checking internal copies of surfaces/exchange with negative
                numbers.
        Fixed bug in quick prep that did not set the correct pointer
                for gas phases.
        Fixed segmentation fault that occurred if all elements for
                phase-boundary mineral were not in the solution.
                Only applied to a phase used to define concentration
                in an initial solution calculation.
        Added option to eliminate echo of input file in PRINT
                data block. -echo_input T/F turns echoing on
                and off. Default is on.
        

------------------------------------------------------------
Release 2.2: Date: Wed March 1, 2000
------------------------------------------------------------

        Fixed bug in MIX if no solutions are defined.
        Changed printout for surface.
                Only gives net surface charge for diffuse layer 
                        calculation.
                Prints correct value for the surface charge and
                        surface charge density for diffuse-layer 
                        calculation.    

        Added function EDL to Basic.
                EDL("element", "surface") gives the amount of 
                        element in the diffuse layer for "surface".
                        not including sorbed species. "surface" should 
                        be the surface name, not the surface-site name 
                        (that is, no underscore).

                Special values for "element" include:
                        "charge" - gives surface charge, equivalents.
                        "sigma"  - surface charge density, C/m**2.
                        "psi"    - potential at the surface, Volts.
                        "water"  - mass of water in the diffuse layer, kg.
        Changed distribution to be more consistent with other USGS 
                water-resources applications.

------------------------------------------------------------
Release 2.1: Date: Wed January 19, 2000
------------------------------------------------------------

        Added additional #ifdef's for PhreeqcI.
        Fixed problem with formats for USER_PUNCH and
                others with Microsoft C++ 3 digit 
                exponents.

Initial Release 2.0: Date: Wed December 15, 1999

Version: C_54 = Version 2.0 
        
