[CHNOSZ-commits] r515 - in pkg/CHNOSZ: . R inst

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Nov 11 15:50:15 CET 2019


Author: jedick
Date: 2019-11-11 15:50:14 +0100 (Mon, 11 Nov 2019)
New Revision: 515

Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/R/equilibrate.R
   pkg/CHNOSZ/R/mosaic.R
   pkg/CHNOSZ/inst/NEWS
Log:
mosaic(): set log activities of solids to zero


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2019-11-11 12:31:58 UTC (rev 514)
+++ pkg/CHNOSZ/DESCRIPTION	2019-11-11 14:50:14 UTC (rev 515)
@@ -1,6 +1,6 @@
 Date: 2019-11-11
 Package: CHNOSZ
-Version: 1.3.3-11
+Version: 1.3.3-12
 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/equilibrate.R
===================================================================
--- pkg/CHNOSZ/R/equilibrate.R	2019-11-11 12:31:58 UTC (rev 514)
+++ pkg/CHNOSZ/R/equilibrate.R	2019-11-11 14:50:14 UTC (rev 515)
@@ -37,7 +37,7 @@
   balance <- bout$balance
   ## if solids (cr) species are present, find them on a predominance diagram 20191111
   hascr <- any(grepl("cr", aout$species$state))
-  if(hascr) dout <- diagram(aout, balance = balance, normalize = normalize, as.residue = as.residue, plot.it = FALSE)
+  if(hascr) dout <- diagram(aout, balance = balance, normalize = normalize, as.residue = as.residue, plot.it = FALSE, limit.water = FALSE)
   ## take selected species in 'ispecies'
   if(length(ispecies)==0) stop("the length of ispecies is zero")
   if(is.logical(ispecies)) ispecies <- which(ispecies)

Modified: pkg/CHNOSZ/R/mosaic.R
===================================================================
--- pkg/CHNOSZ/R/mosaic.R	2019-11-11 12:31:58 UTC (rev 514)
+++ pkg/CHNOSZ/R/mosaic.R	2019-11-11 14:50:14 UTC (rev 515)
@@ -93,7 +93,12 @@
   message("mosaic: calculating affinities of species for all ", nrow(allbases), " combinations of the basis species")
   # run backwards so that we put the starting basis species back at the end
   for(i in nrow(allbases):1) {
-    put.basis(allbases[i, ], basis0$logact)
+    # use logact = 0 for solids 20191111
+    thislogact <- basis0$logact
+    states <- sout$species$state[match(allbases[i, ], sout$species$ispecies)]
+    icr <- grepl("cr", states)
+    thislogact[icr] <- 0
+    put.basis(allbases[i, ], thislogact)
     # we have to define the species using the current basis
     species(species0$ispecies, species0$logact)
     aff.species[[i]] <- suppressMessages(affinity(..., sout = sout))

Modified: pkg/CHNOSZ/inst/NEWS
===================================================================
--- pkg/CHNOSZ/inst/NEWS	2019-11-11 12:31:58 UTC (rev 514)
+++ pkg/CHNOSZ/inst/NEWS	2019-11-11 14:50:14 UTC (rev 515)
@@ -1,14 +1,16 @@
-CHANGES IN CHNOSZ 1.3.3-11 (2019-11-11)
+CHANGES IN CHNOSZ 1.3.3-12 (2019-11-11)
 ---------------------------------------
 
-- describe.reaction(): revert the change of using a double arrow. The
-  equals sign is much more portable.
+- describe.reaction(): remove the Unicode double arrow. A simple equals
+  sign is displayed correctly on all systems.
 
 - OBIGT: Change data for dawsonite, scheelite, and ferberite from
   calories to Joules (as originally reported).
 
 - OBIGT: Use correct Cp coefficients for ferberite (2nd term in equation
-  of Wood and Samson, 2000 is off by a factor of 10).
+  of Wood and Samson, 2000 is off by a factor of 10). Thanks to
+  Xiangchong Liu for the bug report and David Polya for data, and both
+  for helpful advice.
 
 - Fix bug in unexported function obigt2eos(): lambda (exponent in heat
   capacity equation) was incorrectly going through a units conversion.
@@ -23,18 +25,19 @@
 - Move some carbonates from SUPCRT92 back into default database:
   artinite, azurite.
 
-- subcrt(): properties of minerals are now returned at the upper T limit
-  (or transition temperature, for e.g. cr1 -> cr2). Previously,
+- subcrt(): properties of minerals are now output at the listed upper
+  T limit (or transition temperature, for e.g. cr1 -> cr2). Previously,
   properties were set to NA at (and not only above) the T limit.
 
 - mosaic(): set the activities of only aqueous basis species to the
   total activity (taken from the incoming basis() definition). This
   fixes a bug where activities of minerals (particularly, native sulfur)
-  were unexpectedly changed (their logact should be 0).
+  were unexpectedly changed; their logarithms are now set to 0. Thanks
+  to Evgeniy Bastrakov for the bug report.
 
 - Improve the handling of solids in equilibrate(). They are now excluded
   from the equilibrium calculation, but their stability fields are
-  calculated (using the maximum affinity method via diagram()). Where
+  calculated using the maximum affinity method (with diagram()). Where
   solids are stable, logarithms of activities of aqueous species are set
   to -999, and vice versa. Thanks to Feng Lai for the request and test
   case.



More information about the CHNOSZ-commits mailing list