pyEQL 1.4.0rc9__cp312-cp312-macosx_10_13_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (491) hide show
  1. pyEQL/__init__.py +50 -0
  2. pyEQL/_phreeqc.cpython-312-darwin.so +0 -0
  3. pyEQL/activity_correction.py +879 -0
  4. pyEQL/database/geothermal.dat +5693 -0
  5. pyEQL/database/llnl.dat +19305 -0
  6. pyEQL/database/phreeqc_license.txt +54 -0
  7. pyEQL/database/pyeql_db.json +35607 -0
  8. pyEQL/engines.py +1153 -0
  9. pyEQL/equilibrium.py +227 -0
  10. pyEQL/functions.py +281 -0
  11. pyEQL/phreeqc/__init__.py +5 -0
  12. pyEQL/phreeqc/bindings.cpp +84 -0
  13. pyEQL/phreeqc/core.py +239 -0
  14. pyEQL/phreeqc/database/Amm.dat +1968 -0
  15. pyEQL/phreeqc/database/CMakeLists.txt +32 -0
  16. pyEQL/phreeqc/database/ColdChem.dat +267 -0
  17. pyEQL/phreeqc/database/Concrete_PHR.dat +158 -0
  18. pyEQL/phreeqc/database/Concrete_PZ.dat +195 -0
  19. pyEQL/phreeqc/database/Kinec.v2.dat +12039 -0
  20. pyEQL/phreeqc/database/Kinec_v3.dat +12159 -0
  21. pyEQL/phreeqc/database/Makefile.am +28 -0
  22. pyEQL/phreeqc/database/Makefile.in +530 -0
  23. pyEQL/phreeqc/database/PHREEQC_ThermoddemV1.10_15Dec2020.dat +12965 -0
  24. pyEQL/phreeqc/database/Tipping_Hurley.dat +4137 -0
  25. pyEQL/phreeqc/database/__init__.py +0 -0
  26. pyEQL/phreeqc/database/core10.dat +6824 -0
  27. pyEQL/phreeqc/database/frezchem.dat +634 -0
  28. pyEQL/phreeqc/database/iso.dat +7235 -0
  29. pyEQL/phreeqc/database/llnl.dat +19310 -0
  30. pyEQL/phreeqc/database/minteq.dat +5654 -0
  31. pyEQL/phreeqc/database/minteq.v4.dat +13212 -0
  32. pyEQL/phreeqc/database/phreeqc.dat +1972 -0
  33. pyEQL/phreeqc/database/phreeqc_rates.dat +3158 -0
  34. pyEQL/phreeqc/database/pitzer.dat +1044 -0
  35. pyEQL/phreeqc/database/sit.dat +14348 -0
  36. pyEQL/phreeqc/database/wateq4f.dat +4036 -0
  37. pyEQL/phreeqc/ext/README.md +10 -0
  38. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/CMakeLists.txt +476 -0
  39. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/INSTALL +302 -0
  40. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/IPhreeqc.rc +61 -0
  41. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/IPhreeqcConfig.cmake.in +4 -0
  42. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/Makefile.am +8 -0
  43. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/Makefile.in +816 -0
  44. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/aclocal.m4 +1217 -0
  45. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/CTestScript.cmake +167 -0
  46. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/CSelectedOutput.cpp.o +0 -0
  47. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/IPhreeqc.cpp.o +0 -0
  48. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/IPhreeqcLib.cpp.o +0 -0
  49. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/IPhreeqc_interface_F.cpp.o +0 -0
  50. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/Var.c.o +0 -0
  51. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Dictionary.cpp.o +0 -0
  52. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/ExchComp.cxx.o +0 -0
  53. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Exchange.cxx.o +0 -0
  54. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/GasComp.cxx.o +0 -0
  55. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/GasPhase.cxx.o +0 -0
  56. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/ISolution.cxx.o +0 -0
  57. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/ISolutionComp.cxx.o +0 -0
  58. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/KineticsComp.cxx.o +0 -0
  59. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/NameDouble.cxx.o +0 -0
  60. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/NumKeyword.cxx.o +0 -0
  61. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/PBasic.cpp.o +0 -0
  62. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/PHRQ_io_output.cpp.o +0 -0
  63. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/PPassemblage.cxx.o +0 -0
  64. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/PPassemblageComp.cxx.o +0 -0
  65. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Phreeqc.cpp.o +0 -0
  66. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/PhreeqcKeywords/Keywords.cpp.o +0 -0
  67. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Pressure.cxx.o +0 -0
  68. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Reaction.cxx.o +0 -0
  69. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/ReadClass.cxx.o +0 -0
  70. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/SS.cxx.o +0 -0
  71. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/SSassemblage.cxx.o +0 -0
  72. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/SScomp.cxx.o +0 -0
  73. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/SelectedOutput.cpp.o +0 -0
  74. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Serializer.cxx.o +0 -0
  75. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Solution.cxx.o +0 -0
  76. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/SolutionIsotope.cxx.o +0 -0
  77. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/StorageBin.cxx.o +0 -0
  78. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/StorageBinList.cpp.o +0 -0
  79. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Surface.cxx.o +0 -0
  80. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/SurfaceCharge.cxx.o +0 -0
  81. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/SurfaceComp.cxx.o +0 -0
  82. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/System.cxx.o +0 -0
  83. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Temperature.cxx.o +0 -0
  84. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Use.cpp.o +0 -0
  85. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/UserPunch.cpp.o +0 -0
  86. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/advection.cpp.o +0 -0
  87. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/basicsubs.cpp.o +0 -0
  88. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/cl1.cpp.o +0 -0
  89. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/common/PHRQ_base.cxx.o +0 -0
  90. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/common/PHRQ_io.cpp.o +0 -0
  91. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/common/Parser.cxx.o +0 -0
  92. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/common/Utils.cxx.o +0 -0
  93. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/cvdense.cpp.o +0 -0
  94. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/cvode.cpp.o +0 -0
  95. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/cxxKinetics.cxx.o +0 -0
  96. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/cxxMix.cxx.o +0 -0
  97. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/dense.cpp.o +0 -0
  98. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/dumper.cpp.o +0 -0
  99. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/gases.cpp.o +0 -0
  100. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/input.cpp.o +0 -0
  101. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/integrate.cpp.o +0 -0
  102. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/inverse.cpp.o +0 -0
  103. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/isotopes.cpp.o +0 -0
  104. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/kinetics.cpp.o +0 -0
  105. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/mainsubs.cpp.o +0 -0
  106. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/model.cpp.o +0 -0
  107. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/nvector.cpp.o +0 -0
  108. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/nvector_serial.cpp.o +0 -0
  109. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/parse.cpp.o +0 -0
  110. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/phqalloc.cpp.o +0 -0
  111. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/pitzer.cpp.o +0 -0
  112. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/pitzer_structures.cpp.o +0 -0
  113. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/prep.cpp.o +0 -0
  114. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/print.cpp.o +0 -0
  115. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/read.cpp.o +0 -0
  116. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/readtr.cpp.o +0 -0
  117. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/runner.cpp.o +0 -0
  118. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/sit.cpp.o +0 -0
  119. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/smalldense.cpp.o +0 -0
  120. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/spread.cpp.o +0 -0
  121. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/step.cpp.o +0 -0
  122. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/structures.cpp.o +0 -0
  123. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/sundialsmath.cpp.o +0 -0
  124. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/tally.cpp.o +0 -0
  125. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/tidy.cpp.o +0 -0
  126. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/transport.cpp.o +0 -0
  127. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/utilities.cpp.o +0 -0
  128. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CTestTestfile.cmake +6 -0
  129. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/DartConfiguration.tcl +109 -0
  130. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/cmake_install.cmake +45 -0
  131. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/libIPhreeqc.a +0 -0
  132. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/ar-lib +270 -0
  133. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/compile +347 -0
  134. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/config.guess +1441 -0
  135. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/config.sub +1813 -0
  136. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/depcomp +791 -0
  137. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/install-sh +508 -0
  138. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/ltmain.sh +11156 -0
  139. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/missing +215 -0
  140. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/test-driver +148 -0
  141. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/configure +23867 -0
  142. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/configure.ac +136 -0
  143. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Amm.dat +1968 -0
  144. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/CMakeLists.txt +32 -0
  145. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/ColdChem.dat +267 -0
  146. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Concrete_PHR.dat +158 -0
  147. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Concrete_PZ.dat +195 -0
  148. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Kinec.v2.dat +12039 -0
  149. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Kinec_v3.dat +12159 -0
  150. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Makefile.am +28 -0
  151. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Makefile.in +530 -0
  152. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/PHREEQC_ThermoddemV1.10_15Dec2020.dat +12965 -0
  153. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Tipping_Hurley.dat +4137 -0
  154. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/core10.dat +6824 -0
  155. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/frezchem.dat +634 -0
  156. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/iso.dat +7235 -0
  157. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/llnl.dat +19310 -0
  158. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/minteq.dat +5654 -0
  159. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/minteq.v4.dat +13212 -0
  160. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/phreeqc.dat +1972 -0
  161. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/phreeqc_rates.dat +3158 -0
  162. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/pitzer.dat +1044 -0
  163. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/sit.dat +14348 -0
  164. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/wateq4f.dat +4036 -0
  165. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/CMakeLists.txt +35 -0
  166. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/IPhreeqc.pdf +0 -0
  167. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/Makefile.am +24 -0
  168. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/Makefile.in +545 -0
  169. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/NOTICE +51 -0
  170. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/Phreeqc_2_1999_manual.pdf +0 -0
  171. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/Phreeqc_3_2013_manual.pdf +0 -0
  172. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/README +428 -0
  173. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/RELEASE +7294 -0
  174. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/IPhreeqc_8h.html +5096 -0
  175. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/IPhreeqc_8h_source.html +389 -0
  176. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/IPhreeqc_8hpp.html +83 -0
  177. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/IPhreeqc_8hpp_source.html +478 -0
  178. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/Var_8h.html +318 -0
  179. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/Var_8h_source.html +200 -0
  180. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/bc_s.png +0 -0
  181. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/bdwn.png +0 -0
  182. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/classIPhreeqc.html +2274 -0
  183. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/classIPhreeqc.png +0 -0
  184. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/classIPhreeqcStop.html +69 -0
  185. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/classIPhreeqcStop.png +0 -0
  186. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/closed.png +0 -0
  187. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html +68 -0
  188. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/doxygen.css +1440 -0
  189. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/doxygen.png +0 -0
  190. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/dynsections.js +97 -0
  191. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2blank.png +0 -0
  192. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2doc.png +0 -0
  193. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2folderclosed.png +0 -0
  194. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2folderopen.png +0 -0
  195. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2lastnode.png +0 -0
  196. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2link.png +0 -0
  197. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2mlastnode.png +0 -0
  198. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2mnode.png +0 -0
  199. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2node.png +0 -0
  200. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2plastnode.png +0 -0
  201. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2pnode.png +0 -0
  202. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2splitbar.png +0 -0
  203. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2vertline.png +0 -0
  204. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/index.html +58 -0
  205. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/jquery.js +31 -0
  206. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/nav_f.png +0 -0
  207. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/nav_g.png +0 -0
  208. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/nav_h.png +0 -0
  209. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/open.png +0 -0
  210. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/structVAR.html +143 -0
  211. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/sync_off.png +0 -0
  212. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/sync_on.png +0 -0
  213. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/tab_a.png +0 -0
  214. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/tab_b.png +0 -0
  215. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/tab_h.png +0 -0
  216. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/tab_s.png +0 -0
  217. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/tabs.css +60 -0
  218. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/phreeqc3.chm +0 -0
  219. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/CMakeLists.txt +11 -0
  220. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/Makefile.am +88 -0
  221. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/Makefile.in +696 -0
  222. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/CMakeLists.txt +1 -0
  223. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/advect/CMakeLists.txt +35 -0
  224. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/advect/CMakeLists.txt.in +21 -0
  225. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/advect/README.txt +44 -0
  226. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/advect/advect.c +101 -0
  227. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/advect/ic +17 -0
  228. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/advect/phreeqc.dat +1579 -0
  229. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/CMakeLists.txt +10 -0
  230. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/README.txt +3 -0
  231. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/excel/CMakeLists.txt +9 -0
  232. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/excel/phreeqc.dat +1582 -0
  233. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/excel/runphreeqc.xls +0 -0
  234. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/excel/withcallback.xls +0 -0
  235. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/python/CMakeLists.txt +11 -0
  236. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/python/Gypsum.py +52 -0
  237. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/python/parallel_advect.py +465 -0
  238. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/python/phreeqc.dat +1582 -0
  239. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/python/pitzer.dat +790 -0
  240. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/python/wateq4f.dat +3846 -0
  241. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/CMakeLists.txt +1 -0
  242. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/advect/CMakeLists.txt +35 -0
  243. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/advect/CMakeLists.txt.in +20 -0
  244. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/advect/README.txt +45 -0
  245. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/advect/advect.cpp +110 -0
  246. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/advect/ic +17 -0
  247. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/advect/phreeqc.dat +1579 -0
  248. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/CMakeLists.txt +1 -0
  249. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/advect/CMakeLists.txt +44 -0
  250. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/advect/CMakeLists.txt.in +24 -0
  251. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/advect/README.txt +45 -0
  252. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/advect/advect.F90 +102 -0
  253. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/advect/ic +17 -0
  254. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/advect/phreeqc.dat +1579 -0
  255. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/CMakeLists.txt +26 -0
  256. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/CMakeLists.txt.in +20 -0
  257. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/README.txt +37 -0
  258. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/ex2 +26 -0
  259. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/main.cpp +20 -0
  260. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/phreeqc.dat +1837 -0
  261. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/post-install.cmake.in +7 -0
  262. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/CMakeLists.txt +185 -0
  263. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/FileTest.cpp +171 -0
  264. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/FileTest.h +34 -0
  265. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/Makefile.am +18 -0
  266. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/Makefile.in +466 -0
  267. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/TestCVar.cpp +9 -0
  268. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/TestIPhreeqc.cpp +4901 -0
  269. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/TestIPhreeqcLib.cpp +4644 -0
  270. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/TestSelectedOutput.cpp +669 -0
  271. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/TestVar.cpp +10 -0
  272. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/conv_fail.in +11 -0
  273. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/dump +42 -0
  274. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/iso.dat +7231 -0
  275. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/kinn20140218 +349 -0
  276. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/missing_e.dat +1556 -0
  277. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/multi_punch +105 -0
  278. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/multi_punch_no_set +102 -0
  279. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/phreeqc.dat.90a6449 +1935 -0
  280. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/phreeqc.dat.old +1556 -0
  281. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/m4/libtool.m4 +8388 -0
  282. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/m4/ltoptions.m4 +437 -0
  283. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/m4/ltsugar.m4 +124 -0
  284. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/m4/ltversion.m4 +23 -0
  285. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/m4/lt~obsolete.m4 +99 -0
  286. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/resource.h +14 -0
  287. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/CSelectedOutput.cpp +401 -0
  288. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/CSelectedOutput.hxx +77 -0
  289. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/CVar.hxx +162 -0
  290. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/Debug.h +12 -0
  291. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/ErrorReporter.hxx +70 -0
  292. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc.cpp +1889 -0
  293. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc.f.inc +91 -0
  294. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc.f90.inc +603 -0
  295. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc.h +2182 -0
  296. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc.hpp +1027 -0
  297. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqcCallbacks.h +19 -0
  298. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqcF.f +653 -0
  299. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqcLib.cpp +1098 -0
  300. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc_interface.F90 +1283 -0
  301. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc_interface_F.cpp +535 -0
  302. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc_interface_F.h +162 -0
  303. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/Makefile.am +210 -0
  304. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/Makefile.in +1294 -0
  305. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/README.Fortran +17 -0
  306. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/Var.c +84 -0
  307. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/Var.h +152 -0
  308. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/Version.h +36 -0
  309. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fimpl.h +282 -0
  310. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap.cpp +646 -0
  311. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap.h +163 -0
  312. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap1.cpp +24 -0
  313. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap2.cpp +24 -0
  314. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap3.cpp +24 -0
  315. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap4.cpp +24 -0
  316. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap5.cpp +24 -0
  317. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap6.cpp +25 -0
  318. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap7.cpp +25 -0
  319. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap8.cpp +24 -0
  320. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ChartHandler.cpp +225 -0
  321. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ChartHandler.h +59 -0
  322. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ChartObject.cpp +1382 -0
  323. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ChartObject.h +444 -0
  324. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/CurveObject.cpp +42 -0
  325. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/CurveObject.h +79 -0
  326. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Dictionary.cpp +41 -0
  327. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Dictionary.h +28 -0
  328. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ExchComp.cxx +398 -0
  329. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ExchComp.h +117 -0
  330. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Exchange.cxx +466 -0
  331. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Exchange.h +74 -0
  332. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Form1.h +1184 -0
  333. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Form1.resX +36 -0
  334. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/GasComp.cxx +265 -0
  335. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/GasComp.h +59 -0
  336. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/GasPhase.cxx +659 -0
  337. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/GasPhase.h +103 -0
  338. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ISolution.cxx +40 -0
  339. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ISolution.h +53 -0
  340. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ISolutionComp.cxx +202 -0
  341. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ISolutionComp.h +138 -0
  342. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/KineticsComp.cxx +318 -0
  343. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/KineticsComp.h +81 -0
  344. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/NA.h +1 -0
  345. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/NameDouble.cxx +537 -0
  346. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/NameDouble.h +66 -0
  347. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/NumKeyword.cxx +190 -0
  348. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/NumKeyword.h +67 -0
  349. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PBasic.cpp +8350 -0
  350. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PBasic.h +572 -0
  351. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PHRQ_io_output.cpp +411 -0
  352. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PPassemblage.cxx +375 -0
  353. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PPassemblage.h +70 -0
  354. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PPassemblageComp.cxx +441 -0
  355. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PPassemblageComp.h +83 -0
  356. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Phreeqc.cpp +2087 -0
  357. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Phreeqc.h +2164 -0
  358. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PhreeqcKeywords/Keywords.cpp +242 -0
  359. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PhreeqcKeywords/Keywords.h +104 -0
  360. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Pressure.cxx +417 -0
  361. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Pressure.h +43 -0
  362. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Reaction.cxx +284 -0
  363. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Reaction.h +57 -0
  364. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ReadClass.cxx +1150 -0
  365. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SS.cxx +609 -0
  366. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SS.h +128 -0
  367. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SSassemblage.cxx +317 -0
  368. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SSassemblage.h +59 -0
  369. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SScomp.cxx +297 -0
  370. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SScomp.h +66 -0
  371. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SelectedOutput.cpp +115 -0
  372. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SelectedOutput.h +209 -0
  373. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Serializer.cxx +213 -0
  374. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Serializer.h +42 -0
  375. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Solution.cxx +1795 -0
  376. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Solution.h +154 -0
  377. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SolutionIsotope.cxx +333 -0
  378. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SolutionIsotope.h +85 -0
  379. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/StorageBin.cxx +1507 -0
  380. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/StorageBin.h +141 -0
  381. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/StorageBinList.cpp +358 -0
  382. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/StorageBinList.h +81 -0
  383. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Surface.cxx +837 -0
  384. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Surface.h +108 -0
  385. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SurfaceCharge.cxx +617 -0
  386. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SurfaceCharge.h +137 -0
  387. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SurfaceComp.cxx +509 -0
  388. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SurfaceComp.h +70 -0
  389. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/System.cxx +103 -0
  390. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/System.h +89 -0
  391. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Temperature.cxx +423 -0
  392. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Temperature.h +42 -0
  393. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Use.cpp +78 -0
  394. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Use.h +159 -0
  395. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/UserPunch.cpp +32 -0
  396. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/UserPunch.h +39 -0
  397. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ZedGraph.dll +0 -0
  398. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/advection.cpp +140 -0
  399. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/basicsubs.cpp +4333 -0
  400. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cl1.cpp +881 -0
  401. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/PHRQ_base.cxx +117 -0
  402. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/PHRQ_base.h +48 -0
  403. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/PHRQ_exports.h +20 -0
  404. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/PHRQ_io.cpp +914 -0
  405. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/PHRQ_io.h +207 -0
  406. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/Parser.cxx +1331 -0
  407. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/Parser.h +310 -0
  408. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/Utils.cxx +263 -0
  409. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/Utils.h +29 -0
  410. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/phrqtype.h +18 -0
  411. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cvdense.cpp +566 -0
  412. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cvdense.h +267 -0
  413. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cvode.cpp +3939 -0
  414. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cvode.h +940 -0
  415. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cxxKinetics.cxx +617 -0
  416. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cxxKinetics.h +78 -0
  417. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cxxMix.cxx +154 -0
  418. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cxxMix.h +58 -0
  419. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/dense.cpp +175 -0
  420. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/dense.h +341 -0
  421. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/dumper.cpp +277 -0
  422. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/dumper.h +60 -0
  423. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/gases.cpp +748 -0
  424. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/global_structures.h +1672 -0
  425. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/input.cpp +133 -0
  426. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/integrate.cpp +1219 -0
  427. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/inverse.cpp +5135 -0
  428. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/isotopes.cpp +1813 -0
  429. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/kinetics.cpp +3180 -0
  430. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/mainsubs.cpp +2320 -0
  431. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/model.cpp +5843 -0
  432. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/nvector.cpp +272 -0
  433. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/nvector.h +485 -0
  434. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/nvector_serial.cpp +1032 -0
  435. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/nvector_serial.h +369 -0
  436. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/parse.cpp +1044 -0
  437. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/phqalloc.cpp +316 -0
  438. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/phqalloc.h +47 -0
  439. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/pitzer.cpp +2709 -0
  440. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/pitzer_structures.cpp +225 -0
  441. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/prep.cpp +6267 -0
  442. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/print.cpp +3673 -0
  443. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/read.cpp +10245 -0
  444. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/readtr.cpp +1495 -0
  445. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/runner.cpp +158 -0
  446. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/runner.h +33 -0
  447. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/sit.cpp +1684 -0
  448. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/smalldense.cpp +324 -0
  449. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/smalldense.h +261 -0
  450. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/spread.cpp +1309 -0
  451. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/step.cpp +1566 -0
  452. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/structures.cpp +3381 -0
  453. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/sundialsmath.cpp +133 -0
  454. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/sundialsmath.h +162 -0
  455. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/sundialstypes.h +183 -0
  456. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/tally.cpp +1288 -0
  457. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/tidy.cpp +5600 -0
  458. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/transport.cpp +6403 -0
  459. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/utilities.cpp +1339 -0
  460. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/thread.h +64 -0
  461. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/CMakeLists.txt +133 -0
  462. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/Makefile.am +45 -0
  463. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/Makefile.in +1128 -0
  464. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/ex2.in +26 -0
  465. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/main.f90 +31 -0
  466. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/main77.f +6 -0
  467. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/main_fortran.cxx +8 -0
  468. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/phreeqc.dat.in +1556 -0
  469. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/test_c.c +148 -0
  470. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/test_cxx.cxx +152 -0
  471. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/test_f90.F90 +328 -0
  472. pyEQL/phreeqc/iphreeqc_wrapper.cpp +75 -0
  473. pyEQL/phreeqc/solution.py +74 -0
  474. pyEQL/phreeqc/var.py +50 -0
  475. pyEQL/presets/Ringers lactate.yaml +20 -0
  476. pyEQL/presets/__init__.py +17 -0
  477. pyEQL/presets/normal saline.yaml +17 -0
  478. pyEQL/presets/rainwater.yaml +17 -0
  479. pyEQL/presets/seawater.yaml +29 -0
  480. pyEQL/presets/urine.yaml +26 -0
  481. pyEQL/presets/wastewater.yaml +21 -0
  482. pyEQL/py.typed +0 -0
  483. pyEQL/salt_ion_match.py +112 -0
  484. pyEQL/solute.py +163 -0
  485. pyEQL/solution.py +2714 -0
  486. pyEQL/utils.py +237 -0
  487. pyeql-1.4.0rc9.dist-info/METADATA +130 -0
  488. pyeql-1.4.0rc9.dist-info/RECORD +491 -0
  489. pyeql-1.4.0rc9.dist-info/WHEEL +6 -0
  490. pyeql-1.4.0rc9.dist-info/licenses/AUTHORS.md +21 -0
  491. pyeql-1.4.0rc9.dist-info/licenses/LICENSE.txt +20 -0
