[CHNOSZ-commits] r926 - in pkg/CHNOSZ: . R demo inst inst/extdata/OBIGT inst/extdata/thermo man vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jun 18 04:07:58 CEST 2025


Author: jedick
Date: 2025-06-18 04:07:56 +0200 (Wed, 18 Jun 2025)
New Revision: 926

Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/R/retrieve.R
   pkg/CHNOSZ/demo/uranyl.R
   pkg/CHNOSZ/inst/NEWS.Rd
   pkg/CHNOSZ/inst/extdata/OBIGT/SLOP98.csv
   pkg/CHNOSZ/inst/extdata/OBIGT/inorganic_cr.csv
   pkg/CHNOSZ/inst/extdata/thermo/refs.csv
   pkg/CHNOSZ/man/add.OBIGT.Rd
   pkg/CHNOSZ/vignettes/OBIGT.Rmd
Log:
Fixes for examples and demos


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2025-06-15 04:00:42 UTC (rev 925)
+++ pkg/CHNOSZ/DESCRIPTION	2025-06-18 02:07:56 UTC (rev 926)
@@ -1,6 +1,6 @@
-Date: 2025-06-15
+Date: 2025-06-18
 Package: CHNOSZ
-Version: 2.1.0-97
+Version: 2.1.0-98
 Title: Thermodynamic Calculations and Diagrams for Geochemistry
 Authors at R: c(
     person("Jeffrey", "Dick", , "j3ffdick at gmail.com", role = c("aut", "cre"),

Modified: pkg/CHNOSZ/R/retrieve.R
===================================================================
--- pkg/CHNOSZ/R/retrieve.R	2025-06-15 04:00:42 UTC (rev 925)
+++ pkg/CHNOSZ/R/retrieve.R	2025-06-18 02:07:56 UTC (rev 926)
@@ -117,7 +117,7 @@
 
   # Require non-NA Delta G0 at specific temperature 20200825
   if(!is.null(T)) {
-    G <- sapply(suppressMessages(subcrt(ispecies, T = T, P = P))$out, "[[", "G")
+    G <- sapply(suppressWarnings(suppressMessages(subcrt(ispecies, T = T, P = P)))$out, "[[", "G")
     ispecies <- ispecies[!is.na(G)]
   }
 

Modified: pkg/CHNOSZ/demo/uranyl.R
===================================================================
--- pkg/CHNOSZ/demo/uranyl.R	2025-06-15 04:00:42 UTC (rev 925)
+++ pkg/CHNOSZ/demo/uranyl.R	2025-06-18 02:07:56 UTC (rev 926)
@@ -21,13 +21,15 @@
 
 # Total carbonate-pH
 iaq <- retrieve("U", ligands = c("C", "O", "H", "Cl", "Na"), state = "aq")
-icr <- retrieve("U", ligands = c("C", "O", "H", "Cl", "Na"), state = "cr")
+# Only get minerals that have non-NA G at the indicated temperature
+icr <- retrieve("U", ligands = c("C", "O", "H", "Cl", "Na"), state = "cr", T = T)
 basis(c("UO2+2", "CO3-2", "Na+", "Cl-", "H+", "H2O", "O2"))
 basis(c("Na+", "Cl-"), c(logm_Naplus, logm_Clminus))
 species(iaq, logm_U)
 species(icr, add = TRUE)
 bases <- c("CO3-2", "HCO3-", "CO2")
-m <- mosaic(bases, pH = c(pH_lim, res), "CO3-2" = c(CS_lim, res), T = T, P = P, IS = IS)
+# Suppress warnings about being above T limit of Cp equation for beta-UO2(OH)2, UO2.25, and beta-UO2.3333
+m <- suppressWarnings(mosaic(bases, pH = c(pH_lim, res), "CO3-2" = c(CS_lim, res), T = T, P = P, IS = IS))
 diagram(m$A.species)
 diagram(m$A.bases, add = TRUE, col = 8, lty = 2, col.names = 8, italic = TRUE)
 title("Uranyl-carbonate complexation at 200 \u00b0C, after Migdisov et al., 2024", font.main = 1)
@@ -34,13 +36,13 @@
 
 # Total sulfate-pH
 iaq <- retrieve("U", ligands = c("S", "O", "H", "Cl", "Na"), state = "aq")
-icr <- retrieve("U", ligands = c("S", "O", "H", "Cl", "Na"), state = "cr")
+icr <- retrieve("U", ligands = c("S", "O", "H", "Cl", "Na"), state = "cr", T = T)
 basis(c("UO2+2", "SO4-2", "Na+", "Cl-", "H+", "H2O", "O2"))
 basis(c("Na+", "Cl-"), c(logm_Naplus, logm_Clminus))
 species(iaq, logm_U)
 species(icr, add = TRUE)
 bases <- c("SO4-2", "HSO4-", "HS-", "H2S")
-m <- mosaic(bases, pH = c(pH_lim, res), "SO4-2" = c(CS_lim, res), T = T, P = P, IS = IS)
+m <- suppressWarnings(mosaic(bases, pH = c(pH_lim, res), "SO4-2" = c(CS_lim, res), T = T, P = P, IS = IS))
 diagram(m$A.species)
 diagram(m$A.bases, add = TRUE, col = 8, lty = 2, col.names = 8, italic = TRUE)
 title("Uranyl-sulfate complexation at 200 \u00b0C, after Migdisov et al., 2024", font.main = 1)

Modified: pkg/CHNOSZ/inst/NEWS.Rd
===================================================================
--- pkg/CHNOSZ/inst/NEWS.Rd	2025-06-15 04:00:42 UTC (rev 925)
+++ pkg/CHNOSZ/inst/NEWS.Rd	2025-06-18 02:07:56 UTC (rev 926)
@@ -15,7 +15,7 @@
 \newcommand{\Cp}{\ifelse{latex}{\eqn{C_P}}{\ifelse{html}{\out{<I>C<sub>P</sub></I>}}{Cp}}}
 \newcommand{\DG0}{\ifelse{latex}{\eqn{{\Delta}G^{\circ}}}{\ifelse{html}{\out{Δ<I>G</I>°}}{ΔG°}}}
 
-\section{Changes in CHNOSZ version 2.1.0-96 (2025-06-09)}{
+\section{Changes in CHNOSZ version 2.1.0-98 (2025-06-18)}{
 
   \subsection{OBIGT DATABASE FORMAT}{
     \itemize{

Modified: pkg/CHNOSZ/inst/extdata/OBIGT/SLOP98.csv
===================================================================
--- pkg/CHNOSZ/inst/extdata/OBIGT/SLOP98.csv	2025-06-15 04:00:42 UTC (rev 925)
+++ pkg/CHNOSZ/inst/extdata/OBIGT/SLOP98.csv	2025-06-18 02:07:56 UTC (rev 926)
@@ -283,8 +283,7 @@
 UO2OH,UO2OH,UO2OH,aq,SSB97,NA,1994-05-18,HKF,cal,-261600,-295900,-13.9,24.8,14.5,3.739,1.3467,5.2242,-2.8346,20.4246,2.0172,-0.03,0
 UO3-,UO3-,UO3-,aq,SSB97,NA,1994-05-18,HKF,cal,-236600,-272600,-19.5,6.7,12.6,4.1388,2.3272,4.8294,-2.8751,27.8024,-1.6697,1.9223,-1
 UO2OH+,UO2OH+,UO2OH+,aq,SSB97,NA,1994-05-18,HKF,cal,-277250,-301550,4.1,4.3,20.7,4.764,3.8529,4.2318,-2.9382,13.224,-2.1586,0.4925,1
-UO3,UO3(AQ),UO3,aq,SSB97,NA,1994-05-18,HKF,cal,-270300,-299600,-12.9,-0.8,14.8,3.7801,1.4512,5.1736,-2.8389,5.4213,-3.1975,-0.03,0
-HUO4-,HUO4-,HUO4-,aq,SSB97,NA,1994-05-18,HKF,cal,-314800,-362900,-20.2,22.1,18.4,4.9364,4.2748,4.0637,-2.9556,36.9351,1.4672,1.9339,-1
+UO3,UO3,UO3,aq,SSB97,NA,1994-05-18,HKF,cal,-270300,-299600,-12.9,-0.8,14.8,3.7801,1.4512,5.1736,-2.8389,5.4213,-3.1975,-0.03,0
 UO4-2,UO4-2,UO4-2,aq,SSB97,NA,1994-05-18,HKF,cal,-296000,-346200,-27.1,-44.4,15.4,5.0964,4.6606,3.9223,-2.9716,13.513,-12.0788,3.6219,-2
 HCl,HCl,HCl,aq,MS97.2,SLOP98.11,1996-07-30,HKF,cal,-30410,-42054,3.2,NA,NA,1.2547,-4.7177,7.6043,-2.584,16.7134,2.8727,-0.7,0
 Ag(HS)2-,Ag(HS)2-,Ag(HS)2-,aq,SSH97.1,NA,1997-10-09,HKF,cal,0,-8200,44.68,38.1,60.5,10.3654,17.5311,-1.1475,-3.5037,37.2753,4.7273,0.9527,-1

Modified: pkg/CHNOSZ/inst/extdata/OBIGT/inorganic_cr.csv
===================================================================
--- pkg/CHNOSZ/inst/extdata/OBIGT/inorganic_cr.csv	2025-06-15 04:00:42 UTC (rev 925)
+++ pkg/CHNOSZ/inst/extdata/OBIGT/inorganic_cr.csv	2025-06-18 02:07:56 UTC (rev 926)
@@ -154,9 +154,9 @@
 cattierite,"cobalt disulfide",CoS2,cr,WV22,PMW87,2024-02-05,CGL,J,-147365,-153140,74.793,68.26,25.52,65.82,0.0303,-587000,0,0,0,0,1223
 carrollite,Cli,Cu0.92Co2.07S4,cr,HDR+24,NA,2024-02-05,CGL,J,-331140,-344460,176.33,158.48,63.91,197.951,-0.0298,-2687000,0,0,0,0,377
 carrollite,Cli,Cu0.92Co2.07S4,cr2,HDR+24,NA,2024-02-05,CGL_Ttr,J,-331157,-345026,174.49,NA,63.91,234.11,-0.18038,0,0,0,0,0,650
-rutherfordine,Rfd,UO2CO3,cr,NEA20,Hem82,2023-08-07,CGL_Ttr,J,-1564701,-1691302,144.2,120.1,57.69,122.8563,0.04468312,-2706665,0,0,0,0,700
-beta-UO2(OH)2,Sho,UO2(OH)2,cr,NEA20,NA,2023-08-07,CGL_Ttr,J,-1398683,-1533800,138,141,52.29,41.8,0.2,3530000,0,0,0,0,473
-Na2U2O7,Na2U2O7,Na2U2O7,cr,NEA20,NA,2023-08-07,CGL_Ttr,J,-3011454,-3203800,275.9,227.3,52.5,262.83,0.014653,-3549000,0,0,0,0,540
+rutherfordine,Rfd,UO2CO3,cr,NEA20,Hem82,2023-08-07,CGL,J,-1564701,-1691302,144.2,120.1,57.69,122.8563,0.04468312,-2706665,0,0,0,0,700
+beta-UO2(OH)2,Sho,UO2(OH)2,cr,NEA20,NA,2023-08-07,CGL,J,-1398683,-1533800,138,141,52.29,41.8,0.2,3530000,0,0,0,0,473
+Na2U2O7,Na2U2O7,Na2U2O7,cr,NEA20,NA,2023-08-07,CGL,J,-3011454,-3203800,275.9,227.3,52.5,262.83,0.014653,-3549000,0,0,0,0,540
 chromite,Chr,FeCr2O4,cr,RH95,NA,2024-05-23,CGL,J,-1344500,-1445500,146,133.58,44.01,301.8,-0.04157,487700,-2803,1.147E-05,0,0,1800
 cassiterite,Cst,SnO2,cr,RH95,NA,2025-01-17,CGL_Ttr,J,-515800,-577600,49.02,53.22,21.55,76.04,0.007364,-2224000,0,0,0,0,1903
 aluminum,Al,Al,cr,RH95,NA,2025-04-28,CGL_Ttr,J,0,0,28.3,24.21,9.999,41.32,-0.01988,-126500,-181.6,1.93E-05,0,0,933.5

Modified: pkg/CHNOSZ/inst/extdata/thermo/refs.csv
===================================================================
--- pkg/CHNOSZ/inst/extdata/thermo/refs.csv	2025-06-15 04:00:42 UTC (rev 925)
+++ pkg/CHNOSZ/inst/extdata/thermo/refs.csv	2025-06-18 02:07:56 UTC (rev 926)
@@ -87,10 +87,11 @@
 DSM+97.1,"J. D. Dale, E. L. Shock et al.",1997,"Geochim. Cosmochim. Acta 61, 4017-4024","phenol, and cresol isomers",https://doi.org/10.1016/S0016-7037(97)00212-3
 DSM+97.2,"J. D. Dale, E. L. Shock et al.",1997,"Geochim. Cosmochim. Acta 61, 4017-4024","dimethylphenol isomers",https://doi.org/10.1016/S0016-7037(97)00212-3
 HP97,"P. C. Ho and D. A. Palmer",1997,"Geochim. Cosmochim. Acta 61, 3027-3040",KOH,https://doi.org/10.1016/S0016-7037(97)00146-4
-MS97,"T. M. McCollom and E. L. Shock",1997,"Geochim. Cosmochim. Acta 61, 4375-4391","MgSO<sub>4</sub>, NaSO<sub>4</sub><sup>-</sup>, and HCl",https://doi.org/10.1016/S0016-7037(97)00241-X
+MS97,"T. M. McCollom and E. L. Shock",1997,"Geochim. Cosmochim. Acta 61, 4375-4391","MgSO<sub>4</sub> and NaSO<sub>4</sub><sup>-</sup>",https://doi.org/10.1016/S0016-7037(97)00241-X
 MS97.1,"T. M. McCollom and E. L. Shock",1997,"Geochim. Cosmochim. Acta 61, 4375-4391",sulfur,https://doi.org/10.1016/S0016-7037(97)00241-X
-MS97.2,"T. M. McCollom and E. L. Shock",1997,"Geochim. Cosmochim. Acta 61, 4375-4391","aqueous HCl",https://doi.org/10.1016/S0016-7037(97)00241-X
+MS97.2,"T. M. McCollom and E. L. Shock",1997,"Geochim. Cosmochim. Acta 61, 4375-4391","HCl",https://doi.org/10.1016/S0016-7037(97)00241-X
 PH97,"V. A. Pokrovskii and H. C. Helgeson",1997,"Chem. Geol. 137, 221-242",KAl<sub>2</sub>O,https://doi.org/10.1016/S0009-2541(96)00167-2
+SSB97,"E. L. Shock, D. C. Sassani and H. Betz",1997,"Geochim. Cosmochim. Acta 61, 4245-4266","uranium species",https://doi.org/10.1016/S0016-7037(97)00240-8
 SSWS97,"E. L. Shock, D. C. Sassani et al.",1997,"Geochim. Cosmochim. Acta 61, 907-950","aqueous ions and hydroxide complexes",https://doi.org/10.1016/S0016-7037(96)00339-0
 SSWS97.1,"E. L. Shock, D. C. Sassani et al.",1997,"Geochim. Cosmochim. Acta 61, 907-950","zincite and litharge",https://doi.org/10.1016/S0016-7037(96)00339-0
 SSWS97.2,"E. L. Shock, D. C. Sassani et al.",1997,"Geochim. Cosmochim. Acta 61, 907-950","Au<sup>+</sup>, Cu<sup>+</sup>, Sn<sup>+2</sup>, Th<sup>+4</sup>, and Zn<sup>+2</sup>",https://doi.org/10.1016/S0016-7037(96)00339-0
@@ -104,7 +105,6 @@
 SSH97.4,"D. A. Sverjensky, E. L. Shock and H. C. Helgeson",1997,"Geochim. Cosmochim. Acta 61, 1359-1412","Zn acetate complexes",https://doi.org/10.1016/S0016-7037(97)00009-4
 SSH97.5,"D. A. Sverjensky, E. L. Shock and H. C. Helgeson",1997,"Geochim. Cosmochim. Acta 61, 1359-1412","NaHSiO<sub>3</sub>, CaHSiO<sub>3</sub><sup>+</sup>, and MgHSiO<sub>3</sub><sup>+</sup>",https://doi.org/10.1016/S0016-7037(97)00009-4
 SSH97.6,"D. A. Sverjensky, E. L. Shock and H. C. Helgeson",1997,"Geochim. Cosmochim. Acta 61, 1359-1412","In fluoride complex",https://doi.org/10.1016/S0016-7037(97)00009-4
-SSB97,"E. L. Shock, D. C. Sassani and H. Betz",1997,"Geochim. Cosmochim. Acta 61, 4245-4266","uranium species",https://doi.org/10.1016/S0016-7037(97)00240-8
 TSD97,"Y. Tardy, R. Schaul, J. Duplay",1997,"C. R. Acad. Sci. Paris 324, 969-976","humic acid, microflora, and plants",https://doi.org/10.1016/S1251-8050(97)83981-X
 TZA97,"B. R. Tagirov, A. V. Zotov and N. N. Akinfiev",2007,"Geochim. Cosmochim. Acta 61, 4267-4280","aqueous HCl",https://doi.org/10.1016/S0016-7037(97)00274-3
 ST97,"D. Shvedov and P. R. Tremaine",1997,"J. Solution Chem. 26, 1113-1143","dimethylammonium chloride HKF parameters",https://doi.org/10.1023/A:1022977006327

Modified: pkg/CHNOSZ/man/add.OBIGT.Rd
===================================================================
--- pkg/CHNOSZ/man/add.OBIGT.Rd	2025-06-15 04:00:42 UTC (rev 925)
+++ pkg/CHNOSZ/man/add.OBIGT.Rd	2025-06-18 02:07:56 UTC (rev 926)
@@ -92,25 +92,30 @@
 # using data from Sverjensky et al., 1997 and Bazarkina et al., 2010
 Cdspecies <- c("Cd+2", "CdCl+", "CdCl2", "CdCl3-", "CdCl4-2")
 P <- c(1, seq(25, 1000, 25))
+# Use data from Sverjensky et al., 1997
+add.OBIGT("SLOP98")
 SSH97 <- lapply(1:4, function(i) {
   subcrt(c(Cdspecies[i], "Cl-", Cdspecies[i+1]),
-    c(-1, -1, 1), T=25, P=P)$out$logK
+    c(-1, -1, 1), T = 25, P = P)$out$logK
 })
-file <- system.file("extdata/misc/BZA10.csv", package="CHNOSZ")
+SSH97 <- do.call(cbind, SSH97)
+# Use data from Bazarkina et al., 2010
+file <- system.file("extdata/misc/BZA10.csv", package = "CHNOSZ")
 add.OBIGT(file)
 BZA10 <- lapply(1:4, function(i) {
   subcrt(c(Cdspecies[i], "Cl-", Cdspecies[i+1]),
-    c(-1, -1, 1), T=25, P=P)$out$logK
+    c(-1, -1, 1), T = 25, P = P)$out$logK
 })
-matplot(P, do.call(cbind, SSH97), type="l")
-matplot(P, do.call(cbind, BZA10), type="l", add=TRUE, lwd=2)
-legend("topleft", legend=c("", "", "Sverjensky et al., 1997",
-  "Bazarkina et al., 2010"), lwd=c(0, 0, 1, 2), bty="n")
+BZA10 <- do.call(cbind, BZA10)
+matplot(P, SSH97, type = "l", lty = 1, lwd = 2, ylab = axis.label("logK"))
+matplot(P, BZA10, type = "l", lty = 2, lwd = 2, add = TRUE)
+ltxt <- c("", "", "Sverjensky et al., 1997", "Bazarkina et al., 2010")
+legend("topleft", ltxt, lty = c(0, 0, 1, 2), lwd = 2, bty = "n")
 # Make reaction labels
 y <- c(1.8, 0.2, -0.5, -1)
 invisible(lapply(1:4, function(i) {
   text(800, y[i], describe.reaction(subcrt(c(Cdspecies[i], "Cl-",
-    Cdspecies[i+1]), c(-1, -1, 1), T=25, P=1)$reaction))
+    Cdspecies[i+1]), c(-1, -1, 1), T = 25, P = 1)$reaction))
 }))
 # Restore default database
 OBIGT()

