mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-15 16:18:22 +01:00
House cleaning for phreeqcpp
git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/trunk@787 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
60a1544019
commit
dff0e3454b
@ -1,325 +0,0 @@
|
||||
Input file: /z/parkplace/home/dlpark/../../home/dlpark/programs/phreeqc/src/../src/Sun/../../examples/ex1
|
||||
Output file: ex1.out
|
||||
Database file: /z/parkplace/home/dlpark/../../home/dlpark/programs/phreeqc/src/../src/Sun/../../database/phreeqc.dat
|
||||
|
||||
------------------
|
||||
Reading data base.
|
||||
------------------
|
||||
|
||||
SOLUTION_MASTER_SPECIES
|
||||
SOLUTION_SPECIES
|
||||
PHASES
|
||||
EXCHANGE_MASTER_SPECIES
|
||||
EXCHANGE_SPECIES
|
||||
SURFACE_MASTER_SPECIES
|
||||
SURFACE_SPECIES
|
||||
RATES
|
||||
END
|
||||
------------------------------------
|
||||
Reading input data for simulation 1.
|
||||
------------------------------------
|
||||
|
||||
TITLE Example 1.--Add uranium and speciate seawater.
|
||||
SOLUTION 1 SEAWATER FROM NORDSTROM ET AL. (1979)
|
||||
units ppm
|
||||
pH 8.22
|
||||
pe 8.451
|
||||
density 1.023
|
||||
temp 25.0
|
||||
redox O(0)/O(-2)
|
||||
Ca 412.3
|
||||
Mg 1291.8
|
||||
Na 10768.0
|
||||
K 399.1
|
||||
Fe 0.002
|
||||
Mn 0.0002 pe
|
||||
Si 4.28
|
||||
Cl 19353.0
|
||||
Alkalinity 141.682 as HCO3
|
||||
S(6) 2712.0
|
||||
N(5) 0.29 gfw 62.0
|
||||
N(-3) 0.03 as NH4
|
||||
U 3.3 ppb N(5)/N(-3)
|
||||
O(0) 1.0 O2(g) -0.7
|
||||
SOLUTION_MASTER_SPECIES
|
||||
U U+4 0.0 238.0290 238.0290
|
||||
U(4) U+4 0.0 238.0290
|
||||
U(5) UO2+ 0.0 238.0290
|
||||
U(6) UO2+2 0.0 238.0290
|
||||
SOLUTION_SPECIES
|
||||
U+4 = U+4
|
||||
log_k 0.0
|
||||
U+4 + 4 H2O = U(OH)4 + 4 H+
|
||||
log_k -8.538
|
||||
delta_h 24.760 kcal
|
||||
U+4 + 5 H2O = U(OH)5- + 5 H+
|
||||
log_k -13.147
|
||||
delta_h 27.580 kcal
|
||||
U+4 + 2 H2O = UO2+ + 4 H+ + e-
|
||||
log_k -6.432
|
||||
delta_h 31.130 kcal
|
||||
U+4 + 2 H2O = UO2+2 + 4 H+ + 2 e-
|
||||
log_k -9.217
|
||||
delta_h 34.430 kcal
|
||||
UO2+2 + H2O = UO2OH+ + H+
|
||||
log_k -5.782
|
||||
delta_h 11.015 kcal
|
||||
2UO2+2 + 2H2O = (UO2)2(OH)2+2 + 2H+
|
||||
log_k -5.626
|
||||
delta_h -36.04 kcal
|
||||
3UO2+2 + 5H2O = (UO2)3(OH)5+ + 5H+
|
||||
log_k -15.641
|
||||
delta_h -44.27 kcal
|
||||
UO2+2 + CO3-2 = UO2CO3
|
||||
log_k 10.064
|
||||
delta_h 0.84 kcal
|
||||
UO2+2 + 2CO3-2 = UO2(CO3)2-2
|
||||
log_k 16.977
|
||||
delta_h 3.48 kcal
|
||||
UO2+2 + 3CO3-2 = UO2(CO3)3-4
|
||||
log_k 21.397
|
||||
delta_h -8.78 kcal
|
||||
PHASES
|
||||
Uraninite
|
||||
UO2 + 4 H+ = U+4 + 2 H2O
|
||||
log_k -3.490
|
||||
delta_h -18.630 kcal
|
||||
END
|
||||
-----
|
||||
TITLE
|
||||
-----
|
||||
|
||||
Example 1.--Add uranium and speciate seawater.
|
||||
|
||||
-------------------------------------------
|
||||
Beginning of initial solution calculations.
|
||||
-------------------------------------------
|
||||
|
||||
Initial solution 1. SEAWATER FROM NORDSTROM ET AL. (1979)
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
Alkalinity 2.406e-03 2.406e-03
|
||||
Ca 1.066e-02 1.066e-02
|
||||
Cl 5.657e-01 5.657e-01
|
||||
Fe 3.711e-08 3.711e-08
|
||||
K 1.058e-02 1.058e-02
|
||||
Mg 5.507e-02 5.507e-02
|
||||
Mn 3.773e-09 3.773e-09
|
||||
N(-3) 1.724e-06 1.724e-06
|
||||
N(5) 4.847e-06 4.847e-06
|
||||
Na 4.854e-01 4.854e-01
|
||||
O(0) 3.746e-04 3.746e-04 Equilibrium with O2(g)
|
||||
S(6) 2.926e-02 2.926e-02
|
||||
Si 7.382e-05 7.382e-05
|
||||
U 1.437e-08 1.437e-08
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 8.220
|
||||
pe = 8.451
|
||||
Activity of water = 0.981
|
||||
Ionic strength = 6.748e-01
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total carbon (mol/kg) = 2.180e-03
|
||||
Total CO2 (mol/kg) = 2.180e-03
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = 7.936e-04
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = 0.07
|
||||
Iterations = 7
|
||||
Total H = 1.110147e+02
|
||||
Total O = 5.563047e+01
|
||||
|
||||
---------------------------------Redox couples---------------------------------
|
||||
|
||||
Redox couple pe Eh (volts)
|
||||
|
||||
N(-3)/N(5) 4.6750 0.2766
|
||||
O(-2)/O(0) 12.3893 0.7329
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
OH- 2.674e-06 1.629e-06 -5.573 -5.788 -0.215
|
||||
H+ 7.981e-09 6.026e-09 -8.098 -8.220 -0.122
|
||||
H2O 5.551e+01 9.806e-01 1.744 -0.009 0.000
|
||||
C(4) 2.180e-03
|
||||
HCO3- 1.514e-03 1.023e-03 -2.820 -2.990 -0.170
|
||||
MgHCO3+ 2.195e-04 1.640e-04 -3.658 -3.785 -0.127
|
||||
NaHCO3 1.667e-04 1.948e-04 -3.778 -3.710 0.067
|
||||
MgCO3 8.913e-05 1.041e-04 -4.050 -3.982 0.067
|
||||
NaCO3- 6.718e-05 5.020e-05 -4.173 -4.299 -0.127
|
||||
CaHCO3+ 4.597e-05 3.106e-05 -4.337 -4.508 -0.170
|
||||
CO3-2 3.821e-05 7.959e-06 -4.418 -5.099 -0.681
|
||||
CaCO3 2.725e-05 3.183e-05 -4.565 -4.497 0.067
|
||||
CO2 1.210e-05 1.413e-05 -4.917 -4.850 0.067
|
||||
UO2(CO3)3-4 1.255e-08 1.184e-10 -7.901 -9.927 -2.025
|
||||
UO2(CO3)2-2 1.814e-09 5.653e-10 -8.741 -9.248 -0.506
|
||||
MnCO3 2.696e-10 3.150e-10 -9.569 -9.502 0.067
|
||||
MnHCO3+ 6.077e-11 4.541e-11 -10.216 -10.343 -0.127
|
||||
UO2CO3 7.429e-12 8.678e-12 -11.129 -11.062 0.067
|
||||
FeCO3 1.952e-20 2.281e-20 -19.709 -19.642 0.067
|
||||
FeHCO3+ 1.635e-20 1.222e-20 -19.786 -19.913 -0.127
|
||||
Ca 1.066e-02
|
||||
Ca+2 9.504e-03 2.380e-03 -2.022 -2.623 -0.601
|
||||
CaSO4 1.083e-03 1.266e-03 -2.965 -2.898 0.067
|
||||
CaHCO3+ 4.597e-05 3.106e-05 -4.337 -4.508 -0.170
|
||||
CaCO3 2.725e-05 3.183e-05 -4.565 -4.497 0.067
|
||||
CaOH+ 8.604e-08 6.429e-08 -7.065 -7.192 -0.127
|
||||
CaHSO4+ 5.979e-11 4.467e-11 -10.223 -10.350 -0.127
|
||||
Cl 5.657e-01
|
||||
Cl- 5.657e-01 3.528e-01 -0.247 -0.452 -0.205
|
||||
MnCl+ 9.582e-10 7.160e-10 -9.019 -9.145 -0.127
|
||||
MnCl2 9.439e-11 1.103e-10 -10.025 -9.958 0.067
|
||||
MnCl3- 1.434e-11 1.071e-11 -10.844 -10.970 -0.127
|
||||
FeCl+2 9.557e-19 2.978e-19 -18.020 -18.526 -0.506
|
||||
FeCl2+ 6.281e-19 4.693e-19 -18.202 -18.329 -0.127
|
||||
FeCl+ 7.786e-20 5.817e-20 -19.109 -19.235 -0.127
|
||||
FeCl3 1.417e-20 1.656e-20 -19.849 -19.781 0.067
|
||||
Fe(2) 6.909e-19
|
||||
Fe+2 5.205e-19 1.195e-19 -18.284 -18.923 -0.639
|
||||
FeCl+ 7.786e-20 5.817e-20 -19.109 -19.235 -0.127
|
||||
FeSO4 4.845e-20 5.660e-20 -19.315 -19.247 0.067
|
||||
FeCO3 1.952e-20 2.281e-20 -19.709 -19.642 0.067
|
||||
FeHCO3+ 1.635e-20 1.222e-20 -19.786 -19.913 -0.127
|
||||
FeOH+ 8.227e-21 6.147e-21 -20.085 -20.211 -0.127
|
||||
FeHSO4+ 3.000e-27 2.242e-27 -26.523 -26.649 -0.127
|
||||
Fe(3) 3.711e-08
|
||||
Fe(OH)3 2.841e-08 3.318e-08 -7.547 -7.479 0.067
|
||||
Fe(OH)4- 6.591e-09 4.924e-09 -8.181 -8.308 -0.127
|
||||
Fe(OH)2+ 2.118e-09 1.583e-09 -8.674 -8.801 -0.127
|
||||
FeOH+2 9.425e-14 2.937e-14 -13.026 -13.532 -0.506
|
||||
FeSO4+ 1.093e-18 8.167e-19 -17.961 -18.088 -0.127
|
||||
FeCl+2 9.557e-19 2.978e-19 -18.020 -18.526 -0.506
|
||||
FeCl2+ 6.281e-19 4.693e-19 -18.202 -18.329 -0.127
|
||||
Fe+3 3.509e-19 2.796e-20 -18.455 -19.554 -1.099
|
||||
Fe(SO4)2- 6.372e-20 4.761e-20 -19.196 -19.322 -0.127
|
||||
FeCl3 1.417e-20 1.656e-20 -19.849 -19.781 0.067
|
||||
Fe2(OH)2+4 2.462e-24 2.322e-26 -23.609 -25.634 -2.025
|
||||
FeHSO4+2 4.228e-26 1.318e-26 -25.374 -25.880 -0.506
|
||||
Fe3(OH)4+5 1.122e-29 7.679e-33 -28.950 -32.115 -3.165
|
||||
H(0) 0.000e+00
|
||||
H2 0.000e+00 0.000e+00 -44.436 -44.369 0.067
|
||||
K 1.058e-02
|
||||
K+ 1.042e-02 6.495e-03 -1.982 -2.187 -0.205
|
||||
KSO4- 1.627e-04 1.216e-04 -3.789 -3.915 -0.127
|
||||
KOH 3.137e-09 3.665e-09 -8.503 -8.436 0.067
|
||||
Mg 5.507e-02
|
||||
Mg+2 4.742e-02 1.371e-02 -1.324 -1.863 -0.539
|
||||
MgSO4 7.330e-03 8.562e-03 -2.135 -2.067 0.067
|
||||
MgHCO3+ 2.195e-04 1.640e-04 -3.658 -3.785 -0.127
|
||||
MgCO3 8.913e-05 1.041e-04 -4.050 -3.982 0.067
|
||||
MgOH+ 1.084e-05 8.100e-06 -4.965 -5.092 -0.127
|
||||
Mn(2) 3.773e-09
|
||||
Mn+2 2.171e-09 4.982e-10 -8.663 -9.303 -0.639
|
||||
MnCl+ 9.582e-10 7.160e-10 -9.019 -9.145 -0.127
|
||||
MnCO3 2.696e-10 3.150e-10 -9.569 -9.502 0.067
|
||||
MnSO4 2.021e-10 2.360e-10 -9.695 -9.627 0.067
|
||||
MnCl2 9.439e-11 1.103e-10 -10.025 -9.958 0.067
|
||||
MnHCO3+ 6.077e-11 4.541e-11 -10.216 -10.343 -0.127
|
||||
MnCl3- 1.434e-11 1.071e-11 -10.844 -10.970 -0.127
|
||||
MnOH+ 2.789e-12 2.084e-12 -11.555 -11.681 -0.127
|
||||
Mn(NO3)2 1.375e-20 1.607e-20 -19.862 -19.794 0.067
|
||||
Mn(3) 5.993e-26
|
||||
Mn+3 5.993e-26 4.349e-27 -25.222 -26.362 -1.139
|
||||
N(-3) 1.724e-06
|
||||
NH4+ 1.609e-06 9.049e-07 -5.794 -6.043 -0.250
|
||||
NH3 7.326e-08 8.558e-08 -7.135 -7.068 0.067
|
||||
NH4SO4- 4.157e-08 3.106e-08 -7.381 -7.508 -0.127
|
||||
N(5) 4.847e-06
|
||||
NO3- 4.847e-06 2.846e-06 -5.314 -5.546 -0.231
|
||||
Mn(NO3)2 1.375e-20 1.607e-20 -19.862 -19.794 0.067
|
||||
Na 4.854e-01
|
||||
Na+ 4.791e-01 3.387e-01 -0.320 -0.470 -0.151
|
||||
NaSO4- 6.053e-03 4.523e-03 -2.218 -2.345 -0.127
|
||||
NaHCO3 1.667e-04 1.948e-04 -3.778 -3.710 0.067
|
||||
NaCO3- 6.718e-05 5.020e-05 -4.173 -4.299 -0.127
|
||||
NaOH 3.117e-07 3.641e-07 -6.506 -6.439 0.067
|
||||
O(0) 3.746e-04
|
||||
O2 1.873e-04 2.188e-04 -3.727 -3.660 0.067
|
||||
S(6) 2.926e-02
|
||||
SO4-2 1.463e-02 2.664e-03 -1.835 -2.574 -0.740
|
||||
MgSO4 7.330e-03 8.562e-03 -2.135 -2.067 0.067
|
||||
NaSO4- 6.053e-03 4.523e-03 -2.218 -2.345 -0.127
|
||||
CaSO4 1.083e-03 1.266e-03 -2.965 -2.898 0.067
|
||||
KSO4- 1.627e-04 1.216e-04 -3.789 -3.915 -0.127
|
||||
NH4SO4- 4.157e-08 3.106e-08 -7.381 -7.508 -0.127
|
||||
HSO4- 2.089e-09 1.561e-09 -8.680 -8.807 -0.127
|
||||
MnSO4 2.021e-10 2.360e-10 -9.695 -9.627 0.067
|
||||
CaHSO4+ 5.979e-11 4.467e-11 -10.223 -10.350 -0.127
|
||||
FeSO4+ 1.093e-18 8.167e-19 -17.961 -18.088 -0.127
|
||||
Fe(SO4)2- 6.372e-20 4.761e-20 -19.196 -19.322 -0.127
|
||||
FeSO4 4.845e-20 5.660e-20 -19.315 -19.247 0.067
|
||||
FeHSO4+2 4.228e-26 1.318e-26 -25.374 -25.880 -0.506
|
||||
FeHSO4+ 3.000e-27 2.242e-27 -26.523 -26.649 -0.127
|
||||
Si 7.382e-05
|
||||
H4SiO4 7.110e-05 8.306e-05 -4.148 -4.081 0.067
|
||||
H3SiO4- 2.720e-06 2.032e-06 -5.565 -5.692 -0.127
|
||||
H2SiO4-2 7.362e-11 2.294e-11 -10.133 -10.639 -0.506
|
||||
U(4) 1.034e-21
|
||||
U(OH)5- 1.034e-21 7.725e-22 -20.985 -21.112 -0.127
|
||||
U(OH)4 1.652e-25 1.930e-25 -24.782 -24.715 0.067
|
||||
U+4 0.000e+00 0.000e+00 -46.997 -49.022 -2.025
|
||||
U(5) 1.622e-18
|
||||
UO2+ 1.622e-18 1.212e-18 -17.790 -17.916 -0.127
|
||||
U(6) 1.437e-08
|
||||
UO2(CO3)3-4 1.255e-08 1.184e-10 -7.901 -9.927 -2.025
|
||||
UO2(CO3)2-2 1.814e-09 5.653e-10 -8.741 -9.248 -0.506
|
||||
UO2CO3 7.429e-12 8.678e-12 -11.129 -11.062 0.067
|
||||
UO2OH+ 3.385e-14 2.530e-14 -13.470 -13.597 -0.127
|
||||
UO2+2 3.019e-16 9.409e-17 -15.520 -16.026 -0.506
|
||||
(UO2)2(OH)2+2 1.780e-21 5.547e-22 -20.750 -21.256 -0.506
|
||||
(UO2)3(OH)5+ 2.908e-23 2.173e-23 -22.536 -22.663 -0.127
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
Anhydrite -0.84 -5.20 -4.36 CaSO4
|
||||
Aragonite 0.61 -7.72 -8.34 CaCO3
|
||||
Calcite 0.76 -7.72 -8.48 CaCO3
|
||||
Chalcedony -0.51 -4.06 -3.55 SiO2
|
||||
Chrysotile 3.36 35.56 32.20 Mg3Si2O5(OH)4
|
||||
CO2(g) -3.38 -4.85 -1.47 CO2
|
||||
Dolomite 2.41 -14.68 -17.09 CaMg(CO3)2
|
||||
Fe(OH)3(a) 0.19 5.08 4.89 Fe(OH)3
|
||||
Goethite 6.09 5.09 -1.00 FeOOH
|
||||
Gypsum -0.63 -5.21 -4.58 CaSO4:2H2O
|
||||
H2(g) -41.22 -44.37 -3.15 H2
|
||||
H2O(g) -1.52 -0.01 1.51 H2O
|
||||
Halite -2.50 -0.92 1.58 NaCl
|
||||
Hausmannite 1.57 62.60 61.03 Mn3O4
|
||||
Hematite 14.20 10.19 -4.01 Fe2O3
|
||||
Jarosite-K -7.52 -16.73 -9.21 KFe3(SO4)2(OH)6
|
||||
Manganite 2.39 27.73 25.34 MnOOH
|
||||
Melanterite -19.35 -21.56 -2.21 FeSO4:7H2O
|
||||
NH3(g) -8.84 -7.07 1.77 NH3
|
||||
O2(g) -0.70 -3.66 -2.96 O2
|
||||
Pyrochroite -8.08 7.12 15.20 Mn(OH)2
|
||||
Pyrolusite 6.96 48.34 41.38 MnO2
|
||||
Quartz -0.08 -4.06 -3.98 SiO2
|
||||
Rhodochrosite -3.27 -14.40 -11.13 MnCO3
|
||||
Sepiolite 1.16 16.92 15.76 Mg2Si3O7.5OH:3H2O
|
||||
Sepiolite(d) -1.74 16.92 18.66 Mg2Si3O7.5OH:3H2O
|
||||
Siderite -13.13 -24.02 -10.89 FeCO3
|
||||
SiO2(a) -1.35 -4.06 -2.71 SiO2
|
||||
Talc 6.04 27.44 21.40 Mg3Si4O10(OH)2
|
||||
Uraninite -12.67 -16.16 -3.49 UO2
|
||||
|
||||
------------------
|
||||
End of simulation.
|
||||
------------------
|
||||
|
||||
------------------------------------
|
||||
Reading input data for simulation 2.
|
||||
------------------------------------
|
||||
|
||||
-----------
|
||||
End of run.
|
||||
-----------
|
||||
|
||||
No memory leaks
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,701 +0,0 @@
|
||||
reaction lg_SigmaPi X_Arag X_Stront X_Ca_aq X_Sr_aq mol_Misc1 mol_Misc2 mol_Arag mol_Stront
|
||||
1.0000e-05 -8.3356e+00 9.9996e-01 4.2096e-05 9.9905e-01 9.4867e-04 1.0000e-10 1.0000e-10 6.5428e-06 2.7544e-10
|
||||
2.0000e-05 -8.3352e+00 9.9992e-01 8.4301e-05 9.9810e-01 1.8967e-03 1.0000e-10 1.0000e-10 1.3083e-05 1.1030e-09
|
||||
3.0000e-05 -8.3348e+00 9.9987e-01 1.2662e-04 9.9716e-01 2.8440e-03 1.0000e-10 1.0000e-10 1.9622e-05 2.4848e-09
|
||||
4.0000e-05 -8.3345e+00 9.9983e-01 1.6904e-04 9.9621e-01 3.7906e-03 1.0000e-10 1.0000e-10 2.6159e-05 4.4226e-09
|
||||
5.0000e-05 -8.3341e+00 9.9979e-01 2.1158e-04 9.9526e-01 4.7366e-03 1.0000e-10 1.0000e-10 3.2693e-05 6.9185e-09
|
||||
6.0000e-05 -8.3337e+00 9.9975e-01 2.5422e-04 9.9432e-01 5.6819e-03 1.0000e-10 1.0000e-10 3.9225e-05 9.9745e-09
|
||||
7.0000e-05 -8.3333e+00 9.9970e-01 2.9698e-04 9.9337e-01 6.6265e-03 1.0000e-10 1.0000e-10 4.5755e-05 1.3593e-08
|
||||
8.0000e-05 -8.3329e+00 9.9966e-01 3.3985e-04 9.9243e-01 7.5705e-03 1.0000e-10 1.0000e-10 5.2283e-05 1.7775e-08
|
||||
9.0000e-05 -8.3325e+00 9.9962e-01 3.8284e-04 9.9149e-01 8.5137e-03 1.0000e-10 1.0000e-10 5.8809e-05 2.2523e-08
|
||||
1.0000e-04 -8.3321e+00 9.9957e-01 4.2593e-04 9.9054e-01 9.4563e-03 1.0000e-10 1.0000e-10 6.5333e-05 2.7839e-08
|
||||
1.1000e-04 -8.3318e+00 9.9953e-01 4.6914e-04 9.8960e-01 1.0398e-02 1.0000e-10 1.0000e-10 7.1855e-05 3.3726e-08
|
||||
1.2000e-04 -8.3314e+00 9.9949e-01 5.1247e-04 9.8866e-01 1.1340e-02 1.0000e-10 1.0000e-10 7.8374e-05 4.0185e-08
|
||||
1.3000e-04 -8.3310e+00 9.9944e-01 5.5591e-04 9.8772e-01 1.2280e-02 1.0000e-10 1.0000e-10 8.4891e-05 4.7218e-08
|
||||
1.4000e-04 -8.3306e+00 9.9940e-01 5.9946e-04 9.8678e-01 1.3220e-02 1.0000e-10 1.0000e-10 9.1407e-05 5.4828e-08
|
||||
1.5000e-04 -8.3302e+00 9.9936e-01 6.4313e-04 9.8584e-01 1.4159e-02 1.0000e-10 1.0000e-10 9.7920e-05 6.3016e-08
|
||||
1.6000e-04 -8.3298e+00 9.9931e-01 6.8692e-04 9.8490e-01 1.5098e-02 1.0000e-10 1.0000e-10 1.0443e-04 7.1784e-08
|
||||
1.7000e-04 -8.3294e+00 9.9927e-01 7.3082e-04 9.8396e-01 1.6036e-02 1.0000e-10 1.0000e-10 1.1094e-04 8.1136e-08
|
||||
1.8000e-04 -8.3290e+00 9.9923e-01 7.7484e-04 9.8303e-01 1.6973e-02 1.0000e-10 1.0000e-10 1.1745e-04 9.1072e-08
|
||||
1.9000e-04 -8.3287e+00 9.9918e-01 8.1897e-04 9.8209e-01 1.7909e-02 1.0000e-10 1.0000e-10 1.2395e-04 1.0160e-07
|
||||
2.0000e-04 -8.3283e+00 9.9914e-01 8.6323e-04 9.8115e-01 1.8845e-02 1.0000e-10 1.0000e-10 1.3045e-04 1.1271e-07
|
||||
2.1000e-04 -8.3279e+00 9.9909e-01 9.0760e-04 9.8022e-01 1.9780e-02 1.0000e-10 1.0000e-10 1.3695e-04 1.2441e-07
|
||||
2.2000e-04 -8.3275e+00 9.9905e-01 9.5209e-04 9.7929e-01 2.0715e-02 1.0000e-10 1.0000e-10 1.4345e-04 1.3671e-07
|
||||
2.3000e-04 -8.3271e+00 9.9900e-01 9.9670e-04 9.7835e-01 2.1649e-02 1.0000e-10 1.0000e-10 1.4995e-04 1.4960e-07
|
||||
2.4000e-04 -8.3267e+00 9.9896e-01 1.0414e-03 9.7742e-01 2.2582e-02 1.0000e-10 1.0000e-10 1.5644e-04 1.6309e-07
|
||||
2.5000e-04 -8.3263e+00 9.9891e-01 1.0863e-03 9.7649e-01 2.3514e-02 1.0000e-10 1.0000e-10 1.6293e-04 1.7719e-07
|
||||
2.6000e-04 -8.3259e+00 9.9887e-01 1.1313e-03 9.7555e-01 2.4446e-02 1.0000e-10 1.0000e-10 1.6942e-04 1.9188e-07
|
||||
2.7000e-04 -8.3256e+00 9.9882e-01 1.1764e-03 9.7462e-01 2.5377e-02 1.0000e-10 1.0000e-10 1.7591e-04 2.0718e-07
|
||||
2.8000e-04 -8.3252e+00 9.9878e-01 1.2216e-03 9.7369e-01 2.6308e-02 1.0000e-10 1.0000e-10 1.8240e-04 2.2308e-07
|
||||
2.9000e-04 -8.3248e+00 9.9873e-01 1.2669e-03 9.7276e-01 2.7238e-02 1.0000e-10 1.0000e-10 1.8888e-04 2.3960e-07
|
||||
3.0000e-04 -8.3244e+00 9.9869e-01 1.3124e-03 9.7183e-01 2.8167e-02 1.0000e-10 1.0000e-10 1.9536e-04 2.5672e-07
|
||||
3.1000e-04 -8.3240e+00 9.9864e-01 1.3580e-03 9.7090e-01 2.9095e-02 1.0000e-10 1.0000e-10 2.0184e-04 2.7446e-07
|
||||
3.2000e-04 -8.3236e+00 9.9860e-01 1.4037e-03 9.6998e-01 3.0023e-02 1.0000e-10 1.0000e-10 2.0832e-04 2.9282e-07
|
||||
3.3000e-04 -8.3232e+00 9.9855e-01 1.4495e-03 9.6905e-01 3.0950e-02 1.0000e-10 1.0000e-10 2.1479e-04 3.1179e-07
|
||||
3.4000e-04 -8.3228e+00 9.9850e-01 1.4955e-03 9.6812e-01 3.1877e-02 1.0000e-10 1.0000e-10 2.2126e-04 3.3139e-07
|
||||
3.5000e-04 -8.3225e+00 9.9846e-01 1.5416e-03 9.6720e-01 3.2802e-02 1.0000e-10 1.0000e-10 2.2773e-04 3.5161e-07
|
||||
3.6000e-04 -8.3221e+00 9.9841e-01 1.5878e-03 9.6627e-01 3.3727e-02 1.0000e-10 1.0000e-10 2.3420e-04 3.7245e-07
|
||||
3.7000e-04 -8.3217e+00 9.9837e-01 1.6341e-03 9.6535e-01 3.4652e-02 1.0000e-10 1.0000e-10 2.4067e-04 3.9392e-07
|
||||
3.8000e-04 -8.3213e+00 9.9832e-01 1.6806e-03 9.6442e-01 3.5576e-02 1.0000e-10 1.0000e-10 2.4713e-04 4.1602e-07
|
||||
3.9000e-04 -8.3209e+00 9.9827e-01 1.7272e-03 9.6350e-01 3.6499e-02 1.0000e-10 1.0000e-10 2.5359e-04 4.3876e-07
|
||||
4.0000e-04 -8.3205e+00 9.9823e-01 1.7739e-03 9.6258e-01 3.7421e-02 1.0000e-10 1.0000e-10 2.6005e-04 4.6213e-07
|
||||
4.1000e-04 -8.3201e+00 9.9818e-01 1.8208e-03 9.6166e-01 3.8343e-02 1.0000e-10 1.0000e-10 2.6651e-04 4.8614e-07
|
||||
4.2000e-04 -8.3197e+00 9.9813e-01 1.8677e-03 9.6074e-01 3.9264e-02 1.0000e-10 1.0000e-10 2.7297e-04 5.1078e-07
|
||||
4.3000e-04 -8.3193e+00 9.9809e-01 1.9149e-03 9.5982e-01 4.0184e-02 1.0000e-10 1.0000e-10 2.7942e-04 5.3607e-07
|
||||
4.4000e-04 -8.3190e+00 9.9804e-01 1.9621e-03 9.5890e-01 4.1104e-02 1.0000e-10 1.0000e-10 2.8587e-04 5.6201e-07
|
||||
4.5000e-04 -8.3186e+00 9.9799e-01 2.0095e-03 9.5798e-01 4.2023e-02 1.0000e-10 1.0000e-10 2.9232e-04 5.8859e-07
|
||||
4.6000e-04 -8.3182e+00 9.9794e-01 2.0570e-03 9.5706e-01 4.2941e-02 1.0000e-10 1.0000e-10 2.9877e-04 6.1583e-07
|
||||
4.7000e-04 -8.3178e+00 9.9790e-01 2.1046e-03 9.5614e-01 4.3859e-02 1.0000e-10 1.0000e-10 3.0521e-04 6.4371e-07
|
||||
4.8000e-04 -8.3174e+00 9.9785e-01 2.1524e-03 9.5522e-01 4.4776e-02 1.0000e-10 1.0000e-10 3.1165e-04 6.7225e-07
|
||||
4.9000e-04 -8.3170e+00 9.9780e-01 2.2003e-03 9.5431e-01 4.5692e-02 1.0000e-10 1.0000e-10 3.1809e-04 7.0145e-07
|
||||
5.0000e-04 -8.3166e+00 9.9775e-01 2.2484e-03 9.5339e-01 4.6608e-02 1.0000e-10 1.0000e-10 3.2453e-04 7.3131e-07
|
||||
5.1000e-04 -8.3162e+00 9.9770e-01 2.2966e-03 9.5248e-01 4.7523e-02 1.0000e-10 1.0000e-10 3.3097e-04 7.6183e-07
|
||||
5.2000e-04 -8.3159e+00 9.9766e-01 2.3449e-03 9.5156e-01 4.8437e-02 1.0000e-10 1.0000e-10 3.3740e-04 7.9302e-07
|
||||
5.3000e-04 -8.3155e+00 9.9761e-01 2.3933e-03 9.5065e-01 4.9351e-02 1.0000e-10 1.0000e-10 3.4383e-04 8.2488e-07
|
||||
5.4000e-04 -8.3151e+00 9.9756e-01 2.4419e-03 9.4974e-01 5.0264e-02 1.0000e-10 1.0000e-10 3.5026e-04 8.5740e-07
|
||||
5.5000e-04 -8.3147e+00 9.9751e-01 2.4907e-03 9.4882e-01 5.1176e-02 1.0000e-10 1.0000e-10 3.5669e-04 8.9060e-07
|
||||
5.6000e-04 -8.3143e+00 9.9746e-01 2.5395e-03 9.4791e-01 5.2088e-02 1.0000e-10 1.0000e-10 3.6311e-04 9.2448e-07
|
||||
5.7000e-04 -8.3139e+00 9.9741e-01 2.5885e-03 9.4700e-01 5.2999e-02 1.0000e-10 1.0000e-10 3.6954e-04 9.5904e-07
|
||||
5.8000e-04 -8.3135e+00 9.9736e-01 2.6377e-03 9.4609e-01 5.3909e-02 1.0000e-10 1.0000e-10 3.7596e-04 9.9428e-07
|
||||
5.9000e-04 -8.3131e+00 9.9731e-01 2.6870e-03 9.4518e-01 5.4819e-02 1.0000e-10 1.0000e-10 3.8237e-04 1.0302e-06
|
||||
6.0000e-04 -8.3127e+00 9.9726e-01 2.7364e-03 9.4427e-01 5.5728e-02 1.0000e-10 1.0000e-10 3.8879e-04 1.0668e-06
|
||||
6.1000e-04 -8.3123e+00 9.9721e-01 2.7860e-03 9.4336e-01 5.6636e-02 1.0000e-10 1.0000e-10 3.9520e-04 1.1041e-06
|
||||
6.2000e-04 -8.3120e+00 9.9716e-01 2.8357e-03 9.4246e-01 5.7544e-02 1.0000e-10 1.0000e-10 4.0162e-04 1.1421e-06
|
||||
6.3000e-04 -8.3116e+00 9.9711e-01 2.8856e-03 9.4155e-01 5.8451e-02 1.0000e-10 1.0000e-10 4.0803e-04 1.1808e-06
|
||||
6.4000e-04 -8.3112e+00 9.9706e-01 2.9356e-03 9.4064e-01 5.9357e-02 1.0000e-10 1.0000e-10 4.1443e-04 1.2202e-06
|
||||
6.5000e-04 -8.3108e+00 9.9701e-01 2.9857e-03 9.3974e-01 6.0263e-02 1.0000e-10 1.0000e-10 4.2084e-04 1.2603e-06
|
||||
6.6000e-04 -8.3104e+00 9.9696e-01 3.0360e-03 9.3883e-01 6.1167e-02 1.0000e-10 1.0000e-10 4.2724e-04 1.3011e-06
|
||||
6.7000e-04 -8.3100e+00 9.9691e-01 3.0864e-03 9.3793e-01 6.2072e-02 1.0000e-10 1.0000e-10 4.3364e-04 1.3426e-06
|
||||
6.8000e-04 -8.3096e+00 9.9686e-01 3.1370e-03 9.3702e-01 6.2975e-02 1.0000e-10 1.0000e-10 4.4004e-04 1.3848e-06
|
||||
6.9000e-04 -8.3092e+00 9.9681e-01 3.1878e-03 9.3612e-01 6.3878e-02 1.0000e-10 1.0000e-10 4.4644e-04 1.4277e-06
|
||||
7.0000e-04 -8.3088e+00 9.9676e-01 3.2386e-03 9.3522e-01 6.4780e-02 1.0000e-10 1.0000e-10 4.5283e-04 1.4713e-06
|
||||
7.1000e-04 -8.3084e+00 9.9671e-01 3.2897e-03 9.3432e-01 6.5682e-02 1.0000e-10 1.0000e-10 4.5922e-04 1.5157e-06
|
||||
7.2000e-04 -8.3081e+00 9.9666e-01 3.3409e-03 9.3342e-01 6.6583e-02 1.0000e-10 1.0000e-10 4.6561e-04 1.5608e-06
|
||||
7.3000e-04 -8.3077e+00 9.9661e-01 3.3922e-03 9.3252e-01 6.7483e-02 1.0000e-10 1.0000e-10 4.7200e-04 1.6066e-06
|
||||
7.4000e-04 -8.3073e+00 9.9656e-01 3.4437e-03 9.3162e-01 6.8383e-02 1.0000e-10 1.0000e-10 4.7839e-04 1.6531e-06
|
||||
7.5000e-04 -8.3069e+00 9.9650e-01 3.4953e-03 9.3072e-01 6.9282e-02 1.0000e-10 1.0000e-10 4.8477e-04 1.7004e-06
|
||||
7.6000e-04 -8.3065e+00 9.9645e-01 3.5471e-03 9.2982e-01 7.0180e-02 1.0000e-10 1.0000e-10 4.9115e-04 1.7484e-06
|
||||
7.7000e-04 -8.3061e+00 9.9640e-01 3.5990e-03 9.2892e-01 7.1077e-02 1.0000e-10 1.0000e-10 4.9753e-04 1.7971e-06
|
||||
7.8000e-04 -8.3057e+00 9.9635e-01 3.6511e-03 9.2803e-01 7.1974e-02 1.0000e-10 1.0000e-10 5.0391e-04 1.8466e-06
|
||||
7.9000e-04 -8.3053e+00 9.9630e-01 3.7034e-03 9.2713e-01 7.2870e-02 1.0000e-10 1.0000e-10 5.1028e-04 1.8968e-06
|
||||
8.0000e-04 -8.3049e+00 9.9624e-01 3.7558e-03 9.2623e-01 7.3766e-02 1.0000e-10 1.0000e-10 5.1665e-04 1.9477e-06
|
||||
8.1000e-04 -8.3045e+00 9.9619e-01 3.8083e-03 9.2534e-01 7.4661e-02 1.0000e-10 1.0000e-10 5.2302e-04 1.9995e-06
|
||||
8.2000e-04 -8.3042e+00 9.9614e-01 3.8611e-03 9.2445e-01 7.5555e-02 1.0000e-10 1.0000e-10 5.2939e-04 2.0519e-06
|
||||
8.3000e-04 -8.3038e+00 9.9609e-01 3.9139e-03 9.2355e-01 7.6448e-02 1.0000e-10 1.0000e-10 5.3576e-04 2.1052e-06
|
||||
8.4000e-04 -8.3034e+00 9.9603e-01 3.9670e-03 9.2266e-01 7.7341e-02 1.0000e-10 1.0000e-10 5.4212e-04 2.1591e-06
|
||||
8.5000e-04 -8.3030e+00 9.9598e-01 4.0202e-03 9.2177e-01 7.8233e-02 1.0000e-10 1.0000e-10 5.4848e-04 2.2139e-06
|
||||
8.6000e-04 -8.3026e+00 9.9593e-01 4.0735e-03 9.2088e-01 7.9125e-02 1.0000e-10 1.0000e-10 5.5484e-04 2.2694e-06
|
||||
8.7000e-04 -8.3022e+00 9.9587e-01 4.1270e-03 9.1998e-01 8.0016e-02 1.0000e-10 1.0000e-10 5.6120e-04 2.3257e-06
|
||||
8.8000e-04 -8.3018e+00 9.9582e-01 4.1807e-03 9.1909e-01 8.0906e-02 1.0000e-10 1.0000e-10 5.6755e-04 2.3827e-06
|
||||
8.9000e-04 -8.3014e+00 9.9577e-01 4.2346e-03 9.1820e-01 8.1795e-02 1.0000e-10 1.0000e-10 5.7390e-04 2.4406e-06
|
||||
9.0000e-04 -8.3010e+00 9.9571e-01 4.2886e-03 9.1732e-01 8.2684e-02 1.0000e-10 1.0000e-10 5.8025e-04 2.4992e-06
|
||||
9.1000e-04 -8.3006e+00 9.9566e-01 4.3427e-03 9.1643e-01 8.3572e-02 1.0000e-10 1.0000e-10 5.8660e-04 2.5586e-06
|
||||
9.2000e-04 -8.3002e+00 9.9560e-01 4.3971e-03 9.1554e-01 8.4460e-02 1.0000e-10 1.0000e-10 5.9295e-04 2.6187e-06
|
||||
9.3000e-04 -8.2999e+00 9.9555e-01 4.4516e-03 9.1465e-01 8.5347e-02 1.0000e-10 1.0000e-10 5.9929e-04 2.6797e-06
|
||||
9.4000e-04 -8.2995e+00 9.9549e-01 4.5062e-03 9.1377e-01 8.6233e-02 1.0000e-10 1.0000e-10 6.0563e-04 2.7415e-06
|
||||
9.5000e-04 -8.2991e+00 9.9544e-01 4.5611e-03 9.1288e-01 8.7118e-02 1.0000e-10 1.0000e-10 6.1197e-04 2.8040e-06
|
||||
9.6000e-04 -8.2987e+00 9.9538e-01 4.6161e-03 9.1200e-01 8.8003e-02 1.0000e-10 1.0000e-10 6.1831e-04 2.8674e-06
|
||||
9.7000e-04 -8.2983e+00 9.9533e-01 4.6713e-03 9.1111e-01 8.8887e-02 1.0000e-10 1.0000e-10 6.2464e-04 2.9316e-06
|
||||
9.8000e-04 -8.2979e+00 9.9527e-01 4.7266e-03 9.1023e-01 8.9770e-02 1.0000e-10 1.0000e-10 6.3097e-04 2.9965e-06
|
||||
9.9000e-04 -8.2975e+00 9.9522e-01 4.7821e-03 9.0935e-01 9.0653e-02 1.0000e-10 1.0000e-10 6.3730e-04 3.0623e-06
|
||||
1.0000e-03 -8.2974e+00 9.8567e-01 1.4329e-02 9.0901e-01 9.0987e-02 6.4175e-04 7.2473e-06 6.3970e-04 9.2997e-06
|
||||
1.0100e-03 -8.2974e+00 9.7071e-01 2.9286e-02 9.0901e-01 9.0987e-02 6.4009e-04 1.8914e-05 6.3970e-04 1.9300e-05
|
||||
1.0200e-03 -8.2974e+00 9.5620e-01 4.3796e-02 9.0901e-01 9.0987e-02 6.3842e-04 3.0580e-05 6.3970e-04 2.9300e-05
|
||||
1.0300e-03 -8.2974e+00 9.4212e-01 5.7879e-02 9.0901e-01 9.0987e-02 6.3675e-04 4.2246e-05 6.3970e-04 3.9300e-05
|
||||
1.0400e-03 -8.2974e+00 9.2845e-01 7.1552e-02 9.0901e-01 9.0987e-02 6.3509e-04 5.3912e-05 6.3970e-04 4.9300e-05
|
||||
1.0500e-03 -8.2974e+00 9.1516e-01 8.4835e-02 9.0901e-01 9.0987e-02 6.3342e-04 6.5578e-05 6.3970e-04 5.9300e-05
|
||||
1.0600e-03 -8.2974e+00 9.0226e-01 9.7743e-02 9.0901e-01 9.0987e-02 6.3176e-04 7.7245e-05 6.3970e-04 6.9300e-05
|
||||
1.0700e-03 -8.2974e+00 8.8971e-01 1.1029e-01 9.0901e-01 9.0987e-02 6.3009e-04 8.8911e-05 6.3970e-04 7.9300e-05
|
||||
1.0800e-03 -8.2974e+00 8.7750e-01 1.2250e-01 9.0901e-01 9.0987e-02 6.2842e-04 1.0058e-04 6.3970e-04 8.9300e-05
|
||||
1.0900e-03 -8.2974e+00 8.6563e-01 1.3437e-01 9.0901e-01 9.0987e-02 6.2676e-04 1.1224e-04 6.3970e-04 9.9300e-05
|
||||
1.1000e-03 -8.2974e+00 8.5407e-01 1.4593e-01 9.0901e-01 9.0987e-02 6.2509e-04 1.2391e-04 6.3970e-04 1.0930e-04
|
||||
1.1100e-03 -8.2974e+00 8.4282e-01 1.5718e-01 9.0901e-01 9.0987e-02 6.2342e-04 1.3558e-04 6.3970e-04 1.1930e-04
|
||||
1.1200e-03 -8.2974e+00 8.3186e-01 1.6814e-01 9.0901e-01 9.0987e-02 6.2176e-04 1.4724e-04 6.3970e-04 1.2930e-04
|
||||
1.1300e-03 -8.2974e+00 8.2118e-01 1.7882e-01 9.0901e-01 9.0987e-02 6.2009e-04 1.5891e-04 6.3970e-04 1.3930e-04
|
||||
1.1400e-03 -8.2974e+00 8.1077e-01 1.8923e-01 9.0901e-01 9.0987e-02 6.1843e-04 1.7057e-04 6.3970e-04 1.4930e-04
|
||||
1.1500e-03 -8.2974e+00 8.0063e-01 1.9937e-01 9.0901e-01 9.0987e-02 6.1676e-04 1.8224e-04 6.3970e-04 1.5930e-04
|
||||
1.1600e-03 -8.2974e+00 7.9073e-01 2.0927e-01 9.0901e-01 9.0987e-02 6.1509e-04 1.9391e-04 6.3970e-04 1.6930e-04
|
||||
1.1700e-03 -8.2974e+00 7.8107e-01 2.1893e-01 9.0901e-01 9.0987e-02 6.1343e-04 2.0557e-04 6.3970e-04 1.7930e-04
|
||||
1.1800e-03 -8.2974e+00 7.7165e-01 2.2835e-01 9.0901e-01 9.0987e-02 6.1176e-04 2.1724e-04 6.3970e-04 1.8930e-04
|
||||
1.1900e-03 -8.2974e+00 7.6246e-01 2.3754e-01 9.0901e-01 9.0987e-02 6.1009e-04 2.2891e-04 6.3970e-04 1.9930e-04
|
||||
1.2000e-03 -8.2974e+00 7.5348e-01 2.4652e-01 9.0901e-01 9.0987e-02 6.0843e-04 2.4057e-04 6.3970e-04 2.0930e-04
|
||||
1.2100e-03 -8.2974e+00 7.4470e-01 2.5530e-01 9.0901e-01 9.0987e-02 6.0676e-04 2.5224e-04 6.3970e-04 2.1930e-04
|
||||
1.2200e-03 -8.2974e+00 7.3613e-01 2.6387e-01 9.0901e-01 9.0987e-02 6.0510e-04 2.6390e-04 6.3970e-04 2.2930e-04
|
||||
1.2300e-03 -8.2974e+00 7.2776e-01 2.7224e-01 9.0901e-01 9.0987e-02 6.0343e-04 2.7557e-04 6.3970e-04 2.3930e-04
|
||||
1.2400e-03 -8.2974e+00 7.1957e-01 2.8043e-01 9.0901e-01 9.0987e-02 6.0176e-04 2.8724e-04 6.3970e-04 2.4930e-04
|
||||
1.2500e-03 -8.2974e+00 7.1157e-01 2.8843e-01 9.0901e-01 9.0987e-02 6.0010e-04 2.9890e-04 6.3970e-04 2.5930e-04
|
||||
1.2600e-03 -8.2974e+00 7.0374e-01 2.9626e-01 9.0901e-01 9.0987e-02 5.9843e-04 3.1057e-04 6.3970e-04 2.6930e-04
|
||||
1.2700e-03 -8.2974e+00 6.9608e-01 3.0392e-01 9.0901e-01 9.0987e-02 5.9677e-04 3.2223e-04 6.3970e-04 2.7930e-04
|
||||
1.2800e-03 -8.2974e+00 6.8859e-01 3.1141e-01 9.0901e-01 9.0987e-02 5.9510e-04 3.3390e-04 6.3970e-04 2.8930e-04
|
||||
1.2900e-03 -8.2974e+00 6.8126e-01 3.1874e-01 9.0901e-01 9.0987e-02 5.9343e-04 3.4557e-04 6.3970e-04 2.9930e-04
|
||||
1.3000e-03 -8.2974e+00 6.7408e-01 3.2592e-01 9.0901e-01 9.0987e-02 5.9177e-04 3.5723e-04 6.3970e-04 3.0930e-04
|
||||
1.3100e-03 -8.2974e+00 6.6705e-01 3.3295e-01 9.0901e-01 9.0987e-02 5.9010e-04 3.6890e-04 6.3970e-04 3.1930e-04
|
||||
1.3200e-03 -8.2974e+00 6.6017e-01 3.3983e-01 9.0901e-01 9.0987e-02 5.8843e-04 3.8057e-04 6.3970e-04 3.2930e-04
|
||||
1.3300e-03 -8.2974e+00 6.5342e-01 3.4658e-01 9.0901e-01 9.0987e-02 5.8677e-04 3.9223e-04 6.3970e-04 3.3930e-04
|
||||
1.3400e-03 -8.2974e+00 6.4682e-01 3.5318e-01 9.0901e-01 9.0987e-02 5.8510e-04 4.0390e-04 6.3970e-04 3.4930e-04
|
||||
1.3500e-03 -8.2974e+00 6.4034e-01 3.5966e-01 9.0901e-01 9.0987e-02 5.8344e-04 4.1556e-04 6.3970e-04 3.5930e-04
|
||||
1.3600e-03 -8.2974e+00 6.3399e-01 3.6601e-01 9.0901e-01 9.0987e-02 5.8177e-04 4.2723e-04 6.3970e-04 3.6930e-04
|
||||
1.3700e-03 -8.2974e+00 6.2777e-01 3.7223e-01 9.0901e-01 9.0987e-02 5.8010e-04 4.3890e-04 6.3970e-04 3.7930e-04
|
||||
1.3800e-03 -8.2974e+00 6.2167e-01 3.7833e-01 9.0901e-01 9.0987e-02 5.7844e-04 4.5056e-04 6.3970e-04 3.8930e-04
|
||||
1.3900e-03 -8.2974e+00 6.1569e-01 3.8431e-01 9.0901e-01 9.0987e-02 5.7677e-04 4.6223e-04 6.3970e-04 3.9930e-04
|
||||
1.4000e-03 -8.2974e+00 6.0982e-01 3.9018e-01 9.0901e-01 9.0987e-02 5.7510e-04 4.7390e-04 6.3970e-04 4.0930e-04
|
||||
1.4100e-03 -8.2974e+00 6.0406e-01 3.9594e-01 9.0901e-01 9.0987e-02 5.7344e-04 4.8556e-04 6.3970e-04 4.1930e-04
|
||||
1.4200e-03 -8.2974e+00 5.9841e-01 4.0159e-01 9.0901e-01 9.0987e-02 5.7177e-04 4.9723e-04 6.3970e-04 4.2930e-04
|
||||
1.4300e-03 -8.2974e+00 5.9286e-01 4.0714e-01 9.0901e-01 9.0987e-02 5.7011e-04 5.0889e-04 6.3970e-04 4.3930e-04
|
||||
1.4400e-03 -8.2974e+00 5.8742e-01 4.1258e-01 9.0901e-01 9.0987e-02 5.6844e-04 5.2056e-04 6.3970e-04 4.4930e-04
|
||||
1.4500e-03 -8.2974e+00 5.8207e-01 4.1793e-01 9.0901e-01 9.0987e-02 5.6677e-04 5.3223e-04 6.3970e-04 4.5930e-04
|
||||
1.4600e-03 -8.2974e+00 5.7683e-01 4.2317e-01 9.0901e-01 9.0987e-02 5.6511e-04 5.4389e-04 6.3970e-04 4.6930e-04
|
||||
1.4700e-03 -8.2974e+00 5.7167e-01 4.2833e-01 9.0901e-01 9.0987e-02 5.6344e-04 5.5556e-04 6.3970e-04 4.7930e-04
|
||||
1.4800e-03 -8.2974e+00 5.6661e-01 4.3339e-01 9.0901e-01 9.0987e-02 5.6178e-04 5.6723e-04 6.3970e-04 4.8930e-04
|
||||
1.4900e-03 -8.2974e+00 5.6163e-01 4.3837e-01 9.0901e-01 9.0987e-02 5.6011e-04 5.7889e-04 6.3970e-04 4.9930e-04
|
||||
1.5000e-03 -8.2974e+00 5.5675e-01 4.4325e-01 9.0901e-01 9.0987e-02 5.5844e-04 5.9056e-04 6.3970e-04 5.0930e-04
|
||||
1.5100e-03 -8.2974e+00 5.5194e-01 4.4806e-01 9.0901e-01 9.0987e-02 5.5678e-04 6.0222e-04 6.3970e-04 5.1930e-04
|
||||
1.5200e-03 -8.2974e+00 5.4722e-01 4.5278e-01 9.0901e-01 9.0987e-02 5.5511e-04 6.1389e-04 6.3970e-04 5.2930e-04
|
||||
1.5300e-03 -8.2974e+00 5.4258e-01 4.5742e-01 9.0901e-01 9.0987e-02 5.5344e-04 6.2556e-04 6.3970e-04 5.3930e-04
|
||||
1.5400e-03 -8.2974e+00 5.3802e-01 4.6198e-01 9.0901e-01 9.0987e-02 5.5178e-04 6.3722e-04 6.3970e-04 5.4930e-04
|
||||
1.5500e-03 -8.2974e+00 5.3353e-01 4.6647e-01 9.0901e-01 9.0987e-02 5.5011e-04 6.4889e-04 6.3970e-04 5.5930e-04
|
||||
1.5600e-03 -8.2974e+00 5.2912e-01 4.7088e-01 9.0901e-01 9.0987e-02 5.4845e-04 6.6055e-04 6.3970e-04 5.6930e-04
|
||||
1.5700e-03 -8.2974e+00 5.2477e-01 4.7523e-01 9.0901e-01 9.0987e-02 5.4678e-04 6.7222e-04 6.3970e-04 5.7930e-04
|
||||
1.5800e-03 -8.2974e+00 5.2050e-01 4.7950e-01 9.0901e-01 9.0987e-02 5.4511e-04 6.8389e-04 6.3970e-04 5.8930e-04
|
||||
1.5900e-03 -8.2974e+00 5.1630e-01 4.8370e-01 9.0901e-01 9.0987e-02 5.4345e-04 6.9555e-04 6.3970e-04 5.9930e-04
|
||||
1.6000e-03 -8.2974e+00 5.1217e-01 4.8783e-01 9.0901e-01 9.0987e-02 5.4178e-04 7.0722e-04 6.3970e-04 6.0930e-04
|
||||
1.6100e-03 -8.2974e+00 5.0810e-01 4.9190e-01 9.0901e-01 9.0987e-02 5.4011e-04 7.1889e-04 6.3970e-04 6.1930e-04
|
||||
1.6200e-03 -8.2974e+00 5.0410e-01 4.9590e-01 9.0901e-01 9.0987e-02 5.3845e-04 7.3055e-04 6.3970e-04 6.2930e-04
|
||||
1.6300e-03 -8.2974e+00 5.0016e-01 4.9984e-01 9.0901e-01 9.0987e-02 5.3678e-04 7.4222e-04 6.3970e-04 6.3930e-04
|
||||
1.6400e-03 -8.2974e+00 4.9628e-01 5.0372e-01 9.0901e-01 9.0987e-02 5.3512e-04 7.5388e-04 6.3970e-04 6.4930e-04
|
||||
1.6500e-03 -8.2974e+00 4.9246e-01 5.0754e-01 9.0901e-01 9.0987e-02 5.3345e-04 7.6555e-04 6.3970e-04 6.5930e-04
|
||||
1.6600e-03 -8.2974e+00 4.8869e-01 5.1131e-01 9.0901e-01 9.0987e-02 5.3178e-04 7.7722e-04 6.3970e-04 6.6930e-04
|
||||
1.6700e-03 -8.2974e+00 4.8499e-01 5.1501e-01 9.0901e-01 9.0987e-02 5.3012e-04 7.8888e-04 6.3970e-04 6.7930e-04
|
||||
1.6800e-03 -8.2974e+00 4.8134e-01 5.1866e-01 9.0901e-01 9.0987e-02 5.2845e-04 8.0055e-04 6.3970e-04 6.8930e-04
|
||||
1.6900e-03 -8.2974e+00 4.7774e-01 5.2226e-01 9.0901e-01 9.0987e-02 5.2678e-04 8.1222e-04 6.3970e-04 6.9930e-04
|
||||
1.7000e-03 -8.2974e+00 4.7420e-01 5.2580e-01 9.0901e-01 9.0987e-02 5.2512e-04 8.2388e-04 6.3970e-04 7.0930e-04
|
||||
1.7100e-03 -8.2974e+00 4.7071e-01 5.2929e-01 9.0901e-01 9.0987e-02 5.2345e-04 8.3555e-04 6.3970e-04 7.1930e-04
|
||||
1.7200e-03 -8.2974e+00 4.6728e-01 5.3272e-01 9.0901e-01 9.0987e-02 5.2179e-04 8.4721e-04 6.3970e-04 7.2930e-04
|
||||
1.7300e-03 -8.2974e+00 4.6389e-01 5.3611e-01 9.0901e-01 9.0987e-02 5.2012e-04 8.5888e-04 6.3970e-04 7.3930e-04
|
||||
1.7400e-03 -8.2974e+00 4.6055e-01 5.3945e-01 9.0901e-01 9.0987e-02 5.1845e-04 8.7055e-04 6.3970e-04 7.4930e-04
|
||||
1.7500e-03 -8.2974e+00 4.5726e-01 5.4274e-01 9.0901e-01 9.0987e-02 5.1679e-04 8.8221e-04 6.3970e-04 7.5930e-04
|
||||
1.7600e-03 -8.2974e+00 4.5401e-01 5.4599e-01 9.0901e-01 9.0987e-02 5.1512e-04 8.9388e-04 6.3970e-04 7.6930e-04
|
||||
1.7700e-03 -8.2974e+00 4.5081e-01 5.4919e-01 9.0901e-01 9.0987e-02 5.1346e-04 9.0554e-04 6.3970e-04 7.7930e-04
|
||||
1.7800e-03 -8.2974e+00 4.4766e-01 5.5234e-01 9.0901e-01 9.0987e-02 5.1179e-04 9.1721e-04 6.3970e-04 7.8930e-04
|
||||
1.7900e-03 -8.2974e+00 4.4455e-01 5.5545e-01 9.0901e-01 9.0987e-02 5.1012e-04 9.2888e-04 6.3970e-04 7.9930e-04
|
||||
1.8000e-03 -8.2974e+00 4.4148e-01 5.5852e-01 9.0901e-01 9.0987e-02 5.0846e-04 9.4054e-04 6.3970e-04 8.0930e-04
|
||||
1.8100e-03 -8.2974e+00 4.3845e-01 5.6155e-01 9.0901e-01 9.0987e-02 5.0679e-04 9.5221e-04 6.3970e-04 8.1930e-04
|
||||
1.8200e-03 -8.2974e+00 4.3547e-01 5.6453e-01 9.0901e-01 9.0987e-02 5.0512e-04 9.6388e-04 6.3970e-04 8.2930e-04
|
||||
1.8300e-03 -8.2974e+00 4.3252e-01 5.6748e-01 9.0901e-01 9.0987e-02 5.0346e-04 9.7554e-04 6.3970e-04 8.3930e-04
|
||||
1.8400e-03 -8.2974e+00 4.2962e-01 5.7038e-01 9.0901e-01 9.0987e-02 5.0179e-04 9.8721e-04 6.3970e-04 8.4930e-04
|
||||
1.8500e-03 -8.2974e+00 4.2675e-01 5.7325e-01 9.0901e-01 9.0987e-02 5.0013e-04 9.9887e-04 6.3970e-04 8.5930e-04
|
||||
1.8600e-03 -8.2974e+00 4.2392e-01 5.7608e-01 9.0901e-01 9.0987e-02 4.9846e-04 1.0105e-03 6.3970e-04 8.6930e-04
|
||||
1.8700e-03 -8.2974e+00 4.2113e-01 5.7887e-01 9.0901e-01 9.0987e-02 4.9679e-04 1.0222e-03 6.3970e-04 8.7930e-04
|
||||
1.8800e-03 -8.2974e+00 4.1838e-01 5.8162e-01 9.0901e-01 9.0987e-02 4.9513e-04 1.0339e-03 6.3970e-04 8.8930e-04
|
||||
1.8900e-03 -8.2974e+00 4.1566e-01 5.8434e-01 9.0901e-01 9.0987e-02 4.9346e-04 1.0455e-03 6.3970e-04 8.9930e-04
|
||||
1.9000e-03 -8.2974e+00 4.1298e-01 5.8702e-01 9.0901e-01 9.0987e-02 4.9179e-04 1.0572e-03 6.3970e-04 9.0930e-04
|
||||
1.9100e-03 -8.2974e+00 4.1033e-01 5.8967e-01 9.0901e-01 9.0987e-02 4.9013e-04 1.0689e-03 6.3970e-04 9.1930e-04
|
||||
1.9200e-03 -8.2974e+00 4.0771e-01 5.9229e-01 9.0901e-01 9.0987e-02 4.8846e-04 1.0805e-03 6.3970e-04 9.2930e-04
|
||||
1.9300e-03 -8.2974e+00 4.0513e-01 5.9487e-01 9.0901e-01 9.0987e-02 4.8680e-04 1.0922e-03 6.3970e-04 9.3930e-04
|
||||
1.9400e-03 -8.2974e+00 4.0258e-01 5.9742e-01 9.0901e-01 9.0987e-02 4.8513e-04 1.1039e-03 6.3970e-04 9.4930e-04
|
||||
1.9500e-03 -8.2974e+00 4.0006e-01 5.9994e-01 9.0901e-01 9.0987e-02 4.8346e-04 1.1155e-03 6.3970e-04 9.5930e-04
|
||||
1.9600e-03 -8.2974e+00 3.9758e-01 6.0242e-01 9.0901e-01 9.0987e-02 4.8180e-04 1.1272e-03 6.3970e-04 9.6930e-04
|
||||
1.9700e-03 -8.2974e+00 3.9512e-01 6.0488e-01 9.0901e-01 9.0987e-02 4.8013e-04 1.1389e-03 6.3970e-04 9.7930e-04
|
||||
1.9800e-03 -8.2974e+00 3.9270e-01 6.0730e-01 9.0901e-01 9.0987e-02 4.7846e-04 1.1505e-03 6.3970e-04 9.8930e-04
|
||||
1.9900e-03 -8.2974e+00 3.9030e-01 6.0970e-01 9.0901e-01 9.0987e-02 4.7680e-04 1.1622e-03 6.3970e-04 9.9930e-04
|
||||
2.0000e-03 -8.2974e+00 3.8793e-01 6.1207e-01 9.0901e-01 9.0987e-02 4.7513e-04 1.1739e-03 6.3970e-04 1.0093e-03
|
||||
2.0100e-03 -8.2974e+00 3.8559e-01 6.1441e-01 9.0901e-01 9.0987e-02 4.7347e-04 1.1855e-03 6.3970e-04 1.0193e-03
|
||||
2.0200e-03 -8.2974e+00 3.8328e-01 6.1672e-01 9.0901e-01 9.0987e-02 4.7180e-04 1.1972e-03 6.3970e-04 1.0293e-03
|
||||
2.0300e-03 -8.2974e+00 3.8100e-01 6.1900e-01 9.0901e-01 9.0987e-02 4.7013e-04 1.2089e-03 6.3970e-04 1.0393e-03
|
||||
2.0400e-03 -8.2974e+00 3.7875e-01 6.2125e-01 9.0901e-01 9.0987e-02 4.6847e-04 1.2205e-03 6.3970e-04 1.0493e-03
|
||||
2.0500e-03 -8.2974e+00 3.7652e-01 6.2348e-01 9.0901e-01 9.0987e-02 4.6680e-04 1.2322e-03 6.3970e-04 1.0593e-03
|
||||
2.0600e-03 -8.2974e+00 3.7431e-01 6.2569e-01 9.0901e-01 9.0987e-02 4.6514e-04 1.2439e-03 6.3970e-04 1.0693e-03
|
||||
2.0700e-03 -8.2974e+00 3.7214e-01 6.2786e-01 9.0901e-01 9.0987e-02 4.6347e-04 1.2555e-03 6.3970e-04 1.0793e-03
|
||||
2.0800e-03 -8.2974e+00 3.6998e-01 6.3002e-01 9.0901e-01 9.0987e-02 4.6180e-04 1.2672e-03 6.3970e-04 1.0893e-03
|
||||
2.0900e-03 -8.2974e+00 3.6786e-01 6.3214e-01 9.0901e-01 9.0987e-02 4.6014e-04 1.2789e-03 6.3970e-04 1.0993e-03
|
||||
2.1000e-03 -8.2974e+00 3.6575e-01 6.3425e-01 9.0901e-01 9.0987e-02 4.5847e-04 1.2905e-03 6.3970e-04 1.1093e-03
|
||||
2.1100e-03 -8.2974e+00 3.6367e-01 6.3633e-01 9.0901e-01 9.0987e-02 4.5680e-04 1.3022e-03 6.3970e-04 1.1193e-03
|
||||
2.1200e-03 -8.2974e+00 3.6162e-01 6.3838e-01 9.0901e-01 9.0987e-02 4.5514e-04 1.3139e-03 6.3970e-04 1.1293e-03
|
||||
2.1300e-03 -8.2974e+00 3.5958e-01 6.4042e-01 9.0901e-01 9.0987e-02 4.5347e-04 1.3255e-03 6.3970e-04 1.1393e-03
|
||||
2.1400e-03 -8.2974e+00 3.5757e-01 6.4243e-01 9.0901e-01 9.0987e-02 4.5181e-04 1.3372e-03 6.3970e-04 1.1493e-03
|
||||
2.1500e-03 -8.2974e+00 3.5559e-01 6.4441e-01 9.0901e-01 9.0987e-02 4.5014e-04 1.3489e-03 6.3970e-04 1.1593e-03
|
||||
2.1600e-03 -8.2974e+00 3.5362e-01 6.4638e-01 9.0901e-01 9.0987e-02 4.4847e-04 1.3605e-03 6.3970e-04 1.1693e-03
|
||||
2.1700e-03 -8.2974e+00 3.5168e-01 6.4832e-01 9.0901e-01 9.0987e-02 4.4681e-04 1.3722e-03 6.3970e-04 1.1793e-03
|
||||
2.1800e-03 -8.2974e+00 3.4975e-01 6.5025e-01 9.0901e-01 9.0987e-02 4.4514e-04 1.3839e-03 6.3970e-04 1.1893e-03
|
||||
2.1900e-03 -8.2974e+00 3.4785e-01 6.5215e-01 9.0901e-01 9.0987e-02 4.4347e-04 1.3955e-03 6.3970e-04 1.1993e-03
|
||||
2.2000e-03 -8.2974e+00 3.4597e-01 6.5403e-01 9.0901e-01 9.0987e-02 4.4181e-04 1.4072e-03 6.3970e-04 1.2093e-03
|
||||
2.2100e-03 -8.2974e+00 3.4411e-01 6.5589e-01 9.0901e-01 9.0987e-02 4.4014e-04 1.4189e-03 6.3970e-04 1.2193e-03
|
||||
2.2200e-03 -8.2974e+00 3.4227e-01 6.5773e-01 9.0901e-01 9.0987e-02 4.3848e-04 1.4305e-03 6.3970e-04 1.2293e-03
|
||||
2.2300e-03 -8.2974e+00 3.4045e-01 6.5955e-01 9.0901e-01 9.0987e-02 4.3681e-04 1.4422e-03 6.3970e-04 1.2393e-03
|
||||
2.2400e-03 -8.2974e+00 3.3864e-01 6.6136e-01 9.0901e-01 9.0987e-02 4.3514e-04 1.4539e-03 6.3970e-04 1.2493e-03
|
||||
2.2500e-03 -8.2974e+00 3.3686e-01 6.6314e-01 9.0901e-01 9.0987e-02 4.3348e-04 1.4655e-03 6.3970e-04 1.2593e-03
|
||||
2.2600e-03 -8.2974e+00 3.3510e-01 6.6490e-01 9.0901e-01 9.0987e-02 4.3181e-04 1.4772e-03 6.3970e-04 1.2693e-03
|
||||
2.2700e-03 -8.2974e+00 3.3335e-01 6.6665e-01 9.0901e-01 9.0987e-02 4.3015e-04 1.4889e-03 6.3970e-04 1.2793e-03
|
||||
2.2800e-03 -8.2974e+00 3.3162e-01 6.6838e-01 9.0901e-01 9.0987e-02 4.2848e-04 1.5005e-03 6.3970e-04 1.2893e-03
|
||||
2.2900e-03 -8.2974e+00 3.2991e-01 6.7009e-01 9.0901e-01 9.0987e-02 4.2681e-04 1.5122e-03 6.3970e-04 1.2993e-03
|
||||
2.3000e-03 -8.2974e+00 3.2822e-01 6.7178e-01 9.0901e-01 9.0987e-02 4.2515e-04 1.5239e-03 6.3970e-04 1.3093e-03
|
||||
2.3100e-03 -8.2974e+00 3.2654e-01 6.7346e-01 9.0901e-01 9.0987e-02 4.2348e-04 1.5355e-03 6.3970e-04 1.3193e-03
|
||||
2.3200e-03 -8.2974e+00 3.2489e-01 6.7511e-01 9.0901e-01 9.0987e-02 4.2181e-04 1.5472e-03 6.3970e-04 1.3293e-03
|
||||
2.3300e-03 -8.2974e+00 3.2324e-01 6.7676e-01 9.0901e-01 9.0987e-02 4.2015e-04 1.5589e-03 6.3970e-04 1.3393e-03
|
||||
2.3400e-03 -8.2974e+00 3.2162e-01 6.7838e-01 9.0901e-01 9.0987e-02 4.1848e-04 1.5705e-03 6.3970e-04 1.3493e-03
|
||||
2.3500e-03 -8.2974e+00 3.2001e-01 6.7999e-01 9.0901e-01 9.0987e-02 4.1682e-04 1.5822e-03 6.3970e-04 1.3593e-03
|
||||
2.3600e-03 -8.2974e+00 3.1842e-01 6.8158e-01 9.0901e-01 9.0987e-02 4.1515e-04 1.5939e-03 6.3970e-04 1.3693e-03
|
||||
2.3700e-03 -8.2974e+00 3.1684e-01 6.8316e-01 9.0901e-01 9.0987e-02 4.1348e-04 1.6055e-03 6.3970e-04 1.3793e-03
|
||||
2.3800e-03 -8.2974e+00 3.1528e-01 6.8472e-01 9.0901e-01 9.0987e-02 4.1182e-04 1.6172e-03 6.3970e-04 1.3893e-03
|
||||
2.3900e-03 -8.2974e+00 3.1373e-01 6.8627e-01 9.0901e-01 9.0987e-02 4.1015e-04 1.6288e-03 6.3970e-04 1.3993e-03
|
||||
2.4000e-03 -8.2974e+00 3.1220e-01 6.8780e-01 9.0901e-01 9.0987e-02 4.0848e-04 1.6405e-03 6.3970e-04 1.4093e-03
|
||||
2.4100e-03 -8.2974e+00 3.1068e-01 6.8932e-01 9.0901e-01 9.0987e-02 4.0682e-04 1.6522e-03 6.3970e-04 1.4193e-03
|
||||
2.4200e-03 -8.2974e+00 3.0918e-01 6.9082e-01 9.0901e-01 9.0987e-02 4.0515e-04 1.6638e-03 6.3970e-04 1.4293e-03
|
||||
2.4300e-03 -8.2974e+00 3.0770e-01 6.9230e-01 9.0901e-01 9.0987e-02 4.0349e-04 1.6755e-03 6.3970e-04 1.4393e-03
|
||||
2.4400e-03 -8.2974e+00 3.0622e-01 6.9378e-01 9.0901e-01 9.0987e-02 4.0182e-04 1.6872e-03 6.3970e-04 1.4493e-03
|
||||
2.4500e-03 -8.2974e+00 3.0476e-01 6.9524e-01 9.0901e-01 9.0987e-02 4.0015e-04 1.6988e-03 6.3970e-04 1.4593e-03
|
||||
2.4600e-03 -8.2974e+00 3.0332e-01 6.9668e-01 9.0901e-01 9.0987e-02 3.9849e-04 1.7105e-03 6.3970e-04 1.4693e-03
|
||||
2.4700e-03 -8.2974e+00 3.0189e-01 6.9811e-01 9.0901e-01 9.0987e-02 3.9682e-04 1.7222e-03 6.3970e-04 1.4793e-03
|
||||
2.4800e-03 -8.2974e+00 3.0047e-01 6.9953e-01 9.0901e-01 9.0987e-02 3.9515e-04 1.7338e-03 6.3970e-04 1.4893e-03
|
||||
2.4900e-03 -8.2974e+00 2.9907e-01 7.0093e-01 9.0901e-01 9.0987e-02 3.9349e-04 1.7455e-03 6.3970e-04 1.4993e-03
|
||||
2.5000e-03 -8.2974e+00 2.9767e-01 7.0233e-01 9.0901e-01 9.0987e-02 3.9182e-04 1.7572e-03 6.3970e-04 1.5093e-03
|
||||
2.5100e-03 -8.2974e+00 2.9629e-01 7.0371e-01 9.0901e-01 9.0987e-02 3.9016e-04 1.7688e-03 6.3970e-04 1.5193e-03
|
||||
2.5200e-03 -8.2974e+00 2.9493e-01 7.0507e-01 9.0901e-01 9.0987e-02 3.8849e-04 1.7805e-03 6.3970e-04 1.5293e-03
|
||||
2.5300e-03 -8.2974e+00 2.9358e-01 7.0642e-01 9.0901e-01 9.0987e-02 3.8682e-04 1.7922e-03 6.3970e-04 1.5393e-03
|
||||
2.5400e-03 -8.2974e+00 2.9223e-01 7.0777e-01 9.0901e-01 9.0987e-02 3.8516e-04 1.8038e-03 6.3970e-04 1.5493e-03
|
||||
2.5500e-03 -8.2974e+00 2.9091e-01 7.0909e-01 9.0901e-01 9.0987e-02 3.8349e-04 1.8155e-03 6.3970e-04 1.5593e-03
|
||||
2.5600e-03 -8.2974e+00 2.8959e-01 7.1041e-01 9.0901e-01 9.0987e-02 3.8183e-04 1.8272e-03 6.3970e-04 1.5693e-03
|
||||
2.5700e-03 -8.2974e+00 2.8828e-01 7.1172e-01 9.0901e-01 9.0987e-02 3.8016e-04 1.8388e-03 6.3970e-04 1.5793e-03
|
||||
2.5800e-03 -8.2974e+00 2.8699e-01 7.1301e-01 9.0901e-01 9.0987e-02 3.7849e-04 1.8505e-03 6.3970e-04 1.5893e-03
|
||||
2.5900e-03 -8.2974e+00 2.8571e-01 7.1429e-01 9.0901e-01 9.0987e-02 3.7683e-04 1.8622e-03 6.3970e-04 1.5993e-03
|
||||
2.6000e-03 -8.2974e+00 2.8444e-01 7.1556e-01 9.0901e-01 9.0987e-02 3.7516e-04 1.8738e-03 6.3970e-04 1.6093e-03
|
||||
2.6100e-03 -8.2974e+00 2.8318e-01 7.1682e-01 9.0901e-01 9.0987e-02 3.7349e-04 1.8855e-03 6.3970e-04 1.6193e-03
|
||||
2.6200e-03 -8.2974e+00 2.8193e-01 7.1807e-01 9.0901e-01 9.0987e-02 3.7183e-04 1.8972e-03 6.3970e-04 1.6293e-03
|
||||
2.6300e-03 -8.2974e+00 2.8069e-01 7.1931e-01 9.0901e-01 9.0987e-02 3.7016e-04 1.9088e-03 6.3970e-04 1.6393e-03
|
||||
2.6400e-03 -8.2974e+00 2.7947e-01 7.2053e-01 9.0901e-01 9.0987e-02 3.6850e-04 1.9205e-03 6.3970e-04 1.6493e-03
|
||||
2.6500e-03 -8.2974e+00 2.7825e-01 7.2175e-01 9.0901e-01 9.0987e-02 3.6683e-04 1.9322e-03 6.3970e-04 1.6593e-03
|
||||
2.6600e-03 -8.2974e+00 2.7705e-01 7.2295e-01 9.0901e-01 9.0987e-02 3.6516e-04 1.9438e-03 6.3970e-04 1.6693e-03
|
||||
2.6700e-03 -8.2974e+00 2.7585e-01 7.2415e-01 9.0901e-01 9.0987e-02 3.6350e-04 1.9555e-03 6.3970e-04 1.6793e-03
|
||||
2.6800e-03 -8.2974e+00 2.7467e-01 7.2533e-01 9.0901e-01 9.0987e-02 3.6183e-04 1.9672e-03 6.3970e-04 1.6893e-03
|
||||
2.6900e-03 -8.2974e+00 2.7349e-01 7.2651e-01 9.0901e-01 9.0987e-02 3.6016e-04 1.9788e-03 6.3970e-04 1.6993e-03
|
||||
2.7000e-03 -8.2974e+00 2.7233e-01 7.2767e-01 9.0901e-01 9.0987e-02 3.5850e-04 1.9905e-03 6.3970e-04 1.7093e-03
|
||||
2.7100e-03 -8.2974e+00 2.7117e-01 7.2883e-01 9.0901e-01 9.0987e-02 3.5683e-04 2.0022e-03 6.3970e-04 1.7193e-03
|
||||
2.7200e-03 -8.2974e+00 2.7003e-01 7.2997e-01 9.0901e-01 9.0987e-02 3.5517e-04 2.0138e-03 6.3970e-04 1.7293e-03
|
||||
2.7300e-03 -8.2974e+00 2.6889e-01 7.3111e-01 9.0901e-01 9.0987e-02 3.5350e-04 2.0255e-03 6.3970e-04 1.7393e-03
|
||||
2.7400e-03 -8.2974e+00 2.6777e-01 7.3223e-01 9.0901e-01 9.0987e-02 3.5183e-04 2.0372e-03 6.3970e-04 1.7493e-03
|
||||
2.7500e-03 -8.2974e+00 2.6665e-01 7.3335e-01 9.0901e-01 9.0987e-02 3.5017e-04 2.0488e-03 6.3970e-04 1.7593e-03
|
||||
2.7600e-03 -8.2974e+00 2.6555e-01 7.3445e-01 9.0901e-01 9.0987e-02 3.4850e-04 2.0605e-03 6.3970e-04 1.7693e-03
|
||||
2.7700e-03 -8.2974e+00 2.6445e-01 7.3555e-01 9.0901e-01 9.0987e-02 3.4683e-04 2.0722e-03 6.3970e-04 1.7793e-03
|
||||
2.7800e-03 -8.2974e+00 2.6336e-01 7.3664e-01 9.0901e-01 9.0987e-02 3.4517e-04 2.0838e-03 6.3970e-04 1.7893e-03
|
||||
2.7900e-03 -8.2974e+00 2.6228e-01 7.3772e-01 9.0901e-01 9.0987e-02 3.4350e-04 2.0955e-03 6.3970e-04 1.7993e-03
|
||||
2.8000e-03 -8.2974e+00 2.6121e-01 7.3879e-01 9.0901e-01 9.0987e-02 3.4184e-04 2.1072e-03 6.3970e-04 1.8093e-03
|
||||
2.8100e-03 -8.2974e+00 2.6015e-01 7.3985e-01 9.0901e-01 9.0987e-02 3.4017e-04 2.1188e-03 6.3970e-04 1.8193e-03
|
||||
2.8200e-03 -8.2974e+00 2.5909e-01 7.4091e-01 9.0901e-01 9.0987e-02 3.3850e-04 2.1305e-03 6.3970e-04 1.8293e-03
|
||||
2.8300e-03 -8.2974e+00 2.5805e-01 7.4195e-01 9.0901e-01 9.0987e-02 3.3684e-04 2.1422e-03 6.3970e-04 1.8393e-03
|
||||
2.8400e-03 -8.2974e+00 2.5701e-01 7.4299e-01 9.0901e-01 9.0987e-02 3.3517e-04 2.1538e-03 6.3970e-04 1.8493e-03
|
||||
2.8500e-03 -8.2974e+00 2.5598e-01 7.4402e-01 9.0901e-01 9.0987e-02 3.3351e-04 2.1655e-03 6.3970e-04 1.8593e-03
|
||||
2.8600e-03 -8.2974e+00 2.5496e-01 7.4504e-01 9.0901e-01 9.0987e-02 3.3184e-04 2.1772e-03 6.3970e-04 1.8693e-03
|
||||
2.8700e-03 -8.2974e+00 2.5395e-01 7.4605e-01 9.0901e-01 9.0987e-02 3.3017e-04 2.1888e-03 6.3970e-04 1.8793e-03
|
||||
2.8800e-03 -8.2974e+00 2.5295e-01 7.4705e-01 9.0901e-01 9.0987e-02 3.2851e-04 2.2005e-03 6.3970e-04 1.8893e-03
|
||||
2.8900e-03 -8.2974e+00 2.5195e-01 7.4805e-01 9.0901e-01 9.0987e-02 3.2684e-04 2.2122e-03 6.3970e-04 1.8993e-03
|
||||
2.9000e-03 -8.2974e+00 2.5096e-01 7.4904e-01 9.0901e-01 9.0987e-02 3.2517e-04 2.2238e-03 6.3970e-04 1.9093e-03
|
||||
2.9100e-03 -8.2974e+00 2.4998e-01 7.5002e-01 9.0901e-01 9.0987e-02 3.2351e-04 2.2355e-03 6.3970e-04 1.9193e-03
|
||||
2.9200e-03 -8.2974e+00 2.4901e-01 7.5099e-01 9.0901e-01 9.0987e-02 3.2184e-04 2.2472e-03 6.3970e-04 1.9293e-03
|
||||
2.9300e-03 -8.2974e+00 2.4804e-01 7.5196e-01 9.0901e-01 9.0987e-02 3.2018e-04 2.2588e-03 6.3970e-04 1.9393e-03
|
||||
2.9400e-03 -8.2974e+00 2.4708e-01 7.5292e-01 9.0901e-01 9.0987e-02 3.1851e-04 2.2705e-03 6.3970e-04 1.9493e-03
|
||||
2.9500e-03 -8.2974e+00 2.4613e-01 7.5387e-01 9.0901e-01 9.0987e-02 3.1684e-04 2.2822e-03 6.3970e-04 1.9593e-03
|
||||
2.9600e-03 -8.2974e+00 2.4519e-01 7.5481e-01 9.0901e-01 9.0987e-02 3.1518e-04 2.2938e-03 6.3970e-04 1.9693e-03
|
||||
2.9700e-03 -8.2974e+00 2.4425e-01 7.5575e-01 9.0901e-01 9.0987e-02 3.1351e-04 2.3055e-03 6.3970e-04 1.9793e-03
|
||||
2.9800e-03 -8.2974e+00 2.4332e-01 7.5668e-01 9.0901e-01 9.0987e-02 3.1184e-04 2.3172e-03 6.3970e-04 1.9893e-03
|
||||
2.9900e-03 -8.2974e+00 2.4240e-01 7.5760e-01 9.0901e-01 9.0987e-02 3.1018e-04 2.3288e-03 6.3970e-04 1.9993e-03
|
||||
3.0000e-03 -8.2974e+00 2.4149e-01 7.5851e-01 9.0901e-01 9.0987e-02 3.0851e-04 2.3405e-03 6.3970e-04 2.0093e-03
|
||||
3.0100e-03 -8.2974e+00 2.4058e-01 7.5942e-01 9.0901e-01 9.0987e-02 3.0685e-04 2.3522e-03 6.3970e-04 2.0193e-03
|
||||
3.0200e-03 -8.2974e+00 2.3968e-01 7.6032e-01 9.0901e-01 9.0987e-02 3.0518e-04 2.3638e-03 6.3970e-04 2.0293e-03
|
||||
3.0300e-03 -8.2974e+00 2.3878e-01 7.6122e-01 9.0901e-01 9.0987e-02 3.0351e-04 2.3755e-03 6.3970e-04 2.0393e-03
|
||||
3.0400e-03 -8.2974e+00 2.3790e-01 7.6210e-01 9.0901e-01 9.0987e-02 3.0185e-04 2.3872e-03 6.3970e-04 2.0493e-03
|
||||
3.0500e-03 -8.2974e+00 2.3701e-01 7.6299e-01 9.0901e-01 9.0987e-02 3.0018e-04 2.3988e-03 6.3970e-04 2.0593e-03
|
||||
3.0600e-03 -8.2974e+00 2.3614e-01 7.6386e-01 9.0901e-01 9.0987e-02 2.9852e-04 2.4105e-03 6.3970e-04 2.0693e-03
|
||||
3.0700e-03 -8.2974e+00 2.3527e-01 7.6473e-01 9.0901e-01 9.0987e-02 2.9685e-04 2.4222e-03 6.3970e-04 2.0793e-03
|
||||
3.0800e-03 -8.2974e+00 2.3441e-01 7.6559e-01 9.0901e-01 9.0987e-02 2.9518e-04 2.4338e-03 6.3970e-04 2.0893e-03
|
||||
3.0900e-03 -8.2974e+00 2.3355e-01 7.6645e-01 9.0901e-01 9.0987e-02 2.9352e-04 2.4455e-03 6.3970e-04 2.0993e-03
|
||||
3.1000e-03 -8.2974e+00 2.3270e-01 7.6730e-01 9.0901e-01 9.0987e-02 2.9185e-04 2.4571e-03 6.3970e-04 2.1093e-03
|
||||
3.1100e-03 -8.2974e+00 2.3186e-01 7.6814e-01 9.0901e-01 9.0987e-02 2.9018e-04 2.4688e-03 6.3970e-04 2.1193e-03
|
||||
3.1200e-03 -8.2974e+00 2.3102e-01 7.6898e-01 9.0901e-01 9.0987e-02 2.8852e-04 2.4805e-03 6.3970e-04 2.1293e-03
|
||||
3.1300e-03 -8.2974e+00 2.3019e-01 7.6981e-01 9.0901e-01 9.0987e-02 2.8685e-04 2.4921e-03 6.3970e-04 2.1393e-03
|
||||
3.1400e-03 -8.2974e+00 2.2937e-01 7.7063e-01 9.0901e-01 9.0987e-02 2.8519e-04 2.5038e-03 6.3970e-04 2.1493e-03
|
||||
3.1500e-03 -8.2974e+00 2.2855e-01 7.7145e-01 9.0901e-01 9.0987e-02 2.8352e-04 2.5155e-03 6.3970e-04 2.1593e-03
|
||||
3.1600e-03 -8.2974e+00 2.2773e-01 7.7227e-01 9.0901e-01 9.0987e-02 2.8185e-04 2.5271e-03 6.3970e-04 2.1693e-03
|
||||
3.1700e-03 -8.2974e+00 2.2692e-01 7.7308e-01 9.0901e-01 9.0987e-02 2.8019e-04 2.5388e-03 6.3970e-04 2.1793e-03
|
||||
3.1800e-03 -8.2974e+00 2.2612e-01 7.7388e-01 9.0901e-01 9.0987e-02 2.7852e-04 2.5505e-03 6.3970e-04 2.1893e-03
|
||||
3.1900e-03 -8.2974e+00 2.2533e-01 7.7467e-01 9.0901e-01 9.0987e-02 2.7685e-04 2.5621e-03 6.3970e-04 2.1993e-03
|
||||
3.2000e-03 -8.2974e+00 2.2454e-01 7.7546e-01 9.0901e-01 9.0987e-02 2.7519e-04 2.5738e-03 6.3970e-04 2.2093e-03
|
||||
3.2100e-03 -8.2974e+00 2.2375e-01 7.7625e-01 9.0901e-01 9.0987e-02 2.7352e-04 2.5855e-03 6.3970e-04 2.2193e-03
|
||||
3.2200e-03 -8.2974e+00 2.2297e-01 7.7703e-01 9.0901e-01 9.0987e-02 2.7186e-04 2.5971e-03 6.3970e-04 2.2293e-03
|
||||
3.2300e-03 -8.2974e+00 2.2220e-01 7.7780e-01 9.0901e-01 9.0987e-02 2.7019e-04 2.6088e-03 6.3970e-04 2.2393e-03
|
||||
3.2400e-03 -8.2974e+00 2.2143e-01 7.7857e-01 9.0901e-01 9.0987e-02 2.6852e-04 2.6205e-03 6.3970e-04 2.2493e-03
|
||||
3.2500e-03 -8.2974e+00 2.2066e-01 7.7934e-01 9.0901e-01 9.0987e-02 2.6686e-04 2.6321e-03 6.3970e-04 2.2593e-03
|
||||
3.2600e-03 -8.2974e+00 2.1990e-01 7.8010e-01 9.0901e-01 9.0987e-02 2.6519e-04 2.6438e-03 6.3970e-04 2.2693e-03
|
||||
3.2700e-03 -8.2974e+00 2.1915e-01 7.8085e-01 9.0901e-01 9.0987e-02 2.6352e-04 2.6555e-03 6.3970e-04 2.2793e-03
|
||||
3.2800e-03 -8.2974e+00 2.1840e-01 7.8160e-01 9.0901e-01 9.0987e-02 2.6186e-04 2.6671e-03 6.3970e-04 2.2893e-03
|
||||
3.2900e-03 -8.2974e+00 2.1766e-01 7.8234e-01 9.0901e-01 9.0987e-02 2.6019e-04 2.6788e-03 6.3970e-04 2.2993e-03
|
||||
3.3000e-03 -8.2974e+00 2.1692e-01 7.8308e-01 9.0901e-01 9.0987e-02 2.5853e-04 2.6905e-03 6.3970e-04 2.3093e-03
|
||||
3.3100e-03 -8.2974e+00 2.1619e-01 7.8381e-01 9.0901e-01 9.0987e-02 2.5686e-04 2.7021e-03 6.3970e-04 2.3193e-03
|
||||
3.3200e-03 -8.2974e+00 2.1546e-01 7.8454e-01 9.0901e-01 9.0987e-02 2.5519e-04 2.7138e-03 6.3970e-04 2.3293e-03
|
||||
3.3300e-03 -8.2974e+00 2.1474e-01 7.8526e-01 9.0901e-01 9.0987e-02 2.5353e-04 2.7255e-03 6.3970e-04 2.3393e-03
|
||||
3.3400e-03 -8.2974e+00 2.1402e-01 7.8598e-01 9.0901e-01 9.0987e-02 2.5186e-04 2.7371e-03 6.3970e-04 2.3493e-03
|
||||
3.3500e-03 -8.2974e+00 2.1330e-01 7.8670e-01 9.0901e-01 9.0987e-02 2.5020e-04 2.7488e-03 6.3970e-04 2.3593e-03
|
||||
3.3600e-03 -8.2974e+00 2.1260e-01 7.8740e-01 9.0901e-01 9.0987e-02 2.4853e-04 2.7605e-03 6.3970e-04 2.3693e-03
|
||||
3.3700e-03 -8.2974e+00 2.1189e-01 7.8811e-01 9.0901e-01 9.0987e-02 2.4686e-04 2.7721e-03 6.3970e-04 2.3793e-03
|
||||
3.3800e-03 -8.2974e+00 2.1119e-01 7.8881e-01 9.0901e-01 9.0987e-02 2.4520e-04 2.7838e-03 6.3970e-04 2.3893e-03
|
||||
3.3900e-03 -8.2974e+00 2.1050e-01 7.8950e-01 9.0901e-01 9.0987e-02 2.4353e-04 2.7955e-03 6.3970e-04 2.3993e-03
|
||||
3.4000e-03 -8.2974e+00 2.0981e-01 7.9019e-01 9.0901e-01 9.0987e-02 2.4186e-04 2.8071e-03 6.3970e-04 2.4093e-03
|
||||
3.4100e-03 -8.2974e+00 2.0912e-01 7.9088e-01 9.0901e-01 9.0987e-02 2.4020e-04 2.8188e-03 6.3970e-04 2.4193e-03
|
||||
3.4200e-03 -8.2974e+00 2.0844e-01 7.9156e-01 9.0901e-01 9.0987e-02 2.3853e-04 2.8305e-03 6.3970e-04 2.4293e-03
|
||||
3.4300e-03 -8.2974e+00 2.0776e-01 7.9224e-01 9.0901e-01 9.0987e-02 2.3687e-04 2.8421e-03 6.3970e-04 2.4393e-03
|
||||
3.4400e-03 -8.2974e+00 2.0709e-01 7.9291e-01 9.0901e-01 9.0987e-02 2.3520e-04 2.8538e-03 6.3970e-04 2.4493e-03
|
||||
3.4500e-03 -8.2974e+00 2.0642e-01 7.9358e-01 9.0901e-01 9.0987e-02 2.3353e-04 2.8655e-03 6.3970e-04 2.4593e-03
|
||||
3.4600e-03 -8.2974e+00 2.0576e-01 7.9424e-01 9.0901e-01 9.0987e-02 2.3187e-04 2.8771e-03 6.3970e-04 2.4693e-03
|
||||
3.4700e-03 -8.2974e+00 2.0510e-01 7.9490e-01 9.0901e-01 9.0987e-02 2.3020e-04 2.8888e-03 6.3970e-04 2.4793e-03
|
||||
3.4800e-03 -8.2974e+00 2.0444e-01 7.9556e-01 9.0901e-01 9.0987e-02 2.2853e-04 2.9005e-03 6.3970e-04 2.4893e-03
|
||||
3.4900e-03 -8.2974e+00 2.0379e-01 7.9621e-01 9.0901e-01 9.0987e-02 2.2687e-04 2.9121e-03 6.3970e-04 2.4993e-03
|
||||
3.5000e-03 -8.2974e+00 2.0314e-01 7.9686e-01 9.0901e-01 9.0987e-02 2.2520e-04 2.9238e-03 6.3970e-04 2.5093e-03
|
||||
3.5100e-03 -8.2974e+00 2.0250e-01 7.9750e-01 9.0901e-01 9.0987e-02 2.2354e-04 2.9355e-03 6.3970e-04 2.5193e-03
|
||||
3.5200e-03 -8.2974e+00 2.0186e-01 7.9814e-01 9.0901e-01 9.0987e-02 2.2187e-04 2.9471e-03 6.3970e-04 2.5293e-03
|
||||
3.5300e-03 -8.2974e+00 2.0123e-01 7.9877e-01 9.0901e-01 9.0987e-02 2.2020e-04 2.9588e-03 6.3970e-04 2.5393e-03
|
||||
3.5400e-03 -8.2974e+00 2.0060e-01 7.9940e-01 9.0901e-01 9.0987e-02 2.1854e-04 2.9705e-03 6.3970e-04 2.5493e-03
|
||||
3.5500e-03 -8.2974e+00 1.9997e-01 8.0003e-01 9.0901e-01 9.0987e-02 2.1687e-04 2.9821e-03 6.3970e-04 2.5593e-03
|
||||
3.5600e-03 -8.2974e+00 1.9935e-01 8.0065e-01 9.0901e-01 9.0987e-02 2.1520e-04 2.9938e-03 6.3970e-04 2.5693e-03
|
||||
3.5700e-03 -8.2974e+00 1.9873e-01 8.0127e-01 9.0901e-01 9.0987e-02 2.1354e-04 3.0055e-03 6.3970e-04 2.5793e-03
|
||||
3.5800e-03 -8.2974e+00 1.9811e-01 8.0189e-01 9.0901e-01 9.0987e-02 2.1187e-04 3.0171e-03 6.3970e-04 2.5893e-03
|
||||
3.5900e-03 -8.2974e+00 1.9750e-01 8.0250e-01 9.0901e-01 9.0987e-02 2.1021e-04 3.0288e-03 6.3970e-04 2.5993e-03
|
||||
3.6000e-03 -8.2974e+00 1.9689e-01 8.0311e-01 9.0901e-01 9.0987e-02 2.0854e-04 3.0405e-03 6.3970e-04 2.6093e-03
|
||||
3.6100e-03 -8.2974e+00 1.9629e-01 8.0371e-01 9.0901e-01 9.0987e-02 2.0687e-04 3.0521e-03 6.3970e-04 2.6193e-03
|
||||
3.6200e-03 -8.2974e+00 1.9569e-01 8.0431e-01 9.0901e-01 9.0987e-02 2.0521e-04 3.0638e-03 6.3970e-04 2.6293e-03
|
||||
3.6300e-03 -8.2974e+00 1.9509e-01 8.0491e-01 9.0901e-01 9.0987e-02 2.0354e-04 3.0755e-03 6.3970e-04 2.6393e-03
|
||||
3.6400e-03 -8.2974e+00 1.9450e-01 8.0550e-01 9.0901e-01 9.0987e-02 2.0188e-04 3.0871e-03 6.3970e-04 2.6493e-03
|
||||
3.6500e-03 -8.2974e+00 1.9391e-01 8.0609e-01 9.0901e-01 9.0987e-02 2.0021e-04 3.0988e-03 6.3970e-04 2.6593e-03
|
||||
3.6600e-03 -8.2974e+00 1.9332e-01 8.0668e-01 9.0901e-01 9.0987e-02 1.9854e-04 3.1105e-03 6.3970e-04 2.6693e-03
|
||||
3.6700e-03 -8.2974e+00 1.9274e-01 8.0726e-01 9.0901e-01 9.0987e-02 1.9688e-04 3.1221e-03 6.3970e-04 2.6793e-03
|
||||
3.6800e-03 -8.2974e+00 1.9216e-01 8.0784e-01 9.0901e-01 9.0987e-02 1.9521e-04 3.1338e-03 6.3970e-04 2.6893e-03
|
||||
3.6900e-03 -8.2974e+00 1.9158e-01 8.0842e-01 9.0901e-01 9.0987e-02 1.9354e-04 3.1455e-03 6.3970e-04 2.6993e-03
|
||||
3.7000e-03 -8.2974e+00 1.9101e-01 8.0899e-01 9.0901e-01 9.0987e-02 1.9188e-04 3.1571e-03 6.3970e-04 2.7093e-03
|
||||
3.7100e-03 -8.2974e+00 1.9044e-01 8.0956e-01 9.0901e-01 9.0987e-02 1.9021e-04 3.1688e-03 6.3970e-04 2.7193e-03
|
||||
3.7200e-03 -8.2974e+00 1.8988e-01 8.1012e-01 9.0901e-01 9.0987e-02 1.8855e-04 3.1805e-03 6.3970e-04 2.7293e-03
|
||||
3.7300e-03 -8.2974e+00 1.8932e-01 8.1068e-01 9.0901e-01 9.0987e-02 1.8688e-04 3.1921e-03 6.3970e-04 2.7393e-03
|
||||
3.7400e-03 -8.2974e+00 1.8876e-01 8.1124e-01 9.0901e-01 9.0987e-02 1.8521e-04 3.2038e-03 6.3970e-04 2.7493e-03
|
||||
3.7500e-03 -8.2974e+00 1.8820e-01 8.1180e-01 9.0901e-01 9.0987e-02 1.8355e-04 3.2155e-03 6.3970e-04 2.7593e-03
|
||||
3.7600e-03 -8.2974e+00 1.8765e-01 8.1235e-01 9.0901e-01 9.0987e-02 1.8188e-04 3.2271e-03 6.3970e-04 2.7693e-03
|
||||
3.7700e-03 -8.2974e+00 1.8710e-01 8.1290e-01 9.0901e-01 9.0987e-02 1.8021e-04 3.2388e-03 6.3970e-04 2.7793e-03
|
||||
3.7800e-03 -8.2974e+00 1.8656e-01 8.1344e-01 9.0901e-01 9.0987e-02 1.7855e-04 3.2505e-03 6.3970e-04 2.7893e-03
|
||||
3.7900e-03 -8.2974e+00 1.8601e-01 8.1399e-01 9.0901e-01 9.0987e-02 1.7688e-04 3.2621e-03 6.3970e-04 2.7993e-03
|
||||
3.8000e-03 -8.2974e+00 1.8547e-01 8.1453e-01 9.0901e-01 9.0987e-02 1.7522e-04 3.2738e-03 6.3970e-04 2.8093e-03
|
||||
3.8100e-03 -8.2974e+00 1.8494e-01 8.1506e-01 9.0901e-01 9.0987e-02 1.7355e-04 3.2855e-03 6.3970e-04 2.8193e-03
|
||||
3.8200e-03 -8.2974e+00 1.8440e-01 8.1560e-01 9.0901e-01 9.0987e-02 1.7188e-04 3.2971e-03 6.3970e-04 2.8293e-03
|
||||
3.8300e-03 -8.2974e+00 1.8387e-01 8.1613e-01 9.0901e-01 9.0987e-02 1.7022e-04 3.3088e-03 6.3970e-04 2.8393e-03
|
||||
3.8400e-03 -8.2974e+00 1.8335e-01 8.1665e-01 9.0901e-01 9.0987e-02 1.6855e-04 3.3204e-03 6.3970e-04 2.8493e-03
|
||||
3.8500e-03 -8.2974e+00 1.8282e-01 8.1718e-01 9.0901e-01 9.0987e-02 1.6689e-04 3.3321e-03 6.3970e-04 2.8593e-03
|
||||
3.8600e-03 -8.2974e+00 1.8230e-01 8.1770e-01 9.0901e-01 9.0987e-02 1.6522e-04 3.3438e-03 6.3970e-04 2.8693e-03
|
||||
3.8700e-03 -8.2974e+00 1.8178e-01 8.1822e-01 9.0901e-01 9.0987e-02 1.6355e-04 3.3554e-03 6.3970e-04 2.8793e-03
|
||||
3.8800e-03 -8.2974e+00 1.8127e-01 8.1873e-01 9.0901e-01 9.0987e-02 1.6189e-04 3.3671e-03 6.3970e-04 2.8893e-03
|
||||
3.8900e-03 -8.2974e+00 1.8076e-01 8.1924e-01 9.0901e-01 9.0987e-02 1.6022e-04 3.3788e-03 6.3970e-04 2.8993e-03
|
||||
3.9000e-03 -8.2974e+00 1.8025e-01 8.1975e-01 9.0901e-01 9.0987e-02 1.5855e-04 3.3904e-03 6.3970e-04 2.9093e-03
|
||||
3.9100e-03 -8.2974e+00 1.7974e-01 8.2026e-01 9.0901e-01 9.0987e-02 1.5689e-04 3.4021e-03 6.3970e-04 2.9193e-03
|
||||
3.9200e-03 -8.2974e+00 1.7924e-01 8.2076e-01 9.0901e-01 9.0987e-02 1.5522e-04 3.4138e-03 6.3970e-04 2.9293e-03
|
||||
3.9300e-03 -8.2974e+00 1.7874e-01 8.2126e-01 9.0901e-01 9.0987e-02 1.5356e-04 3.4254e-03 6.3970e-04 2.9393e-03
|
||||
3.9400e-03 -8.2974e+00 1.7824e-01 8.2176e-01 9.0901e-01 9.0987e-02 1.5189e-04 3.4371e-03 6.3970e-04 2.9493e-03
|
||||
3.9500e-03 -8.2974e+00 1.7774e-01 8.2226e-01 9.0901e-01 9.0987e-02 1.5022e-04 3.4488e-03 6.3970e-04 2.9593e-03
|
||||
3.9600e-03 -8.2974e+00 1.7725e-01 8.2275e-01 9.0901e-01 9.0987e-02 1.4856e-04 3.4604e-03 6.3970e-04 2.9693e-03
|
||||
3.9700e-03 -8.2974e+00 1.7676e-01 8.2324e-01 9.0901e-01 9.0987e-02 1.4689e-04 3.4721e-03 6.3970e-04 2.9793e-03
|
||||
3.9800e-03 -8.2974e+00 1.7627e-01 8.2373e-01 9.0901e-01 9.0987e-02 1.4522e-04 3.4838e-03 6.3970e-04 2.9893e-03
|
||||
3.9900e-03 -8.2974e+00 1.7579e-01 8.2421e-01 9.0901e-01 9.0987e-02 1.4356e-04 3.4954e-03 6.3970e-04 2.9993e-03
|
||||
4.0000e-03 -8.2974e+00 1.7531e-01 8.2469e-01 9.0901e-01 9.0987e-02 1.4189e-04 3.5071e-03 6.3970e-04 3.0093e-03
|
||||
4.0100e-03 -8.2974e+00 1.7483e-01 8.2517e-01 9.0901e-01 9.0987e-02 1.4023e-04 3.5188e-03 6.3970e-04 3.0193e-03
|
||||
4.0200e-03 -8.2974e+00 1.7435e-01 8.2565e-01 9.0901e-01 9.0987e-02 1.3856e-04 3.5304e-03 6.3970e-04 3.0293e-03
|
||||
4.0300e-03 -8.2974e+00 1.7388e-01 8.2612e-01 9.0901e-01 9.0987e-02 1.3689e-04 3.5421e-03 6.3970e-04 3.0393e-03
|
||||
4.0400e-03 -8.2974e+00 1.7341e-01 8.2659e-01 9.0901e-01 9.0987e-02 1.3523e-04 3.5538e-03 6.3970e-04 3.0493e-03
|
||||
4.0500e-03 -8.2974e+00 1.7294e-01 8.2706e-01 9.0901e-01 9.0987e-02 1.3356e-04 3.5654e-03 6.3970e-04 3.0593e-03
|
||||
4.0600e-03 -8.2974e+00 1.7247e-01 8.2753e-01 9.0901e-01 9.0987e-02 1.3189e-04 3.5771e-03 6.3970e-04 3.0693e-03
|
||||
4.0700e-03 -8.2974e+00 1.7201e-01 8.2799e-01 9.0901e-01 9.0987e-02 1.3023e-04 3.5888e-03 6.3970e-04 3.0793e-03
|
||||
4.0800e-03 -8.2974e+00 1.7155e-01 8.2845e-01 9.0901e-01 9.0987e-02 1.2856e-04 3.6004e-03 6.3970e-04 3.0893e-03
|
||||
4.0900e-03 -8.2974e+00 1.7109e-01 8.2891e-01 9.0901e-01 9.0987e-02 1.2690e-04 3.6121e-03 6.3970e-04 3.0993e-03
|
||||
4.1000e-03 -8.2974e+00 1.7063e-01 8.2937e-01 9.0901e-01 9.0987e-02 1.2523e-04 3.6238e-03 6.3970e-04 3.1093e-03
|
||||
4.1100e-03 -8.2974e+00 1.7018e-01 8.2982e-01 9.0901e-01 9.0987e-02 1.2356e-04 3.6354e-03 6.3970e-04 3.1193e-03
|
||||
4.1200e-03 -8.2974e+00 1.6973e-01 8.3027e-01 9.0901e-01 9.0987e-02 1.2190e-04 3.6471e-03 6.3970e-04 3.1293e-03
|
||||
4.1300e-03 -8.2974e+00 1.6928e-01 8.3072e-01 9.0901e-01 9.0987e-02 1.2023e-04 3.6588e-03 6.3970e-04 3.1393e-03
|
||||
4.1400e-03 -8.2974e+00 1.6883e-01 8.3117e-01 9.0901e-01 9.0987e-02 1.1857e-04 3.6704e-03 6.3970e-04 3.1493e-03
|
||||
4.1500e-03 -8.2974e+00 1.6839e-01 8.3161e-01 9.0901e-01 9.0987e-02 1.1690e-04 3.6821e-03 6.3970e-04 3.1593e-03
|
||||
4.1600e-03 -8.2974e+00 1.6794e-01 8.3206e-01 9.0901e-01 9.0987e-02 1.1523e-04 3.6938e-03 6.3970e-04 3.1693e-03
|
||||
4.1700e-03 -8.2974e+00 1.6750e-01 8.3250e-01 9.0901e-01 9.0987e-02 1.1357e-04 3.7054e-03 6.3970e-04 3.1793e-03
|
||||
4.1800e-03 -8.2974e+00 1.6707e-01 8.3293e-01 9.0901e-01 9.0987e-02 1.1190e-04 3.7171e-03 6.3970e-04 3.1893e-03
|
||||
4.1900e-03 -8.2974e+00 1.6663e-01 8.3337e-01 9.0901e-01 9.0987e-02 1.1023e-04 3.7288e-03 6.3970e-04 3.1993e-03
|
||||
4.2000e-03 -8.2974e+00 1.6620e-01 8.3380e-01 9.0901e-01 9.0987e-02 1.0857e-04 3.7404e-03 6.3970e-04 3.2093e-03
|
||||
4.2100e-03 -8.2974e+00 1.6577e-01 8.3423e-01 9.0901e-01 9.0987e-02 1.0690e-04 3.7521e-03 6.3970e-04 3.2193e-03
|
||||
4.2200e-03 -8.2974e+00 1.6534e-01 8.3466e-01 9.0901e-01 9.0987e-02 1.0524e-04 3.7638e-03 6.3970e-04 3.2293e-03
|
||||
4.2300e-03 -8.2974e+00 1.6491e-01 8.3509e-01 9.0901e-01 9.0987e-02 1.0357e-04 3.7754e-03 6.3970e-04 3.2393e-03
|
||||
4.2400e-03 -8.2974e+00 1.6449e-01 8.3551e-01 9.0901e-01 9.0987e-02 1.0190e-04 3.7871e-03 6.3970e-04 3.2493e-03
|
||||
4.2500e-03 -8.2974e+00 1.6407e-01 8.3593e-01 9.0901e-01 9.0987e-02 1.0024e-04 3.7988e-03 6.3970e-04 3.2593e-03
|
||||
4.2600e-03 -8.2974e+00 1.6365e-01 8.3635e-01 9.0901e-01 9.0987e-02 9.8571e-05 3.8104e-03 6.3970e-04 3.2693e-03
|
||||
4.2700e-03 -8.2974e+00 1.6323e-01 8.3677e-01 9.0901e-01 9.0987e-02 9.6905e-05 3.8221e-03 6.3970e-04 3.2793e-03
|
||||
4.2800e-03 -8.2974e+00 1.6282e-01 8.3718e-01 9.0901e-01 9.0987e-02 9.5238e-05 3.8338e-03 6.3970e-04 3.2893e-03
|
||||
4.2900e-03 -8.2974e+00 1.6240e-01 8.3760e-01 9.0901e-01 9.0987e-02 9.3572e-05 3.8454e-03 6.3970e-04 3.2993e-03
|
||||
4.3000e-03 -8.2974e+00 1.6199e-01 8.3801e-01 9.0901e-01 9.0987e-02 9.1906e-05 3.8571e-03 6.3970e-04 3.3093e-03
|
||||
4.3100e-03 -8.2974e+00 1.6158e-01 8.3842e-01 9.0901e-01 9.0987e-02 9.0240e-05 3.8688e-03 6.3970e-04 3.3193e-03
|
||||
4.3200e-03 -8.2974e+00 1.6117e-01 8.3883e-01 9.0901e-01 9.0987e-02 8.8574e-05 3.8804e-03 6.3970e-04 3.3293e-03
|
||||
4.3300e-03 -8.2974e+00 1.6077e-01 8.3923e-01 9.0901e-01 9.0987e-02 8.6907e-05 3.8921e-03 6.3970e-04 3.3393e-03
|
||||
4.3400e-03 -8.2974e+00 1.6037e-01 8.3963e-01 9.0901e-01 9.0987e-02 8.5241e-05 3.9038e-03 6.3970e-04 3.3493e-03
|
||||
4.3500e-03 -8.2974e+00 1.5997e-01 8.4003e-01 9.0901e-01 9.0987e-02 8.3575e-05 3.9154e-03 6.3970e-04 3.3593e-03
|
||||
4.3600e-03 -8.2974e+00 1.5957e-01 8.4043e-01 9.0901e-01 9.0987e-02 8.1909e-05 3.9271e-03 6.3970e-04 3.3693e-03
|
||||
4.3700e-03 -8.2974e+00 1.5917e-01 8.4083e-01 9.0901e-01 9.0987e-02 8.0243e-05 3.9388e-03 6.3970e-04 3.3793e-03
|
||||
4.3800e-03 -8.2974e+00 1.5877e-01 8.4123e-01 9.0901e-01 9.0987e-02 7.8576e-05 3.9504e-03 6.3970e-04 3.3893e-03
|
||||
4.3900e-03 -8.2974e+00 1.5838e-01 8.4162e-01 9.0901e-01 9.0987e-02 7.6910e-05 3.9621e-03 6.3970e-04 3.3993e-03
|
||||
4.4000e-03 -8.2974e+00 1.5799e-01 8.4201e-01 9.0901e-01 9.0987e-02 7.5244e-05 3.9738e-03 6.3970e-04 3.4093e-03
|
||||
4.4100e-03 -8.2974e+00 1.5760e-01 8.4240e-01 9.0901e-01 9.0987e-02 7.3578e-05 3.9854e-03 6.3970e-04 3.4193e-03
|
||||
4.4200e-03 -8.2974e+00 1.5721e-01 8.4279e-01 9.0901e-01 9.0987e-02 7.1912e-05 3.9971e-03 6.3970e-04 3.4293e-03
|
||||
4.4300e-03 -8.2974e+00 1.5683e-01 8.4317e-01 9.0901e-01 9.0987e-02 7.0245e-05 4.0088e-03 6.3970e-04 3.4393e-03
|
||||
4.4400e-03 -8.2974e+00 1.5644e-01 8.4356e-01 9.0901e-01 9.0987e-02 6.8579e-05 4.0204e-03 6.3970e-04 3.4493e-03
|
||||
4.4500e-03 -8.2974e+00 1.5606e-01 8.4394e-01 9.0901e-01 9.0987e-02 6.6913e-05 4.0321e-03 6.3970e-04 3.4593e-03
|
||||
4.4600e-03 -8.2974e+00 1.5568e-01 8.4432e-01 9.0901e-01 9.0987e-02 6.5247e-05 4.0438e-03 6.3970e-04 3.4693e-03
|
||||
4.4700e-03 -8.2974e+00 1.5530e-01 8.4470e-01 9.0901e-01 9.0987e-02 6.3581e-05 4.0554e-03 6.3970e-04 3.4793e-03
|
||||
4.4800e-03 -8.2974e+00 1.5493e-01 8.4507e-01 9.0901e-01 9.0987e-02 6.1914e-05 4.0671e-03 6.3970e-04 3.4893e-03
|
||||
4.4900e-03 -8.2974e+00 1.5455e-01 8.4545e-01 9.0901e-01 9.0987e-02 6.0248e-05 4.0788e-03 6.3970e-04 3.4993e-03
|
||||
4.5000e-03 -8.2974e+00 1.5418e-01 8.4582e-01 9.0901e-01 9.0987e-02 5.8582e-05 4.0904e-03 6.3970e-04 3.5093e-03
|
||||
4.5100e-03 -8.2974e+00 1.5381e-01 8.4619e-01 9.0901e-01 9.0987e-02 5.6916e-05 4.1021e-03 6.3970e-04 3.5193e-03
|
||||
4.5200e-03 -8.2974e+00 1.5344e-01 8.4656e-01 9.0901e-01 9.0987e-02 5.5250e-05 4.1138e-03 6.3970e-04 3.5293e-03
|
||||
4.5300e-03 -8.2974e+00 1.5307e-01 8.4693e-01 9.0901e-01 9.0987e-02 5.3583e-05 4.1254e-03 6.3970e-04 3.5393e-03
|
||||
4.5400e-03 -8.2974e+00 1.5271e-01 8.4729e-01 9.0901e-01 9.0987e-02 5.1917e-05 4.1371e-03 6.3970e-04 3.5493e-03
|
||||
4.5500e-03 -8.2974e+00 1.5235e-01 8.4765e-01 9.0901e-01 9.0987e-02 5.0251e-05 4.1487e-03 6.3970e-04 3.5593e-03
|
||||
4.5600e-03 -8.2974e+00 1.5198e-01 8.4802e-01 9.0901e-01 9.0987e-02 4.8585e-05 4.1604e-03 6.3970e-04 3.5693e-03
|
||||
4.5700e-03 -8.2974e+00 1.5162e-01 8.4838e-01 9.0901e-01 9.0987e-02 4.6919e-05 4.1721e-03 6.3970e-04 3.5793e-03
|
||||
4.5800e-03 -8.2974e+00 1.5127e-01 8.4873e-01 9.0901e-01 9.0987e-02 4.5252e-05 4.1837e-03 6.3970e-04 3.5893e-03
|
||||
4.5900e-03 -8.2974e+00 1.5091e-01 8.4909e-01 9.0901e-01 9.0987e-02 4.3586e-05 4.1954e-03 6.3970e-04 3.5993e-03
|
||||
4.6000e-03 -8.2974e+00 1.5055e-01 8.4945e-01 9.0901e-01 9.0987e-02 4.1920e-05 4.2071e-03 6.3970e-04 3.6093e-03
|
||||
4.6100e-03 -8.2974e+00 1.5020e-01 8.4980e-01 9.0901e-01 9.0987e-02 4.0254e-05 4.2187e-03 6.3970e-04 3.6193e-03
|
||||
4.6200e-03 -8.2974e+00 1.4985e-01 8.5015e-01 9.0901e-01 9.0987e-02 3.8588e-05 4.2304e-03 6.3970e-04 3.6293e-03
|
||||
4.6300e-03 -8.2974e+00 1.4950e-01 8.5050e-01 9.0901e-01 9.0987e-02 3.6921e-05 4.2421e-03 6.3970e-04 3.6393e-03
|
||||
4.6400e-03 -8.2974e+00 1.4915e-01 8.5085e-01 9.0901e-01 9.0987e-02 3.5255e-05 4.2537e-03 6.3970e-04 3.6493e-03
|
||||
4.6500e-03 -8.2974e+00 1.4880e-01 8.5120e-01 9.0901e-01 9.0987e-02 3.3589e-05 4.2654e-03 6.3970e-04 3.6593e-03
|
||||
4.6600e-03 -8.2974e+00 1.4846e-01 8.5154e-01 9.0901e-01 9.0987e-02 3.1923e-05 4.2771e-03 6.3970e-04 3.6693e-03
|
||||
4.6700e-03 -8.2974e+00 1.4811e-01 8.5189e-01 9.0901e-01 9.0987e-02 3.0257e-05 4.2887e-03 6.3970e-04 3.6793e-03
|
||||
4.6800e-03 -8.2974e+00 1.4777e-01 8.5223e-01 9.0901e-01 9.0987e-02 2.8590e-05 4.3004e-03 6.3970e-04 3.6893e-03
|
||||
4.6900e-03 -8.2974e+00 1.4743e-01 8.5257e-01 9.0901e-01 9.0987e-02 2.6924e-05 4.3121e-03 6.3970e-04 3.6993e-03
|
||||
4.7000e-03 -8.2974e+00 1.4709e-01 8.5291e-01 9.0901e-01 9.0987e-02 2.5258e-05 4.3237e-03 6.3970e-04 3.7093e-03
|
||||
4.7100e-03 -8.2974e+00 1.4675e-01 8.5325e-01 9.0901e-01 9.0987e-02 2.3592e-05 4.3354e-03 6.3970e-04 3.7193e-03
|
||||
4.7200e-03 -8.2974e+00 1.4642e-01 8.5358e-01 9.0901e-01 9.0987e-02 2.1926e-05 4.3471e-03 6.3970e-04 3.7293e-03
|
||||
4.7300e-03 -8.2974e+00 1.4608e-01 8.5392e-01 9.0901e-01 9.0987e-02 2.0259e-05 4.3587e-03 6.3970e-04 3.7393e-03
|
||||
4.7400e-03 -8.2974e+00 1.4575e-01 8.5425e-01 9.0901e-01 9.0987e-02 1.8593e-05 4.3704e-03 6.3970e-04 3.7493e-03
|
||||
4.7500e-03 -8.2974e+00 1.4542e-01 8.5458e-01 9.0901e-01 9.0987e-02 1.6927e-05 4.3821e-03 6.3970e-04 3.7593e-03
|
||||
4.7600e-03 -8.2974e+00 1.4509e-01 8.5491e-01 9.0901e-01 9.0987e-02 1.5261e-05 4.3937e-03 6.3970e-04 3.7693e-03
|
||||
4.7700e-03 -8.2974e+00 1.4476e-01 8.5524e-01 9.0901e-01 9.0987e-02 1.3595e-05 4.4054e-03 6.3970e-04 3.7793e-03
|
||||
4.7800e-03 -8.2974e+00 1.4443e-01 8.5557e-01 9.0901e-01 9.0987e-02 1.1928e-05 4.4171e-03 6.3970e-04 3.7893e-03
|
||||
4.7900e-03 -8.2974e+00 1.4411e-01 8.5589e-01 9.0901e-01 9.0987e-02 1.0262e-05 4.4287e-03 6.3970e-04 3.7993e-03
|
||||
4.8000e-03 -8.2974e+00 1.4379e-01 8.5621e-01 9.0901e-01 9.0987e-02 8.5959e-06 4.4404e-03 6.3970e-04 3.8093e-03
|
||||
4.8100e-03 -8.2974e+00 1.4346e-01 8.5654e-01 9.0901e-01 9.0987e-02 6.9297e-06 4.4521e-03 6.3970e-04 3.8193e-03
|
||||
4.8200e-03 -8.2974e+00 1.4314e-01 8.5686e-01 9.0901e-01 9.0987e-02 5.2635e-06 4.4637e-03 6.3970e-04 3.8293e-03
|
||||
4.8300e-03 -8.2974e+00 1.4282e-01 8.5718e-01 9.0901e-01 9.0987e-02 3.5973e-06 4.4754e-03 6.3970e-04 3.8393e-03
|
||||
4.8400e-03 -8.2974e+00 1.4250e-01 8.5750e-01 9.0901e-01 9.0987e-02 1.9311e-06 4.4871e-03 6.3970e-04 3.8493e-03
|
||||
4.8500e-03 -8.2974e+00 1.4219e-01 8.5781e-01 9.0901e-01 9.0987e-02 2.6493e-07 4.4987e-03 6.3970e-04 3.8593e-03
|
||||
4.8600e-03 -8.2975e+00 1.4210e-01 8.5790e-01 9.0899e-01 9.1014e-02 1.0000e-10 1.0000e-10 6.4087e-04 3.8691e-03
|
||||
4.8700e-03 -8.2976e+00 1.4206e-01 8.5794e-01 9.0895e-01 9.1046e-02 1.0000e-10 1.0000e-10 6.4227e-04 3.8789e-03
|
||||
4.8800e-03 -8.2977e+00 1.4202e-01 8.5798e-01 9.0892e-01 9.1078e-02 1.0000e-10 1.0000e-10 6.4366e-04 3.8886e-03
|
||||
4.8900e-03 -8.2979e+00 1.4197e-01 8.5803e-01 9.0889e-01 9.1110e-02 1.0000e-10 1.0000e-10 6.4505e-04 3.8984e-03
|
||||
4.9000e-03 -8.2980e+00 1.4193e-01 8.5807e-01 9.0886e-01 9.1142e-02 1.0000e-10 1.0000e-10 6.4644e-04 3.9081e-03
|
||||
4.9100e-03 -8.2981e+00 1.4189e-01 8.5811e-01 9.0883e-01 9.1174e-02 1.0000e-10 1.0000e-10 6.4783e-04 3.9179e-03
|
||||
4.9200e-03 -8.2982e+00 1.4185e-01 8.5815e-01 9.0879e-01 9.1206e-02 1.0000e-10 1.0000e-10 6.4922e-04 3.9276e-03
|
||||
4.9300e-03 -8.2984e+00 1.4181e-01 8.5819e-01 9.0876e-01 9.1238e-02 1.0000e-10 1.0000e-10 6.5060e-04 3.9374e-03
|
||||
4.9400e-03 -8.2985e+00 1.4176e-01 8.5824e-01 9.0873e-01 9.1270e-02 1.0000e-10 1.0000e-10 6.5199e-04 3.9471e-03
|
||||
4.9500e-03 -8.2986e+00 1.4172e-01 8.5828e-01 9.0870e-01 9.1302e-02 1.0000e-10 1.0000e-10 6.5338e-04 3.9569e-03
|
||||
4.9600e-03 -8.2988e+00 1.4168e-01 8.5832e-01 9.0867e-01 9.1334e-02 1.0000e-10 1.0000e-10 6.5476e-04 3.9667e-03
|
||||
4.9700e-03 -8.2989e+00 1.4164e-01 8.5836e-01 9.0863e-01 9.1366e-02 1.0000e-10 1.0000e-10 6.5615e-04 3.9764e-03
|
||||
4.9800e-03 -8.2990e+00 1.4160e-01 8.5840e-01 9.0860e-01 9.1398e-02 1.0000e-10 1.0000e-10 6.5753e-04 3.9862e-03
|
||||
4.9900e-03 -8.2991e+00 1.4155e-01 8.5845e-01 9.0857e-01 9.1429e-02 1.0000e-10 1.0000e-10 6.5891e-04 3.9959e-03
|
||||
5.0000e-03 -8.2993e+00 1.4151e-01 8.5849e-01 9.0854e-01 9.1461e-02 1.0000e-10 1.0000e-10 6.6029e-04 4.0057e-03
|
||||
1.0000e-03 -8.2974e+00 9.8567e-01 1.4329e-02 9.0901e-01 9.0987e-02 6.4175e-04 7.2473e-06 6.3970e-04 9.2997e-06
|
||||
2.0000e-03 -8.2974e+00 3.8793e-01 6.1207e-01 9.0901e-01 9.0987e-02 4.7513e-04 1.1739e-03 6.3970e-04 1.0093e-03
|
||||
3.0000e-03 -8.2974e+00 2.4149e-01 7.5851e-01 9.0901e-01 9.0987e-02 3.0851e-04 2.3405e-03 6.3970e-04 2.0093e-03
|
||||
4.0000e-03 -8.2974e+00 1.7531e-01 8.2469e-01 9.0901e-01 9.0987e-02 1.4189e-04 3.5071e-03 6.3970e-04 3.0093e-03
|
||||
5.0000e-03 -8.2993e+00 1.4151e-01 8.5849e-01 9.0854e-01 9.1461e-02 1.0000e-10 1.0000e-10 6.6029e-04 4.0057e-03
|
||||
6.0000e-03 -8.3118e+00 1.3751e-01 8.6249e-01 9.0539e-01 9.4606e-02 1.0000e-10 1.0000e-10 7.9428e-04 4.9819e-03
|
||||
7.0000e-03 -8.3236e+00 1.3383e-01 8.6617e-01 9.0233e-01 9.7673e-02 1.0000e-10 1.0000e-10 9.2071e-04 5.9590e-03
|
||||
8.0000e-03 -8.3349e+00 1.3043e-01 8.6957e-01 8.9933e-01 1.0067e-01 1.0000e-10 1.0000e-10 1.0405e-03 6.9369e-03
|
||||
9.0000e-03 -8.3456e+00 1.2726e-01 8.7274e-01 8.9640e-01 1.0360e-01 1.0000e-10 1.0000e-10 1.1543e-03 7.9155e-03
|
||||
1.0000e-02 -8.3559e+00 1.2431e-01 8.7569e-01 8.9352e-01 1.0648e-01 1.0000e-10 1.0000e-10 1.2627e-03 8.8947e-03
|
||||
1.1000e-02 -8.3658e+00 1.2155e-01 8.7845e-01 8.9070e-01 1.0930e-01 1.0000e-10 1.0000e-10 1.3663e-03 9.8746e-03
|
||||
1.2000e-02 -8.3752e+00 1.1895e-01 8.8105e-01 8.8792e-01 1.1208e-01 1.0000e-10 1.0000e-10 1.4655e-03 1.0855e-02
|
||||
1.3000e-02 -8.3843e+00 1.1650e-01 8.8350e-01 8.8519e-01 1.1481e-01 1.0000e-10 1.0000e-10 1.5607e-03 1.1836e-02
|
||||
1.4000e-02 -8.3931e+00 1.1419e-01 8.8581e-01 8.8251e-01 1.1749e-01 1.0000e-10 1.0000e-10 1.6522e-03 1.2817e-02
|
||||
1.5000e-02 -8.4016e+00 1.1199e-01 8.8801e-01 8.7986e-01 1.2014e-01 1.0000e-10 1.0000e-10 1.7403e-03 1.3799e-02
|
||||
1.6000e-02 -8.4098e+00 1.0991e-01 8.9009e-01 8.7725e-01 1.2275e-01 1.0000e-10 1.0000e-10 1.8252e-03 1.4781e-02
|
||||
1.7000e-02 -8.4178e+00 1.0793e-01 8.9207e-01 8.7468e-01 1.2532e-01 1.0000e-10 1.0000e-10 1.9072e-03 1.5764e-02
|
||||
1.8000e-02 -8.4254e+00 1.0604e-01 8.9396e-01 8.7214e-01 1.2786e-01 1.0000e-10 1.0000e-10 1.9864e-03 1.6746e-02
|
||||
1.9000e-02 -8.4329e+00 1.0423e-01 8.9577e-01 8.6963e-01 1.3037e-01 1.0000e-10 1.0000e-10 2.0631e-03 1.7730e-02
|
||||
2.0000e-02 -8.4401e+00 1.0251e-01 8.9749e-01 8.6716e-01 1.3284e-01 1.0000e-10 1.0000e-10 2.1374e-03 1.8713e-02
|
||||
2.1000e-02 -8.4472e+00 1.0086e-01 8.9914e-01 8.6471e-01 1.3529e-01 1.0000e-10 1.0000e-10 2.2094e-03 1.9697e-02
|
||||
2.2000e-02 -8.4540e+00 9.9270e-02 9.0073e-01 8.6230e-01 1.3770e-01 1.0000e-10 1.0000e-10 2.2793e-03 2.0681e-02
|
||||
2.3000e-02 -8.4607e+00 9.7747e-02 9.0225e-01 8.5991e-01 1.4009e-01 1.0000e-10 1.0000e-10 2.3472e-03 2.1666e-02
|
||||
2.4000e-02 -8.4672e+00 9.6283e-02 9.0372e-01 8.5754e-01 1.4246e-01 1.0000e-10 1.0000e-10 2.4132e-03 2.2650e-02
|
||||
2.5000e-02 -8.4735e+00 9.4874e-02 9.0513e-01 8.5520e-01 1.4480e-01 1.0000e-10 1.0000e-10 2.4774e-03 2.3635e-02
|
||||
2.6000e-02 -8.4797e+00 9.3517e-02 9.0648e-01 8.5289e-01 1.4711e-01 1.0000e-10 1.0000e-10 2.5400e-03 2.4621e-02
|
||||
2.7000e-02 -8.4857e+00 9.2208e-02 9.0779e-01 8.5060e-01 1.4940e-01 1.0000e-10 1.0000e-10 2.6009e-03 2.5606e-02
|
||||
2.8000e-02 -8.4915e+00 9.0944e-02 9.0906e-01 8.4833e-01 1.5167e-01 1.0000e-10 1.0000e-10 2.6603e-03 2.6592e-02
|
||||
2.9000e-02 -8.4973e+00 8.9723e-02 9.1028e-01 8.4608e-01 1.5392e-01 1.0000e-10 1.0000e-10 2.7182e-03 2.7578e-02
|
||||
3.0000e-02 -8.5029e+00 8.8542e-02 9.1146e-01 8.4386e-01 1.5614e-01 1.0000e-10 1.0000e-10 2.7748e-03 2.8564e-02
|
||||
3.1000e-02 -8.5084e+00 8.7400e-02 9.1260e-01 8.4166e-01 1.5834e-01 1.0000e-10 1.0000e-10 2.8300e-03 2.9550e-02
|
||||
3.2000e-02 -8.5137e+00 8.6294e-02 9.1371e-01 8.3947e-01 1.6053e-01 1.0000e-10 1.0000e-10 2.8840e-03 3.0536e-02
|
||||
3.3000e-02 -8.5190e+00 8.5221e-02 9.1478e-01 8.3731e-01 1.6269e-01 1.0000e-10 1.0000e-10 2.9367e-03 3.1523e-02
|
||||
3.4000e-02 -8.5241e+00 8.4182e-02 9.1582e-01 8.3516e-01 1.6484e-01 1.0000e-10 1.0000e-10 2.9883e-03 3.2510e-02
|
||||
3.5000e-02 -8.5292e+00 8.3173e-02 9.1683e-01 8.3304e-01 1.6696e-01 1.0000e-10 1.0000e-10 3.0388e-03 3.3497e-02
|
||||
3.6000e-02 -8.5341e+00 8.2193e-02 9.1781e-01 8.3093e-01 1.6907e-01 1.0000e-10 1.0000e-10 3.0882e-03 3.4484e-02
|
||||
3.7000e-02 -8.5390e+00 8.1241e-02 9.1876e-01 8.2884e-01 1.7116e-01 1.0000e-10 1.0000e-10 3.1366e-03 3.5472e-02
|
||||
3.8000e-02 -8.5437e+00 8.0316e-02 9.1968e-01 8.2677e-01 1.7323e-01 1.0000e-10 1.0000e-10 3.1840e-03 3.6459e-02
|
||||
3.9000e-02 -8.5484e+00 7.9416e-02 9.2058e-01 8.2471e-01 1.7529e-01 1.0000e-10 1.0000e-10 3.2304e-03 3.7447e-02
|
||||
4.0000e-02 -8.5529e+00 7.8540e-02 9.2146e-01 8.2267e-01 1.7733e-01 1.0000e-10 1.0000e-10 3.2760e-03 3.8435e-02
|
||||
4.1000e-02 -8.5574e+00 7.7688e-02 9.2231e-01 8.2065e-01 1.7935e-01 1.0000e-10 1.0000e-10 3.3206e-03 3.9423e-02
|
||||
4.2000e-02 -8.5618e+00 7.6857e-02 9.2314e-01 8.1865e-01 1.8135e-01 1.0000e-10 1.0000e-10 3.3645e-03 4.0411e-02
|
||||
4.3000e-02 -8.5662e+00 7.6048e-02 9.2395e-01 8.1665e-01 1.8335e-01 1.0000e-10 1.0000e-10 3.4075e-03 4.1399e-02
|
||||
4.4000e-02 -8.5704e+00 7.5259e-02 9.2474e-01 8.1468e-01 1.8532e-01 1.0000e-10 1.0000e-10 3.4497e-03 4.2388e-02
|
||||
4.5000e-02 -8.5746e+00 7.4489e-02 9.2551e-01 8.1272e-01 1.8728e-01 1.0000e-10 1.0000e-10 3.4911e-03 4.3376e-02
|
||||
4.6000e-02 -8.5787e+00 7.3738e-02 9.2626e-01 8.1077e-01 1.8923e-01 1.0000e-10 1.0000e-10 3.5318e-03 4.4365e-02
|
||||
4.7000e-02 -8.5827e+00 7.3005e-02 9.2699e-01 8.0884e-01 1.9116e-01 1.0000e-10 1.0000e-10 3.5718e-03 4.5354e-02
|
||||
4.8000e-02 -8.5867e+00 7.2290e-02 9.2771e-01 8.0692e-01 1.9308e-01 1.0000e-10 1.0000e-10 3.6111e-03 4.6343e-02
|
||||
4.9000e-02 -8.5906e+00 7.1590e-02 9.2841e-01 8.0502e-01 1.9498e-01 1.0000e-10 1.0000e-10 3.6498e-03 4.7332e-02
|
||||
5.0000e-02 -8.5945e+00 7.0907e-02 9.2909e-01 8.0313e-01 1.9687e-01 1.0000e-10 1.0000e-10 3.6878e-03 4.8321e-02
|
||||
5.1000e-02 -8.5982e+00 7.0239e-02 9.2976e-01 8.0125e-01 1.9875e-01 1.0000e-10 1.0000e-10 3.7252e-03 4.9310e-02
|
||||
5.2000e-02 -8.6020e+00 6.9586e-02 9.3041e-01 7.9939e-01 2.0061e-01 1.0000e-10 1.0000e-10 3.7619e-03 5.0300e-02
|
||||
5.3000e-02 -8.6056e+00 6.8947e-02 9.3105e-01 7.9753e-01 2.0247e-01 1.0000e-10 1.0000e-10 3.7981e-03 5.1289e-02
|
||||
5.4000e-02 -8.6092e+00 6.8322e-02 9.3168e-01 7.9570e-01 2.0430e-01 1.0000e-10 1.0000e-10 3.8337e-03 5.2279e-02
|
||||
5.5000e-02 -8.6128e+00 6.7710e-02 9.3229e-01 7.9387e-01 2.0613e-01 1.0000e-10 1.0000e-10 3.8688e-03 5.3269e-02
|
||||
5.6000e-02 -8.6163e+00 6.7111e-02 9.3289e-01 7.9206e-01 2.0794e-01 1.0000e-10 1.0000e-10 3.9033e-03 5.4258e-02
|
||||
5.7000e-02 -8.6198e+00 6.6524e-02 9.3348e-01 7.9026e-01 2.0974e-01 1.0000e-10 1.0000e-10 3.9373e-03 5.5248e-02
|
||||
5.8000e-02 -8.6232e+00 6.5950e-02 9.3405e-01 7.8847e-01 2.1153e-01 1.0000e-10 1.0000e-10 3.9708e-03 5.6238e-02
|
||||
5.9000e-02 -8.6265e+00 6.5386e-02 9.3461e-01 7.8669e-01 2.1331e-01 1.0000e-10 1.0000e-10 4.0037e-03 5.7228e-02
|
||||
6.0000e-02 -8.6298e+00 6.4834e-02 9.3517e-01 7.8492e-01 2.1508e-01 1.0000e-10 1.0000e-10 4.0362e-03 5.8219e-02
|
||||
6.1000e-02 -8.6331e+00 6.4293e-02 9.3571e-01 7.8317e-01 2.1683e-01 1.0000e-10 1.0000e-10 4.0683e-03 5.9209e-02
|
||||
6.2000e-02 -8.6363e+00 6.3762e-02 9.3624e-01 7.8142e-01 2.1858e-01 1.0000e-10 1.0000e-10 4.0999e-03 6.0199e-02
|
||||
6.3000e-02 -8.6395e+00 6.3242e-02 9.3676e-01 7.7969e-01 2.2031e-01 1.0000e-10 1.0000e-10 4.1310e-03 6.1190e-02
|
||||
6.4000e-02 -8.6426e+00 6.2731e-02 9.3727e-01 7.7797e-01 2.2203e-01 1.0000e-10 1.0000e-10 4.1617e-03 6.2180e-02
|
||||
6.5000e-02 -8.6457e+00 6.2230e-02 9.3777e-01 7.7626e-01 2.2374e-01 1.0000e-10 1.0000e-10 4.1920e-03 6.3171e-02
|
||||
6.6000e-02 -8.6487e+00 6.1738e-02 9.3826e-01 7.7456e-01 2.2544e-01 1.0000e-10 1.0000e-10 4.2218e-03 6.4162e-02
|
||||
6.7000e-02 -8.6517e+00 6.1255e-02 9.3875e-01 7.7287e-01 2.2713e-01 1.0000e-10 1.0000e-10 4.2513e-03 6.5153e-02
|
||||
6.8000e-02 -8.6547e+00 6.0780e-02 9.3922e-01 7.7119e-01 2.2881e-01 1.0000e-10 1.0000e-10 4.2804e-03 6.6144e-02
|
||||
6.9000e-02 -8.6576e+00 6.0314e-02 9.3969e-01 7.6952e-01 2.3048e-01 1.0000e-10 1.0000e-10 4.3091e-03 6.7135e-02
|
||||
7.0000e-02 -8.6605e+00 5.9857e-02 9.4014e-01 7.6786e-01 2.3214e-01 1.0000e-10 1.0000e-10 4.3374e-03 6.8126e-02
|
||||
7.1000e-02 -8.6634e+00 5.9407e-02 9.4059e-01 7.6621e-01 2.3379e-01 1.0000e-10 1.0000e-10 4.3654e-03 6.9117e-02
|
||||
7.2000e-02 -8.6662e+00 5.8965e-02 9.4103e-01 7.6457e-01 2.3543e-01 1.0000e-10 1.0000e-10 4.3930e-03 7.0108e-02
|
||||
7.3000e-02 -8.6690e+00 5.8531e-02 9.4147e-01 7.6294e-01 2.3706e-01 1.0000e-10 1.0000e-10 4.4202e-03 7.1099e-02
|
||||
7.4000e-02 -8.6718e+00 5.8104e-02 9.4190e-01 7.6132e-01 2.3868e-01 1.0000e-10 1.0000e-10 4.4471e-03 7.2091e-02
|
||||
7.5000e-02 -8.6745e+00 5.7684e-02 9.4232e-01 7.5970e-01 2.4030e-01 1.0000e-10 1.0000e-10 4.4737e-03 7.3082e-02
|
||||
7.6000e-02 -8.6772e+00 5.7271e-02 9.4273e-01 7.5810e-01 2.4190e-01 1.0000e-10 1.0000e-10 4.5000e-03 7.4074e-02
|
||||
7.7000e-02 -8.6798e+00 5.6864e-02 9.4314e-01 7.5651e-01 2.4349e-01 1.0000e-10 1.0000e-10 4.5259e-03 7.5065e-02
|
||||
7.8000e-02 -8.6824e+00 5.6465e-02 9.4354e-01 7.5492e-01 2.4508e-01 1.0000e-10 1.0000e-10 4.5515e-03 7.6057e-02
|
||||
7.9000e-02 -8.6850e+00 5.6071e-02 9.4393e-01 7.5335e-01 2.4665e-01 1.0000e-10 1.0000e-10 4.5769e-03 7.7049e-02
|
||||
8.0000e-02 -8.6876e+00 5.5684e-02 9.4432e-01 7.5178e-01 2.4822e-01 1.0000e-10 1.0000e-10 4.6019e-03 7.8040e-02
|
||||
8.1000e-02 -8.6901e+00 5.5303e-02 9.4470e-01 7.5023e-01 2.4977e-01 1.0000e-10 1.0000e-10 4.6266e-03 7.9032e-02
|
||||
8.2000e-02 -8.6926e+00 5.4928e-02 9.4507e-01 7.4868e-01 2.5132e-01 1.0000e-10 1.0000e-10 4.6511e-03 8.0024e-02
|
||||
8.3000e-02 -8.6951e+00 5.4559e-02 9.4544e-01 7.4714e-01 2.5286e-01 1.0000e-10 1.0000e-10 4.6752e-03 8.1016e-02
|
||||
8.4000e-02 -8.6976e+00 5.4196e-02 9.4580e-01 7.4560e-01 2.5440e-01 1.0000e-10 1.0000e-10 4.6991e-03 8.2008e-02
|
||||
8.5000e-02 -8.7000e+00 5.3837e-02 9.4616e-01 7.4408e-01 2.5592e-01 1.0000e-10 1.0000e-10 4.7228e-03 8.3000e-02
|
||||
8.6000e-02 -8.7024e+00 5.3485e-02 9.4652e-01 7.4256e-01 2.5744e-01 1.0000e-10 1.0000e-10 4.7461e-03 8.3992e-02
|
||||
8.7000e-02 -8.7047e+00 5.3137e-02 9.4686e-01 7.4106e-01 2.5894e-01 1.0000e-10 1.0000e-10 4.7693e-03 8.4984e-02
|
||||
8.8000e-02 -8.7071e+00 5.2795e-02 9.4721e-01 7.3956e-01 2.6044e-01 1.0000e-10 1.0000e-10 4.7921e-03 8.5977e-02
|
||||
8.9000e-02 -8.7094e+00 5.2457e-02 9.4754e-01 7.3807e-01 2.6193e-01 1.0000e-10 1.0000e-10 4.8147e-03 8.6969e-02
|
||||
9.0000e-02 -8.7117e+00 5.2125e-02 9.4788e-01 7.3658e-01 2.6342e-01 1.0000e-10 1.0000e-10 4.8371e-03 8.7961e-02
|
||||
9.1000e-02 -8.7140e+00 5.1797e-02 9.4820e-01 7.3511e-01 2.6489e-01 1.0000e-10 1.0000e-10 4.8592e-03 8.8954e-02
|
||||
9.2000e-02 -8.7162e+00 5.1474e-02 9.4853e-01 7.3364e-01 2.6636e-01 1.0000e-10 1.0000e-10 4.8811e-03 8.9946e-02
|
||||
9.3000e-02 -8.7185e+00 5.1155e-02 9.4884e-01 7.3218e-01 2.6782e-01 1.0000e-10 1.0000e-10 4.9028e-03 9.0939e-02
|
||||
9.4000e-02 -8.7207e+00 5.0841e-02 9.4916e-01 7.3073e-01 2.6927e-01 1.0000e-10 1.0000e-10 4.9243e-03 9.1932e-02
|
||||
9.5000e-02 -8.7228e+00 5.0531e-02 9.4947e-01 7.2928e-01 2.7072e-01 1.0000e-10 1.0000e-10 4.9455e-03 9.2924e-02
|
||||
9.6000e-02 -8.7250e+00 5.0226e-02 9.4977e-01 7.2784e-01 2.7216e-01 1.0000e-10 1.0000e-10 4.9665e-03 9.3917e-02
|
||||
9.7000e-02 -8.7271e+00 4.9924e-02 9.5008e-01 7.2641e-01 2.7359e-01 1.0000e-10 1.0000e-10 4.9873e-03 9.4910e-02
|
||||
9.8000e-02 -8.7292e+00 4.9627e-02 9.5037e-01 7.2499e-01 2.7501e-01 1.0000e-10 1.0000e-10 5.0079e-03 9.5903e-02
|
||||
9.9000e-02 -8.7313e+00 4.9334e-02 9.5067e-01 7.2357e-01 2.7643e-01 1.0000e-10 1.0000e-10 5.0283e-03 9.6895e-02
|
||||
1.0000e-01 -8.7334e+00 4.9044e-02 9.5096e-01 7.2216e-01 2.7784e-01 1.0000e-10 1.0000e-10 5.0485e-03 9.7888e-02
|
||||
1.0000e-01 -8.7334e+00 4.9044e-02 9.5096e-01 7.2216e-01 2.7784e-01 1.0000e-10 1.0000e-10 5.0485e-03 9.7888e-02
|
||||
2.0000e-01 -8.8746e+00 3.1529e-02 9.6847e-01 6.0843e-01 3.9157e-01 1.0000e-10 1.0000e-10 6.4250e-03 1.9735e-01
|
||||
3.0000e-01 -8.9515e+00 2.3611e-02 9.7639e-01 5.2912e-01 4.7088e-01 1.0000e-10 1.0000e-10 7.1824e-03 2.9701e-01
|
||||
4.0000e-01 -9.0015e+00 1.8992e-02 9.8101e-01 4.6954e-01 5.3046e-01 1.0000e-10 1.0000e-10 7.6814e-03 3.9677e-01
|
||||
5.0000e-01 -9.0371e+00 1.5935e-02 9.8407e-01 4.2272e-01 5.7728e-01 1.0000e-10 1.0000e-10 8.0411e-03 4.9659e-01
|
||||
6.0000e-01 -9.0640e+00 1.3750e-02 9.8625e-01 3.8479e-01 6.1521e-01 1.0000e-10 1.0000e-10 8.3153e-03 5.9645e-01
|
||||
7.0000e-01 -9.0851e+00 1.2105e-02 9.8790e-01 3.5335e-01 6.4665e-01 1.0000e-10 1.0000e-10 8.5323e-03 6.9633e-01
|
||||
8.0000e-01 -9.1022e+00 1.0819e-02 9.8918e-01 3.2680e-01 6.7320e-01 1.0000e-10 1.0000e-10 8.7090e-03 7.9623e-01
|
||||
9.0000e-01 -9.1162e+00 9.7855e-03 9.9021e-01 3.0406e-01 6.9594e-01 1.0000e-10 1.0000e-10 8.8560e-03 8.9615e-01
|
||||
1.0000e+00 -9.1281e+00 8.9352e-03 9.9106e-01 2.8435e-01 7.1565e-01 1.0000e-10 1.0000e-10 8.9804e-03 9.9608e-01
|
||||
1.1000e+00 -9.1382e+00 8.2229e-03 9.9178e-01 2.6708e-01 7.3292e-01 1.0000e-10 1.0000e-10 9.0872e-03 1.0960e+00
|
||||
1.2000e+00 -9.1470e+00 7.6172e-03 9.9238e-01 2.5183e-01 7.4817e-01 1.0000e-10 1.0000e-10 9.1799e-03 1.1960e+00
|
||||
1.3000e+00 -9.1547e+00 7.0957e-03 9.9290e-01 2.3825e-01 7.6175e-01 1.0000e-10 1.0000e-10 9.2612e-03 1.2959e+00
|
||||
1.4000e+00 -9.1614e+00 6.6418e-03 9.9336e-01 2.2608e-01 7.7392e-01 1.0000e-10 1.0000e-10 9.3332e-03 1.3959e+00
|
||||
1.5000e+00 -9.1674e+00 6.2431e-03 9.9376e-01 2.1511e-01 7.8489e-01 1.0000e-10 1.0000e-10 9.3973e-03 1.4958e+00
|
||||
1.6000e+00 -9.1728e+00 5.8899e-03 9.9411e-01 2.0516e-01 7.9484e-01 1.0000e-10 1.0000e-10 9.4548e-03 1.5958e+00
|
||||
1.7000e+00 -9.1776e+00 5.5749e-03 9.9443e-01 1.9610e-01 8.0390e-01 1.0000e-10 1.0000e-10 9.5068e-03 1.6958e+00
|
||||
1.8000e+00 -9.1820e+00 5.2921e-03 9.9471e-01 1.8782e-01 8.1218e-01 1.0000e-10 1.0000e-10 9.5539e-03 1.7957e+00
|
||||
1.9000e+00 -9.1860e+00 5.0369e-03 9.9496e-01 1.8021e-01 8.1979e-01 1.0000e-10 1.0000e-10 9.5968e-03 1.8957e+00
|
||||
2.0000e+00 -9.1896e+00 4.8052e-03 9.9519e-01 1.7320e-01 8.2680e-01 1.0000e-10 1.0000e-10 9.6361e-03 1.9957e+00
|
||||
2.1000e+00 -9.1929e+00 4.5941e-03 9.9541e-01 1.6672e-01 8.3328e-01 1.0000e-10 1.0000e-10 9.6722e-03 2.0957e+00
|
||||
2.2000e+00 -9.1960e+00 4.4009e-03 9.9560e-01 1.6071e-01 8.3929e-01 1.0000e-10 1.0000e-10 9.7055e-03 2.1957e+00
|
||||
2.3000e+00 -9.1988e+00 4.2233e-03 9.9578e-01 1.5512e-01 8.4488e-01 1.0000e-10 1.0000e-10 9.7364e-03 2.2956e+00
|
||||
2.4000e+00 -9.2015e+00 4.0596e-03 9.9594e-01 1.4990e-01 8.5010e-01 1.0000e-10 1.0000e-10 9.7650e-03 2.3956e+00
|
||||
2.5000e+00 -9.2039e+00 3.9082e-03 9.9609e-01 1.4503e-01 8.5497e-01 1.0000e-10 1.0000e-10 9.7916e-03 2.4956e+00
|
||||
2.6000e+00 -9.2062e+00 3.7677e-03 9.9623e-01 1.4047e-01 8.5953e-01 1.0000e-10 1.0000e-10 9.8164e-03 2.5956e+00
|
||||
2.7000e+00 -9.2083e+00 3.6370e-03 9.9636e-01 1.3618e-01 8.6382e-01 1.0000e-10 1.0000e-10 9.8396e-03 2.6956e+00
|
||||
2.8000e+00 -9.2103e+00 3.5151e-03 9.9648e-01 1.3216e-01 8.6784e-01 1.0000e-10 1.0000e-10 9.8614e-03 2.7956e+00
|
||||
2.9000e+00 -9.2122e+00 3.4011e-03 9.9660e-01 1.2836e-01 8.7164e-01 1.0000e-10 1.0000e-10 9.8818e-03 2.8955e+00
|
||||
3.0000e+00 -9.2139e+00 3.2944e-03 9.9671e-01 1.2478e-01 8.7522e-01 1.0000e-10 1.0000e-10 9.9010e-03 2.9955e+00
|
||||
3.1000e+00 -9.2156e+00 3.1941e-03 9.9681e-01 1.2139e-01 8.7861e-01 1.0000e-10 1.0000e-10 9.9191e-03 3.0955e+00
|
||||
3.2000e+00 -9.2171e+00 3.0998e-03 9.9690e-01 1.1818e-01 8.8182e-01 1.0000e-10 1.0000e-10 9.9363e-03 3.1955e+00
|
||||
3.3000e+00 -9.2186e+00 3.0109e-03 9.9699e-01 1.1514e-01 8.8486e-01 1.0000e-10 1.0000e-10 9.9524e-03 3.2955e+00
|
||||
3.4000e+00 -9.2200e+00 2.9270e-03 9.9707e-01 1.1225e-01 8.8775e-01 1.0000e-10 1.0000e-10 9.9678e-03 3.3955e+00
|
||||
3.5000e+00 -9.2213e+00 2.8476e-03 9.9715e-01 1.0950e-01 8.9050e-01 1.0000e-10 1.0000e-10 9.9823e-03 3.4955e+00
|
||||
3.6000e+00 -9.2226e+00 2.7725e-03 9.9723e-01 1.0688e-01 8.9312e-01 1.0000e-10 1.0000e-10 9.9961e-03 3.5955e+00
|
||||
3.7000e+00 -9.2238e+00 2.7012e-03 9.9730e-01 1.0439e-01 8.9561e-01 1.0000e-10 1.0000e-10 1.0009e-02 3.6955e+00
|
||||
3.8000e+00 -9.2249e+00 2.6335e-03 9.9737e-01 1.0201e-01 8.9799e-01 1.0000e-10 1.0000e-10 1.0022e-02 3.7955e+00
|
||||
3.9000e+00 -9.2260e+00 2.5691e-03 9.9743e-01 9.9738e-02 9.0026e-01 1.0000e-10 1.0000e-10 1.0034e-02 3.8955e+00
|
||||
4.0000e+00 -9.2270e+00 2.5078e-03 9.9749e-01 9.7564e-02 9.0244e-01 1.0000e-10 1.0000e-10 1.0045e-02 3.9954e+00
|
||||
4.1000e+00 -9.2280e+00 2.4494e-03 9.9755e-01 9.5483e-02 9.0452e-01 1.0000e-10 1.0000e-10 1.0056e-02 4.0954e+00
|
||||
4.2000e+00 -9.2289e+00 2.3936e-03 9.9761e-01 9.3489e-02 9.0651e-01 1.0000e-10 1.0000e-10 1.0066e-02 4.1954e+00
|
||||
4.3000e+00 -9.2298e+00 2.3404e-03 9.9766e-01 9.1577e-02 9.0842e-01 1.0000e-10 1.0000e-10 1.0076e-02 4.2954e+00
|
||||
4.4000e+00 -9.2307e+00 2.2894e-03 9.9771e-01 8.9742e-02 9.1026e-01 1.0000e-10 1.0000e-10 1.0086e-02 4.3954e+00
|
||||
4.5000e+00 -9.2315e+00 2.2406e-03 9.9776e-01 8.7979e-02 9.1202e-01 1.0000e-10 1.0000e-10 1.0095e-02 4.4954e+00
|
||||
4.6000e+00 -9.2323e+00 2.1939e-03 9.9781e-01 8.6284e-02 9.1372e-01 1.0000e-10 1.0000e-10 1.0104e-02 4.5954e+00
|
||||
4.7000e+00 -9.2331e+00 2.1491e-03 9.9785e-01 8.4653e-02 9.1535e-01 1.0000e-10 1.0000e-10 1.0112e-02 4.6954e+00
|
||||
4.8000e+00 -9.2338e+00 2.1060e-03 9.9789e-01 8.3083e-02 9.1692e-01 1.0000e-10 1.0000e-10 1.0121e-02 4.7954e+00
|
||||
4.9000e+00 -9.2345e+00 2.0647e-03 9.9794e-01 8.1570e-02 9.1843e-01 1.0000e-10 1.0000e-10 1.0128e-02 4.8954e+00
|
||||
5.0000e+00 -9.2352e+00 2.0249e-03 9.9798e-01 8.0112e-02 9.1989e-01 1.0000e-10 1.0000e-10 1.0136e-02 4.9954e+00
|
||||
5.1000e+00 -9.2359e+00 1.9867e-03 9.9801e-01 7.8704e-02 9.2130e-01 1.0000e-10 1.0000e-10 1.0143e-02 5.0954e+00
|
||||
5.2000e+00 -9.2365e+00 1.9499e-03 9.9805e-01 7.7346e-02 9.2265e-01 1.0000e-10 1.0000e-10 1.0150e-02 5.1954e+00
|
||||
5.3000e+00 -9.2371e+00 1.9144e-03 9.9809e-01 7.6033e-02 9.2397e-01 1.0000e-10 1.0000e-10 1.0157e-02 5.2954e+00
|
||||
5.4000e+00 -9.2377e+00 1.8802e-03 9.9812e-01 7.4765e-02 9.2524e-01 1.0000e-10 1.0000e-10 1.0163e-02 5.3954e+00
|
||||
5.5000e+00 -9.2383e+00 1.8472e-03 9.9815e-01 7.3538e-02 9.2646e-01 1.0000e-10 1.0000e-10 1.0170e-02 5.4954e+00
|
||||
5.6000e+00 -9.2388e+00 1.8153e-03 9.9818e-01 7.2350e-02 9.2765e-01 1.0000e-10 1.0000e-10 1.0176e-02 5.5954e+00
|
||||
5.7000e+00 -9.2393e+00 1.7845e-03 9.9822e-01 7.1201e-02 9.2880e-01 1.0000e-10 1.0000e-10 1.0182e-02 5.6954e+00
|
||||
5.8000e+00 -9.2398e+00 1.7548e-03 9.9825e-01 7.0087e-02 9.2991e-01 1.0000e-10 1.0000e-10 1.0187e-02 5.7954e+00
|
||||
5.9000e+00 -9.2403e+00 1.7260e-03 9.9827e-01 6.9008e-02 9.3099e-01 1.0000e-10 1.0000e-10 1.0193e-02 5.8954e+00
|
||||
6.0000e+00 -9.2408e+00 1.6982e-03 9.9830e-01 6.7962e-02 9.3204e-01 1.0000e-10 1.0000e-10 1.0198e-02 5.9954e+00
|
||||
6.1000e+00 -9.2413e+00 1.6712e-03 9.9833e-01 6.6947e-02 9.3305e-01 1.0000e-10 1.0000e-10 1.0204e-02 6.0953e+00
|
||||
6.2000e+00 -9.2417e+00 1.6451e-03 9.9835e-01 6.5961e-02 9.3404e-01 1.0000e-10 1.0000e-10 1.0209e-02 6.1953e+00
|
||||
6.3000e+00 -9.2422e+00 1.6198e-03 9.9838e-01 6.5005e-02 9.3500e-01 1.0000e-10 1.0000e-10 1.0213e-02 6.2953e+00
|
||||
6.4000e+00 -9.2426e+00 1.5952e-03 9.9840e-01 6.4076e-02 9.3592e-01 1.0000e-10 1.0000e-10 1.0218e-02 6.3953e+00
|
||||
6.5000e+00 -9.2430e+00 1.5714e-03 9.9843e-01 6.3173e-02 9.3683e-01 1.0000e-10 1.0000e-10 1.0223e-02 6.4953e+00
|
||||
6.6000e+00 -9.2434e+00 1.5483e-03 9.9845e-01 6.2295e-02 9.3771e-01 1.0000e-10 1.0000e-10 1.0227e-02 6.5953e+00
|
||||
6.7000e+00 -9.2438e+00 1.5258e-03 9.9847e-01 6.1441e-02 9.3856e-01 1.0000e-10 1.0000e-10 1.0232e-02 6.6953e+00
|
||||
6.8000e+00 -9.2442e+00 1.5040e-03 9.9850e-01 6.0610e-02 9.3939e-01 1.0000e-10 1.0000e-10 1.0236e-02 6.7953e+00
|
||||
6.9000e+00 -9.2446e+00 1.4829e-03 9.9852e-01 5.9802e-02 9.4020e-01 1.0000e-10 1.0000e-10 1.0240e-02 6.8953e+00
|
||||
7.0000e+00 -9.2449e+00 1.4623e-03 9.9854e-01 5.9015e-02 9.4099e-01 1.0000e-10 1.0000e-10 1.0244e-02 6.9953e+00
|
||||
7.1000e+00 -9.2453e+00 1.4422e-03 9.9856e-01 5.8248e-02 9.4175e-01 1.0000e-10 1.0000e-10 1.0248e-02 7.0953e+00
|
||||
7.2000e+00 -9.2456e+00 1.4227e-03 9.9858e-01 5.7501e-02 9.4250e-01 1.0000e-10 1.0000e-10 1.0252e-02 7.1953e+00
|
||||
7.3000e+00 -9.2459e+00 1.4038e-03 9.9860e-01 5.6773e-02 9.4323e-01 1.0000e-10 1.0000e-10 1.0255e-02 7.2953e+00
|
||||
7.4000e+00 -9.2463e+00 1.3853e-03 9.9861e-01 5.6063e-02 9.4394e-01 1.0000e-10 1.0000e-10 1.0259e-02 7.3953e+00
|
||||
7.5000e+00 -9.2466e+00 1.3673e-03 9.9863e-01 5.5370e-02 9.4463e-01 1.0000e-10 1.0000e-10 1.0262e-02 7.4953e+00
|
||||
7.6000e+00 -9.2469e+00 1.3498e-03 9.9865e-01 5.4695e-02 9.4530e-01 1.0000e-10 1.0000e-10 1.0266e-02 7.5953e+00
|
||||
7.7000e+00 -9.2472e+00 1.3327e-03 9.9867e-01 5.4036e-02 9.4596e-01 1.0000e-10 1.0000e-10 1.0269e-02 7.6953e+00
|
||||
7.8000e+00 -9.2475e+00 1.3160e-03 9.9868e-01 5.3392e-02 9.4661e-01 1.0000e-10 1.0000e-10 1.0273e-02 7.7953e+00
|
||||
7.9000e+00 -9.2478e+00 1.2998e-03 9.9870e-01 5.2764e-02 9.4724e-01 1.0000e-10 1.0000e-10 1.0276e-02 7.8953e+00
|
||||
8.0000e+00 -9.2480e+00 1.2840e-03 9.9872e-01 5.2150e-02 9.4785e-01 1.0000e-10 1.0000e-10 1.0279e-02 7.9953e+00
|
||||
8.1000e+00 -9.2483e+00 1.2685e-03 9.9873e-01 5.1551e-02 9.4845e-01 1.0000e-10 1.0000e-10 1.0282e-02 8.0953e+00
|
||||
8.2000e+00 -9.2486e+00 1.2534e-03 9.9875e-01 5.0965e-02 9.4903e-01 1.0000e-10 1.0000e-10 1.0285e-02 8.1953e+00
|
||||
8.3000e+00 -9.2488e+00 1.2386e-03 9.9876e-01 5.0392e-02 9.4961e-01 1.0000e-10 1.0000e-10 1.0288e-02 8.2953e+00
|
||||
8.4000e+00 -9.2491e+00 1.2242e-03 9.9878e-01 4.9832e-02 9.5017e-01 1.0000e-10 1.0000e-10 1.0290e-02 8.3953e+00
|
||||
8.5000e+00 -9.2493e+00 1.2102e-03 9.9879e-01 4.9285e-02 9.5072e-01 1.0000e-10 1.0000e-10 1.0293e-02 8.4953e+00
|
||||
8.6000e+00 -9.2496e+00 1.1964e-03 9.9880e-01 4.8749e-02 9.5125e-01 1.0000e-10 1.0000e-10 1.0296e-02 8.5953e+00
|
||||
8.7000e+00 -9.2498e+00 1.1830e-03 9.9882e-01 4.8225e-02 9.5178e-01 1.0000e-10 1.0000e-10 1.0299e-02 8.6953e+00
|
||||
8.8000e+00 -9.2500e+00 1.1698e-03 9.9883e-01 4.7712e-02 9.5229e-01 1.0000e-10 1.0000e-10 1.0301e-02 8.7953e+00
|
||||
8.9000e+00 -9.2503e+00 1.1570e-03 9.9884e-01 4.7209e-02 9.5279e-01 1.0000e-10 1.0000e-10 1.0304e-02 8.8953e+00
|
||||
9.0000e+00 -9.2505e+00 1.1444e-03 9.9886e-01 4.6718e-02 9.5328e-01 1.0000e-10 1.0000e-10 1.0306e-02 8.9953e+00
|
||||
9.1000e+00 -9.2507e+00 1.1321e-03 9.9887e-01 4.6236e-02 9.5376e-01 1.0000e-10 1.0000e-10 1.0309e-02 9.0953e+00
|
||||
9.2000e+00 -9.2509e+00 1.1201e-03 9.9888e-01 4.5764e-02 9.5424e-01 1.0000e-10 1.0000e-10 1.0311e-02 9.1953e+00
|
||||
9.3000e+00 -9.2511e+00 1.1083e-03 9.9889e-01 4.5302e-02 9.5470e-01 1.0000e-10 1.0000e-10 1.0313e-02 9.2953e+00
|
||||
9.4000e+00 -9.2513e+00 1.0967e-03 9.9890e-01 4.4849e-02 9.5515e-01 1.0000e-10 1.0000e-10 1.0316e-02 9.3953e+00
|
||||
9.5000e+00 -9.2515e+00 1.0854e-03 9.9891e-01 4.4405e-02 9.5560e-01 1.0000e-10 1.0000e-10 1.0318e-02 9.4953e+00
|
||||
9.6000e+00 -9.2517e+00 1.0744e-03 9.9893e-01 4.3969e-02 9.5603e-01 1.0000e-10 1.0000e-10 1.0320e-02 9.5953e+00
|
||||
9.7000e+00 -9.2519e+00 1.0635e-03 9.9894e-01 4.3543e-02 9.5646e-01 1.0000e-10 1.0000e-10 1.0322e-02 9.6953e+00
|
||||
9.8000e+00 -9.2521e+00 1.0529e-03 9.9895e-01 4.3124e-02 9.5688e-01 1.0000e-10 1.0000e-10 1.0324e-02 9.7953e+00
|
||||
9.9000e+00 -9.2523e+00 1.0425e-03 9.9896e-01 4.2713e-02 9.5729e-01 1.0000e-10 1.0000e-10 1.0326e-02 9.8953e+00
|
||||
1.0000e+01 -9.2525e+00 1.0323e-03 9.9897e-01 4.2310e-02 9.5769e-01 1.0000e-10 1.0000e-10 1.0328e-02 9.9953e+00
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,125 +0,0 @@
|
||||
step Na Cl K Ca Pore_vol
|
||||
-99 0.0000e+00 1.2000e-03 0.0000e+00 6.0000e-04 1.2500e-02
|
||||
-99 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 1.2500e-02
|
||||
-99 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 1.2500e-02
|
||||
1 5.2815e-04 1.2000e-03 4.5842e-04 1.0672e-04 3.7500e-02
|
||||
1 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 3.7500e-02
|
||||
2 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 6.2500e-02
|
||||
3 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 8.7500e-02
|
||||
4 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 1.1250e-01
|
||||
5 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 1.3750e-01
|
||||
6 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 1.6250e-01
|
||||
7 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 1.8750e-01
|
||||
8 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 2.1250e-01
|
||||
9 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 2.3750e-01
|
||||
10 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 2.6250e-01
|
||||
11 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 2.8750e-01
|
||||
12 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 3.1250e-01
|
||||
13 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 3.3750e-01
|
||||
14 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 3.6250e-01
|
||||
15 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 3.8750e-01
|
||||
16 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 4.1250e-01
|
||||
17 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 4.3750e-01
|
||||
18 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 4.6250e-01
|
||||
19 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 4.8750e-01
|
||||
20 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 5.1250e-01
|
||||
21 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 5.3750e-01
|
||||
22 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 5.6250e-01
|
||||
23 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 5.8750e-01
|
||||
24 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 6.1250e-01
|
||||
25 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 6.3750e-01
|
||||
26 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 6.6250e-01
|
||||
27 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 6.8750e-01
|
||||
28 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 7.1250e-01
|
||||
29 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 7.3750e-01
|
||||
30 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 7.6250e-01
|
||||
31 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 7.8750e-01
|
||||
32 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 8.1250e-01
|
||||
33 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 8.3750e-01
|
||||
34 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 8.6250e-01
|
||||
35 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 8.8750e-01
|
||||
36 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 9.1250e-01
|
||||
37 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 9.3750e-01
|
||||
38 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 9.6250e-01
|
||||
39 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 9.8750e-01
|
||||
40 1.0000e-03 1.2000e-03 2.0000e-04 0.0000e+00 1.0125e+00
|
||||
41 1.0000e-03 1.2000e-03 2.0000e-04 0.0000e+00 1.0375e+00
|
||||
42 1.0000e-03 1.2000e-03 2.0000e-04 0.0000e+00 1.0625e+00
|
||||
43 1.0000e-03 1.2000e-03 2.0000e-04 0.0000e+00 1.0875e+00
|
||||
44 1.0000e-03 1.2000e-03 2.0000e-04 0.0000e+00 1.1125e+00
|
||||
45 1.0000e-03 1.2000e-03 2.0000e-04 0.0000e+00 1.1375e+00
|
||||
46 1.0000e-03 1.2000e-03 2.0000e-04 0.0000e+00 1.1625e+00
|
||||
47 1.0000e-03 1.2000e-03 2.0000e-04 0.0000e+00 1.1875e+00
|
||||
48 1.0000e-03 1.2000e-03 2.0000e-04 0.0000e+00 1.2125e+00
|
||||
49 1.0000e-03 1.2000e-03 2.0000e-04 0.0000e+00 1.2375e+00
|
||||
50 1.0000e-03 1.2000e-03 2.0000e-04 0.0000e+00 1.2625e+00
|
||||
51 1.0000e-03 1.2000e-03 2.0000e-04 0.0000e+00 1.2875e+00
|
||||
52 1.0000e-03 1.2000e-03 2.0000e-04 0.0000e+00 1.3125e+00
|
||||
53 1.0000e-03 1.2000e-03 2.0000e-04 0.0000e+00 1.3375e+00
|
||||
54 9.9998e-04 1.2000e-03 2.0002e-04 0.0000e+00 1.3625e+00
|
||||
55 9.9993e-04 1.2000e-03 2.0007e-04 0.0000e+00 1.3875e+00
|
||||
56 9.9969e-04 1.2000e-03 2.0031e-04 0.0000e+00 1.4125e+00
|
||||
57 9.9860e-04 1.2000e-03 2.0140e-04 0.0000e+00 1.4375e+00
|
||||
58 9.9376e-04 1.2000e-03 2.0624e-04 0.0000e+00 1.4625e+00
|
||||
59 9.7266e-04 1.2000e-03 2.2734e-04 0.0000e+00 1.4875e+00
|
||||
60 8.8947e-04 1.2000e-03 3.1053e-04 0.0000e+00 1.5125e+00
|
||||
61 6.5396e-04 1.2000e-03 5.4604e-04 0.0000e+00 1.5375e+00
|
||||
62 3.1876e-04 1.2000e-03 8.8124e-04 0.0000e+00 1.5625e+00
|
||||
63 1.0663e-04 1.2000e-03 1.0934e-03 0.0000e+00 1.5875e+00
|
||||
64 2.9829e-05 1.2000e-03 1.1702e-03 0.0000e+00 1.6125e+00
|
||||
65 7.8763e-06 1.2000e-03 1.1921e-03 1.2216e-27 1.6375e+00
|
||||
66 2.0460e-06 1.2000e-03 1.1980e-03 1.8112e-25 1.6625e+00
|
||||
67 5.2878e-07 1.2000e-03 1.1995e-03 2.6557e-23 1.6875e+00
|
||||
68 1.3629e-07 1.2000e-03 1.1999e-03 3.9376e-21 1.7125e+00
|
||||
69 3.5021e-08 1.2000e-03 1.2000e-03 5.8912e-19 1.7375e+00
|
||||
70 8.9558e-09 1.2000e-03 1.2000e-03 8.8181e-17 1.7625e+00
|
||||
71 2.2719e-09 1.2000e-03 1.2000e-03 1.3080e-14 1.7875e+00
|
||||
72 5.6835e-10 1.2000e-03 1.2000e-03 1.9126e-12 1.8125e+00
|
||||
73 1.3869e-10 1.2000e-03 1.2000e-03 2.7576e-10 1.8375e+00
|
||||
74 3.2281e-11 1.2000e-03 1.1999e-03 3.9374e-08 1.8625e+00
|
||||
75 6.7673e-12 1.2000e-03 1.1890e-03 5.4946e-06 1.8875e+00
|
||||
76 8.0510e-13 1.2000e-03 7.0494e-04 2.4753e-04 1.9125e+00
|
||||
77 2.1968e-14 1.2000e-03 9.6079e-05 5.5196e-04 1.9375e+00
|
||||
78 4.1771e-16 1.2000e-03 9.1269e-06 5.9544e-04 1.9625e+00
|
||||
79 7.6748e-18 1.2000e-03 8.3782e-07 5.9958e-04 1.9875e+00
|
||||
80 1.4057e-19 1.2000e-03 7.6671e-08 5.9996e-04 2.0125e+00
|
||||
81 2.5740e-21 1.2000e-03 7.0147e-09 6.0000e-04 2.0375e+00
|
||||
82 4.7052e-23 1.2000e-03 6.4179e-10 6.0000e-04 2.0625e+00
|
||||
83 8.2642e-25 1.2000e-03 5.8721e-11 6.0000e-04 2.0875e+00
|
||||
84 0.0000e+00 1.2000e-03 5.3731e-12 6.0000e-04 2.1125e+00
|
||||
85 0.0000e+00 1.2000e-03 4.9168e-13 6.0000e-04 2.1375e+00
|
||||
86 0.0000e+00 1.2000e-03 4.4995e-14 6.0000e-04 2.1625e+00
|
||||
87 0.0000e+00 1.2000e-03 4.1178e-15 6.0000e-04 2.1875e+00
|
||||
88 0.0000e+00 1.2000e-03 3.7688e-16 6.0000e-04 2.2125e+00
|
||||
89 0.0000e+00 1.2000e-03 3.4497e-17 6.0000e-04 2.2375e+00
|
||||
90 0.0000e+00 1.2000e-03 3.1577e-18 6.0000e-04 2.2625e+00
|
||||
91 0.0000e+00 1.2000e-03 2.8907e-19 6.0000e-04 2.2875e+00
|
||||
92 0.0000e+00 1.2000e-03 2.6465e-20 6.0000e-04 2.3125e+00
|
||||
93 0.0000e+00 1.2000e-03 2.4231e-21 6.0000e-04 2.3375e+00
|
||||
94 0.0000e+00 1.2000e-03 2.2183e-22 6.0000e-04 2.3625e+00
|
||||
95 0.0000e+00 1.2000e-03 2.0287e-23 6.0000e-04 2.3875e+00
|
||||
96 0.0000e+00 1.2000e-03 1.8364e-24 6.0000e-04 2.4125e+00
|
||||
97 0.0000e+00 1.2000e-03 1.5102e-25 6.0000e-04 2.4375e+00
|
||||
98 0.0000e+00 1.2000e-03 0.0000e+00 6.0000e-04 2.4625e+00
|
||||
99 0.0000e+00 1.2000e-03 0.0000e+00 6.0000e-04 2.4875e+00
|
||||
100 0.0000e+00 1.2000e-03 0.0000e+00 6.0000e-04 2.5125e+00
|
||||
101 0.0000e+00 1.2000e-03 0.0000e+00 6.0000e-04 2.5375e+00
|
||||
102 0.0000e+00 1.2000e-03 0.0000e+00 6.0000e-04 2.5625e+00
|
||||
103 0.0000e+00 1.2000e-03 0.0000e+00 6.0000e-04 2.5875e+00
|
||||
104 0.0000e+00 1.2000e-03 0.0000e+00 6.0000e-04 2.6125e+00
|
||||
105 0.0000e+00 1.2000e-03 0.0000e+00 6.0000e-04 2.6375e+00
|
||||
106 0.0000e+00 1.2000e-03 0.0000e+00 6.0000e-04 2.6625e+00
|
||||
107 0.0000e+00 1.2000e-03 0.0000e+00 6.0000e-04 2.6875e+00
|
||||
108 0.0000e+00 1.2000e-03 0.0000e+00 6.0000e-04 2.7125e+00
|
||||
109 0.0000e+00 1.2000e-03 0.0000e+00 6.0000e-04 2.7375e+00
|
||||
110 0.0000e+00 1.2000e-03 0.0000e+00 6.0000e-04 2.7625e+00
|
||||
111 0.0000e+00 1.2000e-03 0.0000e+00 6.0000e-04 2.7875e+00
|
||||
112 0.0000e+00 1.2000e-03 0.0000e+00 6.0000e-04 2.8125e+00
|
||||
113 0.0000e+00 1.2000e-03 0.0000e+00 6.0000e-04 2.8375e+00
|
||||
114 0.0000e+00 1.2000e-03 0.0000e+00 6.0000e-04 2.8625e+00
|
||||
115 0.0000e+00 1.2000e-03 0.0000e+00 6.0000e-04 2.8875e+00
|
||||
116 0.0000e+00 1.2000e-03 0.0000e+00 6.0000e-04 2.9125e+00
|
||||
117 0.0000e+00 1.2000e-03 0.0000e+00 6.0000e-04 2.9375e+00
|
||||
118 0.0000e+00 1.2000e-03 0.0000e+00 6.0000e-04 2.9625e+00
|
||||
119 0.0000e+00 1.2000e-03 0.0000e+00 6.0000e-04 2.9875e+00
|
||||
120 0.0000e+00 1.2000e-03 0.0000e+00 6.0000e-04 3.0125e+00
|
||||
@ -1,125 +0,0 @@
|
||||
step Na Cl K Ca Pore_vol
|
||||
-99 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 1.2500e-02
|
||||
-99 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 1.2500e-02
|
||||
1 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 3.7500e-02
|
||||
0 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 1.2500e-02
|
||||
1 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 3.7500e-02
|
||||
2 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 6.2500e-02
|
||||
3 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 8.7500e-02
|
||||
4 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 1.1250e-01
|
||||
5 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 1.3750e-01
|
||||
6 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 1.6250e-01
|
||||
7 1.0000e-03 0.0000e+00 2.0000e-04 0.0000e+00 1.8750e-01
|
||||
8 1.0000e-03 3.0997e-22 2.0000e-04 0.0000e+00 2.1250e-01
|
||||
9 1.0000e-03 1.5009e-17 2.0000e-04 0.0000e+00 2.3750e-01
|
||||
10 1.0000e-03 6.3378e-15 2.0000e-04 0.0000e+00 2.6250e-01
|
||||
11 1.0000e-03 4.4948e-13 2.0000e-04 0.0000e+00 2.8750e-01
|
||||
12 1.0000e-03 1.1487e-11 2.0000e-04 0.0000e+00 3.1250e-01
|
||||
13 1.0000e-03 1.5022e-10 2.0000e-04 0.0000e+00 3.3750e-01
|
||||
14 1.0000e-03 1.2225e-09 2.0000e-04 0.0000e+00 3.6250e-01
|
||||
15 1.0000e-03 6.9925e-09 2.0000e-04 0.0000e+00 3.8750e-01
|
||||
16 1.0000e-03 3.0480e-08 2.0000e-04 0.0000e+00 4.1250e-01
|
||||
17 1.0000e-03 1.0717e-07 2.0000e-04 0.0000e+00 4.3750e-01
|
||||
18 1.0000e-03 3.1679e-07 2.0000e-04 0.0000e+00 4.6250e-01
|
||||
19 1.0000e-03 8.1192e-07 2.0000e-04 0.0000e+00 4.8750e-01
|
||||
20 1.0000e-03 1.8478e-06 2.0000e-04 0.0000e+00 5.1250e-01
|
||||
21 1.0000e-03 3.8042e-06 2.0000e-04 0.0000e+00 5.3750e-01
|
||||
22 1.0000e-03 7.1918e-06 2.0000e-04 0.0000e+00 5.6250e-01
|
||||
23 1.0000e-03 1.2635e-05 2.0000e-04 0.0000e+00 5.8750e-01
|
||||
24 1.0000e-03 2.0834e-05 2.0000e-04 0.0000e+00 6.1250e-01
|
||||
25 1.0000e-03 3.2507e-05 2.0000e-04 0.0000e+00 6.3750e-01
|
||||
26 1.0000e-03 4.8325e-05 2.0000e-04 0.0000e+00 6.6250e-01
|
||||
27 1.0000e-03 6.8844e-05 2.0000e-04 0.0000e+00 6.8750e-01
|
||||
28 1.0000e-03 9.4449e-05 2.0000e-04 0.0000e+00 7.1250e-01
|
||||
29 1.0000e-03 1.2532e-04 2.0000e-04 0.0000e+00 7.3750e-01
|
||||
30 1.0000e-03 1.6140e-04 2.0000e-04 0.0000e+00 7.6250e-01
|
||||
31 1.0000e-03 2.0242e-04 2.0000e-04 0.0000e+00 7.8750e-01
|
||||
32 1.0000e-03 2.4790e-04 2.0000e-04 0.0000e+00 8.1250e-01
|
||||
33 9.9999e-04 2.9719e-04 2.0001e-04 0.0000e+00 8.3750e-01
|
||||
34 9.9999e-04 3.4951e-04 2.0001e-04 0.0000e+00 8.6250e-01
|
||||
35 9.9998e-04 4.0403e-04 2.0002e-04 0.0000e+00 8.8750e-01
|
||||
36 9.9996e-04 4.5987e-04 2.0004e-04 0.0000e+00 9.1250e-01
|
||||
37 9.9993e-04 5.1616e-04 2.0007e-04 0.0000e+00 9.3750e-01
|
||||
38 9.9988e-04 5.7209e-04 2.0012e-04 0.0000e+00 9.6250e-01
|
||||
39 9.9979e-04 6.2694e-04 2.0021e-04 0.0000e+00 9.8750e-01
|
||||
40 9.9964e-04 6.8006e-04 2.0036e-04 0.0000e+00 1.0125e+00
|
||||
41 9.9940e-04 7.3093e-04 2.0060e-04 0.0000e+00 1.0375e+00
|
||||
42 9.9902e-04 7.7913e-04 2.0098e-04 0.0000e+00 1.0625e+00
|
||||
43 9.9842e-04 8.2437e-04 2.0158e-04 0.0000e+00 1.0875e+00
|
||||
44 9.9749e-04 8.6644e-04 2.0251e-04 0.0000e+00 1.1125e+00
|
||||
45 9.9606e-04 9.0523e-04 2.0394e-04 0.0000e+00 1.1375e+00
|
||||
46 9.9390e-04 9.4071e-04 2.0610e-04 0.0000e+00 1.1625e+00
|
||||
47 9.9067e-04 9.7294e-04 2.0933e-04 0.0000e+00 1.1875e+00
|
||||
48 9.8590e-04 1.0020e-03 2.1410e-04 0.0000e+00 1.2125e+00
|
||||
49 9.7896e-04 1.0281e-03 2.2104e-04 0.0000e+00 1.2375e+00
|
||||
50 9.6900e-04 1.0513e-03 2.3100e-04 0.0000e+00 1.2625e+00
|
||||
51 9.5496e-04 1.0718e-03 2.4504e-04 0.0000e+00 1.2875e+00
|
||||
52 9.3563e-04 1.0899e-03 2.6437e-04 0.0000e+00 1.3125e+00
|
||||
53 9.0974e-04 1.1058e-03 2.9026e-04 0.0000e+00 1.3375e+00
|
||||
54 8.7620e-04 1.1196e-03 3.2380e-04 0.0000e+00 1.3625e+00
|
||||
55 8.3445e-04 1.1316e-03 3.6555e-04 0.0000e+00 1.3875e+00
|
||||
56 7.8479e-04 1.1420e-03 4.1521e-04 0.0000e+00 1.4125e+00
|
||||
57 7.2845e-04 1.1510e-03 4.7155e-04 3.5277e-28 1.4375e+00
|
||||
58 6.6747e-04 1.1587e-03 5.3253e-04 4.2108e-26 1.4625e+00
|
||||
59 6.0423e-04 1.1652e-03 5.9577e-04 2.1113e-24 1.4875e+00
|
||||
60 5.4107e-04 1.1708e-03 6.5893e-04 9.1531e-23 1.5125e+00
|
||||
61 4.7992e-04 1.1756e-03 7.2008e-04 3.5143e-21 1.5375e+00
|
||||
62 4.2217e-04 1.1796e-03 7.7783e-04 1.2072e-19 1.5625e+00
|
||||
63 3.6873e-04 1.1830e-03 8.3127e-04 3.6941e-18 1.5875e+00
|
||||
64 3.2004e-04 1.1859e-03 8.7996e-04 1.0357e-16 1.6125e+00
|
||||
65 2.7623e-04 1.1883e-03 9.2377e-04 2.6573e-15 1.6375e+00
|
||||
66 2.3720e-04 1.1903e-03 9.6280e-04 6.2721e-14 1.6625e+00
|
||||
67 2.0268e-04 1.1920e-03 9.9732e-04 1.4041e-12 1.6875e+00
|
||||
68 1.7232e-04 1.1934e-03 1.0277e-03 2.9709e-11 1.7125e+00
|
||||
69 1.4570e-04 1.1945e-03 1.0543e-03 5.8657e-10 1.7375e+00
|
||||
70 1.2238e-04 1.1955e-03 1.0776e-03 1.1507e-08 1.7625e+00
|
||||
71 1.0193e-04 1.1963e-03 1.0977e-03 2.0826e-07 1.7875e+00
|
||||
72 8.3815e-05 1.1970e-03 1.1095e-03 3.3299e-06 1.8125e+00
|
||||
73 6.6682e-05 1.1975e-03 1.0249e-03 5.4190e-05 1.8375e+00
|
||||
74 5.0532e-05 1.1980e-03 7.3505e-04 2.0721e-04 1.8625e+00
|
||||
75 3.8797e-05 1.1983e-03 5.3569e-04 3.1276e-04 1.8875e+00
|
||||
76 3.0077e-05 1.1986e-03 4.0212e-04 3.8390e-04 1.9125e+00
|
||||
77 2.3445e-05 1.1989e-03 3.0685e-04 4.3485e-04 1.9375e+00
|
||||
78 1.8340e-05 1.1991e-03 2.3662e-04 4.7252e-04 1.9625e+00
|
||||
79 1.4384e-05 1.1993e-03 1.8380e-04 5.0091e-04 1.9875e+00
|
||||
80 1.1303e-05 1.1994e-03 1.4355e-04 5.2257e-04 2.0125e+00
|
||||
81 8.8949e-06 1.1995e-03 1.1260e-04 5.3925e-04 2.0375e+00
|
||||
82 7.0081e-06 1.1996e-03 8.8613e-05 5.5219e-04 2.0625e+00
|
||||
83 5.5269e-06 1.1997e-03 6.9934e-05 5.6227e-04 2.0875e+00
|
||||
84 4.3622e-06 1.1997e-03 5.5321e-05 5.7016e-04 2.1125e+00
|
||||
85 3.4452e-06 1.1998e-03 4.3847e-05 5.7635e-04 2.1375e+00
|
||||
86 2.7225e-06 1.1998e-03 3.4813e-05 5.8123e-04 2.1625e+00
|
||||
87 2.1523e-06 1.1999e-03 2.7680e-05 5.8508e-04 2.1875e+00
|
||||
88 1.7023e-06 1.1999e-03 2.2038e-05 5.8813e-04 2.2125e+00
|
||||
89 1.3467e-06 1.1999e-03 1.7565e-05 5.9054e-04 2.2375e+00
|
||||
90 1.0658e-06 1.1999e-03 1.4014e-05 5.9246e-04 2.2625e+00
|
||||
91 8.4359e-07 1.1999e-03 1.1192e-05 5.9398e-04 2.2875e+00
|
||||
92 6.6787e-07 1.2000e-03 8.9443e-06 5.9519e-04 2.3125e+00
|
||||
93 5.2883e-07 1.2000e-03 7.1535e-06 5.9616e-04 2.3375e+00
|
||||
94 4.1880e-07 1.2000e-03 5.7250e-06 5.9693e-04 2.3625e+00
|
||||
95 3.3169e-07 1.2000e-03 4.5844e-06 5.9754e-04 2.3875e+00
|
||||
96 2.6273e-07 1.2000e-03 3.6730e-06 5.9803e-04 2.4125e+00
|
||||
97 2.0811e-07 1.2000e-03 2.9442e-06 5.9842e-04 2.4375e+00
|
||||
98 1.6486e-07 1.2000e-03 2.3611e-06 5.9874e-04 2.4625e+00
|
||||
99 1.3060e-07 1.2000e-03 1.8942e-06 5.9899e-04 2.4875e+00
|
||||
100 1.0347e-07 1.2000e-03 1.5202e-06 5.9919e-04 2.5125e+00
|
||||
101 8.1970e-08 1.2000e-03 1.2205e-06 5.9935e-04 2.5375e+00
|
||||
102 6.4939e-08 1.2000e-03 9.8015e-07 5.9948e-04 2.5625e+00
|
||||
103 5.1446e-08 1.2000e-03 7.8736e-07 5.9958e-04 2.5875e+00
|
||||
104 4.0756e-08 1.2000e-03 6.3266e-07 5.9966e-04 2.6125e+00
|
||||
105 3.2287e-08 1.2000e-03 5.0848e-07 5.9973e-04 2.6375e+00
|
||||
106 2.5577e-08 1.2000e-03 4.0877e-07 5.9978e-04 2.6625e+00
|
||||
107 2.0260e-08 1.2000e-03 3.2868e-07 5.9983e-04 2.6875e+00
|
||||
108 1.6048e-08 1.2000e-03 2.6433e-07 5.9986e-04 2.7125e+00
|
||||
109 1.2712e-08 1.2000e-03 2.1262e-07 5.9989e-04 2.7375e+00
|
||||
110 1.0068e-08 1.2000e-03 1.7105e-07 5.9991e-04 2.7625e+00
|
||||
111 7.9740e-09 1.2000e-03 1.3763e-07 5.9993e-04 2.7875e+00
|
||||
112 6.3151e-09 1.2000e-03 1.1076e-07 5.9994e-04 2.8125e+00
|
||||
113 5.0010e-09 1.2000e-03 8.9141e-08 5.9995e-04 2.8375e+00
|
||||
114 3.9601e-09 1.2000e-03 7.1753e-08 5.9996e-04 2.8625e+00
|
||||
115 3.1357e-09 1.2000e-03 5.7764e-08 5.9997e-04 2.8875e+00
|
||||
116 2.4828e-09 1.2000e-03 4.6507e-08 5.9998e-04 2.9125e+00
|
||||
117 1.9657e-09 1.2000e-03 3.7447e-08 5.9998e-04 2.9375e+00
|
||||
118 1.5562e-09 1.2000e-03 3.0156e-08 5.9998e-04 2.9625e+00
|
||||
119 1.2319e-09 1.2000e-03 2.4286e-08 5.9999e-04 2.9875e+00
|
||||
120 9.7513e-10 1.2000e-03 1.9560e-08 5.9999e-04 3.0125e+00
|
||||
@ -1,99 +0,0 @@
|
||||
Input file: /z/parkplace/home/dlpark/../../home/dlpark/programs/phreeqc/src/../src/Sun/../../examples/ex12
|
||||
Output file: ex12.out
|
||||
Database file: /z/parkplace/home/dlpark/../../home/dlpark/programs/phreeqc/src/../src/Sun/../../database/phreeqc.dat
|
||||
|
||||
------------------
|
||||
Reading data base.
|
||||
------------------
|
||||
|
||||
SOLUTION_MASTER_SPECIES
|
||||
SOLUTION_SPECIES
|
||||
PHASES
|
||||
EXCHANGE_MASTER_SPECIES
|
||||
EXCHANGE_SPECIES
|
||||
SURFACE_MASTER_SPECIES
|
||||
SURFACE_SPECIES
|
||||
RATES
|
||||
END
|
||||
------------------------------------
|
||||
Reading input data for simulation 1.
|
||||
------------------------------------
|
||||
|
||||
TITLE Example 12.--Advective and diffusive transport of heat and solutes.
|
||||
Constant boundary condition at one end, closed at other.
|
||||
The problem is designed so that temperature should equal Na-conc
|
||||
(in mmol/kgw) after diffusion.
|
||||
EXCHANGE_SPECIES
|
||||
Na+ + X- = NaX
|
||||
log_k 0.0
|
||||
gamma 4.0 0.075
|
||||
H+ + X- = HX
|
||||
log_k -99.
|
||||
gamma 9.0 0.0
|
||||
K+ + X- = KX
|
||||
log_k 0.0
|
||||
gamma 3.5 0.015
|
||||
SOLUTION 0 24.0 mM KNO3
|
||||
units mol/kgw
|
||||
temp 0 # Incoming solution 0C
|
||||
pH 7.0
|
||||
pe 12.0 O2(g) -0.67
|
||||
K 24.e-3
|
||||
N(5) 24.e-3
|
||||
SOLUTION 1-20 0.001 mM KCl
|
||||
units mol/kgw
|
||||
temp 25 # Column is at 25C
|
||||
pH 7.0
|
||||
pe 12.0 O2(g) -0.67
|
||||
K 1e-6
|
||||
Cl 1e-6
|
||||
EXCHANGE 1-20
|
||||
KX 0.048
|
||||
TRANSPORT # Make column temperature 0C, displace Cl
|
||||
cells 20
|
||||
shifts 19
|
||||
flow_direction forward
|
||||
bcond flux flux
|
||||
length 1.0
|
||||
disp 0.0 # No dispersion
|
||||
diffc 0.0 # No diffusion
|
||||
thermal_diffusion 1.0 # No retardation for heat
|
||||
PRINT
|
||||
WARNING: Cell-lengths were read for 1 cells. Last value is used till cell 20.
|
||||
WARNING: Dispersivities were read for 1 cells. Last value is used till cell 20.
|
||||
reset false
|
||||
END
|
||||
SOLUTION 0 Fixed temp 24C, and NaCl conc (first type boundary cond) at inlet
|
||||
units mol/kgw
|
||||
temp 24
|
||||
pH 7.0
|
||||
pe 12.0 O2(g) -0.67
|
||||
Na 24.e-3
|
||||
Cl 24.e-3
|
||||
SOLUTION 20 Same as soln 0 in cell 20 at closed column end (second type boundary cond)
|
||||
units mol/kgw
|
||||
temp 24
|
||||
pH 7.0
|
||||
pe 12.0 O2(g) -0.67
|
||||
Na 24.e-3
|
||||
Cl 24.e-3
|
||||
EXCHANGE 20
|
||||
NaX 0.048
|
||||
TRANSPORT # Diffuse 24C, NaCl solution from column end
|
||||
shifts 1
|
||||
flow_direction diffusion
|
||||
bcond constant closed
|
||||
thermal_diffusion 3.0 # heat is retarded equal to Na
|
||||
diffc 0.3e-9 # m^2/s
|
||||
timest 1.0e+10 # 317 years, 19 substeps will be used
|
||||
SELECTED_OUTPUT
|
||||
file ex12.sel
|
||||
high_precision true
|
||||
reset false
|
||||
distance true
|
||||
temperature true
|
||||
USER_PUNCH
|
||||
heading Na_mmol K_mmol Cl_mmol
|
||||
10 PUNCH TOT("Na")*1000, TOT("K")*1000, TOT("Cl")*1000
|
||||
END
|
||||
No memory leaks
|
||||
@ -1,44 +0,0 @@
|
||||
dist_x temp Na_mmol K_mmol Cl_mmol
|
||||
-99 2.400000000000e+01 2.400000000000e+01 0.000000000000e+00 2.400000000000e+01
|
||||
-99 2.400000000000e+01 2.400000000000e+01 0.000000000000e+00 2.400000000000e+01
|
||||
-99 2.400000000000e+01 2.400000000000e+01 0.000000000000e+00 2.400000000000e+01
|
||||
0.5 0.000000000000e+00 0.000000000000e+00 2.400000000010e+01 0.000000000000e+00
|
||||
1.5 0.000000000000e+00 0.000000000000e+00 2.400000000010e+01 0.000000000000e+00
|
||||
2.5 0.000000000000e+00 0.000000000000e+00 2.400000000010e+01 0.000000000000e+00
|
||||
3.5 0.000000000000e+00 0.000000000000e+00 2.400000000010e+01 0.000000000000e+00
|
||||
4.5 0.000000000000e+00 0.000000000000e+00 2.400000000010e+01 0.000000000000e+00
|
||||
5.5 0.000000000000e+00 0.000000000000e+00 2.400000000010e+01 0.000000000000e+00
|
||||
6.5 0.000000000000e+00 0.000000000000e+00 2.400000000010e+01 0.000000000000e+00
|
||||
7.5 0.000000000000e+00 0.000000000000e+00 2.400000000010e+01 0.000000000000e+00
|
||||
8.5 0.000000000000e+00 0.000000000000e+00 2.400000000010e+01 0.000000000000e+00
|
||||
9.5 0.000000000000e+00 0.000000000000e+00 2.400000000010e+01 0.000000000000e+00
|
||||
10.5 0.000000000000e+00 0.000000000000e+00 2.400000000010e+01 0.000000000000e+00
|
||||
11.5 0.000000000000e+00 0.000000000000e+00 2.400000000010e+01 0.000000000000e+00
|
||||
12.5 0.000000000000e+00 0.000000000000e+00 2.400000000010e+01 0.000000000000e+00
|
||||
13.5 0.000000000000e+00 0.000000000000e+00 2.400000000010e+01 0.000000000000e+00
|
||||
14.5 0.000000000000e+00 0.000000000000e+00 2.400000000010e+01 0.000000000000e+00
|
||||
15.5 0.000000000000e+00 0.000000000000e+00 2.400000000010e+01 0.000000000000e+00
|
||||
16.5 0.000000000000e+00 0.000000000000e+00 2.400000000010e+01 0.000000000000e+00
|
||||
17.5 0.000000000000e+00 0.000000000000e+00 2.400000000010e+01 0.000000000000e+00
|
||||
18.5 0.000000000000e+00 0.000000000000e+00 2.400000000009e+01 0.000000000000e+00
|
||||
19.5 2.400000000000e+01 2.400000000000e+01 0.000000000000e+00 2.400000000000e+01
|
||||
0.5 1.686181418415e+01 1.686181416184e+01 7.138185829939e+00 2.011377529332e+01
|
||||
1.5 6.421492325960e+00 6.421492342616e+00 1.757850764418e+01 1.294968671951e+01
|
||||
2.5 1.759908541854e+00 1.759908557221e+00 2.224009143309e+01 7.342808261321e+00
|
||||
3.5 3.571924631562e-01 3.571924666823e-01 2.364280752813e+01 3.623408283684e+00
|
||||
4.5 5.490209781370e-02 5.490209803302e-02 2.394509789974e+01 1.538555967129e+00
|
||||
5.5 6.484238380348e-03 6.484238322345e-03 2.399351576095e+01 5.556625533113e-01
|
||||
6.5 5.926340095484e-04 5.926339925265e-04 2.399940736587e+01 1.684990632469e-01
|
||||
7.5 4.190926756604e-05 4.190926525116e-05 2.399995809080e+01 4.224784404205e-02
|
||||
8.5 2.276345750780e-06 2.276345548554e-06 2.399999772377e+01 8.664946370896e-03
|
||||
9.5 1.396593677778e-07 1.396593266673e-07 2.399999986046e+01 2.055609847093e-03
|
||||
10.5 1.138869021831e-06 1.138868368161e-06 2.399999886125e+01 4.374443607427e-03
|
||||
11.5 2.090811414205e-05 2.090810331638e-05 2.399997909199e+01 2.044715368548e-02
|
||||
12.5 2.951795282278e-04 2.951793938629e-04 2.399970482061e+01 7.995922685941e-02
|
||||
13.5 3.221164570742e-03 3.221163321490e-03 2.399677883641e+01 2.567109777341e-01
|
||||
14.5 2.715473190226e-02 2.715472330367e-02 2.397284527577e+01 6.850286499844e-01
|
||||
15.5 1.753541123879e-01 1.753540697297e-01 2.382464592812e+01 1.533872870596e+00
|
||||
16.5 8.525032220200e-01 8.525030769812e-01 2.314749691919e+01 2.902126148041e+00
|
||||
17.5 3.032149931402e+00 3.032149625513e+00 2.096785036949e+01 4.663139220104e+00
|
||||
18.5 7.550952821146e+00 7.550952502686e+00 1.644904749357e+01 6.385483516941e+00
|
||||
19.5 1.235834674495e+01 1.235834658501e+01 1.164165341481e+01 7.468268986482e+00
|
||||
@ -1,188 +0,0 @@
|
||||
Input file: /z/parkplace/home/dlpark/../../home/dlpark/programs/phreeqc/src/../src/Sun/../../examples/ex12a
|
||||
Output file: ex12a.out
|
||||
Database file: /z/parkplace/home/dlpark/../../home/dlpark/programs/phreeqc/src/../src/Sun/../../database/phreeqc.dat
|
||||
|
||||
------------------
|
||||
Reading data base.
|
||||
------------------
|
||||
|
||||
SOLUTION_MASTER_SPECIES
|
||||
SOLUTION_SPECIES
|
||||
PHASES
|
||||
EXCHANGE_MASTER_SPECIES
|
||||
EXCHANGE_SPECIES
|
||||
SURFACE_MASTER_SPECIES
|
||||
SURFACE_SPECIES
|
||||
RATES
|
||||
END
|
||||
------------------------------------
|
||||
Reading input data for simulation 1.
|
||||
------------------------------------
|
||||
|
||||
TITLE Example 12a.--Advective and diffusive transport of heat and solutes.
|
||||
Constant boundary condition at one end, closed at other.
|
||||
The problem is designed so that temperature should equal Na-conc
|
||||
(in mmol/kgw) after diffusion. Compares with analytical solution
|
||||
for 20-cell and 60-cell models.
|
||||
EXCHANGE_SPECIES
|
||||
Na+ + X- = NaX
|
||||
log_k 0.0
|
||||
gamma 4.0 0.075
|
||||
H+ + X- = HX
|
||||
log_k -99.
|
||||
gamma 9.0 0.0
|
||||
K+ + X- = KX
|
||||
log_k 0.0
|
||||
gamma 3.5 0.015
|
||||
SOLUTION 0 Fixed temp 24C, and NaCl conc (first type boundary cond) at inlet
|
||||
units mol/kgw
|
||||
temp 24
|
||||
pH 7.0
|
||||
pe 12.0 O2(g) -0.67
|
||||
Na 24.e-3
|
||||
Cl 24.e-3
|
||||
SOLUTION 1-19 24.0 mM KNO3
|
||||
units mol/kgw
|
||||
temp 0 # Incoming solution 0C
|
||||
pH 7.0
|
||||
pe 12.0 O2(g) -0.67
|
||||
K 24.e-3
|
||||
N(5) 24.e-3
|
||||
EXCHANGE 1-19
|
||||
KX 0.048
|
||||
SOLUTION 20 Same as soln 0 in cell 20 at closed column end (second type boundary cond)
|
||||
units mol/kgw
|
||||
temp 24
|
||||
pH 7.0
|
||||
pe 12.0 O2(g) -0.67
|
||||
Na 24.e-3
|
||||
Cl 24.e-3
|
||||
EXCHANGE 20
|
||||
NaX 0.048
|
||||
PRINT
|
||||
reset false
|
||||
END
|
||||
TRANSPORT # Diffuse 24C, NaCl solution from column end
|
||||
cells 20
|
||||
shifts 1
|
||||
flow_direction diffusion
|
||||
bcond constant closed
|
||||
length 1.0
|
||||
thermal_diffusion 3.0 # Heat is retarded equal to Na
|
||||
disp 0.0 # No dispersion
|
||||
diffc 0.3e-9 # m^2/s
|
||||
timest 1.0e+10 # 317 years, 19 substeps will be used
|
||||
SELECTED_OUTPUT
|
||||
WARNING: Cell-lengths were read for 1 cells. Last value is used till cell 20.
|
||||
WARNING: Dispersivities were read for 1 cells. Last value is used till cell 20.
|
||||
file ex12a.sel
|
||||
high_precision true
|
||||
reset false
|
||||
distance true
|
||||
temperature true
|
||||
USER_PUNCH
|
||||
heading Na_mmol K_mmol Cl_mmol Cl-analytic Na_analytic
|
||||
10 PUNCH TOT("Na")*1000, TOT("K")*1000, TOT("Cl")*1000
|
||||
20 DATA 0.254829592, -0.284496736, 1.421413741, -1.453152027, 1.061405429
|
||||
30 x = DIST
|
||||
40 if (x > 8.5 OR SIM_TIME <= 0) THEN END
|
||||
50 IF (ABS(x MOD 0.5) > 1e-3) OR (TC <= 0) THEN END
|
||||
60 READ a1, a2, a3, a4, a5
|
||||
70 REM calculate error in Cl
|
||||
80 Arg = x / (2*SQRT(3e-10 * SIM_TIME / 1.0))
|
||||
90 e = 1/(1 + 0.3275911 * Arg)
|
||||
100 erfc_Cl = (e*(a1+e*(a2+e*(a3+e*(a4+e*a5)))))*EXP(-Arg*Arg)
|
||||
110 REM calculate error in Na
|
||||
120 Arg = x / (2*SQRT(3e-10 * SIM_TIME / 3.0))
|
||||
130 e = 1/(1 + 0.3275911 * Arg)
|
||||
140 erfc_Na = (e*(a1+e*(a2+e*(a3+e*(a4+e*a5)))))*EXP(-Arg*Arg)
|
||||
150 REM punch results
|
||||
160 error_Cl = 0.024 * erfc_Cl - TOT("Cl")
|
||||
170 error_Na = 0.024 * erfc_Na - TOT("Na")
|
||||
180 PUNCH error_Cl, error_Na
|
||||
190 REM store results
|
||||
200 j = x - 0.5
|
||||
210 PUT(error_Cl, SIM_NO, j, 1)
|
||||
220 PUT(error_Na, SIM_NO, j, 2)
|
||||
500 END
|
||||
END
|
||||
SELECTED_OUTPUT
|
||||
user_punch false
|
||||
SOLUTION 0 Fixed temp 24C, and NaCl conc (first type boundary cond) at inlet
|
||||
units mol/kgw
|
||||
temp 24
|
||||
pH 7.0
|
||||
pe 12.0 O2(g) -0.67
|
||||
Na 24.e-3
|
||||
Cl 24.e-3
|
||||
SOLUTION 1-59 24.0 mM KNO3
|
||||
units mol/kgw
|
||||
temp 0 # Incoming solution 0C
|
||||
pH 7.0
|
||||
pe 12.0 O2(g) -0.67
|
||||
K 24.e-3
|
||||
N(5) 24.e-3
|
||||
EXCHANGE 1-59
|
||||
KX 0.048
|
||||
SOLUTION 60 Same as soln 0 in cell 60 at closed column end (second type boundary cond)
|
||||
units mol/kgw
|
||||
temp 24
|
||||
pH 7.0
|
||||
pe 12.0 O2(g) -0.67
|
||||
Na 24.e-3
|
||||
Cl 24.e-3
|
||||
EXCHANGE 60
|
||||
NaX 0.048
|
||||
END
|
||||
TRANSPORT # Diffuse 24C, NaCl solution from column end
|
||||
cells 60
|
||||
shifts 1
|
||||
flow_direction diffusion
|
||||
bcond constant closed
|
||||
thermal_diffusion 3.0 # Heat is retarded equal to Na
|
||||
disp 0.0 # No dispersion
|
||||
diffc 0.3e-9 # m^2/s
|
||||
length .33333333333333333
|
||||
timest 1.0e+10 # 317 years
|
||||
punch_cells 1-60
|
||||
SELECTED_OUTPUT
|
||||
WARNING: Cell-lengths were read for 1 cells. Last value is used till cell 60.
|
||||
WARNING: Dispersivities were read for 1 cells. Last value is used till cell 60.
|
||||
high_precision true
|
||||
user_punch true
|
||||
reset false
|
||||
distance true
|
||||
temperature true
|
||||
END
|
||||
SOLUTION # Initial solution calculation for pure water
|
||||
PRINT
|
||||
reset false # Initial solution calculation not printed
|
||||
user_print true
|
||||
SELECTED_OUTPUT
|
||||
high_precision false # Controls precision for USER_PRINT too.
|
||||
USER_PRINT
|
||||
10 PRINT " Error in Cl concentration Error in Na concentration"
|
||||
20 PRINT " ------------------------- -------------------------"
|
||||
30 PRINT " Distance 20-cell 60-cell 20-cell 60-cell"
|
||||
40 PRINT " "
|
||||
50 FOR j = 0 TO 8
|
||||
60 PRINT j + 0.5, GET(2, j, 1), GET(4, j, 1), GET(2, j, 2), GET(4, j, 2)
|
||||
70 NEXT j
|
||||
END
|
||||
----------------------------------User print-----------------------------------
|
||||
|
||||
Error in Cl concentration Error in Na concentration
|
||||
------------------------- -------------------------
|
||||
Distance 20-cell 60-cell 20-cell 60-cell
|
||||
|
||||
5.0000e-01 4.3817e-06 9.0009e-08 5.0636e-04 3.9397e-05
|
||||
1.5000e+00 1.7304e-05 1.0407e-06 5.1077e-04 5.5286e-05
|
||||
2.5000e+00 3.5613e-05 3.2028e-06 9.0486e-05 1.4725e-05
|
||||
3.5000e+00 4.9599e-05 5.2170e-06 -3.7312e-05 -3.8884e-06
|
||||
4.5000e+00 5.0063e-05 5.6394e-06 -1.9794e-05 -2.5770e-06
|
||||
5.5000e+00 3.8208e-05 4.4562e-06 -4.0684e-06 -5.0254e-07
|
||||
6.5000e+00 2.2627e-05 2.7007e-06 -4.8926e-07 -4.8938e-08
|
||||
7.5000e+00 1.0547e-05 1.2850e-06 -3.9174e-08 -2.7009e-09
|
||||
8.5000e+00 3.8231e-06 4.5302e-07 -2.2318e-09 -9.0081e-11
|
||||
|
||||
No memory leaks
|
||||
@ -1,169 +0,0 @@
|
||||
dist_x temp Na_mmol K_mmol Cl_mmol Cl-analytic Na_analytic
|
||||
0.5 0.000000000000e+00 0.000000000000e+00 2.400000000009e+01 0.000000000000e+00
|
||||
1.5 0.000000000000e+00 0.000000000000e+00 2.400000000009e+01 0.000000000000e+00
|
||||
2.5 0.000000000000e+00 0.000000000000e+00 2.400000000009e+01 0.000000000000e+00
|
||||
3.5 0.000000000000e+00 0.000000000000e+00 2.400000000009e+01 0.000000000000e+00
|
||||
4.5 0.000000000000e+00 0.000000000000e+00 2.400000000009e+01 0.000000000000e+00
|
||||
5.5 0.000000000000e+00 0.000000000000e+00 2.400000000009e+01 0.000000000000e+00
|
||||
6.5 0.000000000000e+00 0.000000000000e+00 2.400000000009e+01 0.000000000000e+00
|
||||
7.5 0.000000000000e+00 0.000000000000e+00 2.400000000009e+01 0.000000000000e+00
|
||||
8.5 0.000000000000e+00 0.000000000000e+00 2.400000000009e+01 0.000000000000e+00
|
||||
9.5 0.000000000000e+00 0.000000000000e+00 2.400000000009e+01 0.000000000000e+00
|
||||
10.5 0.000000000000e+00 0.000000000000e+00 2.400000000009e+01 0.000000000000e+00
|
||||
11.5 0.000000000000e+00 0.000000000000e+00 2.400000000009e+01 0.000000000000e+00
|
||||
12.5 0.000000000000e+00 0.000000000000e+00 2.400000000009e+01 0.000000000000e+00
|
||||
13.5 0.000000000000e+00 0.000000000000e+00 2.400000000009e+01 0.000000000000e+00
|
||||
14.5 0.000000000000e+00 0.000000000000e+00 2.400000000009e+01 0.000000000000e+00
|
||||
15.5 0.000000000000e+00 0.000000000000e+00 2.400000000009e+01 0.000000000000e+00
|
||||
16.5 0.000000000000e+00 0.000000000000e+00 2.400000000009e+01 0.000000000000e+00
|
||||
17.5 0.000000000000e+00 0.000000000000e+00 2.400000000009e+01 0.000000000000e+00
|
||||
18.5 0.000000000000e+00 0.000000000000e+00 2.400000000009e+01 0.000000000000e+00
|
||||
19.5 2.400000000000e+01 2.400000000000e+01 0.000000000000e+00 2.400000000000e+01
|
||||
0.5 1.686181418415e+01 1.686181419284e+01 7.138185798940e+00 2.011377529332e+01 4.381717721817e-06 5.063555346726e-04
|
||||
1.5 6.421492325960e+00 6.421492401967e+00 1.757850758482e+01 1.294968671951e+01 1.730376465525e-05 5.107739267532e-04
|
||||
2.5 1.759908541854e+00 1.759908596887e+00 2.224009139342e+01 7.342808261321e+00 3.561257289983e-05 9.048612448212e-05
|
||||
3.5 3.571924631562e-01 3.571924817826e-01 2.364280751302e+01 3.623408283684e+00 4.959925523712e-05 -3.731213350966e-05
|
||||
4.5 5.490209781370e-02 5.490210180416e-02 2.394509789597e+01 1.538555967129e+00 5.006313596727e-05 -1.979378199416e-05
|
||||
5.5 6.484238380348e-03 6.484238983030e-03 2.399351576028e+01 5.556625533113e-01 3.820767165714e-05 -4.068366980646e-06
|
||||
6.5 5.926340095484e-04 5.926340766447e-04 2.399940736578e+01 1.684990632469e-01 2.262672987200e-05 -4.892608394194e-07
|
||||
7.5 4.190926756604e-05 4.190927316640e-05 2.399995809078e+01 4.224784404205e-02 1.054699173423e-05 -3.917411153365e-08
|
||||
8.5 2.276345750780e-06 2.276346101865e-06 2.399999772376e+01 8.664946370896e-03 3.823149392506e-06 -2.231772077916e-09
|
||||
9.5 1.396593677778e-07 1.396593921606e-07 2.399999986046e+01 2.055609847093e-03
|
||||
10.5 1.138869021831e-06 1.138869196840e-06 2.399999886124e+01 4.374443607427e-03
|
||||
11.5 2.090811414205e-05 2.090811693112e-05 2.399997909197e+01 2.044715368548e-02
|
||||
12.5 2.951795282278e-04 2.951795617161e-04 2.399970482043e+01 7.995922685941e-02
|
||||
13.5 3.221164570742e-03 3.221164872772e-03 2.399677883485e+01 2.567109777341e-01
|
||||
14.5 2.715473190226e-02 2.715473392142e-02 2.397284526515e+01 6.850286499844e-01
|
||||
15.5 1.753541123879e-01 1.753541220807e-01 2.382464587576e+01 1.533872870596e+00
|
||||
16.5 8.525032220200e-01 8.525032534626e-01 2.314749674271e+01 2.902126148041e+00
|
||||
17.5 3.032149931402e+00 3.032149994216e+00 2.096785000078e+01 4.663139220104e+00
|
||||
18.5 7.550952821146e+00 7.550952899109e+00 1.644904709714e+01 6.385483516941e+00
|
||||
19.5 1.235834674495e+01 1.235834684370e+01 1.164165315611e+01 7.468268986482e+00
|
||||
dist_x temp
|
||||
-99 2.400000000000e+01
|
||||
-99 0.000000000000e+00
|
||||
-99 2.400000000000e+01
|
||||
-99 2.400000000000e+01
|
||||
dist_x temp Na_mmol K_mmol Cl_mmol Cl-analytic Na_analytic
|
||||
0.166667 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
0.5 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
0.833333 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
1.16667 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
1.5 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
1.83333 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
2.16667 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
2.5 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
2.83333 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
3.16667 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
3.5 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
3.83333 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
4.16667 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
4.5 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
4.83333 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
5.16667 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
5.5 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
5.83333 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
6.16667 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
6.5 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
6.83333 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
7.16667 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
7.5 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
7.83333 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
8.16667 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
8.5 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
8.83333 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
9.16667 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
9.5 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
9.83333 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
10.1667 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
10.5 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
10.8333 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
11.1667 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
11.5 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
11.8333 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
12.1667 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
12.5 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
12.8333 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
13.1667 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
13.5 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
13.8333 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
14.1667 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
14.5 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
14.8333 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
15.1667 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
15.5 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
15.8333 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
16.1667 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
16.5 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
16.8333 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
17.1667 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
17.5 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
17.8333 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
18.1667 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
18.5 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
18.8333 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
19.1667 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
19.5 0.000000000000e+00 0.000000000000e+00 2.400000000000e+01 0.000000000000e+00
|
||||
19.8333 2.400000000000e+01 2.400000000000e+01 0.000000000000e+00 2.400000000000e+01
|
||||
0.166667 2.173421305916e+01 2.173421306343e+01 2.265786933713e+00 2.269804666237e+01
|
||||
0.5 1.732877230198e+01 1.732877231885e+01 6.671227673618e+00 2.011806700231e+01 9.000873062853e-08 3.939740866218e-05
|
||||
0.833333 1.328083118787e+01 1.328083122259e+01 1.071916876673e+01 1.760855984610e+01
|
||||
1.16667 9.764783869793e+00 9.764783923632e+00 1.423521606399e+01 1.521226338251e+01
|
||||
1.5 6.876979954453e+00 6.876980022636e+00 1.712301996456e+01 1.296594983180e+01 1.040652364160e-06 5.528630608450e-05
|
||||
1.83333 4.633445178532e+00 4.633445251920e+00 1.936655473578e+01 1.089878644688e+01
|
||||
2.16667 2.983957613764e+00 2.983957682799e+00 2.101604230602e+01 9.031332911172e+00
|
||||
2.5 1.835670035272e+00 1.835670093239e+00 2.216432989702e+01 7.375218041863e+00 3.202792358406e-06 1.472462813043e-05
|
||||
2.83333 1.078309641703e+00 1.078309685856e+00 2.292169030595e+01 5.933464823536e+00
|
||||
3.16667 6.047271172834e-01 6.047271481610e-01 2.339527284513e+01 4.701369002513e+00
|
||||
3.5 3.237687663205e-01 3.237687863260e-01 2.367623120832e+01 3.667790505378e+00 5.217033543007e-06 -3.888438053093e-06
|
||||
3.83333 1.655091653734e-01 1.655091774636e-01 2.383449081836e+01 2.816693047508e+00
|
||||
4.16667 8.080184009388e-02 8.080184694439e-02 2.391919814987e+01 2.128765884991e+00
|
||||
4.5 3.768529738011e-02 3.768530103391e-02 2.396231469660e+01 1.582979737206e+00 5.639365889894e-06 -2.576981223905e-06
|
||||
4.83333 1.679748179371e-02 1.679748363383e-02 2.398320251464e+01 1.157961028529e+00
|
||||
5.16667 7.158658672534e-03 7.158659549847e-03 2.399284133922e+01 8.331081560779e-01
|
||||
5.5 2.918406916536e-03 2.918407313331e-03 2.399708159183e+01 5.894139758477e-01 4.456249120743e-06 -5.025353109470e-07
|
||||
5.83333 1.138704483513e-03 1.138704654056e-03 2.399886129476e+01 4.099947290008e-01
|
||||
6.16667 4.254614091980e-04 4.254614789566e-04 2.399957453813e+01 2.803535790356e-01
|
||||
6.5 1.523110828875e-04 1.523111100786e-04 2.399984768864e+01 1.884251292313e-01 2.700663887612e-06 -4.893787285338e-08
|
||||
6.83333 5.227158932778e-05 5.227159943954e-05 2.399994772825e+01 1.244558376472e-01
|
||||
7.16667 1.720693829075e-05 1.720694188206e-05 2.399998279298e+01 8.077556918093e-02
|
||||
7.5 5.436060808742e-06 5.436062028079e-06 2.399999456390e+01 5.150981286307e-02 1.285022913218e-06 -2.700900395322e-09
|
||||
7.83333 1.649087567417e-06 1.649087963540e-06 2.399999835090e+01 3.227276557119e-02
|
||||
8.16667 4.806328011003e-07 4.806329243359e-07 2.399999951938e+01 1.987075437176e-02
|
||||
8.5 1.346545980534e-07 1.346546347973e-07 2.399999986537e+01 1.203507596490e-02 4.530197984976e-07 -9.008061084852e-11
|
||||
8.83333 3.628418612942e-08 3.628419663780e-08 2.399999996375e+01 7.194421703709e-03
|
||||
9.16667 9.420115605087e-09 9.420118494085e-09 2.399999999061e+01 4.290208467916e-03
|
||||
9.5 2.409789753518e-09 2.409790536015e-09 2.399999999763e+01 2.633460429579e-03
|
||||
9.83333 8.318493065839e-10 8.318495907164e-10 2.399999999921e+01 1.799170182453e-03
|
||||
10.1667 1.239138622414e-09 1.239139029450e-09 2.399999999880e+01 1.552911248870e-03
|
||||
10.5 4.450121249069e-09 4.450122620282e-09 2.399999999559e+01 1.804410616828e-03
|
||||
10.8333 1.697307773631e-08 1.697308267056e-08 2.399999998306e+01 2.583364148394e-03
|
||||
11.1667 6.262520065472e-08 6.262521780825e-08 2.399999993741e+01 4.033590225456e-03
|
||||
11.5 2.221760110271e-07 2.221760682136e-07 2.399999977785e+01 6.422343300949e-03
|
||||
11.8333 7.572168365738e-07 7.572170191795e-07 2.399999924281e+01 1.016200278611e-02
|
||||
12.1667 2.477714073998e-06 2.477714631994e-06 2.399999752230e+01 1.584124624556e-02
|
||||
12.5 7.778925375184e-06 7.778927005412e-06 2.399999222108e+01 2.426212581439e-02
|
||||
12.8333 2.341776426203e-05 2.341776881132e-05 2.399997658222e+01 3.647820852624e-02
|
||||
13.1667 6.755207229881e-05 6.755208441218e-05 2.399993244787e+01 5.382725013175e-02
|
||||
13.5 1.865949099352e-04 1.865949406769e-04 2.399981340498e+01 7.795002257855e-02
|
||||
13.8333 4.931967003130e-04 4.931967745830e-04 2.399950680310e+01 1.107853267574e-01
|
||||
14.1667 1.246472753669e-03 1.246472924261e-03 2.399875352688e+01 1.545304347559e-01
|
||||
14.5 3.009977094510e-03 3.009977466523e-03 2.399699002225e+01 2.115568175130e-01
|
||||
14.8333 6.939537438586e-03 6.939538207639e-03 2.399306046140e+01 2.842735712027e-01
|
||||
15.1667 1.526331935379e-02 1.526332085840e-02 2.398473667861e+01 3.749358095681e-01
|
||||
15.5 3.200217915009e-02 3.200218193090e-02 2.396799781737e+01 4.854024361712e-01
|
||||
15.8333 6.391193399667e-02 6.391193884267e-02 2.393608806026e+01 6.168566584837e-01
|
||||
16.1667 1.214834631133e-01 1.214834710604e-01 2.387851652783e+01 7.695123116931e-01
|
||||
16.5 2.196089759550e-01 2.196089881955e-01 2.378039101048e+01 9.423379783552e-01
|
||||
16.8333 3.772704376914e-01 3.772704553669e-01 2.362272954311e+01 1.132837159798e+00
|
||||
17.1667 6.154714589941e-01 6.154714828922e-01 2.338452851541e+01 1.336924520486e+00
|
||||
17.5 9.528239860304e-01 9.528240162733e-01 2.304717598190e+01 1.548934044811e+00
|
||||
17.8333 1.398887571630e+00 1.398887607499e+00 2.260111239061e+01 1.761784203671e+00
|
||||
18.1667 1.946511170344e+00 1.946511210371e+00 2.205348878777e+01 1.967308461518e+00
|
||||
18.5 2.565669345631e+00 2.565669387970e+00 2.143433061028e+01 2.156738468785e+00
|
||||
18.8333 3.201925616708e+00 3.201925659659e+00 2.079807433877e+01 2.321305007457e+00
|
||||
19.1667 3.781994216092e+00 3.781994258530e+00 2.021800574010e+01 2.452901809002e+00
|
||||
19.5 4.226690935644e+00 4.226690977196e+00 1.977330902162e+01 2.544743405451e+00
|
||||
19.8333 4.468507319433e+00 4.468507360365e+00 1.953149263856e+01 2.591943163049e+00
|
||||
dist_x temp Na_mmol K_mmol Cl_mmol Cl-analytic Na_analytic
|
||||
-99 25.000 0.0000e+00 0.0000e+00 0.0000e+00
|
||||
@ -1,310 +0,0 @@
|
||||
Input file: /z/parkplace/home/dlpark/../../home/dlpark/programs/phreeqc/src/../src/Sun/../../examples/ex13a
|
||||
Output file: ex13a.out
|
||||
Database file: /z/parkplace/home/dlpark/../../home/dlpark/programs/phreeqc/src/../src/Sun/../../database/phreeqc.dat
|
||||
|
||||
------------------
|
||||
Reading data base.
|
||||
------------------
|
||||
|
||||
SOLUTION_MASTER_SPECIES
|
||||
SOLUTION_SPECIES
|
||||
PHASES
|
||||
EXCHANGE_MASTER_SPECIES
|
||||
EXCHANGE_SPECIES
|
||||
SURFACE_MASTER_SPECIES
|
||||
SURFACE_SPECIES
|
||||
RATES
|
||||
END
|
||||
------------------------------------
|
||||
Reading input data for simulation 1.
|
||||
------------------------------------
|
||||
|
||||
TITLE Example 13A.--1 mmol/l NaCl/NO3 enters column with stagnant zones.
|
||||
Implicit definition of first-order exchange model.
|
||||
SOLUTION 0 # 1 mmol/l NaCl
|
||||
units mmol/l
|
||||
pH 7.0
|
||||
pe 13.0 O2(g) -0.7
|
||||
Na 1.0 # Na has Retardation = 2
|
||||
Cl 1.0 # Cl has Retardation = 1, stagnant exchange
|
||||
N(5) 1.0 # NO3 is conservative
|
||||
END
|
||||
-----
|
||||
TITLE
|
||||
-----
|
||||
|
||||
Example 13A.--1 mmol/l NaCl/NO3 enters column with stagnant zones.
|
||||
Implicit definition of first-order exchange model.
|
||||
|
||||
-------------------------------------------
|
||||
Beginning of initial solution calculations.
|
||||
-------------------------------------------
|
||||
|
||||
Initial solution 0.
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
Cl 1.000e-03 1.000e-03
|
||||
N(5) 1.000e-03 1.000e-03
|
||||
Na 1.000e-03 1.000e-03
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 7.000
|
||||
pe = 13.605 Equilibrium with O2(g)
|
||||
Activity of water = 1.000
|
||||
Ionic strength = 1.500e-03
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total alkalinity (eq/kg) = 4.551e-10
|
||||
Total carbon (mol/kg) = 0.000e+00
|
||||
Total CO2 (mol/kg) = 0.000e+00
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = -1.000e-03
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = -33.33
|
||||
Iterations = 3
|
||||
Total H = 1.110124e+02
|
||||
Total O = 5.550965e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
OH- 1.046e-07 1.001e-07 -6.981 -7.000 -0.019
|
||||
H+ 1.042e-07 1.000e-07 -6.982 -7.000 -0.018
|
||||
H2O 5.551e+01 9.999e-01 1.744 -0.000 0.000
|
||||
Cl 1.000e-03
|
||||
Cl- 1.000e-03 9.576e-04 -3.000 -3.019 -0.019
|
||||
H(0) 0.000e+00
|
||||
H2 0.000e+00 0.000e+00 -44.360 -44.360 0.000
|
||||
N(5) 1.000e-03
|
||||
NO3- 1.000e-03 9.573e-04 -3.000 -3.019 -0.019
|
||||
Na 1.000e-03
|
||||
Na+ 1.000e-03 9.580e-04 -3.000 -3.019 -0.019
|
||||
NaOH 6.327e-11 6.329e-11 -10.199 -10.199 0.000
|
||||
O(0) 4.374e-04
|
||||
O2 2.187e-04 2.188e-04 -3.660 -3.660 0.000
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
H2(g) -41.21 -44.36 -3.15 H2
|
||||
H2O(g) -1.51 -0.00 1.51 H2O
|
||||
Halite -7.62 -6.04 1.58 NaCl
|
||||
O2(g) -0.70 -3.66 -2.96 O2
|
||||
|
||||
------------------
|
||||
End of simulation.
|
||||
------------------
|
||||
|
||||
------------------------------------
|
||||
Reading input data for simulation 2.
|
||||
------------------------------------
|
||||
|
||||
SOLUTION 1-41 # Column with KNO3
|
||||
units mmol/l
|
||||
pH 7.0
|
||||
pe 13.0 O2(g) -0.7
|
||||
K 1.0
|
||||
N(5) 1.0
|
||||
EXCHANGE 1-41
|
||||
equilibrate 1
|
||||
X 1.e-3
|
||||
EXCHANGE_SPECIES # For linear exchange, make KX exch. coeff. equal to NaX
|
||||
K+ + X- = KX
|
||||
log_k 0.0
|
||||
gamma 3.5 0.015
|
||||
END
|
||||
-------------------------------------------
|
||||
Beginning of initial solution calculations.
|
||||
-------------------------------------------
|
||||
|
||||
Initial solution 1.
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
K 1.000e-03 1.000e-03
|
||||
N(5) 1.000e-03 1.000e-03
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 7.000
|
||||
pe = 13.605 Equilibrium with O2(g)
|
||||
Activity of water = 1.000
|
||||
Ionic strength = 1.000e-03
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total alkalinity (eq/kg) = 3.351e-10
|
||||
Total carbon (mol/kg) = 0.000e+00
|
||||
Total CO2 (mol/kg) = 0.000e+00
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = -3.351e-10
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = -0.00
|
||||
Iterations = 3
|
||||
Total H = 1.110124e+02
|
||||
Total O = 5.550965e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
OH- 1.038e-07 1.001e-07 -6.984 -7.000 -0.016
|
||||
H+ 1.034e-07 1.000e-07 -6.985 -7.000 -0.015
|
||||
H2O 5.551e+01 1.000e+00 1.744 -0.000 0.000
|
||||
H(0) 0.000e+00
|
||||
H2 0.000e+00 0.000e+00 -44.360 -44.360 0.000
|
||||
K 1.000e-03
|
||||
K+ 1.000e-03 9.649e-04 -3.000 -3.016 -0.016
|
||||
KOH 3.345e-11 3.346e-11 -10.476 -10.476 0.000
|
||||
N(5) 1.000e-03
|
||||
NO3- 1.000e-03 9.647e-04 -3.000 -3.016 -0.016
|
||||
O(0) 4.375e-04
|
||||
O2 2.187e-04 2.188e-04 -3.660 -3.660 0.000
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
H2(g) -41.21 -44.36 -3.15 H2
|
||||
H2O(g) -1.51 -0.00 1.51 H2O
|
||||
O2(g) -0.70 -3.66 -2.96 O2
|
||||
|
||||
-------------------------------------------------------
|
||||
Beginning of initial exchange-composition calculations.
|
||||
-------------------------------------------------------
|
||||
|
||||
Exchange 1.
|
||||
|
||||
X 1.000e-03 mol
|
||||
|
||||
Equiv- Equivalent Log
|
||||
Species Moles alents Fraction Gamma
|
||||
|
||||
KX 1.000e-03 1.000e-03 1.000e+00 -0.016
|
||||
|
||||
-----------------------------------------
|
||||
Beginning of batch-reaction calculations.
|
||||
-----------------------------------------
|
||||
|
||||
Reaction step 1.
|
||||
|
||||
Using solution 1.
|
||||
Using exchange 1. Exchange assemblage after simulation 2.
|
||||
|
||||
-----------------------------Exchange composition------------------------------
|
||||
|
||||
X 1.000e-03 mol
|
||||
|
||||
Equiv- Equivalent Log
|
||||
Species Moles alents Fraction Gamma
|
||||
|
||||
KX 1.000e-03 1.000e-03 1.000e+00 -0.016
|
||||
NH4X 6.872e-63 6.872e-63 6.872e-60 -0.016
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
K 1.000e-03 1.000e-03
|
||||
N 1.000e-03 1.000e-03
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 7.000 Charge balance
|
||||
pe = 13.605 Adjusted to redox equilibrium
|
||||
Activity of water = 1.000
|
||||
Ionic strength = 1.000e-03
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total alkalinity (eq/kg) = 3.351e-10
|
||||
Total carbon (mol/kg) = 0.000e+00
|
||||
Total CO2 (mol/kg) = 0.000e+00
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = -3.351e-10
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = -0.00
|
||||
Iterations = 0
|
||||
Total H = 1.110124e+02
|
||||
Total O = 5.550965e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
OH- 1.038e-07 1.001e-07 -6.984 -7.000 -0.016
|
||||
H+ 1.034e-07 1.000e-07 -6.985 -7.000 -0.015
|
||||
H2O 5.551e+01 1.000e+00 1.744 -0.000 0.000
|
||||
H(0) 0.000e+00
|
||||
H2 0.000e+00 0.000e+00 -44.360 -44.360 0.000
|
||||
K 1.000e-03
|
||||
K+ 1.000e-03 9.649e-04 -3.000 -3.016 -0.016
|
||||
KOH 3.345e-11 3.346e-11 -10.476 -10.476 0.000
|
||||
N(-3) 0.000e+00
|
||||
NH4+ 0.000e+00 0.000e+00 -62.763 -62.779 -0.016
|
||||
NH3 0.000e+00 0.000e+00 -65.023 -65.023 0.000
|
||||
N(0) 1.994e-19
|
||||
N2 9.971e-20 9.973e-20 -19.001 -19.001 0.000
|
||||
N(3) 2.291e-16
|
||||
NO2- 2.291e-16 2.210e-16 -15.640 -15.656 -0.016
|
||||
N(5) 1.000e-03
|
||||
NO3- 1.000e-03 9.647e-04 -3.000 -3.016 -0.016
|
||||
O(0) 4.375e-04
|
||||
O2 2.187e-04 2.188e-04 -3.660 -3.660 0.000
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
H2(g) -41.21 -44.36 -3.15 H2
|
||||
H2O(g) -1.51 -0.00 1.51 H2O
|
||||
N2(g) -15.74 -19.00 -3.26 N2
|
||||
NH3(g) -66.79 -65.02 1.77 NH3
|
||||
O2(g) -0.70 -3.66 -2.96 O2
|
||||
|
||||
------------------
|
||||
End of simulation.
|
||||
------------------
|
||||
|
||||
------------------------------------
|
||||
Reading input data for simulation 3.
|
||||
------------------------------------
|
||||
|
||||
TRANSPORT
|
||||
cells 20
|
||||
shifts 5
|
||||
flow_direction forward
|
||||
timest 3600
|
||||
bcond flux flux
|
||||
diffc 0.0
|
||||
length 0.1
|
||||
disp 0.015
|
||||
stagnant 1 6.8e-6 0.3 0.1
|
||||
PRINT
|
||||
WARNING: Cell-lengths were read for 1 cells. Last value is used till cell 20.
|
||||
WARNING: Dispersivities were read for 1 cells. Last value is used till cell 20.
|
||||
reset false
|
||||
END
|
||||
SOLUTION 0 # Original solution reenters
|
||||
units mmol/l
|
||||
pH 7.0
|
||||
pe 13.0 O2(g) -0.7
|
||||
K 1.0
|
||||
N(5) 1.0
|
||||
TRANSPORT
|
||||
shifts 10
|
||||
punch_frequency 10
|
||||
punch_cells 1-20
|
||||
SELECTED_OUTPUT
|
||||
file ex13a.sel
|
||||
reset false
|
||||
solution
|
||||
distance true
|
||||
USER_PUNCH
|
||||
heading Cl_mmol Na_mmol
|
||||
10 PUNCH TOT("Cl")*1000, TOT("Na")*1000
|
||||
END
|
||||
No memory leaks
|
||||
@ -1,42 +0,0 @@
|
||||
soln dist_x Cl_mmol Na_mmol
|
||||
0 -99 0.0000e+00 0.0000e+00
|
||||
1 0.05 9.6495e-01 8.8504e-01
|
||||
2 0.15 9.1812e-01 6.9360e-01
|
||||
3 0.25 8.4451e-01 4.3288e-01
|
||||
4 0.35 7.1652e-01 1.9734e-01
|
||||
5 0.45 4.9952e-01 6.0705e-02
|
||||
6 0.55 2.4048e-01 1.1785e-02
|
||||
7 0.65 7.2812e-02 1.4039e-03
|
||||
8 0.75 1.3132e-02 9.9324e-05
|
||||
9 0.85 1.2882e-03 3.8318e-06
|
||||
10 0.95 5.2940e-05 6.2140e-08
|
||||
11 1.05 0.0000e+00 0.0000e+00
|
||||
12 1.15 0.0000e+00 0.0000e+00
|
||||
13 1.25 0.0000e+00 0.0000e+00
|
||||
14 1.35 0.0000e+00 0.0000e+00
|
||||
15 1.45 0.0000e+00 0.0000e+00
|
||||
16 1.55 0.0000e+00 0.0000e+00
|
||||
17 1.65 0.0000e+00 0.0000e+00
|
||||
18 1.75 0.0000e+00 0.0000e+00
|
||||
19 1.85 0.0000e+00 0.0000e+00
|
||||
20 1.95 0.0000e+00 0.0000e+00
|
||||
1 0.05 7.5889e-03 2.0250e-02
|
||||
2 0.15 1.7993e-02 5.0943e-02
|
||||
3 0.25 3.3135e-02 1.0209e-01
|
||||
4 0.35 5.3591e-02 1.7480e-01
|
||||
5 0.45 8.0158e-02 2.5484e-01
|
||||
6 0.55 1.1396e-01 3.1308e-01
|
||||
7 0.65 1.5767e-01 3.2277e-01
|
||||
8 0.75 2.1666e-01 2.7968e-01
|
||||
9 0.85 2.9573e-01 2.0468e-01
|
||||
10 0.95 3.8769e-01 1.2726e-01
|
||||
11 1.05 4.6467e-01 6.7581e-02
|
||||
12 1.15 4.9243e-01 3.0745e-02
|
||||
13 1.25 4.5811e-01 1.1988e-02
|
||||
14 1.35 3.7620e-01 3.9981e-03
|
||||
15 1.45 2.7323e-01 1.1366e-03
|
||||
16 1.55 1.7416e-01 2.7440e-04
|
||||
17 1.65 9.6074e-02 5.6038e-05
|
||||
18 1.75 4.5211e-02 9.6477e-06
|
||||
19 1.85 1.7934e-02 1.3954e-06
|
||||
20 1.95 6.4869e-03 1.7678e-07
|
||||
@ -1,430 +0,0 @@
|
||||
Input file: /z/parkplace/home/dlpark/../../home/dlpark/programs/phreeqc/src/../src/Sun/../../examples/ex13b
|
||||
Output file: ex13b.out
|
||||
Database file: /z/parkplace/home/dlpark/../../home/dlpark/programs/phreeqc/src/../src/Sun/../../database/phreeqc.dat
|
||||
|
||||
------------------
|
||||
Reading data base.
|
||||
------------------
|
||||
|
||||
SOLUTION_MASTER_SPECIES
|
||||
SOLUTION_SPECIES
|
||||
PHASES
|
||||
EXCHANGE_MASTER_SPECIES
|
||||
EXCHANGE_SPECIES
|
||||
SURFACE_MASTER_SPECIES
|
||||
SURFACE_SPECIES
|
||||
RATES
|
||||
END
|
||||
------------------------------------
|
||||
Reading input data for simulation 1.
|
||||
------------------------------------
|
||||
|
||||
TITLE Example 13B.--1 mmol/l NaCl/NO3 enters column with stagnant zones.
|
||||
Explicit definition of first-order exchange factors.
|
||||
SOLUTION 0 # 1 mmol/l NaCl
|
||||
units mmol/l
|
||||
pH 7.0
|
||||
pe 13.0 O2(g) -0.7
|
||||
Na 1.0 # Na has Retardation = 2
|
||||
Cl 1.0 # Cl has Retardation = 1, stagnant exchange
|
||||
N(5) 1.0 # NO3 is conservative
|
||||
END
|
||||
-----
|
||||
TITLE
|
||||
-----
|
||||
|
||||
Example 13B.--1 mmol/l NaCl/NO3 enters column with stagnant zones.
|
||||
Explicit definition of first-order exchange factors.
|
||||
|
||||
-------------------------------------------
|
||||
Beginning of initial solution calculations.
|
||||
-------------------------------------------
|
||||
|
||||
Initial solution 0.
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
Cl 1.000e-03 1.000e-03
|
||||
N(5) 1.000e-03 1.000e-03
|
||||
Na 1.000e-03 1.000e-03
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 7.000
|
||||
pe = 13.605 Equilibrium with O2(g)
|
||||
Activity of water = 1.000
|
||||
Ionic strength = 1.500e-03
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total alkalinity (eq/kg) = 4.551e-10
|
||||
Total carbon (mol/kg) = 0.000e+00
|
||||
Total CO2 (mol/kg) = 0.000e+00
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = -1.000e-03
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = -33.33
|
||||
Iterations = 3
|
||||
Total H = 1.110124e+02
|
||||
Total O = 5.550965e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
OH- 1.046e-07 1.001e-07 -6.981 -7.000 -0.019
|
||||
H+ 1.042e-07 1.000e-07 -6.982 -7.000 -0.018
|
||||
H2O 5.551e+01 9.999e-01 1.744 -0.000 0.000
|
||||
Cl 1.000e-03
|
||||
Cl- 1.000e-03 9.576e-04 -3.000 -3.019 -0.019
|
||||
H(0) 0.000e+00
|
||||
H2 0.000e+00 0.000e+00 -44.360 -44.360 0.000
|
||||
N(5) 1.000e-03
|
||||
NO3- 1.000e-03 9.573e-04 -3.000 -3.019 -0.019
|
||||
Na 1.000e-03
|
||||
Na+ 1.000e-03 9.580e-04 -3.000 -3.019 -0.019
|
||||
NaOH 6.327e-11 6.329e-11 -10.199 -10.199 0.000
|
||||
O(0) 4.374e-04
|
||||
O2 2.187e-04 2.188e-04 -3.660 -3.660 0.000
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
H2(g) -41.21 -44.36 -3.15 H2
|
||||
H2O(g) -1.51 -0.00 1.51 H2O
|
||||
Halite -7.62 -6.04 1.58 NaCl
|
||||
O2(g) -0.70 -3.66 -2.96 O2
|
||||
|
||||
------------------
|
||||
End of simulation.
|
||||
------------------
|
||||
|
||||
------------------------------------
|
||||
Reading input data for simulation 2.
|
||||
------------------------------------
|
||||
|
||||
SOLUTION 1-41 # Column with KNO3
|
||||
units mmol/l
|
||||
pH 7.0
|
||||
pe 13.0 O2(g) -0.7
|
||||
K 1.0
|
||||
N(5) 1.0
|
||||
EXCHANGE 1-41
|
||||
equilibrate 1
|
||||
X 1.e-3
|
||||
EXCHANGE_SPECIES # For linear exchange, make KX exch. coeff. equal to NaX
|
||||
K+ + X- = KX
|
||||
log_k 0.0
|
||||
gamma 3.5 0.015
|
||||
END
|
||||
-------------------------------------------
|
||||
Beginning of initial solution calculations.
|
||||
-------------------------------------------
|
||||
|
||||
Initial solution 1.
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
K 1.000e-03 1.000e-03
|
||||
N(5) 1.000e-03 1.000e-03
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 7.000
|
||||
pe = 13.605 Equilibrium with O2(g)
|
||||
Activity of water = 1.000
|
||||
Ionic strength = 1.000e-03
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total alkalinity (eq/kg) = 3.351e-10
|
||||
Total carbon (mol/kg) = 0.000e+00
|
||||
Total CO2 (mol/kg) = 0.000e+00
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = -3.351e-10
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = -0.00
|
||||
Iterations = 3
|
||||
Total H = 1.110124e+02
|
||||
Total O = 5.550965e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
OH- 1.038e-07 1.001e-07 -6.984 -7.000 -0.016
|
||||
H+ 1.034e-07 1.000e-07 -6.985 -7.000 -0.015
|
||||
H2O 5.551e+01 1.000e+00 1.744 -0.000 0.000
|
||||
H(0) 0.000e+00
|
||||
H2 0.000e+00 0.000e+00 -44.360 -44.360 0.000
|
||||
K 1.000e-03
|
||||
K+ 1.000e-03 9.649e-04 -3.000 -3.016 -0.016
|
||||
KOH 3.345e-11 3.346e-11 -10.476 -10.476 0.000
|
||||
N(5) 1.000e-03
|
||||
NO3- 1.000e-03 9.647e-04 -3.000 -3.016 -0.016
|
||||
O(0) 4.375e-04
|
||||
O2 2.187e-04 2.188e-04 -3.660 -3.660 0.000
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
H2(g) -41.21 -44.36 -3.15 H2
|
||||
H2O(g) -1.51 -0.00 1.51 H2O
|
||||
O2(g) -0.70 -3.66 -2.96 O2
|
||||
|
||||
-------------------------------------------------------
|
||||
Beginning of initial exchange-composition calculations.
|
||||
-------------------------------------------------------
|
||||
|
||||
Exchange 1.
|
||||
|
||||
X 1.000e-03 mol
|
||||
|
||||
Equiv- Equivalent Log
|
||||
Species Moles alents Fraction Gamma
|
||||
|
||||
KX 1.000e-03 1.000e-03 1.000e+00 -0.016
|
||||
|
||||
-----------------------------------------
|
||||
Beginning of batch-reaction calculations.
|
||||
-----------------------------------------
|
||||
|
||||
Reaction step 1.
|
||||
|
||||
Using solution 1.
|
||||
Using exchange 1. Exchange assemblage after simulation 2.
|
||||
|
||||
-----------------------------Exchange composition------------------------------
|
||||
|
||||
X 1.000e-03 mol
|
||||
|
||||
Equiv- Equivalent Log
|
||||
Species Moles alents Fraction Gamma
|
||||
|
||||
KX 1.000e-03 1.000e-03 1.000e+00 -0.016
|
||||
NH4X 6.872e-63 6.872e-63 6.872e-60 -0.016
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
K 1.000e-03 1.000e-03
|
||||
N 1.000e-03 1.000e-03
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 7.000 Charge balance
|
||||
pe = 13.605 Adjusted to redox equilibrium
|
||||
Activity of water = 1.000
|
||||
Ionic strength = 1.000e-03
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total alkalinity (eq/kg) = 3.351e-10
|
||||
Total carbon (mol/kg) = 0.000e+00
|
||||
Total CO2 (mol/kg) = 0.000e+00
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = -3.351e-10
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = -0.00
|
||||
Iterations = 0
|
||||
Total H = 1.110124e+02
|
||||
Total O = 5.550965e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
OH- 1.038e-07 1.001e-07 -6.984 -7.000 -0.016
|
||||
H+ 1.034e-07 1.000e-07 -6.985 -7.000 -0.015
|
||||
H2O 5.551e+01 1.000e+00 1.744 -0.000 0.000
|
||||
H(0) 0.000e+00
|
||||
H2 0.000e+00 0.000e+00 -44.360 -44.360 0.000
|
||||
K 1.000e-03
|
||||
K+ 1.000e-03 9.649e-04 -3.000 -3.016 -0.016
|
||||
KOH 3.345e-11 3.346e-11 -10.476 -10.476 0.000
|
||||
N(-3) 0.000e+00
|
||||
NH4+ 0.000e+00 0.000e+00 -62.763 -62.779 -0.016
|
||||
NH3 0.000e+00 0.000e+00 -65.023 -65.023 0.000
|
||||
N(0) 1.994e-19
|
||||
N2 9.971e-20 9.973e-20 -19.001 -19.001 0.000
|
||||
N(3) 2.291e-16
|
||||
NO2- 2.291e-16 2.210e-16 -15.640 -15.656 -0.016
|
||||
N(5) 1.000e-03
|
||||
NO3- 1.000e-03 9.647e-04 -3.000 -3.016 -0.016
|
||||
O(0) 4.375e-04
|
||||
O2 2.187e-04 2.188e-04 -3.660 -3.660 0.000
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
H2(g) -41.21 -44.36 -3.15 H2
|
||||
H2O(g) -1.51 -0.00 1.51 H2O
|
||||
N2(g) -15.74 -19.00 -3.26 N2
|
||||
NH3(g) -66.79 -65.02 1.77 NH3
|
||||
O2(g) -0.70 -3.66 -2.96 O2
|
||||
|
||||
------------------
|
||||
End of simulation.
|
||||
------------------
|
||||
|
||||
------------------------------------
|
||||
Reading input data for simulation 3.
|
||||
------------------------------------
|
||||
|
||||
MIX 1
|
||||
1 .93038
|
||||
22 .06962
|
||||
MIX 2
|
||||
2 .93038
|
||||
23 .06962
|
||||
MIX 3
|
||||
3 .93038
|
||||
24 .06962
|
||||
MIX 4
|
||||
4 .93038
|
||||
25 .06962
|
||||
MIX 5
|
||||
5 .93038
|
||||
26 .06962
|
||||
MIX 6
|
||||
6 .93038
|
||||
27 .06962
|
||||
MIX 7
|
||||
7 .93038
|
||||
28 .06962
|
||||
MIX 8
|
||||
8 .93038
|
||||
29 .06962
|
||||
MIX 9
|
||||
9 .93038
|
||||
30 .06962
|
||||
MIX 10
|
||||
10 .93038
|
||||
31 .06962
|
||||
MIX 11
|
||||
11 .93038
|
||||
32 .06962
|
||||
MIX 12
|
||||
12 .93038
|
||||
33 .06962
|
||||
MIX 13
|
||||
13 .93038
|
||||
34 .06962
|
||||
MIX 14
|
||||
14 .93038
|
||||
35 .06962
|
||||
MIX 15
|
||||
15 .93038
|
||||
36 .06962
|
||||
MIX 16
|
||||
16 .93038
|
||||
37 .06962
|
||||
MIX 17
|
||||
17 .93038
|
||||
38 .06962
|
||||
MIX 18
|
||||
18 .93038
|
||||
39 .06962
|
||||
MIX 19
|
||||
19 .93038
|
||||
40 .06962
|
||||
MIX 20
|
||||
20 .93038
|
||||
41 .06962
|
||||
MIX 22
|
||||
1 .20886
|
||||
22 .79114
|
||||
MIX 23
|
||||
2 .20886
|
||||
23 .79114
|
||||
MIX 24
|
||||
3 .20886
|
||||
24 .79114
|
||||
MIX 25
|
||||
4 .20886
|
||||
25 .79114
|
||||
MIX 26
|
||||
5 .20886
|
||||
26 .79114
|
||||
MIX 27
|
||||
6 .20886
|
||||
27 .79114
|
||||
MIX 28
|
||||
7 .20886
|
||||
28 .79114
|
||||
MIX 29
|
||||
8 .20886
|
||||
29 .79114
|
||||
MIX 30
|
||||
9 .20886
|
||||
30 .79114
|
||||
MIX 31
|
||||
10 .20886
|
||||
31 .79114
|
||||
MIX 32
|
||||
11 .20886
|
||||
32 .79114
|
||||
MIX 33
|
||||
12 .20886
|
||||
33 .79114
|
||||
MIX 34
|
||||
13 .20886
|
||||
34 .79114
|
||||
MIX 35
|
||||
14 .20886
|
||||
35 .79114
|
||||
MIX 36
|
||||
15 .20886
|
||||
36 .79114
|
||||
MIX 37
|
||||
16 .20886
|
||||
37 .79114
|
||||
MIX 38
|
||||
17 .20886
|
||||
38 .79114
|
||||
MIX 39
|
||||
18 .20886
|
||||
39 .79114
|
||||
MIX 40
|
||||
19 .20886
|
||||
40 .79114
|
||||
MIX 41
|
||||
20 .20886
|
||||
41 .79114
|
||||
TRANSPORT
|
||||
cells 20
|
||||
shifts 5
|
||||
flow_direction forward
|
||||
timest 3600
|
||||
bcond flux flux
|
||||
diffc 0.0
|
||||
length 0.1
|
||||
disp 0.015
|
||||
stagnant 1
|
||||
PRINT
|
||||
WARNING: Cell-lengths were read for 1 cells. Last value is used till cell 20.
|
||||
WARNING: Dispersivities were read for 1 cells. Last value is used till cell 20.
|
||||
reset false
|
||||
END
|
||||
SOLUTION 0 # Original solution reenters
|
||||
units mmol/l
|
||||
pH 7.0
|
||||
pe 13.0 O2(g) -0.7
|
||||
K 1.0
|
||||
N(5) 1.0
|
||||
TRANSPORT
|
||||
shifts 10
|
||||
punch_frequency 10
|
||||
punch_cells 1-20
|
||||
SELECTED_OUTPUT
|
||||
file ex13b.sel
|
||||
reset false
|
||||
distance true
|
||||
solution
|
||||
USER_PUNCH
|
||||
heading Cl_mmol Na_mmol
|
||||
10 PUNCH TOT("Cl")*1000, TOT("Na")*1000
|
||||
END
|
||||
No memory leaks
|
||||
@ -1,42 +0,0 @@
|
||||
soln dist_x Cl_mmol Na_mmol
|
||||
0 -99 0.0000e+00 0.0000e+00
|
||||
1 0.05 9.6495e-01 8.8504e-01
|
||||
2 0.15 9.1812e-01 6.9360e-01
|
||||
3 0.25 8.4451e-01 4.3288e-01
|
||||
4 0.35 7.1652e-01 1.9734e-01
|
||||
5 0.45 4.9952e-01 6.0705e-02
|
||||
6 0.55 2.4048e-01 1.1785e-02
|
||||
7 0.65 7.2813e-02 1.4039e-03
|
||||
8 0.75 1.3132e-02 9.9324e-05
|
||||
9 0.85 1.2882e-03 3.8318e-06
|
||||
10 0.95 5.2941e-05 6.2140e-08
|
||||
11 1.05 0.0000e+00 0.0000e+00
|
||||
12 1.15 0.0000e+00 0.0000e+00
|
||||
13 1.25 0.0000e+00 0.0000e+00
|
||||
14 1.35 0.0000e+00 0.0000e+00
|
||||
15 1.45 0.0000e+00 0.0000e+00
|
||||
16 1.55 0.0000e+00 0.0000e+00
|
||||
17 1.65 0.0000e+00 0.0000e+00
|
||||
18 1.75 0.0000e+00 0.0000e+00
|
||||
19 1.85 0.0000e+00 0.0000e+00
|
||||
20 1.95 0.0000e+00 0.0000e+00
|
||||
1 0.05 7.5889e-03 2.0249e-02
|
||||
2 0.15 1.7993e-02 5.0943e-02
|
||||
3 0.25 3.3135e-02 1.0209e-01
|
||||
4 0.35 5.3590e-02 1.7480e-01
|
||||
5 0.45 8.0158e-02 2.5484e-01
|
||||
6 0.55 1.1395e-01 3.1308e-01
|
||||
7 0.65 1.5766e-01 3.2277e-01
|
||||
8 0.75 2.1666e-01 2.7969e-01
|
||||
9 0.85 2.9573e-01 2.0468e-01
|
||||
10 0.95 3.8768e-01 1.2727e-01
|
||||
11 1.05 4.6467e-01 6.7581e-02
|
||||
12 1.15 4.9243e-01 3.0745e-02
|
||||
13 1.25 4.5811e-01 1.1988e-02
|
||||
14 1.35 3.7620e-01 3.9981e-03
|
||||
15 1.45 2.7323e-01 1.1366e-03
|
||||
16 1.55 1.7416e-01 2.7440e-04
|
||||
17 1.65 9.6075e-02 5.6039e-05
|
||||
18 1.75 4.5211e-02 9.6477e-06
|
||||
19 1.85 1.7934e-02 1.3954e-06
|
||||
20 1.95 6.4870e-03 1.7678e-07
|
||||
@ -1,751 +0,0 @@
|
||||
Input file: /z/parkplace/home/dlpark/../../home/dlpark/programs/phreeqc/src/../src/Sun/../../examples/ex13c
|
||||
Output file: ex13c.out
|
||||
Database file: /z/parkplace/home/dlpark/../../home/dlpark/programs/phreeqc/src/../src/Sun/../../database/phreeqc.dat
|
||||
|
||||
------------------
|
||||
Reading data base.
|
||||
------------------
|
||||
|
||||
SOLUTION_MASTER_SPECIES
|
||||
SOLUTION_SPECIES
|
||||
PHASES
|
||||
EXCHANGE_MASTER_SPECIES
|
||||
EXCHANGE_SPECIES
|
||||
SURFACE_MASTER_SPECIES
|
||||
SURFACE_SPECIES
|
||||
RATES
|
||||
END
|
||||
------------------------------------
|
||||
Reading input data for simulation 1.
|
||||
------------------------------------
|
||||
|
||||
TITLE Example 13C.--1 mmol/l NaCl/NO3 enters column with stagnant zones.
|
||||
5 layer stagnant zone with finite differences.
|
||||
SOLUTION 0 # 1 mmol/l NaCl
|
||||
units mmol/l
|
||||
pH 7.0
|
||||
pe 13.0 O2(g) -0.7
|
||||
Na 1.0 # Na has Retardation = 2
|
||||
Cl 1.0 # Cl has Retardation = 1, stagnant exchange
|
||||
N(5) 1.0 # NO3 is conservative
|
||||
END
|
||||
-----
|
||||
TITLE
|
||||
-----
|
||||
|
||||
Example 13C.--1 mmol/l NaCl/NO3 enters column with stagnant zones.
|
||||
5 layer stagnant zone with finite differences.
|
||||
|
||||
-------------------------------------------
|
||||
Beginning of initial solution calculations.
|
||||
-------------------------------------------
|
||||
|
||||
Initial solution 0.
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
Cl 1.000e-03 1.000e-03
|
||||
N(5) 1.000e-03 1.000e-03
|
||||
Na 1.000e-03 1.000e-03
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 7.000
|
||||
pe = 13.605 Equilibrium with O2(g)
|
||||
Activity of water = 1.000
|
||||
Ionic strength = 1.500e-03
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total alkalinity (eq/kg) = 4.551e-10
|
||||
Total carbon (mol/kg) = 0.000e+00
|
||||
Total CO2 (mol/kg) = 0.000e+00
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = -1.000e-03
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = -33.33
|
||||
Iterations = 3
|
||||
Total H = 1.110124e+02
|
||||
Total O = 5.550965e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
OH- 1.046e-07 1.001e-07 -6.981 -7.000 -0.019
|
||||
H+ 1.042e-07 1.000e-07 -6.982 -7.000 -0.018
|
||||
H2O 5.551e+01 9.999e-01 1.744 -0.000 0.000
|
||||
Cl 1.000e-03
|
||||
Cl- 1.000e-03 9.576e-04 -3.000 -3.019 -0.019
|
||||
H(0) 0.000e+00
|
||||
H2 0.000e+00 0.000e+00 -44.360 -44.360 0.000
|
||||
N(5) 1.000e-03
|
||||
NO3- 1.000e-03 9.573e-04 -3.000 -3.019 -0.019
|
||||
Na 1.000e-03
|
||||
Na+ 1.000e-03 9.580e-04 -3.000 -3.019 -0.019
|
||||
NaOH 6.327e-11 6.329e-11 -10.199 -10.199 0.000
|
||||
O(0) 4.374e-04
|
||||
O2 2.187e-04 2.188e-04 -3.660 -3.660 0.000
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
H2(g) -41.21 -44.36 -3.15 H2
|
||||
H2O(g) -1.51 -0.00 1.51 H2O
|
||||
Halite -7.62 -6.04 1.58 NaCl
|
||||
O2(g) -0.70 -3.66 -2.96 O2
|
||||
|
||||
------------------
|
||||
End of simulation.
|
||||
------------------
|
||||
|
||||
------------------------------------
|
||||
Reading input data for simulation 2.
|
||||
------------------------------------
|
||||
|
||||
SOLUTION 1-121 # Column with KNO3
|
||||
units mmol/l
|
||||
pH 7.0
|
||||
pe 13.0 O2(g) -0.7
|
||||
K 1.0
|
||||
N(5) 1.0
|
||||
EXCHANGE 1-121
|
||||
equilibrate 1
|
||||
X 1.e-3
|
||||
EXCHANGE_SPECIES # For linear exchange, make KX exch. coeff. equal to NaX
|
||||
K+ + X- = KX
|
||||
log_k 0.0
|
||||
gamma 3.5 0.015
|
||||
END
|
||||
-------------------------------------------
|
||||
Beginning of initial solution calculations.
|
||||
-------------------------------------------
|
||||
|
||||
Initial solution 1.
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
K 1.000e-03 1.000e-03
|
||||
N(5) 1.000e-03 1.000e-03
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 7.000
|
||||
pe = 13.605 Equilibrium with O2(g)
|
||||
Activity of water = 1.000
|
||||
Ionic strength = 1.000e-03
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total alkalinity (eq/kg) = 3.351e-10
|
||||
Total carbon (mol/kg) = 0.000e+00
|
||||
Total CO2 (mol/kg) = 0.000e+00
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = -3.351e-10
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = -0.00
|
||||
Iterations = 3
|
||||
Total H = 1.110124e+02
|
||||
Total O = 5.550965e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
OH- 1.038e-07 1.001e-07 -6.984 -7.000 -0.016
|
||||
H+ 1.034e-07 1.000e-07 -6.985 -7.000 -0.015
|
||||
H2O 5.551e+01 1.000e+00 1.744 -0.000 0.000
|
||||
H(0) 0.000e+00
|
||||
H2 0.000e+00 0.000e+00 -44.360 -44.360 0.000
|
||||
K 1.000e-03
|
||||
K+ 1.000e-03 9.649e-04 -3.000 -3.016 -0.016
|
||||
KOH 3.345e-11 3.346e-11 -10.476 -10.476 0.000
|
||||
N(5) 1.000e-03
|
||||
NO3- 1.000e-03 9.647e-04 -3.000 -3.016 -0.016
|
||||
O(0) 4.375e-04
|
||||
O2 2.187e-04 2.188e-04 -3.660 -3.660 0.000
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
H2(g) -41.21 -44.36 -3.15 H2
|
||||
H2O(g) -1.51 -0.00 1.51 H2O
|
||||
O2(g) -0.70 -3.66 -2.96 O2
|
||||
|
||||
-------------------------------------------------------
|
||||
Beginning of initial exchange-composition calculations.
|
||||
-------------------------------------------------------
|
||||
|
||||
Exchange 1.
|
||||
|
||||
X 1.000e-03 mol
|
||||
|
||||
Equiv- Equivalent Log
|
||||
Species Moles alents Fraction Gamma
|
||||
|
||||
KX 1.000e-03 1.000e-03 1.000e+00 -0.016
|
||||
|
||||
-----------------------------------------
|
||||
Beginning of batch-reaction calculations.
|
||||
-----------------------------------------
|
||||
|
||||
Reaction step 1.
|
||||
|
||||
Using solution 1.
|
||||
Using exchange 1. Exchange assemblage after simulation 2.
|
||||
|
||||
-----------------------------Exchange composition------------------------------
|
||||
|
||||
X 1.000e-03 mol
|
||||
|
||||
Equiv- Equivalent Log
|
||||
Species Moles alents Fraction Gamma
|
||||
|
||||
KX 1.000e-03 1.000e-03 1.000e+00 -0.016
|
||||
NH4X 6.872e-63 6.872e-63 6.872e-60 -0.016
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
K 1.000e-03 1.000e-03
|
||||
N 1.000e-03 1.000e-03
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 7.000 Charge balance
|
||||
pe = 13.605 Adjusted to redox equilibrium
|
||||
Activity of water = 1.000
|
||||
Ionic strength = 1.000e-03
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total alkalinity (eq/kg) = 3.351e-10
|
||||
Total carbon (mol/kg) = 0.000e+00
|
||||
Total CO2 (mol/kg) = 0.000e+00
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = -3.351e-10
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = -0.00
|
||||
Iterations = 0
|
||||
Total H = 1.110124e+02
|
||||
Total O = 5.550965e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
OH- 1.038e-07 1.001e-07 -6.984 -7.000 -0.016
|
||||
H+ 1.034e-07 1.000e-07 -6.985 -7.000 -0.015
|
||||
H2O 5.551e+01 1.000e+00 1.744 -0.000 0.000
|
||||
H(0) 0.000e+00
|
||||
H2 0.000e+00 0.000e+00 -44.360 -44.360 0.000
|
||||
K 1.000e-03
|
||||
K+ 1.000e-03 9.649e-04 -3.000 -3.016 -0.016
|
||||
KOH 3.345e-11 3.346e-11 -10.476 -10.476 0.000
|
||||
N(-3) 0.000e+00
|
||||
NH4+ 0.000e+00 0.000e+00 -62.763 -62.779 -0.016
|
||||
NH3 0.000e+00 0.000e+00 -65.023 -65.023 0.000
|
||||
N(0) 1.994e-19
|
||||
N2 9.971e-20 9.973e-20 -19.001 -19.001 0.000
|
||||
N(3) 2.291e-16
|
||||
NO2- 2.291e-16 2.210e-16 -15.640 -15.656 -0.016
|
||||
N(5) 1.000e-03
|
||||
NO3- 1.000e-03 9.647e-04 -3.000 -3.016 -0.016
|
||||
O(0) 4.375e-04
|
||||
O2 2.187e-04 2.188e-04 -3.660 -3.660 0.000
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
H2(g) -41.21 -44.36 -3.15 H2
|
||||
H2O(g) -1.51 -0.00 1.51 H2O
|
||||
N2(g) -15.74 -19.00 -3.26 N2
|
||||
NH3(g) -66.79 -65.02 1.77 NH3
|
||||
O2(g) -0.70 -3.66 -2.96 O2
|
||||
|
||||
------------------
|
||||
End of simulation.
|
||||
------------------
|
||||
|
||||
------------------------------------
|
||||
Reading input data for simulation 3.
|
||||
------------------------------------
|
||||
|
||||
MIX 1
|
||||
1 0.90712
|
||||
22 0.09288
|
||||
MIX 22
|
||||
1 0.57098
|
||||
22 0.21656
|
||||
42 0.21246
|
||||
MIX 42
|
||||
22 0.35027
|
||||
42 0.45270
|
||||
62 0.19703
|
||||
MIX 62
|
||||
42 0.38368
|
||||
62 0.44579
|
||||
82 0.17053
|
||||
MIX 82
|
||||
62 0.46286
|
||||
82 0.42143
|
||||
102 0.11571
|
||||
MIX 102
|
||||
82 0.81000
|
||||
102 0.19000
|
||||
MIX 2
|
||||
2 0.90712
|
||||
23 0.09288
|
||||
MIX 23
|
||||
2 0.57098
|
||||
23 0.21656
|
||||
43 0.21246
|
||||
MIX 43
|
||||
23 0.35027
|
||||
43 0.45270
|
||||
63 0.19703
|
||||
MIX 63
|
||||
43 0.38368
|
||||
63 0.44579
|
||||
83 0.17053
|
||||
MIX 83
|
||||
63 0.46286
|
||||
83 0.42143
|
||||
103 0.11571
|
||||
MIX 103
|
||||
83 0.81000
|
||||
103 0.19000
|
||||
MIX 3
|
||||
3 0.90712
|
||||
24 0.09288
|
||||
MIX 24
|
||||
3 0.57098
|
||||
24 0.21656
|
||||
44 0.21246
|
||||
MIX 44
|
||||
24 0.35027
|
||||
44 0.45270
|
||||
64 0.19703
|
||||
MIX 64
|
||||
44 0.38368
|
||||
64 0.44579
|
||||
84 0.17053
|
||||
MIX 84
|
||||
64 0.46286
|
||||
84 0.42143
|
||||
104 0.11571
|
||||
MIX 104
|
||||
84 0.81000
|
||||
104 0.19000
|
||||
MIX 4
|
||||
4 0.90712
|
||||
25 0.09288
|
||||
MIX 25
|
||||
4 0.57098
|
||||
25 0.21656
|
||||
45 0.21246
|
||||
MIX 45
|
||||
25 0.35027
|
||||
45 0.45270
|
||||
65 0.19703
|
||||
MIX 65
|
||||
45 0.38368
|
||||
65 0.44579
|
||||
85 0.17053
|
||||
MIX 85
|
||||
65 0.46286
|
||||
85 0.42143
|
||||
105 0.11571
|
||||
MIX 105
|
||||
85 0.81000
|
||||
105 0.19000
|
||||
MIX 5
|
||||
5 0.90712
|
||||
26 0.09288
|
||||
MIX 26
|
||||
5 0.57098
|
||||
26 0.21656
|
||||
46 0.21246
|
||||
MIX 46
|
||||
26 0.35027
|
||||
46 0.45270
|
||||
66 0.19703
|
||||
MIX 66
|
||||
46 0.38368
|
||||
66 0.44579
|
||||
86 0.17053
|
||||
MIX 86
|
||||
66 0.46286
|
||||
86 0.42143
|
||||
106 0.11571
|
||||
MIX 106
|
||||
86 0.81000
|
||||
106 0.19000
|
||||
MIX 6
|
||||
6 0.90712
|
||||
27 0.09288
|
||||
MIX 27
|
||||
6 0.57098
|
||||
27 0.21656
|
||||
47 0.21246
|
||||
MIX 47
|
||||
27 0.35027
|
||||
47 0.45270
|
||||
67 0.19703
|
||||
MIX 67
|
||||
47 0.38368
|
||||
67 0.44579
|
||||
87 0.17053
|
||||
MIX 87
|
||||
67 0.46286
|
||||
87 0.42143
|
||||
107 0.11571
|
||||
MIX 107
|
||||
87 0.81000
|
||||
107 0.19000
|
||||
MIX 7
|
||||
7 0.90712
|
||||
28 0.09288
|
||||
MIX 28
|
||||
7 0.57098
|
||||
28 0.21656
|
||||
48 0.21246
|
||||
MIX 48
|
||||
28 0.35027
|
||||
48 0.45270
|
||||
68 0.19703
|
||||
MIX 68
|
||||
48 0.38368
|
||||
68 0.44579
|
||||
88 0.17053
|
||||
MIX 88
|
||||
68 0.46286
|
||||
88 0.42143
|
||||
108 0.11571
|
||||
MIX 108
|
||||
88 0.81000
|
||||
108 0.19000
|
||||
MIX 8
|
||||
8 0.90712
|
||||
29 0.09288
|
||||
MIX 29
|
||||
8 0.57098
|
||||
29 0.21656
|
||||
49 0.21246
|
||||
MIX 49
|
||||
29 0.35027
|
||||
49 0.45270
|
||||
69 0.19703
|
||||
MIX 69
|
||||
49 0.38368
|
||||
69 0.44579
|
||||
89 0.17053
|
||||
MIX 89
|
||||
69 0.46286
|
||||
89 0.42143
|
||||
109 0.11571
|
||||
MIX 109
|
||||
89 0.81000
|
||||
109 0.19000
|
||||
MIX 9
|
||||
9 0.90712
|
||||
30 0.09288
|
||||
MIX 30
|
||||
9 0.57098
|
||||
30 0.21656
|
||||
50 0.21246
|
||||
MIX 50
|
||||
30 0.35027
|
||||
50 0.45270
|
||||
70 0.19703
|
||||
MIX 70
|
||||
50 0.38368
|
||||
70 0.44579
|
||||
90 0.17053
|
||||
MIX 90
|
||||
70 0.46286
|
||||
90 0.42143
|
||||
110 0.11571
|
||||
MIX 110
|
||||
90 0.81000
|
||||
110 0.19000
|
||||
MIX 10
|
||||
10 0.90712
|
||||
31 0.09288
|
||||
MIX 31
|
||||
10 0.57098
|
||||
31 0.21656
|
||||
51 0.21246
|
||||
MIX 51
|
||||
31 0.35027
|
||||
51 0.45270
|
||||
71 0.19703
|
||||
MIX 71
|
||||
51 0.38368
|
||||
71 0.44579
|
||||
91 0.17053
|
||||
MIX 91
|
||||
71 0.46286
|
||||
91 0.42143
|
||||
111 0.11571
|
||||
MIX 111
|
||||
91 0.81000
|
||||
111 0.19000
|
||||
MIX 11
|
||||
11 0.90712
|
||||
32 0.09288
|
||||
MIX 32
|
||||
11 0.57098
|
||||
32 0.21656
|
||||
52 0.21246
|
||||
MIX 52
|
||||
32 0.35027
|
||||
52 0.45270
|
||||
72 0.19703
|
||||
MIX 72
|
||||
52 0.38368
|
||||
72 0.44579
|
||||
92 0.17053
|
||||
MIX 92
|
||||
72 0.46286
|
||||
92 0.42143
|
||||
112 0.11571
|
||||
MIX 112
|
||||
92 0.81000
|
||||
112 0.19000
|
||||
MIX 12
|
||||
12 0.90712
|
||||
33 0.09288
|
||||
MIX 33
|
||||
12 0.57098
|
||||
33 0.21656
|
||||
53 0.21246
|
||||
MIX 53
|
||||
33 0.35027
|
||||
53 0.45270
|
||||
73 0.19703
|
||||
MIX 73
|
||||
53 0.38368
|
||||
73 0.44579
|
||||
93 0.17053
|
||||
MIX 93
|
||||
73 0.46286
|
||||
93 0.42143
|
||||
113 0.11571
|
||||
MIX 113
|
||||
93 0.81000
|
||||
113 0.19000
|
||||
MIX 13
|
||||
13 0.90712
|
||||
34 0.09288
|
||||
MIX 34
|
||||
13 0.57098
|
||||
34 0.21656
|
||||
54 0.21246
|
||||
MIX 54
|
||||
34 0.35027
|
||||
54 0.45270
|
||||
74 0.19703
|
||||
MIX 74
|
||||
54 0.38368
|
||||
74 0.44579
|
||||
94 0.17053
|
||||
MIX 94
|
||||
74 0.46286
|
||||
94 0.42143
|
||||
114 0.11571
|
||||
MIX 114
|
||||
94 0.81000
|
||||
114 0.19000
|
||||
MIX 14
|
||||
14 0.90712
|
||||
35 0.09288
|
||||
MIX 35
|
||||
14 0.57098
|
||||
35 0.21656
|
||||
55 0.21246
|
||||
MIX 55
|
||||
35 0.35027
|
||||
55 0.45270
|
||||
75 0.19703
|
||||
MIX 75
|
||||
55 0.38368
|
||||
75 0.44579
|
||||
95 0.17053
|
||||
MIX 95
|
||||
75 0.46286
|
||||
95 0.42143
|
||||
115 0.11571
|
||||
MIX 115
|
||||
95 0.81000
|
||||
115 0.19000
|
||||
MIX 15
|
||||
15 0.90712
|
||||
36 0.09288
|
||||
MIX 36
|
||||
15 0.57098
|
||||
36 0.21656
|
||||
56 0.21246
|
||||
MIX 56
|
||||
36 0.35027
|
||||
56 0.45270
|
||||
76 0.19703
|
||||
MIX 76
|
||||
56 0.38368
|
||||
76 0.44579
|
||||
96 0.17053
|
||||
MIX 96
|
||||
76 0.46286
|
||||
96 0.42143
|
||||
116 0.11571
|
||||
MIX 116
|
||||
96 0.81000
|
||||
116 0.19000
|
||||
MIX 16
|
||||
16 0.90712
|
||||
37 0.09288
|
||||
MIX 37
|
||||
16 0.57098
|
||||
37 0.21656
|
||||
57 0.21246
|
||||
MIX 57
|
||||
37 0.35027
|
||||
57 0.45270
|
||||
77 0.19703
|
||||
MIX 77
|
||||
57 0.38368
|
||||
77 0.44579
|
||||
97 0.17053
|
||||
MIX 97
|
||||
77 0.46286
|
||||
97 0.42143
|
||||
117 0.11571
|
||||
MIX 117
|
||||
97 0.81000
|
||||
117 0.19000
|
||||
MIX 17
|
||||
17 0.90712
|
||||
38 0.09288
|
||||
MIX 38
|
||||
17 0.57098
|
||||
38 0.21656
|
||||
58 0.21246
|
||||
MIX 58
|
||||
38 0.35027
|
||||
58 0.45270
|
||||
78 0.19703
|
||||
MIX 78
|
||||
58 0.38368
|
||||
78 0.44579
|
||||
98 0.17053
|
||||
MIX 98
|
||||
78 0.46286
|
||||
98 0.42143
|
||||
118 0.11571
|
||||
MIX 118
|
||||
98 0.81000
|
||||
118 0.19000
|
||||
MIX 18
|
||||
18 0.90712
|
||||
39 0.09288
|
||||
MIX 39
|
||||
18 0.57098
|
||||
39 0.21656
|
||||
59 0.21246
|
||||
MIX 59
|
||||
39 0.35027
|
||||
59 0.45270
|
||||
79 0.19703
|
||||
MIX 79
|
||||
59 0.38368
|
||||
79 0.44579
|
||||
99 0.17053
|
||||
MIX 99
|
||||
79 0.46286
|
||||
99 0.42143
|
||||
119 0.11571
|
||||
MIX 119
|
||||
99 0.81000
|
||||
119 0.19000
|
||||
MIX 19
|
||||
19 0.90712
|
||||
40 0.09288
|
||||
MIX 40
|
||||
19 0.57098
|
||||
40 0.21656
|
||||
60 0.21246
|
||||
MIX 60
|
||||
40 0.35027
|
||||
60 0.45270
|
||||
80 0.19703
|
||||
MIX 80
|
||||
60 0.38368
|
||||
80 0.44579
|
||||
100 0.17053
|
||||
MIX 100
|
||||
80 0.46286
|
||||
100 0.42143
|
||||
120 0.11571
|
||||
MIX 120
|
||||
100 0.81000
|
||||
120 0.19000
|
||||
MIX 20
|
||||
20 0.90712
|
||||
41 0.09288
|
||||
MIX 41
|
||||
20 0.57098
|
||||
41 0.21656
|
||||
61 0.21246
|
||||
MIX 61
|
||||
41 0.35027
|
||||
61 0.45270
|
||||
81 0.19703
|
||||
MIX 81
|
||||
61 0.38368
|
||||
81 0.44579
|
||||
101 0.17053
|
||||
MIX 101
|
||||
81 0.46286
|
||||
101 0.42143
|
||||
121 0.11571
|
||||
MIX 121
|
||||
101 0.81000
|
||||
121 0.19000
|
||||
TRANSPORT
|
||||
cells 20
|
||||
shifts 5
|
||||
flow_direction forward
|
||||
timest 3600
|
||||
tempr 3.0
|
||||
bcond flux flux
|
||||
diffc 0.0
|
||||
length 0.10
|
||||
disp 0.015
|
||||
stagnant 5
|
||||
PRINT
|
||||
WARNING: Cell-lengths were read for 1 cells. Last value is used till cell 20.
|
||||
WARNING: Dispersivities were read for 1 cells. Last value is used till cell 20.
|
||||
reset false
|
||||
END
|
||||
SOLUTION 0 # Original solution reenters
|
||||
units mmol/l
|
||||
pH 7.0
|
||||
pe 13.0 O2(g) -0.7
|
||||
K 1.0
|
||||
N(5) 1.0
|
||||
TRANSPORT
|
||||
shifts 10
|
||||
punch_frequency 10
|
||||
punch_cells 1-20
|
||||
SELECTED_OUTPUT
|
||||
file ex13c.sel
|
||||
reset false
|
||||
solution
|
||||
distance true
|
||||
USER_PUNCH
|
||||
heading Cl_mmol Na_mmol
|
||||
10 PUNCH TOT("Cl")*1000, TOT("Na")*1000
|
||||
END
|
||||
No memory leaks
|
||||
@ -1,42 +0,0 @@
|
||||
soln dist_x Cl_mmol Na_mmol
|
||||
0 -99 0.0000e+00 0.0000e+00
|
||||
1 0.05 9.7683e-01 8.8829e-01
|
||||
2 0.15 9.4255e-01 6.9066e-01
|
||||
3 0.25 8.7253e-01 4.2503e-01
|
||||
4 0.35 7.2600e-01 1.9091e-01
|
||||
5 0.45 4.8246e-01 5.8021e-02
|
||||
6 0.55 2.2239e-01 1.1177e-02
|
||||
7 0.65 6.5489e-02 1.3256e-03
|
||||
8 0.75 1.1639e-02 9.3569e-05
|
||||
9 0.85 1.1350e-03 3.6065e-06
|
||||
10 0.95 4.6646e-05 5.8485e-08
|
||||
11 1.05 0.0000e+00 0.0000e+00
|
||||
12 1.15 0.0000e+00 0.0000e+00
|
||||
13 1.25 0.0000e+00 0.0000e+00
|
||||
14 1.35 0.0000e+00 0.0000e+00
|
||||
15 1.45 0.0000e+00 0.0000e+00
|
||||
16 1.55 0.0000e+00 0.0000e+00
|
||||
17 1.65 0.0000e+00 0.0000e+00
|
||||
18 1.75 0.0000e+00 0.0000e+00
|
||||
19 1.85 0.0000e+00 0.0000e+00
|
||||
20 1.95 0.0000e+00 0.0000e+00
|
||||
1 0.05 4.7101e-03 1.6916e-02
|
||||
2 0.15 1.0234e-02 4.9729e-02
|
||||
3 0.25 1.8109e-02 1.0883e-01
|
||||
4 0.35 2.9565e-02 1.9194e-01
|
||||
5 0.45 4.7408e-02 2.7841e-01
|
||||
6 0.55 7.7191e-02 3.3492e-01
|
||||
7 0.65 1.2832e-01 3.3632e-01
|
||||
8 0.75 2.1109e-01 2.8375e-01
|
||||
9 0.85 3.2572e-01 2.0251e-01
|
||||
10 0.95 4.4908e-01 1.2304e-01
|
||||
11 1.05 5.3819e-01 6.3977e-02
|
||||
12 1.15 5.5716e-01 2.8554e-02
|
||||
13 1.25 5.0158e-01 1.0943e-02
|
||||
14 1.35 3.9581e-01 3.5935e-03
|
||||
15 1.45 2.7424e-01 1.0078e-03
|
||||
16 1.55 1.6586e-01 2.4047e-04
|
||||
17 1.65 8.6688e-02 4.8621e-05
|
||||
18 1.75 3.8743e-02 8.3007e-06
|
||||
19 1.85 1.4669e-02 1.1922e-06
|
||||
20 1.95 5.0940e-03 1.5016e-07
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,202 +0,0 @@
|
||||
step m_Ca m_Mg m_Na umol_As pH
|
||||
1 4.6428e-01 1.6167e-01 5.4020e+00 5.0000e-02 5.3496e+00
|
||||
1 5.2071e-04 3.6797e-04 1.0345e-01 2.9703e-04 7.0358e+00
|
||||
2 4.3418e-05 3.0073e-05 2.7681e-02 1.4274e-02 8.4251e+00
|
||||
3 1.6723e-05 1.0553e-05 1.5102e-02 1.7369e-01 9.0861e+00
|
||||
4 1.3810e-05 8.4300e-06 1.2580e-02 3.4749e-01 9.2687e+00
|
||||
5 1.3241e-05 8.0170e-06 1.1705e-02 4.2057e-01 9.3189e+00
|
||||
6 1.3253e-05 8.0279e-06 1.1293e-02 4.3148e-01 9.3249e+00
|
||||
7 1.3481e-05 8.1962e-06 1.1055e-02 4.1548e-01 9.3142e+00
|
||||
8 1.3805e-05 8.4346e-06 1.0889e-02 3.9004e-01 9.2967e+00
|
||||
9 1.4178e-05 8.7091e-06 1.0758e-02 3.6247e-01 9.2767e+00
|
||||
10 1.4581e-05 9.0053e-06 1.0645e-02 3.3557e-01 9.2558e+00
|
||||
11 1.5006e-05 9.3176e-06 1.0542e-02 3.1029e-01 9.2348e+00
|
||||
12 1.5449e-05 9.6438e-06 1.0447e-02 2.8686e-01 9.2138e+00
|
||||
13 1.5911e-05 9.9834e-06 1.0358e-02 2.6525e-01 9.1929e+00
|
||||
14 1.6392e-05 1.0337e-05 1.0274e-02 2.4534e-01 9.1722e+00
|
||||
15 1.6892e-05 1.0704e-05 1.0195e-02 2.2698e-01 9.1517e+00
|
||||
16 1.7412e-05 1.1087e-05 1.0119e-02 2.1004e-01 9.1314e+00
|
||||
17 1.7954e-05 1.1485e-05 1.0047e-02 1.9440e-01 9.1111e+00
|
||||
18 1.8519e-05 1.1901e-05 9.9787e-03 1.7994e-01 9.0910e+00
|
||||
19 1.9109e-05 1.2335e-05 9.9131e-03 1.6656e-01 9.0710e+00
|
||||
20 1.9725e-05 1.2787e-05 9.8504e-03 1.5418e-01 9.0510e+00
|
||||
21 2.0368e-05 1.3260e-05 9.7904e-03 1.4270e-01 9.0311e+00
|
||||
22 2.1041e-05 1.3755e-05 9.7328e-03 1.3206e-01 9.0112e+00
|
||||
23 2.1745e-05 1.4273e-05 9.6775e-03 1.2220e-01 8.9913e+00
|
||||
24 2.2482e-05 1.4815e-05 9.6243e-03 1.1304e-01 8.9714e+00
|
||||
25 2.3254e-05 1.5383e-05 9.5731e-03 1.0454e-01 8.9515e+00
|
||||
26 2.4064e-05 1.5978e-05 9.5238e-03 9.6657e-02 8.9316e+00
|
||||
27 2.4914e-05 1.6603e-05 9.4761e-03 8.9334e-02 8.9116e+00
|
||||
28 2.5807e-05 1.7260e-05 9.4301e-03 8.2534e-02 8.8916e+00
|
||||
29 2.6745e-05 1.7950e-05 9.3855e-03 7.6219e-02 8.8715e+00
|
||||
30 2.7732e-05 1.8675e-05 9.3423e-03 7.0356e-02 8.8514e+00
|
||||
31 2.8770e-05 1.9439e-05 9.3004e-03 6.4912e-02 8.8312e+00
|
||||
32 2.9863e-05 2.0243e-05 9.2597e-03 5.9857e-02 8.8109e+00
|
||||
33 3.1015e-05 2.1090e-05 9.2200e-03 5.5166e-02 8.7905e+00
|
||||
34 3.2230e-05 2.1983e-05 9.1814e-03 5.0812e-02 8.7699e+00
|
||||
35 3.3513e-05 2.2926e-05 9.1436e-03 4.6773e-02 8.7493e+00
|
||||
36 3.4867e-05 2.3922e-05 9.1067e-03 4.3028e-02 8.7285e+00
|
||||
37 3.6299e-05 2.4975e-05 9.0705e-03 3.9555e-02 8.7076e+00
|
||||
38 3.7813e-05 2.6089e-05 9.0350e-03 3.6337e-02 8.6865e+00
|
||||
39 3.9416e-05 2.7267e-05 9.0000e-03 3.3356e-02 8.6653e+00
|
||||
40 4.1113e-05 2.8516e-05 8.9656e-03 3.0597e-02 8.6439e+00
|
||||
41 4.2913e-05 2.9840e-05 8.9315e-03 2.8043e-02 8.6224e+00
|
||||
42 4.4823e-05 3.1244e-05 8.8978e-03 2.5682e-02 8.6006e+00
|
||||
43 4.6851e-05 3.2736e-05 8.8643e-03 2.3500e-02 8.5787e+00
|
||||
44 4.9006e-05 3.4321e-05 8.8310e-03 2.1485e-02 8.5565e+00
|
||||
45 5.1298e-05 3.6006e-05 8.7977e-03 1.9626e-02 8.5342e+00
|
||||
46 5.3738e-05 3.7800e-05 8.7644e-03 1.7911e-02 8.5116e+00
|
||||
47 5.6337e-05 3.9712e-05 8.7309e-03 1.6331e-02 8.4889e+00
|
||||
48 5.9107e-05 4.1749e-05 8.6973e-03 1.4877e-02 8.4658e+00
|
||||
49 6.2064e-05 4.3924e-05 8.6633e-03 1.3539e-02 8.4426e+00
|
||||
50 6.5221e-05 4.6246e-05 8.6288e-03 1.2309e-02 8.4191e+00
|
||||
51 6.8596e-05 4.8728e-05 8.5938e-03 1.1181e-02 8.3954e+00
|
||||
52 7.2206e-05 5.1383e-05 8.5581e-03 1.0146e-02 8.3714e+00
|
||||
53 7.6071e-05 5.4225e-05 8.5216e-03 9.1972e-03 8.3471e+00
|
||||
54 8.0212e-05 5.7271e-05 8.4840e-03 8.3294e-03 8.3226e+00
|
||||
55 8.4653e-05 6.0537e-05 8.4454e-03 7.5361e-03 8.2978e+00
|
||||
56 8.9419e-05 6.4042e-05 8.4055e-03 6.8118e-03 8.2727e+00
|
||||
57 9.4538e-05 6.7807e-05 8.3641e-03 6.1514e-03 8.2473e+00
|
||||
58 1.0004e-04 7.1853e-05 8.3211e-03 5.5498e-03 8.2217e+00
|
||||
59 1.0596e-04 7.6206e-05 8.2762e-03 5.0027e-03 8.1958e+00
|
||||
60 1.1233e-04 8.0892e-05 8.2293e-03 4.5057e-03 8.1696e+00
|
||||
61 1.1919e-04 8.5939e-05 8.1800e-03 4.0548e-03 8.1431e+00
|
||||
62 1.2659e-04 9.1378e-05 8.1283e-03 3.6464e-03 8.1164e+00
|
||||
63 1.3456e-04 9.7244e-05 8.0737e-03 3.2769e-03 8.0893e+00
|
||||
64 1.4317e-04 1.0357e-04 8.0161e-03 2.9432e-03 8.0621e+00
|
||||
65 1.5246e-04 1.1040e-04 7.9550e-03 2.6421e-03 8.0345e+00
|
||||
66 1.6249e-04 1.1778e-04 7.8904e-03 2.3710e-03 8.0067e+00
|
||||
67 1.7301e-04 1.2608e-04 7.8205e-03 2.1257e-03 7.9786e+00
|
||||
68 1.8432e-04 1.3516e-04 7.7465e-03 1.9049e-03 7.9501e+00
|
||||
69 1.9654e-04 1.4497e-04 7.6681e-03 1.7071e-03 7.9214e+00
|
||||
70 2.0974e-04 1.5559e-04 7.5847e-03 1.5302e-03 7.8925e+00
|
||||
71 2.2397e-04 1.6707e-04 7.4960e-03 1.3724e-03 7.8636e+00
|
||||
72 2.3933e-04 1.7947e-04 7.4015e-03 1.2317e-03 7.8345e+00
|
||||
73 2.5587e-04 1.9285e-04 7.3009e-03 1.1064e-03 7.8054e+00
|
||||
74 2.7370e-04 2.0729e-04 7.1938e-03 9.9507e-04 7.7763e+00
|
||||
75 2.9288e-04 2.2286e-04 7.0799e-03 8.9618e-04 7.7472e+00
|
||||
76 3.1349e-04 2.3961e-04 6.9590e-03 8.0843e-04 7.7182e+00
|
||||
77 3.3561e-04 2.5763e-04 6.8306e-03 7.3066e-04 7.6893e+00
|
||||
78 3.5933e-04 2.7696e-04 6.6948e-03 6.6179e-04 7.6606e+00
|
||||
79 3.8469e-04 2.9767e-04 6.5512e-03 6.0086e-04 7.6321e+00
|
||||
80 4.1177e-04 3.1980e-04 6.3998e-03 5.4698e-04 7.6039e+00
|
||||
81 4.4060e-04 3.4340e-04 6.2406e-03 4.9938e-04 7.5760e+00
|
||||
82 4.7122e-04 3.6849e-04 6.0737e-03 4.5735e-04 7.5485e+00
|
||||
83 5.0365e-04 3.9509e-04 5.8993e-03 4.2027e-04 7.5215e+00
|
||||
84 5.3788e-04 4.2320e-04 5.7176e-03 3.8756e-04 7.4950e+00
|
||||
85 5.7386e-04 4.5277e-04 5.5290e-03 3.5874e-04 7.4691e+00
|
||||
86 6.1156e-04 4.8377e-04 5.3342e-03 3.3335e-04 7.4438e+00
|
||||
87 6.5087e-04 5.1613e-04 5.1337e-03 3.1101e-04 7.4193e+00
|
||||
88 6.9168e-04 5.4973e-04 4.9284e-03 2.9135e-04 7.3955e+00
|
||||
89 7.3384e-04 5.8447e-04 4.7190e-03 2.7407e-04 7.3726e+00
|
||||
90 7.7716e-04 6.2017e-04 4.5066e-03 2.5890e-04 7.3505e+00
|
||||
91 8.2146e-04 6.5669e-04 4.2923e-03 2.4559e-04 7.3293e+00
|
||||
92 8.6649e-04 6.9381e-04 4.0771e-03 2.3392e-04 7.3090e+00
|
||||
93 9.1201e-04 7.3133e-04 3.8623e-03 2.2372e-04 7.2897e+00
|
||||
94 9.5775e-04 7.6903e-04 3.6490e-03 2.1480e-04 7.2714e+00
|
||||
95 1.0035e-03 8.0669e-04 3.4384e-03 2.0702e-04 7.2541e+00
|
||||
96 1.0489e-03 8.4407e-04 3.2315e-03 2.0024e-04 7.2377e+00
|
||||
97 1.0937e-03 8.8096e-04 3.0295e-03 1.9436e-04 7.2223e+00
|
||||
98 1.1377e-03 9.1715e-04 2.8333e-03 1.8926e-04 7.2079e+00
|
||||
99 1.1807e-03 9.5246e-04 2.6436e-03 1.8485e-04 7.1945e+00
|
||||
100 1.2224e-03 9.8670e-04 2.4613e-03 1.8105e-04 7.1819e+00
|
||||
101 1.2628e-03 1.0197e-03 2.2869e-03 1.7780e-04 7.1703e+00
|
||||
102 1.3015e-03 1.0514e-03 2.1208e-03 1.7501e-04 7.1595e+00
|
||||
103 1.3386e-03 1.0817e-03 1.9634e-03 1.7264e-04 7.1495e+00
|
||||
104 1.3740e-03 1.1105e-03 1.8148e-03 1.7063e-04 7.1403e+00
|
||||
105 1.4074e-03 1.1377e-03 1.6752e-03 1.6893e-04 7.1318e+00
|
||||
106 1.4391e-03 1.1633e-03 1.5444e-03 1.6752e-04 7.1239e+00
|
||||
107 1.4689e-03 1.1874e-03 1.4225e-03 1.6634e-04 7.1168e+00
|
||||
108 1.4968e-03 1.2099e-03 1.3090e-03 1.6537e-04 7.1102e+00
|
||||
109 1.5229e-03 1.2309e-03 1.2038e-03 1.6458e-04 7.1042e+00
|
||||
110 1.5472e-03 1.2503e-03 1.1066e-03 1.6394e-04 7.0987e+00
|
||||
111 1.5699e-03 1.2683e-03 1.0170e-03 1.6344e-04 7.0937e+00
|
||||
112 1.5909e-03 1.2849e-03 9.3458e-04 1.6305e-04 7.0891e+00
|
||||
113 1.6103e-03 1.3002e-03 8.5895e-04 1.6275e-04 7.0850e+00
|
||||
114 1.6282e-03 1.3143e-03 7.8970e-04 1.6254e-04 7.0812e+00
|
||||
115 1.6448e-03 1.3271e-03 7.2642e-04 1.6239e-04 7.0777e+00
|
||||
116 1.6600e-03 1.3389e-03 6.6867e-04 1.6229e-04 7.0746e+00
|
||||
117 1.6740e-03 1.3496e-03 6.1608e-04 1.6225e-04 7.0718e+00
|
||||
118 1.6868e-03 1.3594e-03 5.6824e-04 1.6224e-04 7.0692e+00
|
||||
119 1.6986e-03 1.3682e-03 5.2478e-04 1.6226e-04 7.0669e+00
|
||||
120 1.7093e-03 1.3763e-03 4.8535e-04 1.6230e-04 7.0648e+00
|
||||
121 1.7192e-03 1.3836e-03 4.4962e-04 1.6236e-04 7.0629e+00
|
||||
122 1.7282e-03 1.3901e-03 4.1726e-04 1.6244e-04 7.0612e+00
|
||||
123 1.7365e-03 1.3960e-03 3.8800e-04 1.6252e-04 7.0596e+00
|
||||
124 1.7441e-03 1.4014e-03 3.6155e-04 1.6262e-04 7.0582e+00
|
||||
125 1.7509e-03 1.4062e-03 3.3765e-04 1.6272e-04 7.0569e+00
|
||||
126 1.7572e-03 1.4105e-03 3.1609e-04 1.6282e-04 7.0558e+00
|
||||
127 1.7630e-03 1.4143e-03 2.9664e-04 1.6292e-04 7.0547e+00
|
||||
128 1.7683e-03 1.4178e-03 2.7910e-04 1.6302e-04 7.0538e+00
|
||||
129 1.7731e-03 1.4208e-03 2.6330e-04 1.6312e-04 7.0529e+00
|
||||
130 1.7774e-03 1.4236e-03 2.4907e-04 1.6321e-04 7.0522e+00
|
||||
131 1.7815e-03 1.4260e-03 2.3626e-04 1.6331e-04 7.0515e+00
|
||||
132 1.7851e-03 1.4281e-03 2.2472e-04 1.6339e-04 7.0509e+00
|
||||
133 1.7885e-03 1.4300e-03 2.1435e-04 1.6348e-04 7.0503e+00
|
||||
134 1.7916e-03 1.4317e-03 2.0502e-04 1.6356e-04 7.0498e+00
|
||||
135 1.7944e-03 1.4331e-03 1.9662e-04 1.6364e-04 7.0494e+00
|
||||
136 1.7970e-03 1.4344e-03 1.8908e-04 1.6371e-04 7.0490e+00
|
||||
137 1.7994e-03 1.4355e-03 1.8230e-04 1.6377e-04 7.0486e+00
|
||||
138 1.8016e-03 1.4364e-03 1.7621e-04 1.6384e-04 7.0483e+00
|
||||
139 1.8036e-03 1.4372e-03 1.7073e-04 1.6390e-04 7.0480e+00
|
||||
140 1.8055e-03 1.4379e-03 1.6582e-04 1.6395e-04 7.0477e+00
|
||||
141 1.8072e-03 1.4385e-03 1.6140e-04 1.6400e-04 7.0475e+00
|
||||
142 1.8088e-03 1.4390e-03 1.5743e-04 1.6405e-04 7.0473e+00
|
||||
143 1.8103e-03 1.4394e-03 1.5387e-04 1.6409e-04 7.0471e+00
|
||||
144 1.8117e-03 1.4397e-03 1.5068e-04 1.6413e-04 7.0469e+00
|
||||
145 1.8130e-03 1.4399e-03 1.4780e-04 1.6417e-04 7.0467e+00
|
||||
146 1.8142e-03 1.4401e-03 1.4523e-04 1.6421e-04 7.0466e+00
|
||||
147 1.8153e-03 1.4402e-03 1.4291e-04 1.6424e-04 7.0465e+00
|
||||
148 1.8164e-03 1.4402e-03 1.4084e-04 1.6427e-04 7.0464e+00
|
||||
149 1.8174e-03 1.4402e-03 1.3897e-04 1.6429e-04 7.0463e+00
|
||||
150 1.8183e-03 1.4402e-03 1.3730e-04 1.6432e-04 7.0462e+00
|
||||
151 1.8192e-03 1.4401e-03 1.3580e-04 1.6434e-04 7.0461e+00
|
||||
152 1.8200e-03 1.4400e-03 1.3445e-04 1.6436e-04 7.0461e+00
|
||||
153 1.8208e-03 1.4399e-03 1.3325e-04 1.6438e-04 7.0460e+00
|
||||
154 1.8216e-03 1.4397e-03 1.3216e-04 1.6440e-04 7.0459e+00
|
||||
155 1.8223e-03 1.4396e-03 1.3119e-04 1.6441e-04 7.0459e+00
|
||||
156 1.8230e-03 1.4394e-03 1.3032e-04 1.6443e-04 7.0459e+00
|
||||
157 1.8236e-03 1.4391e-03 1.2953e-04 1.6444e-04 7.0458e+00
|
||||
158 1.8243e-03 1.4389e-03 1.2883e-04 1.6446e-04 7.0458e+00
|
||||
159 1.8249e-03 1.4386e-03 1.2820e-04 1.6447e-04 7.0458e+00
|
||||
160 1.8255e-03 1.4384e-03 1.2763e-04 1.6448e-04 7.0457e+00
|
||||
161 1.8260e-03 1.4381e-03 1.2713e-04 1.6449e-04 7.0457e+00
|
||||
162 1.8266e-03 1.4378e-03 1.2667e-04 1.6450e-04 7.0457e+00
|
||||
163 1.8271e-03 1.4375e-03 1.2626e-04 1.6451e-04 7.0457e+00
|
||||
164 1.8276e-03 1.4372e-03 1.2590e-04 1.6451e-04 7.0457e+00
|
||||
165 1.8281e-03 1.4369e-03 1.2557e-04 1.6452e-04 7.0457e+00
|
||||
166 1.8286e-03 1.4366e-03 1.2527e-04 1.6453e-04 7.0457e+00
|
||||
167 1.8291e-03 1.4363e-03 1.2501e-04 1.6453e-04 7.0456e+00
|
||||
168 1.8296e-03 1.4360e-03 1.2477e-04 1.6454e-04 7.0456e+00
|
||||
169 1.8300e-03 1.4356e-03 1.2456e-04 1.6454e-04 7.0456e+00
|
||||
170 1.8305e-03 1.4353e-03 1.2437e-04 1.6455e-04 7.0456e+00
|
||||
171 1.8309e-03 1.4350e-03 1.2420e-04 1.6455e-04 7.0456e+00
|
||||
172 1.8313e-03 1.4347e-03 1.2404e-04 1.6456e-04 7.0456e+00
|
||||
173 1.8318e-03 1.4343e-03 1.2390e-04 1.6456e-04 7.0456e+00
|
||||
174 1.8322e-03 1.4340e-03 1.2378e-04 1.6456e-04 7.0456e+00
|
||||
175 1.8326e-03 1.4337e-03 1.2367e-04 1.6457e-04 7.0456e+00
|
||||
176 1.8330e-03 1.4333e-03 1.2357e-04 1.6457e-04 7.0456e+00
|
||||
177 1.8334e-03 1.4330e-03 1.2348e-04 1.6457e-04 7.0456e+00
|
||||
178 1.8338e-03 1.4327e-03 1.2340e-04 1.6458e-04 7.0456e+00
|
||||
179 1.8342e-03 1.4323e-03 1.2333e-04 1.6458e-04 7.0457e+00
|
||||
180 1.8346e-03 1.4320e-03 1.2326e-04 1.6458e-04 7.0457e+00
|
||||
181 1.8349e-03 1.4317e-03 1.2321e-04 1.6458e-04 7.0457e+00
|
||||
182 1.8353e-03 1.4313e-03 1.2315e-04 1.6459e-04 7.0457e+00
|
||||
183 1.8357e-03 1.4310e-03 1.2311e-04 1.6459e-04 7.0457e+00
|
||||
184 1.8360e-03 1.4307e-03 1.2306e-04 1.6459e-04 7.0457e+00
|
||||
185 1.8364e-03 1.4304e-03 1.2303e-04 1.6459e-04 7.0457e+00
|
||||
186 1.8368e-03 1.4300e-03 1.2299e-04 1.6460e-04 7.0457e+00
|
||||
187 1.8371e-03 1.4297e-03 1.2296e-04 1.6460e-04 7.0457e+00
|
||||
188 1.8375e-03 1.4294e-03 1.2294e-04 1.6460e-04 7.0457e+00
|
||||
189 1.8378e-03 1.4291e-03 1.2291e-04 1.6460e-04 7.0457e+00
|
||||
190 1.8382e-03 1.4287e-03 1.2289e-04 1.6460e-04 7.0457e+00
|
||||
191 1.8385e-03 1.4284e-03 1.2287e-04 1.6460e-04 7.0457e+00
|
||||
192 1.8388e-03 1.4281e-03 1.2285e-04 1.6461e-04 7.0457e+00
|
||||
193 1.8392e-03 1.4278e-03 1.2284e-04 1.6461e-04 7.0457e+00
|
||||
194 1.8395e-03 1.4275e-03 1.2282e-04 1.6461e-04 7.0457e+00
|
||||
195 1.8398e-03 1.4272e-03 1.2281e-04 1.6461e-04 7.0457e+00
|
||||
196 1.8402e-03 1.4269e-03 1.2280e-04 1.6461e-04 7.0458e+00
|
||||
197 1.8405e-03 1.4266e-03 1.2279e-04 1.6461e-04 7.0458e+00
|
||||
198 1.8408e-03 1.4263e-03 1.2278e-04 1.6462e-04 7.0458e+00
|
||||
199 1.8411e-03 1.4260e-03 1.2277e-04 1.6462e-04 7.0458e+00
|
||||
200 1.8415e-03 1.4257e-03 1.2276e-04 1.6462e-04 7.0458e+00
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,78 +0,0 @@
|
||||
sim state soln dist_x time step pH pe m_Nta-3 m_CoNta- m_HNta-2 m_Co+2 hours Co_sorb CoNta_sorb Biomass
|
||||
1 transp 10 9.5 0 0 6 14.3937 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 5.0000e-01 0.0000e+00 0.0000e+00 0.0000e+00
|
||||
1 transp 10 9.5 3600 1 6 14.3937 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 1.5000e+00 0.0000e+00 0.0000e+00 1.3572e-04
|
||||
1 transp 10 9.5 7200 2 6 14.3937 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 2.5000e+00 0.0000e+00 0.0000e+00 1.3544e-04
|
||||
1 transp 10 9.5 10800 3 6 14.3937 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 3.5000e+00 0.0000e+00 0.0000e+00 1.3515e-04
|
||||
1 transp 10 9.5 14400 4 6 14.3937 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 4.5000e+00 0.0000e+00 0.0000e+00 1.3487e-04
|
||||
1 transp 10 9.5 18000 5 6 14.3937 4.1637e-17 4.8355e-19 8.3076e-13 2.3172e-14 5.5000e+00 6.1781e-18 1.4377e-22 1.3459e-04
|
||||
1 transp 10 9.5 21600 6 6.00019 14.3935 5.3587e-15 7.6672e-15 1.0687e-10 2.8548e-12 6.5000e+00 1.0994e-15 2.6066e-18 1.3431e-04
|
||||
1 transp 10 9.5 25200 7 6.00441 14.3893 1.1039e-13 3.4338e-12 2.1803e-09 6.2065e-11 7.5000e+00 2.2731e-14 9.7754e-16 1.3406e-04
|
||||
1 transp 10 9.5 28800 8 6.03587 14.3576 8.7248e-13 1.8088e-10 1.6028e-08 4.1366e-10 8.5000e+00 1.5703e-13 4.8045e-14 1.3399e-04
|
||||
1 transp 10 9.5 32400 9 6.12883 14.264 3.7779e-12 1.9561e-09 5.6030e-08 1.0331e-09 9.5000e+00 4.8525e-13 5.5433e-13 1.3445e-04
|
||||
1 transp 10 9.5 36000 10 6.2369 14.1549 9.6448e-12 8.0004e-09 1.1153e-07 1.6551e-09 1.0500e+01 9.8421e-13 2.4608e-12 1.3556e-04
|
||||
1 transp 10 9.5 39600 11 6.30614 14.0851 1.5152e-11 2.0272e-08 1.4940e-07 2.6695e-09 1.1500e+01 1.7623e-12 6.7849e-12 1.3707e-04
|
||||
1 transp 10 9.5 43200 12 6.35376 14.0371 1.9799e-11 4.1065e-08 1.7494e-07 4.1384e-09 1.2500e+01 2.9364e-12 1.4662e-11 1.3886e-04
|
||||
1 transp 10 9.5 46800 13 6.3909 13.9998 2.3996e-11 7.2616e-08 1.9464e-07 6.0380e-09 1.3500e+01 4.6059e-12 2.7261e-11 1.4085e-04
|
||||
1 transp 10 9.5 50400 14 6.4217 13.9688 2.7923e-11 1.1683e-07 2.1099e-07 8.3484e-09 1.4500e+01 6.8561e-12 4.5675e-11 1.4301e-04
|
||||
1 transp 10 9.5 54000 15 6.44804 13.9423 3.1619e-11 1.7515e-07 2.2486e-07 1.1052e-08 1.5500e+01 9.7615e-12 7.0827e-11 1.4533e-04
|
||||
1 transp 10 9.5 57600 16 6.47097 13.9193 3.5087e-11 2.4844e-07 2.3669e-07 1.4128e-08 1.6500e+01 1.3385e-11 1.0340e-10 1.4778e-04
|
||||
1 transp 10 9.5 61200 17 6.49117 13.8989 3.8321e-11 3.3699e-07 2.4675e-07 1.7546e-08 1.7500e+01 1.7779e-11 1.4381e-10 1.5036e-04
|
||||
1 transp 10 9.5 64800 18 6.50914 13.8808 4.1316e-11 4.4051e-07 2.5526e-07 2.1274e-08 1.8500e+01 2.2982e-11 1.9215e-10 1.5306e-04
|
||||
1 transp 10 9.5 68400 19 6.52519 13.8647 4.4065e-11 5.5820e-07 2.6236e-07 2.5276e-08 1.9500e+01 2.9022e-11 2.4826e-10 1.5586e-04
|
||||
1 transp 10 9.5 72000 20 6.53959 13.8502 4.6562e-11 6.8880e-07 2.6819e-07 2.9517e-08 2.0500e+01 3.5915e-11 3.1170e-10 1.5876e-04
|
||||
2 transp 10 9.5 72000 0 6.53959 13.8502 4.6562e-11 6.8880e-07 2.6819e-07 2.9517e-08 2.0500e+01 0.0000e+00 0.0000e+00 0.0000e+00
|
||||
2 transp 10 9.5 75600 1 6.55254 13.8371 4.8804e-11 8.3068e-07 2.7284e-07 3.3961e-08 2.1500e+01 4.3669e-11 3.8179e-10 1.6174e-04
|
||||
2 transp 10 9.5 79200 2 6.56419 13.8254 5.0791e-11 9.8198e-07 2.7644e-07 3.8576e-08 2.2500e+01 5.2280e-11 4.5769e-10 1.6481e-04
|
||||
2 transp 10 9.5 82800 3 6.57469 13.8148 5.2526e-11 1.1406e-06 2.7905e-07 4.3329e-08 2.3500e+01 6.1739e-11 5.3842e-10 1.6796e-04
|
||||
2 transp 10 9.5 86400 4 6.58413 13.8053 5.4012e-11 1.3046e-06 2.8077e-07 4.8193e-08 2.4500e+01 7.2027e-11 6.2293e-10 1.7117e-04
|
||||
2 transp 10 9.5 90000 5 6.59263 13.7967 5.5256e-11 1.4717e-06 2.8168e-07 5.3142e-08 2.5500e+01 8.3123e-11 7.1013e-10 1.7444e-04
|
||||
2 transp 10 9.5 93600 6 6.60028 13.789 5.6269e-11 1.6400e-06 2.8183e-07 5.8153e-08 2.6500e+01 9.4998e-11 7.9893e-10 1.7778e-04
|
||||
2 transp 10 9.5 97200 7 6.60754 13.7817 5.7056e-11 1.8075e-06 2.8103e-07 6.3208e-08 2.7500e+01 1.0762e-10 8.8826e-10 1.8116e-04
|
||||
2 transp 10 9.5 100800 8 6.61795 13.7713 5.7637e-11 1.9718e-06 2.7717e-07 6.8258e-08 2.8500e+01 1.2096e-10 9.7697e-10 1.8457e-04
|
||||
2 transp 10 9.5 104400 9 6.64212 13.7473 5.8212e-11 2.1299e-06 2.6478e-07 7.3002e-08 2.9500e+01 1.3490e-10 1.0636e-09 1.8791e-04
|
||||
2 transp 10 9.5 108000 10 6.6795 13.7103 5.8949e-11 2.2783e-06 2.4602e-07 7.7114e-08 3.0500e+01 1.4924e-10 1.1465e-09 1.9109e-04
|
||||
2 transp 10 9.5 111600 11 6.69156 13.6985 5.8746e-11 2.4117e-06 2.3846e-07 8.1911e-08 3.1500e+01 1.6415e-10 1.2236e-09 1.9424e-04
|
||||
2 transp 10 9.5 115200 12 6.68638 13.7039 5.7684e-11 2.5260e-06 2.3696e-07 8.7374e-08 3.2500e+01 1.7978e-10 1.2925e-09 1.9741e-04
|
||||
2 transp 10 9.5 118800 13 6.67462 13.7157 5.6097e-11 2.6183e-06 2.3676e-07 9.3127e-08 3.3500e+01 1.9616e-10 1.3514e-09 2.0062e-04
|
||||
2 transp 10 9.5 122400 14 6.66009 13.7304 5.4144e-11 2.6860e-06 2.3630e-07 9.8982e-08 3.4500e+01 2.1330e-10 1.3987e-09 2.0387e-04
|
||||
2 transp 10 9.5 126000 15 6.64373 13.7469 5.1900e-11 2.7276e-06 2.3520e-07 1.0486e-07 3.5500e+01 2.3114e-10 1.4332e-09 2.0716e-04
|
||||
2 transp 10 9.5 129600 16 6.62579 13.7649 4.9419e-11 2.7424e-06 2.3341e-07 1.1072e-07 3.6500e+01 2.4964e-10 1.4540e-09 2.1047e-04
|
||||
2 transp 10 9.5 133200 17 6.60638 13.7845 4.6754e-11 2.7304e-06 2.3091e-07 1.1652e-07 3.7500e+01 2.6875e-10 1.4608e-09 2.1379e-04
|
||||
2 transp 10 9.5 136800 18 6.58562 13.8054 4.3956e-11 2.6927e-06 2.2772e-07 1.2223e-07 3.8500e+01 2.8841e-10 1.4537e-09 2.1712e-04
|
||||
2 transp 10 9.5 140400 19 6.56361 13.8275 4.1075e-11 2.6309e-06 2.2386e-07 1.2780e-07 3.9500e+01 3.0854e-10 1.4333e-09 2.2044e-04
|
||||
2 transp 10 9.5 144000 20 6.54047 13.8508 3.8158e-11 2.5474e-06 2.1934e-07 1.3320e-07 4.0500e+01 3.2906e-10 1.4004e-09 2.2375e-04
|
||||
2 transp 10 9.5 147600 21 6.51631 13.8751 3.5247e-11 2.4449e-06 2.1419e-07 1.3841e-07 4.1500e+01 3.4990e-10 1.3562e-09 2.2702e-04
|
||||
2 transp 10 9.5 151200 22 6.49127 13.9003 3.2379e-11 2.3266e-06 2.0845e-07 1.4337e-07 4.2500e+01 3.7097e-10 1.3021e-09 2.3026e-04
|
||||
2 transp 10 9.5 154800 23 6.46547 13.9262 2.9588e-11 2.1956e-06 2.0213e-07 1.4806e-07 4.3500e+01 3.9217e-10 1.2398e-09 2.3344e-04
|
||||
2 transp 10 9.5 158400 24 6.43907 13.9527 2.6899e-11 2.0552e-06 1.9529e-07 1.5245e-07 4.4500e+01 4.1340e-10 1.1710e-09 2.3656e-04
|
||||
2 transp 10 9.5 162000 25 6.41223 13.9797 2.4336e-11 1.9087e-06 1.8794e-07 1.5649e-07 4.5500e+01 4.3456e-10 1.0972e-09 2.3959e-04
|
||||
2 transp 10 9.5 165600 26 6.38512 14.0069 2.1913e-11 1.7589e-06 1.8013e-07 1.6016e-07 4.6500e+01 4.5554e-10 1.0202e-09 2.4253e-04
|
||||
2 transp 10 9.5 169200 27 6.35794 14.0343 1.9643e-11 1.6088e-06 1.7189e-07 1.6342e-07 4.7500e+01 4.7623e-10 9.4150e-10 2.4537e-04
|
||||
2 transp 10 9.5 172800 28 6.33089 14.0614 1.7532e-11 1.4607e-06 1.6329e-07 1.6624e-07 4.8500e+01 4.9652e-10 8.6254e-10 2.4809e-04
|
||||
2 transp 10 9.5 176400 29 6.30416 14.0883 1.5584e-11 1.3168e-06 1.5436e-07 1.6859e-07 4.9500e+01 5.1630e-10 7.8460e-10 2.5068e-04
|
||||
2 transp 10 9.5 180000 30 6.27797 14.1146 1.3798e-11 1.1788e-06 1.4516e-07 1.7047e-07 5.0500e+01 5.3545e-10 7.0877e-10 2.5312e-04
|
||||
2 transp 10 9.5 183600 31 6.25252 14.1402 1.2170e-11 1.0482e-06 1.3576e-07 1.7185e-07 5.1500e+01 5.5388e-10 6.3597e-10 2.5541e-04
|
||||
2 transp 10 9.5 187200 32 6.228 14.1648 1.0695e-11 9.2591e-07 1.2623e-07 1.7274e-07 5.2500e+01 5.7148e-10 5.6693e-10 2.5754e-04
|
||||
2 transp 10 9.5 190800 33 6.20459 14.1883 9.3648e-12 8.1273e-07 1.1666e-07 1.7316e-07 5.3500e+01 5.8818e-10 5.0219e-10 2.5949e-04
|
||||
2 transp 10 9.5 194400 34 6.18244 14.2105 8.1717e-12 7.0904e-07 1.0712e-07 1.7312e-07 5.4500e+01 6.0391e-10 4.4212e-10 2.6127e-04
|
||||
2 transp 10 9.5 198000 35 6.16167 14.2314 7.1059e-12 6.1497e-07 9.7713e-08 1.7268e-07 5.5500e+01 6.1861e-10 3.8695e-10 2.6286e-04
|
||||
2 transp 10 9.5 201600 36 6.14237 14.2508 6.1578e-12 5.3042e-07 8.8524e-08 1.7187e-07 5.6500e+01 6.3226e-10 3.3676e-10 2.6427e-04
|
||||
2 transp 10 9.5 205200 37 6.12459 14.2686 5.3178e-12 4.5509e-07 7.9641e-08 1.7075e-07 5.7500e+01 6.4483e-10 2.9149e-10 2.6550e-04
|
||||
2 transp 10 9.5 208800 38 6.10837 14.2849 4.5763e-12 3.8853e-07 7.1145e-08 1.6940e-07 5.8500e+01 6.5634e-10 2.5101e-10 2.6655e-04
|
||||
2 transp 10 9.5 212400 39 6.09369 14.2996 3.9244e-12 3.3017e-07 6.3107e-08 1.6787e-07 5.9500e+01 6.6679e-10 2.1511e-10 2.6742e-04
|
||||
2 transp 10 9.5 216000 40 6.08053 14.3129 3.3534e-12 2.7937e-07 5.5584e-08 1.6623e-07 6.0500e+01 6.7624e-10 1.8349e-10 2.6813e-04
|
||||
2 transp 10 9.5 219600 41 6.06883 14.3246 2.8552e-12 2.3545e-07 4.8619e-08 1.6454e-07 6.1500e+01 6.8474e-10 1.5585e-10 2.6869e-04
|
||||
2 transp 10 9.5 223200 42 6.05851 14.335 2.4224e-12 1.9772e-07 4.2241e-08 1.6286e-07 6.2500e+01 6.9233e-10 1.3184e-10 2.6910e-04
|
||||
2 transp 10 9.5 226800 43 6.04948 14.3441 2.0479e-12 1.6548e-07 3.6461e-08 1.6123e-07 6.3500e+01 6.9911e-10 1.1112e-10 2.6938e-04
|
||||
2 transp 10 9.5 230400 44 6.04163 14.3519 1.7253e-12 1.3809e-07 3.1277e-08 1.5969e-07 6.4500e+01 7.0513e-10 9.3326e-11 2.6955e-04
|
||||
2 transp 10 9.5 234000 45 6.03487 14.3587 1.4485e-12 1.1491e-07 2.6672e-08 1.5827e-07 6.5500e+01 7.1047e-10 7.8132e-11 2.6960e-04
|
||||
2 transp 10 9.5 237600 46 6.02908 14.3645 1.2122e-12 9.5378e-08 2.2620e-08 1.5699e-07 6.6500e+01 7.1521e-10 6.5220e-11 2.6957e-04
|
||||
2 transp 10 9.5 241200 47 6.02415 14.3695 1.0113e-12 7.8988e-08 1.9086e-08 1.5585e-07 6.7500e+01 7.1941e-10 5.4292e-11 2.6945e-04
|
||||
2 transp 10 9.5 244800 48 6.01999 14.3737 8.4110e-13 6.5277e-08 1.6027e-08 1.5485e-07 6.8500e+01 7.2315e-10 4.5082e-11 2.6926e-04
|
||||
2 transp 10 9.5 248400 49 6.01648 14.3772 6.9760e-13 5.3842e-08 1.3400e-08 1.5400e-07 6.9500e+01 7.2648e-10 3.7348e-11 2.6901e-04
|
||||
2 transp 10 9.5 252000 50 6.01355 14.3801 5.7705e-13 4.4330e-08 1.1160e-08 1.5328e-07 7.0500e+01 7.2947e-10 3.0873e-11 2.6870e-04
|
||||
2 transp 10 9.5 255600 51 6.01111 14.3826 4.7615e-13 3.6437e-08 9.2604e-09 1.5268e-07 7.1500e+01 7.3215e-10 2.5469e-11 2.6836e-04
|
||||
2 transp 10 9.5 259200 52 6.00908 14.3846 3.9198e-13 2.9901e-08 7.6592e-09 1.5220e-07 7.2500e+01 7.3458e-10 2.0972e-11 2.6798e-04
|
||||
2 transp 10 9.5 262800 53 6.00741 14.3863 3.2200e-13 2.4501e-08 6.3161e-09 1.5182e-07 7.3500e+01 7.3678e-10 1.7238e-11 2.6756e-04
|
||||
2 transp 10 9.5 266400 54 6.00603 14.3877 2.6398e-13 2.0046e-08 5.1944e-09 1.5152e-07 7.4500e+01 7.3880e-10 1.4145e-11 2.6713e-04
|
||||
2 transp 10 9.5 270000 55 6.0049 14.3888 2.1600e-13 1.6379e-08 4.2615e-09 1.5130e-07 7.5500e+01 7.4066e-10 1.1589e-11 2.6667e-04
|
||||
@ -1,435 +0,0 @@
|
||||
Input file: /z/parkplace/home/dlpark/../../home/dlpark/programs/phreeqc/src/../src/Sun/../../examples/ex16
|
||||
Output file: ex16.out
|
||||
Database file: /z/parkplace/home/dlpark/../../home/dlpark/programs/phreeqc/src/../src/Sun/../../database/phreeqc.dat
|
||||
|
||||
------------------
|
||||
Reading data base.
|
||||
------------------
|
||||
|
||||
SOLUTION_MASTER_SPECIES
|
||||
SOLUTION_SPECIES
|
||||
PHASES
|
||||
EXCHANGE_MASTER_SPECIES
|
||||
EXCHANGE_SPECIES
|
||||
SURFACE_MASTER_SPECIES
|
||||
SURFACE_SPECIES
|
||||
RATES
|
||||
END
|
||||
------------------------------------
|
||||
Reading input data for simulation 1.
|
||||
------------------------------------
|
||||
|
||||
TITLE Example 16.--Inverse modeling of Sierra springs
|
||||
SOLUTION_SPREAD
|
||||
units mmol/L
|
||||
Number pH Si Ca Mg Na K Alkalinity S(6) Cl
|
||||
1 6.2 0.273 0.078 0.029 0.134 0.028 0.328 0.01 0.014
|
||||
2 6.8 0.41 0.26 0.071 0.259 0.04 0.895 0.025 0.03
|
||||
INVERSE_MODELING 1
|
||||
solutions 1 2
|
||||
uncertainty 0.025
|
||||
range
|
||||
phases
|
||||
Halite
|
||||
Gypsum
|
||||
Kaolinite precip
|
||||
Ca-montmorillonite precip
|
||||
CO2(g)
|
||||
Calcite
|
||||
Chalcedony precip
|
||||
Biotite dissolve
|
||||
Plagioclase dissolve
|
||||
balances
|
||||
Ca 0.05 0.025
|
||||
PHASES
|
||||
Biotite
|
||||
KMg3AlSi3O10(OH)2 + 6H+ + 4H2O = K+ + 3Mg+2 + Al(OH)4- + 3H4SiO4
|
||||
log_k 0.0 # No log_k, Inverse modeling only
|
||||
Plagioclase
|
||||
Na0.62Ca0.38Al1.38Si2.62O8 + 5.52 H+ + 2.48H2O = 0.62Na+ + 0.38Ca+2 + 1.38Al+3 + 2.62H4SiO4
|
||||
log_k 0.0 # No log_k, inverse modeling only
|
||||
END
|
||||
-----
|
||||
TITLE
|
||||
-----
|
||||
|
||||
Example 16.--Inverse modeling of Sierra springs
|
||||
|
||||
-------------------------------------------
|
||||
Beginning of initial solution calculations.
|
||||
-------------------------------------------
|
||||
|
||||
Initial solution 1.
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
Alkalinity 3.280e-04 3.280e-04
|
||||
Ca 7.800e-05 7.800e-05
|
||||
Cl 1.400e-05 1.400e-05
|
||||
K 2.800e-05 2.800e-05
|
||||
Mg 2.900e-05 2.900e-05
|
||||
Na 1.340e-04 1.340e-04
|
||||
S(6) 1.000e-05 1.000e-05
|
||||
Si 2.730e-04 2.730e-04
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 6.200
|
||||
pe = 4.000
|
||||
Activity of water = 1.000
|
||||
Ionic strength = 4.851e-04
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total carbon (mol/kg) = 7.825e-04
|
||||
Total CO2 (mol/kg) = 7.825e-04
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = 1.400e-05
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = 1.90
|
||||
Iterations = 7
|
||||
Total H = 1.110139e+02
|
||||
Total O = 5.550924e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
H+ 6.464e-07 6.310e-07 -6.189 -6.200 -0.011
|
||||
OH- 1.627e-08 1.587e-08 -7.789 -7.800 -0.011
|
||||
H2O 5.551e+01 1.000e+00 1.744 -0.000 0.000
|
||||
C(4) 7.825e-04
|
||||
CO2 4.540e-04 4.540e-04 -3.343 -3.343 0.000
|
||||
HCO3- 3.281e-04 3.200e-04 -3.484 -3.495 -0.011
|
||||
CaHCO3+ 2.940e-07 2.868e-07 -6.532 -6.542 -0.011
|
||||
MgHCO3+ 1.003e-07 9.783e-08 -6.999 -7.010 -0.011
|
||||
CO3-2 2.628e-08 2.379e-08 -7.580 -7.624 -0.043
|
||||
NaHCO3 2.351e-08 2.352e-08 -7.629 -7.629 0.000
|
||||
CaCO3 2.806e-09 2.807e-09 -8.552 -8.552 0.000
|
||||
MgCO3 5.929e-10 5.930e-10 -9.227 -9.227 0.000
|
||||
NaCO3- 5.935e-11 5.788e-11 -10.227 -10.237 -0.011
|
||||
Ca 7.800e-05
|
||||
Ca+2 7.758e-05 7.023e-05 -4.110 -4.153 -0.043
|
||||
CaHCO3+ 2.940e-07 2.868e-07 -6.532 -6.542 -0.011
|
||||
CaSO4 1.244e-07 1.245e-07 -6.905 -6.905 0.000
|
||||
CaCO3 2.806e-09 2.807e-09 -8.552 -8.552 0.000
|
||||
CaOH+ 1.894e-11 1.847e-11 -10.723 -10.733 -0.011
|
||||
CaHSO4+ 4.717e-13 4.600e-13 -12.326 -12.337 -0.011
|
||||
Cl 1.400e-05
|
||||
Cl- 1.400e-05 1.365e-05 -4.854 -4.865 -0.011
|
||||
H(0) 5.636e-24
|
||||
H2 2.818e-24 2.818e-24 -23.550 -23.550 0.000
|
||||
K 2.800e-05
|
||||
K+ 2.800e-05 2.730e-05 -4.553 -4.564 -0.011
|
||||
KSO4- 1.747e-09 1.704e-09 -8.758 -8.769 -0.011
|
||||
KOH 1.500e-13 1.500e-13 -12.824 -12.824 0.000
|
||||
Mg 2.900e-05
|
||||
Mg+2 2.885e-05 2.612e-05 -4.540 -4.583 -0.043
|
||||
MgHCO3+ 1.003e-07 9.783e-08 -6.999 -7.010 -0.011
|
||||
MgSO4 5.438e-08 5.439e-08 -7.265 -7.264 0.000
|
||||
MgCO3 5.929e-10 5.930e-10 -9.227 -9.227 0.000
|
||||
MgOH+ 1.541e-10 1.503e-10 -9.812 -9.823 -0.011
|
||||
Na 1.340e-04
|
||||
Na+ 1.340e-04 1.307e-04 -3.873 -3.884 -0.011
|
||||
NaHCO3 2.351e-08 2.352e-08 -7.629 -7.629 0.000
|
||||
NaSO4- 5.964e-09 5.816e-09 -8.224 -8.235 -0.011
|
||||
NaCO3- 5.935e-11 5.788e-11 -10.227 -10.237 -0.011
|
||||
NaOH 1.368e-12 1.368e-12 -11.864 -11.864 0.000
|
||||
O(0) 0.000e+00
|
||||
O2 0.000e+00 0.000e+00 -45.280 -45.280 0.000
|
||||
S(6) 1.000e-05
|
||||
SO4-2 9.813e-06 8.882e-06 -5.008 -5.052 -0.043
|
||||
CaSO4 1.244e-07 1.245e-07 -6.905 -6.905 0.000
|
||||
MgSO4 5.438e-08 5.439e-08 -7.265 -7.264 0.000
|
||||
NaSO4- 5.964e-09 5.816e-09 -8.224 -8.235 -0.011
|
||||
KSO4- 1.747e-09 1.704e-09 -8.758 -8.769 -0.011
|
||||
HSO4- 5.587e-10 5.448e-10 -9.253 -9.264 -0.011
|
||||
CaHSO4+ 4.717e-13 4.600e-13 -12.326 -12.337 -0.011
|
||||
Si 2.730e-04
|
||||
H4SiO4 2.729e-04 2.730e-04 -3.564 -3.564 0.000
|
||||
H3SiO4- 6.541e-08 6.379e-08 -7.184 -7.195 -0.011
|
||||
H2SiO4-2 7.604e-15 6.877e-15 -14.119 -14.163 -0.044
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
Anhydrite -4.84 -9.20 -4.36 CaSO4
|
||||
Aragonite -3.44 -11.78 -8.34 CaCO3
|
||||
Calcite -3.30 -11.78 -8.48 CaCO3
|
||||
Chalcedony -0.01 -3.56 -3.55 SiO2
|
||||
Chrysotile -15.88 16.32 32.20 Mg3Si2O5(OH)4
|
||||
CO2(g) -1.87 -3.34 -1.47 CO2
|
||||
Dolomite -6.89 -23.98 -17.09 CaMg(CO3)2
|
||||
Gypsum -4.62 -9.20 -4.58 CaSO4:2H2O
|
||||
H2(g) -20.40 -23.55 -3.15 H2
|
||||
H2O(g) -1.51 -0.00 1.51 H2O
|
||||
Halite -10.33 -8.75 1.58 NaCl
|
||||
O2(g) -42.32 -45.28 -2.96 O2
|
||||
Quartz 0.42 -3.56 -3.98 SiO2
|
||||
Sepiolite -10.82 4.94 15.76 Mg2Si3O7.5OH:3H2O
|
||||
Sepiolite(d) -13.72 4.94 18.66 Mg2Si3O7.5OH:3H2O
|
||||
SiO2(a) -0.85 -3.56 -2.71 SiO2
|
||||
Talc -12.20 9.20 21.40 Mg3Si4O10(OH)2
|
||||
|
||||
Initial solution 2.
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
Alkalinity 8.951e-04 8.951e-04
|
||||
Ca 2.600e-04 2.600e-04
|
||||
Cl 3.000e-05 3.000e-05
|
||||
K 4.000e-05 4.000e-05
|
||||
Mg 7.101e-05 7.101e-05
|
||||
Na 2.590e-04 2.590e-04
|
||||
S(6) 2.500e-05 2.500e-05
|
||||
Si 4.100e-04 4.100e-04
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 6.800
|
||||
pe = 4.000
|
||||
Activity of water = 1.000
|
||||
Ionic strength = 1.313e-03
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total carbon (mol/kg) = 1.199e-03
|
||||
Total CO2 (mol/kg) = 1.199e-03
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = -1.400e-05
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = -0.73
|
||||
Iterations = 6
|
||||
Total H = 1.110150e+02
|
||||
Total O = 5.551125e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
H+ 1.647e-07 1.585e-07 -6.783 -6.800 -0.017
|
||||
OH- 6.579e-08 6.316e-08 -7.182 -7.200 -0.018
|
||||
H2O 5.551e+01 1.000e+00 1.744 -0.000 0.000
|
||||
C(4) 1.199e-03
|
||||
HCO3- 8.907e-04 8.559e-04 -3.050 -3.068 -0.017
|
||||
CO2 3.049e-04 3.050e-04 -3.516 -3.516 0.000
|
||||
CaHCO3+ 2.485e-06 2.387e-06 -5.605 -5.622 -0.017
|
||||
MgHCO3+ 6.235e-07 5.987e-07 -6.205 -6.223 -0.018
|
||||
CO3-2 2.971e-07 2.533e-07 -6.527 -6.596 -0.069
|
||||
NaHCO3 1.196e-07 1.197e-07 -6.922 -6.922 0.000
|
||||
CaCO3 9.299e-08 9.302e-08 -7.032 -7.031 0.000
|
||||
MgCO3 1.444e-08 1.445e-08 -7.840 -7.840 0.000
|
||||
NaCO3- 1.221e-09 1.173e-09 -8.913 -8.931 -0.018
|
||||
Ca 2.600e-04
|
||||
Ca+2 2.566e-04 2.186e-04 -3.591 -3.660 -0.069
|
||||
CaHCO3+ 2.485e-06 2.387e-06 -5.605 -5.622 -0.017
|
||||
CaSO4 8.841e-07 8.843e-07 -6.054 -6.053 0.000
|
||||
CaCO3 9.299e-08 9.302e-08 -7.032 -7.031 0.000
|
||||
CaOH+ 2.384e-10 2.289e-10 -9.623 -9.640 -0.018
|
||||
CaHSO4+ 8.551e-13 8.211e-13 -12.068 -12.086 -0.018
|
||||
Cl 3.000e-05
|
||||
Cl- 3.000e-05 2.880e-05 -4.523 -4.541 -0.018
|
||||
H(0) 3.555e-25
|
||||
H2 1.778e-25 1.778e-25 -24.750 -24.750 0.000
|
||||
K 4.000e-05
|
||||
K+ 4.000e-05 3.840e-05 -4.398 -4.416 -0.018
|
||||
KSO4- 5.696e-09 5.470e-09 -8.244 -8.262 -0.018
|
||||
KOH 8.398e-13 8.401e-13 -12.076 -12.076 0.000
|
||||
Mg 7.101e-05
|
||||
Mg+2 7.008e-05 5.978e-05 -4.154 -4.223 -0.069
|
||||
MgHCO3+ 6.235e-07 5.987e-07 -6.205 -6.223 -0.018
|
||||
MgSO4 2.840e-07 2.841e-07 -6.547 -6.547 0.000
|
||||
MgCO3 1.444e-08 1.445e-08 -7.840 -7.840 0.000
|
||||
MgOH+ 1.426e-09 1.370e-09 -8.846 -8.863 -0.018
|
||||
Na 2.590e-04
|
||||
Na+ 2.589e-04 2.486e-04 -3.587 -3.604 -0.018
|
||||
NaHCO3 1.196e-07 1.197e-07 -6.922 -6.922 0.000
|
||||
NaSO4- 2.631e-08 2.526e-08 -7.580 -7.598 -0.018
|
||||
NaCO3- 1.221e-09 1.173e-09 -8.913 -8.931 -0.018
|
||||
NaOH 1.036e-11 1.036e-11 -10.985 -10.984 0.000
|
||||
O(0) 0.000e+00
|
||||
O2 0.000e+00 0.000e+00 -42.880 -42.880 0.000
|
||||
S(6) 2.500e-05
|
||||
SO4-2 2.380e-05 2.027e-05 -4.623 -4.693 -0.070
|
||||
CaSO4 8.841e-07 8.843e-07 -6.054 -6.053 0.000
|
||||
MgSO4 2.840e-07 2.841e-07 -6.547 -6.547 0.000
|
||||
NaSO4- 2.631e-08 2.526e-08 -7.580 -7.598 -0.018
|
||||
KSO4- 5.696e-09 5.470e-09 -8.244 -8.262 -0.018
|
||||
HSO4- 3.253e-10 3.124e-10 -9.488 -9.505 -0.018
|
||||
CaHSO4+ 8.551e-13 8.211e-13 -12.068 -12.086 -0.018
|
||||
Si 4.100e-04
|
||||
H4SiO4 4.096e-04 4.098e-04 -3.388 -3.387 0.000
|
||||
H3SiO4- 3.970e-07 3.812e-07 -6.401 -6.419 -0.018
|
||||
H2SiO4-2 1.924e-13 1.636e-13 -12.716 -12.786 -0.070
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
Anhydrite -3.99 -8.35 -4.36 CaSO4
|
||||
Aragonite -1.92 -10.26 -8.34 CaCO3
|
||||
Calcite -1.78 -10.26 -8.48 CaCO3
|
||||
Chalcedony 0.16 -3.39 -3.55 SiO2
|
||||
Chrysotile -10.85 21.35 32.20 Mg3Si2O5(OH)4
|
||||
CO2(g) -2.05 -3.52 -1.47 CO2
|
||||
Dolomite -3.99 -21.08 -17.09 CaMg(CO3)2
|
||||
Gypsum -3.77 -8.35 -4.58 CaSO4:2H2O
|
||||
H2(g) -21.60 -24.75 -3.15 H2
|
||||
H2O(g) -1.51 -0.00 1.51 H2O
|
||||
Halite -9.73 -8.14 1.58 NaCl
|
||||
O2(g) -39.92 -42.88 -2.96 O2
|
||||
Quartz 0.59 -3.39 -3.98 SiO2
|
||||
Sepiolite -7.17 8.59 15.76 Mg2Si3O7.5OH:3H2O
|
||||
Sepiolite(d) -10.07 8.59 18.66 Mg2Si3O7.5OH:3H2O
|
||||
SiO2(a) -0.68 -3.39 -2.71 SiO2
|
||||
Talc -6.82 14.58 21.40 Mg3Si4O10(OH)2
|
||||
|
||||
-------------------------------------------
|
||||
Beginning of inverse modeling calculations.
|
||||
-------------------------------------------
|
||||
|
||||
|
||||
Solution 1:
|
||||
|
||||
Input Delta Input+Delta
|
||||
pH 6.200e+00 + 1.246e-02 = 6.212e+00
|
||||
Al 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
Alkalinity 3.280e-04 + 5.500e-06 = 3.335e-04
|
||||
C(-4) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
C(4) 7.825e-04 + 0.000e+00 = 7.825e-04
|
||||
Ca 7.800e-05 + -3.900e-06 = 7.410e-05
|
||||
Cl 1.400e-05 + 0.000e+00 = 1.400e-05
|
||||
H(0) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
K 2.800e-05 + -7.000e-07 = 2.730e-05
|
||||
Mg 2.900e-05 + 0.000e+00 = 2.900e-05
|
||||
Na 1.340e-04 + 0.000e+00 = 1.340e-04
|
||||
O(0) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
S(-2) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
S(6) 1.000e-05 + 0.000e+00 = 1.000e-05
|
||||
Si 2.730e-04 + 0.000e+00 = 2.730e-04
|
||||
|
||||
Solution 2:
|
||||
|
||||
Input Delta Input+Delta
|
||||
pH 6.800e+00 + -3.407e-03 = 6.797e+00
|
||||
Al 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
Alkalinity 8.951e-04 + -1.796e-06 = 8.933e-04
|
||||
C(-4) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
C(4) 1.199e-03 + 0.000e+00 = 1.199e-03
|
||||
Ca 2.600e-04 + 6.501e-06 = 2.665e-04
|
||||
Cl 3.000e-05 + 0.000e+00 = 3.000e-05
|
||||
H(0) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
K 4.000e-05 + 1.000e-06 = 4.100e-05
|
||||
Mg 7.101e-05 + -8.979e-07 = 7.011e-05
|
||||
Na 2.590e-04 + 0.000e+00 = 2.590e-04
|
||||
O(0) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
S(-2) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
S(6) 2.500e-05 + 0.000e+00 = 2.500e-05
|
||||
Si 4.100e-04 + 0.000e+00 = 4.100e-04
|
||||
|
||||
Solution fractions: Minimum Maximum
|
||||
Solution 1 1.000e+00 1.000e+00 1.000e+00
|
||||
Solution 2 1.000e+00 1.000e+00 1.000e+00
|
||||
|
||||
Phase mole transfers: Minimum Maximum
|
||||
Halite 1.600e-05 1.490e-05 1.710e-05 NaCl
|
||||
Gypsum 1.500e-05 1.413e-05 1.588e-05 CaSO4:2H2O
|
||||
Kaolinite -3.392e-05 -5.587e-05 -1.224e-05 Al2Si2O5(OH)4
|
||||
Ca-Montmorillon -8.090e-05 -1.100e-04 -5.154e-05 Ca0.165Al2.33Si3.67O10(OH)2
|
||||
CO2(g) 2.928e-04 2.363e-04 3.563e-04 CO2
|
||||
Calcite 1.240e-04 1.007e-04 1.309e-04 CaCO3
|
||||
Biotite 1.370e-05 1.317e-05 1.370e-05 KMg3AlSi3O10(OH)2
|
||||
Plagioclase 1.758e-04 1.582e-04 1.935e-04 Na0.62Ca0.38Al1.38Si2.62O8
|
||||
|
||||
Redox mole transfers:
|
||||
|
||||
Sum of residuals (epsilons in documentation): 5.574e+00
|
||||
Sum of delta/uncertainty limit: 5.574e+00
|
||||
Maximum fractional error in element concentration: 5.000e-02
|
||||
|
||||
Model contains minimum number of phases.
|
||||
===============================================================================
|
||||
|
||||
|
||||
Solution 1:
|
||||
|
||||
Input Delta Input+Delta
|
||||
pH 6.200e+00 + 1.246e-02 = 6.212e+00
|
||||
Al 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
Alkalinity 3.280e-04 + 5.500e-06 = 3.335e-04
|
||||
C(-4) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
C(4) 7.825e-04 + 0.000e+00 = 7.825e-04
|
||||
Ca 7.800e-05 + -3.900e-06 = 7.410e-05
|
||||
Cl 1.400e-05 + 0.000e+00 = 1.400e-05
|
||||
H(0) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
K 2.800e-05 + -7.000e-07 = 2.730e-05
|
||||
Mg 2.900e-05 + 0.000e+00 = 2.900e-05
|
||||
Na 1.340e-04 + 0.000e+00 = 1.340e-04
|
||||
O(0) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
S(-2) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
S(6) 1.000e-05 + 0.000e+00 = 1.000e-05
|
||||
Si 2.730e-04 + 0.000e+00 = 2.730e-04
|
||||
|
||||
Solution 2:
|
||||
|
||||
Input Delta Input+Delta
|
||||
pH 6.800e+00 + -3.407e-03 = 6.797e+00
|
||||
Al 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
Alkalinity 8.951e-04 + -1.796e-06 = 8.933e-04
|
||||
C(-4) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
C(4) 1.199e-03 + 0.000e+00 = 1.199e-03
|
||||
Ca 2.600e-04 + 6.501e-06 = 2.665e-04
|
||||
Cl 3.000e-05 + 0.000e+00 = 3.000e-05
|
||||
H(0) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
K 4.000e-05 + 1.000e-06 = 4.100e-05
|
||||
Mg 7.101e-05 + -8.980e-07 = 7.011e-05
|
||||
Na 2.590e-04 + 0.000e+00 = 2.590e-04
|
||||
O(0) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
S(-2) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
S(6) 2.500e-05 + 0.000e+00 = 2.500e-05
|
||||
Si 4.100e-04 + 0.000e+00 = 4.100e-04
|
||||
|
||||
Solution fractions: Minimum Maximum
|
||||
Solution 1 1.000e+00 1.000e+00 1.000e+00
|
||||
Solution 2 1.000e+00 1.000e+00 1.000e+00
|
||||
|
||||
Phase mole transfers: Minimum Maximum
|
||||
Halite 1.600e-05 1.490e-05 1.710e-05 NaCl
|
||||
Gypsum 1.500e-05 1.413e-05 1.588e-05 CaSO4:2H2O
|
||||
Kaolinite -1.282e-04 -1.403e-04 -1.159e-04 Al2Si2O5(OH)4
|
||||
CO2(g) 3.061e-04 2.490e-04 3.703e-04 CO2
|
||||
Calcite 1.106e-04 8.680e-05 1.182e-04 CaCO3
|
||||
Chalcedony -1.084e-04 -1.473e-04 -6.906e-05 SiO2
|
||||
Biotite 1.370e-05 1.317e-05 1.370e-05 KMg3AlSi3O10(OH)2
|
||||
Plagioclase 1.758e-04 1.582e-04 1.935e-04 Na0.62Ca0.38Al1.38Si2.62O8
|
||||
|
||||
Redox mole transfers:
|
||||
|
||||
Sum of residuals (epsilons in documentation): 5.574e+00
|
||||
Sum of delta/uncertainty limit: 5.574e+00
|
||||
Maximum fractional error in element concentration: 5.000e-02
|
||||
|
||||
Model contains minimum number of phases.
|
||||
===============================================================================
|
||||
|
||||
|
||||
Summary of inverse modeling:
|
||||
|
||||
Number of models found: 2
|
||||
Number of minimal models found: 2
|
||||
Number of infeasible sets of phases saved: 20
|
||||
Number of calls to cl1: 62
|
||||
------------------
|
||||
End of simulation.
|
||||
------------------
|
||||
|
||||
------------------------------------
|
||||
Reading input data for simulation 2.
|
||||
------------------------------------
|
||||
|
||||
-----------
|
||||
End of run.
|
||||
-----------
|
||||
|
||||
No memory leaks
|
||||
@ -1,349 +0,0 @@
|
||||
Input file: /z/parkplace/home/dlpark/../../home/dlpark/programs/phreeqc/src/../src/Sun/../../examples/ex17
|
||||
Output file: ex17.out
|
||||
Database file: /z/parkplace/home/dlpark/../../home/dlpark/programs/phreeqc/src/../src/Sun/../../database/phreeqc.dat
|
||||
|
||||
------------------
|
||||
Reading data base.
|
||||
------------------
|
||||
|
||||
SOLUTION_MASTER_SPECIES
|
||||
SOLUTION_SPECIES
|
||||
PHASES
|
||||
EXCHANGE_MASTER_SPECIES
|
||||
EXCHANGE_SPECIES
|
||||
SURFACE_MASTER_SPECIES
|
||||
SURFACE_SPECIES
|
||||
RATES
|
||||
END
|
||||
------------------------------------
|
||||
Reading input data for simulation 1.
|
||||
------------------------------------
|
||||
|
||||
TITLE Example 17.--Inverse modeling of Black Sea water evaporation
|
||||
SOLUTION 1 Black Sea water
|
||||
units mg/L
|
||||
density 1.014
|
||||
pH 8.0 # estimated
|
||||
Ca 233
|
||||
Mg 679
|
||||
Na 5820
|
||||
K 193
|
||||
S(6) 1460
|
||||
Cl 10340
|
||||
Br 35
|
||||
C 1 CO2(g) -3.5
|
||||
SOLUTION 2 Composition during halite precipitation
|
||||
units mg/L
|
||||
density 1.271
|
||||
pH 5.0 # estimated
|
||||
Ca 0.0
|
||||
Mg 50500
|
||||
Na 55200
|
||||
K 15800
|
||||
S(6) 76200
|
||||
Cl 187900
|
||||
Br 2670
|
||||
C 1 CO2(g) -3.5
|
||||
INVERSE_MODELING
|
||||
solutions 1 2
|
||||
uncertainties .025
|
||||
range
|
||||
balances
|
||||
Br
|
||||
K
|
||||
Mg
|
||||
phases
|
||||
H2O(g) pre
|
||||
Calcite pre
|
||||
CO2(g) pre
|
||||
Gypsum pre
|
||||
Halite pre
|
||||
END
|
||||
-----
|
||||
TITLE
|
||||
-----
|
||||
|
||||
Example 17.--Inverse modeling of Black Sea water evaporation
|
||||
|
||||
-------------------------------------------
|
||||
Beginning of initial solution calculations.
|
||||
-------------------------------------------
|
||||
|
||||
Initial solution 1. Black Sea water
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
Br 4.401e-04 4.401e-04
|
||||
C 8.284e-04 8.284e-04 Equilibrium with CO2(g)
|
||||
Ca 5.841e-03 5.841e-03
|
||||
Cl 2.930e-01 2.930e-01
|
||||
K 4.959e-03 4.959e-03
|
||||
Mg 2.806e-02 2.806e-02
|
||||
Na 2.544e-01 2.544e-01
|
||||
S(6) 1.527e-02 1.527e-02
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 8.000
|
||||
pe = 4.000
|
||||
Activity of water = 0.990
|
||||
Ionic strength = 3.540e-01
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total alkalinity (eq/kg) = 8.625e-04
|
||||
Total CO2 (mol/kg) = 8.284e-04
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = 2.240e-03
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = 0.36
|
||||
Iterations = 5
|
||||
Total H = 1.110132e+02
|
||||
Total O = 5.556978e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
OH- 1.500e-06 9.909e-07 -5.824 -6.004 -0.180
|
||||
H+ 1.288e-08 1.000e-08 -7.890 -8.000 -0.110
|
||||
H2O 5.551e+01 9.899e-01 1.744 -0.004 0.000
|
||||
Br 4.401e-04
|
||||
Br- 4.401e-04 2.835e-04 -3.356 -3.547 -0.191
|
||||
C(-4) 0.000e+00
|
||||
CH4 0.000e+00 0.000e+00 -76.604 -76.569 0.035
|
||||
C(4) 8.284e-04
|
||||
HCO3- 6.657e-04 4.740e-04 -3.177 -3.324 -0.147
|
||||
MgHCO3+ 5.725e-05 4.187e-05 -4.242 -4.378 -0.136
|
||||
NaHCO3 4.444e-05 4.822e-05 -4.352 -4.317 0.035
|
||||
MgCO3 1.476e-05 1.601e-05 -4.831 -4.796 0.035
|
||||
CaHCO3+ 1.247e-05 8.879e-06 -4.904 -5.052 -0.147
|
||||
NaCO3- 1.024e-05 7.488e-06 -4.990 -5.126 -0.136
|
||||
CO2 9.923e-06 1.077e-05 -5.003 -4.968 0.035
|
||||
CO3-2 8.646e-06 2.223e-06 -5.063 -5.653 -0.590
|
||||
CaCO3 5.053e-06 5.483e-06 -5.296 -5.261 0.035
|
||||
Ca 5.841e-03
|
||||
Ca+2 5.267e-03 1.468e-03 -2.278 -2.833 -0.555
|
||||
CaSO4 5.563e-04 6.035e-04 -3.255 -3.219 0.035
|
||||
CaHCO3+ 1.247e-05 8.879e-06 -4.904 -5.052 -0.147
|
||||
CaCO3 5.053e-06 5.483e-06 -5.296 -5.261 0.035
|
||||
CaOH+ 3.298e-08 2.412e-08 -7.482 -7.618 -0.136
|
||||
CaHSO4+ 4.835e-11 3.536e-11 -10.316 -10.452 -0.136
|
||||
Cl 2.930e-01
|
||||
Cl- 2.930e-01 1.960e-01 -0.533 -0.708 -0.175
|
||||
H(0) 1.305e-27
|
||||
H2 6.525e-28 7.079e-28 -27.185 -27.150 0.035
|
||||
K 4.959e-03
|
||||
K+ 4.895e-03 3.274e-03 -2.310 -2.485 -0.175
|
||||
KSO4- 6.480e-05 4.739e-05 -4.188 -4.324 -0.136
|
||||
KOH 1.036e-09 1.124e-09 -8.985 -8.949 0.035
|
||||
Mg 2.806e-02
|
||||
Mg+2 2.463e-02 7.549e-03 -1.609 -2.122 -0.514
|
||||
MgSO4 3.360e-03 3.646e-03 -2.474 -2.438 0.035
|
||||
MgHCO3+ 5.725e-05 4.187e-05 -4.242 -4.378 -0.136
|
||||
MgCO3 1.476e-05 1.601e-05 -4.831 -4.796 0.035
|
||||
MgOH+ 3.710e-06 2.713e-06 -5.431 -5.567 -0.136
|
||||
Na 2.544e-01
|
||||
Na+ 2.518e-01 1.809e-01 -0.599 -0.743 -0.144
|
||||
NaSO4- 2.554e-03 1.868e-03 -2.593 -2.729 -0.136
|
||||
NaHCO3 4.444e-05 4.822e-05 -4.352 -4.317 0.035
|
||||
NaCO3- 1.024e-05 7.488e-06 -4.990 -5.126 -0.136
|
||||
NaOH 1.090e-07 1.183e-07 -6.962 -6.927 0.035
|
||||
O(0) 1.502e-38
|
||||
O2 7.512e-39 8.150e-39 -38.124 -38.089 0.035
|
||||
S(6) 1.527e-02
|
||||
SO4-2 8.735e-03 2.060e-03 -2.059 -2.686 -0.627
|
||||
MgSO4 3.360e-03 3.646e-03 -2.474 -2.438 0.035
|
||||
NaSO4- 2.554e-03 1.868e-03 -2.593 -2.729 -0.136
|
||||
CaSO4 5.563e-04 6.035e-04 -3.255 -3.219 0.035
|
||||
KSO4- 6.480e-05 4.739e-05 -4.188 -4.324 -0.136
|
||||
HSO4- 2.739e-09 2.003e-09 -8.562 -8.698 -0.136
|
||||
CaHSO4+ 4.835e-11 3.536e-11 -10.316 -10.452 -0.136
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
Anhydrite -1.16 -5.52 -4.36 CaSO4
|
||||
Aragonite -0.15 -8.49 -8.34 CaCO3
|
||||
Calcite -0.01 -8.49 -8.48 CaCO3
|
||||
CH4(g) -73.71 -76.57 -2.86 CH4
|
||||
CO2(g) -3.50 -4.97 -1.47 CO2
|
||||
Dolomite 0.83 -16.26 -17.09 CaMg(CO3)2
|
||||
Gypsum -0.95 -5.53 -4.58 CaSO4:2H2O
|
||||
H2(g) -24.00 -27.15 -3.15 H2
|
||||
H2O(g) -1.51 -0.00 1.51 H2O
|
||||
Halite -3.03 -1.45 1.58 NaCl
|
||||
O2(g) -35.13 -38.09 -2.96 O2
|
||||
|
||||
Initial solution 2. Composition during halite precipitation
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
Br 3.785e-02 3.785e-02
|
||||
C 7.019e-06 7.019e-06 Equilibrium with CO2(g)
|
||||
Cl 6.004e+00 6.004e+00
|
||||
K 4.578e-01 4.578e-01
|
||||
Mg 2.353e+00 2.353e+00
|
||||
Na 2.720e+00 2.720e+00
|
||||
S(6) 8.986e-01 8.986e-01
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 5.000
|
||||
pe = 4.000
|
||||
Activity of water = 0.802
|
||||
Ionic strength = 7.827e+00
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total alkalinity (eq/kg) = -9.195e-06
|
||||
Total CO2 (mol/kg) = 7.019e-06
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = 4.491e-02
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = 0.36
|
||||
Iterations = 10
|
||||
Total H = 1.110125e+02
|
||||
Total O = 5.910064e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
H+ 1.425e-05 1.000e-05 -4.846 -5.000 -0.154
|
||||
OH- 1.749e-09 8.029e-10 -8.757 -9.095 -0.338
|
||||
H2O 5.551e+01 8.021e-01 1.744 -0.096 0.000
|
||||
Br 3.785e-02
|
||||
Br- 3.785e-02 1.580e-02 -1.422 -1.801 -0.379
|
||||
C(-4) 0.000e+00
|
||||
CH4 0.000e+00 0.000e+00 -53.169 -52.386 0.783
|
||||
C(4) 7.019e-06
|
||||
MgHCO3+ 4.391e-06 2.905e-05 -5.357 -4.537 0.821
|
||||
CO2 1.776e-06 1.077e-05 -5.751 -4.968 0.783
|
||||
HCO3- 6.660e-07 3.841e-07 -6.177 -6.416 -0.239
|
||||
NaHCO3 1.847e-07 1.120e-06 -6.734 -5.951 0.783
|
||||
MgCO3 1.833e-09 1.111e-08 -8.737 -7.954 0.783
|
||||
NaCO3- 2.628e-11 1.739e-10 -10.580 -9.760 0.821
|
||||
CO3-2 1.629e-11 1.801e-12 -10.788 -11.744 -0.956
|
||||
Cl 6.004e+00
|
||||
Cl- 6.004e+00 3.612e+00 0.778 0.558 -0.221
|
||||
H(0) 2.335e-22
|
||||
H2 1.168e-22 7.079e-22 -21.933 -21.150 0.783
|
||||
K 4.578e-01
|
||||
K+ 4.568e-01 2.748e-01 -0.340 -0.561 -0.221
|
||||
KSO4- 9.513e-04 6.294e-03 -3.022 -2.201 0.821
|
||||
KOH 1.261e-11 7.643e-11 -10.899 -10.117 0.783
|
||||
Mg 2.353e+00
|
||||
Mg+2 1.538e+00 6.465e+00 0.187 0.811 0.624
|
||||
MgSO4 8.148e-01 4.940e+00 -0.089 0.694 0.783
|
||||
MgHCO3+ 4.391e-06 2.905e-05 -5.357 -4.537 0.821
|
||||
MgOH+ 2.845e-07 1.883e-06 -6.546 -5.725 0.821
|
||||
MgCO3 1.833e-09 1.111e-08 -8.737 -7.954 0.783
|
||||
Na 2.720e+00
|
||||
Na+ 2.707e+00 5.184e+00 0.433 0.715 0.282
|
||||
NaSO4- 1.280e-02 8.469e-02 -1.893 -1.072 0.821
|
||||
NaHCO3 1.847e-07 1.120e-06 -6.734 -5.951 0.783
|
||||
NaOH 4.531e-10 2.747e-09 -9.344 -8.561 0.783
|
||||
NaCO3- 2.628e-11 1.739e-10 -10.580 -9.760 0.821
|
||||
O(0) 0.000e+00
|
||||
O2 0.000e+00 0.000e+00 -51.054 -50.272 0.783
|
||||
S(6) 8.986e-01
|
||||
MgSO4 8.148e-01 4.940e+00 -0.089 0.694 0.783
|
||||
SO4-2 7.004e-02 3.259e-03 -1.155 -2.487 -1.332
|
||||
NaSO4- 1.280e-02 8.469e-02 -1.893 -1.072 0.821
|
||||
KSO4- 9.513e-04 6.294e-03 -3.022 -2.201 0.821
|
||||
HSO4- 4.789e-07 3.169e-06 -6.320 -5.499 0.821
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
CH4(g) -49.53 -52.39 -2.86 CH4
|
||||
CO2(g) -3.50 -4.97 -1.47 CO2
|
||||
H2(g) -18.00 -21.15 -3.15 H2
|
||||
H2O(g) -1.61 -0.10 1.51 H2O
|
||||
Halite -0.31 1.27 1.58 NaCl
|
||||
O2(g) -47.31 -50.27 -2.96 O2
|
||||
|
||||
-------------------------------------------
|
||||
Beginning of inverse modeling calculations.
|
||||
-------------------------------------------
|
||||
|
||||
|
||||
Solution 1: Black Sea water
|
||||
|
||||
Input Delta Input+Delta
|
||||
pH 8.000e+00 + 0.000e+00 = 8.000e+00
|
||||
Alkalinity 8.625e-04 + 0.000e+00 = 8.625e-04
|
||||
Br 4.401e-04 + 0.000e+00 = 4.401e-04
|
||||
C(-4) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
C(4) 8.284e-04 + 0.000e+00 = 8.284e-04
|
||||
Ca 5.841e-03 + 0.000e+00 = 5.841e-03
|
||||
Cl 2.930e-01 + 7.845e-04 = 2.938e-01
|
||||
H(0) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
K 4.959e-03 + 1.034e-04 = 5.063e-03
|
||||
Mg 2.806e-02 + -7.016e-04 = 2.736e-02
|
||||
Na 2.544e-01 + 0.000e+00 = 2.544e-01
|
||||
O(0) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
S(-2) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
S(6) 1.527e-02 + 7.768e-05 = 1.535e-02
|
||||
|
||||
Solution 2: Composition during halite precipitation
|
||||
|
||||
Input Delta Input+Delta
|
||||
pH 5.000e+00 + 5.711e-14 = 5.000e+00
|
||||
Alkalinity -9.195e-06 + 0.000e+00 = -9.195e-06
|
||||
Br 3.785e-02 + 9.440e-04 = 3.880e-02
|
||||
C(-4) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
C(4) 7.019e-06 + 0.000e+00 = 7.019e-06
|
||||
Ca 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
Cl 6.004e+00 + 1.501e-01 = 6.154e+00
|
||||
H(0) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
K 4.578e-01 + -1.144e-02 = 4.463e-01
|
||||
Mg 2.353e+00 + 5.883e-02 = 2.412e+00
|
||||
Na 2.720e+00 + -4.500e-02 = 2.675e+00
|
||||
O(0) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
S(-2) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
S(6) 8.986e-01 + -2.247e-02 = 8.761e-01
|
||||
|
||||
Solution fractions: Minimum Maximum
|
||||
Solution 1 8.815e+01 8.780e+01 8.815e+01
|
||||
Solution 2 1.000e+00 1.000e+00 1.000e+00
|
||||
|
||||
Phase mole transfers: Minimum Maximum
|
||||
H2O(g) -4.837e+03 -4.817e+03 -4.817e+03 H2O
|
||||
Calcite -3.802e-02 -3.897e-02 -3.692e-02 CaCO3
|
||||
CO2(g) -3.500e-02 -3.615e-02 -3.371e-02 CO2
|
||||
Gypsum -4.769e-01 -4.907e-01 -4.612e-01 CaSO4:2H2O
|
||||
Halite -1.975e+01 -2.033e+01 -1.901e+01 NaCl
|
||||
|
||||
Redox mole transfers:
|
||||
|
||||
Sum of residuals (epsilons in documentation): 1.947e+02
|
||||
Sum of delta/uncertainty limit: 7.804e+00
|
||||
Maximum fractional error in element concentration: 2.500e-02
|
||||
|
||||
Model contains minimum number of phases.
|
||||
===============================================================================
|
||||
|
||||
|
||||
Summary of inverse modeling:
|
||||
|
||||
Number of models found: 1
|
||||
Number of minimal models found: 1
|
||||
Number of infeasible sets of phases saved: 6
|
||||
Number of calls to cl1: 22
|
||||
------------------
|
||||
End of simulation.
|
||||
------------------
|
||||
|
||||
------------------------------------
|
||||
Reading input data for simulation 2.
|
||||
------------------------------------
|
||||
|
||||
-----------
|
||||
End of run.
|
||||
-----------
|
||||
|
||||
No memory leaks
|
||||
@ -1,550 +0,0 @@
|
||||
Input file: /z/parkplace/home/dlpark/../../home/dlpark/programs/phreeqc/src/../src/Sun/../../examples/ex18
|
||||
Output file: ex18.out
|
||||
Database file: /z/parkplace/home/dlpark/../../home/dlpark/programs/phreeqc/src/../src/Sun/../../database/phreeqc.dat
|
||||
|
||||
------------------
|
||||
Reading data base.
|
||||
------------------
|
||||
|
||||
SOLUTION_MASTER_SPECIES
|
||||
SOLUTION_SPECIES
|
||||
PHASES
|
||||
EXCHANGE_MASTER_SPECIES
|
||||
EXCHANGE_SPECIES
|
||||
SURFACE_MASTER_SPECIES
|
||||
SURFACE_SPECIES
|
||||
RATES
|
||||
END
|
||||
------------------------------------
|
||||
Reading input data for simulation 1.
|
||||
------------------------------------
|
||||
|
||||
TITLE Example 18.--Inverse modeling of Madison aquifer
|
||||
SOLUTION 1 Recharge number 3
|
||||
units mmol/kgw
|
||||
temp 9.9
|
||||
pe 0.
|
||||
pH 7.55
|
||||
Ca 1.2
|
||||
Mg 1.01
|
||||
Na 0.02
|
||||
K 0.02
|
||||
Fe(2) 0.001
|
||||
Cl 0.02
|
||||
S(6) 0.16
|
||||
S(-2) 0
|
||||
C(4) 4.30
|
||||
isotope 13C -7.0 1.4
|
||||
isotope 34S 9.7 0.9
|
||||
SOLUTION 2 Mysse
|
||||
units mmol/kgw
|
||||
temp 63.
|
||||
pH 6.61
|
||||
pe 0.
|
||||
redox S(6)/S(-2)
|
||||
Ca 11.28
|
||||
Mg 4.54
|
||||
Na 31.89
|
||||
K 2.54
|
||||
Fe(2) 0.0004
|
||||
Cl 17.85
|
||||
S(6) 19.86
|
||||
S(-2) 0.26
|
||||
C(4) 6.87
|
||||
isotope 13C -2.3 0.2
|
||||
isotope 34S(6) 16.3 1.5
|
||||
isotope 34S(-2) -22.1 7
|
||||
INVERSE_MODELING 1
|
||||
solutions 1 2
|
||||
uncertainty 0.05
|
||||
range
|
||||
isotopes
|
||||
13C
|
||||
34S
|
||||
balances
|
||||
Fe(2) 1.0
|
||||
ph 0.1
|
||||
phases
|
||||
Dolomite dis 13C 3.0 2
|
||||
Calcite pre 13C -1.5 1
|
||||
Anhydrite dis 34S 13.5 2
|
||||
CH2O dis 13C -25.0 5
|
||||
Goethite
|
||||
Pyrite pre 34S -22. 2
|
||||
CaX2 pre
|
||||
Ca.75Mg.25X2 pre
|
||||
MgX2 pre
|
||||
NaX
|
||||
Halite
|
||||
Sylvite
|
||||
PHASES
|
||||
Sylvite
|
||||
KCl = K+ + Cl-
|
||||
log_k 0.0
|
||||
CH2O
|
||||
CH2O + H2O = CO2 + 4H+ + 4e-
|
||||
log_k 0.0
|
||||
EXCHANGE_SPECIES
|
||||
0.75Ca+2 + 0.25Mg+2 + 2X- = Ca.75Mg.25X2
|
||||
log_k 0.0
|
||||
END
|
||||
-----
|
||||
TITLE
|
||||
-----
|
||||
|
||||
Example 18.--Inverse modeling of Madison aquifer
|
||||
|
||||
-------------------------------------------
|
||||
Beginning of initial solution calculations.
|
||||
-------------------------------------------
|
||||
|
||||
Initial solution 1. Recharge number 3
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
C(4) 4.300e-03 4.300e-03
|
||||
Ca 1.200e-03 1.200e-03
|
||||
Cl 2.000e-05 2.000e-05
|
||||
Fe(2) 1.000e-06 1.000e-06
|
||||
K 2.000e-05 2.000e-05
|
||||
Mg 1.010e-03 1.010e-03
|
||||
Na 2.000e-05 2.000e-05
|
||||
S(6) 1.600e-04 1.600e-04
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 7.550
|
||||
pe = 0.000
|
||||
Activity of water = 1.000
|
||||
Ionic strength = 6.543e-03
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total alkalinity (eq/kg) = 4.016e-03
|
||||
Total CO2 (mol/kg) = 4.300e-03
|
||||
Temperature (deg C) = 9.900
|
||||
Electrical balance (eq) = 1.061e-04
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = 1.24
|
||||
Iterations = 8
|
||||
Total H = 1.110164e+02
|
||||
Total O = 5.551946e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
OH- 1.120e-07 1.029e-07 -6.951 -6.988 -0.037
|
||||
H+ 3.038e-08 2.818e-08 -7.517 -7.550 -0.033
|
||||
H2O 5.551e+01 9.999e-01 1.744 -0.000 0.000
|
||||
C(4) 4.300e-03
|
||||
HCO3- 3.929e-03 3.623e-03 -2.406 -2.441 -0.035
|
||||
CO2 2.970e-04 2.974e-04 -3.527 -3.527 0.001
|
||||
MgHCO3+ 3.098e-05 2.850e-05 -4.509 -4.545 -0.036
|
||||
CaHCO3+ 3.027e-05 2.792e-05 -4.519 -4.554 -0.035
|
||||
CO3-2 5.765e-06 4.168e-06 -5.239 -5.380 -0.141
|
||||
CaCO3 4.727e-06 4.734e-06 -5.325 -5.325 0.001
|
||||
MgCO3 2.208e-06 2.211e-06 -5.656 -5.655 0.001
|
||||
FeHCO3+ 2.086e-07 1.919e-07 -6.681 -6.717 -0.036
|
||||
FeCO3 5.289e-08 5.297e-08 -7.277 -7.276 0.001
|
||||
NaHCO3 3.737e-08 3.742e-08 -7.428 -7.427 0.001
|
||||
NaCO3- 6.948e-10 6.391e-10 -9.158 -9.194 -0.036
|
||||
Ca 1.200e-03
|
||||
Ca+2 1.151e-03 8.317e-04 -2.939 -3.080 -0.141
|
||||
CaHCO3+ 3.027e-05 2.792e-05 -4.519 -4.554 -0.035
|
||||
CaSO4 1.393e-05 1.395e-05 -4.856 -4.855 0.001
|
||||
CaCO3 4.727e-06 4.734e-06 -5.325 -5.325 0.001
|
||||
CaOH+ 5.323e-09 4.897e-09 -8.274 -8.310 -0.036
|
||||
CaHSO4+ 2.136e-12 1.965e-12 -11.670 -11.707 -0.036
|
||||
Cl 2.000e-05
|
||||
Cl- 2.000e-05 1.838e-05 -4.699 -4.736 -0.037
|
||||
FeCl+ 1.461e-11 1.344e-11 -10.835 -10.872 -0.036
|
||||
Fe(2) 1.000e-06
|
||||
Fe+2 7.296e-07 5.298e-07 -6.137 -6.276 -0.139
|
||||
FeHCO3+ 2.086e-07 1.919e-07 -6.681 -6.717 -0.036
|
||||
FeCO3 5.289e-08 5.297e-08 -7.277 -7.276 0.001
|
||||
FeSO4 6.861e-09 6.871e-09 -8.164 -8.163 0.001
|
||||
FeOH+ 1.969e-09 1.811e-09 -8.706 -8.742 -0.036
|
||||
FeCl+ 1.461e-11 1.344e-11 -10.835 -10.872 -0.036
|
||||
FeHSO4+ 1.361e-15 1.252e-15 -14.866 -14.903 -0.036
|
||||
H(0) 1.316e-18
|
||||
H2 6.579e-19 6.588e-19 -18.182 -18.181 0.001
|
||||
K 2.000e-05
|
||||
K+ 1.999e-05 1.837e-05 -4.699 -4.736 -0.037
|
||||
KSO4- 1.037e-08 9.538e-09 -7.984 -8.021 -0.036
|
||||
KOH 2.256e-12 2.260e-12 -11.647 -11.646 0.001
|
||||
Mg 1.010e-03
|
||||
Mg+2 9.662e-04 7.011e-04 -3.015 -3.154 -0.139
|
||||
MgHCO3+ 3.098e-05 2.850e-05 -4.509 -4.545 -0.036
|
||||
MgSO4 1.063e-05 1.064e-05 -4.974 -4.973 0.001
|
||||
MgCO3 2.208e-06 2.211e-06 -5.656 -5.655 0.001
|
||||
MgOH+ 2.335e-08 2.148e-08 -7.632 -7.668 -0.036
|
||||
Na 2.000e-05
|
||||
Na+ 1.995e-05 1.837e-05 -4.700 -4.736 -0.036
|
||||
NaHCO3 3.737e-08 3.742e-08 -7.428 -7.427 0.001
|
||||
NaSO4- 8.826e-09 8.119e-09 -8.054 -8.090 -0.036
|
||||
NaCO3- 6.948e-10 6.391e-10 -9.158 -9.194 -0.036
|
||||
NaOH 4.299e-12 4.306e-12 -11.367 -11.366 0.001
|
||||
O(0) 0.000e+00
|
||||
O2 0.000e+00 0.000e+00 -61.151 -61.151 0.001
|
||||
S(6) 1.600e-04
|
||||
SO4-2 1.354e-04 9.754e-05 -3.868 -4.011 -0.142
|
||||
CaSO4 1.393e-05 1.395e-05 -4.856 -4.855 0.001
|
||||
MgSO4 1.063e-05 1.064e-05 -4.974 -4.973 0.001
|
||||
KSO4- 1.037e-08 9.538e-09 -7.984 -8.021 -0.036
|
||||
NaSO4- 8.826e-09 8.119e-09 -8.054 -8.090 -0.036
|
||||
FeSO4 6.861e-09 6.871e-09 -8.164 -8.163 0.001
|
||||
HSO4- 2.136e-10 1.965e-10 -9.670 -9.707 -0.036
|
||||
CaHSO4+ 2.136e-12 1.965e-12 -11.670 -11.707 -0.036
|
||||
FeHSO4+ 1.361e-15 1.252e-15 -14.866 -14.903 -0.036
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
Anhydrite -2.76 -7.09 -4.34 CaSO4
|
||||
Aragonite -0.21 -8.46 -8.25 CaCO3
|
||||
Calcite -0.05 -8.46 -8.41 CaCO3
|
||||
CH2O -33.73 -33.73 0.00 CH2O
|
||||
CO2(g) -2.26 -3.53 -1.27 CO2
|
||||
Dolomite -0.27 -16.99 -16.72 CaMg(CO3)2
|
||||
Gypsum -2.50 -7.09 -4.59 CaSO4:2H2O
|
||||
H2(g) -15.10 -18.18 -3.08 H2
|
||||
H2O(g) -1.92 -0.00 1.92 H2O
|
||||
Halite -11.02 -9.47 1.55 NaCl
|
||||
Melanterite -7.88 -10.29 -2.41 FeSO4:7H2O
|
||||
O2(g) -58.26 -61.15 -2.89 O2
|
||||
Siderite -0.86 -11.66 -10.79 FeCO3
|
||||
Sylvite -9.47 -9.47 0.00 KCl
|
||||
|
||||
Initial solution 2. Mysse
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
C(4) 6.870e-03 6.870e-03
|
||||
Ca 1.128e-02 1.128e-02
|
||||
Cl 1.785e-02 1.785e-02
|
||||
Fe(2) 4.000e-07 4.000e-07
|
||||
K 2.540e-03 2.540e-03
|
||||
Mg 4.540e-03 4.540e-03
|
||||
Na 3.189e-02 3.189e-02
|
||||
S(-2) 2.600e-04 2.600e-04
|
||||
S(6) 1.986e-02 1.986e-02
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 6.610
|
||||
pe = 0.000
|
||||
Activity of water = 0.999
|
||||
Ionic strength = 7.256e-02
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total alkalinity (eq/kg) = 5.258e-03
|
||||
Total CO2 (mol/kg) = 6.870e-03
|
||||
Temperature (deg C) = 63.000
|
||||
Electrical balance (eq) = 3.242e-03
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = 3.20
|
||||
Iterations = 8
|
||||
Total H = 1.110179e+02
|
||||
Total O = 5.560448e+01
|
||||
|
||||
---------------------------------Redox couples---------------------------------
|
||||
|
||||
Redox couple pe Eh (volts)
|
||||
|
||||
S(-2)/S(6) -3.6487 -0.2434
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
OH- 5.726e-07 4.419e-07 -6.242 -6.355 -0.112
|
||||
H+ 2.963e-07 2.455e-07 -6.528 -6.610 -0.082
|
||||
H2O 5.551e+01 9.985e-01 1.744 -0.001 0.000
|
||||
C(4) 6.870e-03
|
||||
HCO3- 4.711e-03 3.746e-03 -2.327 -2.426 -0.100
|
||||
CO2 1.784e-03 1.814e-03 -2.749 -2.741 0.007
|
||||
CaHCO3+ 2.347e-04 1.867e-04 -3.629 -3.729 -0.100
|
||||
MgHCO3+ 6.578e-05 5.169e-05 -4.182 -4.287 -0.105
|
||||
NaHCO3 5.046e-05 5.131e-05 -4.297 -4.290 0.007
|
||||
CaCO3 1.560e-05 1.586e-05 -4.807 -4.800 0.007
|
||||
NaCO3- 3.512e-06 2.760e-06 -5.454 -5.559 -0.105
|
||||
CO3-2 2.780e-06 1.112e-06 -5.556 -5.954 -0.398
|
||||
MgCO3 1.642e-06 1.670e-06 -5.784 -5.777 0.007
|
||||
FeHCO3+ 1.177e-08 9.248e-09 -7.929 -8.034 -0.105
|
||||
FeCO3 6.474e-10 6.583e-10 -9.189 -9.182 0.007
|
||||
Ca 1.128e-02
|
||||
Ca+2 7.217e-03 2.899e-03 -2.142 -2.538 -0.396
|
||||
CaSO4 3.813e-03 3.877e-03 -2.419 -2.411 0.007
|
||||
CaHCO3+ 2.347e-04 1.867e-04 -3.629 -3.729 -0.100
|
||||
CaCO3 1.560e-05 1.586e-05 -4.807 -4.800 0.007
|
||||
CaHSO4+ 1.322e-08 1.039e-08 -7.879 -7.983 -0.105
|
||||
CaOH+ 2.491e-09 1.957e-09 -8.604 -8.708 -0.105
|
||||
Cl 1.785e-02
|
||||
Cl- 1.785e-02 1.381e-02 -1.748 -1.860 -0.111
|
||||
FeCl+ 5.988e-10 4.706e-10 -9.223 -9.327 -0.105
|
||||
Fe(2) 4.000e-07
|
||||
Fe(HS)2 2.830e-07 2.878e-07 -6.548 -6.541 0.007
|
||||
Fe+2 5.978e-08 2.468e-08 -7.223 -7.608 -0.384
|
||||
FeSO4 3.911e-08 3.977e-08 -7.408 -7.400 0.007
|
||||
FeHCO3+ 1.177e-08 9.248e-09 -7.929 -8.034 -0.105
|
||||
Fe(HS)3- 4.561e-09 3.585e-09 -8.341 -8.446 -0.105
|
||||
FeCO3 6.474e-10 6.583e-10 -9.189 -9.182 0.007
|
||||
FeCl+ 5.988e-10 4.706e-10 -9.223 -9.327 -0.105
|
||||
FeOH+ 5.014e-10 3.940e-10 -9.300 -9.404 -0.105
|
||||
FeHSO4+ 1.125e-13 8.843e-14 -12.949 -13.053 -0.105
|
||||
H(0) 1.190e-09
|
||||
H2 5.948e-10 6.048e-10 -9.226 -9.218 0.007
|
||||
K 2.540e-03
|
||||
K+ 2.394e-03 1.852e-03 -2.621 -2.732 -0.111
|
||||
KSO4- 1.459e-04 1.146e-04 -3.836 -3.941 -0.105
|
||||
KOH 2.569e-11 2.613e-11 -10.590 -10.583 0.007
|
||||
Mg 4.540e-03
|
||||
MgSO4 2.360e-03 2.399e-03 -2.627 -2.620 0.007
|
||||
Mg+2 2.113e-03 8.783e-04 -2.675 -3.056 -0.381
|
||||
MgHCO3+ 6.578e-05 5.169e-05 -4.182 -4.287 -0.105
|
||||
MgCO3 1.642e-06 1.670e-06 -5.784 -5.777 0.007
|
||||
MgOH+ 3.463e-07 2.721e-07 -6.461 -6.565 -0.105
|
||||
Na 3.189e-02
|
||||
Na+ 3.090e-02 2.435e-02 -1.510 -1.613 -0.103
|
||||
NaSO4- 9.408e-04 7.393e-04 -3.027 -3.131 -0.105
|
||||
NaHCO3 5.046e-05 5.131e-05 -4.297 -4.290 0.007
|
||||
NaCO3- 3.512e-06 2.760e-06 -5.454 -5.559 -0.105
|
||||
NaOH 6.437e-10 6.545e-10 -9.191 -9.184 0.007
|
||||
O(0) 0.000e+00
|
||||
O2 0.000e+00 0.000e+00 -63.075 -63.067 0.007
|
||||
S(-2) 2.600e-04
|
||||
HS- 1.482e-04 1.144e-04 -3.829 -3.942 -0.112
|
||||
H2S 1.112e-04 1.131e-04 -3.954 -3.947 0.007
|
||||
Fe(HS)2 2.830e-07 2.878e-07 -6.548 -6.541 0.007
|
||||
Fe(HS)3- 4.561e-09 3.585e-09 -8.341 -8.446 -0.105
|
||||
S-2 1.449e-09 5.662e-10 -8.839 -9.247 -0.408
|
||||
S(6) 1.986e-02
|
||||
SO4-2 1.260e-02 4.892e-03 -1.900 -2.311 -0.411
|
||||
CaSO4 3.813e-03 3.877e-03 -2.419 -2.411 0.007
|
||||
MgSO4 2.360e-03 2.399e-03 -2.627 -2.620 0.007
|
||||
NaSO4- 9.408e-04 7.393e-04 -3.027 -3.131 -0.105
|
||||
KSO4- 1.459e-04 1.146e-04 -3.836 -3.941 -0.105
|
||||
HSO4- 3.792e-07 2.980e-07 -6.421 -6.526 -0.105
|
||||
FeSO4 3.911e-08 3.977e-08 -7.408 -7.400 0.007
|
||||
CaHSO4+ 1.322e-08 1.039e-08 -7.879 -7.983 -0.105
|
||||
FeHSO4+ 1.125e-13 8.843e-14 -12.949 -13.053 -0.105
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
Anhydrite -0.14 -4.85 -4.71 CaSO4
|
||||
Aragonite 0.18 -8.49 -8.67 CaCO3
|
||||
Calcite 0.30 -8.49 -8.79 CaCO3
|
||||
CH2O -14.59 -14.59 0.00 CH2O
|
||||
CO2(g) -0.94 -2.74 -1.80 CO2
|
||||
Dolomite 0.37 -17.50 -17.87 CaMg(CO3)2
|
||||
FeS(ppt) -1.02 -4.94 -3.92 FeS
|
||||
Gypsum -0.18 -4.85 -4.67 CaSO4:2H2O
|
||||
H2(g) -5.92 -9.22 -3.30 H2
|
||||
H2O(g) -0.64 -0.00 0.64 H2O
|
||||
H2S(g) -2.57 -3.95 -1.38 H2S
|
||||
Halite -5.13 -3.47 1.66 NaCl
|
||||
Mackinawite -0.29 -4.94 -4.65 FeS
|
||||
Melanterite -8.07 -9.92 -1.85 FeSO4:7H2O
|
||||
O2(g) -59.95 -63.07 -3.11 O2
|
||||
Pyrite 7.97 -9.57 -17.54 FeS2
|
||||
Siderite -2.47 -13.56 -11.10 FeCO3
|
||||
Sulfur -2.12 1.98 4.09 S
|
||||
Sylvite -4.59 -4.59 0.00 KCl
|
||||
|
||||
-------------------------------------------
|
||||
Beginning of inverse modeling calculations.
|
||||
-------------------------------------------
|
||||
|
||||
|
||||
Solution 1: Recharge number 3
|
||||
|
||||
Input Delta Input+Delta
|
||||
pH 7.550e+00 + 0.000e+00 = 7.550e+00
|
||||
Alkalinity 4.016e-03 + 0.000e+00 = 4.016e-03
|
||||
C(-4) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
C(4) 4.300e-03 + 0.000e+00 = 4.300e-03
|
||||
Ca 1.200e-03 + -5.306e-05 = 1.147e-03
|
||||
Cl 2.000e-05 + 0.000e+00 = 2.000e-05
|
||||
Fe(2) 1.000e-06 + 0.000e+00 = 1.000e-06
|
||||
Fe(3) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
H(0) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
K 2.000e-05 + 0.000e+00 = 2.000e-05
|
||||
Mg 1.010e-03 + 0.000e+00 = 1.010e-03
|
||||
Na 2.000e-05 + 0.000e+00 = 2.000e-05
|
||||
O(0) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
S(-2) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
S(6) 1.600e-04 + 0.000e+00 = 1.600e-04
|
||||
X 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
13C(-4) -7 + 0 = -7
|
||||
13C(4) -7 + 0 = -7
|
||||
34S(-2) 9.7 + 0 = 9.7
|
||||
34S(6) 9.7 + 0 = 9.7
|
||||
|
||||
Solution 2: Mysse
|
||||
|
||||
Input Delta Input+Delta
|
||||
pH 6.610e+00 + 0.000e+00 = 6.610e+00
|
||||
Alkalinity 5.258e-03 + 0.000e+00 = 5.258e-03
|
||||
C(-4) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
C(4) 6.870e-03 + 0.000e+00 = 6.870e-03
|
||||
Ca 1.128e-02 + 0.000e+00 = 1.128e-02
|
||||
Cl 1.785e-02 + 0.000e+00 = 1.785e-02
|
||||
Fe(2) 4.000e-07 + 0.000e+00 = 4.000e-07
|
||||
Fe(3) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
H(0) 1.190e-09 + 0.000e+00 = 1.190e-09
|
||||
K 2.540e-03 + 0.000e+00 = 2.540e-03
|
||||
Mg 4.540e-03 + 0.000e+00 = 4.540e-03
|
||||
Na 3.189e-02 + -1.256e-03 = 3.063e-02
|
||||
O(0) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
S(-2) 2.600e-04 + 0.000e+00 = 2.600e-04
|
||||
S(6) 1.986e-02 + 9.930e-04 = 2.085e-02
|
||||
X 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
13C(-4) -2.3 + 0 = -2.3
|
||||
13C(4) -2.3 + 0 = -2.3
|
||||
34S(-2) -22.1 + 0 = -22.1
|
||||
34S(6) 16.3 + 0 = 16.3
|
||||
|
||||
Isotopic composition of phases:
|
||||
13C Dolomite 3 + 0 = 3
|
||||
13C Calcite -1.5 + 0 = -1.5
|
||||
34S Anhydrite 13.5 + -0.65116 = 12.8488
|
||||
13C CH2O -25 + 3.56577 = -21.4342
|
||||
34S Pyrite -22 + 2 = -20
|
||||
|
||||
Solution fractions: Minimum Maximum
|
||||
Solution 1 1.000e+00 9.999e-01 1.000e+00
|
||||
Solution 2 1.000e+00 1.000e+00 1.000e+00
|
||||
|
||||
Phase mole transfers: Minimum Maximum
|
||||
Dolomite 1.118e-02 1.022e-02 1.193e-02 CaMg(CO3)2
|
||||
Calcite -2.393e-02 -2.567e-02 -2.144e-02 CaCO3
|
||||
Anhydrite 2.288e-02 2.076e-02 2.348e-02 CaSO4
|
||||
CH2O 4.138e-03 3.003e-03 5.273e-03 CH2O
|
||||
Goethite 9.642e-04 6.533e-04 1.275e-03 FeOOH
|
||||
Pyrite -9.648e-04 -1.274e-03 -6.553e-04 FeS2
|
||||
MgX2 -7.652e-03 -8.576e-03 -6.972e-03 MgX2
|
||||
NaX 1.530e-02 1.394e-02 1.715e-02 NaX
|
||||
Halite 1.531e-02 1.429e-02 1.633e-02 NaCl
|
||||
Sylvite 2.520e-03 2.392e-03 2.648e-03 KCl
|
||||
|
||||
Redox mole transfers:
|
||||
Fe(3) 9.642e-04
|
||||
H(0) -1.190e-09
|
||||
S(-2) -2.190e-03
|
||||
|
||||
Sum of residuals (epsilons in documentation): 2.684e+00
|
||||
Sum of delta/uncertainty limit: 4.711e+00
|
||||
Maximum fractional error in element concentration: 5.000e-02
|
||||
|
||||
Model contains minimum number of phases.
|
||||
===============================================================================
|
||||
|
||||
|
||||
Solution 1: Recharge number 3
|
||||
|
||||
Input Delta Input+Delta
|
||||
pH 7.550e+00 + 0.000e+00 = 7.550e+00
|
||||
Alkalinity 4.016e-03 + 1.061e-04 = 4.122e-03
|
||||
C(-4) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
C(4) 4.300e-03 + 1.136e-04 = 4.414e-03
|
||||
Ca 1.200e-03 + 0.000e+00 = 1.200e-03
|
||||
Cl 2.000e-05 + 0.000e+00 = 2.000e-05
|
||||
Fe(2) 1.000e-06 + 0.000e+00 = 1.000e-06
|
||||
Fe(3) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
H(0) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
K 2.000e-05 + 0.000e+00 = 2.000e-05
|
||||
Mg 1.010e-03 + 0.000e+00 = 1.010e-03
|
||||
Na 2.000e-05 + 0.000e+00 = 2.000e-05
|
||||
O(0) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
S(-2) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
S(6) 1.600e-04 + 0.000e+00 = 1.600e-04
|
||||
X 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
13C(-4) -7 + 0 = -7
|
||||
13C(4) -7 + 0 = -7
|
||||
34S(-2) 9.7 + 0 = 9.7
|
||||
34S(6) 9.7 + 0 = 9.7
|
||||
|
||||
Solution 2: Mysse
|
||||
|
||||
Input Delta Input+Delta
|
||||
pH 6.610e+00 + 5.872e-02 = 6.669e+00
|
||||
Alkalinity 5.258e-03 + 0.000e+00 = 5.258e-03
|
||||
C(-4) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
C(4) 6.870e-03 + -2.581e-04 = 6.612e-03
|
||||
Ca 1.128e-02 + 0.000e+00 = 1.128e-02
|
||||
Cl 1.785e-02 + 0.000e+00 = 1.785e-02
|
||||
Fe(2) 4.000e-07 + 0.000e+00 = 4.000e-07
|
||||
Fe(3) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
H(0) 1.190e-09 + 0.000e+00 = 1.190e-09
|
||||
K 2.540e-03 + 0.000e+00 = 2.540e-03
|
||||
Mg 4.540e-03 + 0.000e+00 = 4.540e-03
|
||||
Na 3.189e-02 + -1.256e-03 = 3.063e-02
|
||||
O(0) 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
S(-2) 2.600e-04 + 0.000e+00 = 2.600e-04
|
||||
S(6) 1.986e-02 + 9.930e-04 = 2.085e-02
|
||||
X 0.000e+00 + 0.000e+00 = 0.000e+00
|
||||
13C(-4) -2.3 + 0 = -2.3
|
||||
13C(4) -2.3 + 0 = -2.3
|
||||
34S(-2) -22.1 + 0 = -22.1
|
||||
34S(6) 16.3 + 0 = 16.3
|
||||
|
||||
Isotopic composition of phases:
|
||||
13C Dolomite 3 + 2 = 5
|
||||
13C Calcite -1.5 + -1 = -2.5
|
||||
34S Anhydrite 13.5 + -0.119926 = 13.3801
|
||||
13C CH2O -25 + 5 = -20
|
||||
34S Pyrite -22 + 2 = -20
|
||||
|
||||
Solution fractions: Minimum Maximum
|
||||
Solution 1 1.000e+00 1.000e+00 1.000e+00
|
||||
Solution 2 1.000e+00 1.000e+00 1.000e+00
|
||||
|
||||
Phase mole transfers: Minimum Maximum
|
||||
Dolomite 5.443e-03 4.995e-03 5.838e-03 CaMg(CO3)2
|
||||
Calcite -1.214e-02 -1.333e-02 -1.098e-02 CaCO3
|
||||
Anhydrite 2.252e-02 2.076e-02 2.297e-02 CaSO4
|
||||
CH2O 3.455e-03 3.003e-03 4.297e-03 CH2O
|
||||
Goethite 7.821e-04 6.533e-04 1.015e-03 FeOOH
|
||||
Pyrite -7.827e-04 -1.014e-03 -6.553e-04 FeS2
|
||||
Ca.75Mg.25X2 -7.652e-03 -8.576e-03 -6.972e-03 Ca.75Mg.25X2
|
||||
NaX 1.530e-02 1.394e-02 1.715e-02 NaX
|
||||
Halite 1.531e-02 1.429e-02 1.633e-02 NaCl
|
||||
Sylvite 2.520e-03 2.392e-03 2.648e-03 KCl
|
||||
|
||||
Redox mole transfers:
|
||||
Fe(3) 7.821e-04
|
||||
H(0) -1.190e-09
|
||||
S(-2) -1.825e-03
|
||||
|
||||
Sum of residuals (epsilons in documentation): 4.207e+00
|
||||
Sum of delta/uncertainty limit: 8.243e+00
|
||||
Maximum fractional error in element concentration: 5.000e-02
|
||||
|
||||
Model contains minimum number of phases.
|
||||
===============================================================================
|
||||
|
||||
|
||||
Summary of inverse modeling:
|
||||
|
||||
Number of models found: 2
|
||||
Number of minimal models found: 2
|
||||
Number of infeasible sets of phases saved: 28
|
||||
Number of calls to cl1: 80
|
||||
------------------
|
||||
End of simulation.
|
||||
------------------
|
||||
|
||||
------------------------------------
|
||||
Reading input data for simulation 2.
|
||||
------------------------------------
|
||||
|
||||
-----------
|
||||
End of run.
|
||||
-----------
|
||||
|
||||
No memory leaks
|
||||
4037
Sun/examples/ex2.out
4037
Sun/examples/ex2.out
File diff suppressed because it is too large
Load Diff
@ -1,53 +0,0 @@
|
||||
sim state soln dist_x time step pH pe temp si_anhydrite si_gypsum
|
||||
1 i_soln 1 -99 -99 -99 7 4 25.000 -999.9990 -999.9990
|
||||
1 react 1 -99 0 1 7.06676 10.6862 25.000 -0.2197 0.0000
|
||||
1 react 1 -99 0 2 7.05329 10.6168 26.000 -0.2157 0.0000
|
||||
1 react 1 -99 0 3 7.03993 10.5719 27.000 -0.2115 0.0000
|
||||
1 react 1 -99 0 4 7.02667 10.4793 28.000 -0.2071 0.0000
|
||||
1 react 1 -99 0 5 7.01353 10.4109 29.000 -0.2025 0.0000
|
||||
1 react 1 -99 0 6 7.00051 10.3439 30.000 -0.1977 0.0000
|
||||
1 react 1 -99 0 7 6.9876 10.2766 31.000 -0.1928 0.0000
|
||||
1 react 1 -99 0 8 6.97482 10.2099 32.000 -0.1877 0.0000
|
||||
1 react 1 -99 0 9 6.96217 10.149 33.000 -0.1824 0.0000
|
||||
1 react 1 -99 0 10 6.94965 10.0785 34.000 -0.1769 0.0000
|
||||
1 react 1 -99 0 11 6.93726 10.0131 35.000 -0.1713 0.0000
|
||||
1 react 1 -99 0 12 6.925 9.94603 36.000 -0.1655 0.0000
|
||||
1 react 1 -99 0 13 6.91288 9.88397 37.000 -0.1595 0.0000
|
||||
1 react 1 -99 0 14 6.90089 9.86516 38.000 -0.1533 0.0000
|
||||
1 react 1 -99 0 15 6.88905 9.75536 39.000 -0.1470 0.0000
|
||||
1 react 1 -99 0 16 6.87734 9.69233 40.000 -0.1406 0.0000
|
||||
1 react 1 -99 0 17 6.86578 9.62865 41.000 -0.1340 0.0000
|
||||
1 react 1 -99 0 18 6.85435 9.56448 42.000 -0.1272 0.0000
|
||||
1 react 1 -99 0 19 6.84307 9.50323 43.000 -0.1203 0.0000
|
||||
1 react 1 -99 0 20 6.83193 9.44484 44.000 -0.1132 0.0000
|
||||
1 react 1 -99 0 21 6.82093 9.37869 45.000 -0.1060 0.0000
|
||||
1 react 1 -99 0 22 6.81008 9.31598 46.000 -0.0986 0.0000
|
||||
1 react 1 -99 0 23 6.79936 9.25548 47.000 -0.0911 0.0000
|
||||
1 react 1 -99 0 24 6.78879 9.19236 48.000 -0.0835 0.0000
|
||||
1 react 1 -99 0 25 6.77836 9.14193 49.000 -0.0757 0.0000
|
||||
1 react 1 -99 0 26 6.76807 9.07059 50.000 -0.0678 0.0000
|
||||
1 react 1 -99 0 27 6.75793 9.01241 51.000 -0.0597 0.0000
|
||||
1 react 1 -99 0 28 6.74792 8.95269 52.000 -0.0515 0.0000
|
||||
1 react 1 -99 0 29 6.73806 8.89104 53.000 -0.0432 0.0000
|
||||
1 react 1 -99 0 30 6.72833 8.83437 54.000 -0.0347 0.0000
|
||||
1 react 1 -99 0 31 6.71874 8.77256 55.000 -0.0261 0.0000
|
||||
1 react 1 -99 0 32 6.7093 8.71589 56.000 -0.0174 0.0000
|
||||
1 react 1 -99 0 33 6.69999 8.65867 57.000 -0.0085 0.0000
|
||||
1 react 1 -99 0 34 6.69076 8.59025 58.000 0.0000 -0.0004
|
||||
1 react 1 -99 0 35 6.68054 8.53312 59.000 0.0000 -0.0095
|
||||
1 react 1 -99 0 36 6.67043 8.4773 60.000 0.0000 -0.0187
|
||||
1 react 1 -99 0 37 6.66041 8.42236 61.000 0.0000 -0.0280
|
||||
1 react 1 -99 0 38 6.65049 8.36458 62.000 0.0000 -0.0375
|
||||
1 react 1 -99 0 39 6.64066 8.22145 63.000 0.0000 -0.0471
|
||||
1 react 1 -99 0 40 6.63093 8.25388 64.000 0.0000 -0.0567
|
||||
1 react 1 -99 0 41 6.62129 8.1986 65.000 0.0000 -0.0665
|
||||
1 react 1 -99 0 42 6.61175 8.05474 66.000 0.0000 -0.0764
|
||||
1 react 1 -99 0 43 6.6023 8.09202 67.000 0.0000 -0.0864
|
||||
1 react 1 -99 0 44 6.59294 8.03836 68.000 0.0000 -0.0966
|
||||
1 react 1 -99 0 45 6.58367 7.98491 69.000 0.0000 -0.1068
|
||||
1 react 1 -99 0 46 6.57449 7.93039 70.000 0.0000 -0.1171
|
||||
1 react 1 -99 0 47 6.5654 7.87729 71.000 0.0000 -0.1276
|
||||
1 react 1 -99 0 48 6.55641 7.82446 72.000 0.0000 -0.1381
|
||||
1 react 1 -99 0 49 6.5475 7.76904 73.000 0.0000 -0.1488
|
||||
1 react 1 -99 0 50 6.53867 7.71679 74.000 0.0000 -0.1595
|
||||
1 react 1 -99 0 51 6.52994 7.66434 75.000 0.0000 -0.1704
|
||||
@ -1,789 +0,0 @@
|
||||
Input file: /z/parkplace/home/dlpark/../../home/dlpark/programs/phreeqc/src/../src/Sun/../../examples/ex3
|
||||
Output file: ex3.out
|
||||
Database file: /z/parkplace/home/dlpark/../../home/dlpark/programs/phreeqc/src/../src/Sun/../../database/phreeqc.dat
|
||||
|
||||
------------------
|
||||
Reading data base.
|
||||
------------------
|
||||
|
||||
SOLUTION_MASTER_SPECIES
|
||||
SOLUTION_SPECIES
|
||||
PHASES
|
||||
EXCHANGE_MASTER_SPECIES
|
||||
EXCHANGE_SPECIES
|
||||
SURFACE_MASTER_SPECIES
|
||||
SURFACE_SPECIES
|
||||
RATES
|
||||
END
|
||||
------------------------------------
|
||||
Reading input data for simulation 1.
|
||||
------------------------------------
|
||||
|
||||
TITLE Example 3, part A.--Calcite equilibrium at log Pco2 = -2.0 and 25C.
|
||||
SOLUTION 1 Pure water
|
||||
pH 7.0
|
||||
temp 25.0
|
||||
EQUILIBRIUM_PHASES
|
||||
CO2(g) -2.0
|
||||
Calcite 0.0
|
||||
SAVE solution 1
|
||||
END
|
||||
-----
|
||||
TITLE
|
||||
-----
|
||||
|
||||
Example 3, part A.--Calcite equilibrium at log Pco2 = -2.0 and 25C.
|
||||
|
||||
-------------------------------------------
|
||||
Beginning of initial solution calculations.
|
||||
-------------------------------------------
|
||||
|
||||
Initial solution 1. Pure water
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
Pure water
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 7.000
|
||||
pe = 4.000
|
||||
Activity of water = 1.000
|
||||
Ionic strength = 1.001e-07
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total alkalinity (eq/kg) = 1.082e-10
|
||||
Total carbon (mol/kg) = 0.000e+00
|
||||
Total CO2 (mol/kg) = 0.000e+00
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = -1.082e-10
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = -0.05
|
||||
Iterations = 0
|
||||
Total H = 1.110124e+02
|
||||
Total O = 5.550622e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
OH- 1.002e-07 1.001e-07 -6.999 -6.999 -0.000
|
||||
H+ 1.001e-07 1.000e-07 -7.000 -7.000 -0.000
|
||||
H2O 5.551e+01 1.000e+00 1.744 0.000 0.000
|
||||
H(0) 1.416e-25
|
||||
H2 7.079e-26 7.079e-26 -25.150 -25.150 0.000
|
||||
O(0) 0.000e+00
|
||||
O2 0.000e+00 0.000e+00 -42.080 -42.080 0.000
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
H2(g) -22.00 -25.15 -3.15 H2
|
||||
H2O(g) -1.51 0.00 1.51 H2O
|
||||
O2(g) -39.12 -42.08 -2.96 O2
|
||||
|
||||
-----------------------------------------
|
||||
Beginning of batch-reaction calculations.
|
||||
-----------------------------------------
|
||||
|
||||
Reaction step 1.
|
||||
|
||||
Using solution 1. Pure water
|
||||
Using pure phase assemblage 1.
|
||||
|
||||
-------------------------------Phase assemblage--------------------------------
|
||||
|
||||
Moles in assemblage
|
||||
Phase SI log IAP log KT Initial Final Delta
|
||||
|
||||
Calcite 0.00 -8.48 -8.48 1.000e+01 9.998e+00 -1.646e-03
|
||||
CO2(g) -2.00 -20.15 -18.15 1.000e+01 9.998e+00 -1.976e-03
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
C 3.622e-03 3.622e-03
|
||||
Ca 1.646e-03 1.646e-03
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 7.297 Charge balance
|
||||
pe = -0.987 Adjusted to redox equilibrium
|
||||
Activity of water = 1.000
|
||||
Ionic strength = 4.826e-03
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total alkalinity (eq/kg) = 3.291e-03
|
||||
Total CO2 (mol/kg) = 3.622e-03
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = -1.082e-10
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = -0.00
|
||||
Iterations = 16
|
||||
Total H = 1.110124e+02
|
||||
Total O = 5.551511e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
OH- 2.137e-07 1.982e-07 -6.670 -6.703 -0.033
|
||||
H+ 5.403e-08 5.050e-08 -7.267 -7.297 -0.029
|
||||
H2O 5.551e+01 9.999e-01 1.744 -0.000 0.000
|
||||
C(-4) 2.799e-30
|
||||
CH4 2.799e-30 2.802e-30 -29.553 -29.552 0.000
|
||||
C(4) 3.622e-03
|
||||
HCO3- 3.224e-03 2.998e-03 -2.492 -2.523 -0.032
|
||||
CO2 3.401e-04 3.405e-04 -3.468 -3.468 0.000
|
||||
CaHCO3+ 4.894e-05 4.551e-05 -4.310 -4.342 -0.032
|
||||
CaCO3 5.559e-06 5.565e-06 -5.255 -5.255 0.000
|
||||
CO3-2 3.721e-06 2.784e-06 -5.429 -5.555 -0.126
|
||||
Ca 1.646e-03
|
||||
Ca+2 1.591e-03 1.190e-03 -2.798 -2.925 -0.126
|
||||
CaHCO3+ 4.894e-05 4.551e-05 -4.310 -4.342 -0.032
|
||||
CaCO3 5.559e-06 5.565e-06 -5.255 -5.255 0.000
|
||||
CaOH+ 4.212e-09 3.910e-09 -8.376 -8.408 -0.032
|
||||
H(0) 3.403e-16
|
||||
H2 1.701e-16 1.703e-16 -15.769 -15.769 0.000
|
||||
O(0) 0.000e+00
|
||||
O2 0.000e+00 0.000e+00 -60.843 -60.843 0.000
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
Aragonite -0.14 -8.48 -8.34 CaCO3
|
||||
Calcite 0.00 -8.48 -8.48 CaCO3
|
||||
CH4(g) -26.69 -29.55 -2.86 CH4
|
||||
CO2(g) -2.00 -3.47 -1.47 CO2
|
||||
H2(g) -12.62 -15.77 -3.15 H2
|
||||
H2O(g) -1.51 -0.00 1.51 H2O
|
||||
O2(g) -57.88 -60.84 -2.96 O2
|
||||
|
||||
------------------
|
||||
End of simulation.
|
||||
------------------
|
||||
|
||||
------------------------------------
|
||||
Reading input data for simulation 2.
|
||||
------------------------------------
|
||||
|
||||
TITLE Example 3, part B.--Definition of seawater.
|
||||
SOLUTION 2 Seawater
|
||||
units ppm
|
||||
pH 8.22
|
||||
pe 8.451
|
||||
density 1.023
|
||||
temp 25.0
|
||||
Ca 412.3
|
||||
Mg 1291.8
|
||||
Na 10768.0
|
||||
K 399.1
|
||||
Si 4.28
|
||||
Cl 19353.0
|
||||
Alkalinity 141.682 as HCO3
|
||||
S(6) 2712.0
|
||||
END
|
||||
-----
|
||||
TITLE
|
||||
-----
|
||||
|
||||
Example 3, part B.--Definition of seawater.
|
||||
|
||||
-------------------------------------------
|
||||
Beginning of initial solution calculations.
|
||||
-------------------------------------------
|
||||
|
||||
Initial solution 2. Seawater
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
Alkalinity 2.406e-03 2.406e-03
|
||||
Ca 1.066e-02 1.066e-02
|
||||
Cl 5.657e-01 5.657e-01
|
||||
K 1.058e-02 1.058e-02
|
||||
Mg 5.507e-02 5.507e-02
|
||||
Na 4.854e-01 4.854e-01
|
||||
S(6) 2.926e-02 2.926e-02
|
||||
Si 7.382e-05 7.382e-05
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 8.220
|
||||
pe = 8.451
|
||||
Activity of water = 0.981
|
||||
Ionic strength = 6.748e-01
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total carbon (mol/kg) = 2.180e-03
|
||||
Total CO2 (mol/kg) = 2.180e-03
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = 7.967e-04
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = 0.07
|
||||
Iterations = 7
|
||||
Total H = 1.110147e+02
|
||||
Total O = 5.563008e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
OH- 2.674e-06 1.629e-06 -5.573 -5.788 -0.215
|
||||
H+ 7.981e-09 6.026e-09 -8.098 -8.220 -0.122
|
||||
H2O 5.551e+01 9.806e-01 1.744 -0.009 0.000
|
||||
C(4) 2.180e-03
|
||||
HCO3- 1.514e-03 1.023e-03 -2.820 -2.990 -0.170
|
||||
MgHCO3+ 2.196e-04 1.640e-04 -3.658 -3.785 -0.127
|
||||
NaHCO3 1.668e-04 1.948e-04 -3.778 -3.710 0.067
|
||||
MgCO3 8.914e-05 1.041e-04 -4.050 -3.982 0.067
|
||||
NaCO3- 6.719e-05 5.020e-05 -4.173 -4.299 -0.127
|
||||
CaHCO3+ 4.598e-05 3.106e-05 -4.337 -4.508 -0.170
|
||||
CO3-2 3.821e-05 7.960e-06 -4.418 -5.099 -0.681
|
||||
CaCO3 2.725e-05 3.183e-05 -4.565 -4.497 0.067
|
||||
CO2 1.210e-05 1.413e-05 -4.917 -4.850 0.067
|
||||
Ca 1.066e-02
|
||||
Ca+2 9.504e-03 2.380e-03 -2.022 -2.623 -0.601
|
||||
CaSO4 1.083e-03 1.266e-03 -2.965 -2.898 0.067
|
||||
CaHCO3+ 4.598e-05 3.106e-05 -4.337 -4.508 -0.170
|
||||
CaCO3 2.725e-05 3.183e-05 -4.565 -4.497 0.067
|
||||
CaOH+ 8.604e-08 6.429e-08 -7.065 -7.192 -0.127
|
||||
CaHSO4+ 5.979e-11 4.467e-11 -10.223 -10.350 -0.127
|
||||
Cl 5.657e-01
|
||||
Cl- 5.657e-01 3.528e-01 -0.247 -0.452 -0.205
|
||||
H(0) 5.515e-37
|
||||
H2 2.757e-37 3.221e-37 -36.559 -36.492 0.067
|
||||
K 1.058e-02
|
||||
K+ 1.041e-02 6.495e-03 -1.982 -2.187 -0.205
|
||||
KSO4- 1.627e-04 1.216e-04 -3.789 -3.915 -0.127
|
||||
KOH 3.137e-09 3.665e-09 -8.503 -8.436 0.067
|
||||
Mg 5.507e-02
|
||||
Mg+2 4.742e-02 1.371e-02 -1.324 -1.863 -0.539
|
||||
MgSO4 7.330e-03 8.562e-03 -2.135 -2.067 0.067
|
||||
MgHCO3+ 2.196e-04 1.640e-04 -3.658 -3.785 -0.127
|
||||
MgCO3 8.914e-05 1.041e-04 -4.050 -3.982 0.067
|
||||
MgOH+ 1.084e-05 8.100e-06 -4.965 -5.092 -0.127
|
||||
Na 4.854e-01
|
||||
Na+ 4.791e-01 3.387e-01 -0.320 -0.470 -0.151
|
||||
NaSO4- 6.053e-03 4.523e-03 -2.218 -2.345 -0.127
|
||||
NaHCO3 1.668e-04 1.948e-04 -3.778 -3.710 0.067
|
||||
NaCO3- 6.719e-05 5.020e-05 -4.173 -4.299 -0.127
|
||||
NaOH 3.117e-07 3.641e-07 -6.506 -6.439 0.067
|
||||
O(0) 6.614e-20
|
||||
O2 3.307e-20 3.863e-20 -19.481 -19.413 0.067
|
||||
S(6) 2.926e-02
|
||||
SO4-2 1.463e-02 2.664e-03 -1.835 -2.574 -0.740
|
||||
MgSO4 7.330e-03 8.562e-03 -2.135 -2.067 0.067
|
||||
NaSO4- 6.053e-03 4.523e-03 -2.218 -2.345 -0.127
|
||||
CaSO4 1.083e-03 1.266e-03 -2.965 -2.898 0.067
|
||||
KSO4- 1.627e-04 1.216e-04 -3.789 -3.915 -0.127
|
||||
HSO4- 2.089e-09 1.561e-09 -8.680 -8.807 -0.127
|
||||
CaHSO4+ 5.979e-11 4.467e-11 -10.223 -10.350 -0.127
|
||||
Si 7.382e-05
|
||||
H4SiO4 7.110e-05 8.306e-05 -4.148 -4.081 0.067
|
||||
H3SiO4- 2.720e-06 2.032e-06 -5.565 -5.692 -0.127
|
||||
H2SiO4-2 7.362e-11 2.294e-11 -10.133 -10.639 -0.506
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
Anhydrite -0.84 -5.20 -4.36 CaSO4
|
||||
Aragonite 0.61 -7.72 -8.34 CaCO3
|
||||
Calcite 0.76 -7.72 -8.48 CaCO3
|
||||
Chalcedony -0.51 -4.06 -3.55 SiO2
|
||||
Chrysotile 3.36 35.56 32.20 Mg3Si2O5(OH)4
|
||||
CO2(g) -3.38 -4.85 -1.47 CO2
|
||||
Dolomite 2.41 -14.68 -17.09 CaMg(CO3)2
|
||||
Gypsum -0.63 -5.21 -4.58 CaSO4:2H2O
|
||||
H2(g) -33.34 -36.49 -3.15 H2
|
||||
H2O(g) -1.52 -0.01 1.51 H2O
|
||||
Halite -2.50 -0.92 1.58 NaCl
|
||||
O2(g) -16.45 -19.41 -2.96 O2
|
||||
Quartz -0.08 -4.06 -3.98 SiO2
|
||||
Sepiolite 1.16 16.92 15.76 Mg2Si3O7.5OH:3H2O
|
||||
Sepiolite(d) -1.74 16.92 18.66 Mg2Si3O7.5OH:3H2O
|
||||
SiO2(a) -1.35 -4.06 -2.71 SiO2
|
||||
Talc 6.04 27.44 21.40 Mg3Si4O10(OH)2
|
||||
|
||||
------------------
|
||||
End of simulation.
|
||||
------------------
|
||||
|
||||
------------------------------------
|
||||
Reading input data for simulation 3.
|
||||
------------------------------------
|
||||
|
||||
TITLE Example 3, part C.--Mix 70% ground water, 30% seawater.
|
||||
MIX 1
|
||||
1 0.7
|
||||
2 0.3
|
||||
SAVE solution 3
|
||||
END
|
||||
-----
|
||||
TITLE
|
||||
-----
|
||||
|
||||
Example 3, part C.--Mix 70% ground water, 30% seawater.
|
||||
|
||||
-----------------------------------------
|
||||
Beginning of batch-reaction calculations.
|
||||
-----------------------------------------
|
||||
|
||||
Reaction step 1.
|
||||
|
||||
Using mix 1.
|
||||
|
||||
Mixture 1.
|
||||
|
||||
7.000e-01 Solution 1 Solution after simulation 1.
|
||||
3.000e-01 Solution 2 Seawater
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
C 3.189e-03 3.189e-03
|
||||
Ca 4.350e-03 4.350e-03
|
||||
Cl 1.697e-01 1.697e-01
|
||||
K 3.173e-03 3.173e-03
|
||||
Mg 1.652e-02 1.652e-02
|
||||
Na 1.456e-01 1.456e-01
|
||||
S 8.777e-03 8.777e-03
|
||||
Si 2.215e-05 2.215e-05
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 7.351 Charge balance
|
||||
pe = -1.717 Adjusted to redox equilibrium
|
||||
Activity of water = 0.994
|
||||
Ionic strength = 2.087e-01
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total alkalinity (eq/kg) = 3.026e-03
|
||||
Total CO2 (mol/kg) = 3.189e-03
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = 2.390e-04
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = 0.06
|
||||
Iterations = 13
|
||||
Total H = 1.110131e+02
|
||||
Total O = 5.554960e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
OH- 3.170e-07 2.231e-07 -6.499 -6.651 -0.153
|
||||
H+ 5.603e-08 4.460e-08 -7.252 -7.351 -0.099
|
||||
H2O 5.551e+01 9.941e-01 1.744 -0.003 0.000
|
||||
C(-4) 4.007e-25
|
||||
CH4 4.007e-25 4.204e-25 -24.397 -24.376 0.021
|
||||
C(4) 3.189e-03
|
||||
HCO3- 2.662e-03 1.980e-03 -2.575 -2.703 -0.129
|
||||
CO2 1.904e-04 1.998e-04 -3.720 -3.699 0.021
|
||||
MgHCO3+ 1.545e-04 1.151e-04 -3.811 -3.939 -0.128
|
||||
NaHCO3 1.137e-04 1.192e-04 -3.944 -3.924 0.021
|
||||
CaHCO3+ 4.245e-05 3.158e-05 -4.372 -4.501 -0.129
|
||||
MgCO3 9.408e-06 9.871e-06 -5.027 -5.006 0.021
|
||||
CO3-2 6.803e-06 2.082e-06 -5.167 -5.682 -0.514
|
||||
NaCO3- 5.572e-06 4.151e-06 -5.254 -5.382 -0.128
|
||||
CaCO3 4.166e-06 4.371e-06 -5.380 -5.359 0.021
|
||||
Ca 4.350e-03
|
||||
Ca+2 3.928e-03 1.250e-03 -2.406 -2.903 -0.497
|
||||
CaSO4 3.753e-04 3.938e-04 -3.426 -3.405 0.021
|
||||
CaHCO3+ 4.245e-05 3.158e-05 -4.372 -4.501 -0.129
|
||||
CaCO3 4.166e-06 4.371e-06 -5.380 -5.359 0.021
|
||||
CaOH+ 6.204e-09 4.622e-09 -8.207 -8.335 -0.128
|
||||
CaHSO4+ 1.381e-10 1.029e-10 -9.860 -9.988 -0.128
|
||||
Cl 1.697e-01
|
||||
Cl- 1.697e-01 1.203e-01 -0.770 -0.920 -0.149
|
||||
H(0) 7.279e-15
|
||||
H2 3.640e-15 3.819e-15 -14.439 -14.418 0.021
|
||||
K 3.173e-03
|
||||
K+ 3.140e-03 2.226e-03 -2.503 -2.652 -0.149
|
||||
KSO4- 3.316e-05 2.470e-05 -4.479 -4.607 -0.128
|
||||
KOH 1.639e-10 1.720e-10 -9.785 -9.764 0.021
|
||||
Mg 1.652e-02
|
||||
Mg+2 1.460e-02 4.968e-03 -1.836 -2.304 -0.468
|
||||
MgSO4 1.753e-03 1.839e-03 -2.756 -2.735 0.021
|
||||
MgHCO3+ 1.545e-04 1.151e-04 -3.811 -3.939 -0.128
|
||||
MgCO3 9.408e-06 9.871e-06 -5.027 -5.006 0.021
|
||||
MgOH+ 5.396e-07 4.020e-07 -6.268 -6.396 -0.128
|
||||
Na 1.456e-01
|
||||
Na+ 1.444e-01 1.071e-01 -0.841 -0.970 -0.130
|
||||
NaSO4- 1.138e-03 8.476e-04 -2.944 -3.072 -0.128
|
||||
NaHCO3 1.137e-04 1.192e-04 -3.944 -3.924 0.021
|
||||
NaCO3- 5.572e-06 4.151e-06 -5.254 -5.382 -0.128
|
||||
NaOH 1.503e-08 1.577e-08 -7.823 -7.802 0.021
|
||||
O(0) 0.000e+00
|
||||
O2 0.000e+00 0.000e+00 -63.570 -63.549 0.021
|
||||
S(-2) 4.890e-22
|
||||
HS- 3.876e-22 2.728e-22 -21.412 -21.564 -0.153
|
||||
H2S 1.014e-22 1.064e-22 -21.994 -21.973 0.021
|
||||
S-2 2.513e-27 7.386e-28 -26.600 -27.132 -0.532
|
||||
S(6) 8.777e-03
|
||||
SO4-2 5.478e-03 1.579e-03 -2.261 -2.802 -0.540
|
||||
MgSO4 1.753e-03 1.839e-03 -2.756 -2.735 0.021
|
||||
NaSO4- 1.138e-03 8.476e-04 -2.944 -3.072 -0.128
|
||||
CaSO4 3.753e-04 3.938e-04 -3.426 -3.405 0.021
|
||||
KSO4- 3.316e-05 2.470e-05 -4.479 -4.607 -0.128
|
||||
HSO4- 9.193e-09 6.849e-09 -8.037 -8.164 -0.128
|
||||
CaHSO4+ 1.381e-10 1.029e-10 -9.860 -9.988 -0.128
|
||||
Si 2.215e-05
|
||||
H4SiO4 2.204e-05 2.313e-05 -4.657 -4.636 0.021
|
||||
H3SiO4- 1.026e-07 7.646e-08 -6.989 -7.117 -0.128
|
||||
H2SiO4-2 3.784e-13 1.166e-13 -12.422 -12.933 -0.511
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
Anhydrite -1.34 -5.70 -4.36 CaSO4
|
||||
Aragonite -0.25 -8.58 -8.34 CaCO3
|
||||
Calcite -0.10 -8.58 -8.48 CaCO3
|
||||
CH4(g) -21.52 -24.38 -2.86 CH4
|
||||
Chalcedony -1.08 -4.63 -3.55 SiO2
|
||||
Chrysotile -4.28 27.92 32.20 Mg3Si2O5(OH)4
|
||||
CO2(g) -2.23 -3.70 -1.47 CO2
|
||||
Dolomite 0.52 -16.57 -17.09 CaMg(CO3)2
|
||||
Gypsum -1.13 -5.71 -4.58 CaSO4:2H2O
|
||||
H2(g) -11.27 -14.42 -3.15 H2
|
||||
H2O(g) -1.51 -0.00 1.51 H2O
|
||||
H2S(g) -20.98 -21.97 -1.00 H2S
|
||||
Halite -3.47 -1.89 1.58 NaCl
|
||||
O2(g) -60.59 -63.55 -2.96 O2
|
||||
Quartz -0.65 -4.63 -3.98 SiO2
|
||||
Sepiolite -4.87 10.89 15.76 Mg2Si3O7.5OH:3H2O
|
||||
Sepiolite(d) -7.77 10.89 18.66 Mg2Si3O7.5OH:3H2O
|
||||
SiO2(a) -1.92 -4.63 -2.71 SiO2
|
||||
Sulfur -15.59 -10.71 4.88 S
|
||||
Talc -2.74 18.66 21.40 Mg3Si4O10(OH)2
|
||||
|
||||
------------------
|
||||
End of simulation.
|
||||
------------------
|
||||
|
||||
------------------------------------
|
||||
Reading input data for simulation 4.
|
||||
------------------------------------
|
||||
|
||||
TITLE Example 3, part D.--Equilibrate mixture with calcite and dolomite.
|
||||
EQUILIBRIUM_PHASES 1
|
||||
Calcite 0.0
|
||||
Dolomite 0.0
|
||||
USE solution 3
|
||||
END
|
||||
-----
|
||||
TITLE
|
||||
-----
|
||||
|
||||
Example 3, part D.--Equilibrate mixture with calcite and dolomite.
|
||||
|
||||
-----------------------------------------
|
||||
Beginning of batch-reaction calculations.
|
||||
-----------------------------------------
|
||||
|
||||
Reaction step 1.
|
||||
|
||||
Using solution 3. Solution after simulation 3.
|
||||
Using pure phase assemblage 1.
|
||||
|
||||
-------------------------------Phase assemblage--------------------------------
|
||||
|
||||
Moles in assemblage
|
||||
Phase SI log IAP log KT Initial Final Delta
|
||||
|
||||
Calcite 0.00 -8.48 -8.48 1.000e+01 9.984e+00 -1.571e-02
|
||||
Dolomite 0.00 -17.09 -17.09 1.000e+01 1.001e+01 7.935e-03
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
C 3.029e-03 3.029e-03
|
||||
Ca 1.213e-02 1.212e-02
|
||||
Cl 1.697e-01 1.697e-01
|
||||
K 3.173e-03 3.173e-03
|
||||
Mg 8.585e-03 8.585e-03
|
||||
Na 1.456e-01 1.456e-01
|
||||
S 8.777e-03 8.777e-03
|
||||
Si 2.215e-05 2.215e-05
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 7.056 Charge balance
|
||||
pe = -1.421 Adjusted to redox equilibrium
|
||||
Activity of water = 0.994
|
||||
Ionic strength = 2.087e-01
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total alkalinity (eq/kg) = 2.704e-03
|
||||
Total CO2 (mol/kg) = 3.029e-03
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = 2.390e-04
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = 0.06
|
||||
Iterations = 5
|
||||
Total H = 1.110131e+02
|
||||
Total O = 5.554912e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
OH- 1.609e-07 1.132e-07 -6.793 -6.946 -0.153
|
||||
H+ 1.104e-07 8.788e-08 -6.957 -7.056 -0.099
|
||||
H2O 5.551e+01 9.941e-01 1.744 -0.003 0.000
|
||||
C(-4) 6.977e-25
|
||||
CH4 6.977e-25 7.320e-25 -24.156 -24.135 0.021
|
||||
C(4) 3.029e-03
|
||||
HCO3- 2.397e-03 1.783e-03 -2.620 -2.749 -0.129
|
||||
CO2 3.377e-04 3.543e-04 -3.471 -3.451 0.021
|
||||
CaHCO3+ 1.065e-04 7.920e-05 -3.973 -4.101 -0.129
|
||||
NaHCO3 1.023e-04 1.073e-04 -3.990 -3.969 0.021
|
||||
MgHCO3+ 7.221e-05 5.380e-05 -4.141 -4.269 -0.128
|
||||
CaCO3 5.304e-06 5.565e-06 -5.275 -5.255 0.021
|
||||
CO3-2 3.109e-06 9.513e-07 -5.507 -6.022 -0.514
|
||||
NaCO3- 2.546e-06 1.897e-06 -5.594 -5.722 -0.128
|
||||
MgCO3 2.232e-06 2.341e-06 -5.651 -5.631 0.021
|
||||
Ca 1.213e-02
|
||||
Ca+2 1.095e-02 3.482e-03 -1.961 -2.458 -0.497
|
||||
CaSO4 1.067e-03 1.119e-03 -2.972 -2.951 0.021
|
||||
CaHCO3+ 1.065e-04 7.920e-05 -3.973 -4.101 -0.129
|
||||
CaCO3 5.304e-06 5.565e-06 -5.275 -5.255 0.021
|
||||
CaOH+ 8.774e-09 6.537e-09 -8.057 -8.185 -0.128
|
||||
CaHSO4+ 7.734e-10 5.762e-10 -9.112 -9.239 -0.128
|
||||
Cl 1.697e-01
|
||||
Cl- 1.697e-01 1.203e-01 -0.770 -0.920 -0.149
|
||||
H(0) 7.246e-15
|
||||
H2 3.623e-15 3.801e-15 -14.441 -14.420 0.021
|
||||
K 3.173e-03
|
||||
K+ 3.140e-03 2.225e-03 -2.503 -2.653 -0.149
|
||||
KSO4- 3.381e-05 2.519e-05 -4.471 -4.599 -0.128
|
||||
KOH 8.319e-11 8.729e-11 -10.080 -10.059 0.021
|
||||
Mg 8.585e-03
|
||||
Mg+2 7.582e-03 2.579e-03 -2.120 -2.588 -0.468
|
||||
MgSO4 9.283e-04 9.740e-04 -3.032 -3.011 0.021
|
||||
MgHCO3+ 7.221e-05 5.380e-05 -4.141 -4.269 -0.128
|
||||
MgCO3 2.232e-06 2.341e-06 -5.651 -5.631 0.021
|
||||
MgOH+ 1.422e-07 1.059e-07 -6.847 -6.975 -0.128
|
||||
Na 1.456e-01
|
||||
Na+ 1.444e-01 1.071e-01 -0.841 -0.970 -0.130
|
||||
NaSO4- 1.160e-03 8.644e-04 -2.935 -3.063 -0.128
|
||||
NaHCO3 1.023e-04 1.073e-04 -3.990 -3.969 0.021
|
||||
NaCO3- 2.546e-06 1.897e-06 -5.594 -5.722 -0.128
|
||||
NaOH 7.627e-09 8.002e-09 -8.118 -8.097 0.021
|
||||
O(0) 0.000e+00
|
||||
O2 0.000e+00 0.000e+00 -63.566 -63.545 0.021
|
||||
S(-2) 1.159e-21
|
||||
HS- 7.648e-22 5.382e-22 -21.116 -21.269 -0.153
|
||||
H2S 3.941e-22 4.136e-22 -21.404 -21.383 0.021
|
||||
S-2 2.517e-27 7.397e-28 -26.599 -27.131 -0.532
|
||||
S(6) 8.777e-03
|
||||
SO4-2 5.588e-03 1.611e-03 -2.253 -2.793 -0.540
|
||||
NaSO4- 1.160e-03 8.644e-04 -2.935 -3.063 -0.128
|
||||
CaSO4 1.067e-03 1.119e-03 -2.972 -2.951 0.021
|
||||
MgSO4 9.283e-04 9.740e-04 -3.032 -3.011 0.021
|
||||
KSO4- 3.381e-05 2.519e-05 -4.471 -4.599 -0.128
|
||||
HSO4- 1.847e-08 1.376e-08 -7.733 -7.861 -0.128
|
||||
CaHSO4+ 7.734e-10 5.762e-10 -9.112 -9.239 -0.128
|
||||
Si 2.215e-05
|
||||
H4SiO4 2.210e-05 2.318e-05 -4.656 -4.635 0.021
|
||||
H3SiO4- 5.221e-08 3.890e-08 -7.282 -7.410 -0.128
|
||||
H2SiO4-2 9.772e-14 3.011e-14 -13.010 -13.521 -0.511
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
Anhydrite -0.89 -5.25 -4.36 CaSO4
|
||||
Aragonite -0.14 -8.48 -8.34 CaCO3
|
||||
Calcite 0.00 -8.48 -8.48 CaCO3
|
||||
CH4(g) -21.28 -24.14 -2.86 CH4
|
||||
Chalcedony -1.08 -4.63 -3.55 SiO2
|
||||
Chrysotile -6.90 25.30 32.20 Mg3Si2O5(OH)4
|
||||
CO2(g) -1.98 -3.45 -1.47 CO2
|
||||
Dolomite 0.00 -17.09 -17.09 CaMg(CO3)2
|
||||
Gypsum -0.68 -5.26 -4.58 CaSO4:2H2O
|
||||
H2(g) -11.27 -14.42 -3.15 H2
|
||||
H2O(g) -1.51 -0.00 1.51 H2O
|
||||
H2S(g) -20.39 -21.38 -1.00 H2S
|
||||
Halite -3.47 -1.89 1.58 NaCl
|
||||
O2(g) -60.58 -63.54 -2.96 O2
|
||||
Quartz -0.65 -4.63 -3.98 SiO2
|
||||
Sepiolite -6.62 9.14 15.76 Mg2Si3O7.5OH:3H2O
|
||||
Sepiolite(d) -9.52 9.14 18.66 Mg2Si3O7.5OH:3H2O
|
||||
SiO2(a) -1.92 -4.63 -2.71 SiO2
|
||||
Sulfur -15.00 -10.11 4.88 S
|
||||
Talc -5.36 16.04 21.40 Mg3Si4O10(OH)2
|
||||
|
||||
------------------
|
||||
End of simulation.
|
||||
------------------
|
||||
|
||||
------------------------------------
|
||||
Reading input data for simulation 5.
|
||||
------------------------------------
|
||||
|
||||
TITLE Example 3, part E.--Equilibrate mixture with calcite only.
|
||||
EQUILIBRIUM_PHASES 2
|
||||
Calcite 0.0
|
||||
USE solution 3
|
||||
END
|
||||
-----
|
||||
TITLE
|
||||
-----
|
||||
|
||||
Example 3, part E.--Equilibrate mixture with calcite only.
|
||||
|
||||
-----------------------------------------
|
||||
Beginning of batch-reaction calculations.
|
||||
-----------------------------------------
|
||||
|
||||
Reaction step 1.
|
||||
|
||||
Using solution 3. Solution after simulation 3.
|
||||
Using pure phase assemblage 2.
|
||||
|
||||
-------------------------------Phase assemblage--------------------------------
|
||||
|
||||
Moles in assemblage
|
||||
Phase SI log IAP log KT Initial Final Delta
|
||||
|
||||
Calcite 0.00 -8.48 -8.48 1.000e+01 1.000e+01 -3.992e-05
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
C 3.229e-03 3.229e-03
|
||||
Ca 4.390e-03 4.390e-03
|
||||
Cl 1.697e-01 1.697e-01
|
||||
K 3.173e-03 3.173e-03
|
||||
Mg 1.652e-02 1.652e-02
|
||||
Na 1.456e-01 1.456e-01
|
||||
S 8.777e-03 8.777e-03
|
||||
Si 2.215e-05 2.215e-05
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 7.442 Charge balance
|
||||
pe = -1.861 Adjusted to redox equilibrium
|
||||
Activity of water = 0.994
|
||||
Ionic strength = 2.088e-01
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total alkalinity (eq/kg) = 3.106e-03
|
||||
Total CO2 (mol/kg) = 3.229e-03
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = 2.390e-04
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = 0.06
|
||||
Iterations = 6
|
||||
Total H = 1.110131e+02
|
||||
Total O = 5.554972e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
OH- 3.915e-07 2.755e-07 -6.407 -6.560 -0.153
|
||||
H+ 4.537e-08 3.612e-08 -7.343 -7.442 -0.099
|
||||
H2O 5.551e+01 9.941e-01 1.744 -0.003 0.000
|
||||
C(-4) 8.842e-25
|
||||
CH4 8.842e-25 9.278e-25 -24.053 -24.033 0.021
|
||||
C(4) 3.229e-03
|
||||
HCO3- 2.721e-03 2.024e-03 -2.565 -2.694 -0.129
|
||||
MgHCO3+ 1.579e-04 1.176e-04 -3.802 -3.930 -0.128
|
||||
CO2 1.576e-04 1.653e-04 -3.803 -3.782 0.021
|
||||
NaHCO3 1.161e-04 1.219e-04 -3.935 -3.914 0.021
|
||||
CaHCO3+ 4.376e-05 3.255e-05 -4.359 -4.487 -0.129
|
||||
MgCO3 1.187e-05 1.245e-05 -4.926 -4.905 0.021
|
||||
CO3-2 8.587e-06 2.628e-06 -5.066 -5.580 -0.514
|
||||
NaCO3- 7.033e-06 5.240e-06 -5.153 -5.281 -0.128
|
||||
CaCO3 5.304e-06 5.565e-06 -5.275 -5.255 0.021
|
||||
Ca 4.390e-03
|
||||
Ca+2 3.963e-03 1.261e-03 -2.402 -2.899 -0.497
|
||||
CaSO4 3.784e-04 3.971e-04 -3.422 -3.401 0.021
|
||||
CaHCO3+ 4.376e-05 3.255e-05 -4.359 -4.487 -0.129
|
||||
CaCO3 5.304e-06 5.565e-06 -5.275 -5.255 0.021
|
||||
CaOH+ 7.728e-09 5.758e-09 -8.112 -8.240 -0.128
|
||||
CaHSO4+ 1.128e-10 8.402e-11 -9.948 -10.076 -0.128
|
||||
Cl 1.697e-01
|
||||
Cl- 1.697e-01 1.203e-01 -0.770 -0.920 -0.149
|
||||
H(0) 9.302e-15
|
||||
H2 4.651e-15 4.880e-15 -14.332 -14.312 0.021
|
||||
K 3.173e-03
|
||||
K+ 3.140e-03 2.226e-03 -2.503 -2.652 -0.149
|
||||
KSO4- 3.314e-05 2.469e-05 -4.480 -4.607 -0.128
|
||||
KOH 2.025e-10 2.124e-10 -9.694 -9.673 0.021
|
||||
Mg 1.652e-02
|
||||
Mg+2 1.460e-02 4.966e-03 -1.836 -2.304 -0.468
|
||||
MgSO4 1.752e-03 1.838e-03 -2.757 -2.736 0.021
|
||||
MgHCO3+ 1.579e-04 1.176e-04 -3.802 -3.930 -0.128
|
||||
MgCO3 1.187e-05 1.245e-05 -4.926 -4.905 0.021
|
||||
MgOH+ 6.661e-07 4.963e-07 -6.176 -6.304 -0.128
|
||||
Na 1.456e-01
|
||||
Na+ 1.444e-01 1.071e-01 -0.841 -0.970 -0.130
|
||||
NaSO4- 1.137e-03 8.472e-04 -2.944 -3.072 -0.128
|
||||
NaHCO3 1.161e-04 1.219e-04 -3.935 -3.914 0.021
|
||||
NaCO3- 7.033e-06 5.240e-06 -5.153 -5.281 -0.128
|
||||
NaOH 1.856e-08 1.947e-08 -7.731 -7.711 0.021
|
||||
O(0) 0.000e+00
|
||||
O2 0.000e+00 0.000e+00 -63.783 -63.762 0.021
|
||||
S(-2) 1.014e-21
|
||||
HS- 8.367e-22 5.888e-22 -21.077 -21.230 -0.153
|
||||
H2S 1.772e-22 1.860e-22 -21.751 -21.731 0.021
|
||||
S-2 6.701e-27 1.969e-27 -26.174 -26.706 -0.532
|
||||
S(6) 8.777e-03
|
||||
SO4-2 5.477e-03 1.579e-03 -2.261 -2.802 -0.540
|
||||
MgSO4 1.752e-03 1.838e-03 -2.757 -2.736 0.021
|
||||
NaSO4- 1.137e-03 8.472e-04 -2.944 -3.072 -0.128
|
||||
CaSO4 3.784e-04 3.971e-04 -3.422 -3.401 0.021
|
||||
KSO4- 3.314e-05 2.469e-05 -4.480 -4.607 -0.128
|
||||
HSO4- 7.441e-09 5.544e-09 -8.128 -8.256 -0.128
|
||||
CaHSO4+ 1.128e-10 8.402e-11 -9.948 -10.076 -0.128
|
||||
Si 2.215e-05
|
||||
H4SiO4 2.202e-05 2.311e-05 -4.657 -4.636 0.021
|
||||
H3SiO4- 1.266e-07 9.432e-08 -6.898 -7.025 -0.128
|
||||
H2SiO4-2 5.766e-13 1.776e-13 -12.239 -12.750 -0.511
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
Anhydrite -1.34 -5.70 -4.36 CaSO4
|
||||
Aragonite -0.14 -8.48 -8.34 CaCO3
|
||||
Calcite 0.00 -8.48 -8.48 CaCO3
|
||||
CH4(g) -21.17 -24.03 -2.86 CH4
|
||||
Chalcedony -1.08 -4.63 -3.55 SiO2
|
||||
Chrysotile -3.73 28.47 32.20 Mg3Si2O5(OH)4
|
||||
CO2(g) -2.31 -3.78 -1.47 CO2
|
||||
Dolomite 0.73 -16.36 -17.09 CaMg(CO3)2
|
||||
Gypsum -1.13 -5.71 -4.58 CaSO4:2H2O
|
||||
H2(g) -11.16 -14.31 -3.15 H2
|
||||
H2O(g) -1.51 -0.00 1.51 H2O
|
||||
H2S(g) -20.73 -21.73 -1.00 H2S
|
||||
Halite -3.47 -1.89 1.58 NaCl
|
||||
O2(g) -60.80 -63.76 -2.96 O2
|
||||
Quartz -0.65 -4.63 -3.98 SiO2
|
||||
Sepiolite -4.51 11.25 15.76 Mg2Si3O7.5OH:3H2O
|
||||
Sepiolite(d) -7.41 11.25 18.66 Mg2Si3O7.5OH:3H2O
|
||||
SiO2(a) -1.92 -4.63 -2.71 SiO2
|
||||
Sulfur -15.45 -10.57 4.88 S
|
||||
Talc -2.19 19.21 21.40 Mg3Si4O10(OH)2
|
||||
|
||||
------------------
|
||||
End of simulation.
|
||||
------------------
|
||||
|
||||
------------------------------------
|
||||
Reading input data for simulation 6.
|
||||
------------------------------------
|
||||
|
||||
-----------
|
||||
End of run.
|
||||
-----------
|
||||
|
||||
No memory leaks
|
||||
@ -1,478 +0,0 @@
|
||||
Input file: /z/parkplace/home/dlpark/../../home/dlpark/programs/phreeqc/src/../src/Sun/../../examples/ex4
|
||||
Output file: ex4.out
|
||||
Database file: /z/parkplace/home/dlpark/../../home/dlpark/programs/phreeqc/src/../src/Sun/../../database/phreeqc.dat
|
||||
|
||||
------------------
|
||||
Reading data base.
|
||||
------------------
|
||||
|
||||
SOLUTION_MASTER_SPECIES
|
||||
SOLUTION_SPECIES
|
||||
PHASES
|
||||
EXCHANGE_MASTER_SPECIES
|
||||
EXCHANGE_SPECIES
|
||||
SURFACE_MASTER_SPECIES
|
||||
SURFACE_SPECIES
|
||||
RATES
|
||||
END
|
||||
------------------------------------
|
||||
Reading input data for simulation 1.
|
||||
------------------------------------
|
||||
|
||||
TITLE Example 4a.--Rain water evaporation
|
||||
SOLUTION 1 Precipitation from Central Oklahoma
|
||||
units mg/L
|
||||
pH 4.5 # estimated
|
||||
temp 25.0
|
||||
Ca .384
|
||||
Mg .043
|
||||
Na .141
|
||||
K .036
|
||||
Cl .236
|
||||
C(4) .1 CO2(g) -3.5
|
||||
S(6) 1.3
|
||||
N(-3) .208
|
||||
N(5) .237
|
||||
REACTION 1
|
||||
H2O -1.0
|
||||
52.73 moles
|
||||
SAVE solution 2
|
||||
END
|
||||
-----
|
||||
TITLE
|
||||
-----
|
||||
|
||||
Example 4a.--Rain water evaporation
|
||||
|
||||
-------------------------------------------
|
||||
Beginning of initial solution calculations.
|
||||
-------------------------------------------
|
||||
|
||||
Initial solution 1. Precipitation from Central Oklahoma
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
C(4) 1.092e-05 1.092e-05 Equilibrium with CO2(g)
|
||||
Ca 9.581e-06 9.581e-06
|
||||
Cl 6.657e-06 6.657e-06
|
||||
K 9.207e-07 9.207e-07
|
||||
Mg 1.769e-06 1.769e-06
|
||||
N(-3) 1.485e-05 1.485e-05
|
||||
N(5) 1.692e-05 1.692e-05
|
||||
Na 6.133e-06 6.133e-06
|
||||
S(6) 1.353e-05 1.353e-05
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 4.500
|
||||
pe = 4.000
|
||||
Activity of water = 1.000
|
||||
Ionic strength = 8.838e-05
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total alkalinity (eq/kg) = -3.185e-05
|
||||
Total CO2 (mol/kg) = 1.092e-05
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = 2.581e-05
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = 20.29
|
||||
Iterations = 3
|
||||
Total H = 1.110125e+02
|
||||
Total O = 5.550634e+01
|
||||
|
||||
---------------------------------Redox couples---------------------------------
|
||||
|
||||
Redox couple pe Eh (volts)
|
||||
|
||||
N(-3)/N(5) 9.2667 0.5482
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
H+ 3.196e-05 3.162e-05 -4.495 -4.500 -0.005
|
||||
OH- 3.200e-10 3.166e-10 -9.495 -9.500 -0.005
|
||||
H2O 5.551e+01 1.000e+00 1.744 -0.000 0.000
|
||||
C(4) 1.092e-05
|
||||
CO2 1.077e-05 1.077e-05 -4.968 -4.968 0.000
|
||||
HCO3- 1.531e-07 1.514e-07 -6.815 -6.820 -0.005
|
||||
CaHCO3+ 1.787e-11 1.768e-11 -10.748 -10.753 -0.005
|
||||
MgHCO3+ 3.025e-12 2.992e-12 -11.519 -11.524 -0.005
|
||||
NaHCO3 5.166e-13 5.166e-13 -12.287 -12.287 0.000
|
||||
CO3-2 2.345e-13 2.246e-13 -12.630 -12.649 -0.019
|
||||
CaCO3 3.452e-15 3.452e-15 -14.462 -14.462 0.000
|
||||
MgCO3 3.619e-16 3.619e-16 -15.441 -15.441 0.000
|
||||
NaCO3- 2.565e-17 2.537e-17 -16.591 -16.596 -0.005
|
||||
Ca 9.581e-06
|
||||
Ca+2 9.557e-06 9.151e-06 -5.020 -5.039 -0.019
|
||||
CaSO4 2.353e-08 2.353e-08 -7.628 -7.628 0.000
|
||||
CaHCO3+ 1.787e-11 1.768e-11 -10.748 -10.753 -0.005
|
||||
CaHSO4+ 4.408e-12 4.360e-12 -11.356 -11.361 -0.005
|
||||
CaOH+ 4.855e-14 4.803e-14 -13.314 -13.319 -0.005
|
||||
CaCO3 3.452e-15 3.452e-15 -14.462 -14.462 0.000
|
||||
Cl 6.657e-06
|
||||
Cl- 6.657e-06 6.585e-06 -5.177 -5.181 -0.005
|
||||
H(0) 1.416e-20
|
||||
H2 7.079e-21 7.079e-21 -20.150 -20.150 0.000
|
||||
K 9.207e-07
|
||||
K+ 9.206e-07 9.106e-07 -6.036 -6.041 -0.005
|
||||
KSO4- 8.337e-11 8.247e-11 -10.079 -10.084 -0.005
|
||||
KOH 9.984e-17 9.985e-17 -16.001 -16.001 0.000
|
||||
Mg 1.769e-06
|
||||
Mg+2 1.764e-06 1.689e-06 -5.754 -5.772 -0.019
|
||||
MgSO4 5.103e-09 5.103e-09 -8.292 -8.292 0.000
|
||||
MgHCO3+ 3.025e-12 2.992e-12 -11.519 -11.524 -0.005
|
||||
MgOH+ 1.960e-13 1.939e-13 -12.708 -12.712 -0.005
|
||||
MgCO3 3.619e-16 3.619e-16 -15.441 -15.441 0.000
|
||||
N(-3) 1.485e-05
|
||||
NH4+ 1.485e-05 1.469e-05 -4.828 -4.833 -0.005
|
||||
NH4SO4- 2.465e-09 2.438e-09 -8.608 -8.613 -0.005
|
||||
NH3 2.646e-10 2.647e-10 -9.577 -9.577 0.000
|
||||
N(5) 1.692e-05
|
||||
NO3- 1.692e-05 1.674e-05 -4.772 -4.776 -0.005
|
||||
Na 6.133e-06
|
||||
Na+ 6.133e-06 6.066e-06 -5.212 -5.217 -0.005
|
||||
NaSO4- 3.962e-10 3.919e-10 -9.402 -9.407 -0.005
|
||||
NaHCO3 5.166e-13 5.166e-13 -12.287 -12.287 0.000
|
||||
NaOH 1.267e-15 1.267e-15 -14.897 -14.897 0.000
|
||||
NaCO3- 2.565e-17 2.537e-17 -16.591 -16.596 -0.005
|
||||
O(0) 0.000e+00
|
||||
O2 0.000e+00 0.000e+00 -52.080 -52.080 0.000
|
||||
S(6) 1.353e-05
|
||||
SO4-2 1.346e-05 1.289e-05 -4.871 -4.890 -0.019
|
||||
HSO4- 4.006e-08 3.963e-08 -7.397 -7.402 -0.005
|
||||
CaSO4 2.353e-08 2.353e-08 -7.628 -7.628 0.000
|
||||
MgSO4 5.103e-09 5.103e-09 -8.292 -8.292 0.000
|
||||
NH4SO4- 2.465e-09 2.438e-09 -8.608 -8.613 -0.005
|
||||
NaSO4- 3.962e-10 3.919e-10 -9.402 -9.407 -0.005
|
||||
KSO4- 8.337e-11 8.247e-11 -10.079 -10.084 -0.005
|
||||
CaHSO4+ 4.408e-12 4.360e-12 -11.356 -11.361 -0.005
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
Anhydrite -5.57 -9.93 -4.36 CaSO4
|
||||
Aragonite -9.35 -17.69 -8.34 CaCO3
|
||||
Calcite -9.21 -17.69 -8.48 CaCO3
|
||||
CO2(g) -3.50 -4.97 -1.47 CO2
|
||||
Dolomite -19.02 -36.11 -17.09 CaMg(CO3)2
|
||||
Gypsum -5.35 -9.93 -4.58 CaSO4:2H2O
|
||||
H2(g) -17.00 -20.15 -3.15 H2
|
||||
H2O(g) -1.51 -0.00 1.51 H2O
|
||||
Halite -11.98 -10.40 1.58 NaCl
|
||||
NH3(g) -11.35 -9.58 1.77 NH3
|
||||
O2(g) -49.12 -52.08 -2.96 O2
|
||||
|
||||
-----------------------------------------
|
||||
Beginning of batch-reaction calculations.
|
||||
-----------------------------------------
|
||||
|
||||
Reaction step 1.
|
||||
|
||||
Using solution 1. Precipitation from Central Oklahoma
|
||||
Using reaction 1.
|
||||
|
||||
Reaction 1. Irreversible reaction defined in simulation 1.
|
||||
|
||||
5.273e+01 moles of the following reaction have been added:
|
||||
|
||||
Relative
|
||||
Reactant moles
|
||||
|
||||
H2O -1.00
|
||||
|
||||
Relative
|
||||
Element moles
|
||||
H -2.00
|
||||
O -1.00
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
C 2.183e-04 1.092e-05
|
||||
Ca 1.916e-04 9.581e-06
|
||||
Cl 1.331e-04 6.657e-06
|
||||
K 1.841e-05 9.207e-07
|
||||
Mg 3.536e-05 1.769e-06
|
||||
N 6.352e-04 3.177e-05
|
||||
Na 1.226e-04 6.133e-06
|
||||
S 2.706e-04 1.353e-05
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 3.148 Charge balance
|
||||
pe = 16.530 Adjusted to redox equilibrium
|
||||
Activity of water = 1.000
|
||||
Ionic strength = 1.528e-03
|
||||
Mass of water (kg) = 5.002e-02
|
||||
Total alkalinity (eq/kg) = -7.555e-04
|
||||
Total CO2 (mol/kg) = 2.183e-04
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = 2.581e-05
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = 24.31
|
||||
Iterations = 20
|
||||
Total H = 5.552525e+00
|
||||
Total O = 2.776344e+00
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
H+ 7.406e-04 7.108e-04 -3.130 -3.148 -0.018
|
||||
OH- 1.472e-11 1.408e-11 -10.832 -10.851 -0.019
|
||||
H2O 5.551e+01 1.000e+00 1.744 -0.000 0.000
|
||||
C(-4) 0.000e+00
|
||||
CH4 0.000e+00 0.000e+00 -136.693 -136.693 0.000
|
||||
C(4) 2.183e-04
|
||||
CO2 2.182e-04 2.182e-04 -3.661 -3.661 0.000
|
||||
HCO3- 1.425e-07 1.366e-07 -6.846 -6.865 -0.019
|
||||
CaHCO3+ 2.834e-10 2.715e-10 -9.548 -9.566 -0.019
|
||||
MgHCO3+ 4.780e-11 4.576e-11 -10.321 -10.340 -0.019
|
||||
NaHCO3 9.005e-12 9.008e-12 -11.046 -11.045 0.000
|
||||
CO3-2 1.070e-14 9.010e-15 -13.971 -14.045 -0.074
|
||||
CaCO3 2.358e-15 2.359e-15 -14.627 -14.627 0.000
|
||||
MgCO3 2.461e-16 2.462e-16 -15.609 -15.609 0.000
|
||||
NaCO3- 2.056e-17 1.968e-17 -16.687 -16.706 -0.019
|
||||
Ca 1.916e-04
|
||||
Ca+2 1.851e-04 1.559e-04 -3.733 -3.807 -0.075
|
||||
CaSO4 6.474e-06 6.477e-06 -5.189 -5.189 0.000
|
||||
CaHSO4+ 2.817e-08 2.697e-08 -7.550 -7.569 -0.019
|
||||
CaHCO3+ 2.834e-10 2.715e-10 -9.548 -9.566 -0.019
|
||||
CaOH+ 3.801e-14 3.639e-14 -13.420 -13.439 -0.019
|
||||
CaCO3 2.358e-15 2.359e-15 -14.627 -14.627 0.000
|
||||
Cl 1.331e-04
|
||||
Cl- 1.331e-04 1.274e-04 -3.876 -3.895 -0.019
|
||||
H(0) 0.000e+00
|
||||
H2 0.000e+00 0.000e+00 -42.506 -42.506 0.000
|
||||
K 1.841e-05
|
||||
K+ 1.838e-05 1.759e-05 -4.736 -4.755 -0.019
|
||||
KSO4- 2.689e-08 2.575e-08 -7.570 -7.589 -0.019
|
||||
KOH 8.579e-17 8.582e-17 -16.067 -16.066 0.000
|
||||
Mg 3.536e-05
|
||||
Mg+2 3.396e-05 2.864e-05 -4.469 -4.543 -0.074
|
||||
MgSO4 1.398e-06 1.398e-06 -5.855 -5.854 0.000
|
||||
MgHCO3+ 4.780e-11 4.576e-11 -10.321 -10.340 -0.019
|
||||
MgOH+ 1.528e-13 1.463e-13 -12.816 -12.835 -0.019
|
||||
MgCO3 2.461e-16 2.462e-16 -15.609 -15.609 0.000
|
||||
N(-3) 0.000e+00
|
||||
NH4+ 0.000e+00 0.000e+00 -48.438 -48.457 -0.019
|
||||
NH4SO4- 0.000e+00 0.000e+00 -51.009 -51.028 -0.019
|
||||
NH3 0.000e+00 0.000e+00 -54.553 -54.553 0.000
|
||||
N(0) 4.751e-04
|
||||
N2 2.375e-04 2.376e-04 -3.624 -3.624 0.000
|
||||
N(3) 2.623e-15
|
||||
NO2- 2.623e-15 2.510e-15 -14.581 -14.600 -0.019
|
||||
N(5) 1.601e-04
|
||||
NO3- 1.601e-04 1.532e-04 -3.796 -3.815 -0.019
|
||||
Na 1.226e-04
|
||||
Na+ 1.225e-04 1.173e-04 -3.912 -3.931 -0.019
|
||||
NaSO4- 1.279e-07 1.224e-07 -6.893 -6.912 -0.019
|
||||
NaHCO3 9.005e-12 9.008e-12 -11.046 -11.045 0.000
|
||||
NaOH 1.090e-15 1.090e-15 -14.963 -14.962 0.000
|
||||
NaCO3- 2.056e-17 1.968e-17 -16.687 -16.706 -0.019
|
||||
O(0) 8.553e-08
|
||||
O2 4.277e-08 4.278e-08 -7.369 -7.369 0.000
|
||||
S(-2) 0.000e+00
|
||||
H2S 0.000e+00 0.000e+00 -126.809 -126.809 0.000
|
||||
HS- 0.000e+00 0.000e+00 -130.583 -130.602 -0.019
|
||||
S-2 0.000e+00 0.000e+00 -140.297 -140.372 -0.075
|
||||
S(6) 2.706e-04
|
||||
SO4-2 2.475e-04 2.083e-04 -3.606 -3.681 -0.075
|
||||
HSO4- 1.503e-05 1.439e-05 -4.823 -4.842 -0.019
|
||||
CaSO4 6.474e-06 6.477e-06 -5.189 -5.189 0.000
|
||||
MgSO4 1.398e-06 1.398e-06 -5.855 -5.854 0.000
|
||||
NaSO4- 1.279e-07 1.224e-07 -6.893 -6.912 -0.019
|
||||
CaHSO4+ 2.817e-08 2.697e-08 -7.550 -7.569 -0.019
|
||||
KSO4- 2.689e-08 2.575e-08 -7.570 -7.589 -0.019
|
||||
NH4SO4- 0.000e+00 0.000e+00 -51.009 -51.028 -0.019
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
Anhydrite -3.13 -7.49 -4.36 CaSO4
|
||||
Aragonite -9.52 -17.85 -8.34 CaCO3
|
||||
Calcite -9.37 -17.85 -8.48 CaCO3
|
||||
CH4(g) -133.83 -136.69 -2.86 CH4
|
||||
CO2(g) -2.19 -3.66 -1.47 CO2
|
||||
Dolomite -19.35 -36.44 -17.09 CaMg(CO3)2
|
||||
Gypsum -2.91 -7.49 -4.58 CaSO4:2H2O
|
||||
H2(g) -39.36 -42.51 -3.15 H2
|
||||
H2O(g) -1.51 -0.00 1.51 H2O
|
||||
H2S(g) -125.81 -126.81 -1.00 H2S
|
||||
Halite -9.41 -7.83 1.58 NaCl
|
||||
N2(g) -0.36 -3.62 -3.26 N2
|
||||
NH3(g) -56.32 -54.55 1.77 NH3
|
||||
O2(g) -4.41 -7.37 -2.96 O2
|
||||
Sulfur -92.34 -87.45 4.88 S
|
||||
|
||||
------------------
|
||||
End of simulation.
|
||||
------------------
|
||||
|
||||
------------------------------------
|
||||
Reading input data for simulation 2.
|
||||
------------------------------------
|
||||
|
||||
TITLE Example 4b.--Factor of 20 more solution
|
||||
MIX
|
||||
2 20.
|
||||
SAVE solution 3
|
||||
END
|
||||
-----
|
||||
TITLE
|
||||
-----
|
||||
|
||||
Example 4b.--Factor of 20 more solution
|
||||
|
||||
-----------------------------------------
|
||||
Beginning of batch-reaction calculations.
|
||||
-----------------------------------------
|
||||
|
||||
Reaction step 1.
|
||||
|
||||
Using mix 1.
|
||||
|
||||
Mixture 1.
|
||||
|
||||
2.000e+01 Solution 2 Solution after simulation 1.
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
C 2.183e-04 2.184e-04
|
||||
Ca 1.916e-04 1.916e-04
|
||||
Cl 1.331e-04 1.331e-04
|
||||
K 1.841e-05 1.841e-05
|
||||
Mg 3.536e-05 3.537e-05
|
||||
N 6.352e-04 6.354e-04
|
||||
Na 1.226e-04 1.227e-04
|
||||
S 2.706e-04 2.707e-04
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 3.148 Charge balance
|
||||
pe = 16.530 Adjusted to redox equilibrium
|
||||
Activity of water = 1.000
|
||||
Ionic strength = 1.528e-03
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total alkalinity (eq/kg) = -7.555e-04
|
||||
Total CO2 (mol/kg) = 2.183e-04
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = 5.162e-04
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = 24.31
|
||||
Iterations = 0
|
||||
Total H = 1.110505e+02
|
||||
Total O = 5.552687e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
H+ 7.406e-04 7.108e-04 -3.130 -3.148 -0.018
|
||||
OH- 1.472e-11 1.408e-11 -10.832 -10.851 -0.019
|
||||
H2O 5.551e+01 1.000e+00 1.744 -0.000 0.000
|
||||
C(-4) 0.000e+00
|
||||
CH4 0.000e+00 0.000e+00 -136.693 -136.693 0.000
|
||||
C(4) 2.183e-04
|
||||
CO2 2.182e-04 2.182e-04 -3.661 -3.661 0.000
|
||||
HCO3- 1.425e-07 1.366e-07 -6.846 -6.865 -0.019
|
||||
CaHCO3+ 2.834e-10 2.715e-10 -9.548 -9.566 -0.019
|
||||
MgHCO3+ 4.780e-11 4.576e-11 -10.321 -10.340 -0.019
|
||||
NaHCO3 9.005e-12 9.008e-12 -11.046 -11.045 0.000
|
||||
CO3-2 1.070e-14 9.010e-15 -13.971 -14.045 -0.074
|
||||
CaCO3 2.358e-15 2.359e-15 -14.627 -14.627 0.000
|
||||
MgCO3 2.461e-16 2.462e-16 -15.609 -15.609 0.000
|
||||
NaCO3- 2.056e-17 1.968e-17 -16.687 -16.706 -0.019
|
||||
Ca 1.916e-04
|
||||
Ca+2 1.851e-04 1.559e-04 -3.733 -3.807 -0.075
|
||||
CaSO4 6.474e-06 6.477e-06 -5.189 -5.189 0.000
|
||||
CaHSO4+ 2.817e-08 2.697e-08 -7.550 -7.569 -0.019
|
||||
CaHCO3+ 2.834e-10 2.715e-10 -9.548 -9.566 -0.019
|
||||
CaOH+ 3.801e-14 3.639e-14 -13.420 -13.439 -0.019
|
||||
CaCO3 2.358e-15 2.359e-15 -14.627 -14.627 0.000
|
||||
Cl 1.331e-04
|
||||
Cl- 1.331e-04 1.274e-04 -3.876 -3.895 -0.019
|
||||
H(0) 0.000e+00
|
||||
H2 0.000e+00 0.000e+00 -42.506 -42.506 0.000
|
||||
K 1.841e-05
|
||||
K+ 1.838e-05 1.759e-05 -4.736 -4.755 -0.019
|
||||
KSO4- 2.689e-08 2.575e-08 -7.570 -7.589 -0.019
|
||||
KOH 8.579e-17 8.582e-17 -16.067 -16.066 0.000
|
||||
Mg 3.536e-05
|
||||
Mg+2 3.396e-05 2.864e-05 -4.469 -4.543 -0.074
|
||||
MgSO4 1.398e-06 1.398e-06 -5.855 -5.854 0.000
|
||||
MgHCO3+ 4.780e-11 4.576e-11 -10.321 -10.340 -0.019
|
||||
MgOH+ 1.528e-13 1.463e-13 -12.816 -12.835 -0.019
|
||||
MgCO3 2.461e-16 2.462e-16 -15.609 -15.609 0.000
|
||||
N(-3) 0.000e+00
|
||||
NH4+ 0.000e+00 0.000e+00 -48.438 -48.457 -0.019
|
||||
NH4SO4- 0.000e+00 0.000e+00 -51.009 -51.028 -0.019
|
||||
NH3 0.000e+00 0.000e+00 -54.553 -54.553 0.000
|
||||
N(0) 4.751e-04
|
||||
N2 2.375e-04 2.376e-04 -3.624 -3.624 0.000
|
||||
N(3) 2.623e-15
|
||||
NO2- 2.623e-15 2.510e-15 -14.581 -14.600 -0.019
|
||||
N(5) 1.601e-04
|
||||
NO3- 1.601e-04 1.532e-04 -3.796 -3.815 -0.019
|
||||
Na 1.226e-04
|
||||
Na+ 1.225e-04 1.173e-04 -3.912 -3.931 -0.019
|
||||
NaSO4- 1.279e-07 1.224e-07 -6.893 -6.912 -0.019
|
||||
NaHCO3 9.005e-12 9.008e-12 -11.046 -11.045 0.000
|
||||
NaOH 1.090e-15 1.090e-15 -14.963 -14.962 0.000
|
||||
NaCO3- 2.056e-17 1.968e-17 -16.687 -16.706 -0.019
|
||||
O(0) 8.553e-08
|
||||
O2 4.277e-08 4.278e-08 -7.369 -7.369 0.000
|
||||
S(-2) 0.000e+00
|
||||
H2S 0.000e+00 0.000e+00 -126.809 -126.809 0.000
|
||||
HS- 0.000e+00 0.000e+00 -130.583 -130.602 -0.019
|
||||
S-2 0.000e+00 0.000e+00 -140.297 -140.372 -0.075
|
||||
S(6) 2.706e-04
|
||||
SO4-2 2.475e-04 2.083e-04 -3.606 -3.681 -0.075
|
||||
HSO4- 1.503e-05 1.439e-05 -4.823 -4.842 -0.019
|
||||
CaSO4 6.474e-06 6.477e-06 -5.189 -5.189 0.000
|
||||
MgSO4 1.398e-06 1.398e-06 -5.855 -5.854 0.000
|
||||
NaSO4- 1.279e-07 1.224e-07 -6.893 -6.912 -0.019
|
||||
CaHSO4+ 2.817e-08 2.697e-08 -7.550 -7.569 -0.019
|
||||
KSO4- 2.689e-08 2.575e-08 -7.570 -7.589 -0.019
|
||||
NH4SO4- 0.000e+00 0.000e+00 -51.009 -51.028 -0.019
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
Anhydrite -3.13 -7.49 -4.36 CaSO4
|
||||
Aragonite -9.52 -17.85 -8.34 CaCO3
|
||||
Calcite -9.37 -17.85 -8.48 CaCO3
|
||||
CH4(g) -133.83 -136.69 -2.86 CH4
|
||||
CO2(g) -2.19 -3.66 -1.47 CO2
|
||||
Dolomite -19.35 -36.44 -17.09 CaMg(CO3)2
|
||||
Gypsum -2.91 -7.49 -4.58 CaSO4:2H2O
|
||||
H2(g) -39.36 -42.51 -3.15 H2
|
||||
H2O(g) -1.51 -0.00 1.51 H2O
|
||||
H2S(g) -125.81 -126.81 -1.00 H2S
|
||||
Halite -9.41 -7.83 1.58 NaCl
|
||||
N2(g) -0.36 -3.62 -3.26 N2
|
||||
NH3(g) -56.32 -54.55 1.77 NH3
|
||||
O2(g) -4.41 -7.37 -2.96 O2
|
||||
Sulfur -92.34 -87.45 4.88 S
|
||||
|
||||
------------------
|
||||
End of simulation.
|
||||
------------------
|
||||
|
||||
------------------------------------
|
||||
Reading input data for simulation 3.
|
||||
------------------------------------
|
||||
|
||||
-----------
|
||||
End of run.
|
||||
-----------
|
||||
|
||||
No memory leaks
|
||||
@ -1,942 +0,0 @@
|
||||
Input file: /z/parkplace/home/dlpark/../../home/dlpark/programs/phreeqc/src/../src/Sun/../../examples/ex5
|
||||
Output file: ex5.out
|
||||
Database file: /z/parkplace/home/dlpark/../../home/dlpark/programs/phreeqc/src/../src/Sun/../../database/phreeqc.dat
|
||||
|
||||
------------------
|
||||
Reading data base.
|
||||
------------------
|
||||
|
||||
SOLUTION_MASTER_SPECIES
|
||||
SOLUTION_SPECIES
|
||||
PHASES
|
||||
EXCHANGE_MASTER_SPECIES
|
||||
EXCHANGE_SPECIES
|
||||
SURFACE_MASTER_SPECIES
|
||||
SURFACE_SPECIES
|
||||
RATES
|
||||
END
|
||||
------------------------------------
|
||||
Reading input data for simulation 1.
|
||||
------------------------------------
|
||||
|
||||
TITLE Example 5.--Add oxygen, equilibrate with pyrite, calcite, and goethite.
|
||||
SOLUTION 1 PURE WATER
|
||||
pH 7.0
|
||||
temp 25.0
|
||||
EQUILIBRIUM_PHASES 1
|
||||
Pyrite 0.0
|
||||
Goethite 0.0
|
||||
Calcite 0.0
|
||||
CO2(g) -3.5
|
||||
Gypsum 0.0 0.0
|
||||
REACTION 1
|
||||
O2 1.0
|
||||
NaCl 0.5
|
||||
0.0 0.001 0.005 0.01 0.05
|
||||
SELECTED_OUTPUT
|
||||
file ex5.sel
|
||||
totals Cl
|
||||
si Gypsum
|
||||
equilibrium_phases pyrite goethite calcite CO2(g) gypsum
|
||||
END
|
||||
-----
|
||||
TITLE
|
||||
-----
|
||||
|
||||
Example 5.--Add oxygen, equilibrate with pyrite, calcite, and goethite.
|
||||
|
||||
-------------------------------------------
|
||||
Beginning of initial solution calculations.
|
||||
-------------------------------------------
|
||||
|
||||
Initial solution 1. PURE WATER
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
Pure water
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 7.000
|
||||
pe = 4.000
|
||||
Activity of water = 1.000
|
||||
Ionic strength = 1.001e-07
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total alkalinity (eq/kg) = 1.082e-10
|
||||
Total carbon (mol/kg) = 0.000e+00
|
||||
Total CO2 (mol/kg) = 0.000e+00
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = -1.082e-10
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = -0.05
|
||||
Iterations = 0
|
||||
Total H = 1.110124e+02
|
||||
Total O = 5.550622e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
OH- 1.002e-07 1.001e-07 -6.999 -6.999 -0.000
|
||||
H+ 1.001e-07 1.000e-07 -7.000 -7.000 -0.000
|
||||
H2O 5.551e+01 1.000e+00 1.744 0.000 0.000
|
||||
H(0) 1.416e-25
|
||||
H2 7.079e-26 7.079e-26 -25.150 -25.150 0.000
|
||||
O(0) 0.000e+00
|
||||
O2 0.000e+00 0.000e+00 -42.080 -42.080 0.000
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
H2(g) -22.00 -25.15 -3.15 H2
|
||||
H2O(g) -1.51 0.00 1.51 H2O
|
||||
O2(g) -39.12 -42.08 -2.96 O2
|
||||
|
||||
-----------------------------------------
|
||||
Beginning of batch-reaction calculations.
|
||||
-----------------------------------------
|
||||
|
||||
Reaction step 1.
|
||||
|
||||
Using solution 1. PURE WATER
|
||||
Using pure phase assemblage 1.
|
||||
Using reaction 1.
|
||||
|
||||
Reaction 1. Irreversible reaction defined in simulation 1.
|
||||
|
||||
0.000e+00 moles of the following reaction have been added:
|
||||
|
||||
Relative
|
||||
Reactant moles
|
||||
|
||||
O2 1.00
|
||||
NaCl 0.50
|
||||
|
||||
Relative
|
||||
Element moles
|
||||
Cl 0.50
|
||||
Na 0.50
|
||||
O 2.00
|
||||
|
||||
-------------------------------Phase assemblage--------------------------------
|
||||
|
||||
Moles in assemblage
|
||||
Phase SI log IAP log KT Initial Final Delta
|
||||
|
||||
Calcite 0.00 -8.48 -8.48 1.000e+01 1.000e+01 -4.934e-04
|
||||
CO2(g) -3.50 -21.65 -18.15 1.000e+01 1.000e+01 -4.870e-04
|
||||
Goethite 0.00 12.02 12.02 1.000e+01 1.000e+01 1.105e-08
|
||||
Gypsum -6.13 -10.71 -4.58 0.000e+00 0.000e+00
|
||||
Pyrite 0.00 -85.78 -85.78 1.000e+01 1.000e+01 -3.154e-08
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
C 9.804e-04 9.804e-04
|
||||
Ca 4.934e-04 4.934e-04
|
||||
Fe 2.049e-08 2.049e-08
|
||||
S 6.308e-08 6.308e-08
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 8.279 Charge balance
|
||||
pe = -4.943 Adjusted to redox equilibrium
|
||||
Activity of water = 1.000
|
||||
Ionic strength = 1.463e-03
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total alkalinity (eq/kg) = 9.867e-04
|
||||
Total CO2 (mol/kg) = 9.803e-04
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = -1.082e-10
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = -0.00
|
||||
Iterations = 14
|
||||
Total H = 1.110124e+02
|
||||
Total O = 5.550867e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
OH- 1.987e-06 1.903e-06 -5.702 -5.720 -0.019
|
||||
H+ 5.476e-09 5.260e-09 -8.262 -8.279 -0.018
|
||||
H2O 5.551e+01 1.000e+00 1.744 -0.000 0.000
|
||||
C(-4) 5.403e-08
|
||||
CH4 5.403e-08 5.405e-08 -7.267 -7.267 0.000
|
||||
C(4) 9.803e-04
|
||||
HCO3- 9.494e-04 9.104e-04 -3.023 -3.041 -0.018
|
||||
CO2 1.076e-05 1.077e-05 -4.968 -4.968 0.000
|
||||
CO3-2 9.603e-06 8.117e-06 -5.018 -5.091 -0.073
|
||||
CaCO3 5.563e-06 5.565e-06 -5.255 -5.255 0.000
|
||||
CaHCO3+ 4.943e-06 4.740e-06 -5.306 -5.324 -0.018
|
||||
FeCO3 2.600e-09 2.601e-09 -8.585 -8.585 0.000
|
||||
FeHCO3+ 1.269e-09 1.216e-09 -8.896 -8.915 -0.019
|
||||
Ca 4.934e-04
|
||||
Ca+2 4.829e-04 4.081e-04 -3.316 -3.389 -0.073
|
||||
CaCO3 5.563e-06 5.565e-06 -5.255 -5.255 0.000
|
||||
CaHCO3+ 4.943e-06 4.740e-06 -5.306 -5.324 -0.018
|
||||
CaOH+ 1.344e-08 1.288e-08 -7.872 -7.890 -0.019
|
||||
CaSO4 3.896e-09 3.897e-09 -8.409 -8.409 0.000
|
||||
CaHSO4+ 1.253e-16 1.201e-16 -15.902 -15.920 -0.019
|
||||
Fe(2) 2.049e-08
|
||||
Fe+2 1.578e-08 1.336e-08 -7.802 -7.874 -0.072
|
||||
FeCO3 2.600e-09 2.601e-09 -8.585 -8.585 0.000
|
||||
FeHCO3+ 1.269e-09 1.216e-09 -8.896 -8.915 -0.019
|
||||
FeOH+ 8.381e-10 8.031e-10 -9.077 -9.095 -0.019
|
||||
FeSO4 1.137e-13 1.137e-13 -12.944 -12.944 0.000
|
||||
Fe(HS)2 6.287e-17 6.289e-17 -16.202 -16.201 0.000
|
||||
FeHSO4+ 4.102e-21 3.931e-21 -20.387 -20.406 -0.019
|
||||
Fe(HS)3- 1.643e-23 1.574e-23 -22.784 -22.803 -0.019
|
||||
Fe(3) 3.369e-14
|
||||
Fe(OH)3 2.753e-14 2.754e-14 -13.560 -13.560 0.000
|
||||
Fe(OH)4- 4.984e-15 4.776e-15 -14.302 -14.321 -0.019
|
||||
Fe(OH)2+ 1.174e-15 1.124e-15 -14.931 -14.949 -0.019
|
||||
FeOH+2 2.119e-20 1.786e-20 -19.674 -19.748 -0.074
|
||||
Fe+3 2.091e-26 1.455e-26 -25.680 -25.837 -0.158
|
||||
FeSO4+ 7.970e-30 7.637e-30 -29.099 -29.117 -0.019
|
||||
Fe(SO4)2- 8.346e-36 7.997e-36 -35.079 -35.097 -0.019
|
||||
FeHSO4+2 1.276e-37 1.076e-37 -36.894 -36.968 -0.074
|
||||
Fe2(OH)2+4 1.700e-38 8.587e-39 -37.769 -38.066 -0.297
|
||||
Fe3(OH)4+5 0.000e+00 0.000e+00 -50.232 -50.695 -0.464
|
||||
H(0) 3.009e-10
|
||||
H2 1.505e-10 1.505e-10 -9.823 -9.822 0.000
|
||||
O(0) 0.000e+00
|
||||
O2 0.000e+00 0.000e+00 -72.735 -72.735 0.000
|
||||
S(-2) 2.505e-09
|
||||
HS- 2.399e-09 2.298e-09 -8.620 -8.639 -0.019
|
||||
H2S 1.057e-10 1.057e-10 -9.976 -9.976 0.000
|
||||
S-2 6.249e-14 5.278e-14 -13.204 -13.278 -0.073
|
||||
Fe(HS)2 6.287e-17 6.289e-17 -16.202 -16.201 0.000
|
||||
Fe(HS)3- 1.643e-23 1.574e-23 -22.784 -22.803 -0.019
|
||||
S(6) 6.057e-08
|
||||
SO4-2 5.668e-08 4.786e-08 -7.247 -7.320 -0.073
|
||||
CaSO4 3.896e-09 3.897e-09 -8.409 -8.409 0.000
|
||||
FeSO4 1.137e-13 1.137e-13 -12.944 -12.944 0.000
|
||||
HSO4- 2.554e-14 2.448e-14 -13.593 -13.611 -0.019
|
||||
CaHSO4+ 1.253e-16 1.201e-16 -15.902 -15.920 -0.019
|
||||
FeHSO4+ 4.102e-21 3.931e-21 -20.387 -20.406 -0.019
|
||||
FeSO4+ 7.970e-30 7.637e-30 -29.099 -29.117 -0.019
|
||||
Fe(SO4)2- 8.346e-36 7.997e-36 -35.079 -35.097 -0.019
|
||||
FeHSO4+2 1.276e-37 1.076e-37 -36.894 -36.968 -0.074
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
Anhydrite -6.35 -10.71 -4.36 CaSO4
|
||||
Aragonite -0.14 -8.48 -8.34 CaCO3
|
||||
Calcite 0.00 -8.48 -8.48 CaCO3
|
||||
CH4(g) -4.41 -7.27 -2.86 CH4
|
||||
CO2(g) -3.50 -4.97 -1.47 CO2
|
||||
Fe(OH)3(a) -5.89 -1.00 4.89 Fe(OH)3
|
||||
FeS(ppt) -4.32 -8.23 -3.92 FeS
|
||||
Goethite 0.00 -1.00 -1.00 FeOOH
|
||||
Gypsum -6.13 -10.71 -4.58 CaSO4:2H2O
|
||||
H2(g) -6.67 -9.82 -3.15 H2
|
||||
H2O(g) -1.51 -0.00 1.51 H2O
|
||||
H2S(g) -8.98 -9.98 -1.00 H2S
|
||||
Hematite 2.01 -2.00 -4.01 Fe2O3
|
||||
Mackinawite -3.59 -8.23 -4.65 FeS
|
||||
Melanterite -12.99 -15.19 -2.21 FeSO4:7H2O
|
||||
O2(g) -69.78 -72.74 -2.96 O2
|
||||
Pyrite 0.00 -18.48 -18.48 FeS2
|
||||
Siderite -2.07 -12.96 -10.89 FeCO3
|
||||
Sulfur -8.19 -3.30 4.88 S
|
||||
|
||||
Reaction step 2.
|
||||
|
||||
Using solution 1. PURE WATER
|
||||
Using pure phase assemblage 1.
|
||||
Using reaction 1.
|
||||
|
||||
Reaction 1. Irreversible reaction defined in simulation 1.
|
||||
|
||||
1.000e-03 moles of the following reaction have been added:
|
||||
|
||||
Relative
|
||||
Reactant moles
|
||||
|
||||
O2 1.00
|
||||
NaCl 0.50
|
||||
|
||||
Relative
|
||||
Element moles
|
||||
Cl 0.50
|
||||
Na 0.50
|
||||
O 2.00
|
||||
|
||||
-------------------------------Phase assemblage--------------------------------
|
||||
|
||||
Moles in assemblage
|
||||
Phase SI log IAP log KT Initial Final Delta
|
||||
|
||||
Calcite 0.00 -8.48 -8.48 1.000e+01 9.999e+00 -9.277e-04
|
||||
CO2(g) -3.50 -21.65 -18.15 1.000e+01 1.000e+01 1.418e-04
|
||||
Goethite 0.00 12.02 12.02 1.000e+01 1.000e+01 2.667e-04
|
||||
Gypsum -2.02 -6.60 -4.58 0.000e+00 0.000e+00
|
||||
Pyrite 0.00 -85.78 -85.78 1.000e+01 1.000e+01 -2.667e-04
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
C 7.859e-04 7.859e-04
|
||||
Ca 9.277e-04 9.277e-04
|
||||
Cl 5.000e-04 5.000e-04
|
||||
Fe 9.939e-09 9.939e-09
|
||||
Na 5.000e-04 5.000e-04
|
||||
S 5.333e-04 5.333e-04
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 8.171 Charge balance
|
||||
pe = -4.287 Adjusted to redox equilibrium
|
||||
Activity of water = 1.000
|
||||
Ionic strength = 3.591e-03
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total alkalinity (eq/kg) = 7.887e-04
|
||||
Total CO2 (mol/kg) = 7.859e-04
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = -1.082e-10
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = -0.00
|
||||
Iterations = 24
|
||||
Total H = 1.110122e+02
|
||||
Total O = 5.551018e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
OH- 1.585e-06 1.484e-06 -5.800 -5.829 -0.029
|
||||
H+ 7.160e-09 6.745e-09 -8.145 -8.171 -0.026
|
||||
H2O 5.551e+01 9.999e-01 1.744 -0.000 0.000
|
||||
C(-4) 2.240e-12
|
||||
CH4 2.240e-12 2.242e-12 -11.650 -11.649 0.000
|
||||
C(4) 7.859e-04
|
||||
HCO3- 7.565e-04 7.099e-04 -3.121 -3.149 -0.028
|
||||
CO2 1.076e-05 1.077e-05 -4.968 -4.968 0.000
|
||||
CaHCO3+ 6.477e-06 6.078e-06 -5.189 -5.216 -0.028
|
||||
CO3-2 6.364e-06 4.936e-06 -5.196 -5.307 -0.110
|
||||
CaCO3 5.560e-06 5.565e-06 -5.255 -5.255 0.000
|
||||
NaHCO3 1.865e-07 1.867e-07 -6.729 -6.729 0.000
|
||||
NaCO3- 4.587e-08 4.298e-08 -7.338 -7.367 -0.028
|
||||
FeCO3 7.363e-10 7.369e-10 -9.133 -9.133 0.000
|
||||
FeHCO3+ 4.715e-10 4.418e-10 -9.327 -9.355 -0.028
|
||||
Ca 9.277e-04
|
||||
Ca+2 8.657e-04 6.711e-04 -3.063 -3.173 -0.111
|
||||
CaSO4 4.996e-05 5.000e-05 -4.301 -4.301 0.000
|
||||
CaHCO3+ 6.477e-06 6.078e-06 -5.189 -5.216 -0.028
|
||||
CaCO3 5.560e-06 5.565e-06 -5.255 -5.255 0.000
|
||||
CaOH+ 1.762e-08 1.651e-08 -7.754 -7.782 -0.028
|
||||
CaHSO4+ 2.108e-12 1.976e-12 -11.676 -11.704 -0.028
|
||||
Cl 5.000e-04
|
||||
Cl- 5.000e-04 4.682e-04 -3.301 -3.330 -0.029
|
||||
FeCl+ 4.293e-12 4.023e-12 -11.367 -11.396 -0.028
|
||||
FeCl+2 5.629e-28 4.339e-28 -27.250 -27.363 -0.113
|
||||
FeCl2+ 9.686e-31 9.076e-31 -30.014 -30.042 -0.028
|
||||
FeCl3 4.246e-35 4.250e-35 -34.372 -34.372 0.000
|
||||
Fe(2) 9.939e-09
|
||||
Fe+2 8.002e-09 6.223e-09 -8.097 -8.206 -0.109
|
||||
FeCO3 7.363e-10 7.369e-10 -9.133 -9.133 0.000
|
||||
FeHCO3+ 4.715e-10 4.418e-10 -9.327 -9.355 -0.028
|
||||
FeSO4 4.129e-10 4.132e-10 -9.384 -9.384 0.000
|
||||
FeOH+ 3.114e-10 2.918e-10 -9.507 -9.535 -0.028
|
||||
FeCl+ 4.293e-12 4.023e-12 -11.367 -11.396 -0.028
|
||||
FeHSO4+ 1.955e-17 1.832e-17 -16.709 -16.737 -0.028
|
||||
Fe(HS)2 5.043e-18 5.047e-18 -17.297 -17.297 0.000
|
||||
Fe(HS)3- 5.596e-25 5.243e-25 -24.252 -24.280 -0.028
|
||||
Fe(3) 3.303e-14
|
||||
Fe(OH)3 2.752e-14 2.754e-14 -13.560 -13.560 0.000
|
||||
Fe(OH)4- 3.974e-15 3.724e-15 -14.401 -14.429 -0.028
|
||||
Fe(OH)2+ 1.539e-15 1.442e-15 -14.813 -14.841 -0.028
|
||||
FeOH+2 3.810e-20 2.937e-20 -19.419 -19.532 -0.113
|
||||
FeSO4+ 1.341e-25 1.256e-25 -24.873 -24.901 -0.028
|
||||
Fe+3 5.252e-26 3.069e-26 -25.280 -25.513 -0.233
|
||||
Fe(SO4)2- 1.095e-27 1.026e-27 -26.960 -26.989 -0.028
|
||||
FeCl+2 5.629e-28 4.339e-28 -27.250 -27.363 -0.113
|
||||
FeCl2+ 9.686e-31 9.076e-31 -30.014 -30.042 -0.028
|
||||
FeHSO4+2 2.943e-33 2.269e-33 -32.531 -32.644 -0.113
|
||||
FeCl3 4.246e-35 4.250e-35 -34.372 -34.372 0.000
|
||||
Fe2(OH)2+4 6.575e-38 2.322e-38 -37.182 -37.634 -0.452
|
||||
Fe3(OH)4+5 0.000e+00 0.000e+00 -49.449 -50.155 -0.706
|
||||
H(0) 2.414e-11
|
||||
H2 1.207e-11 1.208e-11 -10.918 -10.918 0.000
|
||||
Na 5.000e-04
|
||||
Na+ 4.988e-04 4.677e-04 -3.302 -3.330 -0.028
|
||||
NaSO4- 9.340e-07 8.752e-07 -6.030 -6.058 -0.028
|
||||
NaHCO3 1.865e-07 1.867e-07 -6.729 -6.729 0.000
|
||||
NaCO3- 4.587e-08 4.298e-08 -7.338 -7.367 -0.028
|
||||
NaOH 4.577e-10 4.581e-10 -9.339 -9.339 0.000
|
||||
O(0) 0.000e+00
|
||||
O2 0.000e+00 0.000e+00 -70.545 -70.544 0.000
|
||||
S(-2) 1.075e-09
|
||||
HS- 1.019e-09 9.540e-10 -8.992 -9.020 -0.029
|
||||
H2S 5.621e-11 5.626e-11 -10.250 -10.250 0.000
|
||||
S-2 2.207e-14 1.708e-14 -13.656 -13.767 -0.111
|
||||
Fe(HS)2 5.043e-18 5.047e-18 -17.297 -17.297 0.000
|
||||
Fe(HS)3- 5.596e-25 5.243e-25 -24.252 -24.280 -0.028
|
||||
S(6) 5.333e-04
|
||||
SO4-2 4.824e-04 3.734e-04 -3.317 -3.428 -0.111
|
||||
CaSO4 4.996e-05 5.000e-05 -4.301 -4.301 0.000
|
||||
NaSO4- 9.340e-07 8.752e-07 -6.030 -6.058 -0.028
|
||||
FeSO4 4.129e-10 4.132e-10 -9.384 -9.384 0.000
|
||||
HSO4- 2.613e-10 2.449e-10 -9.583 -9.611 -0.028
|
||||
CaHSO4+ 2.108e-12 1.976e-12 -11.676 -11.704 -0.028
|
||||
FeHSO4+ 1.955e-17 1.832e-17 -16.709 -16.737 -0.028
|
||||
FeSO4+ 1.341e-25 1.256e-25 -24.873 -24.901 -0.028
|
||||
Fe(SO4)2- 1.095e-27 1.026e-27 -26.960 -26.989 -0.028
|
||||
FeHSO4+2 2.943e-33 2.269e-33 -32.531 -32.644 -0.113
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
Anhydrite -2.24 -6.60 -4.36 CaSO4
|
||||
Aragonite -0.14 -8.48 -8.34 CaCO3
|
||||
Calcite 0.00 -8.48 -8.48 CaCO3
|
||||
CH4(g) -8.79 -11.65 -2.86 CH4
|
||||
CO2(g) -3.50 -4.97 -1.47 CO2
|
||||
Fe(OH)3(a) -5.89 -1.00 4.89 Fe(OH)3
|
||||
FeS(ppt) -5.14 -9.06 -3.92 FeS
|
||||
Goethite -0.00 -1.00 -1.00 FeOOH
|
||||
Gypsum -2.02 -6.60 -4.58 CaSO4:2H2O
|
||||
H2(g) -7.77 -10.92 -3.15 H2
|
||||
H2O(g) -1.51 -0.00 1.51 H2O
|
||||
H2S(g) -9.25 -10.25 -1.00 H2S
|
||||
Halite -8.24 -6.66 1.58 NaCl
|
||||
Hematite 2.01 -2.00 -4.01 Fe2O3
|
||||
Mackinawite -4.41 -9.06 -4.65 FeS
|
||||
Melanterite -9.42 -11.63 -2.21 FeSO4:7H2O
|
||||
O2(g) -67.58 -70.54 -2.96 O2
|
||||
Pyrite -0.00 -18.48 -18.48 FeS2
|
||||
Siderite -2.62 -13.51 -10.89 FeCO3
|
||||
Sulfur -7.36 -2.48 4.88 S
|
||||
|
||||
Reaction step 3.
|
||||
|
||||
Using solution 1. PURE WATER
|
||||
Using pure phase assemblage 1.
|
||||
Using reaction 1.
|
||||
|
||||
Reaction 1. Irreversible reaction defined in simulation 1.
|
||||
|
||||
5.000e-03 moles of the following reaction have been added:
|
||||
|
||||
Relative
|
||||
Reactant moles
|
||||
|
||||
O2 1.00
|
||||
NaCl 0.50
|
||||
|
||||
Relative
|
||||
Element moles
|
||||
Cl 0.50
|
||||
Na 0.50
|
||||
O 2.00
|
||||
|
||||
-------------------------------Phase assemblage--------------------------------
|
||||
|
||||
Moles in assemblage
|
||||
Phase SI log IAP log KT Initial Final Delta
|
||||
|
||||
Calcite 0.00 -8.48 -8.48 1.000e+01 9.997e+00 -2.937e-03
|
||||
CO2(g) -3.50 -21.65 -18.15 1.000e+01 1.000e+01 2.395e-03
|
||||
Goethite 0.00 12.02 12.02 1.000e+01 1.000e+01 1.333e-03
|
||||
Gypsum -1.06 -5.64 -4.58 0.000e+00 0.000e+00
|
||||
Pyrite 0.00 -85.78 -85.78 1.000e+01 9.999e+00 -1.333e-03
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
C 5.424e-04 5.424e-04
|
||||
Ca 2.937e-03 2.937e-03
|
||||
Cl 2.500e-03 2.500e-03
|
||||
Fe 2.124e-08 2.124e-08
|
||||
Na 2.500e-03 2.500e-03
|
||||
S 2.667e-03 2.667e-03
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 7.982 Charge balance
|
||||
pe = -3.970 Adjusted to redox equilibrium
|
||||
Activity of water = 1.000
|
||||
Ionic strength = 1.210e-02
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total alkalinity (eq/kg) = 5.415e-04
|
||||
Total CO2 (mol/kg) = 5.424e-04
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = -1.082e-10
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = -0.00
|
||||
Iterations = 25
|
||||
Total H = 1.110111e+02
|
||||
Total O = 5.551757e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
OH- 1.077e-06 9.604e-07 -5.968 -6.018 -0.050
|
||||
H+ 1.149e-08 1.042e-08 -7.940 -7.982 -0.042
|
||||
H2O 5.551e+01 9.998e-01 1.744 -0.000 0.000
|
||||
C(-4) 2.129e-13
|
||||
CH4 2.129e-13 2.135e-13 -12.672 -12.671 0.001
|
||||
C(4) 5.424e-04
|
||||
HCO3- 5.118e-04 4.594e-04 -3.291 -3.338 -0.047
|
||||
CO2 1.074e-05 1.077e-05 -4.969 -4.968 0.001
|
||||
CaHCO3+ 1.046e-05 9.392e-06 -4.980 -5.027 -0.047
|
||||
CaCO3 5.549e-06 5.565e-06 -5.256 -5.255 0.001
|
||||
CO3-2 3.184e-06 2.067e-06 -5.497 -5.685 -0.188
|
||||
NaHCO3 5.724e-07 5.740e-07 -6.242 -6.241 0.001
|
||||
NaCO3- 9.566e-08 8.553e-08 -7.019 -7.068 -0.049
|
||||
FeHCO3+ 5.691e-10 5.088e-10 -9.245 -9.293 -0.049
|
||||
FeCO3 5.477e-10 5.493e-10 -9.261 -9.260 0.001
|
||||
Ca 2.937e-03
|
||||
Ca+2 2.469e-03 1.602e-03 -2.607 -2.795 -0.188
|
||||
CaSO4 4.520e-04 4.532e-04 -3.345 -3.344 0.001
|
||||
CaHCO3+ 1.046e-05 9.392e-06 -4.980 -5.027 -0.047
|
||||
CaCO3 5.549e-06 5.565e-06 -5.256 -5.255 0.001
|
||||
CaOH+ 2.854e-08 2.551e-08 -7.545 -7.593 -0.049
|
||||
CaHSO4+ 3.095e-11 2.767e-11 -10.509 -10.558 -0.049
|
||||
Cl 2.500e-03
|
||||
Cl- 2.500e-03 2.230e-03 -2.602 -2.652 -0.050
|
||||
FeCl+ 3.814e-11 3.410e-11 -10.419 -10.467 -0.049
|
||||
FeCl+2 1.194e-26 7.627e-27 -25.923 -26.118 -0.194
|
||||
FeCl2+ 8.499e-29 7.599e-29 -28.071 -28.119 -0.049
|
||||
FeCl3 1.690e-32 1.695e-32 -31.772 -31.771 0.001
|
||||
Fe(2) 2.124e-08
|
||||
Fe+2 1.693e-08 1.108e-08 -7.771 -7.956 -0.184
|
||||
FeSO4 2.784e-09 2.792e-09 -8.555 -8.554 0.001
|
||||
FeHCO3+ 5.691e-10 5.088e-10 -9.245 -9.293 -0.049
|
||||
FeCO3 5.477e-10 5.493e-10 -9.261 -9.260 0.001
|
||||
FeOH+ 3.758e-10 3.360e-10 -9.425 -9.474 -0.049
|
||||
FeCl+ 3.814e-11 3.410e-11 -10.419 -10.467 -0.049
|
||||
FeHSO4+ 2.139e-16 1.913e-16 -15.670 -15.718 -0.049
|
||||
Fe(HS)2 2.796e-18 2.804e-18 -17.553 -17.552 0.001
|
||||
Fe(HS)3- 1.820e-25 1.627e-25 -24.740 -24.789 -0.049
|
||||
Fe(3) 3.265e-14
|
||||
Fe(OH)3 2.746e-14 2.754e-14 -13.561 -13.560 0.001
|
||||
Fe(OH)4- 2.695e-15 2.409e-15 -14.569 -14.618 -0.049
|
||||
Fe(OH)2+ 2.492e-15 2.228e-15 -14.603 -14.652 -0.049
|
||||
FeOH+2 1.098e-19 7.014e-20 -18.960 -19.154 -0.194
|
||||
FeSO4+ 1.968e-24 1.760e-24 -23.706 -23.755 -0.049
|
||||
Fe+3 2.720e-25 1.132e-25 -24.566 -24.946 -0.381
|
||||
Fe(SO4)2- 6.105e-26 5.458e-26 -25.214 -25.263 -0.049
|
||||
FeCl+2 1.194e-26 7.627e-27 -25.923 -26.118 -0.194
|
||||
FeCl2+ 8.499e-29 7.599e-29 -28.071 -28.119 -0.049
|
||||
FeHSO4+2 7.686e-32 4.911e-32 -31.114 -31.309 -0.194
|
||||
FeCl3 1.690e-32 1.695e-32 -31.772 -31.771 0.001
|
||||
Fe2(OH)2+4 7.941e-37 1.324e-37 -36.100 -36.878 -0.778
|
||||
Fe3(OH)4+5 0.000e+00 0.000e+00 -47.995 -49.210 -1.216
|
||||
H(0) 1.338e-11
|
||||
H2 6.691e-12 6.710e-12 -11.174 -11.173 0.001
|
||||
Na 2.500e-03
|
||||
Na+ 2.482e-03 2.222e-03 -2.605 -2.653 -0.048
|
||||
NaSO4- 1.766e-05 1.579e-05 -4.753 -4.802 -0.049
|
||||
NaHCO3 5.724e-07 5.740e-07 -6.242 -6.241 0.001
|
||||
NaCO3- 9.566e-08 8.553e-08 -7.019 -7.068 -0.049
|
||||
NaOH 1.404e-09 1.408e-09 -8.853 -8.851 0.001
|
||||
O(0) 0.000e+00
|
||||
O2 0.000e+00 0.000e+00 -70.035 -70.034 0.001
|
||||
S(-2) 6.460e-10
|
||||
HS- 5.976e-10 5.329e-10 -9.224 -9.273 -0.050
|
||||
H2S 4.843e-11 4.856e-11 -10.315 -10.314 0.001
|
||||
S-2 9.562e-15 6.176e-15 -14.019 -14.209 -0.190
|
||||
Fe(HS)2 2.796e-18 2.804e-18 -17.553 -17.552 0.001
|
||||
Fe(HS)3- 1.820e-25 1.627e-25 -24.740 -24.789 -0.049
|
||||
S(6) 2.667e-03
|
||||
SO4-2 2.197e-03 1.418e-03 -2.658 -2.848 -0.190
|
||||
CaSO4 4.520e-04 4.532e-04 -3.345 -3.344 0.001
|
||||
NaSO4- 1.766e-05 1.579e-05 -4.753 -4.802 -0.049
|
||||
FeSO4 2.784e-09 2.792e-09 -8.555 -8.554 0.001
|
||||
HSO4- 1.606e-09 1.436e-09 -8.794 -8.843 -0.049
|
||||
CaHSO4+ 3.095e-11 2.767e-11 -10.509 -10.558 -0.049
|
||||
FeHSO4+ 2.139e-16 1.913e-16 -15.670 -15.718 -0.049
|
||||
FeSO4+ 1.968e-24 1.760e-24 -23.706 -23.755 -0.049
|
||||
Fe(SO4)2- 6.105e-26 5.458e-26 -25.214 -25.263 -0.049
|
||||
FeHSO4+2 7.686e-32 4.911e-32 -31.114 -31.309 -0.194
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
Anhydrite -1.28 -5.64 -4.36 CaSO4
|
||||
Aragonite -0.14 -8.48 -8.34 CaCO3
|
||||
Calcite 0.00 -8.48 -8.48 CaCO3
|
||||
CH4(g) -9.81 -12.67 -2.86 CH4
|
||||
CO2(g) -3.50 -4.97 -1.47 CO2
|
||||
Fe(OH)3(a) -5.89 -1.00 4.89 Fe(OH)3
|
||||
FeS(ppt) -5.33 -9.25 -3.92 FeS
|
||||
Goethite -0.00 -1.00 -1.00 FeOOH
|
||||
Gypsum -1.06 -5.64 -4.58 CaSO4:2H2O
|
||||
H2(g) -8.02 -11.17 -3.15 H2
|
||||
H2O(g) -1.51 -0.00 1.51 H2O
|
||||
H2S(g) -9.32 -10.31 -1.00 H2S
|
||||
Halite -6.89 -5.30 1.58 NaCl
|
||||
Hematite 2.01 -2.00 -4.01 Fe2O3
|
||||
Mackinawite -4.60 -9.25 -4.65 FeS
|
||||
Melanterite -8.60 -10.80 -2.21 FeSO4:7H2O
|
||||
O2(g) -67.07 -70.03 -2.96 O2
|
||||
Pyrite -0.00 -18.48 -18.48 FeS2
|
||||
Siderite -2.75 -13.64 -10.89 FeCO3
|
||||
Sulfur -7.17 -2.29 4.88 S
|
||||
|
||||
Reaction step 4.
|
||||
|
||||
Using solution 1. PURE WATER
|
||||
Using pure phase assemblage 1.
|
||||
Using reaction 1.
|
||||
|
||||
Reaction 1. Irreversible reaction defined in simulation 1.
|
||||
|
||||
1.000e-02 moles of the following reaction have been added:
|
||||
|
||||
Relative
|
||||
Reactant moles
|
||||
|
||||
O2 1.00
|
||||
NaCl 0.50
|
||||
|
||||
Relative
|
||||
Element moles
|
||||
Cl 0.50
|
||||
Na 0.50
|
||||
O 2.00
|
||||
|
||||
-------------------------------Phase assemblage--------------------------------
|
||||
|
||||
Moles in assemblage
|
||||
Phase SI log IAP log KT Initial Final Delta
|
||||
|
||||
Calcite 0.00 -8.48 -8.48 1.000e+01 9.994e+00 -5.559e-03
|
||||
CO2(g) -3.50 -21.65 -18.15 1.000e+01 1.001e+01 5.105e-03
|
||||
Goethite 0.00 12.02 12.02 1.000e+01 1.000e+01 2.667e-03
|
||||
Gypsum -0.65 -5.23 -4.58 0.000e+00 0.000e+00
|
||||
Pyrite -0.00 -85.78 -85.78 1.000e+01 9.997e+00 -2.667e-03
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
C 4.540e-04 4.540e-04
|
||||
Ca 5.560e-03 5.559e-03
|
||||
Cl 5.000e-03 5.000e-03
|
||||
Fe 3.429e-08 3.429e-08
|
||||
Na 5.000e-03 5.000e-03
|
||||
S 5.333e-03 5.333e-03
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 7.884 Charge balance
|
||||
pe = -3.817 Adjusted to redox equilibrium
|
||||
Activity of water = 1.000
|
||||
Ionic strength = 2.218e-02
|
||||
Mass of water (kg) = 1.000e+00
|
||||
Total alkalinity (eq/kg) = 4.522e-04
|
||||
Total CO2 (mol/kg) = 4.540e-04
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = -1.082e-10
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = -0.00
|
||||
Iterations = 25
|
||||
Total H = 1.110098e+02
|
||||
Total O = 5.552735e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
OH- 8.898e-07 7.665e-07 -6.051 -6.115 -0.065
|
||||
H+ 1.474e-08 1.306e-08 -7.832 -7.884 -0.053
|
||||
H2O 5.551e+01 9.997e-01 1.744 -0.000 0.000
|
||||
C(-4) 7.696e-14
|
||||
CH4 7.696e-14 7.735e-14 -13.114 -13.112 0.002
|
||||
C(4) 4.540e-04
|
||||
HCO3- 4.210e-04 3.666e-04 -3.376 -3.436 -0.060
|
||||
CaHCO3+ 1.351e-05 1.177e-05 -4.869 -4.929 -0.060
|
||||
CO2 1.071e-05 1.077e-05 -4.970 -4.968 0.002
|
||||
CaCO3 5.536e-06 5.565e-06 -5.257 -5.255 0.002
|
||||
CO3-2 2.289e-06 1.317e-06 -5.640 -5.880 -0.240
|
||||
NaHCO3 8.791e-07 8.836e-07 -6.056 -6.054 0.002
|
||||
NaCO3- 1.214e-07 1.051e-07 -6.916 -6.978 -0.063
|
||||
FeHCO3+ 6.487e-10 5.616e-10 -9.188 -9.251 -0.063
|
||||
FeCO3 4.814e-10 4.839e-10 -9.317 -9.315 0.002
|
||||
Ca 5.560e-03
|
||||
Ca+2 4.373e-03 2.515e-03 -2.359 -2.599 -0.240
|
||||
CaSO4 1.168e-03 1.174e-03 -2.933 -2.930 0.002
|
||||
CaHCO3+ 1.351e-05 1.177e-05 -4.869 -4.929 -0.060
|
||||
CaCO3 5.536e-06 5.565e-06 -5.257 -5.255 0.002
|
||||
CaOH+ 3.692e-08 3.196e-08 -7.433 -7.495 -0.063
|
||||
CaHSO4+ 1.037e-10 8.977e-11 -9.984 -10.047 -0.063
|
||||
Cl 5.000e-03
|
||||
Cl- 5.000e-03 4.311e-03 -2.301 -2.365 -0.064
|
||||
FeCl+ 1.053e-10 9.114e-11 -9.978 -10.040 -0.063
|
||||
FeCl+2 5.162e-26 2.899e-26 -25.287 -25.538 -0.251
|
||||
FeCl2+ 6.449e-28 5.583e-28 -27.191 -27.253 -0.063
|
||||
FeCl3 2.394e-31 2.406e-31 -30.621 -30.619 0.002
|
||||
Fe(2) 3.429e-08
|
||||
Fe+2 2.629e-08 1.532e-08 -7.580 -7.815 -0.235
|
||||
FeSO4 6.337e-09 6.369e-09 -8.198 -8.196 0.002
|
||||
FeHCO3+ 6.487e-10 5.616e-10 -9.188 -9.251 -0.063
|
||||
FeCO3 4.814e-10 4.839e-10 -9.317 -9.315 0.002
|
||||
FeOH+ 4.284e-10 3.708e-10 -9.368 -9.431 -0.063
|
||||
FeCl+ 1.053e-10 9.114e-11 -9.978 -10.040 -0.063
|
||||
FeHSO4+ 6.314e-16 5.466e-16 -15.200 -15.262 -0.063
|
||||
Fe(HS)2 2.164e-18 2.175e-18 -17.665 -17.663 0.002
|
||||
Fe(HS)3- 1.092e-25 9.454e-26 -24.962 -25.024 -0.063
|
||||
Fe(3) 3.284e-14
|
||||
Fe(OH)3 2.739e-14 2.753e-14 -13.562 -13.560 0.002
|
||||
Fe(OH)2+ 3.224e-15 2.791e-15 -14.492 -14.554 -0.063
|
||||
Fe(OH)4- 2.221e-15 1.923e-15 -14.653 -14.716 -0.063
|
||||
FeOH+2 1.960e-19 1.101e-19 -18.708 -18.958 -0.251
|
||||
FeSO4+ 6.596e-24 5.710e-24 -23.181 -23.243 -0.063
|
||||
Fe+3 6.635e-25 2.227e-25 -24.178 -24.652 -0.474
|
||||
Fe(SO4)2- 3.374e-25 2.921e-25 -24.472 -24.534 -0.063
|
||||
FeCl+2 5.162e-26 2.899e-26 -25.287 -25.538 -0.251
|
||||
FeCl2+ 6.449e-28 5.583e-28 -27.191 -27.253 -0.063
|
||||
FeHSO4+2 3.555e-31 1.996e-31 -30.449 -30.700 -0.251
|
||||
FeCl3 2.394e-31 2.406e-31 -30.621 -30.619 0.002
|
||||
Fe2(OH)2+4 3.279e-36 3.263e-37 -35.484 -36.486 -1.002
|
||||
Fe3(OH)4+5 0.000e+00 0.000e+00 -47.155 -48.721 -1.566
|
||||
H(0) 1.036e-11
|
||||
H2 5.179e-12 5.205e-12 -11.286 -11.284 0.002
|
||||
Na 5.000e-03
|
||||
Na+ 4.941e-03 4.286e-03 -2.306 -2.368 -0.062
|
||||
NaSO4- 5.802e-05 5.023e-05 -4.236 -4.299 -0.063
|
||||
NaHCO3 8.791e-07 8.836e-07 -6.056 -6.054 0.002
|
||||
NaCO3- 1.214e-07 1.051e-07 -6.916 -6.978 -0.063
|
||||
NaOH 2.157e-09 2.168e-09 -8.666 -8.664 0.002
|
||||
O(0) 0.000e+00
|
||||
O2 0.000e+00 0.000e+00 -69.815 -69.813 0.002
|
||||
S(-2) 5.087e-10
|
||||
HS- 4.634e-10 3.992e-10 -9.334 -9.399 -0.065
|
||||
H2S 4.533e-11 4.557e-11 -10.344 -10.341 0.002
|
||||
S-2 6.474e-15 3.693e-15 -14.189 -14.433 -0.244
|
||||
Fe(HS)2 2.164e-18 2.175e-18 -17.665 -17.663 0.002
|
||||
Fe(HS)3- 1.092e-25 9.454e-26 -24.962 -25.024 -0.063
|
||||
S(6) 5.333e-03
|
||||
SO4-2 4.108e-03 2.338e-03 -2.386 -2.631 -0.245
|
||||
CaSO4 1.168e-03 1.174e-03 -2.933 -2.930 0.002
|
||||
NaSO4- 5.802e-05 5.023e-05 -4.236 -4.299 -0.063
|
||||
FeSO4 6.337e-09 6.369e-09 -8.198 -8.196 0.002
|
||||
HSO4- 3.429e-09 2.968e-09 -8.465 -8.527 -0.063
|
||||
CaHSO4+ 1.037e-10 8.977e-11 -9.984 -10.047 -0.063
|
||||
FeHSO4+ 6.314e-16 5.466e-16 -15.200 -15.262 -0.063
|
||||
FeSO4+ 6.596e-24 5.710e-24 -23.181 -23.243 -0.063
|
||||
Fe(SO4)2- 3.374e-25 2.921e-25 -24.472 -24.534 -0.063
|
||||
FeHSO4+2 3.555e-31 1.996e-31 -30.449 -30.700 -0.251
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
Anhydrite -0.87 -5.23 -4.36 CaSO4
|
||||
Aragonite -0.14 -8.48 -8.34 CaCO3
|
||||
Calcite 0.00 -8.48 -8.48 CaCO3
|
||||
CH4(g) -10.25 -13.11 -2.86 CH4
|
||||
CO2(g) -3.50 -4.97 -1.47 CO2
|
||||
Fe(OH)3(a) -5.89 -1.00 4.89 Fe(OH)3
|
||||
FeS(ppt) -5.41 -9.33 -3.92 FeS
|
||||
Goethite -0.00 -1.00 -1.00 FeOOH
|
||||
Gypsum -0.65 -5.23 -4.58 CaSO4:2H2O
|
||||
H2(g) -8.13 -11.28 -3.15 H2
|
||||
H2O(g) -1.51 -0.00 1.51 H2O
|
||||
H2S(g) -9.34 -10.34 -1.00 H2S
|
||||
Halite -6.32 -4.73 1.58 NaCl
|
||||
Hematite 2.01 -2.00 -4.01 Fe2O3
|
||||
Mackinawite -4.68 -9.33 -4.65 FeS
|
||||
Melanterite -8.24 -10.45 -2.21 FeSO4:7H2O
|
||||
O2(g) -66.85 -69.81 -2.96 O2
|
||||
Pyrite -0.00 -18.48 -18.48 FeS2
|
||||
Siderite -2.81 -13.70 -10.89 FeCO3
|
||||
Sulfur -7.09 -2.21 4.88 S
|
||||
|
||||
Reaction step 5.
|
||||
|
||||
Using solution 1. PURE WATER
|
||||
Using pure phase assemblage 1.
|
||||
Using reaction 1.
|
||||
|
||||
Reaction 1. Irreversible reaction defined in simulation 1.
|
||||
|
||||
5.000e-02 moles of the following reaction have been added:
|
||||
|
||||
Relative
|
||||
Reactant moles
|
||||
|
||||
O2 1.00
|
||||
NaCl 0.50
|
||||
|
||||
Relative
|
||||
Element moles
|
||||
Cl 0.50
|
||||
Na 0.50
|
||||
O 2.00
|
||||
|
||||
-------------------------------Phase assemblage--------------------------------
|
||||
|
||||
Moles in assemblage
|
||||
Phase SI log IAP log KT Initial Final Delta
|
||||
|
||||
Calcite 0.00 -8.48 -8.48 1.000e+01 9.973e+00 -2.684e-02
|
||||
CO2(g) -3.50 -21.65 -18.15 1.000e+01 1.003e+01 2.649e-02
|
||||
Goethite 0.00 12.02 12.02 1.000e+01 1.001e+01 1.333e-02
|
||||
Gypsum 0.00 -4.58 -4.58 0.000e+00 9.002e-03 9.002e-03
|
||||
Pyrite -0.00 -85.78 -85.78 1.000e+01 9.987e+00 -1.333e-02
|
||||
|
||||
-----------------------------Solution composition------------------------------
|
||||
|
||||
Elements Molality Moles
|
||||
|
||||
C 3.526e-04 3.524e-04
|
||||
Ca 1.785e-02 1.784e-02
|
||||
Cl 2.501e-02 2.500e-02
|
||||
Fe 8.735e-08 8.732e-08
|
||||
Na 2.501e-02 2.500e-02
|
||||
S 1.767e-02 1.766e-02
|
||||
|
||||
----------------------------Description of solution----------------------------
|
||||
|
||||
pH = 7.719 Charge balance
|
||||
pe = -3.565 Adjusted to redox equilibrium
|
||||
Activity of water = 0.999
|
||||
Ionic strength = 7.432e-02
|
||||
Mass of water (kg) = 9.996e-01
|
||||
Total alkalinity (eq/kg) = 3.499e-04
|
||||
Total CO2 (mol/kg) = 3.526e-04
|
||||
Temperature (deg C) = 25.000
|
||||
Electrical balance (eq) = -4.778e-11
|
||||
Percent error, 100*(Cat-|An|)/(Cat+|An|) = -0.00
|
||||
Iterations = 25
|
||||
Total H = 1.109631e+02
|
||||
Total O = 5.555309e+01
|
||||
|
||||
----------------------------Distribution of species----------------------------
|
||||
|
||||
Log Log Log
|
||||
Species Molality Activity Molality Activity Gamma
|
||||
|
||||
OH- 6.681e-07 5.237e-07 -6.175 -6.281 -0.106
|
||||
H+ 2.279e-08 1.909e-08 -7.642 -7.719 -0.077
|
||||
H2O 5.551e+01 9.986e-01 1.744 -0.001 0.000
|
||||
C(-4) 1.534e-14
|
||||
CH4 1.534e-14 1.561e-14 -13.814 -13.807 0.007
|
||||
C(4) 3.526e-04
|
||||
HCO3- 3.108e-04 2.505e-04 -3.508 -3.601 -0.094
|
||||
CaHCO3+ 2.134e-05 1.720e-05 -4.671 -4.764 -0.094
|
||||
CO2 1.058e-05 1.077e-05 -4.975 -4.968 0.007
|
||||
CaCO3 5.470e-06 5.565e-06 -5.262 -5.255 0.007
|
||||
NaHCO3 2.706e-06 2.752e-06 -5.568 -5.560 0.007
|
||||
CO3-2 1.458e-06 6.155e-07 -5.836 -6.211 -0.374
|
||||
NaCO3- 2.804e-07 2.239e-07 -6.552 -6.650 -0.098
|
||||
FeHCO3+ 8.424e-10 6.727e-10 -9.074 -9.172 -0.098
|
||||
FeCO3 3.897e-10 3.964e-10 -9.409 -9.402 0.007
|
||||
Ca 1.785e-02
|
||||
Ca+2 1.266e-02 5.382e-03 -1.898 -2.269 -0.371
|
||||
CaSO4 5.162e-03 5.251e-03 -2.287 -2.280 0.007
|
||||
CaHCO3+ 2.134e-05 1.720e-05 -4.671 -4.764 -0.094
|
||||
CaCO3 5.470e-06 5.565e-06 -5.262 -5.255 0.007
|
||||
CaOH+ 5.853e-08 4.673e-08 -7.233 -7.330 -0.098
|
||||
CaHSO4+ 7.355e-10 5.872e-10 -9.133 -9.231 -0.098
|
||||
Cl 2.501e-02
|
||||
Cl- 2.501e-02 1.966e-02 -1.602 -1.706 -0.105
|
||||
FeCl+ 9.125e-10 7.286e-10 -9.040 -9.138 -0.098
|
||||
FeCl+2 1.019e-24 4.140e-25 -23.992 -24.383 -0.391
|
||||
FeCl2+ 4.553e-26 3.635e-26 -25.342 -25.439 -0.098
|
||||
FeCl3 7.025e-29 7.146e-29 -28.153 -28.146 0.007
|
||||
Fe(2) 8.735e-08
|
||||
Fe+2 6.170e-08 2.685e-08 -7.210 -7.571 -0.361
|
||||
FeSO4 2.295e-08 2.335e-08 -7.639 -7.632 0.007
|
||||
FeCl+ 9.125e-10 7.286e-10 -9.040 -9.138 -0.098
|
||||
FeHCO3+ 8.424e-10 6.727e-10 -9.074 -9.172 -0.098
|
||||
FeOH+ 5.563e-10 4.442e-10 -9.255 -9.352 -0.098
|
||||
FeCO3 3.897e-10 3.964e-10 -9.409 -9.402 0.007
|
||||
FeHSO4+ 3.669e-15 2.930e-15 -14.435 -14.533 -0.098
|
||||
Fe(HS)2 1.432e-18 1.457e-18 -17.844 -17.837 0.007
|
||||
Fe(HS)3- 4.903e-26 3.915e-26 -25.310 -25.407 -0.098
|
||||
Fe(3) 3.379e-14
|
||||
Fe(OH)3 2.704e-14 2.750e-14 -13.568 -13.561 0.007
|
||||
Fe(OH)2+ 5.111e-15 4.081e-15 -14.291 -14.389 -0.098
|
||||
Fe(OH)4- 1.644e-15 1.312e-15 -14.784 -14.882 -0.098
|
||||
FeOH+2 5.796e-19 2.356e-19 -18.237 -18.628 -0.391
|
||||
FeSO4+ 4.683e-23 3.739e-23 -22.329 -22.427 -0.098
|
||||
Fe(SO4)2- 5.010e-24 4.000e-24 -23.300 -23.398 -0.098
|
||||
Fe+3 3.432e-24 6.974e-25 -23.464 -24.156 -0.692
|
||||
FeCl+2 1.019e-24 4.140e-25 -23.992 -24.383 -0.391
|
||||
FeCl2+ 4.553e-26 3.635e-26 -25.342 -25.439 -0.098
|
||||
FeCl3 7.025e-29 7.146e-29 -28.153 -28.146 0.007
|
||||
FeHSO4+2 4.703e-30 1.911e-30 -29.328 -29.719 -0.391
|
||||
Fe2(OH)2+4 5.473e-35 1.494e-36 -34.262 -35.826 -1.564
|
||||
Fe3(OH)4+5 0.000e+00 0.000e+00 -45.451 -47.895 -2.444
|
||||
H(0) 6.856e-12
|
||||
H2 3.428e-12 3.487e-12 -11.465 -11.458 0.007
|
||||
Na 2.501e-02
|
||||
Na+ 2.441e-02 1.954e-02 -1.612 -1.709 -0.097
|
||||
NaSO4- 5.997e-04 4.788e-04 -3.222 -3.320 -0.098
|
||||
NaHCO3 2.706e-06 2.752e-06 -5.568 -5.560 0.007
|
||||
NaCO3- 2.804e-07 2.239e-07 -6.552 -6.650 -0.098
|
||||
NaOH 6.639e-09 6.753e-09 -8.178 -8.170 0.007
|
||||
O(0) 0.000e+00
|
||||
O2 0.000e+00 0.000e+00 -69.474 -69.466 0.007
|
||||
S(-2) 3.552e-10
|
||||
HS- 3.148e-10 2.467e-10 -9.502 -9.608 -0.106
|
||||
H2S 4.048e-11 4.118e-11 -10.393 -10.385 0.007
|
||||
S-2 3.777e-15 1.561e-15 -14.423 -14.807 -0.384
|
||||
Fe(HS)2 1.432e-18 1.457e-18 -17.844 -17.837 0.007
|
||||
Fe(HS)3- 4.903e-26 3.915e-26 -25.310 -25.407 -0.098
|
||||
S(6) 1.767e-02
|
||||
SO4-2 1.191e-02 4.890e-03 -1.924 -2.311 -0.387
|
||||
CaSO4 5.162e-03 5.251e-03 -2.287 -2.280 0.007
|
||||
NaSO4- 5.997e-04 4.788e-04 -3.222 -3.320 -0.098
|
||||
FeSO4 2.295e-08 2.335e-08 -7.639 -7.632 0.007
|
||||
HSO4- 1.137e-08 9.075e-09 -7.944 -8.042 -0.098
|
||||
CaHSO4+ 7.355e-10 5.872e-10 -9.133 -9.231 -0.098
|
||||
FeHSO4+ 3.669e-15 2.930e-15 -14.435 -14.533 -0.098
|
||||
FeSO4+ 4.683e-23 3.739e-23 -22.329 -22.427 -0.098
|
||||
Fe(SO4)2- 5.010e-24 4.000e-24 -23.300 -23.398 -0.098
|
||||
FeHSO4+2 4.703e-30 1.911e-30 -29.328 -29.719 -0.391
|
||||
|
||||
------------------------------Saturation indices-------------------------------
|
||||
|
||||
Phase SI log IAP log KT
|
||||
|
||||
Anhydrite -0.22 -4.58 -4.36 CaSO4
|
||||
Aragonite -0.14 -8.48 -8.34 CaCO3
|
||||
Calcite 0.00 -8.48 -8.48 CaCO3
|
||||
CH4(g) -10.95 -13.81 -2.86 CH4
|
||||
CO2(g) -3.50 -4.97 -1.47 CO2
|
||||
Fe(OH)3(a) -5.89 -1.00 4.89 Fe(OH)3
|
||||
FeS(ppt) -5.54 -9.46 -3.92 FeS
|
||||
Goethite 0.00 -1.00 -1.00 FeOOH
|
||||
Gypsum 0.00 -4.58 -4.58 CaSO4:2H2O
|
||||
H2(g) -8.31 -11.46 -3.15 H2
|
||||
H2O(g) -1.51 -0.00 1.51 H2O
|
||||
H2S(g) -9.39 -10.39 -1.00 H2S
|
||||
Halite -5.00 -3.42 1.58 NaCl
|
||||
Hematite 2.01 -2.00 -4.01 Fe2O3
|
||||
Mackinawite -4.81 -9.46 -4.65 FeS
|
||||
Melanterite -7.68 -9.89 -2.21 FeSO4:7H2O
|
||||
O2(g) -66.51 -69.47 -2.96 O2
|
||||
Pyrite -0.00 -18.48 -18.48 FeS2
|
||||
Siderite -2.89 -13.78 -10.89 FeCO3
|
||||
Sulfur -6.96 -2.08 4.88 S
|
||||
|
||||
------------------
|
||||
End of simulation.
|
||||
------------------
|
||||
|
||||
------------------------------------
|
||||
Reading input data for simulation 2.
|
||||
------------------------------------
|
||||
|
||||
-----------
|
||||
End of run.
|
||||
-----------
|
||||
|
||||
No memory leaks
|
||||
@ -1,7 +0,0 @@
|
||||
sim state soln dist_x time step pH pe Cl pyrite d_pyrite goethite d_goethite calcite d_calcite CO2(g) d_CO2(g) gypsum d_gypsum si_Gypsum
|
||||
1 i_soln 1 -99 -99 -99 7 4 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 -999.9990
|
||||
1 react 1 -99 0 1 8.27904 -4.94284 0.0000e+00 1.0000e+01 -3.1538e-08 1.0000e+01 1.1047e-08 9.9995e+00 -4.9340e-04 9.9995e+00 -4.8697e-04 0.0000e+00 0.0000e+00 -6.1283
|
||||
1 react 1 -99 0 2 8.17103 -4.28707 5.0000e-04 9.9997e+00 -2.6667e-04 1.0000e+01 2.6666e-04 9.9991e+00 -9.2766e-04 1.0000e+01 1.4180e-04 0.0000e+00 0.0000e+00 -2.0202
|
||||
1 react 1 -99 0 3 7.98207 -3.97043 2.5000e-03 9.9987e+00 -1.3333e-03 1.0001e+01 1.3333e-03 9.9971e+00 -2.9374e-03 1.0002e+01 2.3951e-03 0.0000e+00 0.0000e+00 -1.0629
|
||||
1 react 1 -99 0 4 7.88418 -3.81741 5.0001e-03 9.9973e+00 -2.6667e-03 1.0003e+01 2.6666e-03 9.9944e+00 -5.5594e-03 1.0005e+01 5.1054e-03 0.0000e+00 0.0000e+00 -0.6499
|
||||
1 react 1 -99 0 5 7.71922 -3.56545 2.5011e-02 9.9867e+00 -1.3333e-02 1.0013e+01 1.3333e-02 9.9732e+00 -2.6841e-02 1.0026e+01 2.6489e-02 9.0018e-03 9.0018e-03 0.0000
|
||||
3053
Sun/examples/ex6.out
3053
Sun/examples/ex6.out
File diff suppressed because it is too large
Load Diff
@ -1,22 +0,0 @@
|
||||
sim state soln dist_x time step pH pe la_K+ la_H+ la_H4SiO4 Gibbsite d_Gibbsite Kaolinite d_Kaolinite K-mica d_K-mica K-feldspar d_K-feldspar si_Gibbsite si_Kaolinite si_K-mica si_K-feldspar
|
||||
1 i_soln 1 -99 -99 -99 6.99977 4 -1.0000e+03 -6.9998e+00 -1.0000e+03 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 -999.9990 -999.9990 -999.9990 -999.9990
|
||||
2 react 1 -99 0 1 7.00609 11.4683 -7.5735e+00 -7.0061e+00 -7.0969e+00 1.0000e+01 -2.6709e-08 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000 -3.8037 -10.6810 -14.6840
|
||||
3 react 1 -99 0 1 8.2125 9.89391 -5.6625e+00 -8.2125e+00 -5.1950e+00 1.7820e-06 1.7820e-06 1.0000e+01 -2.1788e-06 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 -0.0000 -0.0000 -1.8580 -5.8610
|
||||
4 react 1 -99 0 1 9.10891 9.06313 -4.7009e+00 -9.1089e+00 -4.4670e+00 0.0000e+00 0.0000e+00 9.7149e-06 9.7149e-06 1.0000e+01 -2.0015e-05 0.0000e+00 0.0000e+00 -0.7280 0.0000 -0.0000 -2.5471
|
||||
5 react 1 -99 0 1 9.3893 8.71926 -3.9009e+00 -9.3893e+00 -3.5536e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 6.3607e-05 6.3607e-05 9.9998e+00 -1.9088e-04 -2.0015 -0.7202 -0.0000 -0.0000
|
||||
6 react 1 -99 0 1 8.35402 9.7856 -5.5204e+00 -8.3540e+00 -5.1950e+00 1.0000e+01 -3.0232e-06 1.0000e+00 1.2370e-06 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000 -0.0000 -1.5744 -5.5774
|
||||
7 react 1 -99 0 1 9.06998 8.8364 -4.6620e+00 -9.0700e+00 -4.2522e+00 0.0000e+00 0.0000e+00 1.0000e+01 -3.2683e-05 1.0000e+00 1.0785e-05 0.0000e+00 0.0000e+00 -0.9428 0.0000 0.0000 -2.1175
|
||||
8 react 1 -99 0 1 7.03143 11.4569 -7.3981e+00 -7.0314e+00 -6.9215e+00 1.1865e-08 1.1865e-08 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 -0.0000 -3.4530 -9.9542 -13.9572
|
||||
8 react 1 -99 0 2 7.10578 11.2881 -7.0971e+00 -7.1058e+00 -6.6206e+00 4.7135e-08 4.7135e-08 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 -0.0000 -2.8512 -8.6762 -12.6792
|
||||
8 react 1 -99 0 3 7.24112 11.2405 -6.7961e+00 -7.2411e+00 -6.3199e+00 1.1602e-07 1.1602e-07 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000 -2.2497 -7.3376 -11.3406
|
||||
8 react 1 -99 0 4 7.45138 11.1879 -6.4952e+00 -7.4514e+00 -6.0195e+00 2.4993e-07 2.4993e-07 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 -0.0000 -1.6491 -5.9254 -9.9284
|
||||
8 react 1 -99 0 5 7.71458 10.9939 -6.1942e+00 -7.7146e+00 -5.7200e+00 5.1299e-07 5.1299e-07 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000 -1.0500 -4.4627 -8.4657
|
||||
8 react 1 -99 0 6 7.89551 10.7897 -6.0005e+00 -7.8955e+00 -5.5279e+00 8.0811e-07 8.0811e-07 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000 -0.6658 -3.5117 -7.5147
|
||||
8 react 1 -99 0 7 8.17803 10.4976 -5.6997e+00 -8.1780e+00 -5.2314e+00 1.6334e-06 1.6334e-06 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000 -0.0728 -2.0389 -6.0419
|
||||
8 react 1 -99 0 8 8.48402 9.39003 -5.3990e+00 -8.4840e+00 -5.0858e+00 0.0000e+00 0.0000e+00 1.7119e-06 1.7119e-06 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 -0.1092 -0.0000 -1.3229 -5.1076
|
||||
8 react 1 -99 0 9 8.77878 9.50556 -5.0983e+00 -8.7788e+00 -4.8166e+00 0.0000e+00 0.0000e+00 3.6945e-06 3.6945e-06 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 -0.3784 -0.0000 -0.7276 -3.9737
|
||||
8 react 1 -99 0 10 9.0347 8.80148 -4.7979e+00 -9.0347e+00 -4.5514e+00 0.0000e+00 0.0000e+00 7.7006e-06 7.7006e-06 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 -0.6436 0.0000 -0.1712 -2.8871
|
||||
8 react 1 -99 0 11 9.07198 8.97748 -4.6640e+00 -9.0720e+00 -4.2616e+00 0.0000e+00 0.0000e+00 5.2701e-07 5.2701e-07 1.0204e-05 1.0204e-05 0.0000e+00 0.0000e+00 -0.9334 0.0000 -0.0000 -2.1362
|
||||
8 react 1 -99 0 12 9.2252 8.68998 -4.3726e+00 -9.2252e+00 -3.9889e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 2.1273e-05 2.1273e-05 0.0000e+00 0.0000e+00 -1.3543 -0.2964 0.0000 -1.2945
|
||||
8 react 1 -99 0 13 9.30457 8.57016 -4.1800e+00 -9.3046e+00 -3.8127e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 3.3294e-05 3.3294e-05 0.0000e+00 0.0000e+00 -1.6212 -0.4777 0.0000 -0.7607
|
||||
8 react 1 -99 0 14 9.3893 8.9467 -3.9009e+00 -9.3893e+00 -3.5536e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 6.3607e-05 6.3607e-05 9.1200e-06 9.1200e-06 -2.0015 -0.7202 -0.0000 0.0000
|
||||
@ -1,9 +0,0 @@
|
||||
pH+log[K] log[H4SiO4]
|
||||
-6.0002e+00 -1.2524e+01
|
||||
-1.8975e+00 -8.4212e+00
|
||||
-8.5316e-01 -7.3798e+00
|
||||
3.5755e-01 -6.3763e+00
|
||||
2.1823e+00 -5.3818e+00
|
||||
4.1360e+00 -4.6005e+00
|
||||
5.2614e+00 -3.7187e+00
|
||||
5.4884e+00 -3.5536e+00
|
||||
2819
Sun/examples/ex7.out
2819
Sun/examples/ex7.out
File diff suppressed because it is too large
Load Diff
@ -1,27 +0,0 @@
|
||||
sim state reaction si_CO2(g) si_CH4(g) si_N2(g) si_NH3(g) pressure total mol volume g_CO2(g) g_CH4(g) g_N2(g) g_NH3(g)
|
||||
1 i_soln -99 -999.9990 -999.9990 -999.9990 -999.9990 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00
|
||||
1 react -99 -1.5000 -26.2591 -999.9990 -999.9990 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00
|
||||
2 react 1.0000e-03 -1.3544 -0.4402 -3.8961 -8.3809 1.1000e+00 1.0000e-25 2.2242e-24 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00
|
||||
2 react 2.0000e-03 -1.2453 -0.1392 -3.6436 -8.1826 1.1000e+00 1.0000e-25 2.2242e-24 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00
|
||||
2 react 3.0000e-03 -1.1592 0.0130 -3.5015 -8.0869 1.1000e+00 8.5793e-05 1.9082e-03 5.4061e-06 8.0362e-05 2.4578e-08 6.3856e-13
|
||||
2 react 4.0000e-03 -1.0929 0.0081 -3.3212 -8.0234 1.1000e+00 6.4416e-04 1.4327e-02 4.7279e-05 5.9660e-04 2.7953e-07 5.5492e-12
|
||||
2 react 8.0000e-03 -0.9101 -0.0107 -2.9007 -7.8887 1.1000e+00 2.9972e-03 6.6664e-02 3.3511e-04 2.6587e-03 3.4247e-06 3.5204e-11
|
||||
2 react 1.6000e-02 -0.7156 -0.0438 -2.4738 -7.7606 1.1000e+00 8.2421e-03 1.8332e-01 1.4423e-03 6.7746e-03 2.5169e-05 1.3002e-10
|
||||
2 react 3.2000e-02 -0.5438 -0.0941 -2.0462 -7.6302 1.1000e+00 2.0521e-02 4.5644e-01 5.3332e-03 1.5021e-02 1.6775e-04 4.3718e-10
|
||||
2 react 6.4000e-02 -0.4248 -0.1517 -1.7252 -7.5359 1.1000e+00 4.9404e-02 1.0988e+00 1.6888e-02 3.1671e-02 8.4558e-04 1.3075e-09
|
||||
2 react 1.2500e-01 -0.3613 -0.1954 -1.5662 -7.4966 1.1000e+00 1.0982e-01 2.4427e+00 4.3447e-02 6.3666e-02 2.7111e-03 3.1820e-09
|
||||
2 react 2.5000e-01 -0.3288 -0.2227 -1.4927 -7.4823 1.1000e+00 2.3770e-01 5.2868e+00 1.0135e-01 1.2940e-01 6.9491e-03 7.1171e-09
|
||||
2 react 5.0000e-01 -0.3131 -0.2373 -1.4597 -7.4772 1.1000e+00 4.9570e-01 1.1025e+01 2.1912e-01 2.6094e-01 1.5635e-02 1.5019e-08
|
||||
2 react 1.0000e+00 -0.3055 -0.2448 -1.4443 -7.4751 1.1000e+00 1.0128e+00 2.2527e+01 4.5565e-01 5.2406e-01 3.3103e-02 3.0832e-08
|
||||
3 react 1.0000e-03 -2.7554 -3.2432 -4.4230 -9.1701 2.3652e-03 2.1751e-03 2.2500e+01 1.6151e-03 5.2527e-04 3.4720e-05 6.2162e-10
|
||||
3 react 2.0000e-03 -2.6525 -2.9422 -4.1221 -8.9453 3.4435e-03 3.1668e-03 2.2500e+01 2.0468e-03 1.0505e-03 6.9421e-05 1.0430e-09
|
||||
3 react 3.0000e-03 -2.5681 -2.7661 -3.9462 -8.8230 4.5301e-03 4.1661e-03 2.2500e+01 2.4862e-03 1.5758e-03 1.0409e-04 1.3823e-09
|
||||
3 react 4.0000e-03 -2.4967 -2.6412 -3.8215 -8.7406 5.6217e-03 5.1699e-03 2.2500e+01 2.9303e-03 2.1010e-03 1.3872e-04 1.6713e-09
|
||||
3 react 8.0000e-03 -2.2889 -2.3402 -3.5212 -8.5555 1.0011e-02 9.2068e-03 2.2500e+01 4.7283e-03 4.2016e-03 2.7697e-04 2.5595e-09
|
||||
3 react 1.6000e-02 -2.0415 -2.0392 -3.2214 -8.3855 1.8825e-02 1.7312e-02 2.2500e+01 8.3576e-03 8.4019e-03 5.5233e-04 3.7856e-09
|
||||
3 react 3.2000e-02 -1.7694 -1.7383 -2.9223 -8.2251 3.6471e-02 3.3540e-02 2.2500e+01 1.5640e-02 1.6800e-02 1.0998e-03 5.4762e-09
|
||||
3 react 6.4000e-02 -1.4834 -1.4374 -2.6240 -8.0704 7.1755e-02 6.5989e-02 2.2500e+01 3.0213e-02 3.3590e-02 2.1859e-03 7.8205e-09
|
||||
3 react 1.2500e-01 -1.2004 -1.1468 -2.3367 -7.9240 1.3896e-01 1.2779e-01 2.2500e+01 5.7976e-02 6.5580e-02 4.2353e-03 1.0956e-08
|
||||
3 react 2.5000e-01 -0.9036 -0.8460 -2.0399 -7.7740 2.7653e-01 2.5431e-01 2.2500e+01 1.1482e-01 1.3110e-01 8.3897e-03 1.5474e-08
|
||||
3 react 5.0000e-01 -0.6049 -0.5452 -1.7426 -7.6246 5.5147e-01 5.0716e-01 2.2500e+01 2.2843e-01 2.6209e-01 1.6634e-02 2.1827e-08
|
||||
3 react 1.0000e+00 -0.3050 -0.2442 -1.4438 -7.4749 1.1013e+00 1.0128e+00 2.2500e+01 4.5563e-01 5.2406e-01 3.3101e-02 3.0813e-08
|
||||
3612
Sun/examples/ex8.out
3612
Sun/examples/ex8.out
File diff suppressed because it is too large
Load Diff
@ -1,27 +0,0 @@
|
||||
sim state soln dist_x time step pH pe m_Zn+2 m_Hfo_wOZn+ m_Hfo_sOZn+
|
||||
2 react 1 -99 0 1 5 15.0946 9.9667e-08 1.3194e-11 3.1498e-10
|
||||
3 react 1 -99 0 1 5.25 14.8089 9.9093e-08 3.6118e-11 8.6216e-10
|
||||
4 react 1 -99 0 1 5.5 14.5232 9.7567e-08 9.7221e-11 2.3200e-09
|
||||
5 react 1 -99 0 1 5.75 14.2374 9.3657e-08 2.5418e-10 6.0611e-09
|
||||
6 react 1 -99 0 1 6 13.9517 8.4476e-08 6.2406e-10 1.4855e-08
|
||||
7 react 1 -99 0 1 6.25 13.666 6.6695e-08 1.3446e-09 3.1897e-08
|
||||
8 react 1 -99 0 1 6.5 13.3803 4.2322e-08 2.3406e-09 5.5265e-08
|
||||
9 react 1 -99 0 1 6.75 13.0946 2.1052e-08 3.2179e-09 7.5665e-08
|
||||
10 react 1 -99 0 1 7 12.8089 8.7494e-09 3.7289e-09 8.7472e-08
|
||||
11 react 1 -99 0 1 7.25 12.5232 3.3000e-09 3.9564e-09 9.2708e-08
|
||||
12 react 1 -99 0 1 7.5 12.2374 1.1903e-09 4.0447e-09 9.4740e-08
|
||||
13 react 1 -99 0 1 7.75 11.9517 4.2114e-10 4.0771e-09 9.5483e-08
|
||||
14 react 1 -99 0 1 8 11.666 1.4799e-10 4.0887e-09 9.5749e-08
|
||||
15 react 2 -99 0 1 5 15.0946 9.9686e-05 1.3187e-08 2.9620e-07
|
||||
16 react 2 -99 0 1 5.25 14.8089 9.9220e-05 3.6081e-08 7.3494e-07
|
||||
17 react 2 -99 0 1 5.5 14.5231 9.8300e-05 9.7297e-08 1.5866e-06
|
||||
18 react 2 -99 0 1 5.75 14.2374 9.6947e-05 2.5891e-07 2.7658e-06
|
||||
19 react 2 -99 0 1 6 13.9517 9.5437e-05 6.8302e-07 3.8297e-06
|
||||
20 react 2 -99 0 1 6.25 13.666 9.3651e-05 1.7815e-06 4.4782e-06
|
||||
21 react 2 -99 0 1 6.5 13.3803 9.0584e-05 4.4798e-06 4.7815e-06
|
||||
22 react 2 -99 0 1 6.75 13.0946 8.4566e-05 1.0266e-05 4.9051e-06
|
||||
23 react 2 -99 0 1 7 12.8088 7.4581e-05 2.0039e-05 4.9534e-06
|
||||
24 react 2 -99 0 1 7.25 12.5229 6.1786e-05 3.2572e-05 4.9732e-06
|
||||
25 react 2 -99 0 1 7.5 12.2374 4.8388e-05 4.5601e-05 4.9823e-06
|
||||
26 react 2 -99 0 1 7.75 11.9517 3.5918e-05 5.7508e-05 4.9871e-06
|
||||
27 react 2 -99 0 1 8 11.666 2.5127e-05 6.7404e-05 4.9897e-06
|
||||
1284
Sun/examples/ex9.out
1284
Sun/examples/ex9.out
File diff suppressed because it is too large
Load Diff
@ -1,13 +0,0 @@
|
||||
Days Fe(2) Fe(3) pH si_goethite
|
||||
0.0000e+00 1.0000e+02 0.0000e+00 7.0000e+00 -9.9990e+01
|
||||
1.1574e-03 9.8942e+01 1.0578e+00 6.0476e+00 6.6424e+00
|
||||
5.7870e-03 9.8206e+01 1.7942e+00 5.8097e+00 6.6543e+00
|
||||
4.1667e-02 9.6592e+01 3.4082e+00 5.5247e+00 6.6602e+00
|
||||
1.6667e-01 9.4639e+01 5.3610e+00 5.3268e+00 6.6620e+00
|
||||
4.1667e-01 9.2764e+01 7.2360e+00 5.1975e+00 6.6627e+00
|
||||
1.0000e+00 9.0358e+01 9.6422e+00 5.0750e+00 6.6632e+00
|
||||
2.0000e+00 8.7896e+01 1.2104e+01 4.9790e+00 6.6635e+00
|
||||
4.0000e+00 8.4808e+01 1.5192e+01 4.8840e+00 6.6638e+00
|
||||
6.0000e+00 8.2651e+01 1.7349e+01 4.8290e+00 6.6639e+00
|
||||
8.0000e+00 8.0939e+01 1.9061e+01 4.7903e+00 6.6640e+00
|
||||
1.0000e+01 7.9498e+01 2.0502e+01 4.7605e+00 6.6640e+00
|
||||
103
advection.cpp
103
advection.cpp
@ -1,103 +0,0 @@
|
||||
#define EXTERNAL extern
|
||||
#include "global.h"
|
||||
#include "phqalloc.h"
|
||||
#include "output.h"
|
||||
#include "phrqproto.h"
|
||||
|
||||
static char const svnid[] = "$Id: advection.c 78 2005-02-01 22:47:12Z dlpark $";
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int advection(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i, n;
|
||||
LDBLE kin_time;
|
||||
if (svnid == NULL) fprintf(stderr," ");
|
||||
/*
|
||||
* Calculate advection
|
||||
*/
|
||||
state = ADVECTION;
|
||||
/* mass_water_switch = TRUE; */
|
||||
/*
|
||||
* Check existence of all solutions
|
||||
*/
|
||||
for (i = 0; i <= count_ad_cells; i++) {
|
||||
if (solution_bsearch(i, &n, TRUE) == NULL) {
|
||||
input_error++;
|
||||
sprintf(error_string, "Solution %d is needed for advection, but is not defined.", i);
|
||||
error_msg(error_string, CONTINUE);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Check kinetics logic
|
||||
*/
|
||||
kin_time = advection_kin_time;
|
||||
if (kin_time <= 0.0) {
|
||||
for (i = 1; i <= count_ad_cells; i++) {
|
||||
if (kinetics_bsearch(i, &n) != NULL) {
|
||||
input_error++;
|
||||
sprintf(error_string, "KINETIC reaction(s) defined, but time_step is not defined in ADVECTION keyword.");
|
||||
error_msg(error_string, CONTINUE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Quit on error
|
||||
*/
|
||||
if (input_error > 0) {
|
||||
error_msg("Program terminating due to input errors.", STOP);
|
||||
}
|
||||
/*
|
||||
* Equilibrate solutions with phases, exchangers, surfaces
|
||||
*/
|
||||
last_model.force_prep = TRUE;
|
||||
rate_sim_time_start = 0;
|
||||
for (advection_step = 1; advection_step <= count_ad_shifts; advection_step++) {
|
||||
output_msg(OUTPUT_LOG, "\nBeginning of advection time step %d, cumulative pore volumes %f.\n", advection_step, (double) (((LDBLE) advection_step) / ((LDBLE) count_ad_cells)));
|
||||
if (pr.use == TRUE && pr.all == TRUE) {
|
||||
output_msg(OUTPUT_MESSAGE, "Beginning of advection time step %d, cumulative pore volumes %f.\n",
|
||||
advection_step, (double) (((LDBLE) advection_step) / ((LDBLE) count_ad_cells)));
|
||||
}
|
||||
/*
|
||||
* Advect
|
||||
*/
|
||||
for (i = count_ad_cells; i > 0; i--) {
|
||||
solution_duplicate(i - 1, i);
|
||||
}
|
||||
/*
|
||||
* Equilibrate and (or) mix
|
||||
*/
|
||||
for (i = 1; i <= count_ad_cells; i++) {
|
||||
|
||||
cell_no = i;
|
||||
set_advection(i, TRUE, TRUE, i);
|
||||
run_reactions(i, kin_time, TRUE, 1.0);
|
||||
if (advection_kin_time_defined == TRUE) {
|
||||
rate_sim_time = rate_sim_time_start + kin_time;
|
||||
}
|
||||
output_msg(OUTPUT_LOG, "\nCell %d.\n\n", i);
|
||||
if (pr.use == TRUE && pr.all == TRUE &&
|
||||
advection_step % print_ad_modulus == 0 &&
|
||||
advection_print[i-1] == TRUE) {
|
||||
output_msg(OUTPUT_MESSAGE, "\nCell %d.\n\n", i);
|
||||
}
|
||||
if (advection_step % punch_ad_modulus == 0 &&
|
||||
advection_punch[i-1] == TRUE ) {
|
||||
punch_all();
|
||||
}
|
||||
if (advection_step % print_ad_modulus == 0 &&
|
||||
advection_print[i-1] == TRUE ) {
|
||||
print_all();
|
||||
}
|
||||
if (i > 1) solution_duplicate(-2, i-1);
|
||||
saver();
|
||||
}
|
||||
solution_duplicate(-2, count_ad_cells);
|
||||
rate_sim_time_start += kin_time;
|
||||
}
|
||||
initial_total_time += rate_sim_time_start;
|
||||
/* free_model_allocs(); */
|
||||
mass_water_switch = FALSE;
|
||||
return(OK);
|
||||
}
|
||||
1774
basicsubs.cpp
1774
basicsubs.cpp
File diff suppressed because it is too large
Load Diff
753
cl1.cpp
753
cl1.cpp
@ -1,753 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/* must be defined here and in global.h */
|
||||
#if !defined(WIN32_MEMORY_DEBUG)
|
||||
#define USE_PHRQ_ALLOC
|
||||
#endif
|
||||
#include "phqalloc.h"
|
||||
#include "output.h"
|
||||
#include "phrqtype.h"
|
||||
|
||||
int cl1(int k, int l, int m, int n,
|
||||
int nklmd, int n2d,
|
||||
LDBLE *q,
|
||||
int *kode, LDBLE toler,
|
||||
int *iter, LDBLE *x, LDBLE *res, LDBLE *error,
|
||||
LDBLE *cu, int *iu, int *s,
|
||||
int check);
|
||||
static char const svnid[] = "$Id: cl1.c 248 2005-04-14 17:10:53Z dlpark $";
|
||||
|
||||
extern void *free_check_null(void *ptr);
|
||||
extern void malloc_error(void);
|
||||
|
||||
/* debug
|
||||
#define DEBUG_CL1
|
||||
#define CHECK_ERRORS
|
||||
*/
|
||||
|
||||
int cl1(int k, int l, int m, int n,
|
||||
int nklmd, int n2d,
|
||||
LDBLE *q,
|
||||
int *kode, LDBLE toler,
|
||||
int *iter, LDBLE *x, LDBLE *res, LDBLE *error,
|
||||
LDBLE *cu, int *iu, int *s, int check)
|
||||
{
|
||||
/* System generated locals */
|
||||
LDBLE *scratch;
|
||||
union double_or_int {int ival; LDBLE dval;} *q2;
|
||||
|
||||
/* Local variables */
|
||||
static int nklm;
|
||||
static LDBLE xmin, xmax;
|
||||
static int iout, i, j;
|
||||
static LDBLE z;
|
||||
static int maxit, n1, n2;
|
||||
static LDBLE pivot;
|
||||
static int ia, ii, kk, in, nk, js;
|
||||
static LDBLE sn;
|
||||
static int iphase, kforce;
|
||||
static LDBLE zu, zv;
|
||||
static LDBLE tpivot;
|
||||
static int klm, jmn, nkl, jpn;
|
||||
static LDBLE cuv, sum;
|
||||
static int klm1;
|
||||
int q_dim, cu_dim;
|
||||
int kode_arg;
|
||||
LDBLE *x_arg, *res_arg, check_toler;
|
||||
#ifdef CHECK_ERRORS
|
||||
extern char **col_name, **row_name;
|
||||
extern int *row_back, *col_back;
|
||||
#endif
|
||||
/* THIS SUBROUTINE USES A MODIFICATION OF THE SIMPLEX */
|
||||
/* METHOD OF LINEAR PROGRAMMING TO CALCULATE AN L1 SOLUTION */
|
||||
/* TO A K BY N SYSTEM OF LINEAR EQUATIONS */
|
||||
/* AX=B */
|
||||
/* SUBJECT TO L LINEAR EQUALITY CONSTRAINTS */
|
||||
/* CX=D */
|
||||
/* AND M LINEAR INEQUALITY CONSTRAINTS */
|
||||
/* EX.LE.F. */
|
||||
/* DESCRIPTION OF PARAMETERS */
|
||||
/* K NUMBER OF ROWS OF THE MATRIX A (K.GE.1). */
|
||||
/* L NUMBER OF ROWS OF THE MATRIX C (L.GE.0). */
|
||||
/* M NUMBER OF ROWS OF THE MATRIX E (M.GE.0). */
|
||||
/* N NUMBER OF COLUMNS OF THE MATRICES A,C,E (N.GE.1). */
|
||||
/* KLMD SET TO AT LEAST K+L+M FOR ADJUSTABLE DIMENSIONS. */
|
||||
/* KLM2D SET TO AT LEAST K+L+M+2 FOR ADJUSTABLE DIMENSIONS. */
|
||||
/* NKLMD SET TO AT LEAST N+K+L+M FOR ADJUSTABLE DIMENSIONS. */
|
||||
/* N2D SET TO AT LEAST N+2 FOR ADJUSTABLE DIMENSIONS */
|
||||
/* Q TWO DIMENSIONAL REAL ARRAY WITH KLM2D ROWS AND */
|
||||
/* AT LEAST N2D COLUMNS. */
|
||||
/* ON ENTRY THE MATRICES A,C AND E, AND THE VECTORS */
|
||||
/* B,D AND F MUST BE STORED IN THE FIRST K+L+M ROWS */
|
||||
/* AND N+1 COLUMNS OF Q AS FOLLOWS */
|
||||
/* A B */
|
||||
/* Q = C D */
|
||||
/* E F */
|
||||
/* THESE VALUES ARE DESTROYED BY THE SUBROUTINE. */
|
||||
/* KODE A CODE USED ON ENTRY TO, AND EXIT */
|
||||
/* FROM, THE SUBROUTINE. */
|
||||
/* ON ENTRY, THIS SHOULD NORMALLY BE SET TO 0. */
|
||||
/* HOWEVER, IF CERTAIN NONNEGATIVITY CONSTRAINTS */
|
||||
/* ARE TO BE INCLUDED IMPLICITLY, RATHER THAN */
|
||||
/* EXPLICITLY IN THE CONSTRAINTS EX.LE.F, THEN KODE */
|
||||
/* SHOULD BE SET TO 1, AND THE NONNEGATIVITY */
|
||||
/* CONSTRAINTS INCLUDED IN THE ARRAYS X AND */
|
||||
/* RES (SEE BELOW). */
|
||||
/* ON EXIT, KODE HAS ONE OF THE */
|
||||
/* FOLLOWING VALUES */
|
||||
/* 0- OPTIMAL SOLUTION FOUND, */
|
||||
/* 1- NO FEASIBLE SOLUTION TO THE */
|
||||
/* CONSTRAINTS, */
|
||||
/* 2- CALCULATIONS TERMINATED */
|
||||
/* PREMATURELY DUE TO ROUNDING ERRORS, */
|
||||
/* 3- MAXIMUM NUMBER OF ITERATIONS REACHED. */
|
||||
/* TOLER A SMALL POSITIVE TOLERANCE. EMPIRICAL */
|
||||
/* EVIDENCE SUGGESTS TOLER = 10**(-D*2/3), */
|
||||
/* WHERE D REPRESENTS THE NUMBER OF DECIMAL */
|
||||
/* DIGITS OF ACCURACY AVAILABLE. ESSENTIALLY, */
|
||||
/* THE SUBROUTINE CANNOT DISTINGUISH BETWEEN ZERO */
|
||||
/* AND ANY QUANTITY WHOSE MAGNITUDE DOES NOT EXCEED */
|
||||
/* TOLER. IN PARTICULAR, IT WILL NOT PIVOT ON ANY */
|
||||
/* NUMBER WHOSE MAGNITUDE DOES NOT EXCEED TOLER. */
|
||||
/* ITER ON ENTRY ITER MUST CONTAIN AN UPPER BOUND ON */
|
||||
/* THE MAXIMUM NUMBER OF ITERATIONS ALLOWED. */
|
||||
/* A SUGGESTED VALUE IS 10*(K+L+M). ON EXIT ITER */
|
||||
/* GIVES THE NUMBER OF SIMPLEX ITERATIONS. */
|
||||
/* X ONE DIMENSIONAL REAL ARRAY OF SIZE AT LEAST N2D. */
|
||||
/* ON EXIT THIS ARRAY CONTAINS A */
|
||||
/* SOLUTION TO THE L1 PROBLEM. IF KODE=1 */
|
||||
/* ON ENTRY, THIS ARRAY IS ALSO USED TO INCLUDE */
|
||||
/* SIMPLE NONNEGATIVITY CONSTRAINTS ON THE */
|
||||
/* VARIABLES. THE VALUES -1, 0, OR 1 */
|
||||
/* FOR X(J) INDICATE THAT THE J-TH VARIABLE */
|
||||
/* IS RESTRICTED TO BE .LE.0, UNRESTRICTED, */
|
||||
/* OR .GE.0 RESPECTIVELY. */
|
||||
/* RES ONE DIMENSIONAL REAL ARRAY OF SIZE AT LEAST KLMD. */
|
||||
/* ON EXIT THIS CONTAINS THE RESIDUALS B-AX */
|
||||
/* IN THE FIRST K COMPONENTS, D-CX IN THE */
|
||||
/* NEXT L COMPONENTS (THESE WILL BE =0),AND */
|
||||
/* F-EX IN THE NEXT M COMPONENTS. IF KODE=1 ON */
|
||||
/* ENTRY, THIS ARRAY IS ALSO USED TO INCLUDE SIMPLE */
|
||||
/* NONNEGATIVITY CONSTRAINTS ON THE RESIDUALS */
|
||||
/* B-AX. THE VALUES -1, 0, OR 1 FOR RES(I) */
|
||||
/* INDICATE THAT THE I-TH RESIDUAL (1.LE.I.LE.K) IS */
|
||||
/* RESTRICTED TO BE .LE.0, UNRESTRICTED, OR .GE.0 */
|
||||
/* RESPECTIVELY. */
|
||||
/* ERROR ON EXIT, THIS GIVES THE MINIMUM SUM OF */
|
||||
/* ABSOLUTE VALUES OF THE RESIDUALS. */
|
||||
/* CU A TWO DIMENSIONAL REAL ARRAY WITH TWO ROWS AND */
|
||||
/* AT LEAST NKLMD COLUMNS USED FOR WORKSPACE. */
|
||||
/* IU A TWO DIMENSIONAL INTEGER ARRAY WITH TWO ROWS AND */
|
||||
/* AT LEAST NKLMD COLUMNS USED FOR WORKSPACE. */
|
||||
/* S INTEGER ARRAY OF SIZE AT LEAST KLMD, USED FOR */
|
||||
/* WORKSPACE. */
|
||||
/* DOUBLE PRECISION DBLE */
|
||||
/* REAL */
|
||||
|
||||
/* INITIALIZATION. */
|
||||
if (svnid == NULL) fprintf(stderr," ");
|
||||
|
||||
|
||||
zv = 0;
|
||||
kode_arg = *kode;
|
||||
x_arg = NULL;
|
||||
res_arg = NULL;
|
||||
if (check == 1) {
|
||||
/*
|
||||
q_arg = PHRQ_malloc((size_t) (max_row_count * max_column_count * sizeof(LDBLE)));
|
||||
if (q_arg == NULL) malloc_error();
|
||||
for (i = 0; i < max_row_count*max_column_count; i++) {
|
||||
q_arg[i] = q[i];
|
||||
}
|
||||
*/
|
||||
x_arg = (double *) PHRQ_malloc((size_t) (n2d * sizeof(LDBLE)));
|
||||
if (x_arg == NULL) malloc_error();
|
||||
for (i = 0; i < n2d; i++) {
|
||||
x_arg[i] = x[i];
|
||||
}
|
||||
res_arg = (double *) PHRQ_malloc((size_t) ((k + l + m) * sizeof(LDBLE)));
|
||||
if (res_arg == NULL) malloc_error();
|
||||
for (i = 0; i < k + l + m; i++) {
|
||||
res_arg[i] = res[i];
|
||||
}
|
||||
}
|
||||
/* Parameter adjustments */
|
||||
q_dim = n2d;
|
||||
q2 = (union double_or_int *) q;
|
||||
cu_dim = nklmd;
|
||||
|
||||
/* Function Body */
|
||||
maxit = *iter;
|
||||
n1 = n + 1;
|
||||
n2 = n + 2;
|
||||
nk = n + k;
|
||||
nkl = nk + l;
|
||||
klm = k + l + m;
|
||||
klm1 = klm + 1;
|
||||
nklm = n + klm;
|
||||
kforce = 1;
|
||||
*iter = 0;
|
||||
js = 0;
|
||||
ia = -1;
|
||||
/* Make scratch space */
|
||||
scratch = (LDBLE *) PHRQ_malloc( (size_t) nklmd * sizeof(LDBLE));
|
||||
if (scratch == NULL) malloc_error();
|
||||
for (i=0; i < nklmd; i++) {
|
||||
scratch[i] = 0.0;
|
||||
}
|
||||
/* SET UP LABELS IN Q. */
|
||||
for (j = 0; j < n; ++j) {
|
||||
q2[ klm1 * q_dim + j ].ival = j + 1;
|
||||
}
|
||||
/* L10: */
|
||||
for (i = 0; i < klm; ++i) {
|
||||
q2[ i * q_dim + n1 ].ival = n + i + 1;
|
||||
if (q2[ i * q_dim + n ].dval < 0.) {
|
||||
for (j = 0; j < n1; ++j) {
|
||||
q2[ i * q_dim + j ].dval = -q2[ i * q_dim + j ].dval;
|
||||
}
|
||||
q2[ i * q_dim + n1 ].ival = -q2[ i * q_dim + n1 ].ival;
|
||||
/* L20: */
|
||||
}
|
||||
}
|
||||
/* L30: */
|
||||
/* SET UP PHASE 1 COSTS. */
|
||||
iphase = 2;
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "Set up phase 1 costs\n");
|
||||
#endif
|
||||
/* Zero first row of cu and iu */
|
||||
memcpy( (void *) &(cu[0]), (void *) &(scratch[0]),
|
||||
(size_t) nklm * sizeof(LDBLE) );
|
||||
for (j = 0; j < nklm; ++j) {
|
||||
iu[ j ] = 0;
|
||||
}
|
||||
/* L40: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L40\n");
|
||||
#endif
|
||||
if (l != 0) {
|
||||
for (j = nk; j < nkl; ++j) {
|
||||
cu[ j ] = 1.;
|
||||
iu[ j ] = 1;
|
||||
}
|
||||
/* L50: */
|
||||
iphase = 1;
|
||||
}
|
||||
|
||||
/* Copy first row of cu and iu to second row */
|
||||
memcpy( (void *) &(cu[cu_dim]), (void *) &(cu[0]),
|
||||
(size_t) nklm * sizeof(LDBLE) );
|
||||
memcpy( (void *) &(iu[cu_dim]), (void *) &(iu[0]),
|
||||
(size_t) nklm * sizeof(int) );
|
||||
|
||||
/* L60: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L60\n");
|
||||
#endif
|
||||
if (m != 0) {
|
||||
for (j = nkl; j < nklm; ++j) {
|
||||
cu[ cu_dim + j ] = 1.;
|
||||
iu[ cu_dim + j ] = 1;
|
||||
jmn = j - n;
|
||||
if (q2[ jmn * q_dim + n1 ].ival < 0) {
|
||||
iphase = 1;
|
||||
}
|
||||
}
|
||||
/* L70: */
|
||||
}
|
||||
/* L80: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L80\n");
|
||||
#endif
|
||||
if (*kode != 0) {
|
||||
for (j = 0; j < n; ++j) {
|
||||
if ( x[j] < 0.) {
|
||||
/* L90: */
|
||||
cu[ j ] = 1.;
|
||||
iu[ j ] = 1;
|
||||
} else if (x[j] > 0.) {
|
||||
cu[ cu_dim + j ] = 1.;
|
||||
iu[ cu_dim + j ] = 1;
|
||||
}
|
||||
}
|
||||
/* L110: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L110\n");
|
||||
#endif
|
||||
for (j = 0; j < k; ++j) {
|
||||
jpn = j + n;
|
||||
if ( res[j] < 0.) {
|
||||
/* L120: */
|
||||
cu[ jpn ] = 1.;
|
||||
iu[ jpn ] = 1;
|
||||
if (q2[ j * q_dim + n1 ].ival > 0) {
|
||||
iphase = 1;
|
||||
}
|
||||
} else if (res[j] > 0.) {
|
||||
/* L130: */
|
||||
cu[ cu_dim + jpn ] = 1.;
|
||||
iu[ cu_dim + jpn ] = 1;
|
||||
if (q2[ j * q_dim + n1 ].ival < 0) {
|
||||
iphase = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* L140: */
|
||||
}
|
||||
/* L150: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L150\n");
|
||||
#endif
|
||||
if (iphase == 2) {
|
||||
goto L500;
|
||||
}
|
||||
/* COMPUTE THE MARGINAL COSTS. */
|
||||
L160:
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L160\n");
|
||||
#endif
|
||||
for (j = js; j < n1; ++j) {
|
||||
sum = 0.;
|
||||
for (i = 0; i < klm; ++i) {
|
||||
ii = q2[ i * q_dim + n1 ].ival;
|
||||
if (ii < 0) {
|
||||
z = cu[ cu_dim - ii - 1 ];
|
||||
} else {
|
||||
z = cu[ ii - 1 ];
|
||||
}
|
||||
sum += q2[ i * q_dim + j ].dval * z;
|
||||
}
|
||||
q2[ klm * q_dim + j ].dval = sum;
|
||||
}
|
||||
for (j = js; j < n; ++j) {
|
||||
ii = q2[ klm1 * q_dim + j].ival;
|
||||
if (ii < 0) {
|
||||
z = cu[ cu_dim - ii - 1 ];
|
||||
} else {
|
||||
z = cu[ ii - 1 ];
|
||||
}
|
||||
q2[ klm * q_dim + j ].dval -= z;
|
||||
}
|
||||
/* DETERMINE THE VECTOR TO ENTER THE BASIS. */
|
||||
L240:
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L240, xmax %e\n", xmax);
|
||||
#endif
|
||||
xmax = 0.;
|
||||
if (js >= n) {
|
||||
goto L490; /* test for optimality */
|
||||
}
|
||||
for (j = js; j < n; ++j) {
|
||||
zu = q2[ klm * q_dim + j ].dval;
|
||||
ii = q2[ klm1 * q_dim + j ].ival;
|
||||
if (ii > 0) {
|
||||
zv = -zu - cu[ ii - 1 ] - cu[ cu_dim + ii - 1 ];
|
||||
} else {
|
||||
ii = -ii;
|
||||
zv = zu;
|
||||
zu = -zu - cu[ ii - 1 ] - cu[ cu_dim + ii - 1 ];
|
||||
}
|
||||
/* L260 */
|
||||
if (kforce == 1 && ii > n) {
|
||||
continue;
|
||||
}
|
||||
if (iu[ ii - 1 ] != 1 && zu > xmax){
|
||||
xmax = zu;
|
||||
in = j;
|
||||
}
|
||||
/* L270 */
|
||||
if (iu[ cu_dim + ii - 1 ] != 1 && zv > xmax ) {
|
||||
xmax = zv;
|
||||
in = j;
|
||||
}
|
||||
}
|
||||
/* L280 */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L280 xmax %e, toler %e\n", xmax, toler);
|
||||
#endif
|
||||
if (xmax <= toler) {
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "xmax before optimality test %e\n",xmax);
|
||||
#endif
|
||||
goto L490; /* test for optimality */
|
||||
}
|
||||
if (q2[ klm * q_dim + in ].dval != xmax) {
|
||||
for (i = 0; i < klm1; ++i) {
|
||||
q2[ i * q_dim + in ].dval = -q2[ i * q_dim + in ].dval;
|
||||
}
|
||||
q2[ klm1 * q_dim + in ].ival = -q2[ klm1 * q_dim + in ].ival;
|
||||
/* L290: */
|
||||
q2[ klm * q_dim + in ].dval = xmax;
|
||||
}
|
||||
/* DETERMINE THE VECTOR TO LEAVE THE BASIS. */
|
||||
if (iphase != 1 && ia != -1) {
|
||||
xmax = 0.;
|
||||
/* find maximum absolute value in column "in" */
|
||||
for (i = 0; i <= ia; ++i) {
|
||||
z = fabs(q2[ i * q_dim + in ].dval);
|
||||
if (z > xmax) {
|
||||
xmax = z;
|
||||
iout = i;
|
||||
}
|
||||
}
|
||||
/* L310: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L310, xmax %e\n", xmax);
|
||||
#endif
|
||||
/* switch row ia with row iout, use memcpy */
|
||||
if (xmax > toler) {
|
||||
memcpy( (void *) &(scratch[0]), (void *) &(q2[ ia * q_dim]),
|
||||
(size_t) n2 * sizeof(LDBLE) );
|
||||
memcpy( (void *) &(q2[ ia * q_dim ]), (void *) &(q2[ iout * q_dim]),
|
||||
(size_t) n2 * sizeof(LDBLE) );
|
||||
memcpy( (void *) &(q2[ iout * q_dim ]), (void *) &(scratch[ 0 ]),
|
||||
(size_t) n2 * sizeof(LDBLE) );
|
||||
/* L320: */
|
||||
/* set pivot to row ia, column in */
|
||||
iout = ia;
|
||||
--ia;
|
||||
pivot = q2[ iout * q_dim + in ].dval;
|
||||
goto L420; /* Gauss Jordan */
|
||||
}
|
||||
}
|
||||
/* L330: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L330, xmax %e\n", xmax);
|
||||
#endif
|
||||
kk = -1;
|
||||
/* divide column n1 by positive value in column "in" greater than toler */
|
||||
for (i = 0; i < klm; ++i) {
|
||||
z = q2[ i * q_dim + in ].dval;
|
||||
if (z > toler) {
|
||||
++kk;
|
||||
res[kk] = q2[ i * q_dim + n ].dval / z;
|
||||
s[kk] = i;
|
||||
}
|
||||
}
|
||||
/* L340: */
|
||||
#ifdef DEBUG_CL1
|
||||
if (kk < 0) {
|
||||
output_msg(OUTPUT_MESSAGE, "kode = 2 in loop 340.\n");
|
||||
}
|
||||
#endif
|
||||
L350:
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L350, xmax %e\n", xmax);
|
||||
#endif
|
||||
if (kk < 0) {
|
||||
/* no positive value found in L340 or bypass intermediate verticies */
|
||||
*kode = 2;
|
||||
goto L590;
|
||||
}
|
||||
/* L360: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L360, xmax %e\n", xmax);
|
||||
#endif
|
||||
/* find minimum residual */
|
||||
xmin = res[ 0 ];
|
||||
iout = s[ 0 ];
|
||||
j = 0;
|
||||
if (kk != 0) {
|
||||
for (i = 1; i <= kk; ++i) {
|
||||
if (res[i] < xmin) {
|
||||
j = i;
|
||||
xmin = res[i];
|
||||
iout = s[i];
|
||||
}
|
||||
}
|
||||
/* L370: */
|
||||
/* put kk in position j */
|
||||
res[j] = res[kk];
|
||||
s[j] = s[kk];
|
||||
}
|
||||
/* L380: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L380 iout %d, xmin %e, xmax %e\n", iout, xmin, xmax);
|
||||
#endif
|
||||
--kk;
|
||||
pivot = q2[ iout * q_dim + in ].dval;
|
||||
ii = q2[ iout * q_dim + n1 ].ival;
|
||||
if (iphase != 1) {
|
||||
if (ii < 0) {
|
||||
/* L390: */
|
||||
if (iu[ - ii - 1 ] == 1) {
|
||||
goto L420;
|
||||
}
|
||||
} else {
|
||||
if (iu[ cu_dim + ii - 1 ] == 1) {
|
||||
goto L420;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* L400: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L400\n");
|
||||
#endif
|
||||
ii = abs(ii);
|
||||
cuv = cu[ ii - 1 ] + cu[ cu_dim + ii - 1];
|
||||
if (q2[ klm * q_dim + in ].dval - pivot * cuv > toler) {
|
||||
|
||||
/* BYPASS INTERMEDIATE VERTICES. */
|
||||
for (j = js; j < n1; ++j) {
|
||||
z = q2[ iout * q_dim + j ].dval;
|
||||
q2[ klm * q_dim + j ].dval -= z * cuv;
|
||||
q2[ iout * q_dim + j ].dval = -z;
|
||||
}
|
||||
/* L410: */
|
||||
q2[ iout * q_dim + n1 ].ival = -q2[ iout * q_dim + n1 ].ival;
|
||||
goto L350;
|
||||
}
|
||||
/* GAUSS-JORDAN ELIMINATION. */
|
||||
L420:
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "Gauss Jordon %d\n", *iter);
|
||||
#endif
|
||||
if (*iter >= maxit) {
|
||||
*kode = 3;
|
||||
goto L590;
|
||||
}
|
||||
/* L430: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L430\n");
|
||||
#endif
|
||||
++(*iter);
|
||||
for (j = js; j < n1; ++j) {
|
||||
if (j != in) {
|
||||
q2[ iout * q_dim + j ].dval /= pivot;
|
||||
}
|
||||
}
|
||||
/* L440: */
|
||||
for (j = js; j < n1; ++j) {
|
||||
if (j != in) {
|
||||
z = -q2[ iout * q_dim + j ].dval;
|
||||
for (i = 0; i < klm1; ++i) {
|
||||
if (i != iout) {
|
||||
q2[ i * q_dim + j ].dval += z * q2[ i * q_dim + in ].dval;
|
||||
}
|
||||
}
|
||||
/* L450: */
|
||||
}
|
||||
}
|
||||
/* L460: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L460\n");
|
||||
#endif
|
||||
tpivot = -pivot;
|
||||
for (i = 0; i < klm1; ++i) {
|
||||
if (i != iout) {
|
||||
q2[ i * q_dim + in ].dval /= tpivot;
|
||||
}
|
||||
}
|
||||
/* L470: */
|
||||
q2[ iout * q_dim + in ].dval = 1. / pivot;
|
||||
ii = q2[ iout * q_dim + n1 ].ival;
|
||||
q2[ iout * q_dim + n1 ].ival = q2[ klm1 * q_dim + in ].ival;
|
||||
q2[ klm1 * q_dim + in ].ival = ii;
|
||||
ii = abs(ii);
|
||||
if (iu[ ii - 1 ] == 0 || iu[ cu_dim + ii - 1 ] == 0) {
|
||||
goto L240;
|
||||
}
|
||||
/* switch column */
|
||||
for (i = 0; i < klm1; ++i) {
|
||||
z = q2[ i * q_dim + in ].dval;
|
||||
q2[ i * q_dim + in ].dval = q2[ i * q_dim + js ].dval;
|
||||
q2[ i * q_dim + js ].dval = z;
|
||||
}
|
||||
i = q2[ klm1 * q_dim + in ].ival;
|
||||
q2[ klm1 * q_dim + in ].ival = q2[ klm1 * q_dim + js ].ival;
|
||||
q2[ klm1 * q_dim + js ].ival = i;
|
||||
/* L480: */
|
||||
++js;
|
||||
goto L240;
|
||||
/* TEST FOR OPTIMALITY. */
|
||||
L490:
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L490\n");
|
||||
#endif
|
||||
if (kforce == 0) {
|
||||
if (iphase == 1) {
|
||||
if (q2[ klm * q_dim + n ].dval <= toler) {
|
||||
goto L500;
|
||||
}
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE,"q2[klm1-1, n1-1] > *toler. %e\n",q2[ ( klm1 - 1 ) * q_dim + n1 - 1 ].dval);
|
||||
#endif
|
||||
*kode = 1;
|
||||
goto L590;
|
||||
}
|
||||
*kode = 0;
|
||||
goto L590;
|
||||
}
|
||||
if (iphase != 1 || q2[ klm * q_dim + n ].dval > toler) {
|
||||
kforce = 0;
|
||||
goto L240;
|
||||
}
|
||||
/* SET UP PHASE 2 COSTS. */
|
||||
L500:
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "Set up phase 2 costs %d\n", *iter);
|
||||
#endif
|
||||
iphase = 2;
|
||||
for (j = 0; j < nklm; ++j) {
|
||||
cu[ j ] = 0.;
|
||||
}
|
||||
/* L510: */
|
||||
for (j = n; j < nk; ++j) {
|
||||
cu[ j ] = 1.;
|
||||
}
|
||||
memcpy( (void *) &(cu[cu_dim]), (void *) &(cu[0]),
|
||||
(size_t) nklm * sizeof(LDBLE) );
|
||||
/* L520: */
|
||||
for (i = 0; i < klm; ++i) {
|
||||
ii = q2[ i * q_dim + n1 ].ival;
|
||||
if (ii <= 0) {
|
||||
if (iu[ cu_dim - ii - 1 ] == 0) {
|
||||
continue;
|
||||
}
|
||||
cu[ cu_dim - ii - 1 ] = 0.;
|
||||
} else {
|
||||
/* L530: */
|
||||
if (iu[ ii - 1 ] == 0) {
|
||||
continue;
|
||||
}
|
||||
cu[ ii - 1 ] = 0.;
|
||||
}
|
||||
/* L540: */
|
||||
++ia;
|
||||
/* switch row */
|
||||
memcpy( (void *) &(scratch[0]), (void *) &(q2[ ia * q_dim]),
|
||||
(size_t) n2 * sizeof(LDBLE) );
|
||||
memcpy( (void *) &(q2[ ia * q_dim ]), (void *) &(q2[ i * q_dim]),
|
||||
(size_t) n2 * sizeof(LDBLE) );
|
||||
memcpy( (void *) &(q2[ i * q_dim ]), (void *) &(scratch[ 0 ]),
|
||||
(size_t) n2 * sizeof(LDBLE) );
|
||||
/* L550: */
|
||||
}
|
||||
/* L560: */
|
||||
goto L160;
|
||||
|
||||
|
||||
/* PREPARE OUTPUT. */
|
||||
L590:
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L590\n");
|
||||
#endif
|
||||
sum = 0.;
|
||||
for (j = 0; j < n; ++j) {
|
||||
x[j] = 0.;
|
||||
}
|
||||
/* L600: */
|
||||
for (i = 0; i < klm; ++i) {
|
||||
res[i] = 0.;
|
||||
}
|
||||
/* L610: */
|
||||
for (i = 0; i < klm; ++i) {
|
||||
ii = q2[ i * q_dim + n1 ].ival;
|
||||
sn = 1.;
|
||||
if (ii < 0) {
|
||||
ii = -ii;
|
||||
sn = -1.;
|
||||
}
|
||||
if (ii <= n) {
|
||||
/* L620: */
|
||||
x[ii - 1] = sn * q2[ i * q_dim + n ].dval;
|
||||
} else {
|
||||
/* L630: */
|
||||
res[ii - n - 1] = sn * q2[ i * q_dim + n ].dval;
|
||||
if (ii >= n1 && ii <= nk ) {
|
||||
/* * DBLE(Q(I,N1)) */
|
||||
sum += q2[ i * q_dim + n ].dval;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* L640: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L640\n");
|
||||
#endif
|
||||
*error = sum;
|
||||
scratch = (double *) free_check_null (scratch);
|
||||
/*
|
||||
* Check calculation
|
||||
*/
|
||||
if ((check == 1) && (*kode == 0)) {
|
||||
check_toler = 10.*toler;
|
||||
/*
|
||||
* Check optimization constraints
|
||||
*/
|
||||
if (kode_arg == 1) {
|
||||
for (i = 0; i < k; i++) {
|
||||
if (res_arg[i] < 0.0) {
|
||||
if (res[i] > check_toler) {
|
||||
#ifdef CHECK_ERRORS
|
||||
output_msg(OUTPUT_MESSAGE, "\tCL1: optimization constraint not satisfied row %d, res %s, constraint %f.\n", row_name[row_back[i]], res[i], res_arg[i]);
|
||||
#endif
|
||||
*kode = 1;
|
||||
}
|
||||
} else if (res_arg[i] > 0.0) {
|
||||
if (res[i] < -check_toler) {
|
||||
#ifdef CHECK_ERRORS
|
||||
output_msg(OUTPUT_MESSAGE, "\tCL1: optimization constraint not satisfied row %s, res %e, constraint %f.\n", row_name[row_back[i]], res[i], res_arg[i]);
|
||||
#endif
|
||||
*kode = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Check equalities
|
||||
*/
|
||||
for (i = k; i < k + l; i++) {
|
||||
if (fabs(res[i]) > check_toler) {
|
||||
#ifdef CHECK_ERRORS
|
||||
output_msg(OUTPUT_MESSAGE, "\tCL1: equality constraint not satisfied row %s, res %e, tolerance %e.\n", row_name[row_back[i]], res[i], check_toler);
|
||||
#endif
|
||||
*kode = 1;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Check inequalities
|
||||
*/
|
||||
for (i = k + l; i < k + l + m; i++) {
|
||||
if (res[i] < -check_toler) {
|
||||
#ifdef CHECK_ERRORS
|
||||
output_msg(OUTPUT_MESSAGE, "\tCL1: inequality constraint not satisfied row %s, res %e, tolerance %e.\n", row_name[row_back[i]], res[i], check_toler);
|
||||
#endif
|
||||
*kode = 1;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Check dissolution/precipitation constraints
|
||||
*/
|
||||
if (kode_arg == 1) {
|
||||
for (i = 0; i < n; i++) {
|
||||
if (x_arg[i] < 0.0) {
|
||||
if (x[i] > check_toler) {
|
||||
#ifdef CHECK_ERRORS
|
||||
output_msg(OUTPUT_MESSAGE, "\tCL1: dis/pre constraint not satisfied column %s, x %e, constraint %f.\n", col_name[col_back[i]], x[i], x_arg[i]);
|
||||
#endif
|
||||
*kode = 1;
|
||||
}
|
||||
} else if (x_arg[i] > 0.0) {
|
||||
if (x[i] < -check_toler) {
|
||||
#ifdef CHECK_ERRORS
|
||||
output_msg(OUTPUT_MESSAGE, "\tCL1: dis/pre constraint not satisfied column %s, x %e, constraint %f.\n", col_name[col_back[i]], x[i], x_arg[i]);
|
||||
#endif
|
||||
*kode = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (*kode == 1) {
|
||||
output_msg(OUTPUT_MESSAGE, "\n\tCL1: Roundoff errors in optimization.\n\t Try using -multiple_precision in INVERSE_MODELING\n");
|
||||
}
|
||||
}
|
||||
if (check == 1) {
|
||||
x_arg = (double *) free_check_null(x_arg);
|
||||
res_arg = (double *) free_check_null(res_arg);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
974
cl1mp.cpp
974
cl1mp.cpp
@ -1,974 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <gmp.h>
|
||||
|
||||
/* must be defined here and in global.h */
|
||||
#if !defined(WIN32_MEMORY_DEBUG)
|
||||
#define USE_PHRQ_ALLOC
|
||||
#endif
|
||||
#include "phqalloc.h"
|
||||
#include "output.h"
|
||||
#include "phrqtype.h"
|
||||
|
||||
extern int max_row_count, max_column_count;
|
||||
static char const svnid[] = "$Id: cl1mp.c 78 2005-02-01 22:47:12Z dlpark $";
|
||||
|
||||
int cl1mp(int k, int l, int m, int n,
|
||||
int nklmd, int n2d,
|
||||
LDBLE *q_arg,
|
||||
int *kode, LDBLE toler,
|
||||
int *iter, LDBLE *x_arg, LDBLE *res_arg, LDBLE *error,
|
||||
LDBLE *cu_arg, int *iu, int *s, int check, LDBLE censor_arg);
|
||||
extern void *free_check_null(void *ptr);
|
||||
extern void malloc_error(void);
|
||||
|
||||
/* debug
|
||||
#define DEBUG_CL1
|
||||
#define CHECK_ERRORS
|
||||
*/
|
||||
|
||||
|
||||
int cl1mp(int k, int l, int m, int n,
|
||||
int nklmd, int n2d,
|
||||
LDBLE *q_arg,
|
||||
int *kode_arg, LDBLE toler_arg,
|
||||
int *iter, LDBLE *x_arg, LDBLE *res_arg, LDBLE *error_arg,
|
||||
LDBLE *cu_arg, int *iu, int *s, int check, LDBLE censor_arg)
|
||||
{
|
||||
/* System generated locals */
|
||||
union double_or_int {int ival; mpf_t dval;} *q2;
|
||||
|
||||
/* Local variables */
|
||||
static int nklm;
|
||||
static int iout, i, j;
|
||||
static int maxit, n1, n2;
|
||||
static int ia, ii, kk, in, nk, js;
|
||||
static int iphase, kforce;
|
||||
static int klm, jmn, nkl, jpn;
|
||||
static int klm1;
|
||||
static int *kode;
|
||||
int q_dim, cu_dim;
|
||||
int iswitch;
|
||||
mpf_t *q;
|
||||
mpf_t *x;
|
||||
mpf_t *res;
|
||||
mpf_t error;
|
||||
mpf_t *cu;
|
||||
mpf_t dummy, dummy1, sum, z, zu, zv, xmax, minus_one, toler, check_toler;
|
||||
/*mpf_t *scratch;*/
|
||||
mpf_t pivot, xmin, cuv, tpivot, sn;
|
||||
mpf_t zero;
|
||||
int censor;
|
||||
mpf_t censor_tol;
|
||||
/* THIS SUBROUTINE USES A MODIFICATION OF THE SIMPLEX */
|
||||
/* METHOD OF LINEAR PROGRAMMING TO CALCULATE AN L1 SOLUTION */
|
||||
/* TO A K BY N SYSTEM OF LINEAR EQUATIONS */
|
||||
/* AX=B */
|
||||
/* SUBJECT TO L LINEAR EQUALITY CONSTRAINTS */
|
||||
/* CX=D */
|
||||
/* AND M LINEAR INEQUALITY CONSTRAINTS */
|
||||
/* EX.LE.F. */
|
||||
/* DESCRIPTION OF PARAMETERS */
|
||||
/* K NUMBER OF ROWS OF THE MATRIX A (K.GE.1). */
|
||||
/* L NUMBER OF ROWS OF THE MATRIX C (L.GE.0). */
|
||||
/* M NUMBER OF ROWS OF THE MATRIX E (M.GE.0). */
|
||||
/* N NUMBER OF COLUMNS OF THE MATRICES A,C,E (N.GE.1). */
|
||||
/* KLMD SET TO AT LEAST K+L+M FOR ADJUSTABLE DIMENSIONS. */
|
||||
/* KLM2D SET TO AT LEAST K+L+M+2 FOR ADJUSTABLE DIMENSIONS. */
|
||||
/* NKLMD SET TO AT LEAST N+K+L+M FOR ADJUSTABLE DIMENSIONS. */
|
||||
/* N2D SET TO AT LEAST N+2 FOR ADJUSTABLE DIMENSIONS */
|
||||
/* Q TWO DIMENSIONAL REAL ARRAY WITH KLM2D ROWS AND */
|
||||
/* AT LEAST N2D COLUMNS. */
|
||||
/* ON ENTRY THE MATRICES A,C AND E, AND THE VECTORS */
|
||||
/* B,D AND F MUST BE STORED IN THE FIRST K+L+M ROWS */
|
||||
/* AND N+1 COLUMNS OF Q AS FOLLOWS */
|
||||
/* A B */
|
||||
/* Q = C D */
|
||||
/* E F */
|
||||
/* THESE VALUES ARE DESTROYED BY THE SUBROUTINE. */
|
||||
/* KODE A CODE USED ON ENTRY TO, AND EXIT */
|
||||
/* FROM, THE SUBROUTINE. */
|
||||
/* ON ENTRY, THIS SHOULD NORMALLY BE SET TO 0. */
|
||||
/* HOWEVER, IF CERTAIN NONNEGATIVITY CONSTRAINTS */
|
||||
/* ARE TO BE INCLUDED IMPLICITLY, RATHER THAN */
|
||||
/* EXPLICITLY IN THE CONSTRAINTS EX.LE.F, THEN KODE */
|
||||
/* SHOULD BE SET TO 1, AND THE NONNEGATIVITY */
|
||||
/* CONSTRAINTS INCLUDED IN THE ARRAYS X AND */
|
||||
/* RES (SEE BELOW). */
|
||||
/* ON EXIT, KODE HAS ONE OF THE */
|
||||
/* FOLLOWING VALUES */
|
||||
/* 0- OPTIMAL SOLUTION FOUND, */
|
||||
/* 1- NO FEASIBLE SOLUTION TO THE */
|
||||
/* CONSTRAINTS, */
|
||||
/* 2- CALCULATIONS TERMINATED */
|
||||
/* PREMATURELY DUE TO ROUNDING ERRORS, */
|
||||
/* 3- MAXIMUM NUMBER OF ITERATIONS REACHED. */
|
||||
/* TOLER A SMALL POSITIVE TOLERANCE. EMPIRICAL */
|
||||
/* EVIDENCE SUGGESTS TOLER = 10**(-D*2/3), */
|
||||
/* WHERE D REPRESENTS THE NUMBER OF DECIMAL */
|
||||
/* DIGITS OF ACCURACY AVAILABLE. ESSENTIALLY, */
|
||||
/* THE SUBROUTINE CANNOT DISTINGUISH BETWEEN ZERO */
|
||||
/* AND ANY QUANTITY WHOSE MAGNITUDE DOES NOT EXCEED */
|
||||
/* TOLER. IN PARTICULAR, IT WILL NOT PIVOT ON ANY */
|
||||
/* NUMBER WHOSE MAGNITUDE DOES NOT EXCEED TOLER. */
|
||||
/* ITER ON ENTRY ITER MUST CONTAIN AN UPPER BOUND ON */
|
||||
/* THE MAXIMUM NUMBER OF ITERATIONS ALLOWED. */
|
||||
/* A SUGGESTED VALUE IS 10*(K+L+M). ON EXIT ITER */
|
||||
/* GIVES THE NUMBER OF SIMPLEX ITERATIONS. */
|
||||
/* X ONE DIMENSIONAL REAL ARRAY OF SIZE AT LEAST N2D. */
|
||||
/* ON EXIT THIS ARRAY CONTAINS A */
|
||||
/* SOLUTION TO THE L1 PROBLEM. IF KODE=1 */
|
||||
/* ON ENTRY, THIS ARRAY IS ALSO USED TO INCLUDE */
|
||||
/* SIMPLE NONNEGATIVITY CONSTRAINTS ON THE */
|
||||
/* VARIABLES. THE VALUES -1, 0, OR 1 */
|
||||
/* FOR X(J) INDICATE THAT THE J-TH VARIABLE */
|
||||
/* IS RESTRICTED TO BE .LE.0, UNRESTRICTED, */
|
||||
/* OR .GE.0 RESPECTIVELY. */
|
||||
/* RES ONE DIMENSIONAL REAL ARRAY OF SIZE AT LEAST KLMD. */
|
||||
/* ON EXIT THIS CONTAINS THE RESIDUALS B-AX */
|
||||
/* IN THE FIRST K COMPONENTS, D-CX IN THE */
|
||||
/* NEXT L COMPONENTS (THESE WILL BE =0),AND */
|
||||
/* F-EX IN THE NEXT M COMPONENTS. IF KODE=1 ON */
|
||||
/* ENTRY, THIS ARRAY IS ALSO USED TO INCLUDE SIMPLE */
|
||||
/* NONNEGATIVITY CONSTRAINTS ON THE RESIDUALS */
|
||||
/* B-AX. THE VALUES -1, 0, OR 1 FOR RES(I) */
|
||||
/* INDICATE THAT THE I-TH RESIDUAL (1.LE.I.LE.K) IS */
|
||||
/* RESTRICTED TO BE .LE.0, UNRESTRICTED, OR .GE.0 */
|
||||
/* RESPECTIVELY. */
|
||||
/* ERROR ON EXIT, THIS GIVES THE MINIMUM SUM OF */
|
||||
/* ABSOLUTE VALUES OF THE RESIDUALS. */
|
||||
/* CU A TWO DIMENSIONAL REAL ARRAY WITH TWO ROWS AND */
|
||||
/* AT LEAST NKLMD COLUMNS USED FOR WORKSPACE. */
|
||||
/* IU A TWO DIMENSIONAL INTEGER ARRAY WITH TWO ROWS AND */
|
||||
/* AT LEAST NKLMD COLUMNS USED FOR WORKSPACE. */
|
||||
/* S INTEGER ARRAY OF SIZE AT LEAST KLMD, USED FOR */
|
||||
/* WORKSPACE. */
|
||||
/* DOUBLE PRECISION DBLE */
|
||||
/* REAL */
|
||||
|
||||
/* INITIALIZATION. */
|
||||
if (svnid == NULL) fprintf(stderr," ");
|
||||
/*
|
||||
* mp variables
|
||||
*/
|
||||
censor = 1;
|
||||
if (censor_arg == 0.0) censor = 0;
|
||||
mpf_set_default_prec(96);
|
||||
mpf_init(zero);
|
||||
mpf_init(dummy);
|
||||
mpf_init(dummy1);
|
||||
mpf_init_set_d(censor_tol, censor_arg);
|
||||
q = (mpf_t *) PHRQ_malloc((size_t) (max_row_count * max_column_count * sizeof(mpf_t)));
|
||||
if (q == NULL) malloc_error();
|
||||
for (i = 0; i < max_row_count*max_column_count; i++) {
|
||||
mpf_init_set_d(q[i], q_arg[i]);
|
||||
if (censor == 1) {
|
||||
if (mpf_cmp(q[ i ], zero) != 0) {
|
||||
mpf_abs(dummy1, q[ i ]);
|
||||
if (mpf_cmp(dummy1, censor_tol) <= 0) {
|
||||
mpf_set_si(q[ i ], 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
x = (mpf_t *) PHRQ_malloc((size_t) (n2d * sizeof(mpf_t)));
|
||||
if (x == NULL) malloc_error();
|
||||
for (i = 0; i < n2d; i++) {
|
||||
mpf_init_set_d (x[i], x_arg[i]);
|
||||
}
|
||||
res = (mpf_t *) PHRQ_malloc((size_t) ((k + l + m) * sizeof(mpf_t)));
|
||||
if (res == NULL) malloc_error();
|
||||
for (i = 0; i < k + l + m; i++) {
|
||||
mpf_init_set_d (res[i], res_arg[i]);
|
||||
}
|
||||
cu = (mpf_t *) PHRQ_malloc((size_t) (2*nklmd * sizeof(mpf_t)));
|
||||
if (cu == NULL) malloc_error();
|
||||
for (i = 0; i < 2*nklmd; i++) {
|
||||
mpf_init_set_d (cu[i], cu_arg[i]);
|
||||
}
|
||||
kode = (int *) PHRQ_malloc(sizeof(int));
|
||||
if (kode == NULL) malloc_error();
|
||||
*kode = *kode_arg;
|
||||
mpf_init(sum);
|
||||
mpf_init(error);
|
||||
mpf_init(z);
|
||||
mpf_init(zu);
|
||||
mpf_init(zv);
|
||||
mpf_init(xmax);
|
||||
mpf_init_set_si(minus_one, -1);
|
||||
mpf_init_set_d(toler, toler_arg);
|
||||
mpf_init_set_d(check_toler, toler_arg);
|
||||
mpf_init(pivot);
|
||||
mpf_init(xmin);
|
||||
mpf_init(cuv);
|
||||
mpf_init(tpivot);
|
||||
mpf_init(sn);
|
||||
/* Parameter adjustments */
|
||||
q_dim = n2d;
|
||||
q2 = (union double_or_int *) q;
|
||||
cu_dim = nklmd;
|
||||
|
||||
/* Function Body */
|
||||
maxit = *iter;
|
||||
n1 = n + 1;
|
||||
n2 = n + 2;
|
||||
nk = n + k;
|
||||
nkl = nk + l;
|
||||
klm = k + l + m;
|
||||
klm1 = klm + 1;
|
||||
nklm = n + klm;
|
||||
kforce = 1;
|
||||
*iter = 0;
|
||||
js = 0;
|
||||
ia = -1;
|
||||
/* Make scratch space */
|
||||
/*
|
||||
scratch = (LDBLE *) PHRQ_malloc( (size_t) nklmd * sizeof(LDBLE));
|
||||
if (scratch == NULL) malloc_error();
|
||||
for (i=0; i < nklmd; i++) {
|
||||
scratch[i] = 0.0;
|
||||
}
|
||||
*/
|
||||
/*
|
||||
scratch = (mpf_t *) PHRQ_malloc( (size_t) nklmd * sizeof(mpf_t));
|
||||
if (scratch == NULL) malloc_error();
|
||||
for (i=0; i < nklmd; i++) {
|
||||
mpf_init(scratch[i]);
|
||||
}
|
||||
*/
|
||||
/* SET UP LABELS IN Q. */
|
||||
for (j = 0; j < n; ++j) {
|
||||
q2[ klm1 * q_dim + j ].ival = j + 1;
|
||||
}
|
||||
/* L10: */
|
||||
for (i = 0; i < klm; ++i) {
|
||||
q2[ i * q_dim + n1 ].ival = n + i + 1;
|
||||
if (mpf_cmp_d(q2[ i * q_dim + n ].dval, 0.0) < 0) {
|
||||
for (j = 0; j < n1; ++j) {
|
||||
/* q2[ i * q_dim + j ].dval = -q2[ i * q_dim + j ].dval; */
|
||||
mpf_neg(q2[ i * q_dim + j ].dval, q2[ i * q_dim + j ].dval);
|
||||
}
|
||||
q2[ i * q_dim + n1 ].ival = -q2[ i * q_dim + n1 ].ival;
|
||||
/* L20: */
|
||||
}
|
||||
}
|
||||
/* L30: */
|
||||
/* SET UP PHASE 1 COSTS. */
|
||||
iphase = 2;
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "Set up phase 1 costs\n");
|
||||
#endif
|
||||
/* Zero first row of cu and iu */
|
||||
/*memcpy( (void *) &(cu[0]), (void *) &(scratch[0]), (size_t) nklm * sizeof(mpf_t) );*/
|
||||
for (j = 0; j < nklm; ++j) {
|
||||
mpf_set_si(cu[j], 0);
|
||||
iu[ j ] = 0;
|
||||
}
|
||||
/* L40: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L40\n");
|
||||
#endif
|
||||
if (l != 0) {
|
||||
for (j = nk; j < nkl; ++j) {
|
||||
mpf_set_si(cu[j], 1);
|
||||
/*cu[ j ] = 1.;*/
|
||||
iu[ j ] = 1;
|
||||
}
|
||||
/* L50: */
|
||||
iphase = 1;
|
||||
}
|
||||
|
||||
/* Copy first row of cu and iu to second row */
|
||||
/*memcpy( (void *) &(cu[cu_dim]), (void *) &(cu[0]), (size_t) nklm * sizeof(mpf_t) );*/
|
||||
for (i = 0; i < nklm; i++) {
|
||||
mpf_set(cu[cu_dim + i], cu[i]);
|
||||
}
|
||||
memcpy( (void *) &(iu[cu_dim]), (void *) &(iu[0]), (size_t) nklm * sizeof(int) );
|
||||
/* L60: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L60\n");
|
||||
#endif
|
||||
if (m != 0) {
|
||||
for (j = nkl; j < nklm; ++j) {
|
||||
/* cu[ cu_dim + j ] = 1.;*/
|
||||
mpf_set_si(cu[cu_dim + j], 1);
|
||||
iu[ cu_dim + j ] = 1;
|
||||
jmn = j - n;
|
||||
if (q2[ jmn * q_dim + n1 ].ival < 0) {
|
||||
iphase = 1;
|
||||
}
|
||||
}
|
||||
/* L70: */
|
||||
}
|
||||
/* L80: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L80\n");
|
||||
#endif
|
||||
if (*kode != 0) {
|
||||
for (j = 0; j < n; ++j) {
|
||||
/* if ( x[j] < 0.) { */
|
||||
if (mpf_cmp_si(x[j], 0) < 0) {
|
||||
/* L90: */
|
||||
/* cu[ j ] = 1.;*/
|
||||
mpf_set_si(cu[j], 1);
|
||||
iu[ j ] = 1;
|
||||
/* } else if (x[j] > 0.) {*/
|
||||
} else if (mpf_cmp_si(x[j], 0) > 0) {
|
||||
/* cu[ cu_dim + j ] = 1.; */
|
||||
mpf_set_si(cu[cu_dim + j], 1);
|
||||
iu[ cu_dim + j ] = 1;
|
||||
}
|
||||
}
|
||||
/* L110: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L110\n");
|
||||
#endif
|
||||
for (j = 0; j < k; ++j) {
|
||||
jpn = j + n;
|
||||
/* if (res[j] < 0.) { */
|
||||
if (mpf_cmp_si(res[j], 0) < 0) {
|
||||
/* L120: */
|
||||
/* cu[ jpn ] = 1.;*/
|
||||
mpf_set_si(cu[jpn], 1);
|
||||
iu[ jpn ] = 1;
|
||||
if (q2[ j * q_dim + n1 ].ival > 0) {
|
||||
iphase = 1;
|
||||
}
|
||||
/* } else if (res[j] > 0.) { */
|
||||
} else if (mpf_cmp_si(res[j], 0) > 0) {
|
||||
/* L130: */
|
||||
/* cu[ cu_dim + jpn ] = 1.;*/
|
||||
mpf_set_si(cu[cu_dim + jpn], 1);
|
||||
iu[ cu_dim + jpn ] = 1;
|
||||
if (q2[ j * q_dim + n1 ].ival < 0) {
|
||||
iphase = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* L140: */
|
||||
}
|
||||
/* L150: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L150\n");
|
||||
#endif
|
||||
if (iphase == 2) {
|
||||
goto L500;
|
||||
}
|
||||
/* COMPUTE THE MARGINAL COSTS. */
|
||||
L160:
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L160\n");
|
||||
#endif
|
||||
for (j = js; j < n1; ++j) {
|
||||
mpf_set_si(sum, 0);
|
||||
for (i = 0; i < klm; ++i) {
|
||||
ii = q2[ i * q_dim + n1 ].ival;
|
||||
if (ii < 0) {
|
||||
/* z = cu[ cu_dim - ii - 1 ];*/
|
||||
mpf_set(z, cu[ cu_dim - ii - 1 ]);
|
||||
} else {
|
||||
/*z = cu[ ii - 1 ];*/
|
||||
mpf_set(z, cu[ ii - 1 ]);
|
||||
}
|
||||
/*sum += q2[ i * q_dim + j ].dval * z;*/
|
||||
mpf_mul(dummy, q2[ i * q_dim + j ].dval, z);
|
||||
mpf_add(sum, sum, dummy);
|
||||
}
|
||||
/*q2[ klm * q_dim + j ].dval = sum;*/
|
||||
mpf_set(q2[ klm * q_dim + j ].dval, sum);
|
||||
}
|
||||
for (j = js; j < n; ++j) {
|
||||
ii = q2[ klm1 * q_dim + j].ival;
|
||||
if (ii < 0) {
|
||||
/*z = cu[ cu_dim - ii - 1 ];*/
|
||||
mpf_set(z, cu[ cu_dim - ii - 1 ]);
|
||||
} else {
|
||||
/*z = cu[ ii - 1 ];*/
|
||||
mpf_set(z, cu[ ii - 1 ]);
|
||||
}
|
||||
/*q2[ klm * q_dim + j ].dval -= z;*/
|
||||
mpf_sub(q2[ klm * q_dim + j ].dval, q2[ klm * q_dim + j ].dval, z);
|
||||
}
|
||||
/* DETERMINE THE VECTOR TO ENTER THE BASIS. */
|
||||
L240:
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L240, xmax %e\n", mpf_get_d(xmax));
|
||||
#endif
|
||||
/*xmax = 0.;*/
|
||||
mpf_set_si(xmax, 0);
|
||||
if (js >= n) {
|
||||
goto L490; /* test for optimality */
|
||||
}
|
||||
for (j = js; j < n; ++j) {
|
||||
/*zu = q2[ klm * q_dim + j ].dval;*/
|
||||
mpf_set(zu, q2[ klm * q_dim + j ].dval);
|
||||
ii = q2[ klm1 * q_dim + j ].ival;
|
||||
if (ii > 0) {
|
||||
/*zv = -zu - cu[ ii - 1 ] - cu[ cu_dim + ii - 1 ];*/
|
||||
mpf_mul(dummy, cu[ cu_dim + ii - 1 ], minus_one);
|
||||
mpf_sub(dummy, dummy, cu[ ii - 1 ]);
|
||||
mpf_sub(zv, dummy, zu);
|
||||
} else {
|
||||
ii = -ii;
|
||||
/* zv = zu; */
|
||||
mpf_set(zv, zu);
|
||||
/* zu = -zu - cu[ ii - 1 ] - cu[ cu_dim + ii - 1 ]; */
|
||||
mpf_mul(dummy, cu[ cu_dim + ii - 1 ], minus_one);
|
||||
mpf_sub(dummy, dummy, cu[ ii - 1 ]);
|
||||
mpf_sub(zu, dummy, zu);
|
||||
}
|
||||
/* L260 */
|
||||
if (kforce == 1 && ii > n) {
|
||||
continue;
|
||||
}
|
||||
/*if (iu[ ii - 1 ] != 1 && zu > xmax){*/
|
||||
if ((iu[ ii - 1 ] != 1) && (mpf_cmp(zu, xmax) > 0)) {
|
||||
/*xmax = zu;*/
|
||||
mpf_set(xmax, zu);
|
||||
in = j;
|
||||
}
|
||||
/* L270 */
|
||||
/*if (iu[ cu_dim + ii - 1 ] != 1 && zv > xmax ) {*/
|
||||
if ((iu[ cu_dim + ii - 1 ] != 1) && (mpf_cmp(zv, xmax) > 0)) {
|
||||
/*xmax = zv;*/
|
||||
mpf_set(xmax, zv);
|
||||
in = j;
|
||||
}
|
||||
}
|
||||
/* L280 */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L280 xmax %e, toler %e\n", mpf_get_d(xmax), mpf_get_d(toler));
|
||||
#endif
|
||||
/*if (xmax <= toler) {*/
|
||||
if (mpf_cmp(xmax, toler) <= 0) {
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "xmax before optimality test %e\n", mpf_get_d(xmax));
|
||||
#endif
|
||||
goto L490; /* test for optimality */
|
||||
}
|
||||
/*if (q2[ klm * q_dim + in ].dval != xmax) {*/
|
||||
if (mpf_cmp(q2[ klm * q_dim + in ].dval,xmax) != 0) {
|
||||
for (i = 0; i < klm1; ++i) {
|
||||
/*q2[ i * q_dim + in ].dval = -q2[ i * q_dim + in ].dval;*/
|
||||
mpf_neg(q2[ i * q_dim + in ].dval, q2[ i * q_dim + in ].dval);
|
||||
}
|
||||
q2[ klm1 * q_dim + in ].ival = -q2[ klm1 * q_dim + in ].ival;
|
||||
/* L290: */
|
||||
/*q2[ klm * q_dim + in ].dval = xmax;*/
|
||||
mpf_set(q2[ klm * q_dim + in ].dval, xmax);
|
||||
}
|
||||
/* DETERMINE THE VECTOR TO LEAVE THE BASIS. */
|
||||
if (iphase != 1 && ia != -1) {
|
||||
/*xmax = 0.;*/
|
||||
mpf_set_si(xmax, 0);
|
||||
/* find maximum absolute value in column "in" */
|
||||
for (i = 0; i <= ia; ++i) {
|
||||
/*z = fabs(q2[ i * q_dim + in ].dval);*/
|
||||
mpf_abs(z, q2[ i * q_dim + in ].dval);
|
||||
/*if (z > xmax) {*/
|
||||
if (mpf_cmp(z, xmax) > 0) {
|
||||
/*xmax = z;*/
|
||||
mpf_set(xmax, z);
|
||||
iout = i;
|
||||
}
|
||||
}
|
||||
/* L310: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L310, xmax %e\n", mpf_get_d(xmax));
|
||||
#endif
|
||||
/* switch row ia with row iout, use memcpy */
|
||||
/*if (xmax > toler) {*/
|
||||
if (mpf_cmp(xmax, toler) > 0) {
|
||||
/*
|
||||
memcpy( (void *) &(scratch[0]), (void *) &(q2[ ia * q_dim]),
|
||||
(size_t) n2 * sizeof(mpf_t) );
|
||||
memcpy( (void *) &(q2[ ia * q_dim ]), (void *) &(q2[ iout * q_dim]),
|
||||
(size_t) n2 * sizeof(mpf_t) );
|
||||
memcpy( (void *) &(q2[ iout * q_dim ]), (void *) &(scratch[ 0 ]),
|
||||
(size_t) n2 * sizeof(mpf_t) );
|
||||
*/
|
||||
for (i = 0; i < n1; i++) {
|
||||
mpf_set(dummy, q2[ ia * q_dim + i].dval);
|
||||
mpf_set(q2[ ia * q_dim + i].dval, q2[ iout * q_dim + i].dval);
|
||||
mpf_set(q2[ iout * q_dim + i].dval, dummy);
|
||||
}
|
||||
j = q2[ ia * q_dim + n1].ival;
|
||||
q2[ ia * q_dim + n1].ival = q2[ iout * q_dim + n1].ival;
|
||||
q2[ iout * q_dim + n1].ival = j;
|
||||
|
||||
/* L320: */
|
||||
/* set pivot to row ia, column in */
|
||||
iout = ia;
|
||||
--ia;
|
||||
/*pivot = q2[ iout * q_dim + in ].dval;*/
|
||||
mpf_set(pivot, q2[ iout * q_dim + in ].dval);
|
||||
goto L420; /* Gauss Jordan */
|
||||
}
|
||||
}
|
||||
/* L330: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L330, xmax %e\n", mpf_get_d(xmax));
|
||||
#endif
|
||||
kk = -1;
|
||||
/* divide column n1 by positive value in column "in" greater than toler */
|
||||
for (i = 0; i < klm; ++i) {
|
||||
/*z = q2[ i * q_dim + in ].dval;*/
|
||||
mpf_set(z, q2[ i * q_dim + in ].dval);
|
||||
/*if (z > toler) {*/
|
||||
if (mpf_cmp(z, toler) > 0) {
|
||||
++kk;
|
||||
/*res[kk] = q2[ i * q_dim + n ].dval / z;*/
|
||||
mpf_div(res[kk], q2[ i * q_dim + n ].dval, z);
|
||||
s[kk] = i;
|
||||
}
|
||||
}
|
||||
/* L340: */
|
||||
if (kk < 0) {
|
||||
output_msg(OUTPUT_MESSAGE, "kode = 2 in loop 340.\n");
|
||||
}
|
||||
L350:
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L350, xmax %e\n", mpf_get_d(xmax));
|
||||
#endif
|
||||
if (kk < 0) {
|
||||
/* no positive value found in L340 or bypass intermediate verticies */
|
||||
*kode = 2;
|
||||
goto L590;
|
||||
}
|
||||
/* L360: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L360, xmax %e\n", mpf_get_d(xmax));
|
||||
#endif
|
||||
/* find minimum residual */
|
||||
/*xmin = res[ 0 ];*/
|
||||
mpf_set(xmin, res[0]);
|
||||
iout = s[ 0 ];
|
||||
j = 0;
|
||||
if (kk != 0) {
|
||||
for (i = 1; i <= kk; ++i) {
|
||||
/*if (res[i] < xmin) {*/
|
||||
if (mpf_cmp(res[i], xmin) < 0) {
|
||||
j = i;
|
||||
/*xmin = res[i];*/
|
||||
mpf_set(xmin, res[i]);
|
||||
iout = s[i];
|
||||
}
|
||||
}
|
||||
/* L370: */
|
||||
/* put kk in position j */
|
||||
/*res[j] = res[kk];*/
|
||||
mpf_set(res[j], res[kk]);
|
||||
s[j] = s[kk];
|
||||
}
|
||||
/* L380: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L380 iout %d, xmin %e, xmax %e\n", iout, mpf_get_d(xmin), mpf_get_d(xmax));
|
||||
#endif
|
||||
--kk;
|
||||
/*pivot = q2[ iout * q_dim + in ].dval;*/
|
||||
mpf_set(pivot, q2[ iout * q_dim + in ].dval);
|
||||
ii = q2[ iout * q_dim + n1 ].ival;
|
||||
if (iphase != 1) {
|
||||
if (ii < 0) {
|
||||
/* L390: */
|
||||
if (iu[ - ii - 1 ] == 1) {
|
||||
goto L420;
|
||||
}
|
||||
} else {
|
||||
if (iu[ cu_dim + ii - 1 ] == 1) {
|
||||
goto L420;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* L400: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L400\n");
|
||||
#endif
|
||||
ii = abs(ii);
|
||||
/*cuv = cu[ ii - 1 ] + cu[ cu_dim + ii - 1];*/
|
||||
mpf_add(cuv, cu[ ii - 1 ], cu[ cu_dim + ii - 1]);
|
||||
/*if (q2[ klm * q_dim + in ].dval - pivot * cuv > toler) {*/
|
||||
mpf_mul(dummy, pivot, cuv);
|
||||
mpf_sub(dummy, q2[ klm * q_dim + in ].dval, dummy);
|
||||
if (mpf_cmp(dummy, toler) > 0) {
|
||||
/* BYPASS INTERMEDIATE VERTICES. */
|
||||
for (j = js; j < n1; ++j) {
|
||||
/*z = q2[ iout * q_dim + j ].dval;*/
|
||||
mpf_set(z, q2[ iout * q_dim + j ].dval);
|
||||
/*q2[ klm * q_dim + j ].dval -= z * cuv;*/
|
||||
mpf_mul(dummy1, z, cuv);
|
||||
mpf_sub(q2[ klm * q_dim + j ].dval, q2[ klm * q_dim + j ].dval, dummy1);
|
||||
|
||||
if (censor == 1) {
|
||||
if (mpf_cmp(q2[ klm * q_dim + j ].dval, zero) != 0) {
|
||||
mpf_abs(dummy1, q2[ klm * q_dim + j ].dval);
|
||||
if (mpf_cmp(dummy1, censor_tol) <= 0) {
|
||||
mpf_set_si(q2[ klm * q_dim + j ].dval, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*q2[ iout * q_dim + j ].dval = -z;*/
|
||||
mpf_neg(q2[ iout * q_dim + j ].dval, z);
|
||||
}
|
||||
/* L410: */
|
||||
q2[ iout * q_dim + n1 ].ival = -q2[ iout * q_dim + n1 ].ival;
|
||||
goto L350;
|
||||
}
|
||||
/* GAUSS-JORDAN ELIMINATION. */
|
||||
L420:
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "Gauss Jordon %d\n", *iter);
|
||||
#endif
|
||||
if (*iter >= maxit) {
|
||||
*kode = 3;
|
||||
goto L590;
|
||||
}
|
||||
/* L430: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L430\n");
|
||||
#endif
|
||||
++(*iter);
|
||||
for (j = js; j < n1; ++j) {
|
||||
if (j != in) {
|
||||
/*q2[ iout * q_dim + j ].dval /= pivot;*/
|
||||
mpf_div(q2[ iout * q_dim + j ].dval, q2[ iout * q_dim + j ].dval, pivot);
|
||||
}
|
||||
}
|
||||
/* L440: */
|
||||
for (j = js; j < n1; ++j) {
|
||||
if (j != in) {
|
||||
/*z = -q2[ iout * q_dim + j ].dval;*/
|
||||
mpf_neg(z, q2[ iout * q_dim + j ].dval);
|
||||
for (i = 0; i < klm1; ++i) {
|
||||
if (i != iout) {
|
||||
/*q2[ i * q_dim + j ].dval += z * q2[ i * q_dim + in ].dval;*/
|
||||
mpf_mul(dummy, z, q2[ i * q_dim + in ].dval);
|
||||
mpf_add(q2[ i * q_dim + j ].dval, q2[ i * q_dim + j ].dval, dummy);
|
||||
|
||||
if (censor == 1) {
|
||||
if (mpf_cmp(q2[ i * q_dim + j ].dval, zero) != 0) {
|
||||
mpf_abs(dummy1, q2[ i * q_dim + j ].dval);
|
||||
if (mpf_cmp(dummy1, censor_tol) <= 0) {
|
||||
mpf_set_si(q2[ i * q_dim + j ].dval, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* L450: */
|
||||
}
|
||||
}
|
||||
/* L460: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L460\n");
|
||||
#endif
|
||||
/*tpivot = -pivot;*/
|
||||
mpf_neg(tpivot, pivot);
|
||||
for (i = 0; i < klm1; ++i) {
|
||||
if (i != iout) {
|
||||
/*q2[ i * q_dim + in ].dval /= tpivot;*/
|
||||
mpf_div(q2[ i * q_dim + in ].dval, q2[ i * q_dim + in ].dval, tpivot);
|
||||
}
|
||||
}
|
||||
/* L470: */
|
||||
/*q2[ iout * q_dim + in ].dval = 1. / pivot;*/
|
||||
mpf_set_si(dummy, 1);
|
||||
mpf_div(q2[ iout * q_dim + in ].dval, dummy, pivot);
|
||||
ii = q2[ iout * q_dim + n1 ].ival;
|
||||
q2[ iout * q_dim + n1 ].ival = q2[ klm1 * q_dim + in ].ival;
|
||||
q2[ klm1 * q_dim + in ].ival = ii;
|
||||
ii = abs(ii);
|
||||
if (iu[ ii - 1 ] == 0 || iu[ cu_dim + ii - 1 ] == 0) {
|
||||
goto L240;
|
||||
}
|
||||
/* switch column */
|
||||
for (i = 0; i < klm1; ++i) {
|
||||
/*z = q2[ i * q_dim + in ].dval;*/
|
||||
mpf_set(z, q2[ i * q_dim + in ].dval);
|
||||
/*q2[ i * q_dim + in ].dval = q2[ i * q_dim + js ].dval;*/
|
||||
mpf_set(q2[ i * q_dim + in ].dval, q2[ i * q_dim + js ].dval);
|
||||
/*q2[ i * q_dim + js ].dval = z;*/
|
||||
mpf_set(q2[ i * q_dim + js ].dval, z);
|
||||
}
|
||||
i = q2[ klm1 * q_dim + in ].ival;
|
||||
q2[ klm1 * q_dim + in ].ival = q2[ klm1 * q_dim + js ].ival;
|
||||
q2[ klm1 * q_dim + js ].ival = i;
|
||||
/* L480: */
|
||||
++js;
|
||||
goto L240;
|
||||
/* TEST FOR OPTIMALITY. */
|
||||
L490:
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L490\n");
|
||||
#endif
|
||||
if (kforce == 0) {
|
||||
if (iphase == 1) {
|
||||
/*if (q2[ klm * q_dim + n ].dval <= toler) {*/
|
||||
if (mpf_cmp(q2[ klm * q_dim + n ].dval, toler) <= 0) {
|
||||
goto L500;
|
||||
}
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE,"q2[klm1-1, n1-1] > *toler. %e\n", mpf_get_d(q2[ ( klm1 - 1 ) * q_dim + n1 - 1 ].dval));
|
||||
#endif
|
||||
*kode = 1;
|
||||
goto L590;
|
||||
}
|
||||
*kode = 0;
|
||||
goto L590;
|
||||
}
|
||||
/*if (iphase != 1 || q2[ klm * q_dim + n ].dval > toler) {*/
|
||||
if ((iphase != 1) || (mpf_cmp(q2[ klm * q_dim + n ].dval, toler) > 0)) {
|
||||
kforce = 0;
|
||||
goto L240;
|
||||
}
|
||||
/* SET UP PHASE 2 COSTS. */
|
||||
L500:
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "Set up phase 2 costs %d\n", *iter);
|
||||
#endif
|
||||
iphase = 2;
|
||||
for (j = 0; j < nklm; ++j) {
|
||||
/*cu[ j ] = 0.;*/
|
||||
mpf_set_si(cu[j], 0);
|
||||
}
|
||||
/* L510: */
|
||||
for (j = n; j < nk; ++j) {
|
||||
/*cu[ j ] = 1.;*/
|
||||
mpf_set_si(cu[j], 1);
|
||||
}
|
||||
/*
|
||||
memcpy( (void *) &(cu[cu_dim]), (void *) &(cu[0]), (size_t) nklm * sizeof(LDBLE) );
|
||||
*/
|
||||
for (i = 0; i < nklm; i++) {
|
||||
mpf_set(cu[cu_dim + i], cu[i]);
|
||||
}
|
||||
|
||||
/* L520: */
|
||||
for (i = 0; i < klm; ++i) {
|
||||
ii = q2[ i * q_dim + n1 ].ival;
|
||||
if (ii <= 0) {
|
||||
if (iu[ cu_dim - ii - 1 ] == 0) {
|
||||
continue;
|
||||
}
|
||||
/*cu[ cu_dim - ii - 1 ] = 0.;*/
|
||||
mpf_set_si(cu[ cu_dim - ii - 1 ], 0);
|
||||
} else {
|
||||
/* L530: */
|
||||
if (iu[ ii - 1 ] == 0) {
|
||||
continue;
|
||||
}
|
||||
/*cu[ ii - 1 ] = 0.;*/
|
||||
mpf_set_si(cu[ ii - 1 ], 0);
|
||||
}
|
||||
/* L540: */
|
||||
++ia;
|
||||
/* switch row */
|
||||
/*
|
||||
memcpy( (void *) &(scratch[0]), (void *) &(q2[ ia * q_dim]),
|
||||
(size_t) n2 * sizeof(LDBLE) );
|
||||
memcpy( (void *) &(q2[ ia * q_dim ]), (void *) &(q2[ i * q_dim]),
|
||||
(size_t) n2 * sizeof(LDBLE) );
|
||||
memcpy( (void *) &(q2[ i * q_dim ]), (void *) &(scratch[ 0 ]),
|
||||
(size_t) n2 * sizeof(LDBLE) );
|
||||
*/
|
||||
for (iswitch = 0; iswitch < n1; iswitch++) {
|
||||
mpf_set(dummy, q2[ ia * q_dim + iswitch].dval);
|
||||
mpf_set(q2[ ia * q_dim + iswitch].dval, q2[ i * q_dim + iswitch].dval);
|
||||
mpf_set(q2[ i * q_dim + iswitch].dval, dummy);
|
||||
}
|
||||
iswitch = q2[ ia * q_dim + n1].ival;
|
||||
q2[ ia * q_dim + n1].ival = q2[ i * q_dim + n1].ival;
|
||||
q2[ i * q_dim + n1].ival = iswitch;
|
||||
/* L550: */
|
||||
}
|
||||
/* L560: */
|
||||
goto L160;
|
||||
|
||||
|
||||
/* PREPARE OUTPUT. */
|
||||
L590:
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L590\n");
|
||||
#endif
|
||||
/*sum = 0.;*/
|
||||
mpf_set_si(sum, 0);
|
||||
for (j = 0; j < n; ++j) {
|
||||
/*x[j] = 0.;*/
|
||||
mpf_set_si(x[j], 0);
|
||||
}
|
||||
/* L600: */
|
||||
for (i = 0; i < klm; ++i) {
|
||||
/*res[i] = 0.;*/
|
||||
mpf_set_si(res[i], 0);
|
||||
}
|
||||
/* L610: */
|
||||
for (i = 0; i < klm; ++i) {
|
||||
ii = q2[ i * q_dim + n1 ].ival;
|
||||
/*sn = 1.;*/
|
||||
mpf_set_si(sn, 1);
|
||||
if (ii < 0) {
|
||||
ii = -ii;
|
||||
/*sn = -1.;*/
|
||||
mpf_set_si(sn, -1);
|
||||
}
|
||||
if (ii <= n) {
|
||||
/* L620: */
|
||||
/*x[ii - 1] = sn * q2[ i * q_dim + n ].dval;*/
|
||||
mpf_mul(x[ii - 1], sn, q2[ i * q_dim + n ].dval);
|
||||
} else {
|
||||
/* L630: */
|
||||
/*res[ii - n - 1] = sn * q2[ i * q_dim + n ].dval;*/
|
||||
mpf_mul(res[ii - n - 1], sn, q2[ i * q_dim + n ].dval);
|
||||
if (ii >= n1 && ii <= nk ) {
|
||||
/* * DBLE(Q(I,N1)) */
|
||||
/*sum += q2[ i * q_dim + n ].dval;*/
|
||||
mpf_add(sum, sum, q2[ i * q_dim + n ].dval);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* L640: */
|
||||
#ifdef DEBUG_CL1
|
||||
output_msg(OUTPUT_MESSAGE, "L640\n");
|
||||
#endif
|
||||
/*
|
||||
* Check calculation
|
||||
*/
|
||||
mpf_set_si(dummy, 100);
|
||||
mpf_mul(check_toler, toler, dummy);
|
||||
if (check && *kode == 0) {
|
||||
/*
|
||||
* Check optimization constraints
|
||||
*/
|
||||
if (*kode_arg == 1) {
|
||||
for (i = 0; i < k; i++) {
|
||||
if (res_arg[i] < 0.0) {
|
||||
mpf_sub(dummy, res[i], check_toler);
|
||||
mpf_set_si(dummy1, 0);
|
||||
if (mpf_cmp(dummy,dummy1) > 0) {
|
||||
#ifdef CHECK_ERRORS
|
||||
output_msg(OUTPUT_MESSAGE, "\tCL1MP: optimization constraint not satisfied row %d, res %e, constraint %f.\n", i, mpf_get_d(res[i]), res_arg[i]);
|
||||
#endif
|
||||
*kode = 1;
|
||||
}
|
||||
} else if (res_arg[i] > 0.0) {
|
||||
mpf_add(dummy, res[i], check_toler);
|
||||
mpf_set_si(dummy1, 0);
|
||||
if (mpf_cmp(dummy,dummy1) < 0) {
|
||||
#ifdef CHECK_ERRORS
|
||||
output_msg(OUTPUT_MESSAGE, "\tCL1MP: optimization constraint not satisfied row %d, res %e, constraint %f.\n", i, mpf_get_d(res[i]), res_arg[i]);
|
||||
#endif
|
||||
*kode = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Check equalities
|
||||
*/
|
||||
for (i = k; i < k + l; i++) {
|
||||
mpf_abs(dummy, res[i]);
|
||||
if (mpf_cmp(dummy, check_toler) > 0) {
|
||||
#ifdef CHECK_ERRORS
|
||||
output_msg(OUTPUT_MESSAGE, "\tCL1MP: equality constraint not satisfied row %d, res %e, tolerance %e.\n", i, mpf_get_d(res[i]), mpf_get_d(check_toler));
|
||||
#endif
|
||||
|
||||
*kode = 1;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Check inequalities
|
||||
*/
|
||||
for (i = k + l; i < k + l + m; i++) {
|
||||
mpf_neg(dummy, check_toler);
|
||||
if (mpf_cmp(res[i], dummy) < 0) {
|
||||
#ifdef CHECK_ERRORS
|
||||
output_msg(OUTPUT_MESSAGE, "\tCL1MP: inequality constraint not satisfied row %d, res %e, tolerance %e.\n", i, mpf_get_d(res[i]), mpf_get_d(check_toler));
|
||||
#endif
|
||||
*kode = 1;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Check dissolution/precipitation constraints
|
||||
*/
|
||||
if (*kode_arg == 1) {
|
||||
for (i = 0; i < n; i++) {
|
||||
if (x_arg[i] < 0.0) {
|
||||
mpf_sub(dummy, x[i], check_toler);
|
||||
mpf_set_si(dummy1, 0);
|
||||
if (mpf_cmp(dummy,dummy1) > 0) {
|
||||
#ifdef CHECK_ERRORS
|
||||
output_msg(OUTPUT_MESSAGE, "\tCL1MP: dis/pre constraint not satisfied column %d, x %e, constraint %f.\n", i, mpf_get_d(x[i]), x_arg[i]);
|
||||
#endif
|
||||
*kode = 1;
|
||||
}
|
||||
} else if (x_arg[i] > 0.0) {
|
||||
mpf_add(dummy, x[i], check_toler);
|
||||
mpf_set_si(dummy1, 0);
|
||||
if (mpf_cmp(dummy,dummy1) < 0) {
|
||||
#ifdef CHECK_ERRORS
|
||||
output_msg(OUTPUT_MESSAGE, "\tCL1MP: dis/pre constraint not satisfied column %d, x %e, constraint %f.\n", i, mpf_get_d(x[i]), x_arg[i]);
|
||||
#endif
|
||||
*kode = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (*kode == 1) {
|
||||
output_msg(OUTPUT_MESSAGE, "\n\tCL1MP: Roundoff errors in optimization.\n\t Deleting model.\n");
|
||||
}
|
||||
}
|
||||
/*
|
||||
* set return variables
|
||||
*/
|
||||
/**error = sum;*/
|
||||
mpf_set(error, sum);
|
||||
*error_arg = mpf_get_d(error);
|
||||
*kode_arg = *kode;
|
||||
for (i = 0; i < n2d; i++) {
|
||||
x_arg[i] = mpf_get_d (x[i]);
|
||||
}
|
||||
for (i = 0; i < k + l + m; i++) {
|
||||
res_arg[i] = mpf_get_d (res[i]);
|
||||
}
|
||||
|
||||
/*scratch = free_check_null (scratch);*/
|
||||
|
||||
for (i = 0; i < max_row_count*max_column_count; i++) {
|
||||
mpf_clear(q[i]);
|
||||
}
|
||||
q = (mpf_t *) free_check_null(q);
|
||||
for (i = 0; i < n2d; i++) {
|
||||
mpf_clear (x[i]);
|
||||
}
|
||||
x = (mpf_t *) free_check_null(x);
|
||||
for (i = 0; i < k + l + m; i++) {
|
||||
mpf_clear (res[i]);
|
||||
}
|
||||
res = (mpf_t *) free_check_null(res);
|
||||
for (i = 0; i < 2*nklmd; i++) {
|
||||
mpf_clear (cu[i]);
|
||||
}
|
||||
cu = (mpf_t *) free_check_null(cu);
|
||||
mpf_clear(dummy);
|
||||
mpf_clear(dummy1);
|
||||
mpf_clear(sum);
|
||||
mpf_clear(error);
|
||||
mpf_clear(z);
|
||||
mpf_clear(zu);
|
||||
mpf_clear(zv);
|
||||
mpf_clear(xmax);
|
||||
mpf_clear(minus_one);
|
||||
mpf_clear(toler);
|
||||
mpf_clear(check_toler);
|
||||
mpf_clear(pivot);
|
||||
mpf_clear(xmin);
|
||||
mpf_clear(cuv);
|
||||
mpf_clear(tpivot);
|
||||
mpf_clear(sn);
|
||||
mpf_clear(censor_tol);
|
||||
kode = (int *) free_check_null(kode);
|
||||
return 0;
|
||||
}
|
||||
473
cvdense.cpp
473
cvdense.cpp
@ -1,473 +0,0 @@
|
||||
/*******************************************************************
|
||||
* *
|
||||
* File : cvdense.c *
|
||||
* Programmers : Scott D. Cohen, Alan C. Hindmarsh, and *
|
||||
* Radu Serban @ LLNL *
|
||||
* Version of : 26 June 2002 *
|
||||
*-----------------------------------------------------------------*
|
||||
* Copyright (c) 2002, The Regents of the University of California *
|
||||
* Produced at the Lawrence Livermore National Laboratory *
|
||||
* All rights reserved *
|
||||
* For details, see sundials/cvode/LICENSE *
|
||||
*-----------------------------------------------------------------*
|
||||
* This is the implementation file for the CVODE dense linear *
|
||||
* solver, CVDENSE. *
|
||||
* *
|
||||
*******************************************************************/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "cvdense.h"
|
||||
#include "cvode.h"
|
||||
#include "dense.h"
|
||||
#include "sundialstypes.h"
|
||||
#include "nvector.h"
|
||||
#include "sundialsmath.h"
|
||||
#include "output.h"
|
||||
#include "phqalloc.h"
|
||||
/* WARNING don't include any headers below here */
|
||||
#define malloc PHRQ_malloc
|
||||
|
||||
static char const svnid[] = "$Id: cvdense.c 78 2005-02-01 22:47:12Z dlpark $";
|
||||
|
||||
/* Error Messages */
|
||||
|
||||
#define CVDENSE "CVDense/CVReInitDense-- "
|
||||
|
||||
#define MSG_CVMEM_NULL CVDENSE "CVode Memory is NULL.\n\n"
|
||||
|
||||
#define MSG_MEM_FAIL CVDENSE "A memory request failed.\n\n"
|
||||
|
||||
#define MSG_WRONG_NVEC CVDENSE "Incompatible NVECTOR implementation.\n\n"
|
||||
|
||||
/* Other Constants */
|
||||
|
||||
#define MIN_INC_MULT RCONST(1000.0)
|
||||
#define ZERO RCONST(0.0)
|
||||
#define ONE RCONST(1.0)
|
||||
#define TWO RCONST(2.0)
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* *
|
||||
* Types : CVDenseMemRec, CVDenseMem *
|
||||
*----------------------------------------------------------------*
|
||||
* The type CVDenseMem is pointer to a CVDenseMemRec. This *
|
||||
* structure contains CVDense solver-specific data. *
|
||||
* *
|
||||
******************************************************************/
|
||||
|
||||
typedef struct {
|
||||
|
||||
CVDenseJacFn d_jac; /* jac = Jacobian routine to be called */
|
||||
|
||||
DenseMat d_M; /* M = I - gamma J, gamma = h / l1 */
|
||||
|
||||
integertype *d_pivots; /* pivots = pivot array for PM = LU */
|
||||
|
||||
DenseMat d_savedJ; /* savedJ = old Jacobian */
|
||||
|
||||
long int d_nstlj; /* nstlj = nst at last Jacobian eval. */
|
||||
|
||||
long int d_nje; /* nje = no. of calls to jac */
|
||||
|
||||
void *d_J_data; /* J_data is passed to jac */
|
||||
|
||||
} CVDenseMemRec, *CVDenseMem;
|
||||
|
||||
|
||||
/* CVDENSE linit, lsetup, lsolve, lfree, and DQJac routines */
|
||||
|
||||
static int CVDenseInit(CVodeMem cv_mem);
|
||||
|
||||
static int CVDenseSetup(CVodeMem cv_mem, int convfail, N_Vector ypred,
|
||||
N_Vector fpred, booleantype *jcurPtr, N_Vector vtemp1,
|
||||
N_Vector vtemp2, N_Vector vtemp3);
|
||||
|
||||
static int CVDenseSolve(CVodeMem cv_mem, N_Vector b, N_Vector ycur,
|
||||
N_Vector fcur);
|
||||
|
||||
static void CVDenseFree(CVodeMem cv_mem);
|
||||
|
||||
static void CVDenseDQJac(integertype N, DenseMat J, RhsFn f, void *f_data,
|
||||
realtype t, N_Vector y, N_Vector fy, N_Vector ewt,
|
||||
realtype h, realtype uround, void *jac_data,
|
||||
long int *nfePtr, N_Vector vtemp1,
|
||||
N_Vector vtemp2, N_Vector vtemp3);
|
||||
|
||||
|
||||
/*************** CVDenseDQJac ****************************************
|
||||
|
||||
This routine generates a dense difference quotient approximation to
|
||||
the Jacobian of f(t,y). It assumes that a dense matrix of type
|
||||
DenseMat is stored column-wise, and that elements within each column
|
||||
are contiguous. The address of the jth column of J is obtained via
|
||||
the macro DENSE_COL and an N_Vector with the jth column as the
|
||||
component array is created using N_VMake and N_VSetData. Finally, the
|
||||
actual computation of the jth column of the Jacobian is done with a
|
||||
call to N_VLinearSum.
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
static void CVDenseDQJac(integertype N, DenseMat J, RhsFn f, void *f_data,
|
||||
realtype tn, N_Vector y, N_Vector fy, N_Vector ewt,
|
||||
realtype h, realtype uround, void *jac_data,
|
||||
long int *nfePtr, N_Vector vtemp1,
|
||||
N_Vector vtemp2, N_Vector vtemp3)
|
||||
{
|
||||
realtype fnorm, minInc, inc, inc_inv, yjsaved, srur;
|
||||
realtype *y_data, *ewt_data;
|
||||
N_Vector ftemp, jthCol;
|
||||
M_Env machEnv;
|
||||
integertype j;
|
||||
|
||||
if (svnid == NULL) fprintf(stderr," ");
|
||||
machEnv = y->menv; /* Get machine environment */
|
||||
|
||||
ftemp = vtemp1; /* Rename work vector for use as f vector value */
|
||||
|
||||
/* Obtain pointers to the data for ewt, y */
|
||||
ewt_data = N_VGetData(ewt);
|
||||
y_data = N_VGetData(y);
|
||||
|
||||
/* Set minimum increment based on uround and norm of f */
|
||||
srur = RSqrt(uround);
|
||||
fnorm = N_VWrmsNorm(fy, ewt);
|
||||
minInc = (fnorm != ZERO) ?
|
||||
(MIN_INC_MULT * ABS(h) * uround * N * fnorm) : ONE;
|
||||
|
||||
jthCol = N_VMake(N, y_data, machEnv); /* j loop overwrites this data address */
|
||||
|
||||
/* This is the only for loop for 0..N-1 in CVODE */
|
||||
for (j = 0; j < N; j++) {
|
||||
|
||||
/* Generate the jth col of J(tn,y) */
|
||||
|
||||
N_VSetData(DENSE_COL(J,j), jthCol);
|
||||
yjsaved = y_data[j];
|
||||
inc = MAX(srur*ABS(yjsaved), minInc/ewt_data[j]);
|
||||
y_data[j] += inc;
|
||||
f(N, tn, y, ftemp, f_data);
|
||||
inc_inv = ONE/inc;
|
||||
N_VLinearSum(inc_inv, ftemp, -inc_inv, fy, jthCol);
|
||||
y_data[j] = yjsaved;
|
||||
}
|
||||
|
||||
N_VDispose(jthCol);
|
||||
|
||||
/* Increment counter nfe = *nfePtr */
|
||||
*nfePtr += N;
|
||||
}
|
||||
|
||||
|
||||
/* Readability Replacements */
|
||||
|
||||
#define N (cv_mem->cv_N)
|
||||
#define lmm (cv_mem->cv_lmm)
|
||||
#define f (cv_mem->cv_f)
|
||||
#define f_data (cv_mem->cv_f_data)
|
||||
#define uround (cv_mem->cv_uround)
|
||||
#define nst (cv_mem->cv_nst)
|
||||
#define tn (cv_mem->cv_tn)
|
||||
#define h (cv_mem->cv_h)
|
||||
#define gamma (cv_mem->cv_gamma)
|
||||
#define gammap (cv_mem->cv_gammap)
|
||||
#define gamrat (cv_mem->cv_gamrat)
|
||||
#define ewt (cv_mem->cv_ewt)
|
||||
#define nfe (cv_mem->cv_nfe)
|
||||
#define errfp (cv_mem->cv_errfp)
|
||||
#define iopt (cv_mem->cv_iopt)
|
||||
#define linit (cv_mem->cv_linit)
|
||||
#define lsetup (cv_mem->cv_lsetup)
|
||||
#define lsolve (cv_mem->cv_lsolve)
|
||||
#define lfree (cv_mem->cv_lfree)
|
||||
#define lmem (cv_mem->cv_lmem)
|
||||
#define setupNonNull (cv_mem->cv_setupNonNull)
|
||||
#define machenv (cv_mem->cv_machenv)
|
||||
|
||||
#define jac (cvdense_mem->d_jac)
|
||||
#define M (cvdense_mem->d_M)
|
||||
#define pivots (cvdense_mem->d_pivots)
|
||||
#define savedJ (cvdense_mem->d_savedJ)
|
||||
#define nstlj (cvdense_mem->d_nstlj)
|
||||
#define nje (cvdense_mem->d_nje)
|
||||
#define J_data (cvdense_mem->d_J_data)
|
||||
|
||||
|
||||
/*************** CVDense *********************************************
|
||||
|
||||
This routine initializes the memory record and sets various function
|
||||
fields specific to the dense linear solver module. CVDense first
|
||||
calls the existing lfree routine if this is not NULL. Then it sets
|
||||
the cv_linit, cv_lsetup, cv_lsolve, cv_lfree fields in (*cvode_mem)
|
||||
to be CVDenseInit, CVDenseSetup, CVDenseSolve, and CVDenseFree,
|
||||
respectively. It allocates memory for a structure of type
|
||||
CVDenseMemRec and sets the cv_lmem field in (*cvode_mem) to the
|
||||
address of this structure. It sets setupNonNull in (*cvode_mem) to
|
||||
TRUE, the d_J_data field in CVDenseMemRec to be the input
|
||||
parameter jac_data, and the d_jac field to be:
|
||||
(1) the input parameter djac if djac != NULL or
|
||||
(2) CVDenseDQJac if djac == NULL.
|
||||
Finally, it allocates memory for M, savedJ, and pivots.
|
||||
The return value is SUCCESS = 0, or LMEM_FAIL = -1.
|
||||
|
||||
NOTE: The dense linear solver assumes a serial implementation
|
||||
of the NVECTOR package. Therefore, CVDense will first
|
||||
test for compatible a compatible N_Vector internal
|
||||
representation by checking (1) the machine environment
|
||||
ID tag and (2) that the functions N_VMake, N_VDispose,
|
||||
N_VGetData, and N_VSetData are implemented.
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
int CVDense(void *cvode_mem, CVDenseJacFn djac, void *jac_data)
|
||||
{
|
||||
CVodeMem cv_mem;
|
||||
CVDenseMem cvdense_mem;
|
||||
|
||||
/* Return immediately if cvode_mem is NULL */
|
||||
cv_mem = (CVodeMem) cvode_mem;
|
||||
if (cv_mem == NULL) { /* CVode reports this error */
|
||||
output_msg(OUTPUT_CVODE, MSG_CVMEM_NULL);
|
||||
return(LMEM_FAIL);
|
||||
}
|
||||
|
||||
/* Test if the NVECTOR package is compatible with the DENSE solver */
|
||||
if ((strcmp(machenv->tag,"serial")) ||
|
||||
machenv->ops->nvmake == NULL ||
|
||||
machenv->ops->nvdispose == NULL ||
|
||||
machenv->ops->nvgetdata == NULL ||
|
||||
machenv->ops->nvsetdata == NULL) {
|
||||
output_msg(OUTPUT_CVODE, MSG_WRONG_NVEC);
|
||||
return(LMEM_FAIL);
|
||||
}
|
||||
|
||||
if (lfree !=NULL) lfree(cv_mem);
|
||||
|
||||
/* Set four main function fields in cv_mem */
|
||||
linit = CVDenseInit;
|
||||
lsetup = CVDenseSetup;
|
||||
lsolve = CVDenseSolve;
|
||||
lfree = CVDenseFree;
|
||||
|
||||
/* Get memory for CVDenseMemRec */
|
||||
lmem = cvdense_mem = (CVDenseMem) malloc(sizeof(CVDenseMemRec));
|
||||
if (cvdense_mem == NULL) {
|
||||
output_msg(OUTPUT_CVODE, MSG_MEM_FAIL);
|
||||
return(LMEM_FAIL);
|
||||
}
|
||||
|
||||
/* Set Jacobian routine field, J_data, and setupNonNull */
|
||||
if (djac == NULL) {
|
||||
jac = CVDenseDQJac;
|
||||
} else {
|
||||
jac = djac;
|
||||
}
|
||||
J_data = jac_data;
|
||||
setupNonNull = TRUE;
|
||||
|
||||
/* Allocate memory for M, savedJ, and pivot array */
|
||||
|
||||
M = DenseAllocMat(N);
|
||||
if (M == NULL) {
|
||||
output_msg(OUTPUT_CVODE, MSG_MEM_FAIL);
|
||||
return(LMEM_FAIL);
|
||||
}
|
||||
savedJ = DenseAllocMat(N);
|
||||
if (savedJ == NULL) {
|
||||
output_msg(OUTPUT_CVODE, MSG_MEM_FAIL);
|
||||
DenseFreeMat(M);
|
||||
return(LMEM_FAIL);
|
||||
}
|
||||
pivots = DenseAllocPiv(N);
|
||||
if (pivots == NULL) {
|
||||
output_msg(OUTPUT_CVODE, MSG_MEM_FAIL);
|
||||
DenseFreeMat(M);
|
||||
DenseFreeMat(savedJ);
|
||||
return(LMEM_FAIL);
|
||||
}
|
||||
|
||||
return(SUCCESS);
|
||||
}
|
||||
|
||||
/*************** CVReInitDense****************************************
|
||||
|
||||
This routine resets the link between the main CVODE module and the
|
||||
dense linear solver module CVDENSE. No memory freeing or allocation
|
||||
operations are done, as the existing linear solver memory is assumed
|
||||
sufficient. All other initializations are the same as in CVDense.
|
||||
The return value is SUCCESS = 0, or LMEM_FAIL = -1.
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
int CVReInitDense(void *cvode_mem, CVDenseJacFn djac, void *jac_data)
|
||||
{
|
||||
CVodeMem cv_mem;
|
||||
CVDenseMem cvdense_mem;
|
||||
|
||||
/* Return immediately if cvode_mem is NULL */
|
||||
cv_mem = (CVodeMem) cvode_mem;
|
||||
if (cv_mem == NULL) { /* CVode reports this error */
|
||||
output_msg(OUTPUT_CVODE, MSG_CVMEM_NULL);
|
||||
return(LMEM_FAIL);
|
||||
}
|
||||
|
||||
/* Test if the NVECTOR package is compatible with the DENSE solver */
|
||||
if ((strcmp(machenv->tag,"serial")) ||
|
||||
machenv->ops->nvmake == NULL ||
|
||||
machenv->ops->nvdispose == NULL ||
|
||||
machenv->ops->nvgetdata == NULL ||
|
||||
machenv->ops->nvsetdata == NULL) {
|
||||
output_msg(OUTPUT_CVODE, MSG_WRONG_NVEC);
|
||||
return(LMEM_FAIL);
|
||||
}
|
||||
|
||||
cvdense_mem = (CVDenseMem) lmem; /* Use existing linear solver memory pointer */
|
||||
|
||||
/* Set four main function fields in cv_mem */
|
||||
linit = CVDenseInit;
|
||||
lsetup = CVDenseSetup;
|
||||
lsolve = CVDenseSolve;
|
||||
lfree = CVDenseFree;
|
||||
|
||||
/* Set Jacobian routine field, J_data, and setupNonNull */
|
||||
if (djac == NULL) {
|
||||
jac = CVDenseDQJac;
|
||||
} else {
|
||||
jac = djac;
|
||||
}
|
||||
J_data = jac_data;
|
||||
setupNonNull = TRUE;
|
||||
|
||||
return(SUCCESS);
|
||||
}
|
||||
|
||||
/*************** CVDenseInit *****************************************
|
||||
|
||||
This routine does remaining initializations specific to the dense
|
||||
linear solver.
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
static int CVDenseInit(CVodeMem cv_mem)
|
||||
{
|
||||
CVDenseMem cvdense_mem;
|
||||
cvdense_mem = (CVDenseMem) lmem;
|
||||
|
||||
/* Initialize nje and nstlj, and set workspace lengths */
|
||||
|
||||
nje = 0;
|
||||
if (iopt != NULL) {
|
||||
iopt[DENSE_NJE] = nje;
|
||||
iopt[DENSE_LRW] = 2*N*N;
|
||||
iopt[DENSE_LIW] = N;
|
||||
}
|
||||
nstlj = 0;
|
||||
|
||||
return(LINIT_OK);
|
||||
}
|
||||
|
||||
/*************** CVDenseSetup ****************************************
|
||||
|
||||
This routine does the setup operations for the dense linear solver.
|
||||
It makes a decision whether or not to call the Jacobian evaluation
|
||||
routine based on various state variables, and if not it uses the
|
||||
saved copy. In any case, it constructs the Newton matrix
|
||||
M = I - gamma*J, updates counters, and calls the dense LU
|
||||
factorization routine.
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
static int CVDenseSetup(CVodeMem cv_mem, int convfail, N_Vector ypred,
|
||||
N_Vector fpred, booleantype *jcurPtr,
|
||||
N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3)
|
||||
{
|
||||
booleantype jbad, jok;
|
||||
realtype dgamma;
|
||||
integertype ier;
|
||||
CVDenseMem cvdense_mem;
|
||||
|
||||
cvdense_mem = (CVDenseMem) lmem;
|
||||
|
||||
/* Use nst, gamma/gammap, and convfail to set J eval. flag jok */
|
||||
|
||||
dgamma = ABS((gamma/gammap) - ONE);
|
||||
jbad = (nst == 0) || (nst > nstlj + CVD_MSBJ) ||
|
||||
((convfail == FAIL_BAD_J) && (dgamma < CVD_DGMAX)) ||
|
||||
(convfail == FAIL_OTHER);
|
||||
jok = !jbad;
|
||||
|
||||
if (jok) {
|
||||
/* If jok = TRUE, use saved copy of J */
|
||||
*jcurPtr = FALSE;
|
||||
DenseCopy(savedJ, M);
|
||||
} else {
|
||||
/* If jok = FALSE, call jac routine for new J value */
|
||||
nje++;
|
||||
if (iopt != NULL) iopt[DENSE_NJE] = nje;
|
||||
nstlj = nst;
|
||||
*jcurPtr = TRUE;
|
||||
DenseZero(M);
|
||||
jac(N, M, f, f_data, tn, ypred, fpred, ewt, h,
|
||||
uround, J_data, &nfe, vtemp1, vtemp2, vtemp3);
|
||||
DenseCopy(M, savedJ);
|
||||
}
|
||||
|
||||
/* Scale and add I to get M = I - gamma*J */
|
||||
DenseScale(-gamma, M);
|
||||
DenseAddI(M);
|
||||
|
||||
/* Do LU factorization of M */
|
||||
ier = DenseFactor(M, pivots);
|
||||
|
||||
/* Return 0 if the LU was complete; otherwise return 1 */
|
||||
if (ier > 0) return(1);
|
||||
return(0);
|
||||
}
|
||||
|
||||
/*************** CVDenseSolve ****************************************
|
||||
|
||||
This routine handles the solve operation for the dense linear solver
|
||||
by calling the dense backsolve routine. The returned value is 0.
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
static int CVDenseSolve(CVodeMem cv_mem, N_Vector b, N_Vector ycur,
|
||||
N_Vector fcur)
|
||||
{
|
||||
CVDenseMem cvdense_mem;
|
||||
realtype *bd;
|
||||
|
||||
cvdense_mem = (CVDenseMem) lmem;
|
||||
|
||||
bd = N_VGetData(b);
|
||||
DenseBacksolve(M, pivots, bd);
|
||||
N_VSetData(bd, b);
|
||||
|
||||
/* If BDF, scale the correction to account for change in gamma */
|
||||
if ((lmm == BDF) && (gamrat != ONE)) {
|
||||
N_VScale(TWO/(ONE + gamrat), b, b);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
/*************** CVDenseFree *****************************************
|
||||
|
||||
This routine frees memory specific to the dense linear solver.
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
static void CVDenseFree(CVodeMem cv_mem)
|
||||
{
|
||||
CVDenseMem cvdense_mem;
|
||||
|
||||
cvdense_mem = (CVDenseMem) lmem;
|
||||
|
||||
DenseFreeMat(M);
|
||||
DenseFreeMat(savedJ);
|
||||
DenseFreePiv(pivots);
|
||||
free(cvdense_mem);
|
||||
}
|
||||
114
dense.cpp
114
dense.cpp
@ -1,114 +0,0 @@
|
||||
/*******************************************************************
|
||||
* *
|
||||
* File : dense.c *
|
||||
* Programmers : Scott D. Cohen, Alan C. Hindmarsh, and *
|
||||
* Radu Serban @ LLNL *
|
||||
* Version of : 26 June 2002 *
|
||||
*-----------------------------------------------------------------*
|
||||
* Copyright (c) 2002, The Regents of the University of California *
|
||||
* Produced at the Lawrence Livermore National Laboratory *
|
||||
* All rights reserved *
|
||||
* For details, see sundials/shared/LICENSE *
|
||||
*-----------------------------------------------------------------*
|
||||
* This is the implementation file for a generic DENSE linear *
|
||||
* solver package. *
|
||||
* *
|
||||
*******************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "sundialstypes.h"
|
||||
#include "sundialsmath.h"
|
||||
#include "dense.h"
|
||||
#include "smalldense.h"
|
||||
#include "output.h"
|
||||
#include "phqalloc.h"
|
||||
/* WARNING don't include any headers below here */
|
||||
#define malloc PHRQ_malloc
|
||||
static char const svnid[] = "$Id: dense.c 78 2005-02-01 22:47:12Z dlpark $";
|
||||
|
||||
#define ZERO RCONST(0.0)
|
||||
#define ONE RCONST(1.0)
|
||||
|
||||
|
||||
/* Implementation */
|
||||
|
||||
|
||||
DenseMat DenseAllocMat(integertype N)
|
||||
{
|
||||
DenseMat A;
|
||||
|
||||
if (svnid == NULL) fprintf(stderr," ");
|
||||
if (N <= 0) return(NULL);
|
||||
|
||||
A = (DenseMat) malloc(sizeof *A);
|
||||
if (A==NULL) return (NULL);
|
||||
|
||||
A->data = denalloc(N);
|
||||
if (A->data == NULL) {
|
||||
free(A);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
A->size = N;
|
||||
|
||||
return(A);
|
||||
}
|
||||
|
||||
|
||||
integertype *DenseAllocPiv(integertype N)
|
||||
{
|
||||
if (N <= 0) return(NULL);
|
||||
|
||||
return((integertype *) malloc(N * sizeof(integertype)));
|
||||
}
|
||||
|
||||
|
||||
integertype DenseFactor(DenseMat A, integertype *p)
|
||||
{
|
||||
return(gefa(A->data, A->size, p));
|
||||
}
|
||||
|
||||
|
||||
void DenseBacksolve(DenseMat A, integertype *p, realtype *b)
|
||||
{
|
||||
gesl(A->data, A->size, p, b);
|
||||
}
|
||||
|
||||
|
||||
void DenseZero(DenseMat A)
|
||||
{
|
||||
denzero(A->data, A->size);
|
||||
}
|
||||
|
||||
void DenseCopy(DenseMat A, DenseMat B)
|
||||
{
|
||||
dencopy(A->data, B->data, A->size);
|
||||
}
|
||||
|
||||
void DenseScale(realtype c, DenseMat A)
|
||||
{
|
||||
denscale(c, A->data, A->size);
|
||||
}
|
||||
|
||||
void DenseAddI(DenseMat A)
|
||||
{
|
||||
denaddI(A->data, A->size);
|
||||
}
|
||||
|
||||
void DenseFreeMat(DenseMat A)
|
||||
{
|
||||
denfree(A->data);
|
||||
free(A);
|
||||
}
|
||||
|
||||
void DenseFreePiv(integertype *p)
|
||||
{
|
||||
free(p);
|
||||
}
|
||||
|
||||
void DensePrint(DenseMat A)
|
||||
{
|
||||
denprint(A->data, A->size);
|
||||
}
|
||||
|
||||
298
dense.h
298
dense.h
@ -1,298 +0,0 @@
|
||||
/*******************************************************************
|
||||
* *
|
||||
* File : dense.h *
|
||||
* Programmers : Scott D. Cohen, Alan C. Hindmarsh, and *
|
||||
* Radu Serban @ LLNL *
|
||||
* Version of : 26 June 2002 *
|
||||
*-----------------------------------------------------------------*
|
||||
* Copyright (c) 2002, The Regents of the University of California *
|
||||
* Produced at the Lawrence Livermore National Laboratory *
|
||||
* All rights reserved *
|
||||
* For details, see sundials/shared/LICENSE *
|
||||
*-----------------------------------------------------------------*
|
||||
* This is the header file for a generic DENSE linear solver *
|
||||
* package. The routines listed in this file all use type *
|
||||
* DenseMat, defined below, for matrices. These routines in turn *
|
||||
* call routines in the smalldense.h/smalldense.c module, which *
|
||||
* use the type realtype** for matrices. This separation allows *
|
||||
* for possible modifications in which matrices of type DenseMat *
|
||||
* may not be stored contiguously, while small matrices can still *
|
||||
* be treated with the routines in smalldense. *
|
||||
* *
|
||||
* Routines that work with the type DenseMat begin with "Dense". *
|
||||
* The DenseAllocMat function allocates a dense matrix for use in *
|
||||
* the other DenseMat routines listed in this file. Matrix *
|
||||
* storage details are given in the documentation for the type *
|
||||
* DenseMat. The DenseAllocPiv function allocates memory for *
|
||||
* pivot information. The storage allocated by DenseAllocMat and *
|
||||
* DenseAllocPiv is deallocated by the routines DenseFreeMat and *
|
||||
* DenseFreePiv, respectively. The DenseFactor and DenseBacksolve *
|
||||
* routines perform the actual solution of a dense linear system. *
|
||||
* *
|
||||
* Routines that work with realtype** begin with "den" (except for *
|
||||
* the factor and solve routines which are called gefa and gesl, *
|
||||
* respectively). The underlying matrix storage is described in *
|
||||
* the documentation for denalloc in smalldense.h *
|
||||
* *
|
||||
*******************************************************************/
|
||||
#ifdef PHREEQC_IDENT
|
||||
static char const svniddense[] = "$Id$";
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus /* wrapper to enable C++ usage */
|
||||
extern "C" {
|
||||
#endif
|
||||
#ifndef _dense_h
|
||||
#define _dense_h
|
||||
|
||||
|
||||
#include "sundialstypes.h"
|
||||
#include "smalldense.h"
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* *
|
||||
* Type: DenseMat *
|
||||
*----------------------------------------------------------------*
|
||||
* The type DenseMat is defined to be a pointer to a structure *
|
||||
* with a size and a data field. The size field indicates the *
|
||||
* number of columns (== number of rows) of a dense matrix, while *
|
||||
* the data field is a two dimensional array used for component *
|
||||
* storage. The elements of a dense matrix are stored columnwise *
|
||||
* (i.e columns are stored one on top of the other in memory). If *
|
||||
* A is of type DenseMat, then the (i,j)th element of A (with *
|
||||
* 0 <= i,j <= size-1) is given by the expression (A->data)[j][i] *
|
||||
* or by the expression (A->data)[0][j*n+i]. The macros below *
|
||||
* allow a user to access efficiently individual matrix *
|
||||
* elements without writing out explicit data structure *
|
||||
* references and without knowing too much about the underlying *
|
||||
* element storage. The only storage assumption needed is that *
|
||||
* elements are stored columnwise and that a pointer to the jth *
|
||||
* column of elements can be obtained via the DENSE_COL macro. *
|
||||
* Users should use these macros whenever possible. *
|
||||
* *
|
||||
******************************************************************/
|
||||
|
||||
typedef struct _DenseMat {
|
||||
integertype size;
|
||||
realtype **data;
|
||||
} *DenseMat;
|
||||
|
||||
|
||||
/* DenseMat accessor macros */
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* *
|
||||
* Macro : DENSE_ELEM *
|
||||
* Usage : DENSE_ELEM(A,i,j) = a_ij; OR *
|
||||
* a_ij = DENSE_ELEM(A,i,j); *
|
||||
*----------------------------------------------------------------*
|
||||
* DENSE_ELEM(A,i,j) references the (i,j)th element of the N by N *
|
||||
* DenseMat A, 0 <= i,j <= N-1. *
|
||||
* *
|
||||
******************************************************************/
|
||||
|
||||
#define DENSE_ELEM(A,i,j) ((A->data)[j][i])
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* *
|
||||
* Macro : DENSE_COL *
|
||||
* Usage : col_j = DENSE_COL(A,j); *
|
||||
*----------------------------------------------------------------*
|
||||
* DENSE_COL(A,j) references the jth column of the N by N *
|
||||
* DenseMat A, 0 <= j <= N-1. The type of the expression *
|
||||
* DENSE_COL(A,j) is realtype *. After the assignment in the usage*
|
||||
* above, col_j may be treated as an array indexed from 0 to N-1. *
|
||||
* The (i,j)th element of A is referenced by col_j[i]. *
|
||||
* *
|
||||
******************************************************************/
|
||||
|
||||
#define DENSE_COL(A,j) ((A->data)[j])
|
||||
|
||||
|
||||
/* Functions that use the DenseMat representation for a dense matrix */
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* *
|
||||
* Function : DenseAllocMat *
|
||||
* Usage : A = DenseAllocMat(N); *
|
||||
* if (A == NULL) ... memory request failed *
|
||||
*----------------------------------------------------------------*
|
||||
* DenseAllocMat allocates memory for an N by N dense matrix and *
|
||||
* returns the storage allocated (type DenseMat). DenseAllocMat *
|
||||
* returns NULL if the request for matrix storage cannot be *
|
||||
* satisfied. See the above documentation for the type DenseMat *
|
||||
* for matrix storage details. *
|
||||
* *
|
||||
******************************************************************/
|
||||
|
||||
DenseMat DenseAllocMat(integertype N);
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* *
|
||||
* Function : DenseAllocPiv *
|
||||
* Usage : p = DenseAllocPiv(N); *
|
||||
* if (p == NULL) ... memory request failed *
|
||||
*----------------------------------------------------------------*
|
||||
* DenseAllocPiv allocates memory for pivot information to be *
|
||||
* filled in by the DenseFactor routine during the factorization *
|
||||
* of an N by N dense matrix. The underlying type for pivot *
|
||||
* information is an array of N integers and this routine returns *
|
||||
* the pointer to the memory it allocates. If the request for *
|
||||
* pivot storage cannot be satisfied, DenseAllocPiv returns NULL. *
|
||||
* *
|
||||
******************************************************************/
|
||||
|
||||
integertype *DenseAllocPiv(integertype N);
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* *
|
||||
* Function : DenseFactor *
|
||||
* Usage : ier = DenseFactor(A, p); *
|
||||
* if (ier != 0) ... A is singular *
|
||||
*----------------------------------------------------------------*
|
||||
* DenseFactor performs the LU factorization of the N by N dense *
|
||||
* matrix A. This is done using standard Gaussian elimination *
|
||||
* with partial pivoting. *
|
||||
* *
|
||||
* A successful LU factorization leaves the matrix A and the *
|
||||
* pivot array p with the following information: *
|
||||
* *
|
||||
* (1) p[k] contains the row number of the pivot element chosen *
|
||||
* at the beginning of elimination step k, k=0, 1, ..., N-1. *
|
||||
* *
|
||||
* (2) If the unique LU factorization of A is given by PA = LU, *
|
||||
* where P is a permutation matrix, L is a lower triangular *
|
||||
* matrix with all 1's on the diagonal, and U is an upper *
|
||||
* triangular matrix, then the upper triangular part of A *
|
||||
* (including its diagonal) contains U and the strictly lower *
|
||||
* triangular part of A contains the multipliers, I-L. *
|
||||
* *
|
||||
* DenseFactor returns 0 if successful. Otherwise it encountered *
|
||||
* a zero diagonal element during the factorization. In this case *
|
||||
* it returns the column index (numbered from one) at which *
|
||||
* it encountered the zero. *
|
||||
* *
|
||||
******************************************************************/
|
||||
|
||||
integertype DenseFactor(DenseMat A, integertype *p);
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* *
|
||||
* Function : DenseBacksolve *
|
||||
* Usage : DenseBacksolve(A, p, b); *
|
||||
*----------------------------------------------------------------*
|
||||
* DenseBacksolve solves the N-dimensional system A x = b using *
|
||||
* the LU factorization in A and the pivot information in p *
|
||||
* computed in DenseFactor. The solution x is returned in b. This *
|
||||
* routine cannot fail if the corresponding call to DenseFactor *
|
||||
* did not fail. *
|
||||
* *
|
||||
******************************************************************/
|
||||
|
||||
void DenseBacksolve(DenseMat A, integertype *p, realtype *b);
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* *
|
||||
* Function : DenseZero *
|
||||
* Usage : DenseZero(A); *
|
||||
*----------------------------------------------------------------*
|
||||
* DenseZero sets all the elements of the N by N matrix A to 0.0. *
|
||||
* *
|
||||
******************************************************************/
|
||||
|
||||
void DenseZero(DenseMat A);
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* *
|
||||
* Function : DenseCopy *
|
||||
* Usage : DenseCopy(A, B); *
|
||||
*----------------------------------------------------------------*
|
||||
* DenseCopy copies the contents of the N by N matrix A into the *
|
||||
* N by N matrix B. *
|
||||
* *
|
||||
******************************************************************/
|
||||
|
||||
void DenseCopy(DenseMat A, DenseMat B);
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* *
|
||||
* Function: DenseScale *
|
||||
* Usage : DenseScale(c, A); *
|
||||
*----------------------------------------------------------------*
|
||||
* DenseScale scales the elements of the N by N matrix A by the *
|
||||
* constant c and stores the result back in A. *
|
||||
* *
|
||||
******************************************************************/
|
||||
|
||||
void DenseScale(realtype c, DenseMat A);
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* *
|
||||
* Function : DenseAddI *
|
||||
* Usage : DenseAddI(A); *
|
||||
*----------------------------------------------------------------*
|
||||
* DenseAddI adds the identity matrix to A and stores the result *
|
||||
* back in A. *
|
||||
* *
|
||||
******************************************************************/
|
||||
|
||||
void DenseAddI(DenseMat A);
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* *
|
||||
* Function : DenseFreeMat *
|
||||
* Usage : DenseFreeMat(A); *
|
||||
*----------------------------------------------------------------*
|
||||
* DenseFreeMat frees the memory allocated by DenseAllocMat for *
|
||||
* the N by N matrix A. *
|
||||
* *
|
||||
******************************************************************/
|
||||
|
||||
void DenseFreeMat(DenseMat A);
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* *
|
||||
* Function : DenseFreePiv *
|
||||
* Usage : DenseFreePiv(p); *
|
||||
*----------------------------------------------------------------*
|
||||
* DenseFreePiv frees the memory allocated by DenseAllocPiv for *
|
||||
* the pivot information array p. *
|
||||
* *
|
||||
******************************************************************/
|
||||
|
||||
void DenseFreePiv(integertype *p);
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* *
|
||||
* Function : DensePrint *
|
||||
* Usage : DensePrint(A); *
|
||||
*----------------------------------------------------------------*
|
||||
* This routine prints the N by N dense matrix A to standard *
|
||||
* output as it would normally appear on paper. It is intended *
|
||||
* as a debugging tool with small values of N. The elements are *
|
||||
* printed using the %g option. A blank line is printed before *
|
||||
* and after the matrix. *
|
||||
* *
|
||||
******************************************************************/
|
||||
|
||||
void DensePrint(DenseMat A);
|
||||
|
||||
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
349
dw.cpp
349
dw.cpp
@ -1,349 +0,0 @@
|
||||
#define EXTERNAL extern
|
||||
#include "global.h"
|
||||
#include "phrqproto.h"
|
||||
#include "output.h"
|
||||
#define PITZER_EXTERNAL extern
|
||||
#include "pitzer.h"
|
||||
|
||||
static int BB (double T);
|
||||
static double PS (double T);
|
||||
static double VLEST (double T);
|
||||
static int DFIND (double *DOUT, double P, double D, double T);
|
||||
static int QQ (double T, double D);
|
||||
static double BASE (double D);
|
||||
|
||||
/* COMMON /QQQQ/ */
|
||||
static double Q0,Q5;
|
||||
/* COMMON /ACONST/ */
|
||||
static double GASCON=0.461522e0, TZ=647.073e0, AA=1.e0;
|
||||
static double Z, DZ, Y;
|
||||
/* COMMON /ELLCON/ */
|
||||
static double G1=11.e0,G2=44.333333333333e0,GF=3.5e0;
|
||||
static double B1, B2, B1T, B2T, B1TT, B2TT;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int DW (double T)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
C
|
||||
C SUBROUTINE TO CALCULATE THE DENSITY OF WATER AS A FUNCTION OF
|
||||
C TEMPERATURE. T IS IN KELVIN, P IS IN PASCALS, DW0 IS IN G/CM^3
|
||||
C
|
||||
C FROM L. HAAR, J. S. GALLAGHER, AND G. S. KELL, (1984)
|
||||
C
|
||||
*/
|
||||
{
|
||||
double FP = 9.869232667e0, P, DGSS, D;
|
||||
|
||||
BB (T);
|
||||
P=1.0e0/FP;
|
||||
if (T > 373.149e0) P=PS(T);
|
||||
DGSS=P/T/.4e0;
|
||||
if (T < TZ) {
|
||||
DGSS=1.0e0/(VLEST(T));
|
||||
}
|
||||
DFIND (&D,P,DGSS,T);
|
||||
DW0=D;
|
||||
VP=P*FP;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
static int BB (double T)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
|
||||
C
|
||||
C THIS SUBROUTINE CALCULATES THE B'S NEEDED FOR FUNCTION DW.
|
||||
C THE B'S CALCULATED HERE ARE IN CM3/G.
|
||||
C
|
||||
C FROM L. HAAR, J. S. GALLAGHER, AND G. S. KELL, (1984)
|
||||
C
|
||||
*/
|
||||
{
|
||||
double V[11];
|
||||
int I;
|
||||
/* COMMON /BCONST/ */
|
||||
double P[11]={0, 0.7478629e0, -.3540782e0, 0.e0, 0e0, .007159876e0, 0.e0,
|
||||
-.003528426e0, 0., 0., 0.};
|
||||
double Q[11]={0, 1.1278334e0,0.e0,-.5944001e0,-5.010996e0,0.e0,.63684256e0,
|
||||
0., 0., 0., 0.};
|
||||
|
||||
V[1]=1.0;
|
||||
for (I = 2; I <= 10; I++) {
|
||||
V[I]=V[I-1]*TZ/T;
|
||||
}
|
||||
B1=P[1]+P[2]*log(1.e0/V[2]);
|
||||
B2=Q[1];
|
||||
B1T=P[2]*V[2]/TZ;
|
||||
B2T=0.e0;
|
||||
B1TT=0.e0;
|
||||
B2TT=0.e0;
|
||||
for (I = 3; I <= 10; I++) {
|
||||
B1=B1+P[I]*V[I-1];
|
||||
B2=B2+Q[I]*V[I-1];
|
||||
B1T=B1T-(I-2)*P[I]*V[I-1]/T;
|
||||
B2T=B2T-(I-2)*Q[I]*V[I-1]/T;
|
||||
B1TT=B1TT+P[I]*(I-2)*(I-2)*V[I-1]/T/T;
|
||||
B2TT=B2TT+Q[I]*(I-2)*(I-2)*V[I-1]/T/T;
|
||||
}
|
||||
B1TT=B1TT-B1T/T;
|
||||
B2TT=B2TT-B2T/T;
|
||||
return OK;
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
static double PS (double T)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
C
|
||||
C THIS FUNCTION CALCULATES AN APPROXIMATION TO THE VAPOR PRESSURE, P
|
||||
C AS A FUNCTION OF THE INPUT TEMPERATURE. THE VAPOR PRESSURE
|
||||
C CALCULATED AGREES WITH THE VAPOR PRESSURE PREDICTED BY THE SURFACE
|
||||
C TO WITHIN .02% TO WITHIN A DEGREE OR SO OF THE CRITICAL TEMPERATUR
|
||||
C AND CAN SERVE AS AN INITIAL GUESS FOR FURTHER REFINEMENT BY
|
||||
C IMPOSING THE CONDITION THAT GL=GV.
|
||||
C
|
||||
C FROM L. HAAR, J. S. GALLAGHER, AND G. S. KELL, (1984)
|
||||
C
|
||||
*/
|
||||
{
|
||||
double A[9]={0, -7.8889166e0,2.5514255e0,-6.716169e0,
|
||||
33.239495e0,-105.38479e0,174.35319e0,-148.39348e0,
|
||||
48.631602e0};
|
||||
double PL, V, W, B, Z, Q;
|
||||
int I;
|
||||
if(T <= 314.e0) {
|
||||
PL=6.3573118e0-8858.843e0/T+607.56335e0*pow(T,-.6e0);
|
||||
return (.1e0*exp(PL));
|
||||
}
|
||||
V=T/647.25e0;
|
||||
W=fabs(1.e0-V);
|
||||
B=0.e0;
|
||||
for (I = 1; I <= 8; I++) {
|
||||
Z=I;
|
||||
B=B+A[I]*pow(W,((Z+1.e0)/2.e0));
|
||||
}
|
||||
Q=B/V;
|
||||
return (22.093e0*exp(Q));
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
static double VLEST (double T)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
C
|
||||
C FROM L. HAAR, J. S. GALLAGHER, AND G. S. KELL, (1984)
|
||||
C
|
||||
*/
|
||||
{
|
||||
double A=-1.59259e1,B=6.57886e-2,C=-1.12666e-4,D=7.33191e-8,
|
||||
E=1.60229e3,F=2.88572e0,G=650.0e0;
|
||||
|
||||
return (A+B*T+C*T*T+D*T*T*T+E/T+F/(G-T));
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
static int DFIND (double *DOUT, double P, double D, double T)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
C
|
||||
C ROUTINE TO FIND DENSITY CORRESPONDING TO INPUT PRESSURE P(MPA), AN
|
||||
C TEMPERATURE T(K), USING INITIAL GUESS DENSITY D(G/CM3). THE OUTPUT
|
||||
C DENSITY IS IN G/CM3.
|
||||
C
|
||||
C FROM L. HAAR, J. S. GALLAGHER, AND G. S. KELL, (1984)
|
||||
C
|
||||
*/
|
||||
{
|
||||
int L;
|
||||
double DD, RT, PP_dfind, DPD, DPDX, DP, X;
|
||||
/* double DD, RT, PP, DPD, DPDX, DP, X; */
|
||||
|
||||
DD=D;
|
||||
RT=GASCON*T;
|
||||
if(DD <= 0.e0) DD=1.e-8;
|
||||
if(DD > 1.9e0) DD=1.9e0;
|
||||
L=0;
|
||||
for (L=1; L <= 30; L++) {
|
||||
if(DD <= 0.e0) DD=1.e-8;
|
||||
if(DD > 1.9e0) DD=1.9e0;
|
||||
QQ(T,DD);
|
||||
PP_dfind = RT*DD*BASE(DD)+Q0;
|
||||
DPD=RT*(Z+Y*DZ)+Q5;
|
||||
/*
|
||||
C
|
||||
C THE FOLLOWING 3 LINES CHECK FOR NEGATIVE DP/DRHO, AND IF SO ASSUME
|
||||
C GUESS TO BE IN 2-PHASE REGION, AND CORRECT GUESS ACCORDINGLY.
|
||||
C
|
||||
*/
|
||||
if(DPD <= 0.e0) {
|
||||
if(D >= .2967e0) DD=DD*1.02e0;
|
||||
if(D < .2967e0) DD=DD*.98e0;
|
||||
if(L <= 10) continue;
|
||||
} else {
|
||||
/* 13 */
|
||||
DPDX=DPD*1.1e0;
|
||||
if(DPDX < 0.1e0) DPDX=0.1e0;
|
||||
DP=fabs(1.e0-PP_dfind/P);
|
||||
if(DP < 1.e-8) break;
|
||||
if(D > .3e0 && DP < 1.e-7) break;
|
||||
if(D > .7e0 && DP < 1.e-6) break;
|
||||
X=(P-PP_dfind)/DPDX;
|
||||
if(fabs(X) > .1e0) X=X*.1e0/fabs(X);
|
||||
DD=DD+X;
|
||||
if(DD < 0.e0) DD=1.e-8;
|
||||
}
|
||||
}
|
||||
if (L > 30) error_msg("In subroutine DFIND", STOP);
|
||||
/* 20 CONTINUE */
|
||||
*DOUT=DD;
|
||||
return OK;
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
static int QQ (double T, double D)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
C
|
||||
C THIS ROUTINE CALCULATES, FOR A GIVEN T(K) AND D(G/CM3), THE RESIDUL
|
||||
C CONTRIBUTIONS TO: PRESSURE (Q), DP/DRHO (Q5)
|
||||
C THIS SUBROUTINE IS USED IN DENSITY OF WATER CALCULATION.
|
||||
C
|
||||
C FROM L. HAAR, J. S. GALLAGHER, AND G. S. KELL, (1984)
|
||||
C
|
||||
*/
|
||||
{
|
||||
/* COMMON /NCONST/ */
|
||||
double G[41]={0,-.53062968529023e3,.22744901424408e4,.78779333020687e3
|
||||
,-.69830527374994e2,.17863832875422e5,-.39514731563338e5
|
||||
,.33803884280753e5,-.13855050202703e5,-.25637436613260e6
|
||||
,.48212575981415e6,-.34183016969660e6, .12223156417448e6
|
||||
,.11797433655832e7,-.21734810110373e7, .10829952168620e7
|
||||
,-.25441998064049e6,-.31377774947767e7,.52911910757704e7
|
||||
,-.13802577177877e7,-.25109914369001e6, .46561826115608e7
|
||||
,-.72752773275387e7,.41774246148294e6,.14016358244614e7
|
||||
,-.31555231392127e7,.47929666384584e7,.40912664781209e6
|
||||
,-.13626369388386e7, .69625220862664e6,-.10834900096447e7
|
||||
,-.22722827401688e6,.38365486000660e6,.68833257944332e4
|
||||
,.21757245522644e5,-.26627944829770e4,-.70730418082074e5
|
||||
,-.225e0,-1.68e0,.055e0,-93.0e0};
|
||||
/*int II[41]={0,4*0,4*1,4*2,4*3,4*4,4*5,4*6,4*8,2*2,0,4,3*2,4};*/
|
||||
int II[41]={0, 0,0,0,0, 1,1,1,1, 2,2,2,2, 3,3,3,3, 4,4,4,4, 5,5,5,5, 6,6,6,6, 8,8,8,8, 2,2, 0,4, 2,2,2,4};
|
||||
/*int JJ[41]={0,2,3,5,7,2,3,5,7,2,3,5,7,2,3,5,7,2,3,5,7,2,3,5,7,2,3,5,7,2,3,5,7,1,3*4,0,2,0,0};*/
|
||||
int JJ[41]={0,2,3,5,7,2,3,5,7,2,3,5,7,2,3,5,7,2,3,5,7,2,3,5,7,2,3,5,7,2,3,5,7,1,4,4,4,0,2,0,0};
|
||||
int NC=36;
|
||||
/* COMMON /ADDCON/ */
|
||||
double ATZ[5]={0,64.e1,64.e1,641.6e0,27.e1},ADZ[5]={0,.319e0,.319e0,.319e0,1.55e0},
|
||||
AAT[5]={0,2.e4,2.e4,4.e4,25.e0}, AAD[5]={0,34.e0,4.e1,3.e1,1.05e3};
|
||||
double *QZT;
|
||||
double QR[12],QT[11] /*, QZT[10]*/;
|
||||
/*EQUIVALENCE (QT(2),QZT(1))*/
|
||||
|
||||
double E, Q10, Q20, V, QP, DDZ, DEL, EX1, DEX, ATT, TX,
|
||||
TAU, EX2, TEX, QM, FCT, Q5T;
|
||||
int I, K, L, J, KM;
|
||||
QZT = &(QT[1]);
|
||||
QR[1]=0.e0;
|
||||
Q5=0.e0;
|
||||
Q0=0.e0;
|
||||
E=exp(-AA*D);
|
||||
Q10=D*D*E;
|
||||
Q20=1.e0-E;
|
||||
QR[2]=Q10;
|
||||
V=TZ/T;
|
||||
QT[1]=T/TZ;
|
||||
/*DO 4 I=2,10*/
|
||||
for (I = 2; I <= 10; I++) {
|
||||
QR[I+1]=QR[I]*Q20;
|
||||
/* 4 QT[I]=QT[I-1]*V*/
|
||||
QT[I]=QT[I-1]*V;
|
||||
}
|
||||
/* DO 10 I=1,NC */
|
||||
for (I = 1; I <= NC; I++) {
|
||||
K=II[I]+1;
|
||||
L=JJ[I];
|
||||
QP=G[I]*AA*QR[K+1]*QZT[L];
|
||||
Q0=Q0+QP;
|
||||
/*10 Q5 = Q5 + AA*(2.e0/D-AA*(1.e0-E*(K-1)/Q20))*QP*/
|
||||
Q5 = Q5 + AA*(2.e0/D-AA*(1.e0-E*(K-1)/Q20))*QP;
|
||||
}
|
||||
QP=0.e0;
|
||||
/* DO 20 J=37,40 */
|
||||
for (J=37; J <= 40; J++) {
|
||||
if(fabs(G[J]) < 1.0e-20) continue;
|
||||
K=II[J];
|
||||
KM=JJ[J];
|
||||
DDZ = ADZ[J-36];
|
||||
DEL = D/DDZ - 1.e0;
|
||||
if(fabs(DEL) < 1.e-10) DEL=1.e-10;
|
||||
EX1 = -AAD[J-36]*pow(DEL,K);
|
||||
if (EX1 <= -88.028e0) {
|
||||
DEX=0.e0;
|
||||
} else {
|
||||
DEX=exp(EX1)*pow(DEL,KM);
|
||||
}
|
||||
ATT = AAT[J-36];
|
||||
TX = ATZ[J-36];
|
||||
TAU = T/TX-1.e0;
|
||||
EX2 = -ATT*TAU*TAU;
|
||||
if (EX2 <= -88.028e0) {
|
||||
TEX=0.e0;
|
||||
} else {
|
||||
TEX = exp(EX2);
|
||||
}
|
||||
Q10 = DEX*TEX;
|
||||
QM = KM/DEL - K*AAD[J-36]*pow(DEL,(K-1));
|
||||
FCT=QM*D*D*Q10/DDZ;
|
||||
Q5T = FCT*(2.e0/D+QM/DDZ)-pow((D/DDZ),2)*Q10*(KM/DEL/DEL+
|
||||
K*(K-1)*AAD[J-36]*pow(DEL,(K-2)));
|
||||
Q5 = Q5 + Q5T*G[J];
|
||||
QP = QP + G[J]*FCT;
|
||||
/* 20 CONTINUE */
|
||||
}
|
||||
Q0=Q0+QP;
|
||||
return OK;
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
static double BASE (double D)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
C
|
||||
C THIS FUNCTION CALCULATES THE Z (=PBASE/(DRT)) NEEDED FOR FUNCTION
|
||||
C
|
||||
C FROM L. HAAR, J. S. GALLAGHER, AND G. S. KELL, (1984)
|
||||
C
|
||||
*/
|
||||
{
|
||||
double X, Z0, DZ0;
|
||||
/*
|
||||
C
|
||||
C G1,G2 AND GF ARE THE ALPHA, BETA AND GAMMA FOR DENSITY OF WATER
|
||||
C CALCULATIONS. B1 AND B2 ARE THE 'EXCLUDED VOLUME' AND '2ND VIRIAL
|
||||
C SUPPLIED BY THE SUBROUTINE BB(T), WHICH ALSO SUPPLIES THE 1ST AND
|
||||
C 2ND DERIVATIVES WITH RESPECT TO T (B1T,B2T,B1TT,B2TT).
|
||||
C
|
||||
*/
|
||||
Y=.25e0*B1*D;
|
||||
X=1.e0-Y;
|
||||
Z0=(1.e0+G1*Y+G2*Y*Y)/pow(X,3);
|
||||
Z=Z0+4.e0*Y*(B2/B1-GF);
|
||||
DZ0=(G1+2.e0*G2*Y)/pow(X,3) + 3.e0*(1.e0+G1*Y+G2*Y*Y)/pow(X,4);
|
||||
DZ=DZ0+4.e0*(B2/B1-GF);
|
||||
return(Z);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
double DC (double T)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
C
|
||||
C THIS FUNCTION CALCULATES THE RELATIVE DIELECTRIC CONSTANT AS A
|
||||
C FUNCTION OF TEMPERATURE, ASSUMING ONE ATMOSPHERE PRESSURE
|
||||
C ACCORDING TO D. J. BRADLEY AND K. S. PITZER, (1979)
|
||||
C
|
||||
*/
|
||||
{
|
||||
double D1000, C, B;
|
||||
double U[10]={0, 3.4279e2, -5.0866e-3, 9.4690e-7, -2.0525e0, 3.1159e3,
|
||||
-1.8289e2, -8.0325e3, 4.2142e6, 2.1417e0};
|
||||
D1000=U[1]*exp(U[2]*T+U[3]*T*T);
|
||||
C=U[4]+U[5]/(U[6]+T);
|
||||
B=U[7]+U[8]/T+U[9]*T;
|
||||
return (D1000+C*log((B+VP*1.01325e0)/(B+1000.0e0)));
|
||||
}
|
||||
249
input.cpp
249
input.cpp
@ -1,249 +0,0 @@
|
||||
#define EXTERNAL extern
|
||||
#include <setjmp.h>
|
||||
#include "global.h"
|
||||
#include "input.h"
|
||||
#include "output.h"
|
||||
#include "phrqproto.h"
|
||||
#include "phqalloc.h"
|
||||
|
||||
static char const svnid[] = "$Id: input.c 78 2005-02-01 22:47:12Z dlpark $";
|
||||
|
||||
int check_line_return;
|
||||
|
||||
static struct read_callback s_read_callback;
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int set_read_callback(PFN_READ_CALLBACK pfn, void *cookie, int database)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
if (svnid == NULL) fprintf(stderr," ");
|
||||
s_read_callback.callback = pfn;
|
||||
s_read_callback.cookie = cookie;
|
||||
s_read_callback.database = database;
|
||||
return OK;
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int reading_database(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
return s_read_callback.database;
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int check_line(const char *string, int allow_empty, int allow_eof, int allow_keyword, int print)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
assert(s_read_callback.callback != NULL);
|
||||
if (s_read_callback.callback == NULL) return EOF;
|
||||
if (reading_database()) print = FALSE;
|
||||
return check_line_impl(s_read_callback.callback, s_read_callback.cookie, string, allow_empty, allow_eof, allow_keyword, print);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int check_line_impl(PFN_READ_CALLBACK pfn, void *cookie, const char *string, int allow_empty, int allow_eof, int allow_keyword, int print)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
* Function gets a new line and checks for empty, eof, and keywords.
|
||||
*
|
||||
* Arguments:
|
||||
* string Input, character string used in printing error message
|
||||
* allow_empty Input, True or false, if a blank line is accepable
|
||||
* if false, another line is read
|
||||
* allow_eof Input, True or false, if EOF is acceptable
|
||||
* allow_keyword Input, True or false, if a keyword is acceptable
|
||||
*
|
||||
* Returns:
|
||||
* EMPTY if empty line read and allow_empty == true
|
||||
* KEYWORD if line begins with keyword
|
||||
* EOF if eof and allow_eof == true
|
||||
* OK otherwise
|
||||
* OPTION if line begins with -[alpha]
|
||||
*
|
||||
* Terminates if EOF and allow_eof == false.
|
||||
*/
|
||||
int i;
|
||||
|
||||
|
||||
/* Get line */
|
||||
do {
|
||||
i = get_line(pfn, cookie);
|
||||
if ((print == TRUE && i != EOF) || i == KEYWORD) {
|
||||
output_msg(OUTPUT_CHECKLINE,"\t%s\n",line_save);
|
||||
}
|
||||
} while ( i == EMPTY && allow_empty == FALSE );
|
||||
/* Check eof */
|
||||
if ( i == EOF && allow_eof == FALSE ) {
|
||||
sprintf(error_string,"Unexpected eof while reading %s\nExecution terminated.\n",string);
|
||||
error_msg(error_string, STOP);
|
||||
}
|
||||
/* Check keyword */
|
||||
if (i == KEYWORD && allow_keyword == FALSE ) {
|
||||
sprintf(error_string, "Expected data for %s, but got a keyword ending data block.", string);
|
||||
error_msg(error_string, CONTINUE);
|
||||
input_error++;
|
||||
}
|
||||
check_line_return = i;
|
||||
return (i);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int get_line(PFN_READ_CALLBACK pfn, void *cookie)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
* Read a line from input file put in "line".
|
||||
* Copy of input line is stored in "line_save".
|
||||
* Characters after # are discarded in line but retained in "line_save"
|
||||
*
|
||||
* Arguments:
|
||||
* fp is file name
|
||||
* Returns:
|
||||
* EMPTY,
|
||||
* EOF,
|
||||
* KEYWORD,
|
||||
* OK,
|
||||
* OPTION
|
||||
*/
|
||||
int i, j, return_value, empty, l;
|
||||
char *ptr;
|
||||
char token[MAX_LENGTH];
|
||||
|
||||
return_value = EMPTY;
|
||||
while (return_value == EMPTY) {
|
||||
/*
|
||||
* Eliminate all characters after # sign as a comment
|
||||
*/
|
||||
i=-1;
|
||||
empty=TRUE;
|
||||
/*
|
||||
* Get line, check for eof
|
||||
*/
|
||||
if (get_logical_line(pfn, cookie, &l) == EOF) {
|
||||
next_keyword=0;
|
||||
return (EOF);
|
||||
}
|
||||
/*
|
||||
* Get long lines
|
||||
*/
|
||||
j = l;
|
||||
ptr = strchr (line_save, '#');
|
||||
if (ptr != NULL) {
|
||||
j = ptr - line_save;
|
||||
}
|
||||
strncpy(line, line_save, (unsigned) j);
|
||||
line[j] = '\0';
|
||||
for (i = 0; i < j; i++) {
|
||||
if (! isspace((int) line[i]) ) {
|
||||
empty = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* New line character encountered
|
||||
*/
|
||||
|
||||
if (empty == TRUE) {
|
||||
return_value=EMPTY;
|
||||
} else {
|
||||
return_value=OK;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Determine return_value
|
||||
*/
|
||||
if (return_value == OK) {
|
||||
if ( check_key(line) == TRUE) {
|
||||
return_value=KEYWORD;
|
||||
} else {
|
||||
ptr = line;
|
||||
copy_token(token, &ptr, &i);
|
||||
if (token[0] == '-' && isalpha((int) token[1])) {
|
||||
return_value = OPTION;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (return_value);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int get_logical_line(PFN_READ_CALLBACK pfn, void *cookie, int *l)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
* Reads file fp until end of line, ";", or eof
|
||||
* stores characters in line_save
|
||||
* reallocs line_save and line if more space is needed
|
||||
*
|
||||
* returns:
|
||||
* EOF on empty line on end of file or
|
||||
* OK otherwise
|
||||
* *l returns length of line
|
||||
*/
|
||||
int i, j;
|
||||
int pos;
|
||||
char c;
|
||||
i = 0;
|
||||
if (!pfn) return EOF;
|
||||
while ((j = pfn(cookie)) != EOF) {
|
||||
c = (char) j;
|
||||
if (c == '#') {
|
||||
/* ignore all chars after # until newline */
|
||||
do {
|
||||
c = (char) j;
|
||||
if (c == '\n') {
|
||||
break;
|
||||
}
|
||||
add_char_to_line(&i, c);
|
||||
} while ((j = pfn(cookie)) != EOF);
|
||||
}
|
||||
if (c == ';') break;
|
||||
if (c == '\n') {
|
||||
break;
|
||||
}
|
||||
if (c == '\\') {
|
||||
pos = i;
|
||||
add_char_to_line(&i, c);
|
||||
while ((j = pfn(cookie)) != EOF) {
|
||||
c = (char) j;
|
||||
if (c == '\\') {
|
||||
pos = i;
|
||||
add_char_to_line(&i, c);
|
||||
continue;
|
||||
}
|
||||
if (c == '\n') {
|
||||
/* remove '\\' */
|
||||
for (; pos < i; pos++) {
|
||||
line_save[pos] = line_save[pos+1];
|
||||
}
|
||||
i--;
|
||||
break;
|
||||
}
|
||||
add_char_to_line(&i, c);
|
||||
if (!isspace(j)) break;
|
||||
}
|
||||
} else {
|
||||
add_char_to_line(&i, c);
|
||||
}
|
||||
}
|
||||
if (j == EOF && i == 0) {
|
||||
*l = 0;
|
||||
line_save[i] = '\0';
|
||||
return(EOF);
|
||||
}
|
||||
line_save[i] = '\0';
|
||||
*l = i;
|
||||
return(OK);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int add_char_to_line(int *i, char c)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
if ( *i + 20 >= max_line) {
|
||||
max_line *= 2;
|
||||
line_save = (char *) PHRQ_realloc(line_save, (size_t) max_line * sizeof(char));
|
||||
if (line_save == NULL) malloc_error();
|
||||
line = (char *) PHRQ_realloc(line, (size_t) max_line * sizeof(char));
|
||||
if (line == NULL) malloc_error();
|
||||
}
|
||||
line_save[*i] = c;
|
||||
*i += 1;
|
||||
return(OK);
|
||||
}
|
||||
24
input.h
24
input.h
@ -1,24 +0,0 @@
|
||||
#ifndef _INC_INPUT_H
|
||||
#define _INC_INPUT_H
|
||||
|
||||
#ifdef PHREEQC_IDENT
|
||||
static char const svnidinput[] = "$Id$";
|
||||
#endif
|
||||
typedef int (*PFN_READ_CALLBACK)(void *cookie);
|
||||
|
||||
struct read_callback {
|
||||
PFN_READ_CALLBACK callback;
|
||||
void *cookie;
|
||||
int database;
|
||||
};
|
||||
|
||||
int add_char_to_line(int *i, char c);
|
||||
int check_line_impl(PFN_READ_CALLBACK pfn, void *cookie, const char *string, int allow_empty, int allow_eof, int allow_keyword, int print);
|
||||
int get_line(PFN_READ_CALLBACK pfn, void *cookie);
|
||||
int get_logical_line(PFN_READ_CALLBACK pfn, void *cookie, int *l);
|
||||
int read_database(PFN_READ_CALLBACK pfn, void *cookie);
|
||||
int run_simulations(PFN_READ_CALLBACK pfn, void *cookie);
|
||||
int set_read_callback(PFN_READ_CALLBACK pfn, void *cookie, int database);
|
||||
|
||||
|
||||
#endif /* _INC_INPUT_H */
|
||||
851
integrate.cpp
851
integrate.cpp
@ -1,851 +0,0 @@
|
||||
#define EXTERNAL extern
|
||||
#include "global.h"
|
||||
#include "phqalloc.h"
|
||||
#include "output.h"
|
||||
#include "phrqproto.h"
|
||||
|
||||
static char const svnid[] = "$Id: integrate.c 78 2005-02-01 22:47:12Z dlpark $";
|
||||
|
||||
#define MAX_QUAD 20
|
||||
#define K_POLY 5
|
||||
static LDBLE g_function(LDBLE x_value);
|
||||
static LDBLE midpnt (LDBLE x1, LDBLE x2, int n);
|
||||
static void polint(LDBLE *xa, LDBLE *ya, int n, LDBLE xv, LDBLE *yv, LDBLE *dy);
|
||||
static LDBLE qromb_midpnt (LDBLE x1, LDBLE x2);
|
||||
static LDBLE z, xd, alpha, G_TOL;
|
||||
static struct surface_charge *surface_charge_ptr;
|
||||
|
||||
/*static LDBLE calc_psi_avg(char *name);*/
|
||||
static LDBLE calc_psi_avg(LDBLE surf_chrg_eq);
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int calc_all_g( void )
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i, j, k;
|
||||
int converge, converge1;
|
||||
int count_g, count_charge;
|
||||
LDBLE new_g, xd1;
|
||||
LDBLE epsilon;
|
||||
|
||||
if (svnid == NULL) fprintf(stderr," ");
|
||||
if (use.surface_ptr == NULL) return(OK);
|
||||
/*
|
||||
* calculate g for each surface
|
||||
*/
|
||||
#ifdef SKIP
|
||||
if (punch.high_precision == FALSE) {
|
||||
epsilon = 1e-8;
|
||||
G_TOL = 1e-9;
|
||||
} else {
|
||||
epsilon = 1.e-12;
|
||||
G_TOL = 1e-10;
|
||||
}
|
||||
#endif
|
||||
epsilon = convergence_tolerance;
|
||||
if (convergence_tolerance >= 1e-8) {
|
||||
G_TOL = 1e-9;
|
||||
} else {
|
||||
G_TOL = 1e-10;
|
||||
}
|
||||
|
||||
converge = TRUE;
|
||||
count_charge = 0;
|
||||
for (j = 0; j < count_unknowns; j++) {
|
||||
if (x[j]->type != SURFACE_CB) continue;
|
||||
if (debug_diffuse_layer == TRUE) output_msg(OUTPUT_MESSAGE, "Calc_all_g, X[%d]\n", j);
|
||||
surface_charge_ptr = x[j]->surface_charge;
|
||||
count_g = 1;
|
||||
x[j]->surface_charge->g[0].charge = 0.0;
|
||||
x[j]->surface_charge->g[0].g = 0.0;
|
||||
x[j]->surface_charge->g[0].dg = 0.0;
|
||||
xd = exp(-2 * x[j]->master[0]->s->la * LOG_10);
|
||||
/* alpha = 0.02935 @ 25; (ee0RT/2)**1/2, (L/mol)**1/2 C / m**2 */
|
||||
/* 1000 J/kJ and 1000 L/m**3 */
|
||||
alpha = sqrt( EPSILON * EPSILON_ZERO * (R_KJ_DEG_MOL * 1000.0) * 1000.0 * tk_x * 0.5);
|
||||
/*
|
||||
* calculate g for given surface for each species
|
||||
*/
|
||||
for (i = 0; i < count_s_x; i++) {
|
||||
if (s_x[i]->type > HPLUS) continue;
|
||||
for (k=0; k < count_g; k++) {
|
||||
if (equal(x[j]->surface_charge->g[k].charge, s_x[i]->z, G_TOL) == TRUE) {
|
||||
s_x[i]->diff_layer[count_charge].charge = x[j]->surface_charge;
|
||||
s_x[i]->diff_layer[count_charge].count_g = k;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (k < count_g) continue;
|
||||
|
||||
if (x[j]->surface_charge->grams > 0.0) {
|
||||
z = s_x[i]->z;
|
||||
if ((use.surface_ptr->only_counter_ions == FALSE) ||
|
||||
(((x[j]->master[0]->s->la > 0) && (z < 0)) || ((x[j]->master[0]->s->la < 0) && (z > 0)))) {
|
||||
if (xd > 0.1) {
|
||||
new_g = qromb_midpnt( 1.0, xd);
|
||||
} else if (xd > 0.01) {
|
||||
new_g = qromb_midpnt( 1.0, 0.1);
|
||||
new_g += qromb_midpnt( 0.1, xd);
|
||||
} else if (xd > 0.001) {
|
||||
new_g = qromb_midpnt( 1.0, 0.1);
|
||||
new_g += qromb_midpnt( 0.1, 0.01);
|
||||
new_g += qromb_midpnt( 0.01, xd);
|
||||
} else if (xd > 0.0001) {
|
||||
new_g = qromb_midpnt( 1.0, 0.1);
|
||||
new_g += qromb_midpnt( 0.1, 0.01);
|
||||
new_g += qromb_midpnt( 0.01, .001);
|
||||
new_g += qromb_midpnt( 0.001, xd);
|
||||
} else if (xd > 0.00001) {
|
||||
new_g = qromb_midpnt( 1.0, 0.1);
|
||||
new_g += qromb_midpnt( 0.1, 0.01);
|
||||
new_g += qromb_midpnt( 0.01, .001);
|
||||
new_g += qromb_midpnt( 0.001, .0001);
|
||||
new_g += qromb_midpnt( 0.0001, xd);
|
||||
} else if (xd > 0.000001) {
|
||||
new_g = qromb_midpnt( 1.0, 0.1);
|
||||
new_g += qromb_midpnt( 0.1, 0.01);
|
||||
new_g += qromb_midpnt( 0.01, .001);
|
||||
new_g += qromb_midpnt( 0.001, .0001);
|
||||
new_g += qromb_midpnt( 0.0001, .00001);
|
||||
new_g += qromb_midpnt( 0.00001, xd);
|
||||
} else if (xd > 0.0000001) {
|
||||
new_g = qromb_midpnt( 1.0, 0.1);
|
||||
new_g += qromb_midpnt( 0.1, 0.01);
|
||||
new_g += qromb_midpnt( 0.01, .001);
|
||||
new_g += qromb_midpnt( 0.001, .0001);
|
||||
new_g += qromb_midpnt( 0.0001, .00001);
|
||||
new_g += qromb_midpnt( 0.00001, .000001);
|
||||
new_g += qromb_midpnt( 0.000001, xd);
|
||||
} else if (xd > 0.00000001) {
|
||||
new_g = qromb_midpnt( 1.0, 0.1);
|
||||
new_g += qromb_midpnt( 0.1, 0.01);
|
||||
new_g += qromb_midpnt( 0.01, .001);
|
||||
new_g += qromb_midpnt( 0.001, .0001);
|
||||
new_g += qromb_midpnt( 0.0001, .00001);
|
||||
new_g += qromb_midpnt( 0.00001, .000001);
|
||||
new_g += qromb_midpnt( 0.000001, .0000001);
|
||||
new_g += qromb_midpnt( 0.0000001, xd);
|
||||
} else {
|
||||
new_g = qromb_midpnt( 1.0, 0.1);
|
||||
new_g += qromb_midpnt( 0.1, 0.01);
|
||||
new_g += qromb_midpnt( 0.01, .001);
|
||||
new_g += qromb_midpnt( 0.001, .0001);
|
||||
new_g += qromb_midpnt( 0.0001, .00001);
|
||||
new_g += qromb_midpnt( 0.00001, .000001);
|
||||
new_g += qromb_midpnt( 0.000001, .0000001);
|
||||
new_g += qromb_midpnt( 0.0000001, .00000001);
|
||||
new_g += qromb_midpnt( 0.00000001, xd);
|
||||
}
|
||||
} else {
|
||||
new_g = 0;
|
||||
}
|
||||
} else {
|
||||
new_g = 0.0;
|
||||
}
|
||||
if ((use.surface_ptr->only_counter_ions == TRUE) && new_g < 0) new_g = 0;
|
||||
x[j]->surface_charge->g[count_g].charge = s_x[i]->z;
|
||||
converge1 = TRUE;
|
||||
if (fabs(new_g) >= 1.) {
|
||||
if (fabs((new_g - x[j]->surface_charge->g[count_g].g)/new_g) > epsilon) {
|
||||
converge1 = FALSE;
|
||||
}
|
||||
} else {
|
||||
if (fabs(new_g - x[j]->surface_charge->g[count_g].g) > epsilon) {
|
||||
converge1 = FALSE;
|
||||
}
|
||||
}
|
||||
if (converge1 == FALSE) {
|
||||
converge = FALSE;
|
||||
if (debug_diffuse_layer == TRUE) {
|
||||
output_msg(OUTPUT_MESSAGE, "\t%12f\t%12.4e\t%12.4e\t%12.4e\n",
|
||||
(double) x[j]->surface_charge->g[count_g].charge,
|
||||
(double) x[j]->surface_charge->g[count_g].g,
|
||||
(double) new_g,
|
||||
(double) (new_g - x[j]->surface_charge->g[count_g].g) );
|
||||
}
|
||||
}
|
||||
x[j]->surface_charge->g[count_g].g = new_g;
|
||||
if (new_g == 0) {
|
||||
x[j]->surface_charge->g[count_g].dg = 0;
|
||||
} else {
|
||||
if (x[j]->surface_charge->grams > 0.0) {
|
||||
x[j]->surface_charge->g[count_g].dg = surface_charge_ptr->grams * surface_charge_ptr->specific_area * alpha * g_function(xd) / F_C_MOL;
|
||||
x[j]->surface_charge->g[count_g].dg *= -2. /
|
||||
(exp(x[j]->master[0]->s->la * LOG_10) *
|
||||
exp(x[j]->master[0]->s->la * LOG_10));
|
||||
if ((xd - 1) < 0.0) {
|
||||
x[j]->surface_charge->g[count_g].dg *= -1.0;
|
||||
}
|
||||
if (fabs(x[j]->surface_charge->g[count_g].dg) < 1e-8) {
|
||||
xd1 = exp(-2 * 1e-3 * LOG_10);
|
||||
|
||||
|
||||
new_g = qromb_midpnt( 1.0, xd1);
|
||||
x[j]->surface_charge->g[count_g].dg = new_g/.001;
|
||||
}
|
||||
} else {
|
||||
x[j]->surface_charge->g[count_g].dg = 0.0;
|
||||
}
|
||||
}
|
||||
s_x[i]->diff_layer[count_charge].charge = x[j]->surface_charge;
|
||||
s_x[i]->diff_layer[count_charge].count_g = count_g;
|
||||
count_g++;
|
||||
|
||||
}
|
||||
if (debug_diffuse_layer == TRUE) {
|
||||
output_msg(OUTPUT_MESSAGE, "\nSurface component %d: charge,\tg,\tdg/dlny,\txd\n", count_charge);
|
||||
for (i = 0; i < count_g; i++) {
|
||||
output_msg(OUTPUT_MESSAGE, "\t%12f\t%12.4e\t%12.4e\t%12.4e\n",
|
||||
(double) x[j]->surface_charge->g[i].charge,
|
||||
(double) x[j]->surface_charge->g[i].g,
|
||||
(double) x[j]->surface_charge->g[i].dg,
|
||||
(double) xd);
|
||||
}
|
||||
}
|
||||
count_charge++;
|
||||
}
|
||||
return (converge);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
LDBLE g_function(LDBLE x_value)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
LDBLE sum, return_value, sum1;
|
||||
int i, j;
|
||||
LDBLE ln_x_value;
|
||||
|
||||
if (equal(x_value, 1.0, G_TOL*100) == TRUE) return(0.0);
|
||||
sum = 0.0;
|
||||
ln_x_value = log(x_value);
|
||||
for (j = 0; j < use.surface_ptr->charge[0].count_g; j++) {
|
||||
use.surface_ptr->charge[0].g[j].psi_to_z =
|
||||
exp(ln_x_value * use.surface_ptr->charge[0].g[j].charge) - 1.0;
|
||||
}
|
||||
for (i = 0; i < count_s_x; i++) {
|
||||
if (s_x[i]->type < H2O && s_x[i]->z != 0.0) {
|
||||
for(j = 0; j < use.surface_ptr->charge[0].count_g; j++) {
|
||||
if(use.surface_ptr->charge[0].g[j].charge == s_x[i]->z) {
|
||||
sum += s_x[i]->moles * use.surface_ptr->charge[0].g[j].psi_to_z;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sum < 0.0) {
|
||||
sum = 0.0;
|
||||
sum1 = 0.0;
|
||||
output_msg(OUTPUT_MESSAGE, "Species\tmoles\tX**z-1\tsum\tsum charge\n");
|
||||
for (i = 0; i < count_s_x; i++) {
|
||||
if (s_x[i]->type < H2O && s_x[i]->z != 0.0) {
|
||||
sum += s_x[i]->moles * (pow(x_value, s_x[i]->z) - 1.0);
|
||||
sum1 += s_x[i]->moles * s_x[i]->z;
|
||||
output_msg(OUTPUT_MESSAGE, "%s\t%e\t%e\t%e\t%e\n", s_x[i]->name, (double) s_x[i]->moles, (double) (pow(x_value, (double) s_x[i]->z) - 1.0), (double) sum, (double) sum1);
|
||||
}
|
||||
}
|
||||
sprintf(error_string, "Negative sum in g_function, %e\t%e.", (double) sum, (double) x_value);
|
||||
error_msg(error_string, CONTINUE);
|
||||
sprintf(error_string, "Solutions must be charge balanced, charge imbalance is %e\n", (double) sum1);
|
||||
error_msg(error_string, STOP);
|
||||
}
|
||||
|
||||
return_value = ( exp (ln_x_value * z) - 1) / sqrt((x_value * x_value * mass_water_aq_x * sum ));
|
||||
return(return_value);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
void polint(LDBLE *xa, LDBLE *ya, int n, LDBLE xv, LDBLE *yv, LDBLE *dy)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i, m, ns;
|
||||
LDBLE den, dif, dift, ho, hp, w;
|
||||
LDBLE *c, *d;
|
||||
|
||||
ns = 1;
|
||||
dif = fabs(xv-xa[1]);
|
||||
/*
|
||||
* Malloc work space
|
||||
*/
|
||||
c = (double *) PHRQ_malloc((size_t) (n + 1) * sizeof (LDBLE) );
|
||||
if (c == NULL) malloc_error();
|
||||
d = (double *) PHRQ_malloc((size_t) (n + 1) * sizeof (LDBLE) );
|
||||
if (d == NULL) malloc_error();
|
||||
|
||||
|
||||
|
||||
for (i=1; i <= n; i++) {
|
||||
dift = fabs(xv-xa[i]);
|
||||
if ( dift < dif ) {
|
||||
ns = i;
|
||||
dif = dift;
|
||||
}
|
||||
c[i] = ya[i];
|
||||
d[i] = ya[i];
|
||||
}
|
||||
|
||||
*yv = ya[ns--];
|
||||
for (m = 1; m < n; m++) {
|
||||
for (i=1; i <= n - m; i++) {
|
||||
ho = xa[i] - xv;
|
||||
hp = xa[i+m] - xv;
|
||||
w = c[i+1] - d[i];
|
||||
if ( (den=ho-hp) == 0.0) {
|
||||
error_msg("In subroutine polint.", STOP);
|
||||
}
|
||||
den = w/den;
|
||||
d[i] = hp*den;
|
||||
c[i] = ho*den;
|
||||
}
|
||||
if (2 * ns < (n-m) ) {
|
||||
*dy = c[ns+1];
|
||||
} else {
|
||||
*dy = d[ns--];
|
||||
}
|
||||
*yv += *dy;
|
||||
|
||||
/* *yv += (*dy = (2 * ns < (n-m) ? c[ns+1] : d[ns--])); */
|
||||
}
|
||||
c = (double *) free_check_null(c);
|
||||
d = (double *) free_check_null(d);
|
||||
return;
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
LDBLE midpnt (LDBLE x1, LDBLE x2, int n)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
LDBLE xv, tnm, sum, del, ddel;
|
||||
static LDBLE sv;
|
||||
int it, j;
|
||||
|
||||
if (n == 1) {
|
||||
sv = (x2-x1) * g_function(0.5 * (x1 + x2));
|
||||
return(sv);
|
||||
} else {
|
||||
for (it=1, j=1; j<n-1; j++) it *=3;
|
||||
tnm = (LDBLE) it;
|
||||
del = (x2 - x1) / (3*tnm);
|
||||
ddel = del + del;
|
||||
xv = x1 + 0.5 * del;
|
||||
sum = 0.0;
|
||||
for (j=1; j <= it; j++) {
|
||||
#if defined(PHREEQCI_GUI)
|
||||
if (WaitForSingleObject(g_hKill /*g_eventKill*/, 0) == WAIT_OBJECT_0)
|
||||
{
|
||||
error_msg("Execution canceled by user.", CONTINUE);
|
||||
RaiseException(USER_CANCELED_RUN, 0, 0, NULL);
|
||||
}
|
||||
#endif
|
||||
sum += g_function(xv);
|
||||
xv += ddel;
|
||||
sum += g_function(xv);
|
||||
xv += del;
|
||||
}
|
||||
sv = (sv + (x2 - x1) * sum / tnm) / 3.0;
|
||||
return sv;
|
||||
}
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
LDBLE qromb_midpnt (LDBLE x1, LDBLE x2)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
LDBLE ss, dss;
|
||||
LDBLE sv[MAX_QUAD + 2], h[MAX_QUAD + 2];
|
||||
int j;
|
||||
|
||||
h[0] = 1.0;
|
||||
sv[0] = midpnt( x1, x2, 1);
|
||||
for (j = 1; j < MAX_QUAD; j++) {
|
||||
sv[j] = midpnt( x1, x2, j + 1);
|
||||
h[j] = h[j-1] / 9.0;
|
||||
|
||||
if (fabs(sv[j]-sv[j-1]) <= G_TOL * fabs(sv[j]) ) {
|
||||
sv[j] *= surface_charge_ptr->grams * surface_charge_ptr->specific_area *
|
||||
alpha / F_C_MOL; /* (ee0RT/2)**1/2, (L/mol)**1/2 C / m**2 */
|
||||
if ((x2 - 1) < 0.0) sv[j] *= -1.0;
|
||||
if (debug_diffuse_layer == TRUE) {
|
||||
output_msg(OUTPUT_MESSAGE, "Iterations in qromb_midpnt: %d\n", j);
|
||||
}
|
||||
return(sv[j]);
|
||||
}
|
||||
|
||||
if (j >= K_POLY - 1) {
|
||||
polint( &h[j - K_POLY], &sv[j - K_POLY], K_POLY, 0.0, &ss, &dss);
|
||||
if (fabs(dss) <= G_TOL * fabs(ss) || fabs(dss) < G_TOL) {
|
||||
ss *= surface_charge_ptr->grams * surface_charge_ptr->specific_area *
|
||||
alpha / F_C_MOL; /* (ee0RT/2)**1/2, (L/mol)**1/2 C / m**2 */
|
||||
if ((x2 - 1) < 0.0) ss *= -1.0;
|
||||
if (debug_diffuse_layer == TRUE) {
|
||||
output_msg(OUTPUT_MESSAGE, "Iterations in qromb_midpnt: %d\n", j);
|
||||
}
|
||||
return(ss);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
sprintf(error_string, "\nToo many iterations integrating diffuse layer.\n");
|
||||
error_msg(error_string, STOP);
|
||||
return(-999.9);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int calc_init_g(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i, j, k;
|
||||
int count_g, count_charge;
|
||||
|
||||
if (use.surface_ptr == NULL) return(OK);
|
||||
|
||||
/*
|
||||
* calculate g for each surface
|
||||
*/
|
||||
count_charge = 0;
|
||||
for (j = 0; j < count_unknowns; j++) {
|
||||
if (x[j]->type != SURFACE_CB) continue;
|
||||
surface_charge_ptr = x[j]->surface_charge;
|
||||
count_g = 0;
|
||||
if (x[j]->surface_charge->g != NULL) {
|
||||
count_g = x[j]->surface_charge->count_g;
|
||||
}
|
||||
if( count_g == 0 ) {
|
||||
x[j]->surface_charge->g = (struct surface_diff_layer *) PHRQ_malloc((size_t) sizeof(struct surface_diff_layer));
|
||||
if (x[j]->surface_charge->g == NULL) malloc_error();
|
||||
x[j]->surface_charge->g[0].charge = 0.0;
|
||||
x[j]->surface_charge->g[0].g = 0.0;
|
||||
x[j]->surface_charge->g[0].dg = 0.0;
|
||||
xd = exp(-2 * x[j]->master[0]->s->la * LOG_10);
|
||||
/* alpha = 0.02935 @ 25; (ee0RT/2)**1/2, (L/mol)**1/2 C / m**2 */
|
||||
/* second 1000 is liters/m**3 */
|
||||
alpha = sqrt( EPSILON * EPSILON_ZERO * (R_KJ_DEG_MOL * 1000.0) * 1000.0 * tk_x * 0.5);
|
||||
}
|
||||
/*
|
||||
* calculate g for given surface for each species
|
||||
*/
|
||||
count_g = 1;
|
||||
for (i = 0; i < count_s_x; i++) {
|
||||
if (s_x[i]->type > HPLUS) continue;
|
||||
for (k=0; k < count_g; k++) {
|
||||
if (equal(x[j]->surface_charge->g[k].charge, s_x[i]->z, G_TOL) == TRUE) {
|
||||
s_x[i]->diff_layer[count_charge].charge = x[j]->surface_charge;
|
||||
s_x[i]->diff_layer[count_charge].count_g = k;
|
||||
s_x[i]->diff_layer[count_charge].g_moles = 0.0;
|
||||
s_x[i]->diff_layer[count_charge].dg_g_moles = 0.0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (k >= count_g) {
|
||||
|
||||
/* malloc space to save g for charge */
|
||||
x[j]->surface_charge->g = (struct surface_diff_layer *) PHRQ_realloc(x[j]->surface_charge->g,
|
||||
(size_t) (count_g + 1) *
|
||||
sizeof(struct surface_diff_layer));
|
||||
if (x[j]->surface_charge->g == NULL) malloc_error();
|
||||
|
||||
/* save g for charge */
|
||||
x[j]->surface_charge->g[count_g].charge = s_x[i]->z;
|
||||
if (x[j]->surface_charge->grams > 0.0) {
|
||||
x[j]->surface_charge->g[count_g].g = 2 * alpha * sqrt(mu_x) * (pow(xd, s_x[i]->z / 2.0) - 1) *surface_charge_ptr->grams * surface_charge_ptr->specific_area / F_C_MOL;
|
||||
x[j]->surface_charge->g[count_g].dg = -s_x[i]->z;
|
||||
if ((use.surface_ptr->only_counter_ions == TRUE) &&
|
||||
x[j]->surface_charge->g[count_g].g < 0) {
|
||||
x[j]->surface_charge->g[count_g].g = 0;
|
||||
x[j]->surface_charge->g[count_g].dg = 0;
|
||||
}
|
||||
} else {
|
||||
x[j]->surface_charge->g[count_g].g = 0.0;
|
||||
x[j]->surface_charge->g[count_g].dg = -s_x[i]->z;
|
||||
}
|
||||
/* save g for species */
|
||||
s_x[i]->diff_layer[count_charge].charge = x[j]->surface_charge;
|
||||
s_x[i]->diff_layer[count_charge].count_g = count_g;
|
||||
s_x[i]->diff_layer[count_charge].g_moles = 0.0;
|
||||
s_x[i]->diff_layer[count_charge].dg_g_moles = 0.0;
|
||||
count_g++;
|
||||
}
|
||||
}
|
||||
if (debug_diffuse_layer == TRUE) {
|
||||
output_msg(OUTPUT_MESSAGE, "\nSurface component %d: charge,\tg,\tdg\n", count_charge);
|
||||
for (i = 0; i < count_g; i++) {
|
||||
output_msg(OUTPUT_MESSAGE, "\t%12f\t%12.4e\t%12.4e\n",
|
||||
(double) x[j]->surface_charge->g[i].charge, (double) x[j]->surface_charge->g[i].g, (double) x[j]->surface_charge->g[i].dg );
|
||||
}
|
||||
}
|
||||
count_charge++;
|
||||
x[j]->surface_charge->count_g = count_g;
|
||||
}
|
||||
return (OK);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int initial_surface_water(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
* In initial surface calculation, need to calculate
|
||||
* mass of water in diffuse layer.
|
||||
* diffuse layer water + aqueous solution water = bulk water.
|
||||
* Ionic strength is fixed, so diffuse-layer water will not change
|
||||
*/
|
||||
int i;
|
||||
/*#define DEBYE*/
|
||||
#ifdef DEBYE
|
||||
LDBLE debye_length;
|
||||
LDBLE volume_diffuse_layer;
|
||||
#endif
|
||||
LDBLE mass_water_surface;
|
||||
/*
|
||||
* Debye length = 1/k = sqrt[eta*eta_zero*R*T/(2*F**2*mu_x*1000)], Dzombak and Morel, p 36
|
||||
*
|
||||
* 1000 converts kJ to J; 1000 converts Liters to meter**3; debye_length is in meters.
|
||||
*/
|
||||
#ifdef DEBYE
|
||||
debye_length = (EPSILON * EPSILON_ZERO * R_KJ_DEG_MOL * 1000.0 * tk_x)
|
||||
/ (2. * F_C_MOL * F_C_MOL * mu_x * 1000.);
|
||||
debye_length = sqrt(debye_length);
|
||||
#endif
|
||||
/*
|
||||
* Loop through all surface components, calculate each H2O surface (diffuse layer),
|
||||
* H2O aq, and H2O bulk (diffuse layers plus aqueous).
|
||||
*/
|
||||
mass_water_surfaces_x = 0.0;
|
||||
for (i = 0; i < count_unknowns; i++) {
|
||||
if (x[i]->type != SURFACE_CB) continue;
|
||||
#ifdef DEBYE
|
||||
/* 1000 converts volume from m**3 to Liters */
|
||||
volume_diffuse_layer = x[i]->surface_charge->specific_area *
|
||||
x[i]->surface_charge->grams * debye_length * 1000;
|
||||
|
||||
/* Assume mol/L = mol/kgw */
|
||||
mass_water_surface = volume_diffuse_layer;
|
||||
#else
|
||||
/* make constant thickness of, default 1e-8 m (100 Angstroms) */
|
||||
mass_water_surface = x[i]->surface_charge->specific_area *
|
||||
x[i]->surface_charge->grams * use.surface_ptr->thickness * 1000;
|
||||
#endif
|
||||
x[i]->surface_charge->mass_water = mass_water_surface;
|
||||
mass_water_surfaces_x += mass_water_surface;
|
||||
}
|
||||
mass_water_bulk_x = mass_water_aq_x + mass_water_surfaces_x;
|
||||
return(OK);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int sum_diffuse_layer(struct surface_charge *surface_charge_ptr1)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i, j, count_g;
|
||||
LDBLE mass_water_surface;
|
||||
LDBLE molality, moles_excess, moles_surface;
|
||||
|
||||
if (use.surface_ptr == NULL) return(OK);
|
||||
/*
|
||||
* Find position of component in list of components
|
||||
*/
|
||||
i = 0;
|
||||
|
||||
for (j =0; j < use.surface_ptr->count_charge; j++) {
|
||||
if (&(use.surface_ptr->charge[j]) == surface_charge_ptr1) {
|
||||
i = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (j >= use.surface_ptr->count_charge) {
|
||||
sprintf(error_string, "In sum_diffuse_layer, component not found, %s.", surface_charge_ptr1->name);
|
||||
error_msg(error_string, STOP);
|
||||
}
|
||||
/*
|
||||
* Loop through all surface components, calculate each H2O surface (diffuse layer),
|
||||
* H2O aq, and H2O bulk (diffuse layers plus aqueous).
|
||||
*/
|
||||
count_elts = 0;
|
||||
paren_count = 0;
|
||||
mass_water_surface = surface_charge_ptr1->mass_water;
|
||||
for (j = 0; j < count_s_x; j++) {
|
||||
if (s_x[j]->type > HPLUS) continue;
|
||||
molality = under(s_x[j]->lm);
|
||||
count_g = s_x[j]->diff_layer[i].count_g;
|
||||
#ifdef SKIP
|
||||
moles_excess = mass_water_bulk_x *
|
||||
/* s_x[j]->diff_layer[i].charge->g[count_g].g * molality; */
|
||||
surface_charge_ptr1->g[count_g].g * molality;
|
||||
#endif
|
||||
moles_excess = mass_water_aq_x * molality * surface_charge_ptr1->g[count_g].g;
|
||||
|
||||
moles_surface = mass_water_surface * molality + moles_excess;
|
||||
/*
|
||||
* Accumulate elements in diffuse layer
|
||||
*/
|
||||
add_elt_list(s_x[j]->next_elt, moles_surface);
|
||||
}
|
||||
add_elt_list(s_h2o->next_elt, mass_water_surface / gfw_water);
|
||||
|
||||
if (count_elts > 0 ) {
|
||||
qsort (elt_list, (size_t) count_elts,
|
||||
(size_t) sizeof(struct elt_list), elt_list_compare);
|
||||
elt_list_combine();
|
||||
}
|
||||
return(OK);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int calc_all_donnan(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i, j, k;
|
||||
int count_g, count_charge, converge;
|
||||
char name[MAX_LENGTH];
|
||||
LDBLE new_g, f_psi, surf_chrg_eq, psi_avg, f_sinh, A_surf, ratio_aq;
|
||||
LDBLE new_g2, f_psi2, surf_chrg_eq2, psi_avg2, dif;
|
||||
|
||||
if (use.surface_ptr == NULL) return(OK);
|
||||
f_sinh = sqrt(8000.0 * EPSILON * EPSILON_ZERO * (R_KJ_DEG_MOL * 1000.0) * tk_x * mu_x);
|
||||
/*
|
||||
* calculate g for each surface...
|
||||
*/
|
||||
converge = TRUE;
|
||||
count_charge = 0;
|
||||
for (j = 0; j < count_unknowns; j++) {
|
||||
if (x[j]->type != SURFACE_CB) continue;
|
||||
surface_charge_ptr = x[j]->surface_charge;
|
||||
|
||||
if (debug_diffuse_layer == TRUE) output_msg(OUTPUT_MESSAGE, "Calc_all_g, X[%d]\n", j);
|
||||
/*
|
||||
* sum eq of each charge number in solution...
|
||||
*/
|
||||
count_g = x[j]->surface_charge->count_g;
|
||||
for (i = 0; i < count_g; i++) {
|
||||
charge_group[i].eq = 0.0;
|
||||
}
|
||||
for (i = 0; i < count_s_x; i++) {
|
||||
if (s_x[i]->type > HPLUS) continue;
|
||||
for (k = 0; k < count_g; k++) {
|
||||
if (equal(charge_group[k].z, s_x[i]->z, G_TOL) == TRUE) {
|
||||
charge_group[k].eq += s_x[i]->z * s_x[i]->moles;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* find surface charge from potential... */
|
||||
A_surf = x[j]->surface_charge->specific_area * x[j]->surface_charge->grams;
|
||||
f_psi = x[j]->master[0]->s->la * LOG_10;
|
||||
surf_chrg_eq = A_surf * f_sinh * sinh(f_psi) / F_C_MOL;
|
||||
/* also for the derivative... */
|
||||
dif = 1e-5;
|
||||
f_psi2 = f_psi + dif;
|
||||
surf_chrg_eq2 = A_surf * f_sinh * sinh(f_psi2) / F_C_MOL;
|
||||
|
||||
|
||||
/* find psi_avg that matches surface charge... */
|
||||
psi_avg = calc_psi_avg(surf_chrg_eq);
|
||||
psi_avg2 = calc_psi_avg(surf_chrg_eq2);
|
||||
|
||||
/* fill in g's */
|
||||
ratio_aq = surface_charge_ptr->mass_water / mass_water_aq_x;
|
||||
|
||||
for (k = 0; k < count_g; k++) {
|
||||
x[j]->surface_charge->g[k].charge = charge_group[k].z;
|
||||
|
||||
new_g = exp(-charge_group[k].z * psi_avg) - 1;
|
||||
if (new_g <= - ratio_aq) new_g = G_TOL;
|
||||
new_g2 = exp(-charge_group[k].z * psi_avg2) - 1;
|
||||
if (new_g2 <= - ratio_aq) new_g2 = G_TOL;
|
||||
|
||||
if (fabs(new_g) >= 1) {
|
||||
if (fabs((new_g - x[j]->surface_charge->g[k].g) / new_g) > convergence_tolerance) {
|
||||
converge = FALSE;
|
||||
}
|
||||
} else {
|
||||
if (fabs(new_g - x[j]->surface_charge->g[k].g) > convergence_tolerance) {
|
||||
converge = FALSE;
|
||||
}
|
||||
}
|
||||
x[j]->surface_charge->g[k].g = new_g;
|
||||
if (new_g != 0) {
|
||||
x[j]->surface_charge->g[k].dg = (new_g2 - new_g) / dif;
|
||||
} else {
|
||||
x[j]->surface_charge->g[k].dg = -charge_group[k].z;
|
||||
}
|
||||
/* save g for species */
|
||||
for (i = 0; i < count_s_x; i++) {
|
||||
if (equal(charge_group[k].z, s_x[i]->z, G_TOL) == TRUE) {
|
||||
s_x[i]->diff_layer[count_charge].charge = x[j]->surface_charge;
|
||||
s_x[i]->diff_layer[count_charge].count_g = k;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (debug_diffuse_layer == TRUE) {
|
||||
strcpy(name, x[j]->master[0]->elt->name);
|
||||
replace ("_psi", "", name);
|
||||
/* surf_chrg_eq = calc_surface_charge(name);
|
||||
*/
|
||||
output_msg(OUTPUT_MESSAGE, "\nDonnan all on %s (%d): charge, \tg, \tdg, Psi_surface = %8f V. \n", name, count_charge,
|
||||
x[j]->master[0]->s->la * 2 * LOG_10 * R_KJ_DEG_MOL * tk_x / F_KJ_V_EQ);
|
||||
for (i = 0; i < count_g; i++) {
|
||||
output_msg(OUTPUT_MESSAGE, "\t%12f\t%12.4e\t%12.4e\n",
|
||||
(double) x[j]->surface_charge->g[i].charge,
|
||||
(double) x[j]->surface_charge->g[i].g,
|
||||
(double) x[j]->surface_charge->g[i].dg);
|
||||
}
|
||||
}
|
||||
count_charge++;
|
||||
}
|
||||
return (converge);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int calc_init_donnan(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i, j, k;
|
||||
int count_g, count_charge;
|
||||
char name[MAX_LENGTH];
|
||||
LDBLE f_psi, surf_chrg_eq, psi_avg, f_sinh, A_surf, ratio_aq;
|
||||
|
||||
if (use.surface_ptr == NULL) return(OK);
|
||||
f_sinh = sqrt(8000.0 * EPSILON * EPSILON_ZERO * (R_KJ_DEG_MOL * 1000.0) * tk_x * mu_x);
|
||||
/*
|
||||
* sum eq of each charge number in solution...
|
||||
*/
|
||||
charge_group = (struct charge_group *) free_check_null(charge_group);
|
||||
charge_group = (struct charge_group *) PHRQ_malloc((size_t) sizeof(struct charge_group));
|
||||
if (charge_group == NULL) malloc_error();
|
||||
charge_group[0].z = 0.0;
|
||||
charge_group[0].eq = 0.0;
|
||||
|
||||
count_g = 1;
|
||||
for (i = 0; i < count_s_x; i++) {
|
||||
if (s_x[i]->type > HPLUS) continue;
|
||||
for (k = 0; k < count_g; k++) {
|
||||
if (equal(charge_group[k].z, s_x[i]->z, G_TOL) == TRUE) {
|
||||
charge_group[k].eq += s_x[i]->z * s_x[i]->moles;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (k >= count_g) {
|
||||
charge_group = (struct charge_group *) PHRQ_realloc(charge_group, (size_t) (count_g + 1) *
|
||||
sizeof(struct charge_group));
|
||||
if (charge_group == NULL) malloc_error();
|
||||
charge_group[count_g].z = s_x[i]->z;
|
||||
charge_group[count_g].eq = s_x[i]->z * s_x[i]->moles;
|
||||
|
||||
count_g++;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* calculate g for each surface...
|
||||
*/
|
||||
count_charge = 0;
|
||||
for (j = 0; j < count_unknowns; j++) {
|
||||
if (x[j]->type != SURFACE_CB) continue;
|
||||
surface_charge_ptr = x[j]->surface_charge;
|
||||
|
||||
x[j]->surface_charge->g = (struct surface_diff_layer *) PHRQ_malloc((size_t) count_g * sizeof(struct surface_diff_layer));
|
||||
if (x[j]->surface_charge->g == NULL) malloc_error();
|
||||
x[j]->surface_charge->count_g = count_g;
|
||||
|
||||
/* find surface charge from potential... */
|
||||
A_surf = x[j]->surface_charge->specific_area * x[j]->surface_charge->grams;
|
||||
f_psi = x[j]->master[0]->s->la * LOG_10;
|
||||
surf_chrg_eq = A_surf * f_sinh * sinh(f_psi) / F_C_MOL;
|
||||
|
||||
/* find psi_avg that matches surface charge... */
|
||||
psi_avg = calc_psi_avg(surf_chrg_eq);
|
||||
|
||||
/* fill in g's */
|
||||
ratio_aq = surface_charge_ptr->mass_water / mass_water_aq_x;
|
||||
|
||||
for (k = 0; k < count_g; k++) {
|
||||
x[j]->surface_charge->g[k].charge = charge_group[k].z;
|
||||
x[j]->surface_charge->g[k].g = exp(-charge_group[k].z * psi_avg) - 1;
|
||||
if (x[j]->surface_charge->g[k].g != 0) {
|
||||
x[j]->surface_charge->g[k].dg = - A_surf * f_sinh * cosh(f_psi) /
|
||||
(charge_group[k].eq * F_C_MOL);
|
||||
} else {
|
||||
x[j]->surface_charge->g[k].dg = -charge_group[k].z;
|
||||
}
|
||||
/* save g for species */
|
||||
for (i = 0; i < count_s_x; i++) {
|
||||
if (equal(charge_group[k].z, s_x[i]->z, G_TOL) == TRUE) {
|
||||
s_x[i]->diff_layer[count_charge].charge = x[j]->surface_charge;
|
||||
s_x[i]->diff_layer[count_charge].count_g = k;
|
||||
s_x[i]->diff_layer[count_charge].g_moles = 0.0;
|
||||
s_x[i]->diff_layer[count_charge].dg_g_moles = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (debug_diffuse_layer == TRUE) {
|
||||
strcpy(name, x[j]->master[0]->elt->name);
|
||||
replace ("_psi", "", name);
|
||||
/* surf_chrg_eq = calc_surface_charge(name);
|
||||
*/
|
||||
output_msg(OUTPUT_MESSAGE, "\nDonnan init on %s : charge, \tg, \tdg, Psi_surface = %8f V. \n", name,
|
||||
x[j]->master[0]->s->la * 2 * LOG_10 * R_KJ_DEG_MOL * tk_x / F_KJ_V_EQ);
|
||||
for (i = 0; i < count_g; i++) {
|
||||
output_msg(OUTPUT_MESSAGE, "\t%12f\t%12.4e\t%12.4e\n",
|
||||
(double) x[j]->surface_charge->g[i].charge, (double) x[j]->surface_charge->g[i].g, (double) x[j]->surface_charge->g[i].dg );
|
||||
}
|
||||
}
|
||||
count_charge++;
|
||||
}
|
||||
return (OK);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
LDBLE calc_psi_avg(LDBLE surf_chrg_eq)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
* calculate the average (F * Psi / RT) that lets the DL charge counter the surface charge
|
||||
*/
|
||||
int i, iter, count_g;
|
||||
LDBLE fd, fd1, p, temp, ratio_aq;
|
||||
/* LDBLE dif;
|
||||
*/
|
||||
count_g = surface_charge_ptr->count_g;
|
||||
if (convergence_tolerance >= 1e-8) {
|
||||
G_TOL = 1e-9;
|
||||
} else {
|
||||
G_TOL = 1e-10;
|
||||
}
|
||||
ratio_aq = surface_charge_ptr->mass_water / mass_water_aq_x;
|
||||
p = 0;
|
||||
if (surf_chrg_eq == 0) {
|
||||
return(0.0);
|
||||
} else if (surf_chrg_eq < 0) {
|
||||
p = -0.5 * log(-surf_chrg_eq * ratio_aq / mu_x + 1);
|
||||
} else if (surf_chrg_eq > 0) {
|
||||
p = 0.5 * log(surf_chrg_eq * ratio_aq / mu_x + 1);
|
||||
}
|
||||
/*
|
||||
* Optimize p in SS{s_x[i]->moles * z_i * g(p)} = -surf_chrg_eq
|
||||
* g(p) = exp(-p * z_i) - 1
|
||||
*/
|
||||
iter = 0;
|
||||
do {
|
||||
fd = surf_chrg_eq;
|
||||
fd1 = 0.0;
|
||||
for (i = 1; i < count_g; i++) {
|
||||
temp = exp(-charge_group[i].z * p);
|
||||
if (temp > 1 - ratio_aq) {
|
||||
fd += charge_group[i].eq * (temp - 1);
|
||||
fd1 -= charge_group[i].z * charge_group[i].eq * temp;
|
||||
}
|
||||
}
|
||||
/* fd1 = surf_chrg_eq * ratio_aq;
|
||||
dif = 1e-5;
|
||||
p += dif;
|
||||
for (i = 1; i < count_g; i++) {
|
||||
temp = exp(-charge_group[i].z * p);
|
||||
fd1 += charge_group[i].eq * temp;
|
||||
}
|
||||
fd /= -(fd1 - fd) / dif;
|
||||
p -= dif;
|
||||
p += (fd > 1) ? 1 : ((fd < -1) ? -1 : fd);
|
||||
*/
|
||||
fd /= -fd1;
|
||||
p += (fd > 1) ? 1 : ((fd < -1) ? -1 : fd);
|
||||
if (fabs(p) < G_TOL) p = 0.0;
|
||||
iter++;
|
||||
if (iter > 50) {
|
||||
sprintf(error_string, "\nToo many iterations for surface in subroutine calc_psi_avg.\n");
|
||||
error_msg(error_string, STOP);
|
||||
}
|
||||
} while (fabs(fd) > G_TOL && p != 0.0);
|
||||
if (debug_diffuse_layer == TRUE)
|
||||
output_msg(OUTPUT_MESSAGE, "iter in calc_psi_avg = %d. g(+1) = %8f. surface charge = %8f.\n",
|
||||
iter, (double) (exp(-p) - 1), (double) surf_chrg_eq);
|
||||
|
||||
return(p);
|
||||
}
|
||||
3014
inverse.cpp
3014
inverse.cpp
File diff suppressed because it is too large
Load Diff
1540
isotopes.cpp
1540
isotopes.cpp
File diff suppressed because it is too large
Load Diff
2288
kinetics.cpp
2288
kinetics.cpp
File diff suppressed because it is too large
Load Diff
140
main.cpp
140
main.cpp
@ -1,140 +0,0 @@
|
||||
#define EXTERNAL
|
||||
#include "global.h"
|
||||
#include "output.h"
|
||||
#include "phrqproto.h"
|
||||
#include "input.h"
|
||||
|
||||
/*#define PHREEQC_XML*/
|
||||
#ifdef PHREEQC_XML
|
||||
#include "SAXPhreeqc.h"
|
||||
extern void SAX_cleanup(void);
|
||||
#endif
|
||||
|
||||
static char const svnid[] = "$Id: main.c 715 2006-01-18 01:26:29Z dlpark $";
|
||||
|
||||
#ifdef DOS
|
||||
static int write_banner(void);
|
||||
#endif
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
* MAIN
|
||||
* ---------------------------------------------------------------------- */
|
||||
int main(int argc, char *argv[])
|
||||
/*
|
||||
* Main program for PHREEQC
|
||||
*/
|
||||
{
|
||||
int errors;
|
||||
void *db_cookie = NULL;
|
||||
void *input_cookie = NULL;
|
||||
if (svnid == NULL) fprintf(stderr," ");
|
||||
phast = FALSE;
|
||||
/*
|
||||
* Add callbacks for error_msg and warning_msg
|
||||
*/
|
||||
if (add_output_callback(phreeqc_handler, NULL) != OK) {
|
||||
fprintf(stderr, "ERROR: %s\n", "NULL pointer returned from malloc or realloc.");
|
||||
fprintf(stderr, "ERROR: %s\n", "Program terminating.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Open input/output files
|
||||
*/
|
||||
errors = process_file_names(argc, argv, &db_cookie, &input_cookie, TRUE);
|
||||
if (errors != 0) {
|
||||
clean_up();
|
||||
return errors;
|
||||
}
|
||||
#ifdef DOS
|
||||
write_banner();
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Initialize arrays
|
||||
*/
|
||||
errors = do_initialize();
|
||||
if (errors != 0) {
|
||||
clean_up();
|
||||
return errors;
|
||||
}
|
||||
|
||||
/*
|
||||
* Load database into memory
|
||||
*/
|
||||
errors = read_database(getc_callback, db_cookie);
|
||||
if (errors != 0) {
|
||||
clean_up();
|
||||
return errors;
|
||||
}
|
||||
|
||||
/*
|
||||
* Read input data for simulation
|
||||
*/
|
||||
errors = run_simulations(getc_callback, input_cookie);
|
||||
if (errors != 0) {
|
||||
clean_up();
|
||||
return errors;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Display successful status
|
||||
*/
|
||||
errors = do_status();
|
||||
if (errors != 0) {
|
||||
clean_up();
|
||||
return errors;
|
||||
}
|
||||
#ifdef PHREEQC_XML
|
||||
{
|
||||
int n;
|
||||
SAX_StartSystem();
|
||||
for (n = 0; n < count_solution; ++n)
|
||||
{
|
||||
SAX_AddSolution(solution[n]);
|
||||
}
|
||||
SAX_EndSystem();
|
||||
SAX_UnpackSolutions(SAX_GetXMLStr(), SAX_GetXMLLength());
|
||||
}
|
||||
#endif
|
||||
|
||||
clean_up();
|
||||
close_input_files();
|
||||
close_output_files();
|
||||
#ifdef PHREEQC_XML
|
||||
SAX_cleanup();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int write_banner(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
char buffer[80];
|
||||
int len, indent;
|
||||
output_msg(OUTPUT_SCREEN, " ÛßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßÛ\n");
|
||||
output_msg(OUTPUT_SCREEN, " º º\n");
|
||||
|
||||
/* version */
|
||||
len = sprintf(buffer, "* PHREEQC-%s *", "@VERSION@");
|
||||
indent = (44 - len) / 2;
|
||||
output_msg(OUTPUT_SCREEN, "%14cº%*c%s%*cº\n", ' ', indent, ' ', buffer, 44 - indent - len, ' ');
|
||||
|
||||
output_msg(OUTPUT_SCREEN, " º º\n");
|
||||
output_msg(OUTPUT_SCREEN, " º A hydrogeochemical transport model º\n");
|
||||
output_msg(OUTPUT_SCREEN, " º º\n");
|
||||
output_msg(OUTPUT_SCREEN, " º by º\n");
|
||||
output_msg(OUTPUT_SCREEN, " º D.L. Parkhurst and C.A.J. Appelo º\n");
|
||||
output_msg(OUTPUT_SCREEN, " º º\n");
|
||||
|
||||
|
||||
/* date */
|
||||
len = sprintf(buffer, "%s", "@VER_DATE@");
|
||||
indent = (44 - len) / 2;
|
||||
output_msg(OUTPUT_SCREEN, "%14cº%*c%s%*cº\n", ' ', indent, ' ', buffer, 44 - indent - len, ' ');
|
||||
|
||||
output_msg(OUTPUT_SCREEN, " ÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ\n\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
2486
mainsubs.cpp
2486
mainsubs.cpp
File diff suppressed because it is too large
Load Diff
193
nvector.cpp
193
nvector.cpp
@ -1,193 +0,0 @@
|
||||
/*******************************************************************
|
||||
* *
|
||||
* File : nvector.c *
|
||||
* Programmers : Radu Serban, LLNL *
|
||||
* Version of : 26 June 2002 *
|
||||
*-----------------------------------------------------------------*
|
||||
* Copyright (c) 2002, The Regents of the University of California *
|
||||
* Produced at the Lawrence Livermore National Laboratory *
|
||||
* All rights reserved *
|
||||
* For details, see sundials/shared/LICENSE *
|
||||
*-----------------------------------------------------------------*
|
||||
* This is the implementation file for a generic NVECTOR *
|
||||
* package. It contains the implementation of the N_Vector *
|
||||
* kernels listed in nvector.h. *
|
||||
* *
|
||||
*******************************************************************/
|
||||
|
||||
#include "nvector.h" /* generic M_Env and N_Vector */
|
||||
#include "output.h"
|
||||
static char const svnid[] = "$Id: nvector.c 78 2005-02-01 22:47:12Z dlpark $";
|
||||
|
||||
N_Vector N_VNew(integertype n, M_Env machEnv)
|
||||
{
|
||||
N_Vector v_new;
|
||||
v_new = machEnv->ops->nvnew(n, machEnv);
|
||||
return(v_new);
|
||||
}
|
||||
|
||||
N_Vector_S N_VNew_S(integertype ns, integertype n, M_Env machEnv)
|
||||
{
|
||||
N_Vector_S vs_new;
|
||||
vs_new = machEnv->ops->nvnewS(ns, n, machEnv);
|
||||
return(vs_new);
|
||||
}
|
||||
|
||||
void N_VFree(N_Vector v)
|
||||
{
|
||||
v->menv->ops->nvfree(v);
|
||||
}
|
||||
|
||||
void N_VFree_S(integertype ns, N_Vector_S vs)
|
||||
{
|
||||
(*vs)->menv->ops->nvfreeS(ns, vs);
|
||||
}
|
||||
|
||||
N_Vector N_VMake(integertype n, realtype *v_data, M_Env machEnv)
|
||||
{
|
||||
N_Vector v_new;
|
||||
v_new = machEnv->ops->nvmake(n, v_data, machEnv);
|
||||
return(v_new);
|
||||
}
|
||||
|
||||
void N_VDispose(N_Vector v)
|
||||
{
|
||||
v->menv->ops->nvdispose(v);
|
||||
}
|
||||
|
||||
realtype *N_VGetData(N_Vector v)
|
||||
{
|
||||
realtype *data;
|
||||
data = v->menv->ops->nvgetdata(v);
|
||||
return(data);
|
||||
}
|
||||
|
||||
void N_VSetData(realtype *v_data, N_Vector v)
|
||||
{
|
||||
v->menv->ops->nvsetdata(v_data, v);
|
||||
}
|
||||
|
||||
void N_VLinearSum(realtype a, N_Vector x, realtype b, N_Vector y, N_Vector z)
|
||||
{
|
||||
z->menv->ops->nvlinearsum(a, x, b, y, z);
|
||||
}
|
||||
|
||||
void N_VConst(realtype c, N_Vector z)
|
||||
{
|
||||
z->menv->ops->nvconst(c, z);
|
||||
}
|
||||
|
||||
void N_VProd(N_Vector x, N_Vector y, N_Vector z)
|
||||
{
|
||||
z->menv->ops->nvprod(x, y, z);
|
||||
}
|
||||
|
||||
void N_VDiv(N_Vector x, N_Vector y, N_Vector z)
|
||||
{
|
||||
z->menv->ops->nvdiv(x, y, z);
|
||||
}
|
||||
|
||||
void N_VScale(realtype c, N_Vector x, N_Vector z)
|
||||
{
|
||||
z->menv->ops->nvscale(c, x, z);
|
||||
}
|
||||
|
||||
void N_VAbs(N_Vector x, N_Vector z)
|
||||
{
|
||||
z->menv->ops->nvabs(x, z);
|
||||
}
|
||||
|
||||
void N_VInv(N_Vector x, N_Vector z)
|
||||
{
|
||||
z->menv->ops->nvinv(x, z);
|
||||
}
|
||||
|
||||
void N_VAddConst(N_Vector x, realtype b, N_Vector z)
|
||||
{
|
||||
z->menv->ops->nvaddconst(x, b, z);
|
||||
}
|
||||
|
||||
realtype N_VDotProd(N_Vector x, N_Vector y)
|
||||
{
|
||||
realtype prod;
|
||||
prod = y->menv->ops->nvdotprod(x, y);
|
||||
return(prod);
|
||||
}
|
||||
|
||||
realtype N_VMaxNorm(N_Vector x)
|
||||
{
|
||||
realtype norm;
|
||||
norm = x->menv->ops->nvmaxnorm(x);
|
||||
return(norm);
|
||||
}
|
||||
|
||||
realtype N_VWrmsNorm(N_Vector x, N_Vector w)
|
||||
{
|
||||
realtype norm;
|
||||
norm = x->menv->ops->nvwrmsnorm(x, w);
|
||||
return(norm);
|
||||
}
|
||||
|
||||
realtype N_VMin(N_Vector x)
|
||||
{
|
||||
realtype minval;
|
||||
minval = x->menv->ops->nvmin(x);
|
||||
return(minval);
|
||||
}
|
||||
|
||||
realtype N_VWL2Norm(N_Vector x, N_Vector w)
|
||||
{
|
||||
realtype norm;
|
||||
norm = x->menv->ops->nvwl2norm(x, w);
|
||||
return(norm);
|
||||
}
|
||||
|
||||
realtype N_VL1Norm(N_Vector x)
|
||||
{
|
||||
realtype norm;
|
||||
norm = x->menv->ops->nvl1norm(x);
|
||||
return(norm);
|
||||
}
|
||||
|
||||
void N_VOneMask(N_Vector x)
|
||||
{
|
||||
x->menv->ops->nvonemask(x);
|
||||
}
|
||||
|
||||
void N_VCompare(realtype c, N_Vector x, N_Vector z)
|
||||
{
|
||||
z->menv->ops->nvcompare(c, x, z);
|
||||
}
|
||||
|
||||
booleantype N_VInvTest(N_Vector x, N_Vector z)
|
||||
{
|
||||
booleantype flag;
|
||||
flag = z->menv->ops->nvinvtest(x, z);
|
||||
return(flag);
|
||||
}
|
||||
|
||||
booleantype N_VConstrProdPos(N_Vector c, N_Vector x)
|
||||
{
|
||||
booleantype flag;
|
||||
flag = x->menv->ops->nvconstrprodpos(c, x);
|
||||
return(flag);
|
||||
}
|
||||
|
||||
booleantype N_VConstrMask(N_Vector c, N_Vector x, N_Vector m)
|
||||
{
|
||||
booleantype flag;
|
||||
flag = x->menv->ops->nvconstrmask(c, x, m);
|
||||
return(flag);
|
||||
}
|
||||
|
||||
realtype N_VMinQuotient(N_Vector num, N_Vector denom)
|
||||
{
|
||||
realtype quotient;
|
||||
quotient = num->menv->ops->nvminquotient(num, denom);
|
||||
return(quotient);
|
||||
}
|
||||
|
||||
void N_VPrint(N_Vector x)
|
||||
{
|
||||
x->menv->ops->nvprint(x);
|
||||
}
|
||||
441
nvector.h
441
nvector.h
@ -1,441 +0,0 @@
|
||||
/*******************************************************************
|
||||
* *
|
||||
* File : nvector.h *
|
||||
* Programmers : Radu Serban, LLNL *
|
||||
* Version of : 26 June 2002 *
|
||||
*-----------------------------------------------------------------*
|
||||
* Copyright (c) 2002, The Regents of the University of California *
|
||||
* Produced at the Lawrence Livermore National Laboratory *
|
||||
* All rights reserved *
|
||||
* For details, see sundials/shared/LICENSE *
|
||||
*-----------------------------------------------------------------*
|
||||
* This is the header file for a generic NVECTOR package. *
|
||||
* It defines the N_Vector and M_Env structures: *
|
||||
* M_Env has an implementation-dependent 'content' field *
|
||||
* which contains the data needed to generate a new *
|
||||
* nvector in that implementation and an 'ops' filed *
|
||||
* which is a structure listing operations acting on *
|
||||
* such nvectors. *
|
||||
* N_Vector has an implementation-dependent 'content' field *
|
||||
* which contains the description and actual data of *
|
||||
* the nvector and a 'menv' field which points to the *
|
||||
* M_Env structure used in creating the nvector. *
|
||||
* *
|
||||
* Part I of this file contains type declarations for the *
|
||||
* the following structures: _generic_M_Env, _generic_N_Vector, *
|
||||
* and _generic_N_Vector_Ops, as well as references to pointers *
|
||||
* to such structures (M_Env and N_Vector). *
|
||||
* *
|
||||
* Part II of this file contains the prototypes for the vector *
|
||||
* kernels which operate on N_Vector. *
|
||||
* *
|
||||
* A particular implementation of an NVECTOR package must then *
|
||||
* specify the 'content' fields of M_Env and N_Vector, define *
|
||||
* the propotypes for kernel operations on those N_Vectors *
|
||||
* (NOTE: kernel routine names must be unique to that *
|
||||
* implementation), and finally provide an initialization *
|
||||
* routine (which generates an M_Env with that particular *
|
||||
* 'content' field and links the defined vector kernel routines *
|
||||
* into the 'ops' field). *
|
||||
* *
|
||||
*******************************************************************/
|
||||
#ifdef PHREEQC_IDENT
|
||||
static char const svnidnvector[] = "$Id$";
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus /* wrapper to enable C++ usage */
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef included_nvector_h
|
||||
#define included_nvector_h
|
||||
|
||||
#include "sundialstypes.h" /* definition of types */
|
||||
|
||||
/****************************************************************
|
||||
* Generic definitions of machine environment and N_Vector *
|
||||
****************************************************************/
|
||||
|
||||
/* Forward reference for pointer to N_Vector_Ops object */
|
||||
typedef struct _generic_N_Vector_Ops *N_Vector_Ops;
|
||||
|
||||
/* Forward reference for pointer to M_Env object */
|
||||
typedef struct _generic_M_Env *M_Env;
|
||||
|
||||
/* Forward reference for pointer to N_Vector object */
|
||||
typedef struct _generic_N_Vector *N_Vector;
|
||||
|
||||
/* Define array of N_Vectors */
|
||||
typedef N_Vector *N_Vector_S;
|
||||
|
||||
/* Structure containing function pointers to vector operations */
|
||||
struct _generic_N_Vector_Ops {
|
||||
N_Vector (*nvnew)(integertype, M_Env);
|
||||
N_Vector_S (*nvnewS)(integertype, integertype, M_Env);
|
||||
void (*nvfree)(N_Vector);
|
||||
void (*nvfreeS)(integertype, N_Vector_S);
|
||||
N_Vector (*nvmake)(integertype, realtype *, M_Env);
|
||||
void (*nvdispose)(N_Vector);
|
||||
realtype* (*nvgetdata)(N_Vector);
|
||||
void (*nvsetdata)(realtype *, N_Vector);
|
||||
void (*nvlinearsum)(realtype, N_Vector, realtype, N_Vector, N_Vector);
|
||||
void (*nvconst)(realtype, N_Vector);
|
||||
void (*nvprod)(N_Vector, N_Vector, N_Vector);
|
||||
void (*nvdiv)(N_Vector, N_Vector, N_Vector);
|
||||
void (*nvscale)(realtype, N_Vector, N_Vector);
|
||||
void (*nvabs)(N_Vector, N_Vector);
|
||||
void (*nvinv)(N_Vector, N_Vector);
|
||||
void (*nvaddconst)(N_Vector, realtype, N_Vector);
|
||||
realtype (*nvdotprod)(N_Vector, N_Vector);
|
||||
realtype (*nvmaxnorm)(N_Vector);
|
||||
realtype (*nvwrmsnorm)(N_Vector, N_Vector);
|
||||
realtype (*nvmin)(N_Vector);
|
||||
realtype (*nvwl2norm)(N_Vector, N_Vector);
|
||||
realtype (*nvl1norm)(N_Vector);
|
||||
void (*nvonemask)(N_Vector);
|
||||
void (*nvcompare)(realtype, N_Vector, N_Vector);
|
||||
booleantype (*nvinvtest)(N_Vector, N_Vector);
|
||||
booleantype (*nvconstrprodpos)(N_Vector, N_Vector);
|
||||
booleantype (*nvconstrmask)(N_Vector, N_Vector, N_Vector);
|
||||
realtype (*nvminquotient)(N_Vector, N_Vector);
|
||||
void (*nvprint)(N_Vector);
|
||||
};
|
||||
|
||||
/* A machine environment is a structure with an implementation
|
||||
dependent 'content' representation (used to generate a new vector
|
||||
in that implementation), a set of operations defined in the above
|
||||
structure, and an ID tag */
|
||||
struct _generic_M_Env {
|
||||
void *content;
|
||||
struct _generic_N_Vector_Ops *ops;
|
||||
char tag[8];
|
||||
};
|
||||
|
||||
/* A vector is a structure with an implementation dependent content
|
||||
representation and a pointer to the machine environment
|
||||
corresponding to that implementation */
|
||||
struct _generic_N_Vector {
|
||||
void *content;
|
||||
struct _generic_M_Env *menv;
|
||||
};
|
||||
|
||||
/****************************************************************
|
||||
* Functions exported by nvector *
|
||||
****************************************************************/
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VNew *
|
||||
* Usage : v = N_VNew(n, machEnv); *
|
||||
*--------------------------------------------------------------*
|
||||
* Returns a new N_Vector of length n. The parameter machEnv *
|
||||
* is a pointer to machine environment-specific information. *
|
||||
* If there is not enough memory for a new N_Vector, then *
|
||||
* N_VNew returns NULL. *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
N_Vector N_VNew(integertype n, M_Env machEnv);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VNew_S *
|
||||
* Usage : v = N_VNew_S(ns, n, machEnv); *
|
||||
*--------------------------------------------------------------*
|
||||
* Returns an array of ns new N_Vectors of length n. The *
|
||||
* parameter machEnv is a pointer to machine environment *
|
||||
* specific information. *
|
||||
* If there is not enough memory for a new array of N_Vectors *
|
||||
* or for one of the components, then N_VNew_S returns NULL. *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
N_Vector_S N_VNew_S(integertype ns, integertype n, M_Env machEnv);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VFree *
|
||||
* Usage : N_VFree(v); *
|
||||
*--------------------------------------------------------------*
|
||||
* Frees the N_Vector v. It is illegal to use v after the call *
|
||||
* N_VFree(v). *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
void N_VFree(N_Vector v);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VFree_S *
|
||||
* Usage : N_VFree_S(ns, vs); *
|
||||
*--------------------------------------------------------------*
|
||||
* Frees the array of ns N_Vectors vs. *
|
||||
* It is illegal to use vs after the call N_VFree_S(Ns,vs). *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
void N_VFree_S(integertype ns, N_Vector_S vs);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VMake *
|
||||
* Usage : v = N_VMake(n, v_data, machEnv); *
|
||||
*--------------------------------------------------------------*
|
||||
* Creates an N_Vector with component array data allocated by *
|
||||
* the user. *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
N_Vector N_VMake(integertype n, realtype *v_data, M_Env machEnv);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VDispose *
|
||||
* Usage : N_VDispose(v); *
|
||||
*--------------------------------------------------------------*
|
||||
* Destroys an N_Vector with component array data allocated by *
|
||||
* the user. *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
void N_VDispose(N_Vector v);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VGetData *
|
||||
* Usage : v_data = N_VGetData(v); *
|
||||
*--------------------------------------------------------------*
|
||||
* Extracts the data component array from the N_Vector v. *
|
||||
* Note: this routine is used in the solver-specific interfaces *
|
||||
* to the dense and banded linear solvers, as well as the *
|
||||
* interfaces to the banded preconditioners provided with *
|
||||
* SUNDIALS. It needs not be implemented by a user *
|
||||
* defined NVECTOR module, if these linear solvers are not*
|
||||
* used. *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
realtype *N_VGetData(N_Vector v);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VSetData *
|
||||
* Usage : N_VSetData(v_data, v); *
|
||||
*--------------------------------------------------------------*
|
||||
* Attaches the data component array v_data to the N_Vector v. *
|
||||
* Note: this routine is used in the solver-specific interfaces *
|
||||
* to the dense and banded linear solvers, as well as the *
|
||||
* interfaces to the banded preconditioners provided with *
|
||||
* SUNDIALS. It needs not be implemented by a user *
|
||||
* defined NVECTOR module, if these linear solvers are not*
|
||||
* used. *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
void N_VSetData(realtype *v_data, N_Vector v);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VLinearSum *
|
||||
* Operation : z = a x + b y *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
void N_VLinearSum(realtype a, N_Vector x, realtype b, N_Vector y,
|
||||
N_Vector z);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VConst *
|
||||
* Operation : z[i] = c for i=0, 1, ..., N-1 *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
void N_VConst(realtype c, N_Vector z);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VProd *
|
||||
* Operation : z[i] = x[i] * y[i] for i=0, 1, ..., N-1 *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
void N_VProd(N_Vector x, N_Vector y, N_Vector z);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VDiv *
|
||||
* Operation : z[i] = x[i] / y[i] for i=0, 1, ..., N-1 *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
void N_VDiv(N_Vector x, N_Vector y, N_Vector z);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VScale *
|
||||
* Operation : z = c x *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
void N_VScale(realtype c, N_Vector x, N_Vector z);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VAbs *
|
||||
* Operation : z[i] = |x[i]|, for i=0, 1, ..., N-1 *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
void N_VAbs(N_Vector x, N_Vector z);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VInv *
|
||||
* Operation : z[i] = 1.0 / x[i] for i = 0, 1, ..., N-1 *
|
||||
*--------------------------------------------------------------*
|
||||
* This routine does not check for division by 0. It should be *
|
||||
* called only with an N_Vector x which is guaranteed to have *
|
||||
* all non-zero components. *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
void N_VInv(N_Vector x, N_Vector z);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VAddConst *
|
||||
* Operation : z[i] = x[i] + b for i = 0, 1, ..., N-1 *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
void N_VAddConst(N_Vector x, realtype b, N_Vector z);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VDotProd *
|
||||
* Usage : dotprod = N_VDotProd(x, y); *
|
||||
*--------------------------------------------------------------*
|
||||
* Returns the value of the ordinary dot product of x and y: *
|
||||
* -> sum (i=0 to N-1) {x[i] * y[i]} *
|
||||
* Returns 0.0 if N <= 0. *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
realtype N_VDotProd(N_Vector x, N_Vector y);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VMaxNorm *
|
||||
* Usage : maxnorm = N_VMaxNorm(x); *
|
||||
*--------------------------------------------------------------*
|
||||
* Returns the maximum norm of x: *
|
||||
* -> max (i=0 to N-1) |x[i]| *
|
||||
* Returns 0.0 if N <= 0. *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
realtype N_VMaxNorm(N_Vector x);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VWrmsNorm *
|
||||
* Usage : wrmsnorm = N_VWrmsNorm(x, w); *
|
||||
*--------------------------------------------------------------*
|
||||
* Returns the weighted root mean square norm of x with *
|
||||
* weight vector w: *
|
||||
* -> sqrt [(sum (i=0 to N-1) {(x[i] * w[i])^2}) / N] *
|
||||
* Returns 0.0 if N <= 0. *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
realtype N_VWrmsNorm(N_Vector x, N_Vector w);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VMin *
|
||||
* Usage : min = N_VMin(x); *
|
||||
*--------------------------------------------------------------*
|
||||
* Returns the smallest element of x: *
|
||||
* -> min (i=0 to N-1) x[i] *
|
||||
* Returns 0.0 if N <= 0. *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
realtype N_VMin(N_Vector x);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VWL2Norm *
|
||||
* Usage : wl2norm = N_VWL2Norm(x, w); *
|
||||
*--------------------------------------------------------------*
|
||||
* Returns the weighted Euclidean L2 norm of x with *
|
||||
* weight vector w: *
|
||||
* -> sqrt [(sum (i=0 to N-1) {(x[i] * w[i])^2}) ] *
|
||||
* Returns 0.0 if N <= 0. *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
realtype N_VWL2Norm(N_Vector x, N_Vector w);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VL1Norm *
|
||||
* Usage : l1norm = N_VL1Norm(x); *
|
||||
*--------------------------------------------------------------*
|
||||
* Returns the L1 norm of x: *
|
||||
* -> sum (i=0 to N-1) {ABS(x[i])} *
|
||||
* Returns 0.0 if N <= 0. *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
realtype N_VL1Norm(N_Vector x);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VOneMask *
|
||||
* Operation : x[i] = 1.0 if |x[i]| != 0. i = 0, 1, ..., N-1 *
|
||||
* 0.0 otherwise *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
void N_VOneMask(N_Vector x);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VCompare *
|
||||
* Operation : z[i] = 1.0 if |x[i]| >= c i = 0, 1, ..., N-1 *
|
||||
* 0.0 otherwise *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
void N_VCompare(realtype c, N_Vector x, N_Vector z);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VInvTest *
|
||||
* Operation : z[i] = 1.0 / x[i] with a test for x[i]==0.0 *
|
||||
* before inverting x[i]. *
|
||||
*--------------------------------------------------------------*
|
||||
* This routine returns TRUE if all components of x are *
|
||||
* non-zero (successful inversion) and returns FALSE *
|
||||
* otherwise. *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
booleantype N_VInvTest(N_Vector x, N_Vector z);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VConstrProdPos *
|
||||
* Usage : booltest = N_VConstrProdPos(c,x); *
|
||||
*--------------------------------------------------------------*
|
||||
* Returns a boolean equal to *
|
||||
* FALSE if some c[i] != 0.0 and x[i]*c[i] <= 0.0, or *
|
||||
* TRUE otherwise. *
|
||||
* *
|
||||
* This routine is used for constraint checking. *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
booleantype N_VConstrProdPos(N_Vector c, N_Vector x);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VConstrMask *
|
||||
* Operation : m[i] = 1.0 if constraint test fails for x[i] *
|
||||
* m[i] = 0.0 if constraint test passes for x[i] *
|
||||
* where the constraint tests are as follows: *
|
||||
* If c[i] = 2.0, then x[i] must be > 0.0. *
|
||||
* If c[i] = 1.0, then x[i] must be >= 0.0. *
|
||||
* If c[i] = -1.0, then x[i] must be <= 0.0. *
|
||||
* If c[i] = -2.0, then x[i] must be < 0.0. *
|
||||
*--------------------------------------------------------------*
|
||||
* This routine returns a boolean FALSE if any element failed *
|
||||
* the constraint test, TRUE if all passed. It also sets a *
|
||||
* mask vector m, with elements equal to 1.0 where the *
|
||||
* corresponding constraint test failed, and equal to 0.0 *
|
||||
* where the constraint test passed. *
|
||||
* This routine is specialized in that it is used only for *
|
||||
* constraint checking. *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
booleantype N_VConstrMask(N_Vector c, N_Vector x, N_Vector m);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VMinQuotient *
|
||||
* Operation : minq = min ( num[i]/denom[i]) over all i such *
|
||||
* that denom[i] != 0. *
|
||||
*--------------------------------------------------------------*
|
||||
* This routine returns the minimum of the quotients obtained *
|
||||
* by term-wise dividing num[i] by denom[i]. A zero element *
|
||||
* in denom will be skipped. If no such quotients are found, *
|
||||
* then the large value 1.e99 is returned. *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
realtype N_VMinQuotient(N_Vector num, N_Vector denom);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function : N_VPrint *
|
||||
* Usage : N_VPrint(x); *
|
||||
*--------------------------------------------------------------*
|
||||
* Prints the N_Vector x to stdout. *
|
||||
* This routine is provided as an aid in debugging code which *
|
||||
* uses this vector package. *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
void N_VPrint(N_Vector x);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@ -1,869 +0,0 @@
|
||||
/*******************************************************************
|
||||
* *
|
||||
* File : nvector_serial.c *
|
||||
* Programmers : Scott D. Cohen, Alan C. Hindmarsh, *
|
||||
* Radu Serban, and Allan G. Taylor, LLNL *
|
||||
* Version of : 26 June 2002 *
|
||||
*-----------------------------------------------------------------*
|
||||
* Copyright (c) 2002, The Regents of the University of California *
|
||||
* Produced at the Lawrence Livermore National Laboratory *
|
||||
* All rights reserved *
|
||||
* For details, see sundials/shared/LICENSE *
|
||||
*-----------------------------------------------------------------*
|
||||
* This is the implementation file for a serial implementation *
|
||||
* of the NVECTOR package. It contains the implementation of *
|
||||
* the serial machine environment intialization and free *
|
||||
* routines (and of the Fortran callable interfaces to them) *
|
||||
* and of the N_Vector kernels listed in nvector_serial.h. *
|
||||
* *
|
||||
*******************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "nvector_serial.h"
|
||||
#include "sundialstypes.h"
|
||||
#include "sundialsmath.h"
|
||||
#include "output.h"
|
||||
#include "phqalloc.h"
|
||||
/* WARNING don't include any headers below here */
|
||||
#define malloc PHRQ_malloc
|
||||
static char const svnid[] = "$Id: nvector_serial.c 663 2005-11-16 00:46:04Z dlpark $";
|
||||
|
||||
#define ZERO RCONST(0.0)
|
||||
#define HALF RCONST(0.5)
|
||||
#define ONE RCONST(1.0)
|
||||
#define ONEPT5 RCONST(1.5)
|
||||
|
||||
|
||||
/* Private Helper Prototypes */
|
||||
/* z=x */
|
||||
static void VCopy_Serial(N_Vector x, N_Vector z);
|
||||
/* z=x+y */
|
||||
static void VSum_Serial(N_Vector x, N_Vector y, N_Vector z);
|
||||
/* z=x-y */
|
||||
static void VDiff_Serial(N_Vector x, N_Vector y, N_Vector z);
|
||||
/* z=-x */
|
||||
static void VNeg_Serial(N_Vector x, N_Vector z);
|
||||
/* z=c(x+y) */
|
||||
static void VScaleSum_Serial(realtype c, N_Vector x, N_Vector y, N_Vector z);
|
||||
/* z=c(x-y) */
|
||||
static void VScaleDiff_Serial(realtype c, N_Vector x, N_Vector y, N_Vector z);
|
||||
/* z=ax+y */
|
||||
static void VLin1_Serial(realtype a, N_Vector x, N_Vector y, N_Vector z);
|
||||
/* z=ax-y */
|
||||
static void VLin2_Serial(realtype a, N_Vector x, N_Vector y, N_Vector z);
|
||||
/* y <- ax+y */
|
||||
static void Vaxpy_Serial(realtype a, N_Vector x, N_Vector y);
|
||||
/* x <- ax */
|
||||
static void VScaleBy_Serial(realtype a, N_Vector x);
|
||||
|
||||
/********************* Exported Functions ************************/
|
||||
|
||||
/* Serial implementation of the machine environment
|
||||
initialization routine */
|
||||
|
||||
M_Env M_EnvInit_Serial(integertype vec_length)
|
||||
{
|
||||
M_Env me;
|
||||
|
||||
if (svnid == NULL) fprintf(stderr," ");
|
||||
/* Create machine environment structure */
|
||||
me = (M_Env) malloc(sizeof *me);
|
||||
if (me == NULL) return(NULL);
|
||||
|
||||
/* Create serial content of machine environment structure */
|
||||
me->content = (M_EnvSerialContent) malloc(sizeof(struct _M_EnvSerialContent));
|
||||
if (me->content == NULL) {
|
||||
free(me);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/* Load serial content of machine environment structure */
|
||||
ME_CONTENT_S(me)->length = vec_length;
|
||||
|
||||
/* Attach vector operations */
|
||||
me->ops = (N_Vector_Ops) malloc(sizeof(struct _generic_N_Vector_Ops));
|
||||
if (me->ops == NULL) {
|
||||
free(me->content);
|
||||
free(me);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
me->ops->nvnew = N_VNew_Serial;
|
||||
me->ops->nvnewS = N_VNew_S_Serial;
|
||||
me->ops->nvfree = N_VFree_Serial;
|
||||
me->ops->nvfreeS = N_VFree_S_Serial;
|
||||
me->ops->nvmake = N_VMake_Serial;
|
||||
me->ops->nvdispose = N_VDispose_Serial;
|
||||
me->ops->nvgetdata = N_VGetData_Serial;
|
||||
me->ops->nvsetdata = N_VSetData_Serial;
|
||||
me->ops->nvlinearsum = N_VLinearSum_Serial;
|
||||
me->ops->nvconst = N_VConst_Serial;
|
||||
me->ops->nvprod = N_VProd_Serial;
|
||||
me->ops->nvdiv = N_VDiv_Serial;
|
||||
me->ops->nvscale = N_VScale_Serial;
|
||||
me->ops->nvabs = N_VAbs_Serial;
|
||||
me->ops->nvinv = N_VInv_Serial;
|
||||
me->ops->nvaddconst = N_VAddConst_Serial;
|
||||
me->ops->nvdotprod = N_VDotProd_Serial;
|
||||
me->ops->nvmaxnorm = N_VMaxNorm_Serial;
|
||||
me->ops->nvwrmsnorm = N_VWrmsNorm_Serial;
|
||||
me->ops->nvmin = N_VMin_Serial;
|
||||
me->ops->nvwl2norm = N_VWL2Norm_Serial;
|
||||
me->ops->nvl1norm = N_VL1Norm_Serial;
|
||||
me->ops->nvonemask = N_VOneMask_Serial;
|
||||
me->ops->nvcompare = N_VCompare_Serial;
|
||||
me->ops->nvinvtest = N_VInvTest_Serial;
|
||||
me->ops->nvconstrprodpos = N_VConstrProdPos_Serial;
|
||||
me->ops->nvconstrmask = N_VConstrMask_Serial;
|
||||
me->ops->nvminquotient = N_VMinQuotient_Serial;
|
||||
me->ops->nvprint = N_VPrint_Serial;
|
||||
|
||||
/* Attach ID tag */
|
||||
strcpy(me->tag, ID_TAG_S);
|
||||
|
||||
return(me);
|
||||
|
||||
}
|
||||
|
||||
/* Serial implementation of the machine environment
|
||||
free routine */
|
||||
|
||||
void M_EnvFree_Serial(M_Env machEnv)
|
||||
{
|
||||
if (machEnv == NULL) return;
|
||||
|
||||
free(machEnv->content);
|
||||
free(machEnv->ops);
|
||||
free(machEnv);
|
||||
}
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
/* BEGIN implementation of vector operations */
|
||||
|
||||
N_Vector N_VNew_Serial(integertype n, M_Env machEnv)
|
||||
{
|
||||
N_Vector v;
|
||||
integertype length;
|
||||
|
||||
if (n <= 0) return(NULL);
|
||||
|
||||
if (machEnv == NULL) return(NULL);
|
||||
|
||||
v = (N_Vector) malloc(sizeof *v);
|
||||
if (v == NULL) return(NULL);
|
||||
|
||||
v->content = (N_VectorSerialContent) malloc(sizeof(struct _N_VectorSerialContent));
|
||||
if (v->content == NULL) {
|
||||
free(v);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
length = ME_CONTENT_S(machEnv)->length;
|
||||
|
||||
NV_CONTENT_S(v)->data = (realtype *) malloc(length * sizeof(realtype));
|
||||
if(NV_CONTENT_S(v)->data == NULL) {
|
||||
free(v->content);
|
||||
free(v);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
NV_CONTENT_S(v)->length = length;
|
||||
|
||||
v->menv = machEnv;
|
||||
|
||||
return(v);
|
||||
}
|
||||
|
||||
|
||||
N_Vector_S N_VNew_S_Serial(integertype ns, integertype n, M_Env machEnv)
|
||||
{
|
||||
N_Vector_S vs;
|
||||
integertype is, j;
|
||||
|
||||
|
||||
if (ns <= 0 || n <= 0) return(NULL);
|
||||
|
||||
if (machEnv == NULL) return(NULL);
|
||||
|
||||
vs = (N_Vector_S) malloc(ns * sizeof(N_Vector *));
|
||||
if (vs == NULL) return(NULL);
|
||||
|
||||
for (is=0; is<ns; is++) {
|
||||
vs[is] = N_VNew_Serial(n, machEnv);
|
||||
if (vs[is] == NULL) {
|
||||
for (j=0; j<is; j++) N_VFree_Serial(vs[j]);
|
||||
free(vs);
|
||||
return(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
return(vs);
|
||||
}
|
||||
|
||||
|
||||
void N_VFree_Serial(N_Vector v)
|
||||
{
|
||||
free(NV_DATA_S(v));
|
||||
free(NV_CONTENT_S(v));
|
||||
free(v);
|
||||
}
|
||||
|
||||
|
||||
void N_VFree_S_Serial(integertype ns, N_Vector_S vs)
|
||||
{
|
||||
integertype is;
|
||||
|
||||
for (is=0; is<ns; is++) N_VFree_Serial(vs[is]);
|
||||
free(vs);
|
||||
}
|
||||
|
||||
N_Vector N_VMake_Serial(integertype n, realtype *v_data, M_Env machEnv)
|
||||
{
|
||||
N_Vector v;
|
||||
integertype length;
|
||||
|
||||
if (n <= 0) return(NULL);
|
||||
|
||||
if (machEnv == NULL) return(NULL);
|
||||
|
||||
v = (N_Vector) malloc(sizeof *v);
|
||||
if (v == NULL) return(NULL);
|
||||
|
||||
v->content = (N_VectorSerialContent) malloc(sizeof(struct _N_VectorSerialContent));
|
||||
if (v->content == NULL) {
|
||||
free(v);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
length = ME_CONTENT_S(machEnv)->length;
|
||||
|
||||
NV_CONTENT_S(v)->data = v_data;
|
||||
|
||||
NV_CONTENT_S(v)->length = length;
|
||||
|
||||
v->menv = machEnv;
|
||||
|
||||
return(v);
|
||||
}
|
||||
|
||||
void N_VDispose_Serial(N_Vector v)
|
||||
{
|
||||
free(NV_CONTENT_S(v));
|
||||
free(v);
|
||||
}
|
||||
|
||||
realtype *N_VGetData_Serial(N_Vector v)
|
||||
{
|
||||
realtype *v_data;
|
||||
v_data = NV_CONTENT_S(v)->data;
|
||||
return(v_data);
|
||||
}
|
||||
|
||||
void N_VSetData_Serial(realtype *v_data, N_Vector v)
|
||||
{
|
||||
NV_CONTENT_S(v)->data = v_data;
|
||||
}
|
||||
|
||||
void N_VLinearSum_Serial(realtype a, N_Vector x, realtype b, N_Vector y, N_Vector z)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype c, *xd, *yd, *zd;
|
||||
N_Vector v1, v2;
|
||||
booleantype test;
|
||||
|
||||
if ((b == ONE) && (z == y)) { /* BLAS usage: axpy y <- ax+y */
|
||||
Vaxpy_Serial(a,x,y);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((a == ONE) && (z == x)) { /* BLAS usage: axpy x <- by+x */
|
||||
Vaxpy_Serial(b,y,x);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Case: a == b == 1.0 */
|
||||
|
||||
if ((a == ONE) && (b == ONE)) {
|
||||
VSum_Serial(x, y, z);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Cases: (1) a == 1.0, b = -1.0, (2) a == -1.0, b == 1.0 */
|
||||
|
||||
/*if ((test = ((a == ONE) && (b == -ONE))) || ((a == -ONE) && (b == ONE))) {*/
|
||||
test = ((a == ONE) && (b == -ONE));
|
||||
if (test || ((a == -ONE) && (b == ONE))) {
|
||||
v1 = test ? y : x;
|
||||
v2 = test ? x : y;
|
||||
VDiff_Serial(v2, v1, z);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Cases: (1) a == 1.0, b == other or 0.0, (2) a == other or 0.0, b == 1.0 */
|
||||
/* if a or b is 0.0, then user should have called N_VScale */
|
||||
|
||||
/*if ((test = (a == ONE)) || (b == ONE)) {*/
|
||||
test = (a == ONE);
|
||||
if (test || (b == ONE)) {
|
||||
c = test ? b : a;
|
||||
v1 = test ? y : x;
|
||||
v2 = test ? x : y;
|
||||
VLin1_Serial(c, v1, v2, z);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Cases: (1) a == -1.0, b != 1.0, (2) a != 1.0, b == -1.0 */
|
||||
|
||||
/*if ((test = (a == -ONE)) || (b == -ONE)) {*/
|
||||
test = (a == -ONE);
|
||||
if (test || (b == -ONE)) {
|
||||
c = test ? b : a;
|
||||
v1 = test ? y : x;
|
||||
v2 = test ? x : y;
|
||||
VLin2_Serial(c, v1, v2, z);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Case: a == b */
|
||||
/* catches case both a and b are 0.0 - user should have called N_VConst */
|
||||
|
||||
if (a == b) {
|
||||
VScaleSum_Serial(a, x, y, z);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Case: a == -b */
|
||||
|
||||
if (a == -b) {
|
||||
VScaleDiff_Serial(a, x, y, z);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Do all cases not handled above:
|
||||
(1) a == other, b == 0.0 - user should have called N_VScale
|
||||
(2) a == 0.0, b == other - user should have called N_VScale
|
||||
(3) a,b == other, a !=b, a != -b */
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
yd = NV_DATA_S(y);
|
||||
zd = NV_DATA_S(z);
|
||||
|
||||
for (i=0; i < N; i++)
|
||||
*zd++ = a * (*xd++) + b * (*yd++);
|
||||
}
|
||||
|
||||
|
||||
void N_VConst_Serial(realtype c, N_Vector z)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype *zd;
|
||||
|
||||
N = NV_LENGTH_S(z);
|
||||
zd = NV_DATA_S(z);
|
||||
|
||||
for (i=0; i < N; i++)
|
||||
*zd++ = c;
|
||||
}
|
||||
|
||||
|
||||
void N_VProd_Serial(N_Vector x, N_Vector y, N_Vector z)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype *xd, *yd, *zd;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
yd = NV_DATA_S(y);
|
||||
zd = NV_DATA_S(z);
|
||||
|
||||
for (i=0; i < N; i++)
|
||||
*zd++ = (*xd++) * (*yd++);
|
||||
}
|
||||
|
||||
|
||||
void N_VDiv_Serial(N_Vector x, N_Vector y, N_Vector z)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype *xd, *yd, *zd;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
yd = NV_DATA_S(y);
|
||||
zd = NV_DATA_S(z);
|
||||
|
||||
for (i=0; i < N; i++)
|
||||
*zd++ = (*xd++) / (*yd++);
|
||||
}
|
||||
|
||||
|
||||
void N_VScale_Serial(realtype c, N_Vector x, N_Vector z)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype *xd, *zd;
|
||||
|
||||
if (z == x) { /* BLAS usage: scale x <- cx */
|
||||
VScaleBy_Serial(c, x);
|
||||
return;
|
||||
}
|
||||
|
||||
if (c == ONE) {
|
||||
VCopy_Serial(x, z);
|
||||
} else if (c == -ONE) {
|
||||
VNeg_Serial(x, z);
|
||||
} else {
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
zd = NV_DATA_S(z);
|
||||
for (i=0; i < N; i++)
|
||||
*zd++ = c * (*xd++);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void N_VAbs_Serial(N_Vector x, N_Vector z)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype *xd, *zd;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
zd = NV_DATA_S(z);
|
||||
|
||||
for (i=0; i < N; i++, xd++, zd++)
|
||||
*zd = ABS(*xd);
|
||||
}
|
||||
|
||||
|
||||
void N_VInv_Serial(N_Vector x, N_Vector z)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype *xd, *zd;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
zd = NV_DATA_S(z);
|
||||
|
||||
for (i=0; i < N; i++)
|
||||
*zd++ = ONE / (*xd++);
|
||||
}
|
||||
|
||||
|
||||
void N_VAddConst_Serial(N_Vector x, realtype b, N_Vector z)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype *xd, *zd;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
zd = NV_DATA_S(z);
|
||||
|
||||
for (i=0; i < N; i++)
|
||||
*zd++ = (*xd++) + b;
|
||||
}
|
||||
|
||||
|
||||
realtype N_VDotProd_Serial(N_Vector x, N_Vector y)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype sum = ZERO, *xd, *yd;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
yd = NV_DATA_S(y);
|
||||
|
||||
for (i=0; i < N; i++)
|
||||
sum += (*xd++) * (*yd++);
|
||||
|
||||
return(sum);
|
||||
}
|
||||
|
||||
|
||||
realtype N_VMaxNorm_Serial(N_Vector x)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype max = ZERO, *xd;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
|
||||
for (i=0; i < N; i++, xd++) {
|
||||
if (ABS(*xd) > max) max = ABS(*xd);
|
||||
}
|
||||
|
||||
return(max);
|
||||
}
|
||||
|
||||
|
||||
realtype N_VWrmsNorm_Serial(N_Vector x, N_Vector w)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype sum = ZERO, prodi, *xd, *wd;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
wd = NV_DATA_S(w);
|
||||
|
||||
for (i=0; i < N; i++) {
|
||||
prodi = (*xd++) * (*wd++);
|
||||
sum += prodi * prodi;
|
||||
}
|
||||
|
||||
return(RSqrt(sum / N));
|
||||
}
|
||||
|
||||
|
||||
realtype N_VMin_Serial(N_Vector x)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype min, *xd;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
|
||||
min = xd[0];
|
||||
|
||||
xd++;
|
||||
for (i=1; i < N; i++, xd++) {
|
||||
if ((*xd) < min) min = *xd;
|
||||
}
|
||||
|
||||
return(min);
|
||||
}
|
||||
|
||||
|
||||
realtype N_VWL2Norm_Serial(N_Vector x, N_Vector w)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype sum = ZERO, prodi, *xd, *wd;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
wd = NV_DATA_S(w);
|
||||
|
||||
for (i=0; i < N; i++) {
|
||||
prodi = (*xd++) * (*wd++);
|
||||
sum += prodi * prodi;
|
||||
}
|
||||
|
||||
return(RSqrt(sum));
|
||||
}
|
||||
|
||||
|
||||
realtype N_VL1Norm_Serial(N_Vector x)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype sum = ZERO, *xd;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
|
||||
for (i=0; i<N; i++)
|
||||
sum += ABS(xd[i]);
|
||||
|
||||
return(sum);
|
||||
}
|
||||
|
||||
|
||||
void N_VOneMask_Serial(N_Vector x)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype *xd;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
|
||||
for (i=0; i<N; i++,xd++) {
|
||||
if (*xd != ZERO) *xd = ONE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void N_VCompare_Serial(realtype c, N_Vector x, N_Vector z)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype *xd, *zd;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
zd = NV_DATA_S(z);
|
||||
|
||||
for (i=0; i < N; i++, xd++, zd++) {
|
||||
*zd = (ABS(*xd) >= c) ? ONE : ZERO;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
booleantype N_VInvTest_Serial(N_Vector x, N_Vector z)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype *xd, *zd;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
zd = NV_DATA_S(z);
|
||||
|
||||
for (i=0; i < N; i++) {
|
||||
if (*xd == ZERO) return(FALSE);
|
||||
*zd++ = ONE / (*xd++);
|
||||
}
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
|
||||
booleantype N_VConstrProdPos_Serial(N_Vector c, N_Vector x)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype *xd, *cd;
|
||||
booleantype test;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
cd = NV_DATA_S(c);
|
||||
|
||||
test = TRUE;
|
||||
|
||||
for (i=0; i < N; i++, xd++,cd++) {
|
||||
if (*cd != ZERO) {
|
||||
if ((*xd)*(*cd) <= ZERO) {
|
||||
test = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return(test);
|
||||
}
|
||||
|
||||
|
||||
booleantype N_VConstrMask_Serial(N_Vector c, N_Vector x, N_Vector m)
|
||||
{
|
||||
integertype i, N;
|
||||
booleantype test;
|
||||
realtype *cd, *xd, *md;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
cd = NV_DATA_S(c);
|
||||
md = NV_DATA_S(m);
|
||||
|
||||
test = TRUE;
|
||||
|
||||
for (i=0; i<N; i++, cd++, xd++, md++) {
|
||||
*md = ZERO;
|
||||
if (*cd == ZERO) continue;
|
||||
if (*cd > ONEPT5 || (*cd) < -ONEPT5) {
|
||||
if ( (*xd)*(*cd) <= ZERO) {test = FALSE; *md = ONE; }
|
||||
continue;
|
||||
}
|
||||
if ( (*cd) > HALF || (*cd) < -HALF) {
|
||||
if ( (*xd)*(*cd) < ZERO ) {test = FALSE; *md = ONE; }
|
||||
}
|
||||
}
|
||||
return(test);
|
||||
}
|
||||
|
||||
|
||||
realtype N_VMinQuotient_Serial(N_Vector num, N_Vector denom)
|
||||
{
|
||||
booleantype notEvenOnce;
|
||||
integertype i, N;
|
||||
realtype *nd, *dd, min;
|
||||
|
||||
N = NV_LENGTH_S(num);
|
||||
nd = NV_DATA_S(num);
|
||||
dd = NV_DATA_S(denom);
|
||||
min = 0;
|
||||
|
||||
notEvenOnce = TRUE;
|
||||
|
||||
for (i=0; i<N; i++, nd++, dd++) {
|
||||
if (*dd == ZERO) continue;
|
||||
else {
|
||||
if (notEvenOnce) {
|
||||
min = *nd / *dd ;
|
||||
notEvenOnce = FALSE;
|
||||
}
|
||||
else
|
||||
min = MIN(min, (*nd)/(*dd));
|
||||
}
|
||||
}
|
||||
if (notEvenOnce) min = 1.e99;
|
||||
|
||||
return(min);
|
||||
}
|
||||
|
||||
|
||||
void N_VPrint_Serial(N_Vector x)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype *xd;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
|
||||
for (i=0; i < N; i++) printf("%11.8g\n", (double) (*xd++));
|
||||
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
||||
/***************** Private Helper Functions **********************/
|
||||
|
||||
|
||||
static void VCopy_Serial(N_Vector x, N_Vector z)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype *xd, *zd;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
zd = NV_DATA_S(z);
|
||||
|
||||
for (i=0; i < N; i++)
|
||||
*zd++ = *xd++;
|
||||
}
|
||||
|
||||
|
||||
static void VSum_Serial(N_Vector x, N_Vector y, N_Vector z)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype *xd, *yd, *zd;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
yd = NV_DATA_S(y);
|
||||
zd = NV_DATA_S(z);
|
||||
|
||||
for (i=0; i < N; i++)
|
||||
*zd++ = (*xd++) + (*yd++);
|
||||
}
|
||||
|
||||
|
||||
static void VDiff_Serial(N_Vector x, N_Vector y, N_Vector z)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype *xd, *yd, *zd;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
yd = NV_DATA_S(y);
|
||||
zd = NV_DATA_S(z);
|
||||
|
||||
for (i=0; i < N; i++)
|
||||
*zd++ = (*xd++) - (*yd++);
|
||||
}
|
||||
|
||||
|
||||
static void VNeg_Serial(N_Vector x, N_Vector z)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype *xd, *zd;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
zd = NV_DATA_S(z);
|
||||
|
||||
for (i=0; i < N; i++)
|
||||
*zd++ = -(*xd++);
|
||||
}
|
||||
|
||||
|
||||
static void VScaleSum_Serial(realtype c, N_Vector x, N_Vector y, N_Vector z)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype *xd, *yd, *zd;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
yd = NV_DATA_S(y);
|
||||
zd = NV_DATA_S(z);
|
||||
|
||||
for (i=0; i < N; i++)
|
||||
*zd++ = c * ((*xd++) + (*yd++));
|
||||
}
|
||||
|
||||
|
||||
static void VScaleDiff_Serial(realtype c, N_Vector x, N_Vector y, N_Vector z)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype *xd, *yd, *zd;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
yd = NV_DATA_S(y);
|
||||
zd = NV_DATA_S(z);
|
||||
|
||||
for (i=0; i < N; i++)
|
||||
*zd++ = c * ((*xd++) - (*yd++));
|
||||
}
|
||||
|
||||
|
||||
static void VLin1_Serial(realtype a, N_Vector x, N_Vector y, N_Vector z)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype *xd, *yd, *zd;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
yd = NV_DATA_S(y);
|
||||
zd = NV_DATA_S(z);
|
||||
|
||||
for (i=0; i < N; i++)
|
||||
*zd++ = a * (*xd++) + (*yd++);
|
||||
}
|
||||
|
||||
|
||||
static void VLin2_Serial(realtype a, N_Vector x, N_Vector y, N_Vector z)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype *xd, *yd, *zd;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
yd = NV_DATA_S(y);
|
||||
zd = NV_DATA_S(z);
|
||||
|
||||
for (i=0; i < N; i++)
|
||||
*zd++ = a * (*xd++) - (*yd++);
|
||||
}
|
||||
|
||||
static void Vaxpy_Serial(realtype a, N_Vector x, N_Vector y)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype *xd, *yd;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
yd = NV_DATA_S(y);
|
||||
|
||||
if (a == ONE) {
|
||||
for (i=0; i < N; i++)
|
||||
*yd++ += (*xd++);
|
||||
return;
|
||||
}
|
||||
|
||||
if (a == -ONE) {
|
||||
for (i=0; i < N; i++)
|
||||
*yd++ -= (*xd++);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i=0; i < N; i++)
|
||||
*yd++ += a * (*xd++);
|
||||
}
|
||||
|
||||
static void VScaleBy_Serial(realtype a, N_Vector x)
|
||||
{
|
||||
integertype i, N;
|
||||
realtype *xd;
|
||||
|
||||
N = NV_LENGTH_S(x);
|
||||
xd = NV_DATA_S(x);
|
||||
|
||||
for (i=0; i < N; i++)
|
||||
*xd++ *= a;
|
||||
}
|
||||
325
nvector_serial.h
325
nvector_serial.h
@ -1,325 +0,0 @@
|
||||
/*******************************************************************
|
||||
* *
|
||||
* File : nvector_serial.h *
|
||||
* Programmers : Scott D. Cohen, Alan C. Hindmarsh, *
|
||||
* : Radu Serban, and Allan G. Taylor, LLNL *
|
||||
* Version of : 26 June 2002 *
|
||||
*-----------------------------------------------------------------*
|
||||
* Copyright (c) 2002, The Regents of the University of California *
|
||||
* Produced at the Lawrence Livermore National Laboratory *
|
||||
* All rights reserved *
|
||||
* For details, see sundials/shared/LICENSE *
|
||||
*-----------------------------------------------------------------*
|
||||
* This is the header file for a serial implementation of the *
|
||||
* NVECTOR package. *
|
||||
* *
|
||||
* Part I of this file contains declarations which are specific *
|
||||
* to the particular machine environment in which this version *
|
||||
* of the vector package is to be used. This includes the *
|
||||
* typedef for the 'content' fields of the structures M_Env and *
|
||||
* N_Vector (M_EnvSerialContent and N_VectorSerialContent, *
|
||||
* respectively). *
|
||||
* *
|
||||
* Part II of this file defines accessor macros that allow the *
|
||||
* user to use efficiently the type N_Vector without making *
|
||||
* explicit references to its underlying representation. *
|
||||
* *
|
||||
* Part III of this file contains the prototype for the *
|
||||
* initialization routine specific to this implementation *
|
||||
* (M_EnvInit_Serial) as well as prototypes for the vector *
|
||||
* kernels which operate on the serial N_Vector. These *
|
||||
* prototypes are unique to this particular implementation of *
|
||||
* the vector package. *
|
||||
* *
|
||||
* NOTES: *
|
||||
* *
|
||||
* The definitions of the generic M_Env and N_Vector structures *
|
||||
* are in the header file nvector.h. *
|
||||
* *
|
||||
* The definitions of the types realtype and integertype are in *
|
||||
* the header file sundialstypes.h and these may be changed *
|
||||
* according to the user's needs. The sundialstypes.h file also *
|
||||
* contains the definition for the type booleantype. *
|
||||
* *
|
||||
* N_Vector arguments to arithmetic kernels need not be *
|
||||
* distinct. Thus, for example, the call *
|
||||
* N_VLinearSum_Serial(a,x,b,y,y); y <- ax+by *
|
||||
* is legal. *
|
||||
* *
|
||||
* This version of nvector is for the ordinary sequential *
|
||||
* machine environment. In the documentation given below, N is *
|
||||
* the length of all N_Vector parameters and x[i] denotes the *
|
||||
* ith component of the N_Vector x, where 0 <= i <= N-1. *
|
||||
* *
|
||||
*******************************************************************/
|
||||
#ifdef PHREEQC_IDENT
|
||||
static char const svnidnvector_serial[] = "$Id$";
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus /* wrapper to enable C++ usage */
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef included_nvector_serial_h
|
||||
#define included_nvector_serial_h
|
||||
|
||||
#include "nvector.h" /* Generic M_Env and N_Vector type definitions */
|
||||
#include "sundialstypes.h"
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* PART I: *
|
||||
* Serial implementaion of M_Env and N_Vector *
|
||||
****************************************************************/
|
||||
|
||||
/* The serial implementation of the machine environment has
|
||||
ID tag 'serial' */
|
||||
#define ID_TAG_S "serial"
|
||||
|
||||
/* The serial implementation of the machine environment 'content'
|
||||
structure contains the length of vectors */
|
||||
|
||||
struct _M_EnvSerialContent {
|
||||
integertype length;
|
||||
};
|
||||
|
||||
typedef struct _M_EnvSerialContent *M_EnvSerialContent;
|
||||
|
||||
/* The serial implementation of the N_Vector 'content'
|
||||
structure contains the length of the vector and a pointer
|
||||
to an array of realtype components */
|
||||
|
||||
struct _N_VectorSerialContent {
|
||||
integertype length;
|
||||
realtype *data;
|
||||
};
|
||||
|
||||
typedef struct _N_VectorSerialContent *N_VectorSerialContent;
|
||||
|
||||
/****************************************************************
|
||||
* *
|
||||
* PART II: Macros *
|
||||
* NV_MAKE_S, NV_DISPOSE_S, NVS_MAKE_S, NVS_DISPOSE_S *
|
||||
* ME_CONTENT_S, NV_CONTENT_S *
|
||||
* NV_DATA_S, NV_LENGTH_S, NV_Ith_S *
|
||||
*--------------------------------------------------------------*
|
||||
* In the descriptions below, the following user declarations *
|
||||
* are assumed: *
|
||||
* *
|
||||
* M_Env machenv; *
|
||||
* N_Vector v, *vs; *
|
||||
* realtype *v_data, **vs_data, r; *
|
||||
* integertype v_len, s_len, i; *
|
||||
* *
|
||||
* (1) NV_MAKE_S, NV_DISPOSE_S *
|
||||
* *
|
||||
* These companion routines are used to create and *
|
||||
* destroy an N_Vector with a component array v_data *
|
||||
* allocated by the user. *
|
||||
* *
|
||||
* The call NV_MAKE_S(v, v_data, machenv) makes v an *
|
||||
* N_Vector with component array v_data. The length of the *
|
||||
* array is taken from machenv. *
|
||||
* NV_MAKE_S stores the pointer v_data so that changes *
|
||||
* made by the user to the elements of v_data are *
|
||||
* simultaneously reflected in v. There is no copying of *
|
||||
* elements. *
|
||||
* *
|
||||
* The call NV_DISPOSE_S(v) frees all memory associated *
|
||||
* with v except for its component array. This memory was *
|
||||
* allocated by the user and, therefore, should be *
|
||||
* deallocated by the user. *
|
||||
* *
|
||||
* (2) NVS_MAKE_S, NVS_DISPOSE_S *
|
||||
* *
|
||||
* These companion routines are used to create and destroy *
|
||||
* an array of N_Vectors with component vs_data allocated *
|
||||
* by the user. *
|
||||
* *
|
||||
* The call NVS_MAKE_S(vs, vs_data, s_len, machenv) makes *
|
||||
* vs an array of s_len N_Vectors, each with component *
|
||||
* array vs_data[i] and array length taken from machenv. *
|
||||
* NVS_MAKE_S stores the pointers vs_data[i] so that *
|
||||
* changes made by the user to the elements of vs_data are *
|
||||
* simultaneously reflected in vs. There is no copying of *
|
||||
* elements. *
|
||||
* *
|
||||
* The call NVS_DISPOSE_S(vs) frees all memory associated *
|
||||
* with vs except for its components' component array. *
|
||||
* This memory was allocated by the user and, therefore, *
|
||||
* should be deallocated by the user. *
|
||||
* *
|
||||
* (3) ME_CONTENT_S, NV_CONTENT_S *
|
||||
* *
|
||||
* These routines give access to the contents of the serial *
|
||||
* machine environment and N_Vector, respectively. *
|
||||
* *
|
||||
* The assignment m_cont = ME_CONTENT_S(machenv) sets *
|
||||
* m_cont to be a pointer to the serial machine *
|
||||
* environment content structure. *
|
||||
* *
|
||||
* The assignment v_cont = NV_CONTENT_S(v) sets *
|
||||
* v_cont to be a pointer to the serial N_Vector content *
|
||||
* structure. *
|
||||
* *
|
||||
* (4) NV_DATA_S, NV_LENGTH_S *
|
||||
* *
|
||||
* These routines give individual access to the parts of *
|
||||
* the content of a serial N_Vector. *
|
||||
* *
|
||||
* The assignment v_data=NV_DATA_S(v) sets v_data to be *
|
||||
* a pointer to the first component of v. The assignment *
|
||||
* NV_DATA_S(v)=v_data sets the component array of v to *
|
||||
* be v_data by storing the pointer v_data. *
|
||||
* *
|
||||
* The assignment v_len=NV_LENGTH_S(v) sets v_len to be *
|
||||
* the length of v. The call NV_LENGTH_S(v)=len_v sets *
|
||||
* the length of v to be len_v. *
|
||||
* *
|
||||
* (5) NV_Ith_S *
|
||||
* *
|
||||
* In the following description, the components of an *
|
||||
* N_Vector are numbered 0..N-1, where N is the length of *
|
||||
* v. *
|
||||
* *
|
||||
* The assignment r=NV_Ith_S(v,i) sets r to be the value of *
|
||||
* the ith component of v. The assignment NV_Ith_S(v,i)=r *
|
||||
* sets the value of the ith component of v to be r. *
|
||||
* *
|
||||
* Notes.. *
|
||||
* *
|
||||
* Users who use the macros (1) and/or (2) must *
|
||||
* #include<stdlib.h> since these macros expand to calls to *
|
||||
* malloc and free. *
|
||||
* *
|
||||
* When looping over the components of an N_Vector v, it is *
|
||||
* more efficient to first obtain the component array via *
|
||||
* v_data=NV_DATA_S(v) and then access v_data[i] within the *
|
||||
* loop than it is to use NV_Ith_S(v,i) within the loop. *
|
||||
* *
|
||||
* NV_MAKE_S and NV_DISPOSE_S are similar to N_VNew_Serial and *
|
||||
* N_VFree_Serial, while NVS_MAKE_S and NVS_DISPOSE_S are *
|
||||
* similar to N_VNew_S_Serial and N_VFree_S_Serial. The *
|
||||
* difference is one of responsibility for component memory *
|
||||
* allocation and deallocation. N_VNew_Serial allocates memory *
|
||||
* for the N_Vector components and N_VFree_Serial frees the *
|
||||
* component memory allocated by N_VNew_Serial. For NV_MAKE_S *
|
||||
* and NV_DISPOSE_S, the component memory is allocated and *
|
||||
* freed by the user of this package. Similar remarks hold for *
|
||||
* NVS_MAKE_S, NVS_DISPOSE_S and N_VNew_S_Serial, *
|
||||
* N_VFree_S_Serial. *
|
||||
* *
|
||||
****************************************************************/
|
||||
|
||||
#define NV_MAKE_S(v, v_data, machenv) \
|
||||
v = (N_Vector) malloc(sizeof(*v)); \
|
||||
v->content = (N_VectorSerialContent) malloc(sizeof(struct _N_VectorSerialContent)); \
|
||||
v->content->data = v_data; \
|
||||
v->content->length = machenv->content->v_len; \
|
||||
v->menv = machenv
|
||||
|
||||
#define NV_DISPOSE_S(v) \
|
||||
free((N_VectorSerialContent)(v->content)); \
|
||||
free(v)
|
||||
|
||||
#define NVS_MAKE_S(vs, vs_data, s_len, machenv) \
|
||||
vs = (N_Vector_S) malloc(s_len*sizeof(N_Vector *)); \
|
||||
for ((int)is=0; is<s_len; is++) { \
|
||||
NV_MAKE_S(vs[is], vs_data[is], machenv); \
|
||||
}
|
||||
#define NVS_DISPOSE_S(vs, s_len) \
|
||||
for ((int)is=0; is<s_len; is++) NV_DISPOSE_S(vs[i]); \
|
||||
free(vs);
|
||||
|
||||
#define ME_CONTENT_S(m) ( (M_EnvSerialContent)(m->content) )
|
||||
|
||||
#define NV_CONTENT_S(v) ( (N_VectorSerialContent)(v->content) )
|
||||
|
||||
#define NV_LENGTH_S(v) ( NV_CONTENT_S(v)->length )
|
||||
|
||||
#define NV_DATA_S(v) ( NV_CONTENT_S(v)->data )
|
||||
|
||||
#define NV_Ith_S(v,i) ( NV_DATA_S(v)[i] )
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* PART III: *
|
||||
* Functions exported by nvector_serial *
|
||||
****************************************************************/
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Routine : M_EnvInit_Serial *
|
||||
*--------------------------------------------------------------*
|
||||
* This function sets the content field of the machine *
|
||||
* environment for the serial implementation to a structure of *
|
||||
* type _MEnvSerialContent and attaches the vector operations *
|
||||
* defined for this implementation. *
|
||||
* *
|
||||
* If successful, M_EnvInit_Serial returns a pointer of type *
|
||||
* M_Env. This pointer should in turn be passed in any user *
|
||||
* calls to N_VNew, or uses of the macros NV_MAKE_S and *
|
||||
* NVS_MAKE_S. *
|
||||
* *
|
||||
*--------------------------------------------------------------*
|
||||
* *
|
||||
* vec_length is the length of the vector. *
|
||||
* *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
M_Env M_EnvInit_Serial(integertype vec_length);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Function M_EnvFree_Serial *
|
||||
*--------------------------------------------------------------*
|
||||
* Function to free the block of machine-dependent environment *
|
||||
* information created by M_EnvInit_Serial. *
|
||||
* Its only argument is the pointer machenv returned by *
|
||||
* M_EnvInit_Serial. *
|
||||
* *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
void M_EnvFree_Serial(M_Env machenv);
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Serial implementations of the vector operations *
|
||||
* *
|
||||
* For a complete description of each of the following routines *
|
||||
* see the header file nvector.h *
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
N_Vector N_VNew_Serial(integertype n, M_Env machEnv);
|
||||
N_Vector_S N_VNew_S_Serial(integertype ns, integertype n, M_Env machEnv);
|
||||
void N_VFree_Serial(N_Vector v);
|
||||
void N_VFree_S_Serial(integertype ns, N_Vector_S vs);
|
||||
N_Vector N_VMake_Serial(integertype n, realtype *v_data, M_Env machEnv);
|
||||
void N_VDispose_Serial(N_Vector v);
|
||||
realtype *N_VGetData_Serial(N_Vector v);
|
||||
void N_VSetData_Serial(realtype *v_data, N_Vector v);
|
||||
void N_VLinearSum_Serial(realtype a, N_Vector x, realtype b, N_Vector y, N_Vector z);
|
||||
void N_VConst_Serial(realtype c, N_Vector z);
|
||||
void N_VProd_Serial(N_Vector x, N_Vector y, N_Vector z);
|
||||
void N_VDiv_Serial(N_Vector x, N_Vector y, N_Vector z);
|
||||
void N_VScale_Serial(realtype c, N_Vector x, N_Vector z);
|
||||
void N_VAbs_Serial(N_Vector x, N_Vector z);
|
||||
void N_VInv_Serial(N_Vector x, N_Vector z);
|
||||
void N_VAddConst_Serial(N_Vector x, realtype b, N_Vector z);
|
||||
realtype N_VDotProd_Serial(N_Vector x, N_Vector y);
|
||||
realtype N_VMaxNorm_Serial(N_Vector x);
|
||||
realtype N_VWrmsNorm_Serial(N_Vector x, N_Vector w);
|
||||
realtype N_VMin_Serial(N_Vector x);
|
||||
realtype N_VWL2Norm_Serial(N_Vector x, N_Vector w);
|
||||
realtype N_VL1Norm_Serial(N_Vector x);
|
||||
void N_VOneMask_Serial(N_Vector x);
|
||||
void N_VCompare_Serial(realtype c, N_Vector x, N_Vector z);
|
||||
booleantype N_VInvTest_Serial(N_Vector x, N_Vector z);
|
||||
booleantype N_VConstrProdPos_Serial(N_Vector c, N_Vector x);
|
||||
booleantype N_VConstrMask_Serial(N_Vector c, N_Vector x, N_Vector m);
|
||||
realtype N_VMinQuotient_Serial(N_Vector num, N_Vector denom);
|
||||
void N_VPrint_Serial(N_Vector x);
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
182
output.cpp
182
output.cpp
@ -1,182 +0,0 @@
|
||||
#define EXTERNAL extern
|
||||
#include <setjmp.h>
|
||||
#include "global.h"
|
||||
#include "output.h"
|
||||
#include "phrqproto.h"
|
||||
#include "phqalloc.h"
|
||||
static char const svnid[] = "$Id: output.c 663 2005-11-16 00:46:04Z dlpark $";
|
||||
|
||||
#define MAX_CALLBACKS 10
|
||||
static struct output_callback output_callbacks[MAX_CALLBACKS];
|
||||
static size_t count_output_callback = 0;
|
||||
static int forward_output_to_log = 0;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int add_output_callback(PFN_OUTPUT_CALLBACK pfn, void *cookie)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
if (svnid == NULL) fprintf(stderr," ");
|
||||
if (pfn) {
|
||||
if (count_output_callback >= MAX_CALLBACKS - 1) {
|
||||
sprintf(error_string, "Too many callbacks.\nSee %s\n", __FILE__);
|
||||
fprintf(stderr, "%s", error_string);
|
||||
error_msg(error_string, STOP);
|
||||
return ERROR;
|
||||
}
|
||||
output_callbacks[count_output_callback].callback = pfn;
|
||||
output_callbacks[count_output_callback].cookie = cookie;
|
||||
++count_output_callback;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int output_message(const int type, const char *err_str, const int stop, const char *format, va_list args)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
extern jmp_buf mark;
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < count_output_callback; ++i) {
|
||||
(output_callbacks[i].callback)(ACTION_OUTPUT, type, err_str, stop, output_callbacks[i].cookie, format, args);
|
||||
}
|
||||
|
||||
if (stop == STOP) {
|
||||
longjmp(mark, input_error);
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int clean_up_output_callbacks(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
count_output_callback = 0;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int error_msg (const char *err_str, const int stop, ...)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
va_list args;
|
||||
int return_value;
|
||||
|
||||
if (input_error <= 0) input_error = 1;
|
||||
va_start(args, stop);
|
||||
return_value = output_message(OUTPUT_ERROR, err_str, stop, "", args);
|
||||
va_end(args);
|
||||
return(return_value);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int warning_msg (const char *err_str, ...)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
va_list args;
|
||||
int return_value;
|
||||
|
||||
va_start(args, err_str);
|
||||
return_value = output_message(OUTPUT_WARNING, err_str, CONTINUE, "", args);
|
||||
count_warnings++;
|
||||
va_end(args);
|
||||
return (return_value);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int output_msg (const int type, const char* format, ...)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int return_value;
|
||||
va_list args;
|
||||
|
||||
va_start(args, format);
|
||||
return_value = output_message(type, NULL, CONTINUE, format, args);
|
||||
va_end(args);
|
||||
|
||||
return(return_value);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
void set_forward_output_to_log(int value)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
forward_output_to_log = value;
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int get_forward_output_to_log(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
return forward_output_to_log;
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int output_fflush(const int type, ...)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
size_t i;
|
||||
int check;
|
||||
va_list args;
|
||||
|
||||
check = OK;
|
||||
va_start(args, type);
|
||||
for (i = 0; i < count_output_callback; ++i) {
|
||||
check = (output_callbacks[i].callback)(ACTION_FLUSH, type, NULL, CONTINUE, output_callbacks[i].cookie, NULL, args);
|
||||
if (check != OK) break;
|
||||
}
|
||||
va_end(args);
|
||||
if (check != OK) return(ERROR);
|
||||
return(OK);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int output_rewind(const int type, ...)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
size_t i;
|
||||
int check;
|
||||
va_list args;
|
||||
|
||||
check = OK;
|
||||
va_start(args, type);
|
||||
for (i = 0; i < count_output_callback; ++i) {
|
||||
check = (output_callbacks[i].callback)(ACTION_REWIND, type, NULL, CONTINUE, output_callbacks[i].cookie, NULL, args);
|
||||
if (check != OK) break;
|
||||
}
|
||||
va_end(args);
|
||||
if (check != OK) return(ERROR);
|
||||
return(OK);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int output_close(const int type, ...)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
size_t i;
|
||||
int check;
|
||||
va_list args;
|
||||
|
||||
check = OK;
|
||||
va_start(args, type);
|
||||
for (i = 0; i < count_output_callback; ++i) {
|
||||
check = (output_callbacks[i].callback)(ACTION_CLOSE, type, NULL, CONTINUE, output_callbacks[i].cookie, NULL, args);
|
||||
if (check != OK) break;
|
||||
}
|
||||
va_end(args);
|
||||
if (check != OK) return(ERROR);
|
||||
return(OK);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int output_open(const int type, const char *file_name, ...)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
size_t i;
|
||||
int check;
|
||||
va_list args;
|
||||
assert(file_name && strlen(file_name));
|
||||
|
||||
check = OK;
|
||||
va_start(args, file_name);
|
||||
for (i = 0; i < count_output_callback; ++i) {
|
||||
check = (output_callbacks[i].callback)(ACTION_OPEN, type, file_name, CONTINUE, output_callbacks[i].cookie, NULL, args);
|
||||
if (check != OK) break;
|
||||
}
|
||||
va_end(args);
|
||||
if (check != OK) return(ERROR);
|
||||
return(OK);
|
||||
}
|
||||
57
output.h
57
output.h
@ -1,57 +0,0 @@
|
||||
#ifndef _INC_MESSAGE_H
|
||||
#define _INC_MESSAGE_H
|
||||
|
||||
#include <stdarg.h>
|
||||
#ifdef PHREEQC_IDENT
|
||||
static char const svnidoutput[] = "$Id$";
|
||||
#endif
|
||||
|
||||
typedef int (*PFN_OUTPUT_CALLBACK)(const int action, const int type, const char *err_str, const int stop, void *cookie, const char *, va_list args);
|
||||
|
||||
struct output_callback {
|
||||
PFN_OUTPUT_CALLBACK callback;
|
||||
void *cookie;
|
||||
};
|
||||
|
||||
int add_output_callback(PFN_OUTPUT_CALLBACK pfn, void *cookie);
|
||||
int clean_up_output_callbacks(void);
|
||||
int output_msg (const int type, const char* format, ...);
|
||||
int warning_msg (const char *err_str, ...);
|
||||
int error_msg (const char *err_str, const int stop, ...);
|
||||
int phreeqc_handler(const int action, const int type, const char *err_str, const int stop, void *cookie, const char *, va_list args);
|
||||
void set_forward_output_to_log(int value);
|
||||
int get_forward_output_to_log(void);
|
||||
|
||||
/*
|
||||
* Functions for output callbacks
|
||||
*/
|
||||
int output_open(const int type, const char *file_name, ...);
|
||||
int output_fflush(const int type, ...);
|
||||
int output_rewind(const int type, ...);
|
||||
int output_close(const int type, ...);
|
||||
|
||||
typedef enum {
|
||||
OUTPUT_ERROR,
|
||||
OUTPUT_WARNING,
|
||||
OUTPUT_MESSAGE,
|
||||
OUTPUT_PUNCH,
|
||||
OUTPUT_SCREEN,
|
||||
OUTPUT_LOG,
|
||||
OUTPUT_CHECKLINE,
|
||||
OUTPUT_GUI_ERROR,
|
||||
OUTPUT_BASIC,
|
||||
OUTPUT_CVODE,
|
||||
OUTPUT_DUMP,
|
||||
OUTPUT_STDERR,
|
||||
OUTPUT_SEND_MESSAGE
|
||||
} output_type;
|
||||
|
||||
typedef enum {
|
||||
ACTION_OPEN,
|
||||
ACTION_OUTPUT,
|
||||
ACTION_CLOSE,
|
||||
ACTION_REWIND,
|
||||
ACTION_FLUSH
|
||||
} action_type;
|
||||
|
||||
#endif /* _INC_MESSAGE_H */
|
||||
543
p2c.h
543
p2c.h
@ -1,543 +0,0 @@
|
||||
#ifndef P2C_H
|
||||
#define P2C_H
|
||||
|
||||
#ifdef PHREEQC_IDENT
|
||||
static char const svnidp2c[] = "$Id$";
|
||||
#endif
|
||||
|
||||
/* Header file for code generated by "p2c", the Pascal-to-C translator */
|
||||
|
||||
/* "p2c" Copyright (C) 1989, 1990, 1991 Free Software Foundation.
|
||||
* By Dave Gillespie, daveg@csvax.cs.caltech.edu. Version 1.20.
|
||||
* This file may be copied, modified, etc. in any way. It is not restricted
|
||||
* by the licence agreement accompanying p2c itself.
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
/* If the following heuristic fails, compile -DBSD=0 for non-BSD systems,
|
||||
or -DBSD=1 for BSD systems. */
|
||||
|
||||
#ifdef M_XENIX
|
||||
# define BSD 0
|
||||
#endif
|
||||
|
||||
#ifdef vms
|
||||
# define BSD 0
|
||||
# ifndef __STDC__
|
||||
# define __STDC__ 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __TURBOC__
|
||||
# define MSDOS 1
|
||||
#endif
|
||||
|
||||
#ifdef MSDOS
|
||||
# define BSD 0
|
||||
#endif
|
||||
|
||||
#ifdef FILE /* a #define in BSD, a typedef in SYSV (hp-ux, at least) */
|
||||
# ifndef BSD /* (a convenient, but horrible kludge!) */
|
||||
# define BSD 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef BSD
|
||||
# if !BSD
|
||||
# undef BSD
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if (defined(__STDC__) && !defined(M_XENIX)) || defined(__TURBOC__)
|
||||
# include <stddef.h>
|
||||
# include <stdlib.h>
|
||||
# define HAS_STDLIB
|
||||
# if defined(vms) || defined(__TURBOC__)
|
||||
# define __ID__(a)a
|
||||
# endif
|
||||
#else
|
||||
# ifndef BSD
|
||||
# ifndef __TURBOC__
|
||||
# include <memory.h>
|
||||
# endif
|
||||
# endif
|
||||
# ifdef hpux
|
||||
# ifdef _INCLUDE__STDC__
|
||||
# include <stddef.h>
|
||||
# include <stdlib.h>
|
||||
# endif
|
||||
# endif
|
||||
# include <sys/types.h>
|
||||
# if !defined(MSDOS) || defined(__TURBOC__)
|
||||
# define __ID__(a)a
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __ID__
|
||||
# define __CAT__(a,b)__ID__(a)b
|
||||
#else
|
||||
# define __CAT__(a,b)a##b
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef BSD
|
||||
# include <strings.h>
|
||||
# define memcpy(a,b,n) (bcopy(b,a,n),a)
|
||||
# define memcmp(a,b,n) bcmp(a,b,n)
|
||||
# define strchr(s,c) index(s,c)
|
||||
# define strrchr(s,c) rindex(s,c)
|
||||
#else
|
||||
# include <string.h>
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
#include <setjmp.h>
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
#ifndef NO_LACK
|
||||
#ifdef vms
|
||||
|
||||
#define LACK_LABS
|
||||
#define LACK_MEMMOVE
|
||||
#define LACK_MEMCPY
|
||||
|
||||
#else
|
||||
|
||||
#define LACK_LABS /* Undefine these if your library has these */
|
||||
#ifdef SKIP
|
||||
#define LACK_MEMMOVE
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct __p2c_jmp_buf {
|
||||
struct __p2c_jmp_buf *next;
|
||||
jmp_buf jbuf;
|
||||
} __p2c_jmp_buf;
|
||||
|
||||
|
||||
/* Warning: The following will not work if setjmp is used simultaneously.
|
||||
This also violates the ANSI restriction about using vars after longjmp,
|
||||
but a typical implementation of longjmp will get it right anyway. */
|
||||
|
||||
#ifndef FAKE_TRY
|
||||
# define TRY(x) do { __p2c_jmp_buf __try_jb; \
|
||||
__try_jb.next = __top_jb; \
|
||||
if (!setjmp((__top_jb = &__try_jb)->jbuf)) {
|
||||
# define RECOVER(x) __top_jb = __try_jb.next; } else {
|
||||
#ifdef SKIP
|
||||
# define RECOVER2(x,L) __top_jb = __try_jb.next; } else { \
|
||||
if (0) { L: __top_jb = __try_jb.next; }
|
||||
#endif
|
||||
# define RECOVER2(x,L) __top_jb = __try_jb.next; } else { \
|
||||
{ L: __top_jb = __try_jb.next; }
|
||||
# define ENDTRY(x) } } while (0)
|
||||
#else
|
||||
# define TRY(x) if (1) {
|
||||
# define RECOVER(x) } else do {
|
||||
# define RECOVER2(x,L) } else do { L: ;
|
||||
# define ENDTRY(x) } while (0)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef M_XENIX /* avoid compiler bug */
|
||||
# define INT_MAX (32767)
|
||||
# define INT_MIN (-32768)
|
||||
#endif
|
||||
|
||||
|
||||
/* The following definitions work only on twos-complement machines */
|
||||
#ifndef INT_MAX
|
||||
# define INT_MAX ((int)(((unsigned int) -1) >> 1))
|
||||
# define INT_MIN (~INT_MAX)
|
||||
#endif
|
||||
|
||||
#ifndef INT_MAX
|
||||
# define INT_MAX ((int)(((unsigned int) -1) >> 1))
|
||||
# define INT_MIN (~INT_MAX)
|
||||
#endif
|
||||
|
||||
#ifndef LONG_MAX
|
||||
# define LONG_MAX ((long)(((unsigned long) -1) >> 1))
|
||||
# define LONG_MIN (~LONG_MAX)
|
||||
#endif
|
||||
|
||||
#ifndef SEEK_SET
|
||||
# define SEEK_SET 0
|
||||
# define SEEK_CUR 1
|
||||
# define SEEK_END 2
|
||||
#endif
|
||||
|
||||
#ifndef EXIT_SUCCESS
|
||||
# ifdef vms
|
||||
# define EXIT_SUCCESS 1
|
||||
# define EXIT_FAILURE (02000000000L)
|
||||
# else
|
||||
# define EXIT_SUCCESS 0
|
||||
# define EXIT_FAILURE 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#define SETBITS 32
|
||||
|
||||
#ifdef SKIP
|
||||
#if defined(__STDC__) || defined(__TURBOC__)
|
||||
# if !defined(vms) && !defined(M_LINT)
|
||||
# define Signed signed
|
||||
# else
|
||||
# define Signed
|
||||
# endif
|
||||
# define Void void /* Void f() = procedure */
|
||||
# ifndef Const
|
||||
# define Const const
|
||||
# endif
|
||||
# ifndef Volatile
|
||||
# define Volatile volatile
|
||||
# endif
|
||||
# ifdef M_LINT
|
||||
# define P2PP(x) ()
|
||||
# define PV() ()
|
||||
typedef char *Anyptr;
|
||||
# else
|
||||
# define P2PP(x) x /* function prototype */
|
||||
# define PV() (void) /* null function prototype */
|
||||
typedef void *Anyptr;
|
||||
# endif
|
||||
#else
|
||||
# define Signed
|
||||
# define Void void
|
||||
# ifndef Const
|
||||
# define Const
|
||||
# endif
|
||||
# ifndef Volatile
|
||||
# define Volatile
|
||||
# endif
|
||||
# define P2PP(x) ()
|
||||
# define PV() ()
|
||||
typedef char *Anyptr;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#define Signed
|
||||
#define Void void
|
||||
#ifndef Const
|
||||
# define Const
|
||||
#endif
|
||||
#ifndef Volatile
|
||||
# define Volatile
|
||||
#endif
|
||||
#define P2PP(x) ()
|
||||
#define PV() ()
|
||||
typedef char *Anyptr;
|
||||
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define Inline inline
|
||||
#else
|
||||
# define Inline
|
||||
#endif
|
||||
|
||||
#define Register register /* Register variables */
|
||||
#define Char char /* Characters (not bytes) */
|
||||
|
||||
#ifndef Static
|
||||
# define Static static /* Private global funcs and vars */
|
||||
#endif
|
||||
|
||||
#ifndef Local
|
||||
# define Local static /* Nested functions */
|
||||
#endif
|
||||
|
||||
typedef Signed char schar;
|
||||
/*typedef unsigned char uchar;*/
|
||||
typedef unsigned char boolean;
|
||||
|
||||
#ifndef true
|
||||
# define true 1
|
||||
# define false 0
|
||||
#endif
|
||||
|
||||
#ifndef TRUE
|
||||
# define TRUE 1
|
||||
# define FALSE 0
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct {
|
||||
Anyptr proc, link;
|
||||
} _PROCEDURE;
|
||||
|
||||
#ifndef _FNSIZE
|
||||
# define _FNSIZE 120
|
||||
#endif
|
||||
|
||||
|
||||
/*extern Void PASCAL_MAIN P2PP( (int, Char **) );*/
|
||||
extern Void PASCAL_MAIN (int, Char **) ;
|
||||
/*
|
||||
extern Char **P_argv;
|
||||
extern int P_argc;
|
||||
*/
|
||||
extern int P_escapecode;
|
||||
extern int P_ioresult;
|
||||
extern __p2c_jmp_buf *__top_jb;
|
||||
|
||||
|
||||
#ifdef P2C_H_PROTO /* if you have Ansi C but non-prototyped header files */
|
||||
extern Char *strcat P2PP( (Char *, Const Char *) );
|
||||
extern Char *strchr P2PP( (Const Char *, int) );
|
||||
extern int strcmp P2PP( (Const Char *, Const Char *) );
|
||||
extern Char *strcpy P2PP( (Char *, Const Char *) );
|
||||
extern size_t strlen P2PP( (Const Char *) );
|
||||
extern Char *strncat P2PP( (Char *, Const Char *, size_t) );
|
||||
extern int strncmp P2PP( (Const Char *, Const Char *, size_t) );
|
||||
extern Char *strncpy P2PP( (Char *, Const Char *, size_t) );
|
||||
extern Char *strrchr P2PP( (Const Char *, int) );
|
||||
|
||||
extern Anyptr memchr P2PP( (Const Anyptr, int, size_t) );
|
||||
extern Anyptr memmove P2PP( (Anyptr, Const Anyptr, size_t) );
|
||||
extern Anyptr memset P2PP( (Anyptr, int, size_t) );
|
||||
#ifndef memcpy
|
||||
extern Anyptr memcpy P2PP( (Anyptr, Const Anyptr, size_t) );
|
||||
extern int memcmp P2PP( (Const Anyptr, Const Anyptr, size_t) );
|
||||
#endif
|
||||
|
||||
extern int atoi P2PP( (Const Char *) );
|
||||
extern LDBLE atof P2PP( (Const Char *) );
|
||||
extern long atol P2PP( (Const Char *) );
|
||||
extern LDBLE strtod P2PP( (Const Char *, Char **) );
|
||||
extern long strtol P2PP( (Const Char *, Char **, int) );
|
||||
#endif /*P2C_H_PROTO*/
|
||||
|
||||
/* force stdlib for DEC */
|
||||
#define HAS_STDLIB
|
||||
#ifndef HAS_STDLIB
|
||||
extern Anyptr malloc P2PP( (size_t) );
|
||||
extern Void free P2PP( (Anyptr) );
|
||||
#endif
|
||||
|
||||
extern int _OutMem PV();
|
||||
extern int _CaseCheck PV();
|
||||
extern int _NilCheck PV();
|
||||
/*extern int _Escape P2PP( (int) );*/
|
||||
extern int _Escape(int);
|
||||
/*extern int _EscIO P2PP( (int) );*/
|
||||
extern int _EscIO (int);
|
||||
extern long ipow P2PP( (long, long) );
|
||||
extern Char *strsub P2PP( (Char *, Char *, int, int) );
|
||||
extern Char *strltrim P2PP( (Char *) );
|
||||
extern Char *strrtrim P2PP( (Char *) );
|
||||
extern Char *strrpt P2PP( (Char *, Char *, int) );
|
||||
extern Char *strpad P2PP( (Char *, Char *, int, int) );
|
||||
extern int strpos2 P2PP( (Char *, Char *, int) );
|
||||
extern long memavail PV();
|
||||
extern int P_peek P2PP( (FILE *) );
|
||||
extern int P_eof P2PP( (FILE *) );
|
||||
extern int P_eoln P2PP( (FILE *) );
|
||||
extern Void P_readpaoc P2PP( (FILE *, Char *, int) );
|
||||
extern Void P_readlnpaoc P2PP( (FILE *, Char *, int) );
|
||||
extern long P_maxpos P2PP( (FILE *) );
|
||||
extern Char *P_trimname P2PP( (Char *, int) );
|
||||
extern long *P_setunion P2PP( (long *, long *, long *) );
|
||||
extern long *P_setint P2PP( (long *, long *, long *) );
|
||||
extern long *P_setdiff P2PP( (long *, long *, long *) );
|
||||
extern long *P_setxor P2PP( (long *, long *, long *) );
|
||||
extern int P_inset P2PP( (unsigned, long *) );
|
||||
extern int P_setequal P2PP( (long *, long *) );
|
||||
extern int P_subset P2PP( (long *, long *) );
|
||||
extern long *P_addset P2PP( (long *, unsigned) );
|
||||
extern long *P_addsetr P2PP( (long *, unsigned, unsigned) );
|
||||
extern long *P_remset P2PP( (long *, unsigned) );
|
||||
extern long *P_setcpy P2PP( (long *, long *) );
|
||||
extern long *P_expset P2PP( (long *, long) );
|
||||
extern long P_packset P2PP( (long *) );
|
||||
extern int P_getcmdline P2PP( (int, int, Char *) );
|
||||
extern Void TimeStamp P2PP( (int *, int *, int *,
|
||||
int *, int *, int *) );
|
||||
extern Void P_sun_argv P2PP( (char *, int, int) );
|
||||
|
||||
|
||||
/* I/O error handling */
|
||||
#define _CHKIO(cond,ior,val,def) ((cond) ? P_ioresult=0,(val) \
|
||||
: P_ioresult=(ior),(def))
|
||||
#define _SETIO(cond,ior) (P_ioresult = (cond) ? 0 : (ior))
|
||||
|
||||
/* Following defines are suitable for the HP Pascal operating system */
|
||||
#define FileNotFound 10
|
||||
#define FileNotOpen 13
|
||||
#define FileWriteError 38
|
||||
#define BadInputFormat 14
|
||||
#define EndOfFile 30
|
||||
|
||||
#define FILENOTFOUND 10
|
||||
#define FILENOTOPEN 13
|
||||
#define FILEWRITEERROR 38
|
||||
#define BADINPUTFORMAT 14
|
||||
#define ENDOFFILE 30
|
||||
|
||||
/* Creating temporary files */
|
||||
#if (defined(BSD) || defined(NO_TMPFILE)) && !defined(HAVE_TMPFILE)
|
||||
# define tmpfile() (fopen(tmpnam(NULL), "w+"))
|
||||
#endif
|
||||
|
||||
/* File buffers */
|
||||
#define FILEBUF(f,sc,type) sc int __CAT__(f,_BFLAGS); \
|
||||
sc type __CAT__(f,_BUFFER)
|
||||
#define FILEBUFNC(f,type) int __CAT__(f,_BFLAGS); \
|
||||
type __CAT__(f,_BUFFER)
|
||||
|
||||
#define RESETBUF(f,type) (__CAT__(f,_BFLAGS) = 1)
|
||||
#define SETUPBUF(f,type) (__CAT__(f,_BFLAGS) = 0)
|
||||
|
||||
#define GETFBUF(f,type) (*((__CAT__(f,_BFLAGS) == 1 && \
|
||||
((__CAT__(f,_BFLAGS) = 2), \
|
||||
fread(&__CAT__(f,_BUFFER), \
|
||||
sizeof(type),1,(f)))),\
|
||||
&__CAT__(f,_BUFFER)))
|
||||
#define AGETFBUF(f,type) ((__CAT__(f,_BFLAGS) == 1 && \
|
||||
((__CAT__(f,_BFLAGS) = 2), \
|
||||
fread(__CAT__(f,_BUFFER), \
|
||||
sizeof(type),1,(f)))),\
|
||||
__CAT__(f,_BUFFER))
|
||||
|
||||
#define PUTFBUF(f,type,v) (GETFBUF(f,type) = (v))
|
||||
#define CPUTFBUF(f,v) (PUTFBUF(f,char,v))
|
||||
#define APUTFBUF(f,type,v) (memcpy(AGETFBUF(f,type), (v), \
|
||||
sizeof(__CAT__(f,_BUFFER))))
|
||||
|
||||
#define GET(f,type) (__CAT__(f,_BFLAGS) == 1 ? \
|
||||
fread(&__CAT__(f,_BUFFER),sizeof(type),1,(f)) : \
|
||||
(__CAT__(f,_BFLAGS) = 1))
|
||||
|
||||
#define PUT(f,type) (fwrite(&__CAT__(f,_BUFFER),sizeof(type),1,(f)), \
|
||||
(__CAT__(f,_BFLAGS) = 0))
|
||||
#define CPUT(f) (PUT(f,char))
|
||||
|
||||
#define BUFEOF(f) (__CAT__(f,_BFLAGS) != 2 && P_eof(f))
|
||||
#define BUFFPOS(f) (ftell(f) - (__CAT__(f,_BFLAGS) == 2))
|
||||
|
||||
#ifdef SKIP
|
||||
typedef struct {
|
||||
FILE *f;
|
||||
FILEBUFNC(f,Char);
|
||||
Char name[_FNSIZE];
|
||||
} _TEXT;
|
||||
#endif
|
||||
|
||||
/* Memory allocation */
|
||||
#ifdef __GCC__
|
||||
# define Malloc(n) (PHRQ_malloc(n) ?: (Anyptr)_OutMem())
|
||||
#else
|
||||
extern Anyptr __MallocTemp__;
|
||||
# define Malloc(n) ((__MallocTemp__ = PHRQ_malloc(n)) ? __MallocTemp__ : (Anyptr)_OutMem())
|
||||
#endif
|
||||
#define FreeR(p) (free((Anyptr)(p))) /* used if arg is an rvalue */
|
||||
#define Free(p) (free((Anyptr)(p)), (p)=NULL)
|
||||
|
||||
/* sign extension */
|
||||
#define SEXT(x,n) ((x) | -(((x) & (1L<<((n)-1))) << 1))
|
||||
|
||||
/* packed arrays */ /* BEWARE: these are untested! */
|
||||
#define P_getbits_UB(a,i,n,L) ((int)((a)[(i)>>(L)-(n)] >> \
|
||||
(((~(i))&((1<<(L)-(n))-1)) << (n)) & \
|
||||
(1<<(1<<(n)))-1))
|
||||
|
||||
#define P_getbits_SB(a,i,n,L) ((int)((a)[(i)>>(L)-(n)] << \
|
||||
(16 - ((((~(i))&((1<<(L)-(n))-1))+1) <<\
|
||||
(n)) >> (16-(1<<(n))))))
|
||||
|
||||
#define P_putbits_UB(a,i,x,n,L) ((a)[(i)>>(L)-(n)] |= \
|
||||
(x) << (((~(i))&((1<<(L)-(n))-1)) << (n)))
|
||||
|
||||
#define P_putbits_SB(a,i,x,n,L) ((a)[(i)>>(L)-(n)] |= \
|
||||
((x) & (1<<(1<<(n)))-1) << \
|
||||
(((~(i))&((1<<(L)-(n))-1)) << (n)))
|
||||
|
||||
#define P_clrbits_B(a,i,n,L) ((a)[(i)>>(L)-(n)] &= \
|
||||
~( ((1<<(1<<(n)))-1) << \
|
||||
(((~(i))&((1<<(L)-(n))-1)) << (n))) )
|
||||
|
||||
/* small packed arrays */
|
||||
#define P_getbits_US(v,i,n) ((int)((v) >> ((i)<<(n)) & (1<<(1<<(n)))-1))
|
||||
#define P_getbits_SS(v,i,n) ((int)((long)(v) << (SETBITS - (((i)+1) << (n))) >> (SETBITS-(1<<(n)))))
|
||||
#define P_putbits_US(v,i,x,n) ((v) |= (x) << ((i) << (n)))
|
||||
#define P_putbits_SS(v,i,x,n) ((v) |= ((x) & (1<<(1<<(n)))-1) << ((i)<<(n)))
|
||||
#define P_clrbits_S(v,i,n) ((v) &= ~( ((1<<(1<<(n)))-1) << ((i)<<(n)) ))
|
||||
|
||||
#define P_max(a,b) ((a) > (b) ? (a) : (b))
|
||||
#define P_min(a,b) ((a) < (b) ? (a) : (b))
|
||||
|
||||
|
||||
/* Fix ANSI-isms */
|
||||
|
||||
#ifdef LACK_LABS
|
||||
# ifndef labs
|
||||
# define labs my_labs
|
||||
extern long my_labs P2PP( (long) );
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef LACK_MEMMOVE
|
||||
# ifndef memmove
|
||||
# define memmove my_memmove
|
||||
extern Anyptr my_memmove P2PP( (Anyptr, Const Anyptr, size_t) );
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef LACK_MEMCPY
|
||||
# ifndef memcpy
|
||||
# define memcpy my_memcpy
|
||||
extern Anyptr my_memcpy P2PP( (Anyptr, Const Anyptr, size_t) );
|
||||
# endif
|
||||
# ifndef memcmp
|
||||
# define memcmp my_memcmp
|
||||
extern int my_memcmp P2PP( (Const Anyptr, Const Anyptr, size_t) );
|
||||
# endif
|
||||
# ifndef memset
|
||||
# define memset my_memset
|
||||
extern Anyptr my_memset P2PP( (Anyptr, int, size_t) );
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Fix toupper/tolower on Suns and other stupid BSD systems */
|
||||
#ifdef toupper
|
||||
# undef toupper
|
||||
# undef tolower
|
||||
# define toupper(c) my_toupper(c)
|
||||
# define tolower(c) my_tolower(c)
|
||||
#endif
|
||||
|
||||
#ifndef _toupper
|
||||
# if 'A' == 65 && 'a' == 97
|
||||
# define _toupper(c) ((c)-'a'+'A')
|
||||
# define _tolower(c) ((c)-'A'+'a')
|
||||
# else
|
||||
# ifdef toupper
|
||||
# undef toupper /* hope these are shadowing real functions, */
|
||||
# undef tolower /* because my_toupper calls _toupper! */
|
||||
# endif
|
||||
# define _toupper(c) toupper(c)
|
||||
# define _tolower(c) tolower(c)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* P2C_H */
|
||||
|
||||
|
||||
|
||||
/* End. */
|
||||
|
||||
|
||||
936
p2clib.cpp
936
p2clib.cpp
@ -1,936 +0,0 @@
|
||||
|
||||
/* Run-time library for use with "p2c", the Pascal to C translator */
|
||||
|
||||
/* "p2c" Copyright (C) 1989, 1990, 1991 Free Software Foundation.
|
||||
* By Dave Gillespie, daveg@csvax.cs.caltech.edu. Version --VERSION--.
|
||||
* This file may be copied, modified, etc. in any way. It is not restricted
|
||||
* by the licence agreement accompanying p2c itself.
|
||||
*/
|
||||
|
||||
static char const svnid[] = "$Id: p2clib.c 663 2005-11-16 00:46:04Z dlpark $";
|
||||
|
||||
#include "p2c.h"
|
||||
#include "output.h"
|
||||
#define STOP 1
|
||||
#define CONTINUE 0
|
||||
|
||||
#define NO_TIME
|
||||
#ifndef NO_TIME
|
||||
# include <time.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
|
||||
#define Isspace(c) isspace(c) /* or "((c) == ' ')" if preferred */
|
||||
|
||||
|
||||
|
||||
|
||||
static int P_argc;
|
||||
static char **P_argv;
|
||||
static char *_ShowEscape(char *buf, int code, int ior, char *prefix);
|
||||
|
||||
int P_escapecode;
|
||||
int P_ioresult;
|
||||
|
||||
long EXCP_LINE; /* Used by Pascal workstation system */
|
||||
|
||||
Anyptr __MallocTemp__;
|
||||
|
||||
__p2c_jmp_buf *__top_jb;
|
||||
|
||||
void PASCAL_MAIN(int argc, char **argv)
|
||||
{
|
||||
if (svnid == NULL) fprintf(stderr," ");
|
||||
P_argc = argc;
|
||||
P_argv = argv;
|
||||
__top_jb = NULL;
|
||||
P_escapecode = 0;
|
||||
P_ioresult = 0;
|
||||
#ifdef LOCAL_INIT
|
||||
LOCAL_INIT();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* In case your system lacks these... */
|
||||
|
||||
long my_labs(long x)
|
||||
{
|
||||
return((x > 0) ? x : -x);
|
||||
}
|
||||
|
||||
|
||||
/* #define __STDC__ */ /* PHREEQ98 */
|
||||
|
||||
Anyptr my_memmove(Anyptr d, Const Anyptr s, size_t n)
|
||||
{
|
||||
register char *dd = (char *)d, *ss = (char *)s;
|
||||
if (dd < ss || (unsigned int) (dd - ss) >= n) {
|
||||
memcpy(dd, ss, n);
|
||||
} else if (n > 0) {
|
||||
dd += n;
|
||||
ss += n;
|
||||
while (n-- > 0)
|
||||
*--dd = *--ss;
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
|
||||
Anyptr my_memcpy(Anyptr d, Const Anyptr s, size_t n)
|
||||
|
||||
{
|
||||
register char *ss = (char *)s, *dd = (char *)d;
|
||||
while (n-- > 0)
|
||||
*dd++ = *ss++;
|
||||
return d;
|
||||
}
|
||||
|
||||
int my_memcmp(Const Anyptr s1, Const Anyptr s2, size_t n)
|
||||
{
|
||||
register char *a = (char *)s1, *b = (char *)s2;
|
||||
register int i;
|
||||
while (n-- > 0)
|
||||
if ((i = (*a++) - (*b++)) != 0)
|
||||
return i;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Anyptr my_memset(Anyptr d, int c, size_t n)
|
||||
{
|
||||
register char *dd = (char *)d;
|
||||
while (n-- > 0)
|
||||
*dd++ = (char) c;
|
||||
return d;
|
||||
}
|
||||
|
||||
int my_toupper(int c)
|
||||
{
|
||||
if (islower(c))
|
||||
return _toupper(c);
|
||||
else
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
int my_tolower(int c)
|
||||
|
||||
{
|
||||
if (isupper(c))
|
||||
return _tolower(c);
|
||||
else
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
long ipow(long a, long b)
|
||||
{
|
||||
long v;
|
||||
|
||||
if (a == 0 || a == 1)
|
||||
return a;
|
||||
if (a == -1)
|
||||
return (b & 1) ? -1 : 1;
|
||||
if (b < 0)
|
||||
return 0;
|
||||
if (a == 2)
|
||||
return 1L << b;
|
||||
v = (b & 1) ? a : 1;
|
||||
while ((b >>= 1) > 0) {
|
||||
a *= a;
|
||||
if (b & 1)
|
||||
v *= a;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* Common string functions: */
|
||||
|
||||
/* Store in "ret" the substring of length "len" starting from "pos" (1-based).
|
||||
Store a shorter or null string if out-of-range. Return "ret". */
|
||||
char *strsub(register char *ret, register char *s, register int pos, register int len)
|
||||
{
|
||||
register char *s2;
|
||||
|
||||
if (--pos < 0 || len <= 0) {
|
||||
*ret = 0;
|
||||
return ret;
|
||||
}
|
||||
while (pos > 0) {
|
||||
if (!*s++) {
|
||||
*ret = 0;
|
||||
return ret;
|
||||
}
|
||||
pos--;
|
||||
}
|
||||
s2 = ret;
|
||||
while (--len >= 0) {
|
||||
if (!(*s2++ = *s++))
|
||||
return ret;
|
||||
}
|
||||
*s2 = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* Return the index of the first occurrence of "pat" as a substring of "s",
|
||||
starting at index "pos" (1-based). Result is 1-based, 0 if not found. */
|
||||
|
||||
int strpos2(char *s, register char *pat, register int pos)
|
||||
{
|
||||
register char *cp, ch;
|
||||
register int slen;
|
||||
|
||||
if (--pos < 0)
|
||||
return 0;
|
||||
slen = strlen(s) - pos;
|
||||
cp = s + pos;
|
||||
if (!(ch = *pat++))
|
||||
return 0;
|
||||
pos = strlen(pat);
|
||||
slen -= pos;
|
||||
while (--slen >= 0) {
|
||||
if (*cp++ == ch && !strncmp(cp, pat, pos))
|
||||
return cp - s;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Case-insensitive version of strcmp. */
|
||||
int strcicmp(register char *s1, register char *s2)
|
||||
{
|
||||
register unsigned char c1, c2;
|
||||
|
||||
while (*s1) {
|
||||
if (*s1++ != *s2++) {
|
||||
if (!s2[-1])
|
||||
return 1;
|
||||
c1 = (unsigned char) toupper(s1[-1]);
|
||||
c2 = (unsigned char) toupper(s2[-1]);
|
||||
if (c1 != c2)
|
||||
return c1 - c2;
|
||||
}
|
||||
}
|
||||
if (*s2)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* HP and Turbo Pascal string functions: */
|
||||
|
||||
/* Trim blanks at left end of string. */
|
||||
char *strltrim(register char *s)
|
||||
{
|
||||
while (Isspace((int) *s++)) ;
|
||||
return s - 1;
|
||||
}
|
||||
|
||||
|
||||
/* Trim blanks at right end of string. */
|
||||
char *strrtrim(register char *s)
|
||||
{
|
||||
register char *s2 = s;
|
||||
|
||||
if (!*s)
|
||||
return s;
|
||||
while (*++s2) ;
|
||||
while (s2 > s && Isspace((int) *--s2))
|
||||
*s2 = 0;
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
/* Store in "ret" "num" copies of string "s". Return "ret". */
|
||||
#ifdef SKIP
|
||||
char *strrpt(ret, s, num)
|
||||
char *ret;
|
||||
register char *s;
|
||||
register int num;
|
||||
{
|
||||
register char *s2 = ret;
|
||||
register char *s1;
|
||||
|
||||
while (--num >= 0) {
|
||||
s1 = s;
|
||||
while ((*s2++ = *s1++)) ;
|
||||
s2--;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Store in "ret" string "s" with enough pad chars added to reach "size". */
|
||||
|
||||
#ifdef SKIP
|
||||
char *strpad
|
||||
(ret, s, padchar, num)
|
||||
char *ret;
|
||||
register char *s;
|
||||
register int padchar, num;
|
||||
{
|
||||
register char *d = ret;
|
||||
|
||||
if (s == d) {
|
||||
while (*d++) ;
|
||||
} else {
|
||||
while ((*d++ = *s++)) ;
|
||||
}
|
||||
num -= (--d - ret);
|
||||
while (--num >= 0)
|
||||
*d++ = (char) padchar;
|
||||
*d = 0;
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Copy the substring of length "len" from index "spos" of "s" (1-based)
|
||||
to index "dpos" of "d", lengthening "d" if necessary. Length and
|
||||
indices must be in-range. */
|
||||
void strmove(register int len, register char *s, register int spos, register char *d, register int dpos)
|
||||
{
|
||||
s += spos - 1;
|
||||
d += dpos - 1;
|
||||
while (*d && --len >= 0)
|
||||
*d++ = *s++;
|
||||
if (len > 0) {
|
||||
while (--len >= 0)
|
||||
*d++ = *s++;
|
||||
*d = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Delete the substring of length "len" at index "pos" from "s".
|
||||
Delete less if out-of-range. */
|
||||
#ifdef SKIP
|
||||
void strdelete(s, pos, len)
|
||||
register char *s;
|
||||
register int pos, len;
|
||||
{
|
||||
register int slen;
|
||||
|
||||
if (--pos < 0)
|
||||
return;
|
||||
slen = strlen(s) - pos;
|
||||
if (slen <= 0)
|
||||
return;
|
||||
s += pos;
|
||||
if (slen <= len) {
|
||||
*s = 0;
|
||||
return;
|
||||
}
|
||||
while ((*s = s[len])) s++;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Insert string "src" at index "pos" of "dst". */
|
||||
void strinsert(register char *src, register char *dst, register int pos)
|
||||
{
|
||||
register int slen, dlen;
|
||||
|
||||
if (--pos < 0)
|
||||
return;
|
||||
dlen = strlen(dst);
|
||||
dst += dlen;
|
||||
dlen -= pos;
|
||||
if (dlen <= 0) {
|
||||
strcpy(dst, src);
|
||||
return;
|
||||
}
|
||||
slen = strlen(src);
|
||||
do {
|
||||
dst[slen] = *dst;
|
||||
--dst;
|
||||
} while (--dlen >= 0);
|
||||
dst++;
|
||||
while (--slen >= 0)
|
||||
*dst++ = *src++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* File functions */
|
||||
|
||||
/* Peek at next character of input stream; return EOF at end-of-file. */
|
||||
int P_peek(FILE *f)
|
||||
{
|
||||
int ch;
|
||||
|
||||
ch = getc(f);
|
||||
if (ch == EOF)
|
||||
return EOF;
|
||||
ungetc(ch, f);
|
||||
return (ch == '\n') ? ' ' : ch;
|
||||
}
|
||||
|
||||
|
||||
/* Check if at end of file, using Pascal "eof" semantics. End-of-file for
|
||||
stdin is broken; remove the special case for it to be broken in a
|
||||
different way. */
|
||||
/*int P_eof(FILE *f)*/
|
||||
int P_eof(void)
|
||||
{
|
||||
#ifdef SKIP
|
||||
register int ch;
|
||||
if (feof(f))
|
||||
return 1;
|
||||
if (f == stdin)
|
||||
return 0; /* not safe to look-ahead on the keyboard! */
|
||||
ch = getc(f);
|
||||
if (ch == EOF)
|
||||
return 1;
|
||||
ungetc(ch, f);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Check if at end of line (or end of entire file). */
|
||||
int P_eoln(FILE *f)
|
||||
{
|
||||
register int ch;
|
||||
|
||||
ch = getc(f);
|
||||
if (ch == EOF)
|
||||
return 1;
|
||||
ungetc(ch, f);
|
||||
return (ch == '\n');
|
||||
}
|
||||
|
||||
|
||||
/* Read a packed array of characters from a file. */
|
||||
Void P_readpaoc(FILE *f, char *s, int len)
|
||||
{
|
||||
int ch;
|
||||
|
||||
for (;;) {
|
||||
if (len <= 0)
|
||||
return;
|
||||
ch = getc(f);
|
||||
if (ch == EOF || ch == '\n')
|
||||
break;
|
||||
*s++ = (char) ch;
|
||||
--len;
|
||||
}
|
||||
while (--len >= 0)
|
||||
*s++ = ' ';
|
||||
if (ch != EOF)
|
||||
ungetc(ch, f);
|
||||
}
|
||||
Void P_readlnpaoc(FILE *f, char *s, int len)
|
||||
{
|
||||
int ch;
|
||||
|
||||
for (;;) {
|
||||
ch = getc(f);
|
||||
if (ch == EOF || ch == '\n')
|
||||
break;
|
||||
if (len > 0) {
|
||||
*s++ = (char) ch;
|
||||
--len;
|
||||
}
|
||||
}
|
||||
while (--len >= 0)
|
||||
*s++ = ' ';
|
||||
}
|
||||
|
||||
|
||||
/* Compute maximum legal "seek" index in file (0-based). */
|
||||
long P_maxpos(FILE *f)
|
||||
{
|
||||
long savepos = ftell(f);
|
||||
long val;
|
||||
|
||||
if (fseek(f, 0L, SEEK_END))
|
||||
return -1;
|
||||
val = ftell(f);
|
||||
if (fseek(f, savepos, SEEK_SET))
|
||||
return -1;
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
/* Use packed array of char for a file name. */
|
||||
Char *P_trimname(register Char *fn, register int len)
|
||||
{
|
||||
static Char fnbuf[256];
|
||||
register Char *cp = fnbuf;
|
||||
|
||||
while (--len >= 0 && *fn && !isspace((int) *fn))
|
||||
*cp++ = *fn++;
|
||||
*cp = 0;
|
||||
return fnbuf;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* Pascal's "memavail" doesn't make much sense in Unix with virtual memory.
|
||||
We fix memory size as 10Meg as a reasonable compromise. */
|
||||
|
||||
long memavail(void)
|
||||
{
|
||||
return 10000000; /* worry about this later! */
|
||||
}
|
||||
|
||||
long maxavail(void)
|
||||
{
|
||||
return memavail();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* Sets are stored as an array of longs. S[0] is the size of the set;
|
||||
S[N] is the N'th 32-bit chunk of the set. S[0] equals the maximum
|
||||
I such that S[I] is nonzero. S[0] is zero for an empty set. Within
|
||||
each long, bits are packed from lsb to msb. The first bit of the
|
||||
set is the element with ordinal value 0. (Thus, for a "set of 5..99",
|
||||
the lowest five bits of the first long are unused and always zero.) */
|
||||
|
||||
/* (Sets with 32 or fewer elements are normally stored as plain longs.) */
|
||||
long *P_setunion(register long *d, register long *s1, register long *s2) /* d := s1 + s2 */
|
||||
{
|
||||
long *dbase = d++;
|
||||
register int sz1 = *s1++, sz2 = *s2++;
|
||||
while (sz1 > 0 && sz2 > 0) {
|
||||
*d++ = *s1++ | *s2++;
|
||||
sz1--, sz2--;
|
||||
}
|
||||
while (--sz1 >= 0)
|
||||
*d++ = *s1++;
|
||||
while (--sz2 >= 0)
|
||||
*d++ = *s2++;
|
||||
*dbase = d - dbase - 1;
|
||||
return dbase;
|
||||
}
|
||||
|
||||
long *P_setint(register long *d, register long *s1, register long *s2) /* d := s1 * s2 */
|
||||
{
|
||||
long *dbase = d++;
|
||||
register int sz1 = *s1++, sz2 = *s2++;
|
||||
while (--sz1 >= 0 && --sz2 >= 0)
|
||||
*d++ = *s1++ & *s2++;
|
||||
while (--d > dbase && !*d) ;
|
||||
*dbase = d - dbase;
|
||||
return dbase;
|
||||
}
|
||||
|
||||
long *P_setdiff(register long *d, register long *s1, register long *s2) /* d := s1 - s2 */
|
||||
{
|
||||
long *dbase = d++;
|
||||
register int sz1 = *s1++, sz2 = *s2++;
|
||||
while (--sz1 >= 0 && --sz2 >= 0)
|
||||
*d++ = *s1++ & ~*s2++;
|
||||
if (sz1 >= 0) {
|
||||
while (sz1-- >= 0)
|
||||
*d++ = *s1++;
|
||||
}
|
||||
while (--d > dbase && !*d) ;
|
||||
*dbase = d - dbase;
|
||||
return dbase;
|
||||
}
|
||||
|
||||
long *P_setxor(register long *d, register long *s1, register long *s2) /* d := s1 / s2 */
|
||||
{
|
||||
long *dbase = d++;
|
||||
register int sz1 = *s1++, sz2 = *s2++;
|
||||
while (sz1 > 0 && sz2 > 0) {
|
||||
*d++ = *s1++ ^ *s2++;
|
||||
sz1--, sz2--;
|
||||
}
|
||||
while (--sz1 >= 0)
|
||||
*d++ = *s1++;
|
||||
while (--sz2 >= 0)
|
||||
*d++ = *s2++;
|
||||
while (--d > dbase && !*d) ;
|
||||
*dbase = d - dbase;
|
||||
return dbase;
|
||||
}
|
||||
|
||||
int P_inset(register unsigned val, register long *s) /* val IN s */
|
||||
{
|
||||
register int bit;
|
||||
bit = val % SETBITS;
|
||||
val /= SETBITS;
|
||||
if ((long) val < (*s++ && ((1L<<bit) & s[val])))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
long *P_addset(register long *s, register unsigned val) /* s := s + [val] */
|
||||
{
|
||||
register long *sbase = s;
|
||||
register int bit, size;
|
||||
bit = val % SETBITS;
|
||||
val /= SETBITS;
|
||||
size = *s;
|
||||
if ((long) ++val > size) {
|
||||
s += size;
|
||||
while ((long) val > size)
|
||||
*++s = 0, size++;
|
||||
*sbase = size;
|
||||
} else
|
||||
s += val;
|
||||
*s |= 1L<<bit;
|
||||
return sbase;
|
||||
}
|
||||
|
||||
long *P_addsetr(register long *s, register unsigned v1, register unsigned v2) /* s := s + [v1..v2] */
|
||||
{
|
||||
register long *sbase = s;
|
||||
register int b1, b2, size;
|
||||
if ((int)v1 > (int)v2)
|
||||
return sbase;
|
||||
b1 = v1 % SETBITS;
|
||||
v1 /= SETBITS;
|
||||
b2 = v2 % SETBITS;
|
||||
v2 /= SETBITS;
|
||||
size = *s;
|
||||
v1++;
|
||||
if ((int) ++v2 > size) {
|
||||
while ((int) v2 > size)
|
||||
s[++size] = 0;
|
||||
s[v2] = 0;
|
||||
*s = v2;
|
||||
}
|
||||
s += v1;
|
||||
if (v1 == v2) {
|
||||
*s |= (~((-2L)<<(b2-b1))) << b1;
|
||||
} else {
|
||||
*s++ |= (-1L) << b1;
|
||||
while (++v1 < v2)
|
||||
*s++ = -1;
|
||||
*s |= ~((-2L) << b2);
|
||||
}
|
||||
return sbase;
|
||||
}
|
||||
|
||||
long *P_remset(register long *s, register unsigned val) /* s := s - [val] */
|
||||
{
|
||||
register int bit;
|
||||
bit = val % SETBITS;
|
||||
val /= SETBITS;
|
||||
if ((long) ++val <= *s) {
|
||||
if (!(s[val] &= ~(1L<<bit)))
|
||||
while (*s && !s[*s])
|
||||
(*s)--;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
int P_setequal(register long *s1, register long *s2) /* s1 = s2 */
|
||||
{
|
||||
register int size = *s1++;
|
||||
if (*s2++ != size)
|
||||
return 0;
|
||||
while (--size >= 0) {
|
||||
if (*s1++ != *s2++)
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int P_subset(register long *s1, register long *s2) /* s1 <= s2 */
|
||||
{
|
||||
register int sz1 = *s1++, sz2 = *s2++;
|
||||
if (sz1 > sz2)
|
||||
return 0;
|
||||
while (--sz1 >= 0) {
|
||||
if (*s1++ & ~*s2++)
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
long *P_setcpy(register long *d, register long *s) /* d := s */
|
||||
{
|
||||
register long *save_d = d;
|
||||
|
||||
#ifdef SETCPY_MEMCPY
|
||||
memcpy(d, s, (*s + 1) * sizeof(long));
|
||||
#else
|
||||
register int i = *s + 1;
|
||||
while (--i >= 0)
|
||||
*d++ = *s++;
|
||||
#endif
|
||||
return save_d;
|
||||
}
|
||||
|
||||
|
||||
/* s is a "smallset", i.e., a 32-bit or less set stored
|
||||
directly in a long. */
|
||||
long *P_expset(register long *d, register long s) /* d := s */
|
||||
{
|
||||
if (s) {
|
||||
d[1] = s;
|
||||
*d = 1;
|
||||
} else
|
||||
*d = 0;
|
||||
return d;
|
||||
}
|
||||
|
||||
long P_packset(register long *s) /* convert s to a small-set */
|
||||
{
|
||||
if (*s++)
|
||||
return *s;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Oregon Software Pascal extensions, courtesy of William Bader */
|
||||
int P_getcmdline(int l, int h, Char *line)
|
||||
{
|
||||
int i, len;
|
||||
char *s;
|
||||
|
||||
h = h - l + 1;
|
||||
len = 0;
|
||||
for(i = 1; i < P_argc; i++) {
|
||||
s = P_argv[i];
|
||||
while (*s) {
|
||||
if (len >= h) return len;
|
||||
line[len++] = *s++;
|
||||
}
|
||||
if (len >= h) return len;
|
||||
line[len++] = ' ';
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
#ifndef NO_TIME
|
||||
Void TimeStamp(Day, Month, Year, Hour, Min, Sec)
|
||||
int *Day, *Month, *Year, *Hour, *Min, *Sec;
|
||||
{
|
||||
struct tm *tm;
|
||||
long clock;
|
||||
|
||||
time(&clock);
|
||||
tm = localtime(&clock);
|
||||
*Day = tm->tm_mday;
|
||||
*Month = tm->tm_mon + 1; /* Jan = 0 */
|
||||
*Year = tm->tm_year;
|
||||
if (*Year < 1900)
|
||||
*Year += 1900; /* year since 1900 */
|
||||
*Hour = tm->tm_hour;
|
||||
*Min = tm->tm_min;
|
||||
*Sec = tm->tm_sec;
|
||||
}
|
||||
|
||||
Void VAXdate(s)
|
||||
char *s;
|
||||
{
|
||||
long clock;
|
||||
char *c;
|
||||
int i;
|
||||
static int where[] = {8, 9, 0, 4, 5, 6, 0, 20, 21, 22, 23};
|
||||
|
||||
time(&clock);
|
||||
c = ctime(&clock);
|
||||
for (i = 0; i < 11; i++)
|
||||
s[i] = my_toupper(c[where[i]]);
|
||||
s[2] = '-';
|
||||
s[6] = '-';
|
||||
}
|
||||
|
||||
Void VAXtime(s)
|
||||
char *s;
|
||||
{
|
||||
long clock;
|
||||
char *c;
|
||||
int i;
|
||||
|
||||
time(&clock);
|
||||
c = ctime(&clock);
|
||||
for (i = 0; i < 8; i++)
|
||||
s[i] = c[i+11];
|
||||
s[8] = '.';
|
||||
s[9] = '0';
|
||||
s[10] = '0';
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* SUN Berkeley Pascal extensions */
|
||||
Void P_sun_argv(register char *s, register int len, register int n)
|
||||
{
|
||||
register char *cp;
|
||||
|
||||
if (n < P_argc)
|
||||
cp = P_argv[n];
|
||||
else
|
||||
cp = "";
|
||||
while (*cp && --len >= 0)
|
||||
*s++ = *cp++;
|
||||
while (--len >= 0)
|
||||
*s++ = ' ';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int _OutMem(void)
|
||||
{
|
||||
return _Escape(-2);
|
||||
}
|
||||
|
||||
int _CaseCheck(void)
|
||||
{
|
||||
return _Escape(-9);
|
||||
}
|
||||
|
||||
int _NilCheck(void)
|
||||
{
|
||||
return _Escape(-3);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* The following is suitable for the HP Pascal operating system.
|
||||
It might want to be revised when emulating another system. */
|
||||
|
||||
#ifdef SKIP
|
||||
static char *_ShowEscape(buf, code, ior, prefix)
|
||||
char *buf, *prefix;
|
||||
int code, ior;
|
||||
#endif
|
||||
static char *_ShowEscape(char *buf, int code, int ior, char *prefix)
|
||||
{
|
||||
char *bufp;
|
||||
|
||||
if (prefix && *prefix) {
|
||||
strcpy(buf, prefix);
|
||||
strcat(buf, ": ");
|
||||
bufp = buf + strlen(buf);
|
||||
} else {
|
||||
bufp = buf;
|
||||
}
|
||||
if (code == -10) {
|
||||
sprintf(bufp, "Pascal system I/O error %d", ior);
|
||||
switch (ior) {
|
||||
case 3:
|
||||
strcat(buf, " (illegal I/O request)");
|
||||
break;
|
||||
case 7:
|
||||
strcat(buf, " (bad file name)");
|
||||
break;
|
||||
case FileNotFound: /*10*/
|
||||
strcat(buf, " (file not found)");
|
||||
break;
|
||||
case FileNotOpen: /*13*/
|
||||
strcat(buf, " (file not open)");
|
||||
break;
|
||||
case BadInputFormat: /*14*/
|
||||
strcat(buf, " (bad input format)");
|
||||
break;
|
||||
case 24:
|
||||
strcat(buf, " (not open for reading)");
|
||||
break;
|
||||
case 25:
|
||||
strcat(buf, " (not open for writing)");
|
||||
break;
|
||||
case 26:
|
||||
strcat(buf, " (not open for direct access)");
|
||||
break;
|
||||
case 28:
|
||||
strcat(buf, " (string subscript out of range)");
|
||||
break;
|
||||
case EndOfFile: /*30*/
|
||||
strcat(buf, " (end-of-file)");
|
||||
break;
|
||||
case FileWriteError: /*38*/
|
||||
strcat(buf, " (file write error)");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
sprintf(bufp, "Pascal system error %d", code);
|
||||
switch (code) {
|
||||
case -2:
|
||||
strcat(buf, " (out of memory)");
|
||||
break;
|
||||
case -3:
|
||||
strcat(buf, " (reference to NIL pointer)");
|
||||
break;
|
||||
case -4:
|
||||
strcat(buf, " (integer overflow)");
|
||||
break;
|
||||
case -5:
|
||||
strcat(buf, " (divide by zero)");
|
||||
break;
|
||||
case -6:
|
||||
strcat(buf, " (real math overflow)");
|
||||
break;
|
||||
case -8:
|
||||
strcat(buf, " (value range error)");
|
||||
break;
|
||||
case -9:
|
||||
strcat(buf, " (CASE value range error)");
|
||||
break;
|
||||
case -12:
|
||||
strcat(buf, " (bus error)");
|
||||
break;
|
||||
case -20:
|
||||
strcat(buf, " (stopped by user)");
|
||||
break;
|
||||
}
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
int _Escape(int code)
|
||||
{
|
||||
char buf[100];
|
||||
char token[200];
|
||||
|
||||
P_escapecode = code;
|
||||
if (__top_jb) {
|
||||
__p2c_jmp_buf *jb = __top_jb;
|
||||
__top_jb = jb->next;
|
||||
longjmp(jb->jbuf, 1);
|
||||
}
|
||||
if (code == 0)
|
||||
/* exit(EXIT_SUCCESS); */
|
||||
error_msg("Exit success in Basic", STOP);
|
||||
if (code == -1) {
|
||||
error_msg("Fatal error in Basic interpreter.", CONTINUE);
|
||||
sprintf(token, "%s", _ShowEscape(buf, P_escapecode, P_ioresult, ""));
|
||||
error_msg(token, STOP);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
/* fprintf(stderr, "%s\n", _ShowEscape(buf, P_escapecode, P_ioresult, "")); */
|
||||
/* exit(EXIT_FAILURE); */
|
||||
error_msg("Fatal error in Basic interpreter.", CONTINUE);
|
||||
sprintf(token, "%s", _ShowEscape(buf, P_escapecode, P_ioresult, ""));
|
||||
error_msg(token, STOP);
|
||||
return(1);
|
||||
}
|
||||
int _EscIO(int code)
|
||||
{
|
||||
P_ioresult = code;
|
||||
return _Escape(-10);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* End. */
|
||||
904
parse.cpp
904
parse.cpp
@ -1,904 +0,0 @@
|
||||
#define EXTERNAL extern
|
||||
#include "global.h"
|
||||
#include "phqalloc.h"
|
||||
#include "output.h"
|
||||
#include "phrqproto.h"
|
||||
|
||||
static char const svnid[] = "$Id: parse.c 392 2005-07-19 16:05:07Z dlpark $";
|
||||
|
||||
static int get_coef(LDBLE *coef, char **eqnaddr);
|
||||
static int get_secondary (char **t_ptr, char *element, int *i);
|
||||
static int get_species (char **ptr);
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int parse_eq(char *eqn, struct elt_list **elt_ptr, int association)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
* function to break equation up into component species
|
||||
* returns species name, coefficient, and charge in global variable "rxn_list".
|
||||
* Also returns pointer to elt_list structure array with list of elements
|
||||
* and coefficients in species.
|
||||
* rxn_list global variable, output with contiguous rxn_list structures,
|
||||
* which is the reaction. Target species is first in
|
||||
* list, coefficient is -1.0.
|
||||
*
|
||||
* Argurments:
|
||||
* *eqn input, pointer to equation to be parsed.
|
||||
* **elt_ptr output, pointer to contiguous elt_list structures,
|
||||
* which is list of elements and coefficients in the
|
||||
* target species.
|
||||
* association input, TRUE or FALSE if reaction is an association reaction
|
||||
*/
|
||||
{
|
||||
int i;
|
||||
LDBLE coef, z;
|
||||
char c;
|
||||
char *ptr, *char_ptr;
|
||||
if (svnid == NULL) fprintf(stderr," ");
|
||||
|
||||
paren_count = 0;
|
||||
/*
|
||||
* Remove white space
|
||||
*/
|
||||
squeeze_white(eqn);
|
||||
/*
|
||||
* Check for illegal characters
|
||||
*/
|
||||
for (i = 0; (c=eqn[i]) != '\0'; i++) {
|
||||
if( islegit(c) == FALSE ){
|
||||
sprintf(error_string,"Character is not allowed,\
|
||||
%c (octal: %o).",c,c);
|
||||
error_msg(error_string, CONTINUE);
|
||||
return(ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Find coefficients, name, and charge for each species for lhs
|
||||
*/
|
||||
count_trxn=0;
|
||||
ptr=eqn;
|
||||
c = ptr[0];
|
||||
for (;;) {
|
||||
if (c == '=') break;
|
||||
if (c == '\0'){
|
||||
sprintf(error_string,"Equation has no equal sign.\n\t%s",eqn);
|
||||
error_msg(error_string, CONTINUE);
|
||||
return(ERROR);
|
||||
}
|
||||
if ( get_species (&ptr) == ERROR ){
|
||||
return(ERROR);
|
||||
}
|
||||
c = ptr[0];
|
||||
if ( association == FALSE ) {
|
||||
trxn.token[count_trxn].coef *= -1.0;
|
||||
}
|
||||
count_trxn++;
|
||||
}
|
||||
/*
|
||||
* Get coefficient, name, and charge of species for dissociation reaction
|
||||
*/
|
||||
ptr++;
|
||||
if ( association == TRUE ) {
|
||||
if ( get_species (&ptr) == ERROR ){
|
||||
return(ERROR);
|
||||
}
|
||||
trxn.token[count_trxn].coef *= -1.0;
|
||||
/* Swap species into first structure position */
|
||||
char_ptr=trxn.token[0].name;
|
||||
coef=trxn.token[0].coef;
|
||||
z=trxn.token[0].z;
|
||||
trxn.token[0].name=trxn.token[count_trxn].name;
|
||||
trxn.token[0].coef=trxn.token[count_trxn].coef;
|
||||
trxn.token[0].z=trxn.token[count_trxn].z;
|
||||
trxn.token[count_trxn].name=char_ptr;
|
||||
trxn.token[count_trxn].coef=coef;
|
||||
trxn.token[count_trxn].z=z;
|
||||
count_trxn++;
|
||||
}
|
||||
/*
|
||||
* Get reaction species from rhs of equation
|
||||
*/
|
||||
c = ptr[0];
|
||||
for (;;) {
|
||||
if (c == '\0') break;
|
||||
if ( get_species (&ptr) == ERROR ){
|
||||
return(ERROR);
|
||||
}
|
||||
c = ptr[0];
|
||||
if ( association == TRUE ) {
|
||||
trxn.token[count_trxn].coef *= -1.0;
|
||||
}
|
||||
count_trxn++;
|
||||
}
|
||||
/*
|
||||
* Sort list of reaction species
|
||||
*/
|
||||
trxn_sort();
|
||||
/*
|
||||
* Get elements in species or mineral formula
|
||||
*/
|
||||
count_elts=0;
|
||||
char_ptr=trxn.token[0].name;
|
||||
if ( get_elts_in_species( &char_ptr , trxn.token[0].coef ) == ERROR ) {
|
||||
return(ERROR);
|
||||
}
|
||||
/*
|
||||
* Sort elements in reaction and combine
|
||||
*/
|
||||
qsort (elt_list, (size_t) count_elts, (size_t) sizeof(struct elt_list), elt_list_compare);
|
||||
if (elt_list_combine () == ERROR) return(ERROR);
|
||||
/*
|
||||
* Malloc space and store element data for return
|
||||
*/
|
||||
*elt_ptr=(struct elt_list *) PHRQ_malloc((size_t) (count_elts + 1)*sizeof(struct elt_list));
|
||||
if (*elt_ptr == NULL ) malloc_error();
|
||||
for ( i=0; i < count_elts; i++ ) {
|
||||
(*elt_ptr)[i].elt=elt_list[i].elt;
|
||||
(*elt_ptr)[i].coef=-elt_list[i].coef;
|
||||
}
|
||||
(*elt_ptr)[count_elts].elt=NULL;
|
||||
/*
|
||||
* Debugging print of parsed equation
|
||||
trxn_print();
|
||||
*/
|
||||
return(OK);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int check_eqn ( int association )
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
* Check that equation is balanced reaction. Uses array "trxn.token" and
|
||||
* assumes "count_trxn" is set to number of species in reaction.
|
||||
* Charge and elements are checked.
|
||||
*
|
||||
* Arguments:
|
||||
*
|
||||
* association input, TRUE or FALSE if reaction is an association reaction.
|
||||
*/
|
||||
{
|
||||
int i;
|
||||
int oops=0;
|
||||
char *t_ptr;
|
||||
LDBLE sumcharge;
|
||||
|
||||
paren_count=0;
|
||||
count_elts=0;
|
||||
/*
|
||||
* Check that coefficient of first species is -1.0
|
||||
*/
|
||||
if ( equal(trxn.token[0].coef,-1.0,TOL) == FALSE ) {
|
||||
if (association == TRUE) {
|
||||
sprintf(error_string, "Coefficient of first species on rhs is not equal to 1.0.");
|
||||
error_msg(error_string, CONTINUE);
|
||||
} else {
|
||||
sprintf(error_string, "Coefficient of mineral (first on lhs) is not equal to 1.0.");
|
||||
error_msg(error_string, CONTINUE);
|
||||
}
|
||||
return(ERROR);
|
||||
}
|
||||
/*
|
||||
* Go through all species in the reaction; sum the charge and store elements
|
||||
*/
|
||||
sumcharge=0.0;
|
||||
for (i=0; i < count_trxn; i++) {
|
||||
sumcharge += ( trxn.token[i].coef)*(trxn.token[i].z);
|
||||
t_ptr=trxn.token[i].name;
|
||||
if ( get_elts_in_species(&t_ptr, trxn.token[i].coef ) == ERROR ) {
|
||||
return(ERROR);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Sort elements in reaction and combine
|
||||
*/
|
||||
qsort (elt_list, (size_t) count_elts, (size_t) sizeof(struct elt_list), elt_list_compare);
|
||||
if (elt_list_combine() == ERROR) return(ERROR);
|
||||
/*
|
||||
* Check charge
|
||||
*/
|
||||
if ( equal(sumcharge, 0.0, TOL) == FALSE) {
|
||||
sprintf(error_string, "Equation is not charge balanced.");
|
||||
error_msg(error_string, CONTINUE);
|
||||
oops++;
|
||||
}
|
||||
/*
|
||||
* Check mass balance
|
||||
*/
|
||||
for ( i=0; i < count_elts; i++) {
|
||||
if ( (equal(elt_list[i].coef,0.0,TOL) == FALSE) &&
|
||||
strncmp( (elt_list[i].elt)->name , "e" , MAX_LENGTH) != 0) {
|
||||
sprintf(error_string, "Equation does not balance for element, %s.", (elt_list[i].elt)->name);
|
||||
error_msg(error_string, CONTINUE);
|
||||
oops++;
|
||||
}
|
||||
}
|
||||
if (oops == 0) {
|
||||
return(OK);
|
||||
} else {
|
||||
return(ERROR);
|
||||
}
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int get_charge(char *charge, LDBLE *z)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
* Function takes character string and calculates the charge on
|
||||
* the species. Charge can be in two forms: (1) string of "+" or "-"
|
||||
* or (2) + or - followed by an integer. Charge is reduced to form (2)
|
||||
* and stored in the pointer location *charge.
|
||||
*
|
||||
* Arguments:
|
||||
* *charge input, string containing charge
|
||||
* output, string containing charge of the form + or -
|
||||
* followed by an integer, if integer greater than 1.
|
||||
* *z output, value of charge.
|
||||
*
|
||||
* Returns:
|
||||
* ERROR,
|
||||
* OK.
|
||||
*/
|
||||
{
|
||||
int i;
|
||||
char *ptr;
|
||||
char c,c1;
|
||||
/*
|
||||
* Charge is zero
|
||||
*/
|
||||
if((c=charge[0]) == '\0'){
|
||||
*z=0.0;
|
||||
return(OK);
|
||||
}
|
||||
/*
|
||||
* Error check for + or - at start of string
|
||||
*/
|
||||
if(c != '+' && c != '-'){
|
||||
sprintf(error_string,"Character string for charge does not start with + or -,\t%s.", charge);
|
||||
error_msg(error_string, CONTINUE);
|
||||
return(ERROR);
|
||||
}
|
||||
/*
|
||||
* Count string of +'s or -'s
|
||||
*/
|
||||
i=0;
|
||||
while (c == (c1=charge[i++]) );
|
||||
i--;
|
||||
if (c1 == '\0') {
|
||||
if (c == '-') i=-i;
|
||||
} else {
|
||||
/*
|
||||
* + or - followed by a number
|
||||
*/
|
||||
errno=0;
|
||||
i=strtol(charge,&ptr,0);
|
||||
#ifdef SKIP
|
||||
if (errno == ERANGE) {
|
||||
sprintf(error_string, "Error in character string for charge, %s.", charge);
|
||||
error_msg(error_string, CONTINUE);
|
||||
return(ERROR);
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* Truncate fractional part of charge if all zeros
|
||||
*/
|
||||
if (*ptr != '\0') {
|
||||
if ( *ptr == '.') {
|
||||
while (*(++ptr) != '\0') {
|
||||
if (*ptr != '0') {
|
||||
*z = strtod(charge, &ptr);
|
||||
return(OK);
|
||||
#ifdef SKIP
|
||||
sprintf(error_string, "Charge must be an integer, %s.", charge);
|
||||
error_msg(error_string, CONTINUE);
|
||||
return(ERROR);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Non-numeric characters
|
||||
*/
|
||||
} else {
|
||||
sprintf(error_string, "Error in character string for charge, %s.", charge);
|
||||
error_msg(error_string, CONTINUE);
|
||||
return(ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Charge is zero, must have had +0 or -0 in eqn
|
||||
*/
|
||||
if (i == 0) {
|
||||
charge[0]='\0';
|
||||
}
|
||||
/*
|
||||
* Charge is +1 or -1, single + or -
|
||||
*/
|
||||
if (abs(i) == 1) {
|
||||
charge[0]=c;
|
||||
charge[1]='\0';
|
||||
}
|
||||
/*
|
||||
* Abs(z)>1, set charge to + or - plus integer
|
||||
*/
|
||||
if (abs(i)>1) {
|
||||
if (sprintf(charge,"%-+d",i) == EOF){
|
||||
sprintf(error_string, "Error converting charge to character string, %s.", charge);
|
||||
error_msg(error_string, CONTINUE);
|
||||
return(ERROR);
|
||||
}
|
||||
}
|
||||
*z=i;
|
||||
return(OK);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int get_coef(LDBLE *coef, char **eqnaddr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
* Function reads through eqn and determines the coefficient of the next
|
||||
* species.
|
||||
*
|
||||
* Arguments:
|
||||
* *coef output, coefficient of next species.
|
||||
*
|
||||
* **eqnaddr input, pointer to a position in eqn to start parsing
|
||||
* output, pointer to next position after coefficient
|
||||
*
|
||||
* Returns:
|
||||
* ERROR,
|
||||
* OK.
|
||||
*/
|
||||
{
|
||||
int i;
|
||||
char c,c1;
|
||||
char *ptr, *ptr1, *rest;
|
||||
char token[MAX_LENGTH];;
|
||||
|
||||
rest=*eqnaddr;
|
||||
ptr=*eqnaddr; /* address of a position in eqn */
|
||||
c=*ptr; /* character in eqn */
|
||||
*coef=0.0;
|
||||
/*
|
||||
* No leading sign or number
|
||||
*/
|
||||
if (isalpha((int) c) ||
|
||||
(c == '(') ||
|
||||
(c == ')') ||
|
||||
(c == '[') ||
|
||||
(c == ']')
|
||||
) {
|
||||
*coef=1.0;
|
||||
return(OK);
|
||||
}
|
||||
/*
|
||||
* Leading +, no digits
|
||||
*/
|
||||
c1=*(ptr+1);
|
||||
if (c == '+' &&
|
||||
( isalpha((int) c1) ||
|
||||
(c1 == '(') ||
|
||||
(c1 == ')') ||
|
||||
(c1 == '[') ||
|
||||
(c1 == ']') ) ) {
|
||||
*eqnaddr=++ptr;
|
||||
*coef=1.0;
|
||||
return(OK);
|
||||
}
|
||||
/*
|
||||
* Leading -, no digits
|
||||
*/
|
||||
if (c == '-' &&
|
||||
( isalpha((int) c1) ||
|
||||
(c1 == '(') ||
|
||||
(c1 == ')') ||
|
||||
(c1 == '[') ||
|
||||
(c1 == ']')
|
||||
) ) {
|
||||
*eqnaddr=++ptr;
|
||||
*coef=-1.0;
|
||||
return(OK);
|
||||
}
|
||||
i=0;
|
||||
/*
|
||||
* Has number coefficient
|
||||
*/
|
||||
if (isdigit((int) c) || c == '+' || c == '-' || c =='.') {
|
||||
while (isdigit((int) c) || c == '+' || c == '-' || c =='.') {
|
||||
token[i++]=c;
|
||||
if (i >= MAX_LENGTH) {
|
||||
sprintf(error_string, "Coefficient has more than MAX_LENGTH characters.");
|
||||
error_msg(error_string, CONTINUE);
|
||||
return(ERROR);
|
||||
}
|
||||
c=*(++ptr);
|
||||
}
|
||||
token[i]='\0';
|
||||
*eqnaddr=ptr;
|
||||
errno = 0;
|
||||
*coef=strtod(token,&ptr1);
|
||||
if ((errno == ERANGE) ||
|
||||
(*ptr1 != '\0') ) {
|
||||
sprintf(error_string, "Error converting coefficient in get_coef, %s.", token);
|
||||
error_msg(error_string, CONTINUE);
|
||||
return(ERROR);
|
||||
}
|
||||
return(OK);
|
||||
}
|
||||
/*
|
||||
* None of the above, unknown construct
|
||||
*/
|
||||
sprintf(error_string, "Illegal equation construct detected in get_coef.\n\t%s.", rest);
|
||||
error_msg(error_string, CONTINUE);
|
||||
return(ERROR);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int get_elt (char **t_ptr, char *element, int *i)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
* Function reads an element name out of the equation string.
|
||||
* An element name is composed of a capital letter followed by any number
|
||||
* of lower case characters.
|
||||
*
|
||||
* Arguments:
|
||||
* **t_ptr input, points to position in the equation to begin
|
||||
* output, points to next character of equation after
|
||||
* element name.
|
||||
* *element input pointer to place to return element character string
|
||||
*/
|
||||
{
|
||||
char c;
|
||||
|
||||
c=*(*t_ptr)++;
|
||||
if (c == '\0') {
|
||||
sprintf(error_string, "Empty string in get_elt. Expected an element name.");
|
||||
error_msg(error_string, CONTINUE);
|
||||
return(ERROR);
|
||||
}
|
||||
/*
|
||||
* Load name into char array element
|
||||
*/
|
||||
element[0]=c;
|
||||
*i=1;
|
||||
if (c == '[') {
|
||||
while ((c=(**t_ptr)) != ']') {
|
||||
element[*i]=c;
|
||||
(*i)++;
|
||||
(*t_ptr)++;
|
||||
if ((c=(**t_ptr)) == ']') {
|
||||
element[*i]=c;
|
||||
(*i)++;
|
||||
(*t_ptr)++;
|
||||
break;
|
||||
} else if (**t_ptr == '\0') {
|
||||
error_msg("No ending bracket (]) for element name", CONTINUE);
|
||||
input_error++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (islower((int) (c=(**t_ptr))) || c == '_') {
|
||||
element[*i]=c;
|
||||
(*i)++;
|
||||
(*t_ptr)++;
|
||||
}
|
||||
} else {
|
||||
while (islower((int) (c=(**t_ptr))) || c == '_') {
|
||||
element[*i]=c;
|
||||
(*i)++;
|
||||
(*t_ptr)++;
|
||||
}
|
||||
}
|
||||
element[*i]='\0';
|
||||
return(OK);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int get_elts_in_species (char **t_ptr, LDBLE coef)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
* Makes a list of elements with their coefficients, stores elements
|
||||
* in elt_list at position count_elts. Global variable count_elts is
|
||||
* updated with each stored element. Also uses static global variable
|
||||
* paren_count.
|
||||
*
|
||||
* Arguments:
|
||||
* **t_ptr input, point in token string to start looking
|
||||
* output, is next position to start looking
|
||||
* coef input, coefficient to multiply subscripts by
|
||||
*/
|
||||
int i, count, l;
|
||||
char c, c1;
|
||||
LDBLE d;
|
||||
char element[MAX_LENGTH];
|
||||
|
||||
while ( ( (c=**t_ptr) != '+') &&
|
||||
(c != '-') && (c != '\0') ) {
|
||||
/* close parenthesis */
|
||||
if (c == ')') {
|
||||
paren_count--;
|
||||
if (paren_count < 0) {
|
||||
sprintf(error_string,"Too many right parentheses.");
|
||||
error_msg(error_string, CONTINUE);
|
||||
return(ERROR);
|
||||
}
|
||||
(*t_ptr)++;
|
||||
return(OK);
|
||||
}
|
||||
c1=*((*t_ptr)+1);
|
||||
/* beginning of element name */
|
||||
if (isupper((int) c) ||
|
||||
(c == 'e' && c1 == '-')
|
||||
|| (c == '[')
|
||||
) {
|
||||
/*
|
||||
* Get new element and subscript
|
||||
*/
|
||||
if ( get_elt( t_ptr, element, &l) == ERROR) {
|
||||
return(ERROR);
|
||||
}
|
||||
if (count_elts >= max_elts) {
|
||||
space ((void **) ((void *) &elt_list), count_elts, &max_elts,
|
||||
sizeof(struct elt_list));
|
||||
}
|
||||
elt_list[count_elts].elt = element_store ( element );
|
||||
if ( get_num( t_ptr , &d ) == ERROR) {
|
||||
return(ERROR);
|
||||
}
|
||||
elt_list[count_elts].coef = d*coef;
|
||||
count_elts++;
|
||||
/*
|
||||
* Expand working space for elements if necessary
|
||||
*/
|
||||
if (count_elts >= max_elts) {
|
||||
space ((void **) ((void *) &elt_list), count_elts, &max_elts,
|
||||
sizeof(struct elt_list));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
/*
|
||||
* Open parentheses
|
||||
*/
|
||||
if (c=='(') {
|
||||
count=count_elts;
|
||||
if (c1 == ')') {
|
||||
sprintf(error_string, "Empty parentheses.");
|
||||
warning_msg(error_string);
|
||||
}
|
||||
paren_count++;
|
||||
(*t_ptr)++;
|
||||
if ( get_elts_in_species(t_ptr, coef ) == ERROR ) {
|
||||
return(ERROR);
|
||||
}
|
||||
if (get_num (t_ptr, &d) == ERROR ) {
|
||||
return(ERROR);
|
||||
}
|
||||
for (i=count; i < count_elts; i++) {
|
||||
elt_list[i].coef *= d;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
/*
|
||||
* Colon
|
||||
*/
|
||||
if (c==':') {
|
||||
count=count_elts;
|
||||
(*t_ptr)++;
|
||||
if (get_num (t_ptr, &d) == ERROR ) {
|
||||
return(ERROR);
|
||||
}
|
||||
if ( get_elts_in_species(t_ptr, coef ) == ERROR ) {
|
||||
return(ERROR);
|
||||
}
|
||||
for (i=count; i < count_elts; i++) {
|
||||
elt_list[i].coef *= d;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
/*
|
||||
* Not beginning of element and not opening paren
|
||||
*/
|
||||
sprintf(error_string, "Parsing error in get_elts_in_species, unexpected character, %c.", c);
|
||||
error_msg(error_string, CONTINUE);
|
||||
input_error++;
|
||||
return (ERROR);
|
||||
}
|
||||
if (paren_count != 0) {
|
||||
sprintf(error_string,"Unbalanced parentheses.");
|
||||
error_msg(error_string, CONTINUE);
|
||||
input_error++;
|
||||
return(ERROR);
|
||||
}
|
||||
return (OK);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
static int get_secondary (char **t_ptr, char *element, int *i)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
* Function reads an element name out of the equation string.
|
||||
* An element name is composed of a capital letter followed by any number
|
||||
* of lower case characters.
|
||||
*
|
||||
* Arguments:
|
||||
* **t_ptr input, points to position in the equation to begin
|
||||
* output, points to next character of equation after
|
||||
* element name.
|
||||
* *element input pointer to place to return element character string
|
||||
*/
|
||||
{
|
||||
int j;
|
||||
char c;
|
||||
char *ptr;
|
||||
|
||||
c=*(*t_ptr)++;
|
||||
if (c == '\0') {
|
||||
sprintf(error_string, "Empty string in get_elt. Expected an element name.");
|
||||
error_msg(error_string, CONTINUE);
|
||||
input_error++;
|
||||
return(ERROR);
|
||||
}
|
||||
/*
|
||||
* Load name into char array element
|
||||
*/
|
||||
element[0]=c;
|
||||
*i=1;
|
||||
if (c == '[') {
|
||||
while ((c=(**t_ptr)) != ']') {
|
||||
element[*i]=c;
|
||||
(*i)++;
|
||||
(*t_ptr)++;
|
||||
if ((c=(**t_ptr)) == ']') {
|
||||
element[*i]=c;
|
||||
(*i)++;
|
||||
(*t_ptr)++;
|
||||
c=(**t_ptr);
|
||||
break;
|
||||
} else if ((c=(**t_ptr)) == '\0') {
|
||||
error_msg("Did not find ending bracket (])", CONTINUE);
|
||||
input_error++;
|
||||
return(ERROR);
|
||||
}
|
||||
}
|
||||
while (islower((int) (c=(**t_ptr))) || c == '_') {
|
||||
element[*i]=c;
|
||||
(*i)++;
|
||||
(*t_ptr)++;
|
||||
}
|
||||
} else {
|
||||
while (islower((int) (c=(**t_ptr))) || c == '_') {
|
||||
element[*i]=c;
|
||||
(*i)++;
|
||||
(*t_ptr)++;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Check if secondary master species element
|
||||
*/
|
||||
j = *i;
|
||||
ptr = *t_ptr;
|
||||
if (c == '(') {
|
||||
/* copy parenthesis */
|
||||
element[*i]=c;
|
||||
(*i)++;
|
||||
(*t_ptr)++;
|
||||
/* copy number */
|
||||
for (;;) {
|
||||
c = **t_ptr;
|
||||
if (isdigit((int) c) || c == '-' || c == '.') {
|
||||
element[*i]=c;
|
||||
(*i)++;
|
||||
(*t_ptr)++;
|
||||
} else if (c == '+') {
|
||||
(*t_ptr)++;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* go back to before parenthesis */
|
||||
if (c != ')' ) {
|
||||
*i = j;
|
||||
*t_ptr = ptr;
|
||||
/* put in closing parenthesis */
|
||||
} else {
|
||||
element[*i]=c;
|
||||
(*i)++;
|
||||
(*t_ptr)++;
|
||||
}
|
||||
}
|
||||
element[*i]='\0';
|
||||
return(OK);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int get_secondary_in_species (char **t_ptr, LDBLE coef)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
* Makes a list of elements with their coefficients, stores elements
|
||||
* in elt_list at position count_elts. Global variable count_elts is
|
||||
* updated with each stored element. Also uses static global variable
|
||||
* paren_count.
|
||||
*
|
||||
* Arguments:
|
||||
* **t_ptr input, point in token string to start looking
|
||||
* output, is next position to start looking
|
||||
* coef input, coefficient to multiply subscripts by
|
||||
*/
|
||||
int i, count, l;
|
||||
char c, c1;
|
||||
LDBLE d;
|
||||
char element[MAX_LENGTH];
|
||||
|
||||
while ( ( (c=**t_ptr) != '+') &&
|
||||
(c != '-') && (c != '\0') ) {
|
||||
/* close parenthesis */
|
||||
if (c == ')') {
|
||||
paren_count--;
|
||||
if (paren_count < 0) {
|
||||
sprintf(error_string,"Too many right parentheses.");
|
||||
error_msg(error_string, CONTINUE);
|
||||
input_error++;
|
||||
return(ERROR);
|
||||
}
|
||||
(*t_ptr)++;
|
||||
return(OK);
|
||||
}
|
||||
c1=*((*t_ptr)+1);
|
||||
/* beginning of element name */
|
||||
if (isupper((int) c) ||
|
||||
c == '[' ||
|
||||
(c == 'e' && c1 == '-') ) {
|
||||
/*
|
||||
* Get new element and subscript
|
||||
*/
|
||||
if ( get_secondary( t_ptr, element, &l) == ERROR) {
|
||||
return(ERROR);
|
||||
}
|
||||
elt_list[count_elts].elt = element_store ( element );
|
||||
if ( get_num( t_ptr , &d ) == ERROR) {
|
||||
return(ERROR);
|
||||
}
|
||||
elt_list[count_elts].coef = d*coef;
|
||||
count_elts++;
|
||||
/*
|
||||
* Expand working space for elements if necessary
|
||||
*/
|
||||
if (count_elts >= max_elts) {
|
||||
space ((void **) ((void *) &elt_list), count_elts, &max_elts,
|
||||
sizeof(struct elt_list));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
/*
|
||||
* Open parentheses
|
||||
*/
|
||||
if (c=='(') {
|
||||
count=count_elts;
|
||||
if (c1 == ')') {
|
||||
sprintf(error_string, "Empty parentheses.");
|
||||
warning_msg(error_string);
|
||||
}
|
||||
paren_count++;
|
||||
(*t_ptr)++;
|
||||
if ( get_secondary_in_species(t_ptr, coef ) == ERROR ) {
|
||||
return(ERROR);
|
||||
}
|
||||
if (get_num (t_ptr, &d) == ERROR ) {
|
||||
return(ERROR);
|
||||
}
|
||||
for (i=count; i < count_elts; i++) {
|
||||
elt_list[i].coef *= d;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
/*
|
||||
* Colon
|
||||
*/
|
||||
if (c==':') {
|
||||
count=count_elts;
|
||||
(*t_ptr)++;
|
||||
if (get_num (t_ptr, &d) == ERROR ) {
|
||||
return(ERROR);
|
||||
}
|
||||
if ( get_secondary_in_species(t_ptr, coef ) == ERROR ) {
|
||||
return(ERROR);
|
||||
}
|
||||
for (i=count; i < count_elts; i++) {
|
||||
elt_list[i].coef *= d;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
/*
|
||||
* Not beginning of element and not opening paren
|
||||
*/
|
||||
sprintf(error_string, "Parsing error in get_secondary_in_species, unexpected character, %c.", c);
|
||||
error_msg(error_string, CONTINUE);
|
||||
return (ERROR);
|
||||
}
|
||||
if (paren_count != 0) {
|
||||
sprintf(error_string,"Unbalanced parentheses.");
|
||||
error_msg(error_string, CONTINUE);
|
||||
return(ERROR);
|
||||
}
|
||||
return (OK);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int get_num (char **t_ptr, LDBLE *num)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
* Function reads through a string looking for leading numeric field
|
||||
* if no numeric field is found, the number is set to 1.0.
|
||||
*
|
||||
* Arguments:
|
||||
*
|
||||
* **t_ptr input, points to a position in a character string from which
|
||||
* a number is to be extracted.
|
||||
* output, points to next position to be parsed.
|
||||
* *num address where the number is to be stored.
|
||||
*
|
||||
* Returns:
|
||||
* ERROR,
|
||||
* OK.
|
||||
*/
|
||||
{
|
||||
int i, decimal;
|
||||
char c;
|
||||
char *ptr1;
|
||||
char token[MAX_LENGTH];
|
||||
|
||||
*num=1.0;
|
||||
i=0;
|
||||
c=**t_ptr;
|
||||
decimal=0;
|
||||
if (isdigit((int) c) || (c == '.') ){
|
||||
while (isdigit((int) c) || (c == '.') ) {
|
||||
if (c == '.') decimal++;
|
||||
if (decimal > 1) break;
|
||||
token[i++]=c;
|
||||
/* check number length */
|
||||
if (i >= MAX_LENGTH ) {
|
||||
sprintf(error_string, "Number was greater than MAX_LENGTH characters.");
|
||||
error_msg(error_string, CONTINUE);
|
||||
input_error++;
|
||||
return(ERROR);
|
||||
}
|
||||
c=*(++(*t_ptr));
|
||||
}
|
||||
token[i]='\0';
|
||||
errno=0;
|
||||
*num=strtod(token,&ptr1);
|
||||
if ( errno == ERANGE ) {
|
||||
sprintf(error_string,"Converting number in get_num, %s.", token);
|
||||
input_error++;
|
||||
error_msg(error_string, CONTINUE);
|
||||
return(ERROR);
|
||||
}
|
||||
}
|
||||
return(OK);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int get_species (char **ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/* Function reads next species out of the equation, including optional
|
||||
* preceding coefficient and optional trailing charge. Data are
|
||||
* store in trxn.token[count].
|
||||
*
|
||||
* Arguments:
|
||||
* **ptr input, points to the position in the equation to pick up the species.
|
||||
* output, points to the next character after the species charge.
|
||||
*
|
||||
*/
|
||||
char string[MAX_LENGTH];
|
||||
int l;
|
||||
|
||||
if (count_trxn + 1 >= max_trxn) {
|
||||
space ((void **) &(trxn.token), count_trxn+1, &max_trxn,
|
||||
sizeof(struct rxn_token_temp));
|
||||
}
|
||||
/* coefficient */
|
||||
if ( get_coef(&(trxn.token[count_trxn].coef), ptr) == ERROR ) {
|
||||
return(ERROR);
|
||||
}
|
||||
/* name and charge */
|
||||
if ( get_token( ptr, string, &trxn.token[count_trxn].z, &l) == ERROR ) {
|
||||
return(ERROR);
|
||||
}
|
||||
trxn.token[count_trxn].name = string_hsave ( string );
|
||||
return(OK);
|
||||
}
|
||||
246
phqalloc.cpp
246
phqalloc.cpp
@ -1,246 +0,0 @@
|
||||
#define EXTERNAL extern
|
||||
#include "global.h"
|
||||
#include "output.h"
|
||||
/*#include <malloc.h>*/
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
static char const svnid[] = "$Id: phqalloc.c 78 2005-02-01 22:47:12Z dlpark $";
|
||||
|
||||
#if defined(PHREEQCI_GUI)
|
||||
#define _CRTDBG_MAP_ALLOC
|
||||
#include <crtdbg.h>
|
||||
#endif
|
||||
|
||||
typedef struct PHRQMemHeader {
|
||||
struct PHRQMemHeader *pNext; /* memory allocated just after this one */
|
||||
struct PHRQMemHeader *pPrev; /* memory allocated just prior to this one */
|
||||
#if !defined(NDEBUG)
|
||||
size_t size; /* memory request + sizeof(PHRQMemHeader) */
|
||||
char *szFileName; /* file name */
|
||||
int nLine; /* line number */
|
||||
int dummy; /* alignment */
|
||||
#endif
|
||||
} PHRQMemHeader;
|
||||
|
||||
/*
|
||||
* This pointer points to the last allocated block
|
||||
* Note: s_pTail->pNext should always be NULL
|
||||
*/
|
||||
static PHRQMemHeader *s_pTail = NULL;
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
#if !defined(NDEBUG)
|
||||
void *PHRQ_malloc( size_t size, const char *szFileName, int nLine)
|
||||
#else
|
||||
void *PHRQ_malloc( size_t size)
|
||||
#endif
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
PHRQMemHeader *p;
|
||||
if (svnid == NULL) fprintf(stderr," ");
|
||||
|
||||
assert((s_pTail == NULL) || (s_pTail->pNext == NULL));
|
||||
|
||||
p = (PHRQMemHeader*)malloc(sizeof(PHRQMemHeader) + size);
|
||||
|
||||
if (p == NULL) return NULL;
|
||||
|
||||
#if !defined(NDEBUG)
|
||||
memset(p, 0, sizeof(PHRQMemHeader) + size);
|
||||
#endif
|
||||
p->pNext = NULL;
|
||||
|
||||
if ( (p->pPrev = s_pTail) != NULL ) {
|
||||
s_pTail->pNext = p;
|
||||
}
|
||||
|
||||
#if !defined(NDEBUG)
|
||||
p->size = sizeof(PHRQMemHeader) + size;
|
||||
p->szFileName = (char *) malloc(strlen(szFileName) + 1);
|
||||
if (p->szFileName) strcpy(p->szFileName, szFileName);
|
||||
p->nLine = nLine;
|
||||
#endif
|
||||
|
||||
s_pTail = p;
|
||||
p++;
|
||||
return ((void *)(p));
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
void PHRQ_free( void *ptr )
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
PHRQMemHeader *p;
|
||||
|
||||
assert((s_pTail == NULL) || (s_pTail->pNext == NULL));
|
||||
|
||||
if (ptr == NULL) return;
|
||||
|
||||
p = (PHRQMemHeader *)ptr - 1;
|
||||
|
||||
if (p->pNext != NULL) {
|
||||
p->pNext->pPrev = p->pPrev;
|
||||
} else {
|
||||
/* Handle special case when (p == s_pTail) */
|
||||
assert(s_pTail != NULL);
|
||||
assert(p == s_pTail);
|
||||
s_pTail = p->pPrev;
|
||||
}
|
||||
|
||||
if (p->pPrev) {
|
||||
p->pPrev->pNext = p->pNext;
|
||||
}
|
||||
|
||||
#if !defined(NDEBUG)
|
||||
free(p->szFileName);
|
||||
#endif
|
||||
|
||||
free(p);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
void PHRQ_free_all( void )
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
assert((s_pTail == NULL) || (s_pTail->pNext == NULL));
|
||||
|
||||
if (s_pTail == NULL) {
|
||||
#if !defined(NDEBUG)
|
||||
output_msg(OUTPUT_MESSAGE, "No memory leaks\n");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
while (s_pTail->pPrev != NULL)
|
||||
{
|
||||
s_pTail = s_pTail->pPrev;
|
||||
#if !defined(NDEBUG)
|
||||
output_msg(OUTPUT_MESSAGE, "%s(%d) %p: freed in PHRQ_free_all\n",
|
||||
s_pTail->pNext->szFileName, s_pTail->pNext->nLine, (void *) (s_pTail->pNext + 1));
|
||||
free(s_pTail->pNext->szFileName);
|
||||
#endif
|
||||
free(s_pTail->pNext);
|
||||
}
|
||||
|
||||
#if !defined(NDEBUG)
|
||||
output_msg(OUTPUT_MESSAGE, "%s(%d) %p: freed in PHRQ_free_all\n",
|
||||
s_pTail->szFileName, s_pTail->nLine, (void *) (s_pTail+1));
|
||||
if (phast == TRUE) {
|
||||
output_msg(OUTPUT_STDERR, "%s(%d) %p: freed in PHRQ_free_all, %d\n",
|
||||
s_pTail->szFileName, s_pTail->nLine, (void *) (s_pTail+1), phreeqc_mpi_myself);
|
||||
}
|
||||
free(s_pTail->szFileName);
|
||||
#endif
|
||||
free(s_pTail);
|
||||
s_pTail = NULL;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
void *PHRQ_calloc( size_t num,
|
||||
size_t size
|
||||
#if !defined(NDEBUG)
|
||||
,
|
||||
const char *szFileName,
|
||||
int nLine
|
||||
#endif
|
||||
)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
PHRQMemHeader *p;
|
||||
|
||||
assert((s_pTail == NULL) || (s_pTail->pNext == NULL));
|
||||
|
||||
p = (PHRQMemHeader*)malloc(sizeof(PHRQMemHeader) + size * num);
|
||||
|
||||
if (p == NULL) return NULL;
|
||||
|
||||
p->pNext = NULL;
|
||||
|
||||
if ( (p->pPrev = s_pTail) != NULL ) {
|
||||
s_pTail->pNext = p;
|
||||
}
|
||||
|
||||
#if !defined(NDEBUG)
|
||||
p->size = sizeof(PHRQMemHeader) + size * num;
|
||||
p->szFileName = (char *) malloc(strlen(szFileName) + 1);
|
||||
if (p->szFileName) strcpy(p->szFileName, szFileName);
|
||||
p->nLine = nLine;
|
||||
#endif
|
||||
|
||||
s_pTail = p;
|
||||
p++;
|
||||
return memset(p, 0, size * num);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
void *PHRQ_realloc( void *ptr,
|
||||
size_t size
|
||||
#if !defined(NDEBUG)
|
||||
,
|
||||
const char *szFileName,
|
||||
int nLine
|
||||
#endif
|
||||
)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
PHRQMemHeader *p;
|
||||
size_t new_size;
|
||||
|
||||
#if !defined(NDEBUG)
|
||||
size_t old_size;
|
||||
#endif
|
||||
|
||||
if (ptr == NULL)
|
||||
{
|
||||
return PHRQ_malloc(size
|
||||
#if !defined(NDEBUG)
|
||||
,
|
||||
szFileName,
|
||||
nLine
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
assert((s_pTail == NULL) || (s_pTail->pNext == NULL));
|
||||
|
||||
p = (PHRQMemHeader*)ptr - 1;
|
||||
|
||||
new_size = sizeof(PHRQMemHeader) + size;
|
||||
|
||||
#if defined(NDEBUG)
|
||||
p = (PHRQMemHeader*)realloc(p, new_size);
|
||||
#else
|
||||
old_size = p->size;
|
||||
p = (PHRQMemHeader*)realloc(p, new_size);
|
||||
if (p != NULL) {
|
||||
p->size = new_size;
|
||||
if (new_size > old_size) {
|
||||
memset((char*)p + old_size, 0, new_size - old_size);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (p == NULL) return NULL;
|
||||
|
||||
if (p->pPrev != NULL) {
|
||||
p->pPrev->pNext = p;
|
||||
}
|
||||
|
||||
if (p->pNext != NULL) {
|
||||
p->pNext->pPrev = p;
|
||||
} else {
|
||||
s_pTail = p;
|
||||
}
|
||||
|
||||
#if !defined(NDEBUG)
|
||||
free(p->szFileName);
|
||||
p->szFileName = (char *) malloc(strlen(szFileName) + 1);
|
||||
if (p->szFileName) strcpy(p->szFileName, szFileName);
|
||||
p->nLine = nLine;
|
||||
#endif
|
||||
|
||||
p++;
|
||||
return ((void *)(p));
|
||||
}
|
||||
|
||||
@ -1,524 +0,0 @@
|
||||
#define EXTERNAL extern
|
||||
#include "global.h"
|
||||
#include "phqalloc.h"
|
||||
#include "output.h"
|
||||
#include "phrqproto.h"
|
||||
#include "input.h"
|
||||
|
||||
/* following line defines path for default data base file */
|
||||
const char *default_data_base = "phreeqc.dat";
|
||||
|
||||
static FILE *input_file = NULL;
|
||||
static FILE *database_file = NULL;
|
||||
static FILE *output = NULL; /* OUTPUT_MESSAGE */
|
||||
static FILE *log_file = NULL; /* OUTPUT_LOG */
|
||||
static FILE *punch_file = NULL; /* OUTPUT_PUNCH */
|
||||
static FILE *error_file = NULL; /* OUTPUT_ERROR */
|
||||
static FILE *dump_file = NULL; /* OUTPUT_DUMP */
|
||||
|
||||
static int fileop_handler(const int type, int (*PFN)(FILE*));
|
||||
static int open_handler(const int type, const char *file_name);
|
||||
static int output_handler(const int type, const char *err_str, const int stop, void *cookie, const char *format, va_list args);
|
||||
static int rewind_wrapper(FILE* file_ptr);
|
||||
|
||||
static char const svnid[] = "$Id: phreeqc_files.c 78 2005-02-01 22:47:12Z dlpark $";
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int phreeqc_handler(const int action, const int type, const char *err_str, const int stop, void *cookie, const char *format, va_list args)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i;
|
||||
|
||||
switch (action) {
|
||||
case ACTION_OPEN:
|
||||
return open_handler(type, err_str);
|
||||
break;
|
||||
case ACTION_OUTPUT:
|
||||
return output_handler(type, err_str, stop, cookie, format, args);
|
||||
break;
|
||||
case ACTION_FLUSH:
|
||||
return fileop_handler(type, fflush);
|
||||
break;
|
||||
case ACTION_REWIND:
|
||||
return fileop_handler(type, rewind_wrapper);
|
||||
break;
|
||||
case ACTION_CLOSE:
|
||||
|
||||
i = fileop_handler(type, fclose);
|
||||
switch (type) {
|
||||
case OUTPUT_ERROR:
|
||||
error_file = NULL;
|
||||
break;
|
||||
|
||||
case OUTPUT_WARNING:
|
||||
break;
|
||||
|
||||
case OUTPUT_MESSAGE:
|
||||
output = NULL;
|
||||
break;
|
||||
|
||||
case OUTPUT_PUNCH:
|
||||
punch_file = NULL;
|
||||
break;
|
||||
|
||||
case OUTPUT_SCREEN:
|
||||
break;
|
||||
|
||||
case OUTPUT_LOG:
|
||||
log_file = NULL;
|
||||
break;
|
||||
|
||||
case OUTPUT_STDERR:
|
||||
break;
|
||||
|
||||
case OUTPUT_DUMP:
|
||||
dump_file = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return(i);
|
||||
break;
|
||||
}
|
||||
return ERROR;
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int close_input_files(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i = 0;
|
||||
i |= fclose(database_file);
|
||||
i |= fclose(input_file);
|
||||
input_file = database_file = NULL;
|
||||
return (i);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int process_file_names(int argc, char *argv[], void **db_cookie, void **input_cookie, int log)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int l;
|
||||
char token[2*MAX_LENGTH], default_name[2*MAX_LENGTH];
|
||||
char query[2*MAX_LENGTH];
|
||||
char in_file[2*MAX_LENGTH], out_file[2*MAX_LENGTH];
|
||||
char *env_ptr;
|
||||
char *ptr;
|
||||
int errors;
|
||||
ENTRY item, *found_item;
|
||||
|
||||
/*
|
||||
* Prepare error handling
|
||||
*/
|
||||
errors = setjmp(mark);
|
||||
if (errors != 0) {
|
||||
return errors;
|
||||
}
|
||||
|
||||
/*
|
||||
* Prep for get_line
|
||||
*/
|
||||
max_line = MAX_LINE;
|
||||
space ((void **) ((void *) &line), INIT, &max_line, sizeof(char));
|
||||
space ((void **) ((void *) &line_save), INIT, &max_line, sizeof(char));
|
||||
hcreate_multi(5, &strings_hash_table);
|
||||
hcreate_multi(2, &keyword_hash_table);
|
||||
|
||||
/*
|
||||
* Initialize hash table
|
||||
*/
|
||||
keyword_hash = (struct key *) PHRQ_malloc(sizeof(struct key));
|
||||
if (keyword_hash == NULL) {
|
||||
malloc_error();
|
||||
} else {
|
||||
keyword_hash->name = string_hsave("database");
|
||||
keyword_hash->keycount = 0;
|
||||
item.key = keyword_hash->name;
|
||||
item.data = keyword_hash;
|
||||
found_item = hsearch_multi(keyword_hash_table, item, ENTER);
|
||||
if (found_item == NULL) {
|
||||
sprintf(error_string, "Hash table error in keyword initialization.");
|
||||
error_msg(error_string, STOP);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Open file for screen output
|
||||
*/
|
||||
if (argc > 4) {
|
||||
error_file = fopen(argv[4], "w");
|
||||
if (error_file == NULL) {
|
||||
error_file = stderr;
|
||||
sprintf(error_string, "Error opening file, %s.", argv[4]);
|
||||
warning_msg(error_string);
|
||||
}
|
||||
} else {
|
||||
error_file = stderr;
|
||||
}
|
||||
|
||||
/*
|
||||
* Open user-input file
|
||||
*/
|
||||
strcpy(query,"Name of input file?");
|
||||
if (argc <= 1) {
|
||||
default_name[0]='\0';
|
||||
input_file = file_open(query, default_name, "r", FALSE);
|
||||
} else {
|
||||
strcpy(default_name, argv[1]);
|
||||
input_file = file_open(query, default_name, "r", TRUE);
|
||||
}
|
||||
output_msg(OUTPUT_SCREEN, "Input file: %s\n\n", default_name);
|
||||
output_msg(OUTPUT_SEND_MESSAGE, "Input file: %s\r\n\r\n", default_name);
|
||||
strcpy(in_file, default_name);
|
||||
/*
|
||||
* Open file for output
|
||||
*/
|
||||
strcpy(query,"Name of output file?");
|
||||
#ifdef DOS
|
||||
replace("."," ",default_name);
|
||||
#endif
|
||||
ptr = default_name;
|
||||
copy_token(token, &ptr, &l);
|
||||
strcat(token,".out");
|
||||
if (argc <= 1) {
|
||||
output = file_open(query, token, "w", FALSE);
|
||||
} else if (argc == 2) {
|
||||
output = file_open(query, token, "w", TRUE);
|
||||
} else if (argc >= 3) {
|
||||
strcpy(token, argv[2]);
|
||||
output = file_open(query, token, "w", TRUE);
|
||||
}
|
||||
output_msg(OUTPUT_SCREEN, "Output file: %s\n\n", token);
|
||||
output_msg(OUTPUT_SEND_MESSAGE, "Output file: %s\r\n\r\n", token);
|
||||
strcpy(out_file, token);
|
||||
/*
|
||||
* Open file for errors
|
||||
*/
|
||||
if (log == TRUE) {
|
||||
if ((log_file = fopen("phreeqc.log","w")) == NULL) {
|
||||
error_msg ("Can't open log file, phreeqc.log.", STOP);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Read input file for DATABASE keyword
|
||||
*/
|
||||
if (get_line(getc_callback, input_file) == KEYWORD) {
|
||||
ptr = line;
|
||||
copy_token(token, &ptr, &l);
|
||||
if (strcmp_nocase(token, "database") == 0) {
|
||||
user_database = string_duplicate(ptr);
|
||||
if (string_trim(user_database) == EMPTY) {
|
||||
warning_msg("DATABASE file name is missing; default database will be used.");
|
||||
user_database = (char *) free_check_null(user_database);
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose(input_file);
|
||||
if ((input_file = fopen(in_file,"r")) == NULL) {;
|
||||
error_msg ("Can't reopen input file.", STOP);
|
||||
}
|
||||
/*
|
||||
* Open data base
|
||||
*/
|
||||
strcpy(query,"Name of database file?");
|
||||
env_ptr = getenv("PHREEQC_DATABASE");
|
||||
if (user_database != NULL) {
|
||||
strcpy(token, user_database);
|
||||
} else if (env_ptr != NULL) {
|
||||
strcpy(token, env_ptr);
|
||||
} else {
|
||||
strcpy(token, default_data_base);
|
||||
}
|
||||
if (argc <= 1) {
|
||||
database_file = file_open(query, token, "r", FALSE);
|
||||
} else if (argc < 4) {
|
||||
database_file = file_open(query, token, "r", TRUE);
|
||||
} else if (argc >= 4) {
|
||||
if (user_database == NULL) {
|
||||
strcpy(token, argv[3]);
|
||||
} else {
|
||||
#ifndef PHREEQCI_GUI
|
||||
warning_msg("Database file from DATABASE keyword is used; command line argument ignored.");
|
||||
#endif
|
||||
}
|
||||
database_file = file_open(query, token, "r", TRUE);
|
||||
}
|
||||
output_msg(OUTPUT_SCREEN, "Database file: %s\n\n", token);
|
||||
output_msg(OUTPUT_SEND_MESSAGE, "Database file: %s\r\n\r\n", token);
|
||||
|
||||
|
||||
output_msg(OUTPUT_MESSAGE, " Input file: %s\n", in_file);
|
||||
output_msg(OUTPUT_MESSAGE, " Output file: %s\n", out_file);
|
||||
output_msg(OUTPUT_MESSAGE, "Database file: %s\n\n", token);
|
||||
|
||||
|
||||
/*
|
||||
* local cleanup
|
||||
*/
|
||||
user_database = (char *) free_check_null(user_database);
|
||||
line = (char *) free_check_null(line);
|
||||
line_save = (char *) free_check_null(line_save);
|
||||
|
||||
hdestroy_multi(keyword_hash_table);
|
||||
keyword_hash = (struct key *) free_check_null(keyword_hash);
|
||||
keyword_hash_table = NULL;
|
||||
|
||||
free_hash_strings(strings_hash_table);
|
||||
hdestroy_multi(strings_hash_table);
|
||||
strings_hash_table = NULL;
|
||||
|
||||
*db_cookie = database_file;
|
||||
*input_cookie = input_file;
|
||||
|
||||
return 0;
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int getc_callback(void* cookie)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i;
|
||||
assert(cookie);
|
||||
i = getc((FILE*)cookie);
|
||||
#ifdef PHREEQ98
|
||||
if (i == '\n') ++inputlinenr;
|
||||
#endif
|
||||
return i;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
static int output_handler(const int type, const char *err_str, const int stop, void *cookie, const char *format, va_list args)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int flush;
|
||||
FILE *save_output = NULL;
|
||||
|
||||
flush = TRUE;
|
||||
|
||||
if (get_forward_output_to_log()) {
|
||||
save_output = output;
|
||||
output = log_file;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
|
||||
case OUTPUT_ERROR:
|
||||
if (status_on == TRUE) {
|
||||
if (error_file != NULL) {
|
||||
fprintf(error_file, "\n");
|
||||
}
|
||||
#ifndef DOS
|
||||
status_on = FALSE;
|
||||
#endif
|
||||
}
|
||||
if (error_file != NULL) {
|
||||
fprintf(error_file, "ERROR: %s\n", err_str);
|
||||
if (flush) fflush(error_file);
|
||||
}
|
||||
if (output != NULL) {
|
||||
fprintf(output, "ERROR: %s\n", err_str);
|
||||
if (flush) fflush(output);
|
||||
}
|
||||
if (stop == STOP) {
|
||||
if (error_file != NULL) {
|
||||
fprintf(error_file, "Stopping.\n");
|
||||
fflush(error_file);
|
||||
}
|
||||
if (output != NULL) {
|
||||
fprintf(output, "Stopping.\n");
|
||||
fflush(output);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case OUTPUT_WARNING:
|
||||
if (pr.logfile == TRUE && log_file != NULL) {
|
||||
fprintf(log_file,"WARNING: %s\n", err_str);
|
||||
if (flush) fflush(log_file);
|
||||
}
|
||||
if (state == TRANSPORT && transport_warnings == FALSE) return(OK);
|
||||
if (state == ADVECTION && advection_warnings == FALSE) return(OK);
|
||||
if (pr.warnings >= 0) {
|
||||
if (count_warnings > pr.warnings) return(OK);
|
||||
}
|
||||
if (status_on == TRUE) {
|
||||
if (error_file != NULL) {
|
||||
fprintf(error_file,"\n");
|
||||
}
|
||||
#ifndef DOS
|
||||
status_on = FALSE;
|
||||
#endif
|
||||
}
|
||||
if (error_file != NULL) {
|
||||
fprintf(error_file,"WARNING: %s\n", err_str);
|
||||
if (flush) fflush(error_file);
|
||||
}
|
||||
if (output != NULL) {
|
||||
fprintf(output,"WARNING: %s\n", err_str);
|
||||
if (flush) fflush(output);
|
||||
}
|
||||
break;
|
||||
case OUTPUT_CHECKLINE:
|
||||
if (pr.echo_input == TRUE) {
|
||||
if (output != NULL) {
|
||||
vfprintf(output, format, args);
|
||||
if (flush) fflush(output);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case OUTPUT_MESSAGE:
|
||||
case OUTPUT_BASIC:
|
||||
if (output != NULL) {
|
||||
vfprintf(output, format, args);
|
||||
if (flush) fflush(output);
|
||||
}
|
||||
break;
|
||||
case OUTPUT_PUNCH:
|
||||
if (punch_file != NULL) {
|
||||
if (pr.punch == TRUE && punch.in == TRUE) {
|
||||
vfprintf(punch_file, format, args);
|
||||
if (flush) fflush(punch_file);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case OUTPUT_LOG:
|
||||
if (pr.logfile == TRUE && log_file != NULL) {
|
||||
vfprintf(log_file, format, args);
|
||||
if (flush) fflush(log_file);
|
||||
}
|
||||
break;
|
||||
case OUTPUT_SCREEN:
|
||||
if (error_file != NULL) {
|
||||
vfprintf(error_file, format, args);
|
||||
if (flush) fflush(error_file);
|
||||
}
|
||||
break;
|
||||
case OUTPUT_STDERR:
|
||||
case OUTPUT_CVODE:
|
||||
if (stderr != NULL) {
|
||||
vfprintf(stderr, format, args);
|
||||
fflush(stderr);
|
||||
}
|
||||
break;
|
||||
case OUTPUT_DUMP:
|
||||
if (dump_file != NULL) {
|
||||
vfprintf(dump_file, format, args);
|
||||
if (flush) fflush(dump_file);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (get_forward_output_to_log()) {
|
||||
output = save_output;
|
||||
}
|
||||
return(OK);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int close_output_files(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (output != NULL) ret |= fclose(output);
|
||||
if (log_file != NULL) ret |= fclose(log_file);
|
||||
if (punch_file != NULL) ret |= fclose(punch_file);
|
||||
if (dump_file != NULL) ret |= fclose(dump_file);
|
||||
if (error_file != NULL) ret |= fclose(error_file);
|
||||
error_file = NULL;
|
||||
output = log_file = punch_file = dump_file = NULL;
|
||||
return ret;
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
static int open_handler(const int type, const char *file_name)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
switch (type) {
|
||||
|
||||
case OUTPUT_PUNCH:
|
||||
if (punch_file != NULL) {
|
||||
fclose(punch_file);
|
||||
punch_file = NULL;
|
||||
}
|
||||
if( (punch_file = fopen(file_name, "w")) == NULL) {
|
||||
return ERROR;
|
||||
} else {
|
||||
free_check_null(selected_output_file_name);
|
||||
selected_output_file_name = string_duplicate(file_name);
|
||||
}
|
||||
break;
|
||||
|
||||
case OUTPUT_DUMP:
|
||||
if (dump_file != NULL) {
|
||||
fclose(dump_file);
|
||||
dump_file = NULL;
|
||||
}
|
||||
if( (dump_file = fopen(file_name, "w")) == NULL) {
|
||||
return ERROR;
|
||||
} else {
|
||||
free_check_null(dump_file_name);
|
||||
dump_file_name = string_duplicate(file_name);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return(OK);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
static int fileop_handler(const int type, int (*PFN)(FILE*))
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
FILE *save_output = NULL;
|
||||
|
||||
int forward = get_forward_output_to_log();
|
||||
if (forward) {
|
||||
save_output = output;
|
||||
output = log_file;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case OUTPUT_ERROR:
|
||||
if (error_file) PFN(error_file);
|
||||
break;
|
||||
|
||||
case OUTPUT_WARNING:
|
||||
if (error_file) PFN(error_file);
|
||||
if (output) PFN(output);
|
||||
break;
|
||||
|
||||
case OUTPUT_MESSAGE:
|
||||
case OUTPUT_CHECKLINE:
|
||||
case OUTPUT_BASIC:
|
||||
if (output) PFN(output);
|
||||
break;
|
||||
|
||||
case OUTPUT_PUNCH:
|
||||
if (punch_file) PFN(punch_file);
|
||||
break;
|
||||
|
||||
case OUTPUT_SCREEN:
|
||||
if (error_file) PFN(error_file);
|
||||
break;
|
||||
|
||||
case OUTPUT_LOG:
|
||||
if (log_file) PFN(log_file);
|
||||
break;
|
||||
|
||||
case OUTPUT_CVODE:
|
||||
case OUTPUT_STDERR:
|
||||
if (stderr) PFN(stderr);
|
||||
break;
|
||||
|
||||
case OUTPUT_DUMP:
|
||||
if (dump_file) PFN(dump_file);
|
||||
break;
|
||||
}
|
||||
|
||||
if (forward) {
|
||||
output = save_output;
|
||||
}
|
||||
return(OK);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
static int rewind_wrapper(FILE* file_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
rewind(file_ptr);
|
||||
return(OK);
|
||||
}
|
||||
515
phrqproto.h
515
phrqproto.h
@ -1,515 +0,0 @@
|
||||
#ifdef PHREEQC_IDENT
|
||||
static char const svnidphrqproto[] = "$Id$";
|
||||
#endif
|
||||
/* advection.c */
|
||||
int advection(void);
|
||||
/* basic.c */
|
||||
LDBLE system_total(char *total_name, LDBLE *count, char ***names, char ***types, LDBLE **moles);
|
||||
int basic_main(char *commands);
|
||||
void cmd_initialize(void);
|
||||
void cmd_free(void);
|
||||
int basic_compile(char *commands, void **lnbase, void **vbase, void **lpbase);
|
||||
int basic_run(char *commands, void *lnbase, void *vbase, void *lpbase);
|
||||
/* basicsubs.c */
|
||||
LDBLE activity (char *species_name);
|
||||
LDBLE calc_logk_n(char *name);
|
||||
LDBLE calc_logk_p(char *name);
|
||||
LDBLE calc_logk_s(char *name);
|
||||
LDBLE calc_surface_charge(char *surface_name);
|
||||
LDBLE diff_layer_total(char *total_name, char *surface_name);
|
||||
LDBLE equi_phase (char *phase_name);
|
||||
LDBLE find_gas_comp (char *gas_comp_name);
|
||||
LDBLE find_misc1 (char *s_s_name);
|
||||
LDBLE find_misc2 (char *s_s_name);
|
||||
LDBLE find_s_s_comp (char *s_s_comp_name);
|
||||
LDBLE get_calculate_value(char *name);
|
||||
LDBLE kinetics_moles (char *kinetics_name);
|
||||
LDBLE log_activity (char *species_name);
|
||||
LDBLE log_molality (char *species_name);
|
||||
LDBLE molality (char *species_name);
|
||||
LDBLE saturation_ratio (char *phase_name);
|
||||
int saturation_index (char *phase_name, LDBLE *iap, LDBLE *si);
|
||||
LDBLE solution_sum_secondary(char *total_name);
|
||||
LDBLE sum_match_gases (char *stemplate, char *name);
|
||||
LDBLE sum_match_species (char *stemplate, char *name);
|
||||
LDBLE sum_match_s_s (char *stemplate, char *name);
|
||||
int match_elts_in_species (char *name, char *stemplate);
|
||||
int extract_bracket(char **string, char *bracket_string);
|
||||
LDBLE surf_total(char *total_name, char *surface_name);
|
||||
int system_species_compare(const void *ptr1, const void *ptr2);
|
||||
LDBLE system_total(char *total_name, LDBLE *count, char ***names, char ***types, LDBLE **moles);
|
||||
int system_total_elements(void);
|
||||
int system_total_si(void);
|
||||
int system_total_aq(void);
|
||||
int system_total_ex(void);
|
||||
int system_total_surf(void);
|
||||
int system_total_gas(void);
|
||||
int system_total_s_s(void);
|
||||
int system_total_elt(char *total_name);
|
||||
int system_total_elt_secondary(char *total_name);
|
||||
LDBLE total (char *total_name);
|
||||
|
||||
/* cl1.c */
|
||||
int cl1(int k, int l, int m, int n,
|
||||
int nklmd, int n2d,
|
||||
LDBLE *q,
|
||||
int *kode, LDBLE toler,
|
||||
int *iter, LDBLE *x, LDBLE *res, LDBLE *error,
|
||||
LDBLE *cu, int *iu, int *s,
|
||||
int check);
|
||||
|
||||
/* default.c */
|
||||
int close_input_files(void);
|
||||
int close_output_files(void);
|
||||
int getc_callback(void* cookie);
|
||||
int process_file_names(int argc, char *argv[], void **db_cookie, void **input_cookie, int log);
|
||||
|
||||
/* integrate.c */
|
||||
int calc_all_g(void);
|
||||
int calc_init_g(void);
|
||||
int initial_surface_water(void);
|
||||
int sum_diffuse_layer(struct surface_charge *surface_charge_ptr1);
|
||||
int calc_all_donnan(void);
|
||||
int calc_init_donnan(void);
|
||||
|
||||
/* inverse.c */
|
||||
int inverse_models(void);
|
||||
|
||||
/* isotopes.c */
|
||||
int add_isotopes(struct solution *solution_ptr);
|
||||
int calculate_values(void);
|
||||
int calculate_isotope_moles(struct element *elt_ptr, struct solution *solution_ptr, LDBLE total_moles);
|
||||
LDBLE convert_isotope(struct master_isotope *master_isotope_ptr, LDBLE ratio);
|
||||
int from_pcil(struct master_isotope *master_isotope_ptr);
|
||||
int from_permil(struct master_isotope *master_isotope_ptr, LDBLE major_total);
|
||||
int from_pct(struct master_isotope *master_isotope_ptr, LDBLE major_total);
|
||||
int from_tu(struct master_isotope *master_isotope_ptr);
|
||||
struct calculate_value *calculate_value_alloc(void);
|
||||
int calculate_value_free(struct calculate_value *calculate_value_ptr);
|
||||
struct calculate_value *calculate_value_search (char *name);
|
||||
struct calculate_value *calculate_value_store (char *name, int replace_if_found);
|
||||
struct isotope_alpha *isotope_alpha_alloc(void);
|
||||
struct isotope_alpha *isotope_alpha_search (char *name);
|
||||
struct isotope_alpha *isotope_alpha_store (char *name, int replace_if_found);
|
||||
struct isotope_ratio *isotope_ratio_alloc(void);
|
||||
struct isotope_ratio *isotope_ratio_search (char *name);
|
||||
struct isotope_ratio *isotope_ratio_store (char *name, int replace_if_found);
|
||||
struct master_isotope *master_isotope_store (char *name, int replace_if_found);
|
||||
struct master_isotope *master_isotope_alloc(void);
|
||||
struct master_isotope *master_isotope_search (char *name);
|
||||
int print_initial_solution_isotopes(void);
|
||||
int print_isotope_ratios(void);
|
||||
int print_isotope_alphas(void);
|
||||
int punch_isotopes(void);
|
||||
int punch_calculate_values(void);
|
||||
int read_calculate_values (void);
|
||||
int read_isotopes(void);
|
||||
int read_isotope_ratios (void);
|
||||
int read_isotope_alphas (void);
|
||||
|
||||
/* kinetics.c */
|
||||
|
||||
void cvode_init(void);
|
||||
int run_reactions(int i, LDBLE kin_time, int use_mix, LDBLE step_fraction);
|
||||
int set_and_run(int i, int use_mix, int use_kinetics, int nsaver, LDBLE step_fraction);
|
||||
int set_and_run_wrapper(int i, int use_mix, int use_kinetics, int nsaver, LDBLE step_fraction);
|
||||
int set_advection(int i, int use_mix, int use_kinetics, int nsaver);
|
||||
int free_cvode(void);
|
||||
|
||||
/* main.c */
|
||||
int main(int argc, char *argv[]);
|
||||
|
||||
/* mainsubs.c */
|
||||
FILE *file_open (char *query, char *default_name, const char *status, int batch);
|
||||
int copy_entities(void);
|
||||
void initialize(void);
|
||||
int initial_exchangers(int print);
|
||||
int initial_gas_phases(int print);
|
||||
int initial_solutions(int print);
|
||||
int step_save_exch(int n_user);
|
||||
int step_save_surf(int n_user);
|
||||
int initial_surfaces(int print);
|
||||
int k_temp(LDBLE tempc);
|
||||
int reactions(void);
|
||||
int saver(void);
|
||||
int xsolution_save(int k_user);
|
||||
int do_initialize(void);
|
||||
int do_status(void);
|
||||
|
||||
/* model.c */
|
||||
int check_residuals(void);
|
||||
int free_model_allocs(void);
|
||||
int ineq(int kode);
|
||||
int model(void);
|
||||
int jacobian_sums (void);
|
||||
int mb_gases(void);
|
||||
int mb_s_s(void);
|
||||
int mb_sums (void);
|
||||
int molalities (int allow_overflow);
|
||||
int reset(void);
|
||||
int residuals(void);
|
||||
int set(int initial);
|
||||
int sum_species(void);
|
||||
int surface_model(void);
|
||||
|
||||
/* p2clib.c */
|
||||
|
||||
/* parse.c */
|
||||
int check_eqn ( int association );
|
||||
int get_charge(char *charge, LDBLE *z);
|
||||
int get_elt (char **t_ptr, char *element, int *i);
|
||||
int get_elts_in_species (char **t_ptr, LDBLE coef);
|
||||
int get_num (char **t_ptr, LDBLE *num);
|
||||
int get_secondary_in_species (char **t_ptr, LDBLE coef);
|
||||
int parse_eq(char *eqn, struct elt_list **elt_ptr, int association);
|
||||
|
||||
/* pitzer.c */
|
||||
int gammas_pz(void);
|
||||
int model_pz(void);
|
||||
int pitzer (void);
|
||||
int pitzer_clean_up(void);
|
||||
int pitzer_init (void);
|
||||
int pitzer_tidy (void);
|
||||
int read_pitzer (void);
|
||||
int set_pz(int initial);
|
||||
|
||||
/* prep.c */
|
||||
int check_same_model(void);
|
||||
int k_temp(LDBLE tc);
|
||||
LDBLE k_calc(LDBLE *logk, LDBLE tempk);
|
||||
int prep(void);
|
||||
int reprep (void);
|
||||
int rewrite_master_to_secondary(struct master *master_ptr1, struct master *master_ptr2);
|
||||
int switch_bases(void);
|
||||
int write_phase_sys_total (int n);
|
||||
|
||||
/* print.c */
|
||||
int fpunchf(const char* name, const char* format, ...);
|
||||
int fpunchf_user(int user_index, const char* format, ...);
|
||||
char *sformatf(const char* format, ...);
|
||||
int array_print(LDBLE *array_l, int row_count, int column_count, int max_column_count);
|
||||
int print_all(void);
|
||||
int print_exchange(void);
|
||||
int print_gas_phase(void);
|
||||
int print_master_reactions(void);
|
||||
int print_reaction(struct reaction *rxn_ptr);
|
||||
int print_species(void);
|
||||
int print_surface(void);
|
||||
int punch_all(void);
|
||||
|
||||
/* read.c */
|
||||
int read_input(void);
|
||||
int read_conc(int n, int count_mass_balance, char *str);
|
||||
int *read_list_ints_range (char **ptr, int *count_ints, int positive, int *int_list );
|
||||
int read_log_k_only (char *ptr, LDBLE *log_k);
|
||||
int read_number_description (char *ptr, int *n_user, int *n_user_end,
|
||||
char **description);
|
||||
int check_key (char *str);
|
||||
int check_units (char *tot_units, int alkalinity, int check_compatibility,
|
||||
const char *default_units, int print);
|
||||
int find_option(char *item, int *n, const char **list, int count_list, int exact);
|
||||
int get_option (const char **opt_list, int count_opt_list, char **next_char);
|
||||
int get_true_false(char *string, int default_value);
|
||||
|
||||
/* readtr.c */
|
||||
int read_transport (void);
|
||||
int dump(void);
|
||||
int dump_exchange(int k);
|
||||
int dump_gas_phase(int k);
|
||||
int dump_kinetics (int k);
|
||||
int dump_mix (int k);
|
||||
int dump_pp_assemblage(int k);
|
||||
int dump_reaction (int k);
|
||||
int dump_s_s_assemblage (int k);
|
||||
int dump_solution (int k);
|
||||
int dump_surface(int k);
|
||||
|
||||
/* spread.c */
|
||||
int read_solution_spread(void);
|
||||
|
||||
/* step.c */
|
||||
int step(LDBLE step_fraction);
|
||||
int xsolution_zero (void);
|
||||
int add_exchange (struct exchange *exchange_ptr);
|
||||
int add_gas_phase (struct gas_phase *gas_phase_ptr);
|
||||
int add_kinetics (struct kinetics *kinetics_ptr);
|
||||
int add_mix (struct mix *mix_ptr);
|
||||
int add_pp_assemblage (struct pp_assemblage *pp_assemblage_ptr);
|
||||
int add_reaction (struct irrev *irrev_ptr, int step_number, LDBLE step_fraction);
|
||||
int add_s_s_assemblage (struct s_s_assemblage *s_s_assemblage_ptr);
|
||||
int add_solution (struct solution *solution_ptr, LDBLE extensive,
|
||||
LDBLE intensive);
|
||||
int add_surface (struct surface *surface_ptr);
|
||||
int add_temperature(struct temperature *temperature_ptr, int step_number);
|
||||
|
||||
/* structures.c */
|
||||
int clean_up(void);
|
||||
int copier_add(struct copier *copier_ptr, int n_user, int start, int end);
|
||||
int copier_free(struct copier *copier_ptr);
|
||||
int copier_init(struct copier *copier_ptr);
|
||||
int copy_entities(void);
|
||||
int element_compare(const void *ptr1, const void *ptr2);
|
||||
struct element *element_store (char *element);
|
||||
int elt_list_combine(void);
|
||||
int elt_list_compare(const void *ptr1, const void *ptr2);
|
||||
struct elt_list *elt_list_dup(struct elt_list *elt_list_ptr_old);
|
||||
int elt_list_print(struct elt_list *elt_list_ptr);
|
||||
struct elt_list *elt_list_save(void);
|
||||
|
||||
struct exchange *exchange_alloc (void);
|
||||
struct exchange *exchange_bsearch (int k, int *n);
|
||||
int exchange_comp_compare(const void *ptr1, const void *ptr2);
|
||||
int exchange_copy(struct exchange *exchange_old_ptr, struct exchange *exchange_new_ptr, int n_user_new);
|
||||
int exchange_compare (const void *ptr1, const void *ptr2);
|
||||
int exchange_copy_to_last(int n, int n_user);
|
||||
int exchange_delete(int n_user_old);
|
||||
int exchange_duplicate(int n_user_old, int n_user_new);
|
||||
int exchange_init (struct exchange *exchange_ptr, int n_user, int n_user_end, char *description);
|
||||
int exchange_free (struct exchange *exchange_ptr);
|
||||
int exchange_ptr_to_user(struct exchange *exchange_old_ptr, int n_user_new);
|
||||
struct exchange *exchange_replicate(struct exchange *exchange_old_ptr, int n_user_new);
|
||||
struct exchange *exchange_search(int n_user, int *n, int print);
|
||||
int exchange_sort(void);
|
||||
|
||||
int gas_comp_compare(const void *ptr1, const void *ptr2);
|
||||
struct gas_phase *gas_phase_alloc (void);
|
||||
struct gas_phase *gas_phase_bsearch (int k, int *n);
|
||||
int gas_phase_compare (const void *ptr1, const void *ptr2);
|
||||
int gas_phase_copy(struct gas_phase *gas_phase_old_ptr,
|
||||
struct gas_phase *gas_phase_new_ptr, int n_user_new);
|
||||
int gas_phase_copy_to_last(int n, int n_user);
|
||||
int gas_phase_delete(int n_user_old);
|
||||
int gas_phase_duplicate(int n_user_old, int n_user_new);
|
||||
int gas_phase_init (struct gas_phase *gas_phase_ptr, int n_user, int n_user_end, char *description);
|
||||
int gas_phase_free (struct gas_phase *gas_phase_ptr);
|
||||
int gas_phase_ptr_to_user(struct gas_phase *gas_phase_ptr_old, int n_user_new);
|
||||
struct gas_phase *gas_phase_replicate(struct gas_phase *gas_phase_old_ptr, int n_user_new);
|
||||
struct gas_phase *gas_phase_search (int n_user, int *n);
|
||||
int gas_phase_sort(void);
|
||||
|
||||
enum entity_type get_entity_enum (char *name);
|
||||
|
||||
struct inverse *inverse_alloc(void);
|
||||
int inverse_delete (int i);
|
||||
int inverse_isotope_compare (const void *ptr1, const void *ptr2);
|
||||
struct inverse *inverse_search (int n_user, int *n);
|
||||
int inverse_sort(void);
|
||||
|
||||
struct irrev *irrev_bsearch (int k, int *n);
|
||||
int irrev_copy(struct irrev *irrev_old_ptr, struct irrev *irrev_new_ptr, int n_user_new);
|
||||
int irrev_duplicate(int n_user_old, int n_user_new);
|
||||
int irrev_free (struct irrev *irrev_ptr);
|
||||
struct irrev *irrev_search(int n_user, int *n);
|
||||
|
||||
struct kinetics *kinetics_alloc (void);
|
||||
struct kinetics *kinetics_bsearch (int k, int *n);
|
||||
int kinetics_delete(int n_user_old);
|
||||
int kinetics_comp_duplicate(struct kinetics_comp *kinetics_comp_new_ptr, struct kinetics_comp *kinetics_comp_old_ptr);
|
||||
int kinetics_compare (const void *ptr1, const void *ptr2);
|
||||
int kinetics_copy(struct kinetics *kinetics_old_ptr,
|
||||
struct kinetics *kinetics_new_ptr, int n_user_new);
|
||||
int kinetics_copy_to_last(int n, int n_user);
|
||||
int kinetics_duplicate(int n_user_old, int n_user_new);
|
||||
int kinetics_init (struct kinetics *kinetics_ptr, int n_user, int n_user_end, char *description);
|
||||
int kinetics_free (struct kinetics *kinetics_ptr);
|
||||
int kinetics_ptr_to_user(struct kinetics *kinetics_ptr_old, int n_user_new);
|
||||
struct kinetics *kinetics_replicate(struct kinetics *kinetics_old_ptr, int n_user_new);
|
||||
struct kinetics *kinetics_search(int n_user, int *n, int print);
|
||||
int kinetics_sort(void);
|
||||
|
||||
struct logk *logk_alloc(void);
|
||||
struct logk *logk_store (char *name, int replace_if_found);
|
||||
struct logk *logk_search (char *name);
|
||||
|
||||
struct master *master_alloc(void);
|
||||
int master_compare (const void *ptr1, const void *ptr2);
|
||||
int master_delete(char *ptr);
|
||||
struct master *master_bsearch (const char *ptr);
|
||||
struct master *master_bsearch_primary (char *ptr);
|
||||
struct master *master_search (char *ptr, int *n);
|
||||
|
||||
struct mix *mix_bsearch (int k, int *n);
|
||||
int mix_copy(struct mix *mix_old_ptr,
|
||||
struct mix *mix_new_ptr, int n_user_new);
|
||||
int mix_duplicate(int n_user_old, int n_user_new);
|
||||
int mix_free (struct mix *mix_ptr);
|
||||
struct mix *mix_search(int n_user, int *n, int print);
|
||||
int mix_sort(void);
|
||||
|
||||
struct pe_data *pe_data_alloc(void);
|
||||
struct pe_data *pe_data_dup (struct pe_data *pe_ptr_old);
|
||||
int pe_data_free (struct pe_data *pe_data_ptr);
|
||||
int pe_data_store (struct pe_data **pe, const char *token);
|
||||
|
||||
struct phase *phase_bsearch (char *ptr, int *j, int print);
|
||||
int phase_compare(const void *ptr1, const void *ptr2);
|
||||
int phase_delete(int i);
|
||||
struct phase *phase_store (char *name);
|
||||
|
||||
struct pp_assemblage *pp_assemblage_alloc (void);
|
||||
struct pp_assemblage *pp_assemblage_bsearch (int k, int *n);
|
||||
int pp_assemblage_compare(const void *ptr1, const void *ptr2);
|
||||
int pp_assemblage_copy(struct pp_assemblage *pp_assemblage_old_ptr, struct pp_assemblage *pp_assemblage_new_ptr, int n_user_new);
|
||||
int pp_assemblage_copy_to_last(int n, int n_user);
|
||||
int pp_assemblage_delete(int n_user_old);
|
||||
int pp_assemblage_duplicate(int n_user_old, int n_user_new);
|
||||
int pp_assemblage_free (struct pp_assemblage *pp_assemblage_ptr);
|
||||
int pp_assemblage_init (struct pp_assemblage *pp_assemblage_ptr, int n_user, int n_user_end, char *description);
|
||||
int pp_assemblage_ptr_to_user(struct pp_assemblage *pp_assemblage_ptr_old, int n_user_new);
|
||||
struct pp_assemblage *pp_assemblage_replicate(struct pp_assemblage *pp_assemblage_old_ptr, int n_user_new);
|
||||
struct pp_assemblage *pp_assemblage_search (int n_user, int *n);
|
||||
int pp_assemblage_sort(void);
|
||||
|
||||
int pure_phase_compare (const void *ptr1, const void *ptr2);
|
||||
|
||||
struct rate *rate_bsearch (char *ptr, int *j);
|
||||
int rate_free(struct rate *rate_ptr);
|
||||
struct rate *rate_search (char *name, int *n);
|
||||
int rate_sort(void);
|
||||
|
||||
struct reaction *rxn_alloc(int ntokens);
|
||||
struct reaction *rxn_dup(struct reaction *rxn_ptr_old);
|
||||
LDBLE rxn_find_coef(struct reaction *r_ptr, const char *str);
|
||||
int rxn_free(struct reaction *rxn_ptr);
|
||||
|
||||
int s_compare (const void *ptr1, const void *ptr2);
|
||||
int s_delete (int i);
|
||||
struct species *s_search (char *name);
|
||||
struct species *s_store (char *name, LDBLE z, int replace_if_found);
|
||||
|
||||
struct s_s_assemblage *s_s_assemblage_alloc (void);
|
||||
struct s_s_assemblage *s_s_assemblage_bsearch (int k, int *n);
|
||||
int s_s_assemblage_compare (const void *ptr1, const void *ptr2);
|
||||
|
||||
int s_s_assemblage_copy(struct s_s_assemblage *s_s_assemblage_old_ptr,
|
||||
struct s_s_assemblage *s_s_assemblage_new_ptr, int n_user_new);
|
||||
int s_s_assemblage_copy_to_last(int n, int n_user);
|
||||
int s_s_assemblage_duplicate(int n_user_old, int n_user_new);
|
||||
int s_s_assemblage_delete(int n_user_old);
|
||||
int s_s_assemblage_free (struct s_s_assemblage *s_s_assemblage_ptr);
|
||||
int s_s_assemblage_init (struct s_s_assemblage *s_s_assemblage_ptr, int n_user, int n_user_end, char *description);
|
||||
int s_s_assemblage_ptr_to_user(struct s_s_assemblage *s_s_assemblage_ptr_old, int n_user_new);
|
||||
struct s_s_assemblage *s_s_assemblage_replicate(struct s_s_assemblage *s_s_assemblage_old_ptr, int n_user_new);
|
||||
struct s_s_assemblage *s_s_assemblage_search (int n_user, int *n);
|
||||
int s_s_assemblage_sort(void);
|
||||
int s_s_compare (const void *ptr1, const void *ptr2);
|
||||
|
||||
struct save_values *save_values_bsearch (struct save_values *k, int *n);
|
||||
int save_values_compare(const void *ptr1, const void *ptr2);
|
||||
int save_values_sort(void);
|
||||
int save_values_store(struct save_values *s_v);
|
||||
|
||||
int conc_compare(const void *ptr1, const void *ptr2);
|
||||
int conc_init (struct conc *conc_ptr);
|
||||
int isotope_compare (const void *ptr1, const void *ptr2);
|
||||
struct solution *solution_alloc(void);
|
||||
struct solution *solution_bsearch (int k, int *n, int print);
|
||||
int solution_copy_to_last(int n, int n_user_new);
|
||||
int solution_duplicate(int n_user_old, int n_user_new);
|
||||
int solution_delete(int n_user_old);
|
||||
int solution_free (struct solution *solution_ptr);
|
||||
int solution_ptr_to_user(struct solution *solution_old_ptr, int n_user_new);
|
||||
struct solution *solution_replicate(struct solution *solution_old_ptr, int n_user_new);
|
||||
int solution_sort(void);
|
||||
|
||||
int species_list_compare_alk (const void *ptr1, const void *ptr2);
|
||||
int species_list_compare_master (const void *ptr1, const void *ptr2);
|
||||
int species_list_sort(void);
|
||||
|
||||
struct surface *surface_alloc (void);
|
||||
struct surface *surface_bsearch (int k, int *n);
|
||||
int surface_comp_compare(const void *ptr1, const void *ptr2);
|
||||
int surface_compare (const void *ptr1, const void *ptr2);
|
||||
int surface_copy(struct surface *surface_old_ptr, struct surface *surface_new_ptr, int n_user_new);
|
||||
int surface_copy_to_last(int n, int n_user);
|
||||
int surface_delete(int n_user_old);
|
||||
int surface_duplicate(int n_user_old, int n_user_new);
|
||||
int surface_free(struct surface *surface_ptr);
|
||||
int surface_init(struct surface *surface_ptr, int n_user, int n_user_end, char *description);
|
||||
int surface_ptr_to_user(struct surface *surface_ptr_old, int n_user_new);
|
||||
struct surface *surface_replicate(struct surface *surface_old_ptr, int n_user_new);
|
||||
struct surface *surface_search(int n_user, int *n, int print);
|
||||
int surface_sort(void);
|
||||
|
||||
int system_duplicate (int i, int save_old);
|
||||
|
||||
struct temperature *temperature_bsearch (int k, int *n);
|
||||
int temperature_copy(struct temperature *temperature_old_ptr,
|
||||
struct temperature *temperature_new_ptr, int n_user_new);
|
||||
int temperature_duplicate(int n_user_old, int n_user_new);
|
||||
int temperature_free (struct temperature *temperature_ptr);
|
||||
struct temperature *temperature_search(int n_user, int *n);
|
||||
int temperature_sort(void);
|
||||
|
||||
int trxn_add (struct reaction *r_ptr, LDBLE coef, int combine);
|
||||
int trxn_combine (void);
|
||||
int trxn_copy (struct reaction *rxn_ptr);
|
||||
LDBLE trxn_find_coef(const char *str, int start);
|
||||
int trxn_print (void);
|
||||
int trxn_reverse_k (void);
|
||||
int trxn_sort( void );
|
||||
int trxn_swap (const char *token);
|
||||
|
||||
struct unknown *unknown_alloc(void);
|
||||
int unknown_delete(int i);
|
||||
int unknown_free(struct unknown *unknown_ptr);
|
||||
|
||||
/* tally.c */
|
||||
void add_all_components_tally(void);
|
||||
int build_tally_table(void);
|
||||
int calc_dummy_kinetic_reaction_tally(struct kinetics *kinetics_ptr);
|
||||
int diff_tally_table(void);
|
||||
int extend_tally_table(void);
|
||||
int free_tally_table(void);
|
||||
int fill_tally_table(int *n_user, int index_conservative, int n_buffer);
|
||||
int get_tally_table_rows_columns(int *rows, int *columns);
|
||||
int get_tally_table_column_heading(int column, int *type, char *string);
|
||||
int get_tally_table_row_heading(int column, char *string);
|
||||
int store_tally_table(double *array, int row_dim, int col_dim, double fill_factor);
|
||||
int zero_tally_table(void);
|
||||
|
||||
/* tidy.c */
|
||||
int add_other_logk(LDBLE *source_k, int count_add_logk, struct name_coef *add_logk);
|
||||
int select_log_k_expression(LDBLE *source_k, LDBLE *target_k);
|
||||
int s_s_prep(LDBLE t, struct s_s *s_s_ptr, int print);
|
||||
int tidy_punch(void);
|
||||
int tidy_model(void);
|
||||
|
||||
/* transport.c */
|
||||
int transport(void);
|
||||
int set_initial_moles(int i);
|
||||
|
||||
/* utilities.c */
|
||||
int add_elt_list(struct elt_list *elt_list_ptr, LDBLE coef);
|
||||
int backspace_screen (int spaces);
|
||||
LDBLE calc_alk(struct reaction *rxn_ptr);
|
||||
int compute_gfw(const char *string, LDBLE *gfw);
|
||||
int copy_token (char *token_ptr, char **ptr, int *length);
|
||||
int dup_print(const char *ptr, int emphasis);
|
||||
int equal (LDBLE a, LDBLE b, LDBLE eps);
|
||||
void *free_check_null(void *ptr);
|
||||
void free_hash_strings(HashTable *Table);
|
||||
int get_token(char **eqnaddr, char *string, LDBLE *z, int *l);
|
||||
int hcreate_multi(unsigned Count, HashTable **HashTable_ptr);
|
||||
void hdestroy_multi(HashTable *HashTable_ptr);
|
||||
ENTRY * hsearch_multi(HashTable *Table, ENTRY item, ACTION action);
|
||||
int islegit(const char c);
|
||||
void malloc_error (void);
|
||||
int parse_couple(char *token);
|
||||
int print_centered(const char *string);
|
||||
int replace(const char *str1, const char *str2, char *str);
|
||||
void space (void **ptr, int i, int *max, int struct_size);
|
||||
void squeeze_white(char *s_l);
|
||||
int status (int count, const char *str);
|
||||
void str_tolower(char *str);
|
||||
void str_toupper(char *str);
|
||||
int strcmp_nocase(const char *str1, const char *str2);
|
||||
int strcmp_nocase_arg1(const char *str1, const char *str2);
|
||||
char * string_duplicate (const char *token);
|
||||
char *string_hsave (const char *str);
|
||||
char *string_pad (char *str, int i);
|
||||
int string_trim (char *str);
|
||||
int string_trim_right (char *str);
|
||||
int string_trim_left (char *str);
|
||||
LDBLE under (LDBLE xval);
|
||||
int get_elts_in_species (char **t_ptr, LDBLE coef);
|
||||
19
phrqtype.h
19
phrqtype.h
@ -1,19 +0,0 @@
|
||||
/*
|
||||
* The following implements long double
|
||||
* Many machines long double = double so there is no advantage
|
||||
* Check float.h include file for number of digits (LDBL_DIG)
|
||||
* Need to define here and in cl1.c
|
||||
*/
|
||||
#ifdef PHREEQC_IDENT
|
||||
static char const svnidphrqtype[] = "$Id$";
|
||||
#endif
|
||||
|
||||
/*#define USE_LONG_DOUBLE*/
|
||||
#ifdef USE_LONG_DOUBLE
|
||||
#define LDBLE long double
|
||||
#define SCANFORMAT "%Lf"
|
||||
#else
|
||||
#define LDBLE double
|
||||
#define SCANFORMAT "%lf"
|
||||
#endif
|
||||
|
||||
1587
pitzer.cpp
1587
pitzer.cpp
File diff suppressed because it is too large
Load Diff
50
pitzer.h
50
pitzer.h
@ -1,50 +0,0 @@
|
||||
typedef enum { TYPE_B0, TYPE_B1, TYPE_B2, TYPE_C0, TYPE_THETA, TYPE_LAMDA, TYPE_ZETA, TYPE_PSI, TYPE_ETHETA, TYPE_Other } pitz_param_type;
|
||||
|
||||
|
||||
PITZER_EXTERNAL double VP, DW0;
|
||||
|
||||
struct pitz_param {
|
||||
char * species[3];
|
||||
int ispec[3];
|
||||
pitz_param_type type;
|
||||
double p;
|
||||
union {double b0;
|
||||
double b1;
|
||||
double b2;
|
||||
double c0;
|
||||
double theta;
|
||||
double lamda;
|
||||
double zeta;
|
||||
double psi;} U;
|
||||
double a[5];
|
||||
double alpha;
|
||||
struct theta_param *thetas;
|
||||
};
|
||||
|
||||
PITZER_EXTERNAL struct pitz_param **pitz_params;
|
||||
PITZER_EXTERNAL int count_pitz_param, max_pitz_param;
|
||||
|
||||
|
||||
|
||||
/* routines define in pitzer_structures.c */
|
||||
PITZER_EXTERNAL struct pitz_param *pitz_param_read (char *string, int n);
|
||||
PITZER_EXTERNAL int pitz_param_search(struct pitz_param *pzp_ptr);
|
||||
PITZER_EXTERNAL struct theta_param *theta_param_search(double zj, double zk);
|
||||
PITZER_EXTERNAL struct theta_param *theta_param_alloc (void);
|
||||
PITZER_EXTERNAL int theta_param_init (struct theta_param *theta_param_ptr);
|
||||
|
||||
|
||||
|
||||
/* defined in DW */
|
||||
PITZER_EXTERNAL int DW (double T);
|
||||
PITZER_EXTERNAL double DC (double T);
|
||||
|
||||
struct theta_param {
|
||||
double zj;
|
||||
double zk;
|
||||
double etheta;
|
||||
double ethetap;
|
||||
};
|
||||
PITZER_EXTERNAL struct theta_param **theta_params;
|
||||
PITZER_EXTERNAL int count_theta_param, max_theta_param;
|
||||
PITZER_EXTERNAL double OTEMP;
|
||||
@ -1,195 +0,0 @@
|
||||
#define EXTERNAL extern
|
||||
#include "global.h"
|
||||
#include "phqalloc.h"
|
||||
#include "output.h"
|
||||
#include "phrqproto.h"
|
||||
#define PITZER_EXTERNAL extern
|
||||
#include "pitzer.h"
|
||||
|
||||
static char const svnid[] = "$Id: structures.c 269 2005-04-27 19:54:25Z dlpark $";
|
||||
|
||||
|
||||
static struct pitz_param *pitz_param_alloc (void);
|
||||
static int pitz_param_init (struct pitz_param *pitz_param_ptr);
|
||||
static struct pitz_param *pitz_param_duplicate(struct pitz_param *old_ptr);
|
||||
static int pitz_param_copy(struct pitz_param *old_ptr, struct pitz_param *new_ptr);
|
||||
|
||||
|
||||
/* **********************************************************************
|
||||
*
|
||||
* Routines related to structure "pitz_param"
|
||||
*
|
||||
* ********************************************************************** */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct pitz_param *pitz_param_alloc (void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
struct pitz_param *pitz_param_ptr;
|
||||
pitz_param_ptr = (struct pitz_param *) PHRQ_malloc(sizeof (struct pitz_param));
|
||||
if (pitz_param_ptr == NULL) malloc_error();
|
||||
return ( pitz_param_ptr );
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int pitz_param_init (struct pitz_param *pitz_param_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i;
|
||||
/*
|
||||
* Frees all data associated with pitz_param structure.
|
||||
*/
|
||||
|
||||
if (pitz_param_ptr == NULL) return(ERROR);
|
||||
pitz_param_ptr->species[0] = NULL;
|
||||
pitz_param_ptr->species[1] = NULL;
|
||||
pitz_param_ptr->species[2] = NULL;
|
||||
pitz_param_ptr->ispec[0] = -1;
|
||||
pitz_param_ptr->ispec[1] = -1;
|
||||
pitz_param_ptr->ispec[2] = -1;
|
||||
pitz_param_ptr->type = TYPE_Other;
|
||||
pitz_param_ptr->p = 0.0;
|
||||
pitz_param_ptr->U.b0 = 0.0;
|
||||
for (i = 0; i < 5; i++) {
|
||||
pitz_param_ptr->a[i] = 0.0;
|
||||
}
|
||||
pitz_param_ptr->alpha = 0.0;
|
||||
pitz_param_ptr->thetas = NULL;
|
||||
return(OK);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct pitz_param *pitz_param_read (char *string, int n)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
* Read pitzer parameter info from string
|
||||
* n is number of species (character values)
|
||||
*
|
||||
*/
|
||||
int l, i, j, k;
|
||||
char *ptr;
|
||||
char token[2*MAX_LENGTH];
|
||||
struct pitz_param pzp, *pzp_ptr;
|
||||
|
||||
if (n != 2 && n != 3) return (NULL);
|
||||
if (string == NULL) return (NULL);
|
||||
|
||||
pitz_param_init(&pzp);
|
||||
ptr = string;
|
||||
if (copy_token(token, &ptr, &l) == EMPTY) return(NULL);
|
||||
ptr = string;
|
||||
for (i = 0; i < n; i++) {
|
||||
if (copy_token(token, &ptr, &l) == EMPTY) return(NULL);
|
||||
pzp.species[i] = string_hsave(token);
|
||||
}
|
||||
k = 0;
|
||||
for (i = 0; i < 5; i++) {
|
||||
if (copy_token(token, &ptr, &l) == EMPTY) break;
|
||||
j=sscanf(token,"%le", &pzp.a[i]);
|
||||
if (j <= 0) break;
|
||||
k++;
|
||||
}
|
||||
if (k <= 0) return(NULL);
|
||||
pzp_ptr = pitz_param_duplicate(&pzp);
|
||||
return ( pzp_ptr);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct pitz_param *pitz_param_duplicate(struct pitz_param *old_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
* Allocates space and makes duplicate copy of pitz_param structure
|
||||
*/
|
||||
struct pitz_param *new_ptr;
|
||||
|
||||
new_ptr = pitz_param_alloc();
|
||||
pitz_param_init(new_ptr);
|
||||
/*
|
||||
* Copy data
|
||||
*/
|
||||
pitz_param_copy(old_ptr, new_ptr);
|
||||
return(new_ptr);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int pitz_param_copy(struct pitz_param *old_ptr,
|
||||
struct pitz_param *new_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
* Copies pitz_param data from old_ptr to new location, new_ptr.
|
||||
* Space for the new_ptr structure must already be malloced.
|
||||
*/
|
||||
/*
|
||||
* Store data for structure pitz_param
|
||||
*/
|
||||
memcpy(new_ptr, old_ptr, sizeof(struct pitz_param));
|
||||
return(OK);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int pitz_param_search(struct pitz_param *pzp_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
* Does linear search of pitz_params for same type and species
|
||||
* Returns -1 if not found, index number in pitz_params if found
|
||||
*/
|
||||
int i;
|
||||
if (pzp_ptr == NULL) return -1;
|
||||
if (pzp_ptr->type == TYPE_Other) return -1;
|
||||
for (i = 0; i < count_pitz_param; i++) {
|
||||
if (pitz_params[i]->type == pzp_ptr->type &&
|
||||
pitz_params[i]->species[0] == pzp_ptr->species[0] &&
|
||||
pitz_params[i]->species[1] == pzp_ptr->species[1] &&
|
||||
pitz_params[i]->species[2] == pzp_ptr->species[2] ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i >= count_pitz_param) {
|
||||
return -1;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
/* **********************************************************************
|
||||
*
|
||||
* Routines related to structure "theta_parm"
|
||||
*
|
||||
* ********************************************************************** */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct theta_param *theta_param_alloc (void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
struct theta_param *theta_param_ptr;
|
||||
theta_param_ptr = (struct theta_param *) PHRQ_malloc(sizeof (struct theta_param));
|
||||
if (theta_param_ptr == NULL) malloc_error();
|
||||
return ( theta_param_ptr );
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int theta_param_init (struct theta_param *theta_param_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
* Frees all data associated with theta_param structure.
|
||||
*/
|
||||
|
||||
if (theta_param_ptr == NULL) return(ERROR);
|
||||
theta_param_ptr->zj = 0;
|
||||
theta_param_ptr->zk = 0;
|
||||
theta_param_ptr->etheta = 0;
|
||||
theta_param_ptr->ethetap = 0;
|
||||
return(OK);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct theta_param *theta_param_search(double zj, double zk)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
* Does linear search of theta_params for same charge
|
||||
* Returns NULL if not found, index number in theta_params if found
|
||||
*/
|
||||
int i;
|
||||
for (i = 0; i < count_theta_param; i++) {
|
||||
if ((theta_params[i]->zj == zj && theta_params[i]->zk == zk) ||
|
||||
(theta_params[i]->zj == zk && theta_params[i]->zk == zj)) {
|
||||
return theta_params[i];
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user