@@ -0,0 +1,1339 @@
1
+ #include "Utils.h"
2
+ #include "Phreeqc.h"
3
+ #include "phqalloc.h"
4
+ #include "NameDouble.h"
5
+ #include "Exchange.h"
6
+ #include "Solution.h"
7
+ #include <time.h>
8
+
9
+ #if defined(PHREEQCI_GUI)
10
+ #ifdef _DEBUG
11
+ #define new DEBUG_NEW
12
+ #undef THIS_FILE
13
+ static char THIS_FILE[] = __FILE__;
14
+ #endif
15
+ #endif
16
+
17
+ /* ---------------------------------------------------------------------- */
18
+ double Phreeqc::
19
+ calc_alk(CReaction& rxn_ref)
20
+ /* ---------------------------------------------------------------------- */
21
+ {
22
+ LDBLE return_value;
23
+ class master* master_ptr;
24
+
25
+ return_value = 0.0;
26
+ class rxn_token* r_token = &rxn_ref.token[1];
27
+ while (r_token->s != NULL)
28
+ {
29
+ master_ptr = r_token->s->secondary;
30
+ if (master_ptr == NULL)
31
+ {
32
+ master_ptr = r_token->s->primary;
33
+ }
34
+ if (master_ptr == NULL)
35
+ {
36
+ error_string = sformatf(
37
+ "Non-master species in secondary reaction, %s.",
38
+ rxn_ref.token[0].s->name);
39
+ error_msg(error_string, CONTINUE);
40
+ input_error++;
41
+ break;
42
+ }
43
+ return_value += r_token->coef * master_ptr->alk;
44
+ //if (strcmp(r_token->name, "e-") == 0 && strcmp(rxn_ref.token[0].name,"e-") != 0)
45
+ //{
46
+ // std::cerr << rxn_ref.token[0].name << " Non-master species has e- in reaction.\n";
47
+ //}
48
+ r_token++;
49
+ }
50
+ return (return_value);
51
+ }/* ---------------------------------------------------------------------- */
52
+ double Phreeqc::
53
+ calc_delta_v(CReaction& r_ref, bool phase)
54
+ /* ---------------------------------------------------------------------- */
55
+ {
56
+ /* calculate delta_v from molar volumes */
57
+ double d_v = 0.0;
58
+ if (phase)
59
+ {
60
+ /* for phases: reactants have coef's < 0, products have coef's > 0, v.v. for species */
61
+ for (size_t i = 1; r_ref.Get_tokens()[i].s; i++)
62
+ {
63
+ if (!r_ref.Get_tokens()[i].s)
64
+ continue;
65
+ d_v += r_ref.Get_tokens()[i].coef * r_ref.Get_tokens()[i].s->logk[vm_tc];
66
+ }
67
+ }
68
+ else
69
+ {
70
+ for (size_t i = 0; r_ref.token[i].name /*|| r_ptr->token[i].s*/; i++)
71
+ {
72
+ if (!r_ref.Get_tokens()[i].s)
73
+ continue;
74
+ d_v -= r_ref.Get_tokens()[i].coef * r_ref.Get_tokens()[i].s->logk[vm_tc];
75
+ }
76
+ }
77
+ return d_v;
78
+ }
79
+ /* ---------------------------------------------------------------------- */
80
+ LDBLE Phreeqc::
81
+ calc_dielectrics(LDBLE tc, LDBLE pa)
82
+ /* ---------------------------------------------------------------------- */
83
+ {
84
+ /* Relative dielectric constant of pure water, eps as a function of (P, T)
85
+ Bradley and Pitzer, 1979, JPC 83, 1599.
86
+ (newer data in Fernandez et al., 1995, JPCRD 24, 33,
87
+ and Fernandez et al., 1997, JPCRD 26, 1125, show its correctness)
88
+ + d(eps)/d(P), Debye-Hueckel A and B, and Av (for Av, see Pitzer et al., 1984, JPCRD 13, p. 4)
89
+ */
90
+ if (llnl_temp.size() > 0) return OK;
91
+ if (tc > 350.)
92
+ {
93
+ tc = 350.;
94
+ }
95
+ LDBLE T = tc + 273.15;
96
+ LDBLE u1 = 3.4279e2, u2 = -5.0866e-3, u3 = 9.469e-7, u4 = -2.0525,
97
+ u5 = 3.1159e3, u6 = -1.8289e2, u7 = -8.0325e3, u8 = 4.2142e6,
98
+ u9 = 2.1417;
99
+ LDBLE d1000 = u1 * exp(T * (u2 + T * u3)); // relative dielectric constant at 1000 bar
100
+ LDBLE c = u4 + u5 / (u6 + T);
101
+ LDBLE b = u7 + u8 / T + u9 * T;
102
+ LDBLE pb = pa * 1.01325; // pa in bar
103
+ eps_r = d1000 + c * log((b + pb) / (b + 1e3)); // relative dielectric constant
104
+ if (eps_r <= 0)
105
+ {
106
+ eps_r = 10.;
107
+ warning_msg("Relative dielectric constant is negative.\nTemperature is out of range of parameterization.");
108
+ }
109
+
110
+ /* qe^2 / (eps_r * kB * T) = 4.803204e-10**2 / 1.38065e-16 / (eps_r * T)
111
+ = 1.671008e-3 (esu^2 / (erg/K)) / (eps_r * T) */
112
+ LDBLE e2_DkT = 1.671008e-3 / (eps_r * T);
113
+
114
+ DH_B = sqrt(8 * pi * AVOGADRO * e2_DkT * rho_0 / 1e3); // Debye length parameter, 1/cm(mol/kg)^-0.5
115
+
116
+ DH_A = DH_B * e2_DkT / (2. * LOG_10); //(mol/kg)^-0.5
117
+
118
+ /* A0 in pitzer */
119
+ if (pitzer_model || sit_model)
120
+ {
121
+ A0 = DH_B * e2_DkT / 6.0;
122
+ if (pitzer_model && aphi != NULL)
123
+ {
124
+ calc_pitz_param(aphi, T, 298.15);
125
+ A0 = aphi->p;
126
+ }
127
+ }
128
+
129
+ /* Debye-Hueckel limiting slope = DH_B * e2_DkT * RT * (d(ln(eps_r)) / d(P) - compressibility) */
130
+ DH_Av = DH_B * e2_DkT * R_LITER_ATM * 1e3 * T * (c / (b + pb) * 1.01325 / eps_r - kappa_0 / 3.); // (cm3/mol)(mol/kg)^-0.5
131
+
132
+ DH_B /= 1e8; // kappa, 1/Angstrom(mol/kg)^-0.5
133
+
134
+ /* the Born functions, * 41.84 to give molal volumes in cm3/mol... */
135
+ ZBrn = (-1 / eps_r + 1.0) * 41.84004;
136
+ QBrn = c / (b + pb) / eps_r / eps_r * 41.84004;
137
+ /* dgdP from subroutine gShok2 in supcrt92, g is neglected here (at tc < 300)...
138
+ and, dgdP is small. Better, adapt Wref to experimental Vm's */
139
+ dgdP = 0;
140
+ //if (tc > 150 && rho_0 < 1.0)
141
+ //{
142
+ // LDBLE sc[7] = {1, -0.2037662e+01, 0.5747000e-02, -0.6557892e-05,
143
+ // 0.6107361e+01, -0.1074377e-01, 0.1268348e-04};
144
+ // LDBLE csc[4] = {1, 0.3666666e+02, -0.1504956e-9, 0.5017997e-13};
145
+ // LDBLE sa = sc[1] + tc * (sc[2] + tc * sc[3]);
146
+ // LDBLE sb = sc[4] + tc * (sc[5] + tc * sc[6]);
147
+
148
+ // dgdP = - sa * sb * pow(1.0 - rho_0, sb - 1.0) * rho_0 * kappa_0 / 1.01325;
149
+
150
+ // LDBLE ft = pow((tc - 155.0)/300.0, 4.8) + csc[1] * pow((tc - 155.0)/300.0, 16.0);
151
+ // LDBLE dfdP = ft * (-3.0 * csc[2] * pow(1000.0 - pb, 2) - 4.0 * csc[3] * pow(1000.0 - pb, 3));
152
+ // dgdP -= dfdP;
153
+ //}
154
+
155
+ return (OK);
156
+ }
157
+ /* ---------------------------------------------------------------------- */
158
+ LDBLE Phreeqc::
159
+ calc_rho_0(LDBLE tc, LDBLE pa)
160
+ /* ---------------------------------------------------------------------- */
161
+ {
162
+ /* Density of pure water
163
+ Wagner and Pruss, 2002, JPCRD 31, 387, eqn. 2.6, along the saturation pressure line +
164
+ interpolation 0 - 300 oC, 0.006 - 1000 atm...
165
+ */
166
+ if (llnl_temp.size() > 0) return OK;
167
+ if (tc > 350.)
168
+ {
169
+ if (need_temp_msg < 1)
170
+ {
171
+ std::ostringstream w_msg;
172
+ w_msg << "Fitting range for dielectric constant of pure water is 0-350 C.\n";
173
+ w_msg << "Fitting range for density along the saturation pressure line is 0-374 C,\n";
174
+ w_msg << " for higher pressures up to 1000 atm 0-300 C.\n";
175
+ w_msg << "Using temperature of 350 C for dielectric and density calculation.";
176
+ warning_msg(w_msg.str().c_str());
177
+ need_temp_msg++;
178
+ }
179
+ tc = 350.;
180
+ }
181
+ LDBLE T = tc + 273.15;
182
+ //eqn. 2.6...
183
+ LDBLE Tc = 647.096, th = 1 - T / Tc;
184
+ LDBLE b1 = 1.99274064, b2 = 1.09965342, b3 = -0.510839303,
185
+ b4 = -1.75493479, b5 = -45.5170352, b6 = -6.7469445e5;
186
+ rho_0_sat = 322.0 * (1.0 + b1 * pow(th, (LDBLE) 1./3.) + b2 * pow(th, (LDBLE) 2./3.) + b3 * pow(th, (LDBLE) 5./3.) +\
187
+ b4 * pow(th, (LDBLE) 16./3.) + b5 * pow(th, (LDBLE) 43./3.) + b6 * pow(th, (LDBLE) 110./3));
188
+ //pressure...
189
+ LDBLE p0 = 5.1880000E-02 + tc * (-4.1885519E-04 + tc * ( 6.6780748E-06 + tc * (-3.6648699E-08 + tc * 8.3501912E-11)));
190
+ LDBLE p1 = -6.0251348E-06 + tc * ( 3.6696407E-07 + tc * (-9.2056269E-09 + tc * ( 6.7024182E-11 + tc * -1.5947241E-13)));
191
+ LDBLE p2 = -2.2983596E-09 + tc * (-4.0133819E-10 + tc * ( 1.2619821E-11 + tc * (-9.8952363E-14 + tc * 2.3363281E-16)));
192
+ LDBLE p3 = 7.0517647E-11 + tc * ( 6.8566831E-12 + tc * (-2.2829750E-13 + tc * ( 1.8113313E-15 + tc * -4.2475324E-18)));
193
+ /* The minimal pressure equals the saturation pressure... */
194
+ if (ah2o_x <= 1.0)
195
+ p_sat = exp(11.6702 - 3816.44 / (T - 46.13)) * ah2o_x;
196
+ else
197
+ p_sat = exp(11.6702 - 3816.44 / (T - 46.13));
198
+ //ah2o_x0 = ah2o_x; // for updating rho in model(): compare with new ah2o_x
199
+ if (pa < p_sat || (use.Get_solution_ptr() && use.Get_solution_ptr()->Get_patm() < p_sat))
200
+ {
201
+ pa = p_sat;
202
+ }
203
+ if (!use.Get_gas_phase_in())
204
+ patm_x = pa;
205
+ pa -= (p_sat - 1e-6);
206
+ rho_0 = rho_0_sat + pa * (p0 + pa * (p1 + pa * (p2 + sqrt(pa) * p3)));
207
+ if (rho_0 < 0.01)
208
+ rho_0 = 0.01;
209
+
210
+ /* compressibility, d(ln(rho)) / d(P), 1/atm... */
211
+ kappa_0 = (p0 + pa * (2 * p1 + pa * (3 * p2 + sqrt(pa) * 3.5 * p3))) / rho_0;
212
+
213
+ return (rho_0 / 1e3);
214
+ }
215
+
216
+ /* ---------------------------------------------------------------------- */
217
+ int Phreeqc::
218
+ compute_gfw(const char *string, LDBLE * gfw)
219
+ /* ---------------------------------------------------------------------- */
220
+ {
221
+ /*
222
+ * Input: string contains a chemical formula
223
+ * Output: gfw contains the calculated gfw
224
+ */
225
+ std::string str(string);
226
+ std::map<std::string, double>::iterator it;
227
+ it = gfw_map.find(str);
228
+ if (it != gfw_map.end())
229
+ {
230
+ *gfw = it->second;
231
+ return OK;
232
+ }
233
+
234
+ int i;
235
+ char token[MAX_LENGTH];
236
+ const char* cptr;
237
+
238
+ count_elts = 0;
239
+ paren_count = 0;
240
+ Utilities::strcpy_safe(token, MAX_LENGTH, string);
241
+ cptr = token;
242
+ if (get_elts_in_species(&cptr, 1.0) == ERROR)
243
+ {
244
+ return (ERROR);
245
+ }
246
+ *gfw = 0.0;
247
+ for (i = 0; i < count_elts; i++)
248
+ {
249
+ if (elt_list[i].elt->gfw <= 0.0)
250
+ {
251
+ return (ERROR);
252
+ }
253
+ *gfw += elt_list[i].coef * (elt_list[i].elt)->gfw;
254
+ }
255
+ gfw_map[str] = *gfw;
256
+ return (OK);
257
+ }
258
+
259
+ /* ---------------------------------------------------------------------- */
260
+ int Phreeqc::
261
+ copy_token(char *token_ptr, const char **cptr, int *length)
262
+ /* ---------------------------------------------------------------------- */
263
+ {
264
+ /*
265
+ * Copies from **cptr to *token_ptr until first space is encountered.
266
+ *
267
+ * Arguments:
268
+ * *token_ptr output, place to store token
269
+ *
270
+ * **cptr input, character string to read token from
271
+ * output, next position after token
272
+ *
273
+ * length output, length of token
274
+ *
275
+ * Returns:
276
+ * UPPER,
277
+ * LOWER,
278
+ * DIGIT,
279
+ * EMPTY,
280
+ * UNKNOWN.
281
+ */
282
+ int i, return_value;
283
+ char c;
284
+
285
+ /*
286
+ * Read to end of whitespace
287
+ */
288
+ while (isspace((int) (c = **cptr)))
289
+ (*cptr)++;
290
+ /*
291
+ * Check what we have
292
+ */
293
+ if (isupper((int) c) || c == '[')
294
+ {
295
+ return_value = UPPER;
296
+ }
297
+ else if (islower((int) c))
298
+ {
299
+ return_value = LOWER;
300
+ }
301
+ else if (isdigit((int) c) || c == '.' || c == '-')
302
+ {
303
+ return_value = DIGIT;
304
+ }
305
+ else if (c == '\0')
306
+ {
307
+ return_value = EMPTY;
308
+ }
309
+ else
310
+ {
311
+ return_value = UNKNOWN;
312
+ }
313
+ /*
314
+ * Begin copying to token
315
+ */
316
+ i = 0;
317
+ while ((!isspace((int) (c = **cptr))) &&
318
+ /* c != ',' && */
319
+ c != ';' && c != '\0')
320
+ {
321
+ token_ptr[i] = c;
322
+ (*cptr)++;
323
+ i++;
324
+ }
325
+ token_ptr[i] = '\0';
326
+ *length = i;
327
+ return (return_value);
328
+ }
329
+ /* ---------------------------------------------------------------------- */
330
+ int Phreeqc::
331
+ copy_token(std::string &token, const char **cptr)
332
+ /* ---------------------------------------------------------------------- */
333
+ {
334
+ /*
335
+ * Copies from **cptr to *token until first space is encountered.
336
+ *
337
+ * Arguments:
338
+ * &token_ptr output, place to store token
339
+ *
340
+ * **cptr input, character string to read token from
341
+ * output, next position after token
342
+ *
343
+ * Returns:
344
+ * UPPER,
345
+ * LOWER,
346
+ * DIGIT,
347
+ * EMPTY,
348
+ * UNKNOWN.
349
+ */
350
+ int return_value;
351
+ char c;
352
+
353
+ /*
354
+ * Read to end of whitespace
355
+ */
356
+ token.clear();
357
+ while (isspace((int) (c = **cptr)))
358
+ (*cptr)++;
359
+ /*
360
+ * Check what we have
361
+ */
362
+ if (isupper((int) c) || c == '[')
363
+ {
364
+ return_value = UPPER;
365
+ }
366
+ else if (islower((int) c))
367
+ {
368
+ return_value = LOWER;
369
+ }
370
+ else if (isdigit((int) c) || c == '.' || c == '-')
371
+ {
372
+ return_value = DIGIT;
373
+ }
374
+ else if (c == '\0')
375
+ {
376
+ return_value = EMPTY;
377
+ }
378
+ else
379
+ {
380
+ return_value = UNKNOWN;
381
+ }
382
+ /*
383
+ * Begin copying to token
384
+ */
385
+ char c_char[2];
386
+ c_char[1] = '\0';
387
+ while ((!isspace((int) (c = **cptr))) &&
388
+ /* c != ',' && */
389
+ c != ';' && c != '\0')
390
+ {
391
+ c_char[0] = c;
392
+ token.append(c_char);
393
+ (*cptr)++;
394
+ }
395
+ return (return_value);
396
+ }
397
+ /* ---------------------------------------------------------------------- */
398
+ int Phreeqc::
399
+ dup_print(const char* cptr, int emphasis)
400
+ /* ---------------------------------------------------------------------- */
401
+ {
402
+ /*
403
+ * print character string to output and logfile
404
+ * if emphasis == TRUE the print is set off by
405
+ * a row of dashes before and after the character string.
406
+ *
407
+ */
408
+ int l;
409
+
410
+ if (pr.headings == FALSE)
411
+ return (OK);
412
+ std::string save_in(cptr);
413
+ l = (int) strlen(cptr);
414
+ if (emphasis == TRUE)
415
+ {
416
+ std::string dash;
417
+ dash.resize(l, '-');
418
+ output_msg(sformatf("%s\n%s\n%s\n\n", dash.c_str(), save_in.c_str(), dash.c_str()));
419
+ log_msg(sformatf("%s\n%s\n%s\n\n", dash.c_str(), save_in.c_str(), dash.c_str()));
420
+ }
421
+ else
422
+ {
423
+ output_msg(sformatf("%s\n\n", save_in.c_str()));
424
+ log_msg(sformatf("%s\n\n", save_in.c_str()));
425
+ }
426
+ return (OK);
427
+ }
428
+
429
+ /* ---------------------------------------------------------------------- */
430
+ int Phreeqc::
431
+ equal(LDBLE a, LDBLE b, LDBLE eps)
432
+ /* ---------------------------------------------------------------------- */
433
+ {
434
+ /*
435
+ * Checks equality between two LDBLE precision numbers
436
+ */
437
+ if (fabs(a - b) <= eps)
438
+ return (TRUE);
439
+ return (FALSE);
440
+ }
441
+
442
+ /* ---------------------------------------------------------------------- */
443
+ void * Phreeqc::
444
+ free_check_null(void *ptr)
445
+ /* ---------------------------------------------------------------------- */
446
+ {
447
+ if (ptr != NULL)
448
+ {
449
+ PHRQ_free(ptr);
450
+ }
451
+ return (NULL);
452
+ }
453
+
454
+ /* ---------------------------------------------------------------------- */
455
+ int Phreeqc::
456
+ get_token(const char** eqnaddr, std::string& string, LDBLE* l_z, int* l)
457
+ /* ---------------------------------------------------------------------- */
458
+ /*
459
+ * Function finds next species in equation, coefficient has already
460
+ * been removed. Also determines charge on the species.
461
+ *
462
+ * Arguments:
463
+ * *eqnaddr input, pointer to position in eqn to start parsing
464
+ * output, pointer to a pointer to next position in eqn to start
465
+ * parsing.
466
+ * *string input pointer to place to store token
467
+ * *l_z charge on token
468
+ * *l length of token
469
+ *
470
+ * Returns:
471
+ * ERROR,
472
+ * OK.
473
+ */
474
+ {
475
+ int i, j;
476
+ int ltoken, lcharge;
477
+ char c;
478
+ const char* cptr, * ptr1, * rest;
479
+ char charge[MAX_LENGTH];
480
+
481
+ string.clear();
482
+ rest = *eqnaddr;
483
+ cptr = *eqnaddr;
484
+ i = 0;
485
+ /*
486
+ * Find end of token or beginning of charge
487
+ */
488
+ while (((c = *cptr) != '+') && (c != '-') && (c != '=') && (c != '\0'))
489
+ {
490
+ string.push_back(c);
491
+ i++;
492
+ if (c == '[')
493
+ {
494
+ cptr++;
495
+ while ((c = *cptr) != ']')
496
+ {
497
+ if (c == '\0')
498
+ {
499
+ error_string = sformatf(
500
+ "No final bracket \"]\" for element name, %s.",
501
+ string.c_str());
502
+ error_msg(error_string, CONTINUE);
503
+ return (ERROR);
504
+ }
505
+ string.push_back(c);
506
+ i++;
507
+ cptr++;
508
+ }
509
+ string.push_back(c);
510
+ i++;
511
+ }
512
+
513
+ cptr++;
514
+ }
515
+ ltoken = i;
516
+ /*
517
+ * Check for an empty string
518
+ */
519
+ if (i == 0)
520
+ {
521
+ error_string = sformatf("NULL string detected in get_token, %s.", rest);
522
+ error_msg(error_string, CONTINUE);
523
+ return (ERROR);
524
+ }
525
+ /*
526
+ * End of token is = or \0, charge is zero
527
+ */
528
+ if (c == '=' || c == '\0')
529
+ {
530
+ *eqnaddr = cptr;
531
+ lcharge = 0;
532
+ *l_z = 0.0;
533
+ }
534
+ else
535
+ {
536
+ /*
537
+ * Copy characters into charge until next species or end is detected
538
+ */
539
+ j = 0;
540
+ ptr1 = cptr;
541
+ while ((isalpha((int)(c = *ptr1)) == FALSE) &&
542
+ (c != '(') &&
543
+ (c != ')') &&
544
+ (c != ']') && (c != '[') && (c != '=') && (c != '\0'))
545
+ {
546
+ charge[j++] = c;
547
+ /* error if no more space */
548
+ if (j >= MAX_LENGTH)
549
+ {
550
+ error_msg("The charge on a species has exceeded MAX_LENGTH characters.",
551
+ CONTINUE);
552
+ return (ERROR);
553
+ }
554
+ ptr1++;
555
+ }
556
+ /*
557
+ * Go back to last + or - if not end of side,
558
+ * everything before the last + or - in charge is part of the charge
559
+ */
560
+ if ((c != '=') && (c != '\0'))
561
+ {
562
+ while (((c = *ptr1) != '+') && (c != '-'))
563
+ {
564
+ j--;
565
+ ptr1--;
566
+ }
567
+ }
568
+ charge[j] = '\0';
569
+ lcharge = j;
570
+ *eqnaddr = ptr1;
571
+ /*
572
+ * Charge has been written, now need to check if charge has legal format
573
+ */
574
+ if (get_charge(charge, MAX_LENGTH, l_z) == OK)
575
+ {
576
+ string.append(charge);
577
+ }
578
+ else
579
+ {
580
+ return (ERROR);
581
+ }
582
+ }
583
+ *l = ltoken + lcharge;
584
+ return (OK);
585
+ }
586
+
587
+ /* ---------------------------------------------------------------------- */
588
+ int Phreeqc::
589
+ isamong(char c, const char *s_l)
590
+ /* ---------------------------------------------------------------------- */
591
+ /*
592
+ * Function checks if c is among the characters in the string s
593
+ *
594
+ * Arguments:
595
+ * c input, character to check
596
+ * *s string of characters
597
+ *
598
+ * Returns:
599
+ * TRUE if c is in set,
600
+ * FALSE if c in not in set.
601
+ */
602
+ {
603
+ int i;
604
+
605
+ for (i = 0; s_l[i] != '\0'; i++)
606
+ {
607
+ if (c == s_l[i])
608
+ {
609
+ return (TRUE);
610
+ }
611
+ }
612
+ return (FALSE);
613
+ }
614
+
615
+ /* ---------------------------------------------------------------------- */
616
+ int Phreeqc::
617
+ islegit(const char c)
618
+ /* ---------------------------------------------------------------------- */
619
+ /*
620
+ * Function checks for legal characters for chemical equations
621
+ *
622
+ * Argument:
623
+ * c input, character to check
624
+ *
625
+ * Returns:
626
+ * TRUE if c is in set,
627
+ * FALSE if c in not in set.
628
+ */
629
+ {
630
+ if (isalpha((int) c) || isdigit((int) c) || isamong(c, "+-=().:_[]"))
631
+ {
632
+ return (TRUE);
633
+ }
634
+ return (FALSE);
635
+ }
636
+
637
+ /* ---------------------------------------------------------------------- */
638
+ void Phreeqc::
639
+ malloc_error(void)
640
+ /* ---------------------------------------------------------------------- */
641
+ {
642
+ error_msg("NULL pointer returned from malloc or realloc.", CONTINUE);
643
+ error_msg("Program terminating.", STOP);
644
+ return;
645
+ }
646
+
647
+ /* ---------------------------------------------------------------------- */
648
+ int Phreeqc::
649
+ print_centered(const char *string)
650
+ /* ---------------------------------------------------------------------- */
651
+ {
652
+ int i, l, l1, l2;
653
+ char token[MAX_LENGTH];
654
+
655
+ l = (int) strlen(string);
656
+ l1 = (79 - l) / 2;
657
+ l2 = 79 - l - l1;
658
+ for (i = 0; i < l1; i++)
659
+ token[i] = '-';
660
+ token[i] = '\0';
661
+ Utilities::strcat_safe(token, MAX_LENGTH, string);
662
+ for (i = 0; i < l2; i++)
663
+ token[i + l1 + l] = '-';
664
+ token[79] = '\0';
665
+ output_msg(sformatf("%s\n\n", token));
666
+ return (OK);
667
+ }
668
+ bool Phreeqc::
669
+ replace(const char *str1, const char *str2, std::string & str)
670
+ {
671
+ size_t pos = str.find(str1);
672
+ if (pos != std::string::npos)
673
+ {
674
+ size_t l = strlen(str1);
675
+ str.replace(pos, l, str2);
676
+ return true;
677
+ }
678
+ return false;
679
+ }
680
+ /* ---------------------------------------------------------------------- */
681
+ int Phreeqc::
682
+ replace(const char *str1, const char *str2, char *str)
683
+ /* ---------------------------------------------------------------------- */
684
+ {
685
+ /*
686
+ * Function replaces str1 with str2 in str
687
+ *
688
+ * Arguments:
689
+ * str1 search str for str1
690
+ * str2 replace str1 if str1 found in str
691
+ * str string to be searched
692
+ *
693
+ * Returns
694
+ * TRUE if string was replaced
695
+ * FALSE if string was not replaced
696
+ */
697
+ int l, l1, l2;
698
+ char* ptr_start;
699
+
700
+ ptr_start = strstr(str, str1);
701
+ /*
702
+ * Str1 not found, return
703
+ */
704
+ if (ptr_start == NULL)
705
+ return (FALSE);
706
+ /*
707
+ * Str1 found, replace Str1 with Str2
708
+ */
709
+ l = (int) strlen(str);
710
+ l1 = (int) strlen(str1);
711
+ l2 = (int) strlen(str2);
712
+ /*
713
+ * Make gap in str long enough for str2
714
+ */
715
+ /* The plus one includes the terminating NULL */
716
+ memmove(ptr_start + l2, ptr_start + l1, l - (ptr_start - str + l1) + 1);
717
+ /*
718
+ * Copy str2 into str
719
+ */
720
+ memcpy(ptr_start, str2, l2);
721
+ return (TRUE);
722
+ }
723
+ void Phreeqc::
724
+ replace(std::string &stds, const char* str1, const char* str2)
725
+ {
726
+ size_t pos, l;
727
+ l = strlen(str1);
728
+ while ((pos = stds.find(str1)) != std::string::npos) {
729
+ stds.replace(pos, l, str2);
730
+ }
731
+ }
732
+ /* ---------------------------------------------------------------------- */
733
+ void Phreeqc::
734
+ space(void **ptr, int i, int *max, int struct_size)
735
+ /* ---------------------------------------------------------------------- */
736
+ {
737
+ /*
738
+ * Routine has 4 functions, allocate space, reallocate space, test to
739
+ * determine whether space is available, and free space.
740
+ *
741
+ * Arguments:
742
+ * ptr pointer to malloced space
743
+ * i value for test
744
+ * i = INIT, allocates space
745
+ * i >= 0 && i < max, space is available, return
746
+ * i >= max, reallocate space
747
+ * i = FREE, free space.
748
+ * max maximum value for i with available space
749
+ * struct size size of structure to be allocated
750
+ */
751
+ /*
752
+ * Return if space exists
753
+ */
754
+ if ((i >= 0) && (i + 1 < *max))
755
+ {
756
+ return;
757
+ }
758
+ /*
759
+ * Realloc space
760
+ */
761
+ if (i + 1 >= *max)
762
+ {
763
+ if (*max > 1000)
764
+ {
765
+ *max += 1000;
766
+ }
767
+ else
768
+ {
769
+ *max *= 2;
770
+ }
771
+ if (i + 1 > *max)
772
+ *max = i + 1;
773
+ *ptr = PHRQ_realloc(*ptr, (size_t) (*max) * struct_size);
774
+ if (*ptr == NULL)
775
+ malloc_error();
776
+ return;
777
+ }
778
+ /*
779
+ * Allocate space
780
+ */
781
+ if (i == INIT)
782
+ {
783
+ /* free(*ptr); */
784
+ *ptr = PHRQ_malloc((size_t) (*max) * struct_size);
785
+ if (*ptr == NULL)
786
+ malloc_error();
787
+ return;
788
+ }
789
+ /*
790
+ * Free space
791
+ */
792
+ /*
793
+ if ( i == FREE ) {
794
+ free(*ptr);
795
+ return;
796
+ }
797
+ */
798
+ /*
799
+ * Error
800
+ */
801
+ error_msg("Illegal argument to function space.", CONTINUE);
802
+ error_msg("Program terminating.", STOP);
803
+ return;
804
+ }
805
+
806
+ /* ---------------------------------------------------------------------- */
807
+ void Phreeqc::
808
+ squeeze_white(char *s_l)
809
+ /* ---------------------------------------------------------------------- */
810
+ /*
811
+ * Delete all white space from string s
812
+ *
813
+ * Argument:
814
+ * *s_l input, character string, possibly containing white space
815
+ * output, character string with all white space removed
816
+ *
817
+ * Return: void
818
+ */
819
+ {
820
+ int i, j;
821
+
822
+ for (i = j = 0; s_l[i] != '\0'; i++)
823
+ {
824
+ if (!isspace((int) s_l[i]))
825
+ s_l[j++] = s_l[i];
826
+ }
827
+ s_l[j] = '\0';
828
+ }
829
+
830
+ /* ---------------------------------------------------------------------- */
831
+ void Phreeqc::
832
+ str_tolower(char *str)
833
+ /* ---------------------------------------------------------------------- */
834
+ {
835
+ /*
836
+ * Replaces string, str, with same string, lower case
837
+ */
838
+ char* ptr;
839
+ ptr = str;
840
+ while (*ptr != '\0')
841
+ {
842
+ *ptr = (char) tolower(*ptr);
843
+ ptr++;
844
+ }
845
+ }
846
+
847
+ /* ---------------------------------------------------------------------- */
848
+ void Phreeqc::
849
+ str_toupper(char *str)
850
+ /* ---------------------------------------------------------------------- */
851
+ {
852
+ /*
853
+ * Replaces string, str, with same string, lower case
854
+ */
855
+ char* ptr;
856
+ ptr = str;
857
+ while (*ptr != '\0')
858
+ {
859
+ *ptr = (char) toupper(*ptr);
860
+ ptr++;
861
+ }
862
+ }
863
+
864
+ /* ---------------------------------------------------------------------- */
865
+ int Phreeqc::
866
+ strcmp_nocase(const char *str1, const char *str2)
867
+ /* ---------------------------------------------------------------------- */
868
+ {
869
+ /*
870
+ * Compare two strings disregarding case
871
+ */
872
+ int c1, c2;
873
+ while ((c1 = tolower(*str1++)) == (c2 = tolower(*str2++)))
874
+ {
875
+ if (c1 == '\0')
876
+ return (0);
877
+ }
878
+ if (c1 < c2)
879
+ return (-1);
880
+ return (1);
881
+ }
882
+ void Phreeqc::str_tolower(std::string &name)
883
+ {
884
+ std::transform(name.begin(), name.end(), name.begin(), tolower);
885
+ }
886
+ /* ---------------------------------------------------------------------- */
887
+ int Phreeqc::
888
+ strcmp_nocase_arg1(const char *str1, const char *str2)
889
+ /* ---------------------------------------------------------------------- */
890
+ {
891
+ /*
892
+ * Compare two strings disregarding case
893
+ */
894
+ int c1, c2;
895
+ while ((c1 = tolower(*str1++)) == (c2 = *str2++))
896
+ {
897
+ if (c1 == '\0')
898
+ return (0);
899
+ }
900
+ if (c1 < c2)
901
+ return (-1);
902
+ return (1);
903
+ }
904
+
905
+ /* ---------------------------------------------------------------------- */
906
+ char * Phreeqc::
907
+ #if !defined(NDEBUG) && defined(WIN32_MEMORY_DEBUG)
908
+ _string_duplicate(const char *token, const char *szFileName, int nLine)
909
+ #else
910
+ string_duplicate(const char *token)
911
+ #endif
912
+ /* ---------------------------------------------------------------------- */
913
+ {
914
+ int l;
915
+ char *str;
916
+
917
+ if (token == NULL)
918
+ return NULL;
919
+ l = (int) strlen(token);
920
+ #if !defined(NDEBUG) && defined(WIN32_MEMORY_DEBUG)
921
+ str = (char *) _malloc_dbg((size_t) (l + 1) * sizeof(char), _NORMAL_BLOCK, szFileName, nLine);
922
+ #else
923
+ str = (char *) PHRQ_malloc(((size_t)l + 1) * sizeof(char));
924
+ #endif
925
+
926
+ if (str == NULL)
927
+ malloc_error();
928
+ strcpy(str, token);
929
+ return (str);
930
+ }
931
+
932
+ /* ---------------------------------------------------------------------- */
933
+ const char * Phreeqc::
934
+ string_hsave(const char *str)
935
+ /* ---------------------------------------------------------------------- */
936
+ {
937
+ /*
938
+ * Save character string str
939
+ *
940
+ * Arguments:
941
+ * str input string to save.
942
+ *
943
+ * Returns:
944
+ * starting address of saved string (str)
945
+ */
946
+ if (str == NULL) return (NULL);
947
+ std::map<std::string, std::string *>::const_iterator it;
948
+ it = strings_map.find(str);
949
+ if (it != strings_map.end())
950
+ {
951
+ return (it->second->c_str());
952
+ }
953
+
954
+ std::string *stdstr = new std::string(str);
955
+ strings_map[*stdstr] = stdstr;
956
+ return(stdstr->c_str());
957
+ }
958
+ /* ---------------------------------------------------------------------- */
959
+ void Phreeqc::
960
+ strings_map_clear()
961
+ /* ---------------------------------------------------------------------- */
962
+ {
963
+ /*
964
+ * Save character string str
965
+ *
966
+ * Arguments:
967
+ * str input string to save.
968
+ *
969
+ * Returns:
970
+ * starting address of saved string (str)
971
+ */
972
+ std::map<std::string, std::string *>::iterator it;
973
+ for (it = strings_map.begin(); it != strings_map.end(); it++)
974
+ {
975
+ delete it->second;
976
+ }
977
+ strings_map.clear();
978
+ }
979
+ /* ---------------------------------------------------------------------- */
980
+ LDBLE Phreeqc::
981
+ under(LDBLE xval)
982
+ /* ---------------------------------------------------------------------- */
983
+ {
984
+ /*
985
+ * Exponentiate a number, x, but censor large and small numbers
986
+ * log values less than MIN_LM are set to 0
987
+ * log values greater than MAX_LM are set to 10**MAX_LM
988
+ */
989
+ /* if (xval < MIN_LM) { */
990
+ if (xval < -40.)
991
+ {
992
+ return (0.0);
993
+ }
994
+ if (xval > MAX_LM)
995
+ {
996
+ return ( MAX_M );
997
+ }
998
+ return (pow ((LDBLE) 10.0, xval));
999
+ }
1000
+ #ifndef PHREEQCI_GUI
1001
+ /* ---------------------------------------------------------------------- */
1002
+ int Phreeqc::
1003
+ status(int count, const char *str, bool rk_string)
1004
+ /* ---------------------------------------------------------------------- */
1005
+ {
1006
+ char sim_str[20];
1007
+ char state_str[45];
1008
+ char spin_str[2];
1009
+ clock_t t2;
1010
+
1011
+ if (pr.status == FALSE || phast == TRUE)
1012
+ return (OK);
1013
+
1014
+ if (state == INITIALIZE)
1015
+ {
1016
+ screen_string = sformatf("\n%-80s", "Initializing...");
1017
+ screen_msg(screen_string.c_str());
1018
+ status_on = true;
1019
+ return (OK);
1020
+ }
1021
+ #ifdef NPP
1022
+ t2 = clock();
1023
+ if (((state < ADVECTION && reaction_step < count_total_steps) ||
1024
+ (state == ADVECTION && (advection_step < count_ad_shifts || cell_no < count_cells)) ||
1025
+ (state == TRANSPORT && (transport_step < count_shifts || (mixrun < nmix /*&&
1026
+ cell_no < count_cells*/))))
1027
+ && (int) (1e3 / CLOCKS_PER_SEC * (t2 - status_timer)) < status_interval)
1028
+ return (OK);
1029
+ #endif
1030
+
1031
+ switch (state)
1032
+ {
1033
+ case INITIALIZE:
1034
+ break;
1035
+ case TRANSPORT:
1036
+ if (str != NULL)
1037
+ {
1038
+ if (rk_string)
1039
+ {
1040
+
1041
+ screen_string = screen_string.substr(0, 43);
1042
+ screen_string.append(str);
1043
+ status_string = screen_string;
1044
+ }
1045
+ else
1046
+ {
1047
+ screen_string = "\r";
1048
+ screen_string.append(str);
1049
+ status_string = screen_string;
1050
+ }
1051
+ status_on = true;
1052
+ }
1053
+ case PHAST:
1054
+ break;
1055
+ default:
1056
+ // if str not NULL, print it
1057
+ if (str != NULL && !rk_string)
1058
+ {
1059
+ screen_string = "\r";
1060
+ screen_string.append(str);
1061
+ status_string = screen_string;
1062
+ }
1063
+ else
1064
+ // print state
1065
+ {
1066
+ std::string stdstr;
1067
+ if (str != NULL && rk_string)
1068
+ {
1069
+ stdstr = str;
1070
+ }
1071
+ snprintf(sim_str, sizeof(sim_str), "\rSimulation %d.", simulation);
1072
+ snprintf(state_str, sizeof(state_str), " ");
1073
+ snprintf(spin_str, sizeof(spin_str), " ");
1074
+ switch (state)
1075
+ {
1076
+ default:
1077
+ break;
1078
+ case INITIAL_SOLUTION:
1079
+ snprintf(state_str, sizeof(state_str), "Initial solution %d.", use.Get_solution_ptr()->Get_n_user());
1080
+ break;
1081
+ case INITIAL_EXCHANGE:
1082
+ snprintf(state_str, sizeof(state_str), "Initial exchange %d.", use.Get_exchange_ptr()->Get_n_user());
1083
+ break;
1084
+ case INITIAL_SURFACE:
1085
+ snprintf(state_str, sizeof(state_str), "Initial surface %d.", use.Get_surface_ptr()->Get_n_user());
1086
+ break;
1087
+ case INVERSE:
1088
+ snprintf(state_str, sizeof(state_str), "Inverse %d. Models = %d.", use.Get_inverse_ptr()->n_user, count);
1089
+ break;
1090
+ case REACTION:
1091
+ if (use.Get_kinetics_in() == TRUE)
1092
+ {
1093
+ snprintf(state_str, sizeof(state_str), "Kinetic step %d.", reaction_step);
1094
+ }
1095
+ else
1096
+ {
1097
+ snprintf(state_str, sizeof(state_str), "Reaction step %d.", reaction_step);
1098
+ }
1099
+ break;
1100
+ case ADVECTION:
1101
+ snprintf(state_str, sizeof(state_str), "Advection, shift %d.", advection_step);
1102
+ break;
1103
+ }
1104
+ spinner++;
1105
+ if (spinner == 1)
1106
+ {
1107
+ spin_str[0] = '/';
1108
+ }
1109
+ else if (spinner == 2)
1110
+ {
1111
+ spin_str[0] = '-';
1112
+ }
1113
+ else
1114
+ {
1115
+ spin_str[0] = '\\';
1116
+ spinner = 0;
1117
+ }
1118
+ if (use.Get_kinetics_in() == TRUE)
1119
+ {
1120
+ screen_string = sformatf("%-15s%-27s%38s", sim_str, state_str, stdstr.c_str());
1121
+ status_string = screen_string;
1122
+ }
1123
+ else
1124
+ {
1125
+ screen_string = sformatf("%-15s%-27s%1s%45s", sim_str, state_str, spin_str, stdstr.c_str());
1126
+ status_string = screen_string;
1127
+ }
1128
+ }
1129
+ status_on = true;
1130
+ break;
1131
+ }
1132
+
1133
+ #ifndef NPP
1134
+ t2 = clock();
1135
+ if ((int) (1e3 / CLOCKS_PER_SEC * (t2 - status_timer)) > status_interval)
1136
+ #endif
1137
+ {
1138
+ status_timer = t2;
1139
+ screen_msg(status_string.c_str());
1140
+ status_string.clear();
1141
+ }
1142
+ return (OK);
1143
+ }
1144
+ #endif /*PHREEQCI_GUI */
1145
+ # include <assert.h>
1146
+
1147
+ /* ---------------------------------------------------------------------- */
1148
+ int Phreeqc::
1149
+ string_trim(char *str)
1150
+ /* ---------------------------------------------------------------------- */
1151
+ {
1152
+ /*
1153
+ * Function trims white space from left and right of string
1154
+ *
1155
+ * Arguments:
1156
+ * str string to trime
1157
+ *
1158
+ * Returns
1159
+ * TRUE if string was changed
1160
+ * FALSE if string was not changed
1161
+ * EMPTY if string is all whitespace
1162
+ */
1163
+ int i, l, start, end, length;
1164
+ char* ptr_start;
1165
+
1166
+ l = (int) strlen(str);
1167
+ /*
1168
+ * leading whitespace
1169
+ */
1170
+ for (i = 0; i < l; i++)
1171
+ {
1172
+ if (isspace((int) str[i]))
1173
+ continue;
1174
+ break;
1175
+ }
1176
+ if (i == l)
1177
+ return (EMPTY);
1178
+ start = i;
1179
+ ptr_start = &(str[i]);
1180
+ /*
1181
+ * trailing whitespace
1182
+ */
1183
+ for (i = l - 1; i >= 0; i--)
1184
+ {
1185
+ if (isspace((int) str[i]))
1186
+ continue;
1187
+ break;
1188
+ }
1189
+ end = i;
1190
+ if (start == 0 && end == l)
1191
+ return (FALSE);
1192
+ length = end - start + 1;
1193
+ memmove((void *) str, (void *) ptr_start, (size_t) length);
1194
+ str[length] = '\0';
1195
+
1196
+ return (TRUE);
1197
+ }
1198
+ void Phreeqc::string_trim_left(std::string& str)
1199
+ {
1200
+ const std::string& chars = "\t\n ";
1201
+ str.erase(0, str.find_first_not_of(chars));
1202
+ }
1203
+ void Phreeqc::string_trim_right(std::string& str)
1204
+ {
1205
+ const std::string& chars = "\t\n ";
1206
+ str.erase(str.find_last_not_of(chars) + 1);
1207
+ }
1208
+ void Phreeqc::string_trim(std::string& str)
1209
+ {
1210
+ const std::string& chars = "\t\n ";
1211
+ str.erase(0, str.find_first_not_of(chars));
1212
+ str.erase(str.find_last_not_of(chars) + 1);
1213
+ }
1214
+
1215
+ /* ---------------------------------------------------------------------- */
1216
+ int Phreeqc::
1217
+ string_trim_right(char *str)
1218
+ /* ---------------------------------------------------------------------- */
1219
+ {
1220
+ /*
1221
+ * Function trims white space from right of string
1222
+ *
1223
+ * Arguments:
1224
+ * str string to trime
1225
+ *
1226
+ * Returns
1227
+ * TRUE if string was changed
1228
+ * FALSE if string was not changed
1229
+ * EMPTY if string is all whitespace
1230
+ */
1231
+ int i, l, end, length;
1232
+
1233
+ l = (int) strlen(str);
1234
+ for (i = l - 1; i >= 0; i--)
1235
+ {
1236
+ if (isspace((int) str[i]))
1237
+ continue;
1238
+ break;
1239
+ }
1240
+ end = i;
1241
+ length = end + 1;
1242
+ str[length] = '\0';
1243
+ if (end == 0)
1244
+ return (EMPTY);
1245
+ if (end == l)
1246
+ return (FALSE);
1247
+ return (TRUE);
1248
+ }
1249
+
1250
+ /* ---------------------------------------------------------------------- */
1251
+ int Phreeqc::
1252
+ string_trim_left(char *str)
1253
+ /* ---------------------------------------------------------------------- */
1254
+ {
1255
+ /*
1256
+ * Function trims white space from left of string
1257
+ *
1258
+ * Arguments:
1259
+ * str string to trime
1260
+ *
1261
+ * Returns
1262
+ * TRUE if string was changed
1263
+ * FALSE if string was not changed
1264
+ * EMPTY if string is all whitespace
1265
+ */
1266
+ int i, l, start, end, length;
1267
+ char* ptr_start;
1268
+
1269
+ l = (int) strlen(str);
1270
+ /*
1271
+ * leading whitespace
1272
+ */
1273
+ for (i = 0; i < l; i++)
1274
+ {
1275
+ if (isspace((int) str[i]))
1276
+ continue;
1277
+ break;
1278
+ }
1279
+ if (i == l)
1280
+ return (EMPTY);
1281
+ start = i;
1282
+ ptr_start = &(str[i]);
1283
+ end = l;
1284
+ if (start == 0 && end == l)
1285
+ return (FALSE);
1286
+ length = end - start + 1;
1287
+ memmove((void *) str, (void *) ptr_start, (size_t) length);
1288
+ str[length] = '\0';
1289
+
1290
+ return (TRUE);
1291
+ }
1292
+
1293
+ /* ---------------------------------------------------------------------- */
1294
+ char * Phreeqc::
1295
+ string_pad(const char *str, int i)
1296
+ /* ---------------------------------------------------------------------- */
1297
+ {
1298
+ /*
1299
+ * Function returns new string padded to width i
1300
+ * or returns str if longer
1301
+ * Arguments:
1302
+ * str string to pad
1303
+ *
1304
+ * Returns
1305
+ * new string of with i
1306
+ */
1307
+ int j, l, max;
1308
+ char *str_ptr;
1309
+
1310
+ l = (int) strlen(str);
1311
+ max = l;
1312
+ if (l < i)
1313
+ max = i;
1314
+ str_ptr = (char *) PHRQ_malloc((((size_t)max + 1) * sizeof(char)));
1315
+ if (str_ptr == NULL)
1316
+ malloc_error();
1317
+ else
1318
+ strcpy(str_ptr, str);
1319
+ if (i > l)
1320
+ {
1321
+ for (j = l; j < i; j++)
1322
+ {
1323
+ str_ptr[j] = ' ';
1324
+ }
1325
+ str_ptr[i] = '\0';
1326
+ }
1327
+ return (str_ptr);
1328
+ }
1329
+ /* ---------------------------------------------------------------------- */
1330
+ int Phreeqc::
1331
+ get_input_errors()
1332
+ /* ---------------------------------------------------------------------- */
1333
+ {
1334
+ if (input_error == 0)
1335
+ {
1336
+ return phrq_io->Get_io_error_count();
1337
+ }
1338
+ return input_error;
1339
+ }