Modified: pkg/CHNOSZ/vignettes/OBIGT.Rmd
===================================================================
--- pkg/CHNOSZ/vignettes/OBIGT.Rmd	2025-06-15 04:00:42 UTC (rev 925)
+++ pkg/CHNOSZ/vignettes/OBIGT.Rmd	2025-06-18 02:07:56 UTC (rev 926)
@@ -272,6 +272,8 @@
 <div id="D-aqueous-inorganic" style="display: none">
 ## <a id="aqueous-inorganic" class="anchor"></a> `r setfile("inorganic_aq.csv")`
 
+**NOTE:** Aqueous U species from @SSB97 (with the exception of HUO<sub>4</sub><sup>-</sup>) have been moved to the SLOP98 optional data file due to incompatibility with more recent data [@MBA+24]. Because the latter source includes only uranyl species, the set of data for aqueous uranium species in the default database is currently incomplete.
+
 ```{r reflist, results="asis", echo=FALSE}
 ```
 </div>
@@ -356,7 +358,7 @@
 <div id="D-optional-SLOP98" style="display: none">
 ## <a id="optional-SLOP98" class="anchor"></a> `r setfile("SLOP98.csv")`
 These species, whose parameters were listed in or are otherwise linked to slop98.dat (or later versions) and were present in earlier versions of CHNOSZ, have been replaced by or are incompatible with species currently in the default database.
-The elements with updated data for at least some aqueous species, and the corresponding references, include:
+The elements with updated data for at least some aqueous species include:
 HCl [@TZA97],
 Al [@TS01],
 Au, Ag, and Cu(I) [@AZ01; @AZ10],
@@ -369,7 +371,7 @@
 Pt [@TBB15],
 Nb [@AKK+20],
 Ga and In [@HB24], and
-U(IV) [@MBA+24].
+U [@MBA+24].
 
 Use `add.OBIGT("SLOP98")` to load the data.
 



More information about the CHNOSZ-commits mailing list