From noreply at r-forge.r-project.org Mon Jan 7 07:10:07 2019
From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org)
Date: Mon, 7 Jan 2019 07:10:07 +0100 (CET)
Subject: [CHNOSZ-commits] r352 - in pkg/CHNOSZ: . inst vignettes
Message-ID: <20190107061007.AAE2D18BA6C@r-forge.r-project.org>
Author: jedick
Date: 2019-01-07 07:10:01 +0100 (Mon, 07 Jan 2019)
New Revision: 352
Modified:
pkg/CHNOSZ/DESCRIPTION
pkg/CHNOSZ/inst/NEWS
pkg/CHNOSZ/vignettes/anintro.Rmd
Log:
anintro.Rmd: add cuprite to mosaic diagram and note about balance = 1
Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION 2018-12-21 15:03:57 UTC (rev 351)
+++ pkg/CHNOSZ/DESCRIPTION 2019-01-07 06:10:01 UTC (rev 352)
@@ -1,6 +1,6 @@
-Date: 2018-12-21
+Date: 2019-01-07
Package: CHNOSZ
-Version: 1.1.3-59
+Version: 1.1.3-60
Title: Thermodynamic Calculations and Diagrams for Geo(bio)chemistry
Authors at R: c(
person("Jeffrey", "Dick", , "j3ffdick at gmail.com", role = c("aut", "cre"),
Modified: pkg/CHNOSZ/inst/NEWS
===================================================================
--- pkg/CHNOSZ/inst/NEWS 2018-12-21 15:03:57 UTC (rev 351)
+++ pkg/CHNOSZ/inst/NEWS 2019-01-07 06:10:01 UTC (rev 352)
@@ -1,4 +1,4 @@
-CHANGES IN CHNOSZ 1.1.3-59 (2018-12-21)
+CHANGES IN CHNOSZ 1.1.3-60 (2019-01-07)
---------------------------------------
NEW FEATURES
@@ -126,6 +126,11 @@
coordinates of lines (field boundaries) on 2-D diagrams (these are
taken from the output of contourLines()).
+DOCUMENTATION
+
+- anintro.Rmd: add cuprite to mosaic diagram example, and note about
+ implications of changing balance to 1.
+
BUG FIXES
- Fix a bug where subcrt()$reaction$coeffs was incorrect for reactions
Modified: pkg/CHNOSZ/vignettes/anintro.Rmd
===================================================================
--- pkg/CHNOSZ/vignettes/anintro.Rmd 2018-12-21 15:03:57 UTC (rev 351)
+++ pkg/CHNOSZ/vignettes/anintro.Rmd 2019-01-07 06:10:01 UTC (rev 352)
@@ -61,16 +61,14 @@
## use pngquant to optimize PNG images
knit_hooks$set(pngquant = hook_pngquant)
+pngquant <- "--speed=1 --quality=0-25"
# pngquant isn't available on R-Forge ...
-if (!nzchar(Sys.which("pngquant"))) {
- pngquant <- NULL
- # save space by using a lower resolution
- dpi <- 50
-} else {
- pngquant <- "--speed=1 --quality=0-25"
- dpi <- 50
-}
+if (!nzchar(Sys.which("pngquant"))) pngquant <- NULL
+## use a low resolution to save space in the package
+# change this to 72 to make higher-resolution images for the CHNOSZ web page
+dpi <- 50
+
## http://stackoverflow.com/questions/23852753/knitr-with-gridsvg
## Set up a chunk hook for manually saved plots.
knit_hooks$set(custom.plot = hook_plot_custom)
@@ -661,7 +659,7 @@
These diagrams are made by constructing individual diagrams for the possible basis species.
The individual diagrams are then combined, each one contributing to the final diagram only in the range of stability of the corresponding basis species.
-Let's use `mosaic()` to make a diagram for aqueous species and minerals in the Cu-S-Cl-`r h2o` system, similar to Figure 5a of @CPCC17.
+Let's use `mosaic()` to make a diagram for aqueous species and minerals in the Cu-S-Cl-`r h2o` system.
To know what aqueous copper chloride complexes are available in the database, we can use a fuzzy search:
```{r info_CuCl, results="hide"}
info(" CuCl")
@@ -677,12 +675,12 @@
Next we define the basis, and set the activities of the H2S and Cl- basis species.
These represent the total activity of S and Cl in the system, which are distributed among the minerals and aqueous species.
-Three minerals and the aqueous copper chloride species are included:
+Four minerals and the aqueous copper chloride species are included:
```{r copper_setup, echo=TRUE, results="hide"}
basis(c("Cu", "H2S", "Cl-", "H2O", "H+", "e-"))
basis("H2S", -6)
basis("Cl-", -0.7)
-species(c("copper", "tenorite"))
+species(c("copper", "cuprite", "tenorite"))
species("chalcocite", "cr2")
species(c("CuCl", "CuCl2-", "CuCl3-2", "CuCl+", "CuCl2", "CuCl3-", "CuCl4-2"))
```
@@ -708,6 +706,13 @@
The smooth transitions between basis species cause the appearance of curved lines on the plot.
Without that argument, the diagrams would be combined using the dominant basis species, and all of the line segments would be straight.
+Note that this diagram is balanced on Cu, so that no Cu appears in reactions between any two other species (minerals or aqueous species).
+If `diagram()` is run with `balance = 1`, then the reactions are written for one mole of the mineral formulas on each side of the reaction, with the possibility of Cu appearing as an additional species to conserve the elements.
+This may be problematic, as Cu would be be present in some reactions in Eh-pH space where it is not a stable phase.
+However, it is common in low-temperature aqueous geochemical calculations to "turn off" particular redox reactions that are not thought to attain equilibrium, so decoupling a species from equilibrium may be justified in some circumstances.
+Therefore, while changing the balance constraints has important implications that should be carefully considered, it can present a possibly useful view of the system if certain assumptions are met.
+Changing the balance to 1 results in the loss of the tenorite stability field and extension of chalcocite stability to pH < 0, as shown in Figure 5a of @CPCC17.
+
We have seen the effects of speciation of S in the basis species.
However, the choice of other basis species can also affect the diagram.
From noreply at r-forge.r-project.org Tue Jan 8 05:44:06 2019
From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org)
Date: Tue, 8 Jan 2019 05:44:06 +0100 (CET)
Subject: [CHNOSZ-commits] r353 - in pkg/CHNOSZ: . R inst
Message-ID: <20190108044406.891BD18B9D2@r-forge.r-project.org>
Author: jedick
Date: 2019-01-08 05:44:05 +0100 (Tue, 08 Jan 2019)
New Revision: 353
Modified:
pkg/CHNOSZ/DESCRIPTION
pkg/CHNOSZ/R/util.affinity.R
pkg/CHNOSZ/R/util.plot.R
pkg/CHNOSZ/R/util.units.R
pkg/CHNOSZ/inst/NEWS
Log:
water.lines(): reduce message clutter
Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION 2019-01-07 06:10:01 UTC (rev 352)
+++ pkg/CHNOSZ/DESCRIPTION 2019-01-08 04:44:05 UTC (rev 353)
@@ -1,6 +1,6 @@
-Date: 2019-01-07
+Date: 2019-01-08
Package: CHNOSZ
-Version: 1.1.3-60
+Version: 1.1.3-61
Title: Thermodynamic Calculations and Diagrams for Geo(bio)chemistry
Authors at R: c(
person("Jeffrey", "Dick", , "j3ffdick at gmail.com", role = c("aut", "cre"),
Modified: pkg/CHNOSZ/R/util.affinity.R
===================================================================
--- pkg/CHNOSZ/R/util.affinity.R 2019-01-07 06:10:01 UTC (rev 352)
+++ pkg/CHNOSZ/R/util.affinity.R 2019-01-08 04:44:05 UTC (rev 353)
@@ -264,12 +264,12 @@
}
# report non-variables to user
if(!T.is.var)
- message('energy.args: temperature is ',outvert(T,'K'),' ',T.units())
+ message('affinity: temperature is ',outvert(T,'K'),' ',T.units())
if(!P.is.var) {
- if(identical(P,"Psat")) message("energy.args: pressure is Psat")
- else message('energy.args: pressure is ',outvert(P,'bar'),' ',P.units())
+ if(identical(P,"Psat")) message("affinity: pressure is Psat")
+ else message('affinity: pressure is ',outvert(P,'bar'),' ',P.units())
}
- if(!IS.is.var & !identical(IS,0)) message('energy.args: ionic strength is ',IS)
+ if(!IS.is.var & !identical(IS,0)) message('affinity: ionic strength is ',IS)
# default values for resolution
res <- 128
# where we store the output
@@ -299,12 +299,12 @@
if(transect) args[[i]] <- -args[[i]]
else args[[i]][1:2] <- -args[[i]][1:2]
if(!'H+' %in% rownames(thermo$basis))
- message('energy.args: pH requested, but no H+ in the basis')
+ message('affinity: pH requested, but no H+ in the basis')
}
if(names(args)[i]=="pe") {
names(args)[i] <- "e-"
if(!'e-' %in% rownames(thermo$basis))
- message('energy.args: pe requested, but no e- in the basis')
+ message('affinity: pe requested, but no e- in the basis')
if(transect) args[[i]] <- -args[[i]]
else args[[i]][1:2] <- -args[[i]][1:2]
}
@@ -332,7 +332,7 @@
if(nametxt=="T") unittxt <- " K"
if(nametxt=="P") unittxt <- " bar"
if(nametxt=="Eh") unittxt <- " V"
- message("energy.args: variable ", length(vars), " is ", nametxt,
+ message("affinity: variable ", length(vars), " is ", nametxt,
" at ", n, " values from ", lims.orig[1], " to ", lims.orig[2], unittxt)
}
}
Modified: pkg/CHNOSZ/R/util.plot.R
===================================================================
--- pkg/CHNOSZ/R/util.plot.R 2019-01-07 06:10:01 UTC (rev 352)
+++ pkg/CHNOSZ/R/util.plot.R 2019-01-08 04:44:05 UTC (rev 353)
@@ -127,12 +127,12 @@
if('reduction' %in% which) {
logfH2 <- logaH2O # usually 0
if(yaxis=="H2") {
- logK <- subcrt(c("H2", "H2"), c(-1, 1), c("gas", H2state), T=T, P=P, convert=FALSE)$out$logK
+ logK <- suppressMessages(subcrt(c("H2", "H2"), c(-1, 1), c("gas", H2state), T=T, P=P, convert=FALSE))$out$logK
# this is logfH2 if H2state=="gas", or logaH2 if H2state=="aq"
logfH2 <- logfH2 + logK
y.reduction <- rep(logfH2, length.out=length(xpoints))
} else {
- logK <- subcrt(c("H2O", "O2", "H2"), c(-1, 0.5, 1), c("liq", O2state, "gas"), T=T, P=P, convert=FALSE)$out$logK
+ logK <- suppressMessages(subcrt(c("H2O", "O2", "H2"), c(-1, 0.5, 1), c("liq", O2state, "gas"), T=T, P=P, convert=FALSE))$out$logK
# this is logfO2 if O2state=="gas", or logaO2 if O2state=="aq"
logfO2 <- 2 * (logK - logfH2 + logaH2O)
if(yaxis=="O2") y.reduction <- rep(logfO2, length.out=length(xpoints))
@@ -143,12 +143,12 @@
if('oxidation' %in% which) {
logfO2 <- logaH2O # usually 0
if(yaxis=="H2") {
- logK <- subcrt(c("H2O", "O2", "H2"), c(-1, 0.5, 1), c("liq", "gas", H2state), T=T, P=P, convert=FALSE)$out$logK
+ logK <- suppressMessages(subcrt(c("H2O", "O2", "H2"), c(-1, 0.5, 1), c("liq", "gas", H2state), T=T, P=P, convert=FALSE))$out$logK
# this is logfH2 if H2state=="gas", or logaH2 if H2state=="aq"
logfH2 <- logK - 0.5*logfO2 + logaH2O
y.oxidation <- rep(logfH2, length.out=length(xpoints))
} else {
- logK <- subcrt(c("O2", "O2"), c(-1, 1), c("gas", O2state), T=T, P=P, convert=FALSE)$out$logK
+ logK <- suppressMessages(subcrt(c("O2", "O2"), c(-1, 1), c("gas", O2state), T=T, P=P, convert=FALSE))$out$logK
# this is logfO2 if O2state=="gas", or logaO2 if O2state=="aq"
logfO2 <- logfO2 + logK
if(yaxis=="O2") y.oxidation <- rep(logfO2, length.out=length(xpoints))
Modified: pkg/CHNOSZ/R/util.units.R
===================================================================
--- pkg/CHNOSZ/R/util.units.R 2019-01-07 06:10:01 UTC (rev 352)
+++ pkg/CHNOSZ/R/util.units.R 2019-01-08 04:44:05 UTC (rev 353)
@@ -86,7 +86,7 @@
}
else if(units %in% c('e0','logfo2')) {
# convert between Eh and logfO2
- supcrt.out <- subcrt(c("H2O", "oxygen", "H+", "e-"), c(-1, 0.5, 2, 2), T=T, P=P, convert=FALSE)
+ supcrt.out <- suppressMessages(subcrt(c("H2O", "oxygen", "H+", "e-"), c(-1, 0.5, 2, 2), T=T, P=P, convert=FALSE))
if(units=='logfo2') value <- 2*(supcrt.out$out$logK + logaH2O + 2*pH + 2*(convert(value,'pe',T=T)))
if(units=='e0') value <- convert(( -supcrt.out$out$logK - 2*pH + value/2 - logaH2O )/2, 'Eh',T=T)
}
Modified: pkg/CHNOSZ/inst/NEWS
===================================================================
--- pkg/CHNOSZ/inst/NEWS 2019-01-07 06:10:01 UTC (rev 352)
+++ pkg/CHNOSZ/inst/NEWS 2019-01-08 04:44:05 UTC (rev 353)
@@ -1,4 +1,4 @@
-CHANGES IN CHNOSZ 1.1.3-60 (2019-01-07)
+CHANGES IN CHNOSZ 1.1.3-61 (2019-01-08)
---------------------------------------
NEW FEATURES
@@ -186,6 +186,8 @@
- The arguments in expr.species() have been reorganized for more
flexible and concise usage.
+- Reduce message clutter for diagrams showing water stability limits.
+
CHANGES IN CHNOSZ 1.1.3 (2017-11-13)
------------------------------------
From noreply at r-forge.r-project.org Tue Jan 15 05:03:20 2019
From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org)
Date: Tue, 15 Jan 2019 05:03:20 +0100 (CET)
Subject: [CHNOSZ-commits] r354 - in pkg/CHNOSZ: . data inst
inst/extdata/OBIGT vignettes
Message-ID: <20190115040320.462E618B1C0@r-forge.r-project.org>
Author: jedick
Date: 2019-01-15 05:03:19 +0100 (Tue, 15 Jan 2019)
New Revision: 354
Modified:
pkg/CHNOSZ/DESCRIPTION
pkg/CHNOSZ/data/refs.csv
pkg/CHNOSZ/inst/NEWS
pkg/CHNOSZ/inst/extdata/OBIGT/inorganic_cr.csv.xz
pkg/CHNOSZ/vignettes/obigt.bib
Log:
update GHS for celestite
Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION 2019-01-08 04:44:05 UTC (rev 353)
+++ pkg/CHNOSZ/DESCRIPTION 2019-01-15 04:03:19 UTC (rev 354)
@@ -1,6 +1,6 @@
-Date: 2019-01-08
+Date: 2019-01-15
Package: CHNOSZ
-Version: 1.1.3-61
+Version: 1.1.3-62
Title: Thermodynamic Calculations and Diagrams for Geo(bio)chemistry
Authors at R: c(
person("Jeffrey", "Dick", , "j3ffdick at gmail.com", role = c("aut", "cre"),
Modified: pkg/CHNOSZ/data/refs.csv
===================================================================
--- pkg/CHNOSZ/data/refs.csv 2019-01-08 04:44:05 UTC (rev 353)
+++ pkg/CHNOSZ/data/refs.csv 2019-01-15 04:03:19 UTC (rev 354)
@@ -8,6 +8,7 @@
FSR76,"M. J. Ferrante et al.",1976,"U. S. Bureau of Mines Report of Investigations 8129","dawsonite Cp (value at 25 °C as listed by @BPAH07; not present in spronsbl.dat)",http://www.worldcat.org/oclc/932914138
HDNB78,"H. C. Helgeson, J. M. Delany et al.",1978,"Am. J. Sci. 278A, 1-229","data for minerals and phase transitions",http://www.worldcat.org/oclc/13594862
HDNB78.1,"H. C. Helgeson, J. M. Delany et al.",1978,"Am. J. Sci. 278A, 1-229","litharge S, V, and Cp parameters",http://www.worldcat.org/oclc/13594862
+HDNB78.2,"H. C. Helgeson, J. M. Delany et al.",1978,"Am. J. Sci. 278A, 1-229","celestite V and Cp parameters",http://www.worldcat.org/oclc/13594862
RHF78,"R. A. Robie, B. S. Hemingway and J. R. Fisher",1978,"U. S. Geological Survey Bull. 1452","chlorargyrite",http://pubs.er.usgs.gov/publication/b1452
RHF78.1,"R. A. Robie, B. S. Hemingway and J. R. Fisher",1978,"U. S. Geological Survey Bull. 1452","dickite, fluorphlogopite, halloysite, and pyrope",http://pubs.er.usgs.gov/publication/b1452
RHF78.2,"R. A. Robie, B. S. Hemingway and J. R. Fisher",1978,"U. S. Geological Survey Bull. 1452",iron,http://pubs.er.usgs.gov/publication/b1452
@@ -20,6 +21,7 @@
BH83,"T. S. Bowers and H. C. Helgeson",1983,"Geochim. Cosmochim. Acta 47, 1247-1275",rutile,https://doi.org/10.1016/0016-7037(83)90066-2
Hel85,"H. C. Helgeson",1985,"Am. J. Sci. 285, 845-855","ferrosilite and siderite",https://doi.org/10.2475/ajs.285.9.845
JH85,"K. J. Jackson and H. C. Helgeson",1985,"Econ. Geol. 80, 1365-1378","Sn minerals",https://doi.org/10.2113/gsecongeo.80.5.1365
+RA87,"E. J. Reardon and D. K. Armstrong",1987,"Geochim. Cosmochim. Acta 51, 63-72","celestite GHS",https://doi.org/10.1016/0016-7037(87)90007-X
Ber88,"R. G. Berman",1988,"J. Petrol. 29, 445-522",minerals,https://doi.org/10.1093/petrology/29.2.445
SH88,"E. L. Shock and H. C. Helgeson",1988,"Geochim. Cosmochim. Acta 52, 2009-2036","ionic species",https://doi.org/10.1016/0016-7037(88)90181-0
SHS89,"E. L. Shock, H. C. Helgeson and D. A. Sverjensky",1989,"Geochim. Cosmochim. Acta 53, 2157-2183","inorganic neutral species",https://doi.org/10.1016/0016-7037(89)90341-4
Modified: pkg/CHNOSZ/inst/NEWS
===================================================================
--- pkg/CHNOSZ/inst/NEWS 2019-01-08 04:44:05 UTC (rev 353)
+++ pkg/CHNOSZ/inst/NEWS 2019-01-15 04:03:19 UTC (rev 354)
@@ -1,4 +1,4 @@
-CHANGES IN CHNOSZ 1.1.3-61 (2019-01-08)
+CHANGES IN CHNOSZ 1.1.3-62 (2019-01-15)
---------------------------------------
NEW FEATURES
@@ -92,6 +92,9 @@
H-succinate and succinate-2 for the -1 and -2 charged ions. Remove
duplicated entries for H-succinate and succinate-2 from biotic_aq.csv.
+- Update G, H, and S of celestite using properties of the dissolution
+ reaction given by Reardon and Armstrong, 1987.
+
DIAGRAMS
- Lines in 1-D diagram()s can optionally be drawn as splines using the
Modified: pkg/CHNOSZ/inst/extdata/OBIGT/inorganic_cr.csv.xz
===================================================================
--- pkg/CHNOSZ/inst/extdata/OBIGT/inorganic_cr.csv.xz 2019-01-08 04:44:05 UTC (rev 353)
+++ pkg/CHNOSZ/inst/extdata/OBIGT/inorganic_cr.csv.xz 2019-01-15 04:03:19 UTC (rev 354)
@@ -1,34 +1,36 @@
-?7zXZ ???F ! t/???.?)] 7I??b???9??????TB;q?"?q???cL;?"???b??g?;??K?????f??1?w?oz??C??a?]I????5i?* p0n?z??j???z?????b?U?e???=?AC????O7??k?J?????f??d??fm????pz?h????[??O??Z???????thH??k??s?3??3jn4L????J?6FP?nz?x???@??p?:??M?????$?x??!V?QrS??k??[7??o?C??????%k???????
+?7zXZ ???F ! t/???/ @] 7I??b???9??????TB;q?"?q???cL;?"???b??g?;??K?????f??1?w?oz??C??a?]I????5i?* p0n?z??j???z?????b?U?e???=?AC????O7??k?J?????f??d??fm????pz?h????[??O??Z???????thH??k??s?3??3jn4L????J?6FP?nz?x???@??p?:??M?????$?x??!V?QrS??k??[7??o?C??????%k???????
??#)??|?M?(s6{??%?Nf?r???????(?>??Q???7?.42&l{?3???a???Z?r??Xe??\Tz??\???S?"?u???*?}b
????????#=39x??'`Q\1J??s'Ar2
,?
?f*??V?V???qU?cs?a???0)?$???u???"???2??23?I?R.]Ge$}y?b?-???J??g~h?`|3??????*:??Y@?t??D??}?E?G???j??Z?$????
5Um?????F?~????#r??-???:?? m??[??i??(?.z|T
-jJ??/??!???J?&!??7>?(?4?k?].'Y&\?CrZ???Wn???^??? ??Q?q??n?? %i??F??.??%.??l??4?4
-7a,???;8S??)??2??:V?)s?u??x;???@???? xk???w??#/?n{b[?\|"?5zU\*??v?x??%????us??P??4??a}?]???m???{?
-?9??sp?,/??nF??>v??????za?d???0?).?A\?b??_??1Y?j??*a??J??s??2?Gk??e at 7???dk???s?h?GNs???8(I?`??????qzh??I?/;:?????<:?/?Q=?W?'?sC,??{2{U?)?0n\:????F???|n?nU?????3a????E&??$??????)K3?????xO????C?-???????????F??5?}0???:)?D?f??D????'?z???G???]?vSF??I4????K??#??n??k????"?????=nro??L=??-?? ?f???????s???Sg:#??>?????}g?n??\?3?l???z?)??)?f?
-?G{??I=?%???8\t?X\?????"???-s???k4Jx??2.?M??(??_??XX??
-?X'5??h?y????b