From noreply at r-forge.r-project.org Wed Nov 1 05:17:03 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 1 Nov 2017 05:17:03 +0100 (CET) Subject: [CHNOSZ-commits] r274 - in pkg/CHNOSZ: . R inst man vignettes Message-ID: <20171101041703.67D63187269@r-forge.r-project.org> Author: jedick Date: 2017-11-01 05:17:02 +0100 (Wed, 01 Nov 2017) New Revision: 274 Modified: pkg/CHNOSZ/DESCRIPTION pkg/CHNOSZ/R/affinity.R pkg/CHNOSZ/R/diagram.R pkg/CHNOSZ/R/util.expression.R pkg/CHNOSZ/inst/NEWS pkg/CHNOSZ/man/diagram.Rd pkg/CHNOSZ/man/util.expression.Rd pkg/CHNOSZ/vignettes/anintro.Rmd Log: axis.label() etc.: add 'use.molality' argument; update and reorganize diagram.Rd Modified: pkg/CHNOSZ/DESCRIPTION =================================================================== --- pkg/CHNOSZ/DESCRIPTION 2017-10-31 14:46:29 UTC (rev 273) +++ pkg/CHNOSZ/DESCRIPTION 2017-11-01 04:17:02 UTC (rev 274) @@ -1,6 +1,6 @@ -Date: 2017-10-31 +Date: 2017-11-01 Package: CHNOSZ -Version: 1.1.0-72 +Version: 1.1.0-73 Title: Thermodynamic Calculations for Geobiochemistry Author: Jeffrey Dick Maintainer: Jeffrey Dick Modified: pkg/CHNOSZ/R/affinity.R =================================================================== --- pkg/CHNOSZ/R/affinity.R 2017-10-31 14:46:29 UTC (rev 273) +++ pkg/CHNOSZ/R/affinity.R 2017-11-01 04:17:02 UTC (rev 274) @@ -247,9 +247,12 @@ # content of return value depends on buffer request if(return.buffer) return(c(tb, list(vars=vars, vals=vals))) - a <- list(sout=sout, property=property, basis=mybasis, species=myspecies, T=T, P=P, vars=vars, vals=vals, values=a) + # add IS value only if it given as an argument 20171101 + # (even if its value is 0, the presence of IS will trigger diagram() to use "m" instead of "a" in axis labels) + iIS <- match("IS", names(args.orig)) + if(!is.na(iIS)) a <- list(sout=sout, property=property, basis=mybasis, species=myspecies, T=T, P=P, IS=args$IS, vars=vars, vals=vals, values=a) + else a <- list(sout=sout, property=property, basis=mybasis, species=myspecies, T=T, P=P, vars=vars, vals=vals, values=a) if(buffer) a <- c(a, list(buffer=tb)) return(a) - } Modified: pkg/CHNOSZ/R/diagram.R =================================================================== --- pkg/CHNOSZ/R/diagram.R 2017-10-31 14:46:29 UTC (rev 273) +++ pkg/CHNOSZ/R/diagram.R 2017-11-01 04:17:02 UTC (rev 274) @@ -5,6 +5,11 @@ # gather plotvals independently of plot parameters (including nd), # single return statement +## if this file is interactively sourced, the following are also needed to provide unexported functions: +#source("equilibrate.R") +#source("util.plot.R") +#source("util.character.R") + diagram <- function( # primary input eout, @@ -84,6 +89,9 @@ # length(dim(eout$values[[1]])) - nd=1 if it was a transect along multiple variables nd <- min(length(eout$vars), length(dim(eout$values[[1]]))) + ## use molality instead of activity if the affinity calculation include ionic strength 20171101 + use.molality <- "IS" %in% names(eout) + ## when can normalize and as.residue be used if(normalize | as.residue) { if(normalize & as.residue) stop("'normalize' and 'as.residue' can not both be TRUE") @@ -246,7 +254,7 @@ ### 0-D diagram - bar graph of properties of species or reactions # plot setup - if(missing(ylab)) ylab <- axis.label(plotvar, units="") + if(missing(ylab)) ylab <- axis.label(plotvar, units="", use.molality=use.molality) barplot(unlist(plotvals), names.arg=names, ylab=ylab, cex.names=cex.names, col=col, ...) if(!is.null(main)) title(main=main) @@ -256,9 +264,9 @@ xvalues <- eout$vals[[1]] # initialize the plot if(!add) { - if(missing(xlab)) xlab <- axis.label(eout$vars[1], basis=eout$basis) + if(missing(xlab)) xlab <- axis.label(eout$vars[1], basis=eout$basis, use.molality=use.molality) if(missing(xlim)) xlim <- range(xvalues) # TODO: this is backward if the vals are not increasing - if(missing(ylab)) ylab <- axis.label(plotvar, units="") + if(missing(ylab)) ylab <- axis.label(plotvar, units="", use.molality=use.molality) # to get range for y-axis, use only those points that are in the xrange if(is.null(ylim)) { isx <- xvalues >= min(xlim) & xvalues <= max(xlim) @@ -499,8 +507,8 @@ ylim <- c(ys[1], tail(ys, 1)) # initialize the plot if(!add) { - if(is.null(xlab)) xlab <- axis.label(eout$vars[1], basis=eout$basis) - if(is.null(ylab)) ylab <- axis.label(eout$vars[2], basis=eout$basis) + if(is.null(xlab)) xlab <- axis.label(eout$vars[1], basis=eout$basis, use.molality=use.molality) + if(is.null(ylab)) ylab <- axis.label(eout$vars[2], basis=eout$basis, use.molality=use.molality) if(tplot) thermo.plot.new(xlim=xlim, ylim=ylim, xlab=xlab, ylab=ylab, cex=cex, cex.axis=cex.axis, mar=mar, yline=yline, side=side, ...) else plot(0, 0, type="n", xlim=xlim, ylim=ylim, xlab=xlab, ylab=ylab, ...) Modified: pkg/CHNOSZ/R/util.expression.R =================================================================== --- pkg/CHNOSZ/R/util.expression.R 2017-10-31 14:46:29 UTC (rev 273) +++ pkg/CHNOSZ/R/util.expression.R 2017-11-01 04:17:02 UTC (rev 274) @@ -2,7 +2,7 @@ # write descriptions of chemical species, properties, reactions, conditions # modified from describe(), axis.label() 20120121 jmd -expr.species <- function(species, state="", log="", value=NULL, use.makeup=FALSE) { +expr.species <- function(species, state="", log="", value=NULL, use.makeup=FALSE, use.molality=FALSE) { # make plotting expressions for chemical formulas # that include subscripts, superscripts (if charged) # and optionally designations of states +/- loga or logf prefix @@ -54,8 +54,12 @@ else expr <- substitute(a[group('(',italic(b),')')],list(a=expr, b=state)) } # write logarithm of activity or fugacity + # (or molality 20171101) if(log != "") { - if(log %in% c("aq", "cr", "liq", "cr2", "cr3", "cr4")) acity <- "a" + if(log == "aq") { + if(use.molality) acity <- "m" + else acity <- "a" + } else if(log %in% c("cr", "liq", "cr2", "cr3", "cr4")) acity <- "a" else if(log %in% c("g", "gas")) acity <- "f" else stop(paste("'", log, "' is not a recognized state", sep="")) logacity <- substitute(log~italic(a), list(a=acity)) @@ -68,7 +72,7 @@ return(expr) } -expr.property <- function(property) { +expr.property <- function(property, use.molality=FALSE) { # a way to make expressions for various properties # e.g. expr.property('DG0r') for standard molal Gibbs # energy change of reaction @@ -77,7 +81,10 @@ # some special cases if(property=="logK") return(quote(log~italic(K))) # grepl here b/c diagram() uses "loga.equil" and "loga.basis" - if(grepl("loga", property)) return(quote(log~italic(a))) + if(grepl("loga", property)) { + if(use.molality) return(quote(log~italic(m))) + else return(quote(log~italic(a))) + } if(property=="alpha") return(quote(alpha)) if(property=="Eh") return("Eh") if(property=="pH") return("pH") @@ -149,7 +156,7 @@ return(expr) } -axis.label <- function(label, units=NULL, basis=get("thermo")$basis, prefix="") { +axis.label <- function(label, units=NULL, basis=get("thermo")$basis, prefix="", use.molality=FALSE) { # make a formatted axis label from a generic description # it can be a chemical property, condition, or chemical activity in the system # if the label matches one of the basis species @@ -161,11 +168,11 @@ # 20090215: the state this basis species is in state <- basis$state[match(label, rownames(basis))] # get the formatted label - desc <- expr.species(label, log=state) + desc <- expr.species(label, log=state, use.molality=use.molality) } else { # the label is for a chemical property or condition # make the label by putting a comma between the property and the units - property <- expr.property(label) + property <- expr.property(label, use.molality=use.molality) if(is.null(units)) units <- expr.units(label, prefix=prefix) # no comma needed if there are no units if(units=="") desc <- substitute(a, list(a=property)) Modified: pkg/CHNOSZ/inst/NEWS =================================================================== --- pkg/CHNOSZ/inst/NEWS 2017-10-31 14:46:29 UTC (rev 273) +++ pkg/CHNOSZ/inst/NEWS 2017-11-01 04:17:02 UTC (rev 274) @@ -1,4 +1,4 @@ -CHANGES IN CHNOSZ 1.1.0-70 (2017-10-30) +CHANGES IN CHNOSZ 1.1.0-73 (2017-11-01) --------------------------------------- MAJOR CHANGES: @@ -116,9 +116,34 @@ OTHER CHANGES: +- Add test-logmolality.R to demonstrate transformation of variables from + activity to molality in the main workflow; refer to this test and + describe these transformations in anintro.Rmd; remove "experimental" + labeling of activity coefficient calculations in CHNOSZ-package.Rd. + +- Add 'use.molality' argument to axis.label() and supporting functions. + So that the labels on diagrams are changed from activity (a) to + molality (m), this argument is set to TRUE by diagram() when IS is + supplied as an argument to affinity(). + +- Add demo TCA.R for standard Gibbs energies of steps of the + citric acid cycle (Canovas and Shock, 2016). + +- Components of subcrt() output indicating the stable polymorph of + minerals with phase transitions are now named 'polymorph', not + 'state'. + +- Add maxdiff() and expect_maxdiff() for calculating and testing the + maximum absolute pairwise difference between two objects. + expect_maxdiff() is used in tests/testthat/*.R as a more + straightforward alternative for checking differences than using + 'tolerance' in expect_equal(). + - Add 'tol' argument to equil.reaction() (convergence tolerance for uniroot()). +REFACTORING AND CLEANUP: + - In hkf() and cgl(), combine 'ghs' and 'eos' arguments into single argument named 'parameters'. @@ -133,23 +158,6 @@ - In water.* functions, rename the "diel" variable to "epsilon". -- Components of subcrt() output indicating the stable polymorph of - minerals with phase transitions are now named 'polymorph', not - 'state'. - -- Add maxdiff() and expect_maxdiff() for calculating and testing the - maximum absolute pairwise difference between two objects. - -- Add demo TCA.R for standard Gibbs energies of steps of the - citric acid cycle (Canovas and Shock, 2016). - -- Add test-logmolality.R to demonstrate transformation of variables from - activity to molality in the main workflow; refer to this test and - describe these transformations in anintro.Rmd; remove "experimental" - labeling of activity coefficient calculations in CHNOSZ-package.Rd. - -CLEANUP: - - To save space, taxid_names.csv has been trimmed to hold only those taxids listed in extdata/bison/gi.taxid.txt. Modified: pkg/CHNOSZ/man/diagram.Rd =================================================================== --- pkg/CHNOSZ/man/diagram.Rd 2017-10-31 14:46:29 UTC (rev 273) +++ pkg/CHNOSZ/man/diagram.Rd 2017-11-01 04:17:02 UTC (rev 274) @@ -79,16 +79,31 @@ 2-D diagrams, for two variables, are plotted as predominance fields. The allowed variables are any that \code{\link{affinity}} accepts: temperature, pressure, or the chemical activities of the basis species -If \code{alpha} is TRUE, the fractional degrees of formation (ratios of activities to total activity) are plotted. -Or, setting \code{alpha} to \samp{balance} allows the activities to be multiplied by the number of the balancing component; this is useful for making \dQuote{percent carbon} diagrams where the species differ in carbon number. If \code{groups} is supplied, the activities of the species identified in each numeric element of this list are multiplied by the balance coefficients of the species, then summed together. The names of the list are used to label the lines or fields for the summed activities of the resulting groups. +For all diagrams, the \code{names} of the species and their colors in \code{col.names} can be changed, as can \code{cex}, \code{cex.names}, and \code{cex.axis} to adjust the overall character expansion factors (see \code{\link{par}}) and those of the species names and axis labels. +The x- and y-axis labels are automatically generated unless they are supplied in \code{xlab} and \code{ylab}. +A new plot is started unless \code{add} is TRUE. +If \code{plot.it} is FALSE, no plot will be generated but all the intermediate computations will be performed and the results returned. + +\code{find.tp} finds the locations in a matrix of integers that are surrounded by the greatest number of different values. +The function counts the unique values in a 3x3 grid around each point and returns a matrix of indices (similar to \code{\link{which}(..., arr.ind = TRUE)}) for the maximum count (ties result in more than one pair of indices). +It can be used with the output from \code{diagram} for calculations in 2 dimensions to approximately locate the triple points on the diagram. + +} + +\section{1-D diagrams}{ For 1-D diagrams, the default setting for the y-axis is a logarithmic scale (unless \code{alpha} is TRUE) with limits corresponding to the range of logarithms of activities (or 0,1 if \code{alpha} is TRUE); these actions can be overridden by \code{ylog} and \code{ylim}. If \code{legend.x} is NA (the default), the lines are labeled with the names of the species near the maximum value. Otherwise, a \code{\link{legend}} is placed at the location identified by \code{legend.x}, or omitted if \code{legend.x} is NULL. + +If \code{alpha} is TRUE, the fractional degrees of formation (ratios of activities to total activity) are plotted. +Or, setting \code{alpha} to \samp{balance} allows the activities to be multiplied by the number of the balancing component; this is useful for making \dQuote{percent carbon} diagrams where the species differ in carbon number. The line type and line width can be controlled with \code{lty} and \code{lwd}, respectively. +} +\section{2-D diagrams}{ On 2-D diagrams, the fields represent the species with the highest equilibrium activity. \code{fill} determines the color of the predominance fields, \code{col} that of the boundary lines. By default, \code{\link{heat.colors}} are used to fill the predominance fields in diagrams on the screen plot device. @@ -97,8 +112,7 @@ \code{fill.NA} is also used to specify the color outside the water stability limits on Eh-pH or pe-pH diagrams, when \code{limit.water} is TRUE. Note that the default for \code{fill.NA} is automatically changed to \samp{transparent} when \code{add} is TRUE. -In CHNOSZ 1.1.0, a new default line-drawing procedure has been implemented. -This uses \code{\link{contour}} to draw smooth-looking diagonal and curved lines, at the expense of not coinciding exactly with the rectangular grid (which is still used for drawing colors). +The default line-drawing algorithm uses \code{\link{contour}} to draw smooth-looking diagonal and curved lines, at the expense of not coinciding exactly with the rectangular grid (which is still used for drawing colors). \code{lty}, \code{col}, and \code{lwd} can be specified, but limiting the lines via \code{xrange} is not currently supported. To go back to the old behavior for drawing lines, set \code{dotted} to \samp{0}. The old behavior does not follow \code{lty}; instead, the style of the boundary lines on 2-D diagrams can be altered by supplying one or more non-zero integers in \code{dotted}, which indicates the fraction of line segments to omit; a value of \samp{1} or NULL for \code{dotted} has the effect of not drawing the boundary lines. @@ -106,25 +120,28 @@ \code{normalize} and \code{as.residue} apply only to the 2-D diagrams, and only when \code{eout} is the output from \code{affinity}. With \code{normalize}, the activity boundaries are calculated as between the residues of the species (the species divided by the balance coefficients), then the activities are rescaled to the whole species formulas. With \code{as.residue}, the activity boundaries are calculated as between the residues of the species, and no rescaling is performed. +} -For all diagrams, the \code{names} of the species and their colors in \code{col.names} can be changed, as can \code{cex}, \code{cex.names}, and \code{cex.axis} to adjust the overall character expansion factors (see \code{\link{par}}) and those of the species names and axis labels. -The x- and y-axis labels are automatically generated unless they are supplied in \code{xlab} and \code{ylab}. -A new plot is started unless \code{add} is TRUE. -If \code{plot.it} is FALSE, no plot will be generated but all the intermediate computations will be performed and the results returned. +\section{Affinity Diagrams}{ +The function behaves differently when the output from \code{affinity} is being used instead of the equilibrium activities from \code{equilibrate}. +If \code{what} is missing, and the number of dimensions is 0 or 1, a property of a reaction, such as the equilibrium constant (\samp{logK}), is plotted. -\code{diagram} also accepts the output from \code{\link{affinity}}, for which three actions are possible: -1) plot a property of a reaction, such as the equilibrium constant (\samp{logK}) (0-D or 1-D); -2) plot the equilibrium activity of a selected basis species in all of the formation reactions (0-D, 1-D or 2-D); -3) plot predominance fields, based on the relative magnitudes of the affinities of the formation reactions (2-D only). +If \code{what} is missing, and the number of dimensions is 2, then highest potential (equilibrium predominance) fields are plotted. +This algorithm is based on comparing the relative magnitudes of the affinities of the formation reactions, also referred to as the maximum affinity method. +In this case, the balancing coefficients are determined usingi the \code{balance} argument. -Some of the arguments have different effects when the output from \code{affinity} is being used instead of the equilibrium activities from \code{equilibrate}. -If \code{what} is missing, option (1) is selected if the number of dimensions is 0 or 1, and option (3) is selected if the number of dimensions is 2. -The latter is referred to as the maximum affinity method. -In cases where it applies (see Warning), the maximum affinity method is much faster than an equilibrium calculation. -\code{balance} is the option that determines the balancing coefficients (this argument has no effect on the calculations of equilibrium activities.) -If \code{what} is the name of a basis species, it refers to option (2) above. +If \code{what} is the name of a basis species, it indicates to plot the equilibrium activity of a selected basis species in all of the formation reactions. A contour plot is made in the case of 2-D diagrams of the equilibrium activity of a basis species (see the \CO2-acetic acid example in \code{\link{buffer}}, and only the first species of interest is used in the calculation; a warning is produced if there is more than one. +} +\section{Activity Coefficients}{ +The wording in this page and names of variables in functions refer exclusively to \samp{activities} of aqueous species. +However, if activity coefficients are calculated (using the \code{IS} argument in \code{\link{affinity}}), then these variables are effectively transformed to molalities (see \code{tests/testthat/test-logmolality.R}). +So that the labels on diagrams are adjusted accordingly, \code{\link{diagram}} sets the \code{use.molality} argument of \code{\link{axis.label}} to TRUE if \code{IS} was supplied as an argument to \code{\link{affinity}}. +The labeling as molality takes effect even if \code{IS} is set to 0; this way, by including (or not) the \code{IS = 0} argument to \code{affinity}, the user decides whether to label aqueous species variables as molality (or activity) for calculations at zero ionic strength (where molality = activity). +} + +\section{Strip Diagrams}{ A different incarnation of 1-D speciation diagrams is provided by \code{strip}. This function generates any number of strip diagrams in a single plot. The diagrams are made up of colors bars whose heights represent the relative abundances of species; the color bars are arranged in order of abundance and the total height of the stack of colors bars is constant. @@ -135,25 +152,13 @@ \code{ymin} can be decreased in order to add more space at the bottom of the plot, and \code{xpad} can be changed in order to increase or decrease the size of the x-axis relative to the width of the strips. An inset dot-and-line plot is created below each strip if \code{ns} is given. This argument has the same format as \code{ispecies}, and can be used e.g. to display the relative numbers of species for comparison with the stability calculations. - -\code{find.tp} finds the locations in a matrix of integers that are surrounded by the greatest number of different values. -The function counts the unique values in a 3x3 grid around each point and returns a matrix of indices (similar to \code{\link{which}(..., arr.ind = TRUE)}) for the maximum count (ties result in more than one pair of indices). -It can be used with the output from \code{diagram} for calculations in 2 dimensions to approximately locate the triple points on the diagram. - } \value{ - For speciation diagrams, an \code{\link{invisible}} list of the chemical activities of the species, or their degrees of formation (if \code{alpha} is \code{TRUE}), at each point. For predominance diagrams, an invisible list with elements \code{species}, the dataframe describing the species, \code{out}, which species predominates at each grid point, and \code{A}, a list of the calculated values of the chemical affinity (per balanced quantity) (log10 dimensionless) at each point. +For speciation diagrams (1-D), an \code{\link{invisible}} list of the chemical activities of the species, or their degrees of formation (if \code{alpha} is \code{TRUE}), at each point. +For predominance diagrams (2-D), an invisible list with elements \code{species}, the dataframe describing the species, \code{out}, which species predominates at each grid point, and \code{A}, a list of the calculated values of the chemical affinity (per balanced quantity) (log10 dimensionless) at each point. } -\section{Warning}{ -The maximum affinity method is premised on the calculation of the affinities of formation reactions at equal activities of the species of interest. -Then, the species with the highest affinity of formation, after normalization by the balancing coefficients, corresponds to the predominant species in an equilibrium calculation. -The examples below \dQuote{work} because they are relatively simple - the balancing coefficients are unity or all the same value (aqueous aluminum example), or the species are solids with unit activities (the mineral examples). -The examples shown for \code{\link{protein}s} elsewhere also take the balancing coefficients to unity, after normalizing by protein length. -However, if aqueous species are present with different balancing coefficients, the maximum affinity method may produce unintended results. -} - \seealso{ Other examples are present in the help for \code{\link{protein}} and \code{\link{buffer}}, and even more can be found in \code{\link{demos}}. See the vignette \emph{Hot-spring proteins in CHNOSZ} for an example of the \code{strip} charts. Modified: pkg/CHNOSZ/man/util.expression.Rd =================================================================== --- pkg/CHNOSZ/man/util.expression.Rd 2017-10-31 14:46:29 UTC (rev 273) +++ pkg/CHNOSZ/man/util.expression.Rd 2017-11-01 04:17:02 UTC (rev 274) @@ -14,10 +14,12 @@ \description{Generate expressions suitable for axis labels and plot legends describing chemical species, properties and reactions.} \usage{ - expr.species(species, state = "", log = "", value=NULL, use.makeup=FALSE) - expr.property(property) + expr.species(species, state = "", log = "", value=NULL, use.makeup=FALSE, + use.molality = FALSE) + expr.property(property, use.molality = FALSE) expr.units(property, prefix = "", per = "mol") - axis.label(label, units = NULL, basis = get("thermo")$basis, prefix = "") + axis.label(label, units = NULL, basis = get("thermo")$basis, prefix = "", + use.molality = FALSE) describe.basis(basis = get("thermo")$basis, ibasis = 1:nrow(basis), digits = 1, oneline = FALSE) describe.property(property, value, digits = 0, oneline = FALSE, @@ -33,6 +35,7 @@ \item{log}{character, designation of physical state (for logarithm of activity or fugacity)} \item{value}{numeric, logarithm of activity or fugacity of species, or value of other property} \item{use.makeup}{logical, use \code{\link{makeup}} to count the elements?} + \item{use.molality}{logical, use molality (m) instead of activity (a) for aqueous species?} \item{property}{character, description of chemical property} \item{prefix}{character, prefix for units} \item{per}{character, denominator in units} @@ -92,7 +95,11 @@ If none of those characters appears in the property, the expression is an empty character (no units). If a \code{prefix} is given, it is added to the expression. The denominator of the units (default \samp{mol}) is taken from the \code{per} argument; it is applied to all units except for \samp{P}, \samp{T}, \samp{Eh}, and \samp{IS}. - \code{axis.label} accepts a generic description of a \code{label}. If this matches the chemical formula of one of the basis species in the \code{basis} argument, the expression for the label is generated using \code{expr.species} with \code{log} set to the physical state of the basis species. Otherwise, the expression is built by combining the output of \code{expr.property} with \code{expr.units} (or the value in \code{units}, if it is supplied), placing a comma between the two. This function is used extensively in \code{\link{diagram}} and also appears in many of the examples. +\code{axis.label} accepts a generic description of a \code{label}. +If this matches the chemical formula of one of the basis species in the \code{basis} argument, the expression for the label is generated using \code{expr.species} with \code{log} set to the physical state of the basis species. +Otherwise, the expression is built by combining the output of \code{expr.property} with \code{expr.units} (or the value in \code{units}, if it is supplied), placing a comma between the two. +This function is used extensively in \code{\link{diagram}} and also appears in many of the examples. +Note that \code{\link{diagram}} sets \code{use.molality} to TRUE if \code{IS} was supplied as an argument to \code{\link{affinity}}. \code{describe.basis} makes an expression summarizing the basis species definition (logarithms of activity or fugacity of the basis species) provided in \code{basis}; only the basis species identified by \code{ibasis} are included. Modified: pkg/CHNOSZ/vignettes/anintro.Rmd =================================================================== --- pkg/CHNOSZ/vignettes/anintro.Rmd 2017-10-31 14:46:29 UTC (rev 273) +++ pkg/CHNOSZ/vignettes/anintro.Rmd 2017-11-01 04:17:02 UTC (rev 274) @@ -1047,7 +1047,7 @@ # Activity coefficients -`nonideal()` uses the extended Debye--H?ckel equation as formulated by @HKF81 for NaCl-dominated solutions, or optionally using parameters described in Chapter 3 of @Alb03, to calculate activity coefficients of charged species. +For calculating activity coefficients of charged species, `nonideal()` uses the extended Debye--H?ckel equation as parameterized by @HKF81 for NaCl-dominated solutions to high pressure and temperature, or optionally using parameters described in Chapter 3 of @Alb03, which are applicable to relatively low-temperature biochemical reactions. The activity coefficients are calculated as a function of ionic strength (*I*), temperature, and charge of each species, without any other species-specific parameters. Using the default `Helgeson` method, the extended term parameter ("B-dot") is derived from data of @Hel69 and Helgeson et al. (1981), and extrapolations of @MSS13. @@ -1074,8 +1074,8 @@ In other words, the activation of activity coefficients effects a transformation from activity to molality in the main workflow. A simple but comprehensive series of calculations demonstrating these tranformations is in `tests/testthat/test-logmolality.R`. -Because it is not possible to dynamically change the names of arguments in the functions, the user should be aware of the effects mentioned above. -As another consequence, activities of basis species or equilibrium activities of species shown on diagrams should be relabeled as molalities when `IS` is used in the calculation of `affinity()`. +Because it is not possible to dynamically change the names of arguments in the functions, the user should be aware of the transformations mentioned above. +However, the labels on diagrams *can* be automatically adjusted; accordingly, activities of aqueous species are relabeled as molalities by `diagram()` when `IS` is used in the calculation of `affinity()`. ## Biochemical example From noreply at r-forge.r-project.org Wed Nov 1 15:13:48 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 1 Nov 2017 15:13:48 +0100 (CET) Subject: [CHNOSZ-commits] r275 - in pkg/CHNOSZ: . R man Message-ID: <20171101141348.36E2C18875C@r-forge.r-project.org> Author: jedick Date: 2017-11-01 15:13:47 +0100 (Wed, 01 Nov 2017) New Revision: 275 Modified: pkg/CHNOSZ/DESCRIPTION pkg/CHNOSZ/R/diagram.R pkg/CHNOSZ/R/util.expression.R pkg/CHNOSZ/man/CHNOSZ-package.Rd Log: clean up CHNOSZ-package.Rd Modified: pkg/CHNOSZ/DESCRIPTION =================================================================== --- pkg/CHNOSZ/DESCRIPTION 2017-11-01 04:17:02 UTC (rev 274) +++ pkg/CHNOSZ/DESCRIPTION 2017-11-01 14:13:47 UTC (rev 275) @@ -1,6 +1,6 @@ Date: 2017-11-01 Package: CHNOSZ -Version: 1.1.0-73 +Version: 1.1.0-74 Title: Thermodynamic Calculations for Geobiochemistry Author: Jeffrey Dick Maintainer: Jeffrey Dick Modified: pkg/CHNOSZ/R/diagram.R =================================================================== --- pkg/CHNOSZ/R/diagram.R 2017-11-01 04:17:02 UTC (rev 274) +++ pkg/CHNOSZ/R/diagram.R 2017-11-01 14:13:47 UTC (rev 275) @@ -284,13 +284,15 @@ if(is.na(legend.x)) { maxvals <- do.call(pmax, pv) dy <- rep(dy, length.out=length(plotvals)) + # don't assign to adj becuase that messes up the missing test below + alladj <- rep(adj, length.out=length(plotvals)) for(i in 1:length(plotvals)) { # y-values for this line myvals <- as.numeric(plotvals[[i]]) # don't take values that lie close to or above the top of plot myvals[myvals > ylim[1] + 0.95*diff(ylim)] <- ylim[1] # the starting x-adjustment - thisadj <- adj + thisadj <- alladj[i] # if this line has any of the overall maximum values, use only those values # (useful for labeling straight-line affinity comparisons 20170221) is.max <- myvals==maxvals Modified: pkg/CHNOSZ/R/util.expression.R =================================================================== --- pkg/CHNOSZ/R/util.expression.R 2017-11-01 04:17:02 UTC (rev 274) +++ pkg/CHNOSZ/R/util.expression.R 2017-11-01 14:13:47 UTC (rev 275) @@ -314,6 +314,12 @@ } if(grepl("-[0-9]?$", formula)) { fsplit <- strsplit(formula, "-")[[1]] + # for formula=="H-citrate-2", unsplit H-citrate + if(length(fsplit) > 2) { + f2 <- tail(fsplit, 1) + f1 <- paste(head(fsplit, -1), collapse="-") + fsplit <- c(f1, f2) + } if(is.na(fsplit[2])) Z <- -1 else Z <- -as.numeric(fsplit[2]) } formula <- fsplit[1] Modified: pkg/CHNOSZ/man/CHNOSZ-package.Rd =================================================================== --- pkg/CHNOSZ/man/CHNOSZ-package.Rd 2017-11-01 04:17:02 UTC (rev 274) +++ pkg/CHNOSZ/man/CHNOSZ-package.Rd 2017-11-01 14:13:47 UTC (rev 275) @@ -2,15 +2,23 @@ \name{CHNOSZ-package} \alias{CHNOSZ-package} \docType{package} -\title{Chemical Thermodynamics and Activity Diagrams} +\title{Thermodynamic Calculations for Geobiochemistry} \description{ CHNOSZ is a package for thermodynamic calculations, primarily with applications in geochemistry and compositional biology. It can be used to calculate the standard molal thermodynamic properties and chemical affinities of reactions relevant to geobiochemical processes, and to visualize the equilibrium activities of species on chemical speciation and predominance diagrams. } +\section{Warm Tips}{ + \itemize{ + \item Be sure to check out the vignette titled \emph{An Introduction to CHNOSZ}. Run \code{\link{help.start}()}, select \sQuote{Packages} then \sQuote{CHNOSZ} followed by \sQuote{User guides, package vignettes and other documentation}. + \item Running the examples from the help pages is a good way to become more familiar with the usage of the functions. After running \code{help.start()}, select \sQuote{Packages} then \sQuote{CHNOSZ} and then select a function of interest. Individual examples can be run by pasting the example block into the \R window. + \item Run the command \code{\link{examples}()} to run all of the examples provided in CHNOSZ. This should take about a minute. + \item Also try out \code{\link{demos}()} to run the demos (longer examples that are not part of the main help pages). + \item To learn how to update the thermodynamic database, look at \code{\link{add.obigt}}. + } +} + \section{Getting Help}{ -The major features of the package are outlined in the Overview given below, with links to specific help topics. -See the vignette \emph{An Introduction to CHNOSZ} (\code{anintro.Rmd}) for more in-depth example of the usage the functions. Each help page (other than this one) has been given one of the following \dQuote{concept index entries}: \itemize{ \item Main workflow: \code{\link{info}}, \code{\link{subcrt}}, \code{\link{basis}}, \code{\link{species}}, \code{\link{affinity}}, \code{\link{equilibrate}}, \code{\link{diagram}} @@ -30,70 +38,22 @@ All thermodynamic data and examples are provided on an as-is basis. It is up to you to check not only the accuracy of the data, but also the \emph{suitability of the data AND computational techniques} for your problem. By combining data taken from different sources, it is possible to build an inconsistent and/or nonsensical calculation. -An attempt has been made to provide a primary database (OBIGT) that is internally consistent, but no guarantee can be made. +An attempt has been made to provide a default database (OBIGT) that is internally consistent, but no guarantee can be made. If there is any doubt about the accuracy or suitability of data for a particular problem, please consult the primary sources (see \code{\link{thermo.refs}}). } -\section{Overview}{ - - Major features in CHNOSZ: - -\itemize{ - - \item Thermodynamic database - assembles literature values of the standard thermodynamic properties and equations of state parameters of minerals, aqueous organic and inorganic species, gases and liquids (\code{\link{thermo}}). - - \item Group additivity for proteins - estimate the standard thermodynamic properties and equations of state parameters for unfolded proteins from their amino acid composition; includes an additive calculation of ionization state of proteins as a function of temperature and pH (\code{\link{protein}}). - - \item File and internet access - read protein sequences from FASTA files, and download sequence information from UniProt (\code{\link{read.fasta}}, \code{\link{protein}}). - - \item Equations of state - calculate the standard thermodynamic properties of proteins or other species in the database, and reactions between them, as a function of temperature and pressure (\code{\link{hkf}}, \code{\link{cgl}}, \code{\link{subcrt}}). - - \item Stoichiometry - count elements in chemical formulas of species, check and optionally correct mass balance of chemical reactions (\code{\link{makeup}}). - - \item System of interest - define the basis species for a system together with one or more species of interest; compute the stoichiometries of the formation reactions of the species of interest (\code{\link{basis}}, \code{\link{species}}). - - \item Chemical affinity - calculate the chemical affinities of the formation reactions of the species of interest at a single point, or as a function of one or more of chemical activities of the basis species, temperature and/or pressure (\code{\link{affinity}}). - - \item Chemical activity - calculate the equilibrium activities of the species of interest as a function of the same variables used in the affinity calculation, using a reference state transformation (either the Boltzmann distribution or a reaction matrix approach). (\code{\link{diagram}}, \code{\link{equil.reaction}}, \code{\link{equil.boltzmann}}). - - \item Activity diagrams - plot the equilibrium activities at a single point (as barplots), or as a function of one (species activity diagrams) or two (predominance diagrams) variables (\code{\link{diagram}}). - - \item Buffer calculations - compute activities of basis species that are determined by a buffer of one or more species (e.g., pyrite-pyrrhotite-magnetite; acetic acid-\CO2) (\code{\link{buffer}}). - - \item Activity coefficients - calculate activity coefficients of aqueous species using the extended Debye-H?ckel equation (\code{\link{nonideal}}). - - \item Activity statistics (\bold{experimental}) - calculate summary statistics for equilibrium activities of species (\code{\link{revisit}}). - - \item Multidimensional optimization (\bold{experimental}) - using an iterative gridded optimization, find a combination of chemical activities of basis species, temperature and/or pressure that maximize or minimize the value of a target statistic (\code{\link{findit}}). - -} - - Here are some tips for new users: - - \itemize{ - \item Running the examples shown in the various help topics is a good way to become more familiar with the usage of the functions. From \code{\link{help.start}}, select \sQuote{Packages} then \sQuote{CHNOSZ} and then select a function of interest. Individual examples can be run by pasting the example block directly into the R console. - \item Type the command \code{\link{examples}()} to run all of the examples provided in CHNOSZ. This takes a few minutes depending on your system. If things go as expected, the entire set will run without any warnings or errors. - \item Also try out \code{\link{demos}()} to run the demos (longer examples that are not part of the main help pages). - \item To learn how to update the thermodynamic database, look at \code{\link{add.obigt}}. - } - -} - \section{Acknowledgements}{ - This package would not exist without the leadership and encouragement of Professor Harold C. Helgeson. - Hal and his students and collaborators are in some way responsible for many of the equations and data contained in this package. - A direct contribution of code is the file \code{H2O92D.f}, taken from the SUPCRT92 distribution, with minor modifications (masking of WRITE and STOP statements) made for compatibility with an \R environment and for allowing sub-zero degrees C calculations (keep valTP flag TRUE). - The revised Helgeson-Kirkham-Flowers equations of state are used in this package, together with the thermodynamic properties and parameters for many species taken from numerous papers coauthored by Helgeson. + This package would not exist without the encouragement and groudbreaking work of the late Professor Harold C. Helgeson. + The revised Helgeson-Kirkham-Flowers equations of state are used in this package, together with thermodynamic properties of minerals and aqueous species from many papers coauthored by Helgeson. + CHNOSZ uses Fortran code from \code{H2O92D.f} in the SUPCRT92 package (Johnson et al., 1992), with only minor modifications (masking of WRITE and STOP statements made for compatibility with the \R environment and keep \code{valTP} flag TRUE to permit sub-zero \degC calculations). - Work on this package at U.C. Berkeley from ~2003--2008 was supported by research grants to HCH from the U.S. National Science Foundation and Department of Energy. + Work on this package at U.C. Berkeley from ca. 2003 to 2008 was supported by research grants to HCH from the U.S. National Science Foundation and Department of Energy. In 2009--2011, development of this package was based upon work supported by the National Science Foundation under grant EAR-0847616. The files in \code{extdata/bison} are derived from BLAST calculations made on the Saguaro high performance computer at Arizona State University. } -\section{Known Bugs}{ - \code{\link{subcrt}} does not correctly identify the stable polymorph of some minerals at high temperature (see skarn example). - - The values generated by \code{\link{buffer}} may not be applied correctly by \code{\link{affinity}} in calculating the affinities of the formation reactions. (The values returned by \code{affinity(..., return.buffer=TRUE)} do appear to be correct in the examples). +\references{ +Johnson, J. W., Oelkers, E. H. and Helgeson, H. C. (1992) SUPCRT92: A software package for calculating the standard molal thermodynamic properties of minerals, gases, aqueous species, and reactions from 1 to 5000 bar and 0 to 1000\degC. \emph{Comp. Geosci.} \bold{18}, 899--947. \url{https://doi.org/10.1016/0098-3004(92)90029-Q} } \keyword{package} From noreply at r-forge.r-project.org Thu Nov 2 04:16:39 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 2 Nov 2017 04:16:39 +0100 (CET) Subject: [CHNOSZ-commits] r276 - in pkg/CHNOSZ: . vignettes Message-ID: <20171102031639.29486188C06@r-forge.r-project.org> Author: jedick Date: 2017-11-02 04:16:38 +0100 (Thu, 02 Nov 2017) New Revision: 276 Modified: pkg/CHNOSZ/DESCRIPTION pkg/CHNOSZ/vignettes/CHNOSZ.dia pkg/CHNOSZ/vignettes/CHNOSZ.png pkg/CHNOSZ/vignettes/anintro.Rmd Log: anintro.Rmd: update flowchart; add DEW to "Water" section Modified: pkg/CHNOSZ/DESCRIPTION =================================================================== --- pkg/CHNOSZ/DESCRIPTION 2017-11-01 14:13:47 UTC (rev 275) +++ pkg/CHNOSZ/DESCRIPTION 2017-11-02 03:16:38 UTC (rev 276) @@ -1,6 +1,6 @@ -Date: 2017-11-01 +Date: 2017-11-02 Package: CHNOSZ -Version: 1.1.0-74 +Version: 1.1.0-75 Title: Thermodynamic Calculations for Geobiochemistry Author: Jeffrey Dick Maintainer: Jeffrey Dick Modified: pkg/CHNOSZ/vignettes/CHNOSZ.dia =================================================================== (Binary files differ) Modified: pkg/CHNOSZ/vignettes/CHNOSZ.png =================================================================== (Binary files differ) Modified: pkg/CHNOSZ/vignettes/anintro.Rmd =================================================================== --- pkg/CHNOSZ/vignettes/anintro.Rmd 2017-11-01 14:13:47 UTC (rev 275) +++ pkg/CHNOSZ/vignettes/anintro.Rmd 2017-11-02 03:16:38 UTC (rev 276) @@ -2023,7 +2023,7 @@ See the [Numerical Tools from GEOPIG](http://geopig.asu.edu/?q=tools) for SUPCRT updates (slop files), including corrections that have not yet been ported to CHNOSZ. ``` -## Water: SUPCRT92 or IAPWS-95 +## Water: SUPCRT92 or IAPWS-95 or DEW For calculations of the thermodynamic and dielectric properties of liquid and supercritical H2O, CHNOSZ uses a Fortran subroutine (`H2O92`) from SUPCRT92 (Johnson et al., 1992). Alternatively, the IAPWS-95 formulation for thermodynamic properties [@WP02] can be utilized. @@ -2031,6 +2031,8 @@ However, the IAPWS-95 equations are useful for other applications, and may be extrapolated to a greater range of *T* and *P* than SUPCRT. See `?water` for more information, as well as the last example in `?subcrt`, where uncommenting the line for the `IAPWS95` option allows extrapolation to lower temperatures for supercooled water. +More recently (late 2017), an implementation of the [Deep Earth Water](http://www.dewcommunity.org/) (DEW) model was added; see [optional data](#optional-data) for more information. + # Messages and errors As you get started writing your own code and functions that use CHNOSZ, it is not uncommon to encounter problems. From noreply at r-forge.r-project.org Sun Nov 5 06:08:13 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 5 Nov 2017 06:08:13 +0100 (CET) Subject: [CHNOSZ-commits] r277 - in pkg/CHNOSZ: . demo man vignettes Message-ID: <20171105050813.5D334188F72@r-forge.r-project.org> Author: jedick Date: 2017-11-05 06:08:12 +0100 (Sun, 05 Nov 2017) New Revision: 277 Modified: pkg/CHNOSZ/DESCRIPTION pkg/CHNOSZ/demo/TCA.R pkg/CHNOSZ/man/IAPWS95.Rd pkg/CHNOSZ/vignettes/anintro.Rmd Log: demo/TCA.R: change equals signs to reaction arrrows Modified: pkg/CHNOSZ/DESCRIPTION =================================================================== --- pkg/CHNOSZ/DESCRIPTION 2017-11-02 03:16:38 UTC (rev 276) +++ pkg/CHNOSZ/DESCRIPTION 2017-11-05 05:08:12 UTC (rev 277) @@ -1,6 +1,6 @@ -Date: 2017-11-02 +Date: 2017-11-05 Package: CHNOSZ -Version: 1.1.0-75 +Version: 1.1.0-76 Title: Thermodynamic Calculations for Geobiochemistry Author: Jeffrey Dick Maintainer: Jeffrey Dick Modified: pkg/CHNOSZ/demo/TCA.R =================================================================== --- pkg/CHNOSZ/demo/TCA.R 2017-11-02 03:16:38 UTC (rev 276) +++ pkg/CHNOSZ/demo/TCA.R 2017-11-05 05:08:12 UTC (rev 277) @@ -50,20 +50,22 @@ fum <- quote(Fumarate^-2) h2 <- quote(H[2*(italic(aq))]) mal <- quote(Malate^-2) +# the reaction double arrow +eq <- "\u21cc" sublist <- list(oxal=oxal, pyr=pyr, h2o=h2o, nox=nox, cit=cit, nred=nred, co2=co2, hplus=hplus, aco=aco, iso=iso, ket=ket, adp=adp, - hpo4=hpo4, suc=suc, atp=atp, fum=fum, h2=h2, mal=mal) + hpo4=hpo4, suc=suc, atp=atp, fum=fum, h2=h2, mal=mal, eq=eq) # reaction titles rtitle <- list( - c(substitute(" "*oxal + pyr + h2o + nox == "", sublist), substitute(cit + nred + co2 + hplus, sublist)), - substitute(cit == aco + h2o, sublist), - substitute(aco + h2o == iso*" ", sublist), - c(substitute(iso + nox == "", sublist), substitute(ket + nred + co2*" ", sublist)), - c(substitute(ket + adp + hpo4 + nox == "", sublist), substitute(suc + atp + nred + co2, sublist)), - substitute(suc == fum + h2, sublist), - substitute(fum + h2o == mal, sublist), - c(substitute(mal + nox == " ", sublist), substitute(oxal + nred + hplus * " ", sublist)), - c(substitute(pyr + 4*nox + adp + hpo4 + 2*h2o == " ", sublist), + c(substitute(" "*oxal + pyr + h2o + nox ~eq~ "", sublist), substitute(cit + nred + co2 + hplus, sublist)), + substitute(cit ~eq~ aco + h2o, sublist), + substitute(aco + h2o ~eq~ iso*" ", sublist), + c(substitute(iso + nox ~eq~ " ", sublist), substitute(ket + nred + co2*" ", sublist)), + c(substitute(ket + adp + hpo4 + nox ~eq~ "", sublist), substitute(" "*suc + atp + nred + co2, sublist)), + c(substitute(suc ~eq~ "", sublist), substitute(fum + h2, sublist)), + substitute(fum + h2o ~eq~ mal, sublist), + c(substitute(mal + nox ~eq~ " ", sublist), substitute(oxal + nred + hplus * " ", sublist)), + c(substitute(pyr + 4*nox + adp + hpo4 + 2*h2o ~eq~ " ", sublist), substitute(3*co2 + 4*nred + 2*hplus + atp + h2 * " ", sublist)) ) # set up plot Modified: pkg/CHNOSZ/man/IAPWS95.Rd =================================================================== --- pkg/CHNOSZ/man/IAPWS95.Rd 2017-11-02 03:16:38 UTC (rev 276) +++ pkg/CHNOSZ/man/IAPWS95.Rd 2017-11-05 05:08:12 UTC (rev 277) @@ -39,7 +39,7 @@ \examples{ ## calculate pressure for given temperature, density -P <- as.numeric(IAPWS95("P", T=500, rho=838.0235)) +IAPWS95("P", T=500, rho=838.0235) } \references{ Modified: pkg/CHNOSZ/vignettes/anintro.Rmd =================================================================== --- pkg/CHNOSZ/vignettes/anintro.Rmd 2017-11-02 03:16:38 UTC (rev 276) +++ pkg/CHNOSZ/vignettes/anintro.Rmd 2017-11-05 05:08:12 UTC (rev 277) @@ -150,7 +150,8 @@ The major components of the package are shown in the figure below, which is an updated version of the diagram in @Dic08. Rectangles and ellipses represent functions and datasets; bold text indicates primary functions. -![Structure of CHNOSZ.](CHNOSZ.png) + +![Structure of CHNOSZ.](CHNOSZ.png){ width=75% } Many functions in CHNOSZ have no side effects. That is, the function only returns a result; to use the result elsewhere, it can be assigned to a variable with `<-`. @@ -177,12 +178,13 @@ The following pseudocode shows a common sequence of commands. In actual usage, the `...` are replaced by arguments that define the chemical species and variables: ```{r pseudocode, eval=FALSE} +data(thermo) ## initialize system settings basis(...) species(...) a <- affinity(...) e <- equilibrate(a) ## optional diagram(e) ## or diagram(a) -data(thermo) ## clear system settings +data(thermo) ## clear settings for next calculation ``` # The basics @@ -2031,7 +2033,7 @@ However, the IAPWS-95 equations are useful for other applications, and may be extrapolated to a greater range of *T* and *P* than SUPCRT. See `?water` for more information, as well as the last example in `?subcrt`, where uncommenting the line for the `IAPWS95` option allows extrapolation to lower temperatures for supercooled water. -More recently (late 2017), an implementation of the [Deep Earth Water](http://www.dewcommunity.org/) (DEW) model was added; see [optional data](#optional-data) for more information. +More recently (late 2017), an implementation of the [Deep Earth Water](http://www.dewcommunity.org/) (DEW) model was added; see [Optional data](#optional-data) for more information. # Messages and errors From noreply at r-forge.r-project.org Mon Nov 6 06:08:39 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 6 Nov 2017 06:08:39 +0100 (CET) Subject: [CHNOSZ-commits] r278 - in pkg/CHNOSZ: . R man tests/testthat vignettes Message-ID: <20171106050839.B2A73188827@r-forge.r-project.org> Author: jedick Date: 2017-11-06 06:08:38 +0100 (Mon, 06 Nov 2017) New Revision: 278 Modified: pkg/CHNOSZ/DESCRIPTION pkg/CHNOSZ/R/swap.basis.R pkg/CHNOSZ/man/nonideal.Rd pkg/CHNOSZ/man/subcrt.Rd pkg/CHNOSZ/tests/testthat/test-logmolality.R pkg/CHNOSZ/vignettes/anintro.Rmd pkg/CHNOSZ/vignettes/vig.bib Log: nomenclature: use "adjusted" (not "apparent") Gibbs energies at specified ionic strength Modified: pkg/CHNOSZ/DESCRIPTION =================================================================== --- pkg/CHNOSZ/DESCRIPTION 2017-11-05 05:08:12 UTC (rev 277) +++ pkg/CHNOSZ/DESCRIPTION 2017-11-06 05:08:38 UTC (rev 278) @@ -1,6 +1,6 @@ -Date: 2017-11-05 +Date: 2017-11-06 Package: CHNOSZ -Version: 1.1.0-76 +Version: 1.1.0-77 Title: Thermodynamic Calculations for Geobiochemistry Author: Jeffrey Dick Maintainer: Jeffrey Dick Modified: pkg/CHNOSZ/R/swap.basis.R =================================================================== --- pkg/CHNOSZ/R/swap.basis.R 2017-11-05 05:08:12 UTC (rev 277) +++ pkg/CHNOSZ/R/swap.basis.R 2017-11-06 05:08:38 UTC (rev 278) @@ -2,6 +2,9 @@ # functions related to swapping basis species # extracted from basis() 20120114 jmd +## if this file is interactively sourced, the following are also needed to provide unexported functions: +#source("basis.R") + # return the current basis elements basis.elements <- function(basis = get("thermo")$basis) { if(is.null(basis)) stop("basis species are not defined") @@ -14,7 +17,8 @@ basis.mat <- basis.elements(basis) # the standard Gibbs energies of the basis species # don't take it from thermo$obigt, even at 25 degC, because G for H2O is NA there - G <- unlist(subcrt(basis$ispecies, T=T, property="G")$out) + # the sapply(..., "[", 1) is needed to get the first value, in case subcrt appends a polymorph column (i.e. for S(cr)) 20171105 + G <- unlist(sapply(subcrt(basis$ispecies, T=T, property="G")$out, "[", 1)) # chemical potentials of the basis species species.mu <- G - convert(basis$logact, "G", T=convert(T, "K")) # chemical potentials of the elements @@ -36,7 +40,8 @@ if(any(is.na(ielem))) stop(paste("element(s)", paste(names(emu)[is.na(ielem)], collapse=" "), "not found in basis")) # the standard Gibbs energies of the basis species # don't take it from thermo$obigt, even at 25 degC, because G for H2O is NA there - G <- unlist(subcrt(basis$ispecies, T=T, property="G")$out) + # the sapply(..., "[", 1) is needed to get the first value, in case subcrt appends a polymorph column (i.e. for S(cr)) 20171105 + G <- unlist(sapply(subcrt(basis$ispecies, T=T, property="G")$out, "[", 1)) # the chemical potentials of the basis species in equilibrium # with the chemical potentials of the elements basis.mu <- colSums((t(basis.mat)*emu)) - G Modified: pkg/CHNOSZ/man/nonideal.Rd =================================================================== --- pkg/CHNOSZ/man/nonideal.Rd 2017-11-05 05:08:12 UTC (rev 277) +++ pkg/CHNOSZ/man/nonideal.Rd 2017-11-06 05:08:38 UTC (rev 278) @@ -4,7 +4,7 @@ \alias{Bdot} \title{Activity coefficients of aqueous species} \description{ -Calculate activity coefficients and apparent (non-ideal) molal properties of aqueous species. +Calculate activity coefficients and adjusted (non-ideal) molal properties of aqueous species. } \usage{ @@ -27,14 +27,14 @@ \details{ \code{nonideal} takes a list of dataframes (in \code{speciesprops}) containing the standard molal properties of the identified \code{species}. -The function calculates the *apparent* properties for given ionic strength (\code{IS}); they are equal to the *standard* values at IS=0. +The function calculates the *adjusted* properties for given ionic strength (\code{IS}); they are equal to the *standard* values at IS=0. The function bypasses (leaves unchanged) properties of all species whose charge (determined by the number of Z in their \code{\link{makeup}}) is equal to zero. The proton (\Hplus) and electron (\eminus) are also bypassed by default; this makes sense if you are setting the pH, i.e. activity of \Hplus, to some value. To apply the calculations to H+ and/or e-, change \code{\link{thermo}$opt$ideal.H} or \code{ideal.e} to FALSE. The lengths of \code{IS} and \code{T} supplied in the arguments should be equal to the number of rows of each dataframe in \code{speciesprops}, or length one to use single values throughout. -If \code{method} is \samp{Alberty}, the values of \code{IS} are combined with Alberty's (2003) equation 3.6-1 (extended Debye-H?ckel equation) and its derivatives, to calculate apparent molal properties at the specified ionic strength(s) and temperature(s). -The apparent molal properties that can be calculated include \samp{G}, \samp{H}, \samp{S} and \samp{Cp}; any columns in the dataframes of \code{speciesprops} with other names are left untouched. +If \code{method} is \samp{Alberty}, the values of \code{IS} are combined with Alberty's (2003) equation 3.6-1 (extended Debye-H?ckel equation) and its derivatives, to calculate adjusted molal properties at the specified ionic strength(s) and temperature(s). +The adjusted molal properties that can be calculated include \samp{G}, \samp{H}, \samp{S} and \samp{Cp}; any columns in the dataframes of \code{speciesprops} with other names are left untouched. If \code{method} is \samp{Helgeson}, the \dQuote{B-dot} equation is used. This equation seems to have been originally proposed by Huckel, 1925; parameters were derived for use at high temperature and pressure by Helgeson, 1969; Helgeson et al., 1981; Manning, 2013. @@ -42,7 +42,7 @@ In addition to \code{IS} and \code{T}, this method depends on values of \code{P}, \code{A_DH}, and \code{B_DH} given in the arguments. The calculation of \dQuote{B-dot}, also used in the equations, is made within \code{nonideal} by calling the \code{Bdot} function. For some uses, it is desirable to set the \dQuote{B-dot} parameter to zero; this can be done by setting the method to \code{Helgeson0}. -Currently, \samp{G} is the only apparent molal property that is calculated (but this can be used by \code{\link{subcrt}} to calculate apparent equilibrium constants). +Currently, \samp{G} is the only adjusted molal property that is calculated (but this can be used by \code{\link{subcrt}} to calculate adjusted equilibrium constants). \code{Bdot} calculates the \dQuote{B-dot} deviation function (Helgeson, 1969) a.k.a. extended term parameter (written as b_gamma; Helgeson et al., 1981) for activity coefficients in NaCl solutions at high temperature and pressure. Data at Psat and 0.5 to 5 kb are taken from Helgeson (1969, Table 2 and Figure 3) and Helgeson et al. (1981, Table 27) and extrapolated values at 10 to 30 kb from Manning et al. (2013, Figure 11). @@ -54,7 +54,7 @@ } \value{ -One (\samp{G}) or more (\samp{H}, \samp{S}, \samp{Cp}; currently only with the Alberty method) standard thermodynamic properties (at IS=0) in \code{speciesprops} are replaced by the corresponding apparent thermodynamic properties (at higher IS). +One (\samp{G}) or more (\samp{H}, \samp{S}, \samp{Cp}; currently only with the Alberty method) standard thermodynamic properties (at IS=0) in \code{speciesprops} are replaced by the corresponding adjusted thermodynamic properties (at higher IS). For all affected species, a column named \code{loggam} (common (base-10) logarithm of gamma, the activity coefficient) is appended to the output dataframe of species properties. } @@ -91,8 +91,8 @@ legend = as.expression(lapply(species, expr.species))) ## more often, the 'IS' argument of subcrt() is used to compute -## apparent properties at given ionic strength -# p. 16 Table 1.3: apparent pKa of acetic acid +## adjusted properties at given ionic strength +# p. 16 Table 1.3: adjusted pKa of acetic acid # set ideal.H to FALSE to calculate activity coefficients for the proton # (makes for better replication of the values in Alberty's book) thermo$opt$ideal.H <<- FALSE Modified: pkg/CHNOSZ/man/subcrt.Rd =================================================================== --- pkg/CHNOSZ/man/subcrt.Rd 2017-11-05 05:08:12 UTC (rev 277) +++ pkg/CHNOSZ/man/subcrt.Rd 2017-11-06 05:08:38 UTC (rev 278) @@ -26,7 +26,7 @@ \item{logact}{numeric, logarithms of activities of species in reaction} \item{convert}{logical, are input and output units of T and P those of the user (\code{TRUE}) (see \code{\link{T.units}}), or are they Kelvin and bar (\code{FALSE})?} \item{action.unbalanced}{character \samp{warn} or NULL, what action to take if unbalanced reaction is provided} - \item{IS}{numeric, ionic strength(s) at which to calculate apparent molal properties, mol kg\eqn{^{-1}}{^-1}} + \item{IS}{numeric, ionic strength(s) at which to calculate adjusted molal properties, mol kg\eqn{^{-1}}{^-1}} } \details{ @@ -76,10 +76,10 @@ Note that \code{\link{affinity}} provides related functionality but is geared toward the properties of formation reactions of species from the basis species and can be performed in more dimensions. Calculations of chemical affinity in \code{subcrt} can be performed for any reaction of interest; however, they are currently limited to constant values of the logarithms of activities of species in the reactions, and hence of \code{logQ}, across the computational range. -If \code{IS} is set to a single value other than zero, \code{\link{nonideal}} is used to calculate the apparent properties (\code{G}, \code{H}, \code{S} and \code{Cp}) of charged aqueous species at the given ionic strength. +If \code{IS} is set to a single value other than zero, \code{\link{nonideal}} is used to calculate the adjusted properties (\code{G}, \code{H}, \code{S} and \code{Cp}) of charged aqueous species at the given ionic strength. To perform calculations at a single \code{P} and \code{T} and for multiple values of ionic strength, supply these values in \code{IS}. Calculations can also be performed on a \code{P}-\code{IS}, \code{T}-\code{IS} or \code{P,T}-\code{IS} grid. -Values of \code{logK} of reactions calculated for \code{IS} not equal to zero are consistent with the apparent Gibbs energies of the charged aqueous species. +Values of \code{logK} of reactions calculated for \code{IS} not equal to zero are consistent with the adjusted Gibbs energies of the charged aqueous species. \code{subcrt} is modeled after the functionality of the \acronym{SUPCRT92} package (Johnson et al., 1992). Certain features of \acronym{SUPCRT92} are not available here, for example, calculations as a function of density of \H2O instead of pressure, or calculations of temperatures of univariant curves (i.e. for which \code{logK} is zero). Modified: pkg/CHNOSZ/tests/testthat/test-logmolality.R =================================================================== --- pkg/CHNOSZ/tests/testthat/test-logmolality.R 2017-11-05 05:08:12 UTC (rev 277) +++ pkg/CHNOSZ/tests/testthat/test-logmolality.R 2017-11-06 05:08:38 UTC (rev 278) @@ -23,11 +23,11 @@ out0 <- subcrt(c("H+", "HCO3-"), T=25)$out # and at IS = 1 out1 <- subcrt(c("H+", "HCO3-"), T=25, IS=1)$out - # the apparent standard Gibbs energy is less than the standard Gibbs energy + # the adjusted standard Gibbs energy is less than the standard Gibbs energy # by an amount determined by the activity coefficient expect_equal(out1[[2]]$G - out0[[2]]$G, -convert(loggam, "G")) - ## take-home message 0: setting IS in subcrt() gives apparent standard Gibbs energy + ## take-home message 0: setting IS in subcrt() gives adjusted standard Gibbs energy # now, what is the equilibrium constant for the reaction CO2 + H2O = H+ + HCO3-? # (this is the standard state property at IS=0) Modified: pkg/CHNOSZ/vignettes/anintro.Rmd =================================================================== --- pkg/CHNOSZ/vignettes/anintro.Rmd 2017-11-05 05:08:12 UTC (rev 277) +++ pkg/CHNOSZ/vignettes/anintro.Rmd 2017-11-06 05:08:38 UTC (rev 278) @@ -1061,7 +1061,7 @@ * H+ is assumed to behave ideally, so its activity coefficient is 1 for any ionic strength. You can calculate activity coefficients of H+ by setting `thermo$opt$ideal.H <<- FALSE`. -* Using `subcrt()` with `IS` not equal to zero, calculated values of `G` are the **apparent** standard Gibbs energy at specified ionic strength. +* Using `subcrt()` with `IS` not equal to zero, calculated values of `G` are the **adjusted** Gibbs energy at specified ionic strength [denoted by Δ*G*?(*I*); @Alb96]. * Using `subcrt()` with `IS` not equal to zero, values in the `logact` argument stand for **log molality** of aqueous species in affinity calculations. @@ -1093,7 +1093,7 @@ ``` The logarithms of the activity coefficients (`loggam`) are more negative for the higher-charged species, as well as at higher temperature, and have a stabilizing effect. -That is, the apparent Gibbs energies at *I* > 0 are less than the standard Gibbs energies at *I* = 0. +That is, the adjusted Gibbs energies at *I* > 0 are less than the standard Gibbs energies at *I* = 0. We can use these calculations to make some speciation plots, similar to Figures 1.2--1.5 in Alberty (2003). These figures show the distribution of differently charged species of adenosine triphosphate (ATP) as a function of pH, and the average number of H+ and Mg+2 bound to ATP in solution as a function of pH or pMg (-log*a*Mg+2). Modified: pkg/CHNOSZ/vignettes/vig.bib =================================================================== --- pkg/CHNOSZ/vignettes/vig.bib 2017-11-05 05:08:12 UTC (rev 277) +++ pkg/CHNOSZ/vignettes/vig.bib 2017-11-06 05:08:38 UTC (rev 278) @@ -225,25 +225,25 @@ } @Article{LH06a, - author = {LaRowe, Douglas E. and Helgeson, Harold C.}, - journal = {Geochimica et Cosmochimica Acta}, - title = {{B}iomolecules in hydrothermal systems: {C}alculation of the standard molal thermodynamic properties of nucleic-acid bases, nucleosides, and nucleotides at elevated temperatures and pressures}, - year = {2006}, - volume = {70}, - number = {18}, - pages = {4680--4724}, - doi = {10.1016/j.gca.2006.04.010}, + author = {LaRowe, Douglas E. and Helgeson, Harold C.}, + journal = {Geochimica et Cosmochimica Acta}, + title = {{B}iomolecules in hydrothermal systems: {C}alculation of the standard molal thermodynamic properties of nucleic-acid bases, nucleosides, and nucleotides at elevated temperatures and pressures}, + year = {2006}, + volume = {70}, + number = {18}, + pages = {4680--4724}, + doi = {10.1016/j.gca.2006.04.010}, } @Article{LH06b, - author = {LaRowe, Douglas E. and Helgeson, Harold C.}, - journal = {Thermochimica Acta}, - title = {{T}he energetics of metabolism in hydrothermal systems: {C}alculation of the standard molal thermodynamic properties of magnesium-complexed adenosine nucleotides and {NAD} and {NADP} at elevated temperatures and pressures}, - year = {2006}, - volume = {448}, - number = {2}, - pages = {82--106}, - doi = {10.1016/j.tca.2006.06.008}, + author = {LaRowe, Douglas E. and Helgeson, Harold C.}, + journal = {Thermochimica Acta}, + title = {{T}he energetics of metabolism in hydrothermal systems: {C}alculation of the standard molal thermodynamic properties of magnesium-complexed adenosine nucleotides and {NAD} and {NADP} at elevated temperatures and pressures}, + year = {2006}, + volume = {448}, + number = {2}, + pages = {82--106}, + doi = {10.1016/j.tca.2006.06.008}, } @Article{MSS13, @@ -631,24 +631,24 @@ } @Article{MD98, - author = {Merino, Enrique and Dewers, Thomas}, - journal = {Journal of Hydrology}, - title = {Implications of replacement for reaction?transport modeling}, - year = {1998}, - volume = {209}, - number = {1?4}, - pages = {137--146}, - doi = {10.1016/S0022-1694(98)00150-4}, - issn = {0022-1694}, + author = {Merino, Enrique and Dewers, Thomas}, + journal = {Journal of Hydrology}, + title = {{I}mplications of replacement for reaction?transport modeling}, + year = {1998}, + volume = {209}, + number = {1?4}, + pages = {137--146}, + doi = {10.1016/S0022-1694(98)00150-4}, + issn = {0022-1694}, } @TechReport{Wol92, - author = {Wolery, Thomas J.}, - title = {{EQ}3/6, a software package for geochemical modeling of aqueous systems: {P}ackage overview and installation guide (version 7.0)}, - institution = {Lawrence Livermore National Laboratory}, - year = {1992}, - number = {UCRL-MA-110662 PT I}, - doi = {10.2172/138894}, + author = {Wolery, Thomas J.}, + title = {{E}q3/6, {A} {S}oftware {P}ackage for {G}eochemical {M}odeling of {A}queous {S}ystems: {P}ackage {O}verview and {I}nstallation {G}uide ({V}ersion 7.0)}, + institution = {Lawrence Livermore National Laboratory}, + year = {1992}, + number = {UCRL-MA-110662 PT I}, + doi = {10.2172/138894}, } @Article{Ber88, @@ -713,3 +713,16 @@ size = {268 p.}, } + at Article{Alb96, + author = {Alberty, Robert A.}, + journal = {European Journal of Biochemistry}, + title = {{R}ecommendations for nomenclature and tables in biochemical thermodynamics}, + year = {1996}, + volume = {240}, + number = {1}, + pages = {1--14}, + doi = {10.1111/j.1432-1033.1996.0001h.x}, + issn = {1432-1033}, + publisher = {Blackwell Science Ltd}, +} + From noreply at r-forge.r-project.org Mon Nov 6 10:45:36 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 6 Nov 2017 10:45:36 +0100 (CET) Subject: [CHNOSZ-commits] r279 - in pkg/CHNOSZ: . inst src vignettes Message-ID: <20171106094536.BBAC518904C@r-forge.r-project.org> Author: jedick Date: 2017-11-06 10:45:36 +0100 (Mon, 06 Nov 2017) New Revision: 279 Modified: pkg/CHNOSZ/DESCRIPTION pkg/CHNOSZ/inst/CHECKLIST pkg/CHNOSZ/src/H2O92D.f pkg/CHNOSZ/vignettes/anintro.Rmd Log: H2O92D.f: fix obsolescent Fortran features identified with winbuilder for R-devel Modified: pkg/CHNOSZ/DESCRIPTION =================================================================== --- pkg/CHNOSZ/DESCRIPTION 2017-11-06 05:08:38 UTC (rev 278) +++ pkg/CHNOSZ/DESCRIPTION 2017-11-06 09:45:36 UTC (rev 279) @@ -1,6 +1,6 @@ Date: 2017-11-06 Package: CHNOSZ -Version: 1.1.0-77 +Version: 1.1.0-78 Title: Thermodynamic Calculations for Geobiochemistry Author: Jeffrey Dick Maintainer: Jeffrey Dick Modified: pkg/CHNOSZ/inst/CHECKLIST =================================================================== --- pkg/CHNOSZ/inst/CHECKLIST 2017-11-06 05:08:38 UTC (rev 278) +++ pkg/CHNOSZ/inst/CHECKLIST 2017-11-06 09:45:36 UTC (rev 279) @@ -2,13 +2,8 @@ release checklist for CHNOSZ **************************** -- uncomment CSL line in Rmd files (commented for building on R-Forge) - csl: elementa.csl - - compile vignettes with release version number and date -- anintro.Rmd: remove "This vignette depends on some features that are available only in the development version of CHNOSZ." - - run examples() and demos() to check their output - check output of demo("sources") to make sure all data sources are cited @@ -29,28 +24,21 @@ try both qpdf and ghostscript to compact vignettes: R CMD build --compact-vignettes=both chnosz/ +- check reverse dependencies: ecipex and canprot packages + OTHER THINGS TO CHECK: - remove all "<<-" from sources (leftover from debugging) - update list of documentation topics in examples() with any new ones -- especially on Windows: anim.*() produce pngs / movies (ImageMagick dependency)? - - check for stale URLs in Rd files - clean up all TODO, XXX, etc. in Rd files (and hopefully R files too) - update .Rinstignore with any new/deleted files -- ensure all Rd files have \keyword{...} or \concept{...} - - keywords used are standard R keywords: package, utilities - - concepts are as follows: - - Thermodynamic data (thermo, extdata) - - Primary thermodynamic modeling (commonly used functions e.g. subcrt) - - Secondary thermodynamic modeling (less often-used functions e.g. revisit) - - Extra thermodynamic modeling (out-of-workflow functions e.g. transfer) - - Protein thermodynamic modeling (protein-specific functions e.g. ionize.aa) +- ensure all Rd files have \concept{...} as listed in CHNOSZ-package.Rd - although Rd files could use the \doi macro, it generates a largish (ca. 265K) build/partial.rdb file; just use \url for now. Modified: pkg/CHNOSZ/src/H2O92D.f =================================================================== --- pkg/CHNOSZ/src/H2O92D.f 2017-11-06 05:08:38 UTC (rev 278) +++ pkg/CHNOSZ/src/H2O92D.f 2017-11-06 09:45:36 UTC (rev 279) @@ -693,8 +693,9 @@ CALL thmHGK(Dens(1),Temp) CALL dimHGK(isat,itripl,Temp,Pres,Dens(1),epseqn) ELSE - DO 10 i=1,NPROP - 10 wpliq(i) = wprops(i) + DO i=1,NPROP + wpliq(i) = wprops(i) + END DO CALL dimHGK(2,itripl,Temp,Pres,Dens(2),epseqn) END IF @@ -865,8 +866,9 @@ v(1) = 1.0d0 - DO 2 i=2,10 - 2 v(i) = v(i-1) * tz / t + DO i=2,10 + v(i) = v(i-1) * tz / t + END DO b1 = bp(1) + bp(2) * DLOG(1.0 / v(2)) b2 = bq(1) @@ -875,13 +877,14 @@ b1tt = 0.0d0 b2tt = 0.0d0 - DO 4 i=3,10 + DO i=3,10 b1 = b1 + bp(i) * v(i-1) b2 = b2 + bq(i) * v(i-1) b1t = b1t - (i-2) * bp(i) * v(i-1) / t b2t = b2t - (i-2) * bq(i) * v(i-1) / t b1tt = b1tt + bp(i) * (i-2)*(i-2) * v(i-1) / t / t - 4 b2tt = b2tt + bq(i) * (i-2)*(i-2) * v(i-1) / t / t + b2tt = b2tt + bq(i) * (i-2)*(i-2) * v(i-1) / t / t + END DO b1tt = b1tt - b1t / t b2tt = b2tt - b2t / t @@ -985,11 +988,12 @@ v = tz / t qt(1) = t / tz - DO 4 i=2,10 + DO i=2,10 qr(i+1) = qr(i) * q20 - 4 qt(i) = qt(i-1) * v + qt(i) = qt(i-1) * v + END DO - DO 10 i=1,n + DO i=1,n k = ii(i) + 1 l = jj(i) zz = k @@ -1006,7 +1010,8 @@ dpt = dfdt*q10*aa*k/q20 dadt = dadt + g(i)*dfdt dpdtr = dpdtr + g(i)*dpt - 10 cvr = cvr + g(i)*d2f/gascon + cvr = cvr + g(i)*d2f/gascon + END DO qp = 0.0d0 q2a = 0.0d0 @@ -1086,11 +1091,12 @@ hi = (c(2) + c(1)*(1.0d0 - tl)/tt) cpi = c(2) - c(1)/tt - DO 8 i=3,18 + DO i=3,18 emult = power(tt,DBLE(i-6)) gi = gi - c(i) * emult hi = hi + c(i) * (i-6) * emult - 8 cpi = cpi + c(i) * (i-6) * (i-5) * emult + cpi = cpi + c(i) * (i-6) * (i-5) * emult + END DO ai = gi - 1.0d0 ui = hi - 1.0d0 @@ -1446,11 +1452,12 @@ b = 0.0d0 c = 0.0d0 - DO 4 i=1,8 + DO i=1,8 z = i y = a(i) * power(w,(z + 1.0d0)/2.0d0) c = c + y/w*(0.5d0 - 0.5d0*z - 1.0d0/v) - 4 b = b + y + b = b + y + END DO q = b / v TdPsdT = 22.093d0 * DEXP(q) * c @@ -2705,8 +2712,9 @@ 4 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46 / - DO 10 i = 1,NPROP - 10 props(key(i,phase)) = ptemp(i) + DO i = 1,NPROP + props(key(i,phase)) = ptemp(i) + END DO RETURN END @@ -2842,20 +2850,22 @@ SAVE - GO TO (1,2,3,4), it + select case(it) - 1 TdegK = t - RETURN + case(1) + TdegK = t - 2 TdegK = t + 273.15d0 - RETURN + case(2) + TdegK = t + 273.15d0 - 3 TdegK = t / 1.8d0 - RETURN + case(3) + TdegK = t / 1.8d0 - 4 TdegK = (t + 459.67d0) / 1.8d0 - RETURN + case(4) + TdegK = (t + 459.67d0) / 1.8d0 + end select + END *********************************************************************** @@ -2870,20 +2880,22 @@ SAVE - GO TO (1,2,3,4), it + select case(it) - 1 TdegUS = t - RETURN + case(1) + TdegUS = t - 2 TdegUS = t - 273.15d0 - RETURN + case(2) + TdegUS = t - 273.15d0 - 3 TdegUS = t * 1.8d0 - RETURN + case(3) + TdegUS = t * 1.8d0 - 4 TdegUS = t * 1.8d0 - 459.67d0 - RETURN + case(4) + TdegUS = t * 1.8d0 - 459.67d0 + end select + END ********************************************************************* @@ -3122,14 +3134,17 @@ D = Dkgm3 / Dstar sum = 0.0d0 - DO 10 i=0,3 - 10 sum = sum + a(i+1)/T**i + DO i=0,3 + sum = sum + a(i+1)/T**i + END DO u0 = ustar * DSQRT(T) / sum sum = 0.0d0 - DO 20 i=0,5 - DO 20 j=0,6 - 20 sum = sum + b(i+1,j+1) * (1.0d0/T-1)**i * (D-1)**j + DO i=0,5 + DO j=0,6 + sum = sum + b(i+1,j+1) * (1.0d0/T-1)**i * (D-1)**j + END DO + END DO u1 = DEXP(D*sum) IF ((0.997d0 .LE. T) .AND. (T .LE. 1.0082d0) .AND. @@ -3210,25 +3225,31 @@ D = Dkgm3 / Dstar sum = 0.0d0 - DO 10 i=0,3 - 10 sum = sum + aL(i+1)/T**i + DO i=0,3 + sum = sum + aL(i+1)/T**i + END DO L0 = DSQRT(T) / sum sum = 0.0d0 - DO 20 i=0,4 - DO 20 j=0,5 - 20 sum = sum + bL(j+1,i+1) * (1.0d0/T-1)**i * (D-1)**j + DO i=0,4 + DO j=0,5 + sum = sum + bL(j+1,i+1) * (1.0d0/T-1)**i * (D-1)**j + END DO + END DO L1 = DEXP(D*sum) sum = 0.0d0 - DO 40 i=0,3 - 40 sum = sum + au(i+1)/T**i + DO i=0,3 + sum = sum + au(i+1)/T**i + END DO u0 = ustar * DSQRT(T) / sum sum = 0.0d0 - DO 50 i=0,5 - DO 50 j=0,4 - 50 sum = sum + bu(j+1,i+1) * (1.0d0/T-1)**i * (D-1)**j + DO i=0,5 + DO j=0,4 + sum = sum + bu(j+1,i+1) * (1.0d0/T-1)**i * (D-1)**j + END DO + END DO u1 = DEXP(D*sum) xt = Pstar/Dstar**2 * betaPa * Dkgm3**2 @@ -3423,22 +3444,26 @@ dc2dTT(5) = 6.0d0*a(8)*Tref**2/T**4 + 2.0d0*a(9)*Tref/T**3 eps = 0.0d0 - DO 50 k=1,5 - 50 eps = eps + c(k)*D**(k-1) + DO k=1,5 + eps = eps + c(k)*D**(k-1) + END DO dedP = 0.0d0 - DO 100 j = 0,4 - 100 dedP = dedP + j*c(j+1)*D**j + DO j = 0,4 + dedP = dedP + j*c(j+1)*D**j + END DO dedP = beta * dedP dedT = 0.0d0 - DO 200 j = 0,4 - 200 dedT = dedT + D**j*(dcdT(j+1) - j*alpha*c(j+1)) + DO j = 0,4 + dedT = dedT + D**j*(dcdT(j+1) - j*alpha*c(j+1)) + END DO d2edT2 = 0.0d0 - DO 300 j = 0,4 - 300 d2edT2 = d2edT2 + D**j*(dc2dTT(j+1) - j*(alpha*dcdT(j+1) + + DO j = 0,4 + d2edT2 = d2edT2 + D**j*(dc2dTT(j+1) - j*(alpha*dcdT(j+1) + 1 c(j+1)*daldT) - j*alpha*(dcdT(j+1) - j*alpha*c(j+1))) + END DO END Modified: pkg/CHNOSZ/vignettes/anintro.Rmd =================================================================== --- pkg/CHNOSZ/vignettes/anintro.Rmd 2017-11-06 05:08:38 UTC (rev 278) +++ pkg/CHNOSZ/vignettes/anintro.Rmd 2017-11-06 09:45:36 UTC (rev 279) @@ -20,9 +20,9 @@ \usepackage[utf8]{inputenc} bibliography: vig.bib link-citations: yes -# The custom CSL file gives a build error on R-Forge (20170212): -# pandoc-citeproc: error while parsing the XML string csl: elementa.csl +# note: this may be needed for margin references in next version of tufte: +#tufte_features: ["background", "margin_references"] --- ```{r options, include=FALSE} @@ -116,7 +116,6 @@ After starting R, install CHNOSZ by selecting the "Install packages from CRAN" or similar menu item in the R GUI or by using the following command: ```{marginfigure} Or, install the package from a package file, which you can download from [CRAN](https://cran.r-project.org/package=CHNOSZ) or (for the development version) from [R-Forge](https://r-forge.r-project.org/projects/chnosz/). -This vignette depends on some features that are available only in the development version of CHNOSZ. ``` ```{r install_CHNOSZ, eval=FALSE} install.packages("CHNOSZ") @@ -142,7 +141,11 @@ There are also links to the *demos* (longer examples) and *vignettes* (more in-depth documentation; this document is a vignette). Suggestions for accessing the documentation are indicated here with blue text. -For example, read `?"CHNOSZ-package"` to get an overview of the package and a list of features. +For example, read ``?`CHNOSZ-package` `` to get an overview of the package and a list of features. +```{marginfigure} +"`?`" is a shortcut to R's `help()` function. +The command here is equivalent to `help("CHNOSZ-package")`. +``` ## Organization of major functions @@ -157,7 +160,8 @@ That is, the function only returns a result; to use the result elsewhere, it can be assigned to a variable with `<-`. In this document, the names of these functions are set in green text (not applicable to the code chunks). ```{marginfigure} -When they are mentioned, names of functions in the base and recommended packages of R are said to belong to R. Example: Use R's `plot()` to plot the data. +When they are mentioned, names of functions in the base and recommended packages of R are said to belong to R. +Example: Use R's `plot()` to plot the data. ``` Major functions without side effects in CHNOSZ are: @@ -2039,7 +2043,6 @@ As you get started writing your own code and functions that use CHNOSZ, it is not uncommon to encounter problems. For example, mixing data types can cause problems (the important difference between factor and character was mentioned [above](#adding-data)). -There are many tricks to learn; becoming familiar with functions like R's `lapply()`, `rbind()`, and `do.call()` will make your programming life more productive and enjoyable. Some functions in CHNOSZ perform "sanity checks" on the arguments and will report errors if an inconsistency is detected. For example, unequal lengths of variables in the transect mode of `affinity()` (when the variables have more than 3 values) cause an error: From noreply at r-forge.r-project.org Tue Nov 7 17:08:39 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 7 Nov 2017 17:08:39 +0100 (CET) Subject: [CHNOSZ-commits] r280 - in pkg/CHNOSZ: . R man Message-ID: <20171107160839.DE188189667@r-forge.r-project.org> Author: jedick Date: 2017-11-07 17:08:39 +0100 (Tue, 07 Nov 2017) New Revision: 280 Modified: pkg/CHNOSZ/DESCRIPTION pkg/CHNOSZ/R/nonideal.R pkg/CHNOSZ/man/diagram.Rd pkg/CHNOSZ/man/nonideal.Rd pkg/CHNOSZ/man/objective.Rd pkg/CHNOSZ/man/protein.Rd pkg/CHNOSZ/man/revisit.Rd pkg/CHNOSZ/man/util.expression.Rd Log: complete/capitalize example plot titles Modified: pkg/CHNOSZ/DESCRIPTION =================================================================== --- pkg/CHNOSZ/DESCRIPTION 2017-11-06 09:45:36 UTC (rev 279) +++ pkg/CHNOSZ/DESCRIPTION 2017-11-07 16:08:39 UTC (rev 280) @@ -1,6 +1,6 @@ -Date: 2017-11-06 +Date: 2017-11-07 Package: CHNOSZ -Version: 1.1.0-78 +Version: 1.1.0-79 Title: Thermodynamic Calculations for Geobiochemistry Author: Jeffrey Dick Maintainer: Jeffrey Dick Modified: pkg/CHNOSZ/R/nonideal.R =================================================================== --- pkg/CHNOSZ/R/nonideal.R 2017-11-06 09:45:36 UTC (rev 279) +++ pkg/CHNOSZ/R/nonideal.R 2017-11-07 16:08:39 UTC (rev 280) @@ -224,7 +224,7 @@ } # show points and spline(T) curves if(showsplines == "T") { - thermo.plot.new(c(0, 1000), c(-.2, .7), xlab=axis.label("T"), ylab=expression(b[gamma])) + thermo.plot.new(c(0, 1000), c(-.2, .7), xlab=axis.label("T"), ylab=expression(italic(b)[gamma])) points(T0, B0, pch=0) points(T0.5, B0.5, pch=1) points(T1, B1, pch=1) @@ -261,8 +261,9 @@ legend=c("Helgeson, 1969", "Helgeson et al., 1981", "Manning et al., 2013", "spline control point", "high-P extrapolation")) legend("bottomright", col=c(NA, rev(col)), lty=1, legend=c("kbar", "60", "50", "40", "30", "20", "10", "5", "4", "3", "2", "1", "0.5", "Psat")) + title(main=expression("Deybe-H\u00FCckel "*italic(b)[gamma]*" ('B-dot') parameter")) } else if(showsplines=="P") { - thermo.plot.new(c(0, 5), c(-.2, .7), xlab="log P(bar)", ylab=expression(b[gamma])) + thermo.plot.new(c(0, 5), c(-.2, .7), xlab=expression(log~italic(P)*"(bar)"), ylab=expression(italic(b)[gamma])) # pressures that are used to make the isothermal splines (see below) P25 <- c(1, 500, 1000, 2000, 3000, 4000, 5000) P100 <- c(1, 500, 1000, 2000, 3000, 4000, 5000, 10000, 20000) @@ -302,6 +303,7 @@ P <- seq(10000, 60000, 50); lines(log10(P), Bdot(1000, P), col=col[11]) legend("topleft", col=c(NA, col), lty=1, legend=c("degrees C", 25, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000)) legend("bottomright", pch=1, legend="points from iso-P splines") + title(main=expression("Deybe-H\u00FCckel "*italic(b)[gamma]*" ('B-dot') parameter")) } else { # make T and P the same length ncond <- max(length(T), length(P)) Modified: pkg/CHNOSZ/man/diagram.Rd =================================================================== --- pkg/CHNOSZ/man/diagram.Rd 2017-11-06 09:45:36 UTC (rev 279) +++ pkg/CHNOSZ/man/diagram.Rd 2017-11-07 16:08:39 UTC (rev 280) @@ -172,7 +172,7 @@ species(c("ethanol", "lactic acid", "deoxyribose", "ribose")) a <- affinity(T=c(0, 150)) diagram(a, what="O2", legend.x="topleft", col=rev(rainbow(4)), lwd=2) -title(main="equilibrium logfO2 for 1e-3 mol/kg of CO2 and ... ") +title(main="Equilibrium logfO2 for 1e-3 mol/kg of CO2 and ... ") ### 1-D diagrams: logarithms of activities Modified: pkg/CHNOSZ/man/nonideal.Rd =================================================================== --- pkg/CHNOSZ/man/nonideal.Rd 2017-11-06 09:45:36 UTC (rev 279) +++ pkg/CHNOSZ/man/nonideal.Rd 2017-11-07 16:08:39 UTC (rev 280) @@ -82,7 +82,7 @@ nonidealprops <- nonideal(species, speciesprops, IS = IS, T = convert(T[j], "K")) for(i in 1:4) lines(IS, 10^(nonidealprops[[i]]$loggam), lty=lty[j], col=col[i]) } -t1 <- "activity coefficient (gamma) of -1,-2,-3,-4 charged species" +t1 <- "Activity coefficient (gamma) of -1,-2,-3,-4 charged species" t2 <- quote("at 0, 25, and 40 "*degree*"C, after Alberty, 2003") mtitle(as.expression(c(t1, t2))) legend("topright", lty=c(NA, 1:3), bty="n", Modified: pkg/CHNOSZ/man/objective.Rd =================================================================== --- pkg/CHNOSZ/man/objective.Rd 2017-11-06 09:45:36 UTC (rev 279) +++ pkg/CHNOSZ/man/objective.Rd 2017-11-07 16:08:39 UTC (rev 280) @@ -121,7 +121,7 @@ lines(a$vals[[1]], DGtr.out) text(-6, 5.5, expr.property("DDGmix/2.303RT")) text(-6, 2.3, expr.property("DGtr/2.303RT")) -title(main=paste("transformation between metastable equilibrium\n", +title(main=paste("Transformation between metastable equilibrium\n", "assemblages of n-alkanes")) # take-home message: use DGtr to measure distance from equilibrium in # open-system transformations (constant T, P, chemical potentials of basis species) Modified: pkg/CHNOSZ/man/protein.Rd =================================================================== --- pkg/CHNOSZ/man/protein.Rd 2017-11-06 09:45:36 UTC (rev 279) +++ pkg/CHNOSZ/man/protein.Rd 2017-11-07 16:08:39 UTC (rev 280) @@ -25,6 +25,7 @@ ip <- add.protein(aa) a <- affinity(pH=c(0, 14), O2=c(-64, -61), T=75, iprotein=ip) diagram(a) +title(main="Sequences for transferase at Bison Pool") ## surface-layer proteins from Methanococcus and others ## as a function of oxygen fugacity, after Dick, 2008, Fig. 5b Modified: pkg/CHNOSZ/man/revisit.Rd =================================================================== --- pkg/CHNOSZ/man/revisit.Rd 2017-11-06 09:45:36 UTC (rev 279) +++ pkg/CHNOSZ/man/revisit.Rd 2017-11-07 16:08:39 UTC (rev 280) @@ -99,13 +99,13 @@ e <- equilibrate(a) # make a plot r <- revisit(e, "count", -5) -title(main="amino acids with metastable log activities > -5") +title(main="Amino acids with metastable log activities > -5") # can also make a 2-D plot a <- affinity(O2=c(-74, -60, 25), H2O=c(-3, 3, 25)) e <- equilibrate(a) r <- revisit(e, "count", -5, style.2D="image", plot.optval=FALSE) -title(main="amino acids with metastable log activities > -5") +title(main="Amino acids with metastable log activities > -5") ## 'revisit' calculations for amino acids opar <- par(mfrow=c(2, 2)) Modified: pkg/CHNOSZ/man/util.expression.Rd =================================================================== --- pkg/CHNOSZ/man/util.expression.Rd 2017-11-06 09:45:36 UTC (rev 279) +++ pkg/CHNOSZ/man/util.expression.Rd 2017-11-07 16:08:39 UTC (rev 280) @@ -162,6 +162,7 @@ text(3, 4.25, describe.reaction(reaction)) text(3, 4.5, describe.reaction(reaction, states="all")) text(3, 4.75, describe.reaction(reaction, iname=1:4)) +title(main="Plot labels for chemical species and thermodynamic properties") } \concept{Utility functions} From noreply at r-forge.r-project.org Wed Nov 8 16:43:12 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 8 Nov 2017 16:43:12 +0100 (CET) Subject: [CHNOSZ-commits] r281 - in pkg/CHNOSZ: . R data inst inst/extdata/Berman inst/extdata/OBIGT inst/extdata/thermo man tests/testthat vignettes Message-ID: <20171108154312.DAA351801E7@r-forge.r-project.org> Author: jedick Date: 2017-11-08 16:43:12 +0100 (Wed, 08 Nov 2017) New Revision: 281 Added: pkg/CHNOSZ/inst/extdata/Berman/DS10.csv Modified: pkg/CHNOSZ/DESCRIPTION pkg/CHNOSZ/R/berman.R pkg/CHNOSZ/R/util.data.R pkg/CHNOSZ/data/refs.csv pkg/CHNOSZ/inst/NEWS pkg/CHNOSZ/inst/extdata/OBIGT/Berman_cr.csv.xz pkg/CHNOSZ/inst/extdata/thermo/obigt_check.csv pkg/CHNOSZ/man/extdata.Rd pkg/CHNOSZ/tests/testthat/test-berman.R pkg/CHNOSZ/vignettes/obigt.bib Log: add extdata/Berman/DS10.csv: ilvaite and other minerals from Delgado Mart?\195?\173n and Soler i Gil, 2010 Modified: pkg/CHNOSZ/DESCRIPTION =================================================================== --- pkg/CHNOSZ/DESCRIPTION 2017-11-07 16:08:39 UTC (rev 280) +++ pkg/CHNOSZ/DESCRIPTION 2017-11-08 15:43:12 UTC (rev 281) @@ -1,6 +1,6 @@ -Date: 2017-11-07 +Date: 2017-11-08 Package: CHNOSZ -Version: 1.1.0-79 +Version: 1.1.0-80 Title: Thermodynamic Calculations for Geobiochemistry Author: Jeffrey Dick Maintainer: Jeffrey Dick Modified: pkg/CHNOSZ/R/berman.R =================================================================== --- pkg/CHNOSZ/R/berman.R 2017-11-07 16:08:39 UTC (rev 280) +++ pkg/CHNOSZ/R/berman.R 2017-11-08 15:43:12 UTC (rev 281) @@ -19,10 +19,11 @@ SHD91 <- read.csv(paste0(dir, "/SHD91.csv"), as.is=TRUE) ZS92 <- read.csv(paste0(dir, "/ZS92.csv"), as.is=TRUE) JUN92 <- read.csv(paste0(dir, "/JUN92.csv"), as.is=TRUE) + DS10 <- read.csv(paste0(dir, "/DS10.csv"), as.is=TRUE) FDM14 <- read.csv(paste0(dir, "/FDM+14.csv"), as.is=TRUE) BDat17 <- read.csv(paste0(dir, "/BDat17.csv"), as.is=TRUE) # assemble the files in reverse chronological order - dat <- rbind(BDat17, FDM14, JUN92, ZS92, SHD91, Ber90, Ber88) + dat <- rbind(BDat17, FDM14, DS10, JUN92, ZS92, SHD91, Ber90, Ber88) # remove duplicates (only the first, i.e. latest entry is kept) dat <- dat[!duplicated(dat$name), ] # remove the multipliers Modified: pkg/CHNOSZ/R/util.data.R =================================================================== --- pkg/CHNOSZ/R/util.data.R 2017-11-07 16:08:39 UTC (rev 280) +++ pkg/CHNOSZ/R/util.data.R 2017-11-08 15:43:12 UTC (rev 281) @@ -253,13 +253,15 @@ # 20110808 jmd replaces 'check=TRUE' argument of info() checkfun <- function(what) { # looking at thermo$obigt - if(what=="OBIGT") to <- get("thermo")$obigt - ntot <- nrow(to) + if(what=="OBIGT") tdata <- get("thermo")$obigt + else if(what=="DEW") tdata <- read.csv(system.file("extdata/OBIGT/DEW_aq.csv", package="CHNOSZ"), as.is=TRUE) + else if(what=="SUPCRTBL") tdata <- read.csv(system.file("extdata/OBIGT/SUPCRTBL.csv", package="CHNOSZ"), as.is=TRUE) + ntot <- nrow(tdata) # where to keep the results DCp <- DV <- DG <- rep(NA,ntot) # first get the aqueous species - isaq <- to$state=="aq" - eos.aq <- obigt2eos(to[isaq,],"aq") + isaq <- tdata$state=="aq" + eos.aq <- obigt2eos(tdata[isaq,],"aq") DCp.aq <- checkEOS(eos.aq,"aq","Cp",ret.diff=TRUE) DV.aq <- checkEOS(eos.aq,"aq","V",ret.diff=TRUE) cat(paste("check.obigt: GHS for",sum(isaq),"aq species in",what,"\n")) @@ -270,7 +272,7 @@ DG[isaq] <- DG.aq # then other species, if they are present if(sum(!isaq) > 0) { - eos.cgl <- obigt2eos(to[!isaq,],"cgl") + eos.cgl <- obigt2eos(tdata[!isaq,],"cgl") DCp.cgl <- checkEOS(eos.cgl,"cgl","Cp",ret.diff=TRUE) cat(paste("check.obigt: GHS for",sum(!isaq),"c,g,l species in",what,"\n")) DG.cgl <- checkGHS(eos.cgl,ret.diff=TRUE) @@ -278,11 +280,14 @@ DG[!isaq] <- DG.cgl } # put it all together - out <- data.frame(table=what,ispecies=1:ntot,name=to$name,state=to$state,DCp=DCp,DV=DV,DG=DG) + out <- data.frame(table=what,ispecies=1:ntot,name=tdata$name,state=tdata$state,DCp=DCp,DV=DV,DG=DG) return(out) } - # check OBIGT database in CHNOSZ + # check default database (OBIGT) out <- checkfun("OBIGT") + # check optional data + out <- rbind(out, checkfun("DEW")) + out <- rbind(out, checkfun("SUPCRTBL")) # set differences within a tolerance to NA out$DCp[abs(out$DCp) < 1] <- NA out$DV[abs(out$DV) < 1] <- NA Modified: pkg/CHNOSZ/data/refs.csv =================================================================== --- pkg/CHNOSZ/data/refs.csv 2017-11-07 16:08:39 UTC (rev 280) +++ pkg/CHNOSZ/data/refs.csv 2017-11-08 15:43:12 UTC (rev 281) @@ -115,6 +115,7 @@ GM09,"K.-D. Grevel and J. Majzlan",2009,"Geochim. Cosmochim. Acta 73, 6805 - 6815","kieserite, starkeyite, hexahydrite, and epsomite",https://doi.org/10.1016/j.gca.2009.08.005 HRMNS09,"H. C. Helgeson, L. Richard et al.",2009,"Geochim. Cosmochim. Acta 73, 594-695",kerogens,https://doi.org/10.1016/j.gca.2008.03.004 AML10,"M. Accornero, L. Marini and M. Lelli",2010,"Appl. Geochem. 25, 242-260","metal-chromate complexes",https://doi.org/10.1016/j.apgeochem.2009.11.010 +DS10,"J. Delgado Martin and A. Soler i Gil",2010,"Eur. J. Mineral. 22, 363-380","hedenbergite, andradite, ferro-actinolite, grunerite, and ilvaite",https://doi.org/10.1127/0935-1221/2010/0022-2021 MA10,"L. Marini and M. Accornero",2010,"Environ. Earth Sci. 59, 1601-1606","corrected values",https://doi.org/10.1007/s12665-009-0369-x Sch10,"M. Schulte",2010,"Aquat. Geochem. 16, 621-637","organic sulfides",https://doi.org/10.1007/s10498-010-9102-3 RG11,"L. Richard and X. Gaona",2011,"Geochim. Cosmochim. Acta 75, 7304-7350","organic iodine compounds",https://doi.org/10.1016/j.gca.2011.07.030 Modified: pkg/CHNOSZ/inst/NEWS =================================================================== --- pkg/CHNOSZ/inst/NEWS 2017-11-07 16:08:39 UTC (rev 280) +++ pkg/CHNOSZ/inst/NEWS 2017-11-08 15:43:12 UTC (rev 281) @@ -1,4 +1,4 @@ -CHANGES IN CHNOSZ 1.1.0-73 (2017-11-01) +CHANGES IN CHNOSZ 1.1.0-80 (2017-11-08) --------------------------------------- MAJOR CHANGES: @@ -114,6 +114,10 @@ (parsed as "minus one Z"; the parentheses cause "-1" to be interpreted as the coefficient on Z instead of the charge in the formula). +- Add data for hedenbergite, andradite, ferro-actinolite, grunerite, and + ilvaite from Delgado Martin and Soler i Gil, 2010 (using the Berman + equations). + OTHER CHANGES: - Add test-logmolality.R to demonstrate transformation of variables from Added: pkg/CHNOSZ/inst/extdata/Berman/DS10.csv =================================================================== --- pkg/CHNOSZ/inst/extdata/Berman/DS10.csv (rev 0) +++ pkg/CHNOSZ/inst/extdata/Berman/DS10.csv 2017-11-08 15:43:12 UTC (rev 281) @@ -0,0 +1,6 @@ +name,GfPrTr,HfPrTr,SPrTr,VPrTr,k0,k1,k2,k3,v1,v2,v3,v4,Tlambda,Tref,dTdP,l1,l2,DtH,Tmax,Tmin,d0,d1,d2,d3,d4,d5 +hedenbergite,-2674300,-2837802.5,173.59,6.785,353.31148,-31.06646,20.47911742,-56.3018581,27.96487,0,-1.7457,0.151,,,,,,,,,,,,,, +andradite,-5419000,-5761985.8,316.4,13.167,569.7558,-14.4144,-224.41040802,314.6543781,20.72525,5610,-0.6539136,0.01635,,,,,,,,,,,,,, +ferro-actinolite,-9839000,-10518042.6,685.1,28.26,1321.15758,-89.66454,-217.05844286,323.6159154,28.4,0,-1.5,0,,,,,,,,,,,,,, +grunerite,-8964807,-9623000,725,27.8,1347.83,-93.5691,-202.2848,303.919,28.4,0,-1.5,0,,,,,,,,,,,,,, +ilvaite,-3440000,-3695605.5,291.5,10.016,682.79138,-87.87112,301.8356871,-566.6432624,18.01543,11520,-0.6838,0.0024,,,,,,,,,,,,,, Modified: pkg/CHNOSZ/inst/extdata/OBIGT/Berman_cr.csv.xz =================================================================== (Binary files differ) Modified: pkg/CHNOSZ/inst/extdata/thermo/obigt_check.csv =================================================================== --- pkg/CHNOSZ/inst/extdata/thermo/obigt_check.csv 2017-11-07 16:08:39 UTC (rev 280) +++ pkg/CHNOSZ/inst/extdata/thermo/obigt_check.csv 2017-11-08 15:43:12 UTC (rev 281) @@ -71,172 +71,207 @@ "OBIGT",762,"Pt(SO4)3-4","aq",,-1.79, "OBIGT",765,"CF4","aq",5.9,, "OBIGT",772,"AsH3","aq",-2.67,, -"OBIGT",843,"MgAsO4-","aq",1.3,, -"OBIGT",846,"MnAsO4-","aq",-1.45,, -"OBIGT",910,"methane","aq",-2.61,, -"OBIGT",915,"hexane","aq",1.43,3.21, -"OBIGT",918,"ethylene","aq",6.12,-3.82, -"OBIGT",942,"propanol","aq",-1.89,, -"OBIGT",1084,"urea","aq",-23.26,23.32, -"OBIGT",1097,"propanoic acid","aq",1.42,, -"OBIGT",1120,"formate","aq",1.96,, -"OBIGT",1122,"propanoate","aq",1.68,, -"OBIGT",1129,"n-decanoate","aq",-1.93,, -"OBIGT",1145,"oxalate","aq",-3.19,, -"OBIGT",1172,"alanate","aq",-24.28,, -"OBIGT",1466,"Li(Mal)-","aq",,-3.22, -"OBIGT",1470,"Al(Mal)+","aq",,-2.19, -"OBIGT",1471,"Pb(Mal)","aq",,1.16, -"OBIGT",1475,"Pb(Succ)","aq",,1.49, -"OBIGT",1476,"Na(Oxal)-","aq",,-3.14, -"OBIGT",1477,"K(Oxal)-","aq",,-2.75, -"OBIGT",1478,"Fe(Oxal)+","aq",,-2.19, -"OBIGT",1480,"Na(Mal)-","aq",,-3.11, -"OBIGT",1481,"K(Mal)-","aq",,-2.63, -"OBIGT",1483,"La(Mal)+","aq",,-1.92, -"OBIGT",1484,"Gd(Mal)+","aq",,-1.73, -"OBIGT",1485,"Lu(Mal)+","aq",,-2.25, -"OBIGT",1486,"Yb(Mal)+","aq",,-2.05, -"OBIGT",1487,"Th(Mal)+2","aq",-1.29,-4.79, -"OBIGT",1489,"Ce(Mal)+","aq",,-1.75, -"OBIGT",1490,"Nd(Mal)+","aq",4.52,, -"OBIGT",1491,"Sm(Mal)+","aq",,-1.77, -"OBIGT",1492,"Pr(Mal)+","aq",,-1.75, -"OBIGT",1493,"Eu(Mal)+","aq",,-1.87, -"OBIGT",1494,"Tb(Mal)+","aq",,-1.92, -"OBIGT",1495,"Dy(Mal)+","aq",,-1.89, -"OBIGT",1496,"Tm(Mal)+","aq",,-2.08, -"OBIGT",1497,"Ho(Mal)+","aq",,-2.08, -"OBIGT",1498,"Er(Mal)+","aq",,-2.11, -"OBIGT",1499,"Sc(Mal)+","aq",,-1.97, -"OBIGT",1500,"Fe(Mal)+","aq",,-1.97, -"OBIGT",1501,"Na(Succ)-","aq",,-2.82, -"OBIGT",1502,"K(Succ)-","aq",,-2.39, -"OBIGT",1508,"Th(Succ)+2","aq",-1.21,-4.47, -"OBIGT",1513,"NH4(Oxal)-","aq",,-2.62, -"OBIGT",1518,"Al(Oxal)+","aq",,-2.62, -"OBIGT",1519,"Yb(Oxal)+","aq",,-2.02, -"OBIGT",1520,"Ce(Oxal)+","aq",,-1.8, -"OBIGT",1521,"Nd(Oxal)+","aq",,-1.8, -"OBIGT",1522,"Eu(Oxal)+","aq",,-1.89, -"OBIGT",1523,"Gd(Oxal)+","aq",,-1.8, -"OBIGT",1524,"Ru(Oxal)+","aq",,-2.41, -"OBIGT",1525,"Pa(Oxal)+2","aq",-1.25,-4.63, -"OBIGT",1526,"Th(Oxal)+2","aq",-1.27,-4.69, -"OBIGT",1527,"U(Oxal)+2","aq",-1.25,-4.63, -"OBIGT",1528,"Np(Oxal)+2","aq",-1.27,-4.69, -"OBIGT",1531,"Am(Oxal)+","aq",,-1.8, -"OBIGT",1532,"Cm(Oxal)+","aq",,-1.8, -"OBIGT",1533,"Y(Oxal)+","aq",,-2.11, -"OBIGT",1538,"La(Oxal)+","aq",,-1.87, -"OBIGT",1539,"Tb(Oxal)+","aq",,-1.92, -"OBIGT",1540,"Er(Oxal)+","aq",,-2.05, -"OBIGT",1541,"Lu(Oxal)+","aq",,-2.19, -"OBIGT",1542,"Cr(Oxal)+","aq",,-2.58, -"OBIGT",1543,"Ga(Oxal)+","aq",,-2.66, -"OBIGT",1544,"Sc(Oxal)+","aq",,-2.13, -"OBIGT",1545,"In(Oxal)+","aq",,-2.19, -"OBIGT",1546,"Pu(Oxal)+2","aq",-1.2,-4.44, -"OBIGT",1547,"NpO2(Oxal)","aq",,-1.94, -"OBIGT",1548,"Sm(Oxal)+","aq",,-1.84, -"OBIGT",1549,"Cs(Mal)-","aq",,-2.39, -"OBIGT",1550,"NH4(Mal)-","aq",,-2.54, -"OBIGT",1555,"In(Mal)+","aq",,-2.11, -"OBIGT",1556,"Y(Mal)+","aq",,-2.02, -"OBIGT",1564,"La(Succ)+","aq",,-1.52, -"OBIGT",1565,"NH4(Succ)-","aq",,-2.26, -"OBIGT",1567,"Fe(Succ)+","aq",,-1.92, -"OBIGT",1568,"Sc(Succ)+","aq",,-1.77, -"OBIGT",1571,"NpO2(Succ)","aq",,-3.16, -"OBIGT",1572,"Sm(Succ)+","aq",,-1.48, -"OBIGT",1573,"Er(Succ)+","aq",,-1.68, -"OBIGT",1574,"U(Succ)+2","aq",-1.15,-4.27, -"OBIGT",1578,"La(Glut)+","aq",,-1.23, -"OBIGT",1579,"Y(Glut)+","aq",,-1.46, -"OBIGT",1580,"Sc(Glut)+","aq",,-1.5, -"OBIGT",1581,"Th(Glut)+2","aq",-1.09,-4.05, -"OBIGT",1584,"Fe(Glut)+","aq",,-1.05, -"OBIGT",1585,"Sm(Glut)+","aq",,-1.2, -"OBIGT",1588,"Er(Glut)+","aq",,-1.4, -"OBIGT",1590,"Ba(Adip)","aq",,1.19, -"OBIGT",1597,"Pb(Adip)","aq",,1.25, -"OBIGT",1598,"Sc(Adip)+","aq",,-1.22, -"OBIGT",1600,"Th(Adip)+2","aq",-1.02,-3.76, -"OBIGT",1601,"U(Adip)+2","aq",-1,-3.71, -"OBIGT",1603,"Li(Oxal)-","aq",,-3.3, -"OBIGT",1607,"Li(Succ)-","aq",,-2.94, -"OBIGT",1609,"Na(Glut)-","aq",,-2.34, -"OBIGT",1610,"K(Glut)-","aq",,-2.05, -"OBIGT",1611,"Li(Glut)-","aq",,-2.66, -"OBIGT",1616,"Na(Adip)-","aq",,-2.05, -"OBIGT",1617,"K(Adip)-","aq",,-1.76, -"OBIGT",1618,"Li(Adip)-","aq",,-2.38, -"OBIGT",1624,"cyclohexane","aq",9.35,6.64, -"OBIGT",1625,"argon","aq",-1.24,-8.59, -"OBIGT",1626,"benzene","aq",,-1.14, -"OBIGT",1627,"CO2","aq",-4.94,, -"OBIGT",1628,"xenon","aq",2.8,, -"OBIGT",1638,"n-butanethiol","aq",2.19,, -"OBIGT",1660,"methyldiethanolamine","aq",1.61,, -"OBIGT",1670,"cysteinate","aq",-1,, -"OBIGT",1697,"glucose","aq",1.11,, -"OBIGT",1726,"adenine","aq",-1.2,, -"OBIGT",1727,"guanine","aq",-4.26,, -"OBIGT",1771,"dHUMP-","aq",-3.13,, -"OBIGT",1868,"MgADP-","aq",-1.01,, -"OBIGT",1879,"HNicMP(ox)","aq",,9.4, -"OBIGT",1887,"ribose-5-phosphate","aq",,7.48, -"OBIGT",1889,"ribose-5-phosphate-2","aq",1.53,, -"OBIGT",1890,"H4NADP(red)","aq",1.73,, -"OBIGT",1891,"H3NADP(red)-","aq",2.41,, -"OBIGT",1892,"H2NADP(red)-2","aq",1.28,, -"OBIGT",1893,"HNADP(red)-3","aq",2.09,, -"OBIGT",1894,"NADP(red)-4","aq",1.09,, -"OBIGT",1896,"H3NADP(ox)","aq",1.05,, -"OBIGT",1944,"Gly-Ala-Gly","aq",,-126.09, -"OBIGT",1945,"Gly-Arg+-Gly","aq",,-182.01, -"OBIGT",1946,"Gly-Asn-Gly","aq",,-145.77, -"OBIGT",1947,"Gly-Asp-Gly","aq",,-139.16, -"OBIGT",1948,"Gly-Cys-Gly","aq",,-139.2, -"OBIGT",1949,"Gly-Gln-Gly","aq",,-158.09, -"OBIGT",1950,"Gly-Glu-Gly","aq",,-155.4, -"OBIGT",1951,"Gly-Gly-Gly","aq",,-107.83, -"OBIGT",1952,"Gly-His-Gly","aq",,-167.84, -"OBIGT",1953,"Gly-Ile-Gly","aq",,-172.24, -"OBIGT",1954,"Gly-Leu-Gly","aq",,-171.74, -"OBIGT",1955,"Gly-Lys+-Gly","aq",,-175.45, -"OBIGT",1956,"Gly-Met-Gly","aq",,-172.45, -"OBIGT",1957,"Gly-Phe-Gly","aq",,-188.52, -"OBIGT",1958,"Gly-Pro-Gly","aq",,-140.68, -"OBIGT",1959,"Gly-Ser-Gly","aq",,-125.79, -"OBIGT",1960,"Gly-Thr-Gly","aq",,-141.19, -"OBIGT",1961,"Gly-Tyr-Gly","aq",,-190.24, -"OBIGT",1962,"Gly-Val-Gly","aq",,-155.72, -"OBIGT",1963,"[GXGBB]","aq",,-98.93, -"OBIGT",1996,"antigorite","cr1",,,812 -"OBIGT",2030,"clinochlore,7a","cr1",,,666 -"OBIGT",2049,"daphnite,14a","cr",,,-836 -"OBIGT",2074,"ferrosilite","cr1",,,694 -"OBIGT",2075,"ferrosilite","cr2",,,694 -"OBIGT",2090,"greenalite","cr",,,142507 -"OBIGT",2105,"hydromagnesite","cr",,,-2569 -"OBIGT",2256,"jarosite","cr",,,20697 -"OBIGT",2257,"natrojarosite","cr",,,17554 -"OBIGT",2279,"n-octadecane","cr",-2.63,, -"OBIGT",2280,"n-nonadecane","cr",-13.32,, -"OBIGT",2281,"n-eicosane","cr",-2.79,, -"OBIGT",2282,"n-heneicosane","cr",-8.61,, -"OBIGT",2283,"n-docosane","cr",-2.63,, -"OBIGT",2284,"n-tricosane","cr",-5.22,, -"OBIGT",2285,"n-tetracosane","cr",-2.02,, -"OBIGT",2286,"n-pentacosane","cr",-2.93,, -"OBIGT",2287,"n-hexacosane","cr",-1.29,, -"OBIGT",2288,"n-heptacosane","cr",-1.23,, -"OBIGT",2340,"carbazole","cr",-43.39,, -"OBIGT",2381,"triphenylene","cr",,,541 -"OBIGT",2694,"deoxyadenosine","cr",,,-2977 -"OBIGT",2795,"n-nonacontane","liq",,,635 -"OBIGT",2802,"2-methyloctane","liq",10,, -"OBIGT",3215,"5,6-dithiadecane","liq",2,, -"OBIGT",3291,"ethylene","gas",-4.59,, -"OBIGT",3301,"3,5-dimethylphenol","gas",,,628 +"OBIGT",859,"methane","aq",-2.61,, +"OBIGT",864,"hexane","aq",1.43,3.21, +"OBIGT",867,"ethylene","aq",6.12,-3.82, +"OBIGT",891,"propanol","aq",-1.89,, +"OBIGT",1033,"urea","aq",-23.26,23.32, +"OBIGT",1046,"propanoic acid","aq",1.42,, +"OBIGT",1069,"formate","aq",1.96,, +"OBIGT",1071,"propanoate","aq",1.68,, +"OBIGT",1078,"n-decanoate","aq",-1.93,, +"OBIGT",1094,"oxalate","aq",-3.19,, +"OBIGT",1121,"alanate","aq",-24.28,, +"OBIGT",1415,"Li(Mal)-","aq",,-3.22, +"OBIGT",1419,"Al(Mal)+","aq",,-2.19, +"OBIGT",1420,"Pb(Mal)","aq",,1.16, +"OBIGT",1424,"Pb(Succ)","aq",,1.49, +"OBIGT",1425,"Na(Oxal)-","aq",,-3.14, +"OBIGT",1426,"K(Oxal)-","aq",,-2.75, +"OBIGT",1427,"Fe(Oxal)+","aq",,-2.19, +"OBIGT",1429,"Na(Mal)-","aq",,-3.11, +"OBIGT",1430,"K(Mal)-","aq",,-2.63, +"OBIGT",1432,"La(Mal)+","aq",,-1.92, +"OBIGT",1433,"Gd(Mal)+","aq",,-1.73, +"OBIGT",1434,"Lu(Mal)+","aq",,-2.25, +"OBIGT",1435,"Yb(Mal)+","aq",,-2.05, +"OBIGT",1436,"Th(Mal)+2","aq",-1.29,-4.79, +"OBIGT",1438,"Ce(Mal)+","aq",,-1.75, +"OBIGT",1439,"Nd(Mal)+","aq",4.52,, +"OBIGT",1440,"Sm(Mal)+","aq",,-1.77, +"OBIGT",1441,"Pr(Mal)+","aq",,-1.75, +"OBIGT",1442,"Eu(Mal)+","aq",,-1.87, +"OBIGT",1443,"Tb(Mal)+","aq",,-1.92, +"OBIGT",1444,"Dy(Mal)+","aq",,-1.89, +"OBIGT",1445,"Tm(Mal)+","aq",,-2.08, +"OBIGT",1446,"Ho(Mal)+","aq",,-2.08, +"OBIGT",1447,"Er(Mal)+","aq",,-2.11, +"OBIGT",1448,"Sc(Mal)+","aq",,-1.97, +"OBIGT",1449,"Fe(Mal)+","aq",,-1.97, +"OBIGT",1450,"Na(Succ)-","aq",,-2.82, +"OBIGT",1451,"K(Succ)-","aq",,-2.39, +"OBIGT",1457,"Th(Succ)+2","aq",-1.21,-4.47, +"OBIGT",1462,"NH4(Oxal)-","aq",,-2.62, +"OBIGT",1467,"Al(Oxal)+","aq",,-2.62, +"OBIGT",1468,"Yb(Oxal)+","aq",,-2.02, +"OBIGT",1469,"Ce(Oxal)+","aq",,-1.8, +"OBIGT",1470,"Nd(Oxal)+","aq",,-1.8, +"OBIGT",1471,"Eu(Oxal)+","aq",,-1.89, +"OBIGT",1472,"Gd(Oxal)+","aq",,-1.8, +"OBIGT",1473,"Ru(Oxal)+","aq",,-2.41, +"OBIGT",1474,"Pa(Oxal)+2","aq",-1.25,-4.63, +"OBIGT",1475,"Th(Oxal)+2","aq",-1.27,-4.69, +"OBIGT",1476,"U(Oxal)+2","aq",-1.25,-4.63, +"OBIGT",1477,"Np(Oxal)+2","aq",-1.27,-4.69, +"OBIGT",1480,"Am(Oxal)+","aq",,-1.8, +"OBIGT",1481,"Cm(Oxal)+","aq",,-1.8, +"OBIGT",1482,"Y(Oxal)+","aq",,-2.11, +"OBIGT",1487,"La(Oxal)+","aq",,-1.87, +"OBIGT",1488,"Tb(Oxal)+","aq",,-1.92, +"OBIGT",1489,"Er(Oxal)+","aq",,-2.05, +"OBIGT",1490,"Lu(Oxal)+","aq",,-2.19, +"OBIGT",1491,"Cr(Oxal)+","aq",,-2.58, +"OBIGT",1492,"Ga(Oxal)+","aq",,-2.66, +"OBIGT",1493,"Sc(Oxal)+","aq",,-2.13, +"OBIGT",1494,"In(Oxal)+","aq",,-2.19, +"OBIGT",1495,"Pu(Oxal)+2","aq",-1.2,-4.44, +"OBIGT",1496,"NpO2(Oxal)","aq",,-1.94, +"OBIGT",1497,"Sm(Oxal)+","aq",,-1.84, +"OBIGT",1498,"Cs(Mal)-","aq",,-2.39, +"OBIGT",1499,"NH4(Mal)-","aq",,-2.54, +"OBIGT",1504,"In(Mal)+","aq",,-2.11, +"OBIGT",1505,"Y(Mal)+","aq",,-2.02, +"OBIGT",1513,"La(Succ)+","aq",,-1.52, +"OBIGT",1514,"NH4(Succ)-","aq",,-2.26, +"OBIGT",1516,"Fe(Succ)+","aq",,-1.92, +"OBIGT",1517,"Sc(Succ)+","aq",,-1.77, +"OBIGT",1520,"NpO2(Succ)","aq",,-3.16, +"OBIGT",1521,"Sm(Succ)+","aq",,-1.48, +"OBIGT",1522,"Er(Succ)+","aq",,-1.68, +"OBIGT",1523,"U(Succ)+2","aq",-1.15,-4.27, +"OBIGT",1527,"La(Glut)+","aq",,-1.23, +"OBIGT",1528,"Y(Glut)+","aq",,-1.46, +"OBIGT",1529,"Sc(Glut)+","aq",,-1.5, +"OBIGT",1530,"Th(Glut)+2","aq",-1.09,-4.05, +"OBIGT",1533,"Fe(Glut)+","aq",,-1.05, +"OBIGT",1534,"Sm(Glut)+","aq",,-1.2, +"OBIGT",1537,"Er(Glut)+","aq",,-1.4, +"OBIGT",1539,"Ba(Adip)","aq",,1.19, +"OBIGT",1546,"Pb(Adip)","aq",,1.25, +"OBIGT",1547,"Sc(Adip)+","aq",,-1.22, +"OBIGT",1549,"Th(Adip)+2","aq",-1.02,-3.76, +"OBIGT",1550,"U(Adip)+2","aq",-1,-3.71, +"OBIGT",1552,"Li(Oxal)-","aq",,-3.3, +"OBIGT",1556,"Li(Succ)-","aq",,-2.94, +"OBIGT",1558,"Na(Glut)-","aq",,-2.34, +"OBIGT",1559,"K(Glut)-","aq",,-2.05, +"OBIGT",1560,"Li(Glut)-","aq",,-2.66, +"OBIGT",1565,"Na(Adip)-","aq",,-2.05, +"OBIGT",1566,"K(Adip)-","aq",,-1.76, +"OBIGT",1567,"Li(Adip)-","aq",,-2.38, +"OBIGT",1573,"cyclohexane","aq",9.35,6.64, +"OBIGT",1574,"argon","aq",-1.24,-8.59, +"OBIGT",1575,"benzene","aq",,-1.14, +"OBIGT",1576,"CO2","aq",-4.94,, +"OBIGT",1577,"xenon","aq",2.8,, +"OBIGT",1587,"n-butanethiol","aq",2.19,, +"OBIGT",1609,"methyldiethanolamine","aq",1.61,, +"OBIGT",1619,"cysteinate","aq",-1,, +"OBIGT",1646,"glucose","aq",1.11,, +"OBIGT",1676,"guanine","aq",-4.26,, +"OBIGT",1720,"dHUMP-","aq",-3.13,, +"OBIGT",1817,"MgADP-","aq",-1.01,, +"OBIGT",1828,"HNicMP(ox)","aq",,9.4, +"OBIGT",1836,"ribose-5-phosphate","aq",,7.48, +"OBIGT",1838,"ribose-5-phosphate-2","aq",1.53,, +"OBIGT",1839,"H4NADP(red)","aq",1.73,, +"OBIGT",1840,"H3NADP(red)-","aq",2.41,, +"OBIGT",1841,"H2NADP(red)-2","aq",1.28,, +"OBIGT",1842,"HNADP(red)-3","aq",2.09,, +"OBIGT",1843,"NADP(red)-4","aq",1.09,, +"OBIGT",1845,"H3NADP(ox)","aq",1.05,, +"OBIGT",1893,"Gly-Ala-Gly","aq",,-126.09, +"OBIGT",1894,"Gly-Arg+-Gly","aq",,-182.01, +"OBIGT",1895,"Gly-Asn-Gly","aq",,-145.77, +"OBIGT",1896,"Gly-Asp-Gly","aq",,-139.16, +"OBIGT",1897,"Gly-Cys-Gly","aq",,-139.2, +"OBIGT",1898,"Gly-Gln-Gly","aq",,-158.09, +"OBIGT",1899,"Gly-Glu-Gly","aq",,-155.4, +"OBIGT",1900,"Gly-Gly-Gly","aq",,-107.83, +"OBIGT",1901,"Gly-His-Gly","aq",,-167.84, +"OBIGT",1902,"Gly-Ile-Gly","aq",,-172.24, +"OBIGT",1903,"Gly-Leu-Gly","aq",,-171.74, +"OBIGT",1904,"Gly-Lys+-Gly","aq",,-175.45, +"OBIGT",1905,"Gly-Met-Gly","aq",,-172.45, +"OBIGT",1906,"Gly-Phe-Gly","aq",,-188.52, +"OBIGT",1907,"Gly-Pro-Gly","aq",,-140.68, +"OBIGT",1908,"Gly-Ser-Gly","aq",,-125.79, +"OBIGT",1909,"Gly-Thr-Gly","aq",,-141.19, +"OBIGT",1910,"Gly-Tyr-Gly","aq",,-190.24, +"OBIGT",1911,"Gly-Val-Gly","aq",,-155.72, +"OBIGT",1912,"[GXGBB]","aq",,-98.93, +"OBIGT",1944,"antigorite","cr",,,812 +"OBIGT",1978,"clinochlore,7a","cr",,,666 +"OBIGT",1997,"daphnite,14a","cr",,,-836 +"OBIGT",2022,"ferrosilite","cr",,,694 +"OBIGT",2023,"ferrosilite","cr2",,,694 +"OBIGT",2038,"greenalite","cr",,,142507 +"OBIGT",2053,"hydromagnesite","cr",,,-2569 +"OBIGT",2204,"jarosite","cr",,,20697 +"OBIGT",2205,"natrojarosite","cr",,,17554 +"OBIGT",2227,"n-octadecane","cr",-2.63,, +"OBIGT",2228,"n-nonadecane","cr",-13.32,, +"OBIGT",2229,"n-eicosane","cr",-2.79,, +"OBIGT",2230,"n-heneicosane","cr",-8.61,, +"OBIGT",2231,"n-docosane","cr",-2.63,, +"OBIGT",2232,"n-tricosane","cr",-5.22,, +"OBIGT",2233,"n-tetracosane","cr",-2.02,, +"OBIGT",2234,"n-pentacosane","cr",-2.93,, +"OBIGT",2235,"n-hexacosane","cr",-1.29,, +"OBIGT",2236,"n-heptacosane","cr",-1.23,, +"OBIGT",2288,"carbazole","cr",-43.39,, +"OBIGT",2329,"triphenylene","cr",,,541 +"OBIGT",2642,"deoxyadenosine","cr",,,-2977 +"OBIGT",2829,"n-nonacontane","liq",,,635 +"OBIGT",2836,"2-methyloctane","liq",10,, +"OBIGT",3249,"5,6-dithiadecane","liq",2,, +"OBIGT",3324,"ethylene","gas",-4.59,, +"OBIGT",3334,"3,5-dimethylphenol","gas",,,628 +"DEW",15,"BO(OH)","aq",,,-1111 +"DEW",19,"CaCl+","aq",,,-593 +"DEW",20,"CaCl2","aq",,,-7937 +"DEW",21,"CaCO3","aq",,,661 +"DEW",25,"Ce+4","aq",,-1.13, +"DEW",31,"CO3-2","aq",,-1.41, +"DEW",38,"diglycine","aq",,,171415 +"DEW",39,"diketopiperazine","aq",,,101562 +"DEW",49,"FeOH+","aq",,,78085 +"DEW",53,"FeCl+2","aq",,,-4165 +"DEW",55,"FeCl2+","aq",,,-8614 +"DEW",56,"FeCl3","aq",,,-14671 +"DEW",57,"FeCl4-","aq",,,-21499 +"DEW",63,"glutamate","aq",,,234035 +"DEW",71,"h-succinate","aq",,,2294200 +"DEW",83,"HCN","aq",,,907 +"DEW",89,"Hg2+2","aq",,,9334 +"DEW",92,"HPO4-2","aq",,-1.02, +"DEW",97,"HSiO3-","aq",,,2160 +"DEW",102,"In+3","aq",,,7335 +"DEW",105,"KOH","aq",,,-71448 +"DEW",115,"Mg(HCO3)+","aq",,,686 +"DEW",119,"MgOH+","aq",,,10976 +"DEW",120,"MgSO4","aq",,,-3852 +"DEW",125,"MnSO4","aq",,,1203 +"DEW",132,"NaHCO3","aq",,,74495 +"DEW",141,"OH-","aq",,,730 +"DEW",147,"PO4-3","aq",,-1.72, +"DEW",156,"S2O3-2","aq",,,939 +"DEW",159,"S2O6-2","aq",,,-607 +"DEW",161,"S3-","aq",,,-8509 +"DEW",167,"S5O6-2","aq",,,664 +"DEW",177,"SO3-2","aq",,-1.02, +"DEW",186,"U+4","aq",,-1.13, +"DEW",199,"ZnCl3-","aq",,,2264 +"SUPCRTBL",16,"dawsonite","cr",,,4653 +"SUPCRTBL",76,"MgAsO4-","aq",1.3,, +"SUPCRTBL",79,"MnAsO4-","aq",-1.45,, Modified: pkg/CHNOSZ/man/extdata.Rd =================================================================== --- pkg/CHNOSZ/man/extdata.Rd 2017-11-07 16:08:39 UTC (rev 280) +++ pkg/CHNOSZ/man/extdata.Rd 2017-11-08 15:43:12 UTC (rev 281) @@ -14,7 +14,7 @@ \itemize{ \item \code{Ber88.csv} lists thermodynamic data for minerals taken from Berman (1988). These consist of standard state thermodyamic properties (Table 2 in the paper), parameters for calculating heat capacity (Table 3a), coefficients for calculation of mineral expansivities and compressibilities (Table 4), parameters describing polymorph transitions (Table 3b), and parameters describing temperature dependent disordering (Table 5). - The values are entered as shown in the source Tables, preserving units and multipliers. + The values are entered as shown in the source Tables, preserving units (i.e. Joules) and multipliers. \code{\link{berman}} removes these multipliers and, after calculation of thermodynamic properties at \P and \T, converts to units used by \code{\link{subcrt}}. Following conventions used in data files for other software packages, the names of sanidine and microcline were changed to K-feldspar,high and K-feldspar,low. } Modified: pkg/CHNOSZ/tests/testthat/test-berman.R =================================================================== --- pkg/CHNOSZ/tests/testthat/test-berman.R 2017-11-07 16:08:39 UTC (rev 280) +++ pkg/CHNOSZ/tests/testthat/test-berman.R 2017-11-08 15:43:12 UTC (rev 281) @@ -8,10 +8,11 @@ SHD91 <- read.csv(paste0(dir, "/SHD91.csv"), as.is=TRUE) ZS92 <- read.csv(paste0(dir, "/ZS92.csv"), as.is=TRUE) JUN92 <- read.csv(paste0(dir, "/JUN92.csv"), as.is=TRUE) +DS10 <- read.csv(paste0(dir, "/DS10.csv"), as.is=TRUE) FDM14 <- read.csv(paste0(dir, "/FDM+14.csv"), as.is=TRUE) BDat17 <- read.csv(paste0(dir, "/BDat17.csv"), as.is=TRUE) # assemble the files and remove duplicates (keep the latest) -dat <- rbind(BDat17, FDM14, JUN92, ZS92, SHD91, Ber90, Ber88) +dat <- rbind(BDat17, FDM14, DS10, ZS92, SHD91, Ber90, Ber88) dat <- dat[!duplicated(dat$name), ] mineral <- unique(dat$name) prop_Berman <- NULL @@ -52,15 +53,15 @@ # which minerals differ in S by more than 4 cal/K/mol? idiffS <- which(abs(prop_Berman$S - prop_Helgeson$S) > 4) - expect_match(mineral[idiffS], "albite|annite|almandine|fluortremolite") + expect_match(mineral[idiffS], "albite|annite|almandine|fluortremolite|andradite|grunerite") # which minerals differ in Cp by more than 4 cal/K/mol? idiffCp <- which(abs(prop_Berman$Cp - prop_Helgeson$Cp) > 4) - expect_match(mineral[idiffCp], "glaucophane|antigorite|cristobalite,beta|K-feldspar|fluortremolite") + expect_match(mineral[idiffCp], "glaucophane|antigorite|cristobalite,beta|K-feldspar|fluortremolite|grunerite") # which minerals differ in V by more than 1 cm^3/mol? idiffV <- which(abs(prop_Berman$V - prop_Helgeson$V) > 1) - expect_match(mineral[idiffV], "glaucophane|anthophyllite|antigorite|chrysotile|merwinite") + expect_match(mineral[idiffV], "glaucophane|anthophyllite|antigorite|chrysotile|merwinite|grunerite") }) test_that("high-T,P calculated properties are similar to precalculated ones", { Modified: pkg/CHNOSZ/vignettes/obigt.bib =================================================================== --- pkg/CHNOSZ/vignettes/obigt.bib 2017-11-07 16:08:39 UTC (rev 280) +++ pkg/CHNOSZ/vignettes/obigt.bib 2017-11-08 15:43:12 UTC (rev 281) @@ -36,15 +36,15 @@ } @Article{AS01, - author = {Amend, Jan P. and Shock, Everett L.}, - journal = {FEMS Microbiology Reviews}, - title = {{E}nergetics of overall metabolic reactions of thermophilic and hyperthermophilic {A}rchaea and {B}acteria}, - year = {2001}, - volume = {25}, - number = {2}, - pages = {175--243}, - doi = {10.1111/j.1574-6976.2001.tb00576.x}, - issn = {0168-6445}, + author = {Amend, Jan P. and Shock, Everett L.}, + journal = {FEMS Microbiology Reviews}, + title = {{E}nergetics of overall metabolic reactions of thermophilic and hyperthermophilic {A}rchaea and {B}acteria}, + year = {2001}, + volume = {25}, + number = {2}, + pages = {175--243}, + doi = {10.1111/j.1574-6976.2001.tb00576.x}, + issn = {0168-6445}, } @Article{BH83, @@ -175,13 +175,13 @@ } @Article{HDNB78, - author = {Helgeson, Harold C. and Delany, Joan M. and Nesbitt, H. Wayne and Bird, Dennis K.}, - journal = {American Journal of Science}, - title = {{S}ummary and critique of the thermodynamic properties of rock-forming minerals}, - year = {1978}, - volume = {278A}, - pages = {1--229}, - url = {http://www.worldcat.org/oclc/13594862}, + author = {Helgeson, Harold C. and Delany, Joan M. and Nesbitt, H. Wayne and Bird, Dennis K.}, + journal = {American Journal of Science}, + title = {{S}ummary and critique of the thermodynamic properties of rock-forming minerals}, + year = {1978}, + volume = {278A}, + pages = {1--229}, + url = {http://www.worldcat.org/oclc/13594862}, } @Article{HOKR98, @@ -250,25 +250,25 @@ } @Article{LH06a, - author = {LaRowe, Douglas E. and Helgeson, Harold C.}, - journal = {Geochimica et Cosmochimica Acta}, - title = {{B}iomolecules in hydrothermal systems: {C}alculation of the standard molal thermodynamic properties of nucleic-acid bases, nucleosides, and nucleotides at elevated temperatures and pressures}, - year = {2006}, - volume = {70}, - number = {18}, - pages = {4680--4724}, - doi = {10.1016/j.gca.2006.04.010}, + author = {LaRowe, Douglas E. and Helgeson, Harold C.}, + journal = {Geochimica et Cosmochimica Acta}, + title = {{B}iomolecules in hydrothermal systems: {C}alculation of the standard molal thermodynamic properties of nucleic-acid bases, nucleosides, and nucleotides at elevated temperatures and pressures}, + year = {2006}, + volume = {70}, + number = {18}, + pages = {4680--4724}, + doi = {10.1016/j.gca.2006.04.010}, } @Article{LH06b, - author = {LaRowe, Douglas E. and Helgeson, Harold C.}, - journal = {Thermochimica Acta}, - title = {{T}he energetics of metabolism in hydrothermal systems: {C}alculation of the standard molal thermodynamic properties of magnesium-complexed adenosine nucleotides and {NAD} and {NADP} at elevated temperatures and pressures}, - year = {2006}, - volume = {448}, - number = {2}, - pages = {82--106}, - doi = {10.1016/j.tca.2006.06.008}, + author = {LaRowe, Douglas E. and Helgeson, Harold C.}, + journal = {Thermochimica Acta}, + title = {{T}he energetics of metabolism in hydrothermal systems: {C}alculation of the standard molal thermodynamic properties of magnesium-complexed adenosine nucleotides and {NAD} and {NADP} at elevated temperatures and pressures}, + year = {2006}, + volume = {448}, + number = {2}, + pages = {82--106}, + doi = {10.1016/j.tca.2006.06.008}, } @Article{MGN03, @@ -631,14 +631,14 @@ } @Article{SH88, - author = {Shock, Everett L. and Helgeson, Harold C.}, - journal = {Geochimica et Cosmochimica Acta}, - title = {{C}alculation of the thermodynamic and transport properties of aqueous species at high pressures and temperatures: {C}orrelation algorithms for ionic species and equation of state predictions to 5 kb and 1000?{C}}, - year = {1988}, - volume = {52}, - number = {8}, - pages = {2009--2036}, - doi = {10.1016/0016-7037(88)90181-0}, + author = {Shock, Everett L. and Helgeson, Harold C.}, + journal = {Geochimica et Cosmochimica Acta}, + title = {{C}alculation of the thermodynamic and transport properties of aqueous species at high pressures and temperatures: {C}orrelation algorithms for ionic species and equation of state predictions to 5 kb and 1000$^\circ${C}}, + year = {1988}, + volume = {52}, + number = {8}, + pages = {2009--2036}, + doi = {10.1016/0016-7037(88)90181-0}, } @Article{SH90, @@ -742,20 +742,20 @@ } @Article{SHA14, - author = {Sverjensky, Dimitri A. and Harrison, Brandon and Azzolini, David}, - journal = {Geochimica et Cosmochimica Acta}, - title = {{W}ater in the deep {E}arth: {T}he dielectric constant and the solubilities of quartz and corundum to 60 kb and 1,200 $^\circ${C}}, - year = {2014}, - volume = {129}, - pages = {125--145}, - doi = {10.1016/j.gca.2013.12.019}, - issn = {0016-7037}, + author = {Sverjensky, Dimitri A. and Harrison, Brandon and Azzolini, David}, + journal = {Geochimica et Cosmochimica Acta}, + title = {{W}ater in the deep {E}arth: {T}he dielectric constant and the solubilities of quartz and corundum to 60 kb and 1,200 $^\circ${C}}, + year = {2014}, + volume = {129}, + pages = {125--145}, + doi = {10.1016/j.gca.2013.12.019}, + issn = {0016-7037}, } @Article{SSH97, author = {Sverjensky, D. A. and Shock, E. L. and Helgeson, H. C.}, journal = {Geochimica et Cosmochimica Acta}, - title = {{P}rediction of the thermodynamic properties of aqueous metal complexes to 1000?{C} and 5 kb}, + title = {{P}rediction of the thermodynamic properties of aqueous metal complexes to 1000$^\circ${C} and 5 kb}, year = {1997}, volume = {61}, number = {7}, @@ -819,14 +819,14 @@ } @Article{ZZL+16, - author = {Kurt Zimmer and Yilun Zhang and Peng Lu and Yanyan Chen and Guanru Zhang and Mehmet Dalkilic and Chen Zhu}, - journal = {Computers \& Geosciences}, - title = {{SUPCRTBL}: {A} revised and extended thermodynamic dataset and software package of {SUPCRT}92}, - year = {2016}, - volume = {90}, - pages = {97--111}, - doi = {10.1016/j.cageo.2016.02.013}, - issn = {0098-3004}, + author = {Kurt Zimmer and Yilun Zhang and Peng Lu and Yanyan Chen and Guanru Zhang and Mehmet Dalkilic and Chen Zhu}, + journal = {Computers \& Geosciences}, + title = {{SUPCRTBL}: {A} revised and extended thermodynamic dataset and software package of {SUPCRT}92}, + year = {2016}, + volume = {90}, + pages = {97--111}, + doi = {10.1016/j.cageo.2016.02.013}, + issn = {0098-3004}, } @Book{CWM89, @@ -840,15 +840,15 @@ } @Article{GM09, - author = {Grevel, Klaus-Dieter and Majzlan, Juraj}, - journal = {Geochimica et Cosmochimica Acta}, - title = {{I}nternally consistent thermodynamic data for magnesium sulfate hydrates}, - year = {2009}, - volume = {73}, - number = {22}, - pages = {6805--6815}, - doi = {10.1016/j.gca.2009.08.005}, - issn = {0016-7037}, + author = {Grevel, Klaus-Dieter and Majzlan, Juraj}, + journal = {Geochimica et Cosmochimica Acta}, + title = {{I}nternally consistent thermodynamic data for magnesium sulfate hydrates}, + year = {2009}, + volume = {73}, + number = {22}, + pages = {6805--6815}, + doi = {10.1016/j.gca.2009.08.005}, + issn = {0016-7037}, } @Article{HS99, @@ -865,14 +865,14 @@ } @Article{Ber88, - author = {Berman, R. G.}, - journal = {Journal of Petrology}, [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/chnosz -r 281 From noreply at r-forge.r-project.org Thu Nov 9 08:43:29 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 9 Nov 2017 08:43:29 +0100 (CET) Subject: [CHNOSZ-commits] r282 - www Message-ID: <20171109074329.CF00518882D@r-forge.r-project.org> Author: jedick Date: 2017-11-09 08:43:29 +0100 (Thu, 09 Nov 2017) New Revision: 282 Removed: www/images/ Modified: www/index.php Log: www: simplify R-forge project home page; remove random image Modified: www/index.php =================================================================== --- www/index.php 2017-11-08 15:43:12 UTC (rev 281) +++ www/index.php 2017-11-09 07:43:29 UTC (rev 282) @@ -44,55 +44,9 @@ -

The project summary page you can find here on R-Forge. (Development site, source code management)

+

Link 1: project summary page on R-Forge.

-

Currently (Jan. 2013) the main website for the project is located at chnosz.net. (Downloads, help pages, output from examples and vignettes)

+

Link 2: project website at chnosz.net.

-

As a teaser, here's a random image from the examples of CHNOSZ 0.9-9, released on CRAN on 2013-01-01. Click here for a directory listing of all 54 images, or here for the images in context of the code running the examples.

- - - - - -

Image filename:

- - From noreply at r-forge.r-project.org Thu Nov 9 12:47:07 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 9 Nov 2017 12:47:07 +0100 (CET) Subject: [CHNOSZ-commits] r283 - in pkg/CHNOSZ: . data demo Message-ID: <20171109114707.9DC561889A0@r-forge.r-project.org> Author: jedick Date: 2017-11-09 12:47:07 +0100 (Thu, 09 Nov 2017) New Revision: 283 Modified: pkg/CHNOSZ/DESCRIPTION pkg/CHNOSZ/data/refs.csv pkg/CHNOSZ/demo/sources.R Log: clean up data/refs.csv Modified: pkg/CHNOSZ/DESCRIPTION =================================================================== --- pkg/CHNOSZ/DESCRIPTION 2017-11-09 07:43:29 UTC (rev 282) +++ pkg/CHNOSZ/DESCRIPTION 2017-11-09 11:47:07 UTC (rev 283) @@ -1,6 +1,6 @@ -Date: 2017-11-08 +Date: 2017-11-09 Package: CHNOSZ -Version: 1.1.0-80 +Version: 1.1.0-81 Title: Thermodynamic Calculations for Geobiochemistry Author: Jeffrey Dick Maintainer: Jeffrey Dick Modified: pkg/CHNOSZ/data/refs.csv =================================================================== --- pkg/CHNOSZ/data/refs.csv 2017-11-09 07:43:29 UTC (rev 282) +++ pkg/CHNOSZ/data/refs.csv 2017-11-09 11:47:07 UTC (rev 283) @@ -99,7 +99,6 @@ HPT06,"B. Hawrylak, R. Palepu and P. R. Tremaine",2006,"J. Chem. Thermodynamics 38, 988-1007","methyldiethanolamine and methyldiethanolammonium chloride HKF parameters",https://doi.org/10.1016/j.jct.2005.10.013 LH06a,"D. E. LaRowe and H. C. Helgeson",2006,"Geochim. Cosmochim. Acta 70, 4680-4724","nucleic-acid bases, nucleosides, and nucleotides",https://doi.org/10.1016/j.gca.2006.04.010 LH06a.1,"D. E. LaRowe and H. C. Helgeson",2006,"Geochim. Cosmochim. Acta 70, 4680-4724","citric acid and citrate",https://doi.org/10.1016/j.gca.2006.04.010 -LH06a.2,"D. E. LaRowe and H. C. Helgeson",2006,"Geochim. Cosmochim. Acta 70, 4680-4724","adenine-old, HKF parameters superseded by @LCT17",https://doi.org/10.1016/j.gca.2006.04.010 LH06b,"D. E. LaRowe and H. C. Helgeson",2006,"Thermochim. Acta 448, 82-106","Mg-complexed adenosine nucleotides (ATP), NAD, and NADP",https://doi.org/10.1016/j.tca.2006.06.008 LH06b.1,"D. E. LaRowe and H. C. Helgeson",2006,"Thermochim. Acta 448, 82-106","pyridine and piperidine",https://doi.org/10.1016/j.tca.2006.06.008 DLH06,"J. M. Dick, D. E. LaRowe and H. C. Helgeson",2006,"Biogeosciences 3, 311-336","amino acid, protein, and organic groups",https://doi.org/10.5194/bg-3-311-2006 @@ -154,40 +153,8 @@ LCT17,"A. R. Lowe, J. S. Cox and P. R. Tremaine",2017,"J. Chem. Thermodynamics 112, 129-145","adenine HKF parameters",https://doi.org/10.1016/j.jct.2017.04.005 DEW17,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","other data from Aqueous Species Table in spreadsheet (see detailed references there)",http://www.dewcommunity.org DEW17.1,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","revised with new predicted a1 for ions",http://www.dewcommunity.org -DEW17.2,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","revised with new predicted a1 for cations",http://www.dewcommunity.org DEW17.3,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","revised with new predicted a1 for complex species",http://www.dewcommunity.org -DEW17.4,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","with revised a1 equal to the sum of the ions",http://www.dewcommunity.org -DEW17.5,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","BaCl+, CaCl+, CaCl2: with new V from the sum of a1 values of ions",http://www.dewcommunity.org -DEW17.6,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","revised volume increased in order that a1 of the complex is the sum of the a1 values of the ions",http://www.dewcommunity.org DEW17.7,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","acetate: revised January 26th, 2016; new a1 value from complexes and organics correlation.",http://www.dewcommunity.org -DEW17.10,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","CaSO4: revised using exptl V and pred. a1 from new correlation",http://www.dewcommunity.org -DEW17.11,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","diglycine: Jamie & Dimitri fit to exptl Cp(T) and pred. a1-a4; delGf and S from fitting logK dimerisation values from Lemke et al. (2009).",http://www.dewcommunity.org -DEW17.12,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","diketopiperazine: Jamie & Dimitri fit delGf and S from to logK dimerisation values from Lemke et al. (2009); pred. a1-a4;",http://www.dewcommunity.org -DEW17.13,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","FeOH+, FeO, HFeO2-: 31/1/17: V from estimate to have similar behavior to MgO,aq",http://www.dewcommunity.org -DEW17.14,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","FeCl+2: 29/11/16: Fit to Tagirov et al. (2000) with revised volume increased in order that a1 of the complex a bit greater than the sum of the a1 values of the ions",http://www.dewcommunity.org -DEW17.15,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","FeCl2+, FeCl4-: 29/11/16: Fit to Liu et al. (2006) with revised volume increased in order that a1 of the complex a bit greater than the sum of the a1 values of the ions",http://www.dewcommunity.org -DEW17.16,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","FeCl3: 29/11/16: Fit to Liu et al. (2006) with revised volume increased in order that a1 of the complex is equal to the sum of the a1 values of the ions",http://www.dewcommunity.org -DEW17.17,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","glutamate: Revised 1/22/15 based on V at 25 C from Ziemer & Woolley (2007) and predicted a1, a2, and a4; c1 and c2 from fits to delCpr protonation of Ziemer & Woolley (2007); S from fitting temperature dependence of logK from Ziemer & Woolley (2007); omega predicted from S using ion correlation.",http://www.dewcommunity.org -DEW17.18,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","glutamic acid: Revised 1/22/15 based on fitting Cp and V vs T data from Hakin et al. (1994) + revised correlation for a1 from Sverjensky et al. (2014); omega from delCPr above 100 °C (Ziemer & Woolley, 2007); G, H, and S from Amend & Helgeson (1997).",http://www.dewcommunity.org -DEW17.19,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","HCl: Regression of Ruaya & Seward (1987) & Tagirov et al. (1997) with new full correlations",http://www.dewcommunity.org -DEW17.20,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","HSiO3-: Revised late Oct. (2014) to fit Baes and Mesmer (1977) along Psat. and high pressure logK's from fitting Kessel et al. (2005) eclogite solubility measurements.",http://www.dewcommunity.org -DEW17.21,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","HSO3-: revised using published estimated V and pred. a1 from new correlation",http://www.dewcommunity.org -DEW17.22,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","isobutane: G, H, S, Cp, V from Shock & Helgeson (1990); a1 estimated with Sverjensky et al. (2014); c2 estimated with a new hydrocarbon correlation.",http://www.dewcommunity.org -DEW17.23,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","KCl: May, 2017 Fitted to logKs from Oelkers & Helgeson (1988) + retrieved logKs from Hemley experiments at 1.0 kb using the HCl referred to above",http://www.dewcommunity.org -DEW17.25,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","KSO4-: Revised G, S and Cp to fit Noyes et al. (1906) & Sharygin et al. (2006) with a1 of the complex equal to the sum of the a1 values of the ions",http://www.dewcommunity.org -DEW17.26,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","Mg(HCO3)+: Fit to Stefansson et al. (2014) & Siebert & Hostetler (1977); plus revised V increased so that a1 of the complex is the sum of the a1 values of the ions",http://www.dewcommunity.org -DEW17.27,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","MgCO3: Sverjensky et al. (1997) revised volume increased in order that a1 of the complex is the sum of the a1 values of the ions; and Cp revised using isocoulombic reln with CaCO3,aq; also omega is set to +0.3 as for all neutral metal complexes.",http://www.dewcommunity.org -DEW17.28,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","MgOH+: Revised by Dimitri, March, 2015",http://www.dewcommunity.org -DEW17.29,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","MgSO4: S, Cp, V, omega from fit to Akilan et al. (2006a) and Frantz et al. (1994)",http://www.dewcommunity.org -DEW17.30,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","NaCO3-: Fit to Stefansson et al. (2013; 80 to 200 C) & Garrels et al., (1961; at 25 C) to get G, S and Cp; with a1 pred. from the sum of the ions and used to predict the volume",http://www.dewcommunity.org -DEW17.31,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","NaHCO3: Fit to Stefansson et al. (2013; 80 to 200 C) & Nakayama (1971; at 25 C) to get G, S and Cp; with V, a1, and omega from fitting high PT Raman data (Facq et al., 2015)",http://www.dewcommunity.org -DEW17.32,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","NaOH: Fitted to Ho & Palmer (1997) data with a1 pred. from the sum of the ions and used to predict the volume",http://www.dewcommunity.org -DEW17.33,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","OH-: August 16th, 2013 fit to Bandura & Lvov (2005)",http://www.dewcommunity.org -DEW17.34,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","propane: Shock & Helgeson (1990) with new a1-a4 based on revised correlation to predict a1 in Sverjensky et al. (2013)",http://www.dewcommunity.org -DEW17.36,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","S3-: Regression of data from Pokrovski & Dubessy (2015), Guggenheim (1971); Feb. 2015",http://www.dewcommunity.org -DEW17.38,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","SO2: Shock et al. (1989) with revised a1 predicted as a complex from delVn",http://www.dewcommunity.org -DEW17.39,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","toluene: Plyasunov & Shock (2001) with new a1 to a4 predicted with revised a1 consistent with Sverjensky et al. (2013)",http://www.dewcommunity.org -DEW17.40,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","urea: Revised Feb. 2015 by Dimitri: c1, c2, and omega from PS01 based on Stokes (1967) data; V from Cabani et al. (1981) with a1-a4 predicted.",http://www.dewcommunity.org DEW17.101,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","methane: revised with new predicted a1 for complex species",http://www.dewcommunity.org DEW17.102,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","MgCl+: revised volume increased in order that a1 of the complex is the sum of the a1 values of the ions",http://www.dewcommunity.org DEW17.103,"D. A. Sverjensky et al.",2017,"Deep Earth Water (DEW) spreadsheet","NaCl: revised with new predicted a1 for complex species",http://www.dewcommunity.org Modified: pkg/CHNOSZ/demo/sources.R =================================================================== --- pkg/CHNOSZ/demo/sources.R 2017-11-09 07:43:29 UTC (rev 282) +++ pkg/CHNOSZ/demo/sources.R 2017-11-09 11:47:07 UTC (rev 283) @@ -3,10 +3,18 @@ ref.source <- thermo$refs$key # sources in the primary thermodynamic database # we omit the [S92] in "HDNB78 [S92]" etc. -os1 <- gsub("\ .*", "", thermo$obigt$ref1) -os2 <- gsub("\ .*", "", thermo$obigt$ref2) +tdata <- get("thermo")$obigt +ps1 <- gsub("\ .*", "", tdata$ref1) +ps2 <- gsub("\ .*", "", tdata$ref2) +# sources in the optional datafiles +tdata <- read.csv(system.file("extdata/OBIGT/DEW_aq.csv", package="CHNOSZ"), as.is=TRUE) +os1 <- gsub("\ .*", "", tdata$ref1) +os2 <- gsub("\ .*", "", tdata$ref2) +tdata <- read.csv(system.file("extdata/OBIGT/SUPCRTBL.csv", package="CHNOSZ"), as.is=TRUE) +os3 <- gsub("\ .*", "", tdata$ref1) +os4 <- gsub("\ .*", "", tdata$ref2) # all of the thermodynamic data sources - some of them might be NA -obigt.source <- unique(c(os1,os2)) +obigt.source <- unique(c(ps1, ps2, os1, os2, os3, os4)) obigt.source <- obigt.source[!is.na(obigt.source)] # these all produce character(0) if the sources are all accounted for print("missing these sources for thermodynamic properties:") From noreply at r-forge.r-project.org Thu Nov 9 14:22:52 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 9 Nov 2017 14:22:52 +0100 (CET) Subject: [CHNOSZ-commits] r284 - in pkg/CHNOSZ: . vignettes Message-ID: <20171109132253.0EBDF189316@r-forge.r-project.org> Author: jedick Date: 2017-11-09 14:22:52 +0100 (Thu, 09 Nov 2017) New Revision: 284 Modified: pkg/CHNOSZ/DESCRIPTION pkg/CHNOSZ/vignettes/anintro.Rmd Log: anintro.Rmd: use water.lines() for all Cu-S-Cl-H2O projections Modified: pkg/CHNOSZ/DESCRIPTION =================================================================== --- pkg/CHNOSZ/DESCRIPTION 2017-11-09 11:47:07 UTC (rev 283) +++ pkg/CHNOSZ/DESCRIPTION 2017-11-09 13:22:52 UTC (rev 284) @@ -1,6 +1,6 @@ Date: 2017-11-09 Package: CHNOSZ -Version: 1.1.0-81 +Version: 1.1.0-82 Title: Thermodynamic Calculations for Geobiochemistry Author: Jeffrey Dick Maintainer: Jeffrey Dick Modified: pkg/CHNOSZ/vignettes/anintro.Rmd =================================================================== --- pkg/CHNOSZ/vignettes/anintro.Rmd 2017-11-09 11:47:07 UTC (rev 283) +++ pkg/CHNOSZ/vignettes/anintro.Rmd 2017-11-09 13:22:52 UTC (rev 284) @@ -691,7 +691,7 @@ The key argument is `bases`, which identifies the candidate basis species, starting with the one in the current basis. The other arguments, like those of `affinity()`, specify the ranges of the variables; `res` indicates the grid resolution to use for each variable (the default is 128). The first call to `diagram()` plots the species of interest; the second adds the predominance fields of the basis species. -We turn off the gray coloring beyond the water stability limits (`limit.water`) but plot the lines using `water.lines()`: +We turn off the gray coloring beyond the water stability limits (`limit.water`) but plot the red dotted lines using `water.lines()`: ```{r copper_mosaic, fig.margin=TRUE, fig.width=4, fig.height=4, small.mar=TRUE, dpi=dpi, out.width="100%", message=FALSE, cache=TRUE, fig.cap="Copper minerals and aqueous complexes with chloride, 200 ?C.", pngquant=pngquant, timeit=timeit} T <- 200 @@ -701,7 +701,7 @@ diagram(m1$A.species, lwd = 2, fill = NA, limit.water = FALSE) diagram(m1$A.bases, add = TRUE, col = "blue", col.names = "blue", lty = 2, limit.water = FALSE) -water.lines(m1$A.species, col = "red", lwd = 2, lty = 2) +water.lines(m1$A.species, col = "red", lwd = 2, lty = 3) ``` The argument `blend = TRUE` is used to combine the diagrams according to the equilibrium activities of the basis species by themselves ([see below](#equilibration)). @@ -724,12 +724,13 @@ limit.water = FALSE) diagram(m1$A.bases, add = TRUE, col = "blue", col.names = "blue", lty = 3, limit.water = FALSE) + water.lines(m1$A.species, col = "red", lwd = 2, lty = 3) swap.basis(names(newvar), "e-") } par(mfrow = c(1, 3)) mosaicfun(list(Eh = c(-1, 1, res))) -mosaicfun(list(H2 = c(-25, 10, res))) -mosaicfun(list(O2 = c(-70, 0, res))) +mosaicfun(list(H2 = c(-30, 10, res))) +mosaicfun(list(O2 = c(-70, 5, res))) ``` ## *T*, *P*, activity transects From noreply at r-forge.r-project.org Fri Nov 10 05:03:11 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 10 Nov 2017 05:03:11 +0100 (CET) Subject: [CHNOSZ-commits] r285 - in pkg/CHNOSZ: . R inst/extdata/cpetc man Message-ID: <20171110040311.20FEC188E73@r-forge.r-project.org> Author: jedick Date: 2017-11-10 05:02:50 +0100 (Fri, 10 Nov 2017) New Revision: 285 Added: pkg/CHNOSZ/inst/extdata/cpetc/bluered.txt Modified: pkg/CHNOSZ/DESCRIPTION pkg/CHNOSZ/NAMESPACE pkg/CHNOSZ/R/util.plot.R pkg/CHNOSZ/man/berman.Rd pkg/CHNOSZ/man/diagram.Rd pkg/CHNOSZ/man/examples.Rd pkg/CHNOSZ/man/extdata.Rd pkg/CHNOSZ/man/findit.Rd pkg/CHNOSZ/man/nonideal.Rd Log: ZC.col(): use precomputed palette; remove Imports:colorspace from DESCRIPTION Modified: pkg/CHNOSZ/DESCRIPTION =================================================================== --- pkg/CHNOSZ/DESCRIPTION 2017-11-09 13:22:52 UTC (rev 284) +++ pkg/CHNOSZ/DESCRIPTION 2017-11-10 04:02:50 UTC (rev 285) @@ -1,12 +1,12 @@ -Date: 2017-11-09 +Date: 2017-11-10 Package: CHNOSZ -Version: 1.1.0-82 +Version: 1.1.0-83 Title: Thermodynamic Calculations for Geobiochemistry Author: Jeffrey Dick Maintainer: Jeffrey Dick Depends: R (>= 3.1.0) Suggests: limSolve, testthat, knitr, rmarkdown, tufte, RSVGTipsDevice -Imports: grDevices, graphics, stats, utils, colorspace +Imports: grDevices, graphics, stats, utils Description: An integrated set of tools for thermodynamic calculations in geochemistry and compositional biology. Thermodynamic properties are taken from a database for minerals and inorganic and organic aqueous species including biomolecules, or from amino acid Modified: pkg/CHNOSZ/NAMESPACE =================================================================== --- pkg/CHNOSZ/NAMESPACE 2017-11-09 13:22:52 UTC (rev 284) +++ pkg/CHNOSZ/NAMESPACE 2017-11-10 04:02:50 UTC (rev 285) @@ -75,7 +75,4 @@ "uniroot", "median") importFrom("utils", "browseURL", "capture.output", "combn", "demo", "example", "head", "installed.packages", "read.csv", "tail", - "write.csv", "write.table") - -# Imports from other packages -importFrom("colorspace", "diverge_hcl") + "write.csv", "write.table", "read.table") Modified: pkg/CHNOSZ/R/util.plot.R =================================================================== --- pkg/CHNOSZ/R/util.plot.R 2017-11-09 13:22:52 UTC (rev 284) +++ pkg/CHNOSZ/R/util.plot.R 2017-11-10 04:02:50 UTC (rev 285) @@ -179,7 +179,10 @@ z <- z * 999/diff(range(z)) z <- round(z - min(z)) + 1 # diverging (blue - light grey - red) palette - dcol <- colorspace::diverge_hcl(1000, c = 100, l = c(50, 90), power = 1) + # dcol <- colorspace::diverge_hcl(1000, c = 100, l = c(50, 90), power = 1) + # use precomputed values + file <- system.file("extdata/cpetc/bluered.txt", package = "CHNOSZ") + dcol <- read.table(file, as.is=TRUE)[[1]] # reverse the palette so red is at lower ZC (more reduced) rev(dcol)[z] } Added: pkg/CHNOSZ/inst/extdata/cpetc/bluered.txt =================================================================== --- pkg/CHNOSZ/inst/extdata/cpetc/bluered.txt (rev 0) +++ pkg/CHNOSZ/inst/extdata/cpetc/bluered.txt 2017-11-10 04:02:50 UTC (rev 285) @@ -0,0 +1,1000 @@ +"#4A6FE3" +"#4B6FE3" +"#4B70E3" +"#4C70E3" +"#4C70E3" +"#4D70E3" +"#4D71E3" +"#4D71E2" +"#4E71E2" +"#4E71E2" +"#4F72E2" +"#4F72E2" +"#5072E2" +"#5072E2" +"#5172E2" +"#5173E2" +"#5173E2" +"#5273E2" +"#5273E2" +"#5374E2" +"#5374E2" +"#5374E2" +"#5474E2" +"#5475E2" +"#5575E2" +"#5575E2" +"#5575E2" +"#5675E2" +"#5676E2" +"#5776E2" +"#5776E2" +"#5776E2" +"#5877E2" +"#5877E2" +"#5977E2" +"#5977E2" +"#5978E2" +"#5A78E2" +"#5A78E2" +"#5B78E2" +"#5B78E2" +"#5B79E2" +"#5C79E2" +"#5C79E1" +"#5D79E1" +"#5D7AE1" +"#5D7AE1" +"#5E7AE1" +"#5E7AE1" +"#5E7BE1" +"#5F7BE1" +"#5F7BE1" +"#5F7BE1" +"#607BE1" +"#607CE1" +"#617CE1" +"#617CE1" +"#617CE1" +"#627DE1" +"#627DE1" +"#627DE1" +"#637DE1" +"#637DE1" +"#637EE1" +"#647EE1" +"#647EE1" +"#657EE1" +"#657FE1" +"#657FE1" +"#667FE1" +"#667FE1" +"#6680E1" +"#6780E1" +"#6780E1" +"#6780E1" +"#6880E1" +"#6881E1" +"#6881E1" +"#6981E1" +"#6981E1" +"#6982E1" +"#6A82E1" +"#6A82E1" +"#6A82E1" +"#6B83E1" +"#6B83E1" +"#6B83E1" +"#6C83E1" +"#6C83E1" +"#6C84E1" +"#6D84E1" +"#6D84E1" +"#6D84E1" +"#6E85E1" +"#6E85E1" +"#6E85E1" +"#6F85E1" +"#6F85E1" +"#6F86E1" +"#7086E1" +"#7086E1" +"#7086E1" +"#7187E1" +"#7187E1" +"#7187E1" +"#7287E1" +"#7288E1" +"#7288E1" +"#7388E1" +"#7388E1" +"#7388E1" +"#7489E1" +"#7489E1" +"#7489E1" +"#7589E1" +"#758AE1" +"#758AE1" +"#768AE1" +"#768AE1" +"#768AE1" +"#778BE1" +"#778BE1" +"#778BE1" +"#778BE1" +"#788CE1" +"#788CE1" +"#788CE1" +"#798CE1" +"#798DE1" +"#798DE1" +"#7A8DE1" +"#7A8DE1" +"#7A8DE1" +"#7B8EE1" +"#7B8EE1" +"#7B8EE1" +"#7C8EE1" +"#7C8FE1" +"#7C8FE1" +"#7C8FE1" +"#7D8FE1" +"#7D8FE1" +"#7D90E1" +"#7E90E1" +"#7E90E1" +"#7E90E1" +"#7F91E1" +"#7F91E1" +"#7F91E1" +"#8091E1" +"#8091E1" +"#8092E1" +"#8092E1" +"#8192E1" +"#8192E1" +"#8193E1" +"#8293E1" +"#8293E1" +"#8293E1" +"#8394E1" +"#8394E1" +"#8394E1" +"#8494E1" +"#8494E1" +"#8495E1" +"#8495E1" +"#8595E1" +"#8595E1" +"#8596E1" +"#8696E1" +"#8696E1" +"#8696E1" +"#8796E1" +"#8797E1" +"#8797E1" +"#8797E1" +"#8897E1" +"#8898E1" +"#8898E1" +"#8998E1" +"#8998E1" +"#8999E1" +"#8A99E1" +"#8A99E1" +"#8A99E1" +"#8A99E1" +"#8B9AE1" +"#8B9AE1" +"#8B9AE1" +"#8C9AE1" +"#8C9BE1" +"#8C9BE1" +"#8C9BE1" +"#8D9BE1" +"#8D9BE1" +"#8D9CE1" +"#8E9CE1" +"#8E9CE1" +"#8E9CE1" +"#8F9DE1" +"#8F9DE1" +"#8F9DE1" +"#8F9DE1" +"#909EE1" +"#909EE1" +"#909EE1" +"#919EE1" +"#919EE1" +"#919FE1" +"#919FE1" +"#929FE1" +"#929FE1" +"#92A0E1" +"#93A0E1" +"#93A0E1" +"#93A0E2" +"#93A1E2" +"#94A1E2" +"#94A1E2" +"#94A1E2" +"#95A1E2" +"#95A2E2" +"#95A2E2" +"#95A2E2" +"#96A2E2" +"#96A3E2" +"#96A3E2" +"#97A3E2" +"#97A3E2" +"#97A3E2" +"#98A4E2" +"#98A4E2" +"#98A4E2" +"#98A4E2" +"#99A5E2" +"#99A5E2" +"#99A5E2" +"#9AA5E2" +"#9AA6E2" +"#9AA6E2" +"#9AA6E2" +"#9BA6E2" +"#9BA6E2" +"#9BA7E2" +"#9CA7E2" +"#9CA7E2" +"#9CA7E2" +"#9CA8E2" +"#9DA8E2" +"#9DA8E2" +"#9DA8E2" +"#9EA9E2" +"#9EA9E2" +"#9EA9E2" +"#9EA9E2" +"#9FA9E2" +"#9FAAE2" +"#9FAAE2" +"#A0AAE2" +"#A0AAE2" +"#A0ABE2" +"#A0ABE2" +"#A1ABE2" +"#A1ABE2" +"#A1ABE2" +"#A1ACE2" +"#A2ACE2" +"#A2ACE2" +"#A2ACE2" +"#A3ADE2" +"#A3ADE2" +"#A3ADE2" +"#A3ADE2" +"#A4AEE2" +"#A4AEE2" +"#A4AEE2" +"#A5AEE2" +"#A5AEE2" +"#A5AFE2" +"#A5AFE2" +"#A6AFE2" +"#A6AFE2" +"#A6B0E2" +"#A7B0E2" +"#A7B0E2" +"#A7B0E2" +"#A7B1E2" +"#A8B1E2" +"#A8B1E2" +"#A8B1E2" +"#A9B1E2" +"#A9B2E2" +"#A9B2E2" +"#A9B2E2" +"#AAB2E2" +"#AAB3E2" +"#AAB3E2" +"#AAB3E2" +"#ABB3E2" +"#ABB4E2" +"#ABB4E2" +"#ACB4E2" +"#ACB4E2" +"#ACB4E2" +"#ACB5E2" +"#ADB5E2" +"#ADB5E2" +"#ADB5E2" +"#AEB6E2" +"#AEB6E2" +"#AEB6E2" +"#AEB6E2" +"#AFB7E2" +"#AFB7E2" +"#AFB7E2" +"#B0B7E2" +"#B0B7E2" +"#B0B8E2" +"#B0B8E2" +"#B1B8E2" +"#B1B8E2" +"#B1B9E2" +"#B1B9E2" +"#B2B9E2" +"#B2B9E2" +"#B2BAE2" +"#B3BAE2" +"#B3BAE3" +"#B3BAE3" +"#B3BAE3" +"#B4BBE3" +"#B4BBE3" +"#B4BBE3" +"#B5BBE3" +"#B5BCE3" +"#B5BCE3" +"#B5BCE3" +"#B6BCE3" +"#B6BDE3" +"#B6BDE3" +"#B6BDE3" +"#B7BDE3" +"#B7BDE3" +"#B7BEE3" +"#B8BEE3" +"#B8BEE3" +"#B8BEE3" +"#B8BFE3" +"#B9BFE3" +"#B9BFE3" +"#B9BFE3" +"#BAC0E3" +"#BAC0E3" +"#BAC0E3" +"#BAC0E3" +"#BBC0E3" +"#BBC1E3" +"#BBC1E3" +"#BBC1E3" +"#BCC1E3" +"#BCC2E3" +"#BCC2E3" +"#BDC2E3" +"#BDC2E3" +"#BDC3E3" +"#BDC3E3" +"#BEC3E3" +"#BEC3E3" +"#BEC3E3" +"#BEC4E3" +"#BFC4E3" +"#BFC4E3" +"#BFC4E3" +"#C0C5E3" +"#C0C5E3" +"#C0C5E3" +"#C0C5E3" +"#C1C6E3" +"#C1C6E3" +"#C1C6E3" +"#C2C6E3" +"#C2C6E3" +"#C2C7E3" +"#C2C7E3" +"#C3C7E3" +"#C3C7E3" +"#C3C8E3" +"#C3C8E3" +"#C4C8E3" +"#C4C8E3" +"#C4C9E3" +"#C5C9E3" +"#C5C9E3" +"#C5C9E3" +"#C5CAE3" +"#C6CAE3" +"#C6CAE3" +"#C6CAE3" +"#C6CAE3" +"#C7CBE3" +"#C7CBE3" +"#C7CBE3" +"#C8CBE3" +"#C8CCE3" +"#C8CCE3" +"#C8CCE3" +"#C9CCE3" +"#C9CDE3" +"#C9CDE3" +"#CACDE3" +"#CACDE3" +"#CACDE3" +"#CACEE3" +"#CBCEE3" +"#CBCEE3" +"#CBCEE3" +"#CBCFE3" +"#CCCFE3" +"#CCCFE3" +"#CCCFE3" +"#CDD0E3" +"#CDD0E3" +"#CDD0E3" +"#CDD0E3" +"#CED1E3" +"#CED1E3" +"#CED1E3" +"#CED1E3" +"#CFD1E3" +"#CFD2E3" +"#CFD2E3" +"#D0D2E3" +"#D0D2E3" +"#D0D3E3" +"#D0D3E3" +"#D1D3E3" +"#D1D3E3" +"#D1D4E3" +"#D1D4E3" +"#D2D4E3" +"#D2D4E3" +"#D2D5E3" +"#D3D5E3" +"#D3D5E3" +"#D3D5E3" +"#D3D5E3" +"#D4D6E3" +"#D4D6E3" +"#D4D6E3" +"#D4D6E3" +"#D5D7E3" +"#D5D7E3" +"#D5D7E3" +"#D6D7E3" +"#D6D8E3" +"#D6D8E3" +"#D6D8E3" +"#D7D8E3" +"#D7D9E3" +"#D7D9E3" +"#D8D9E3" +"#D8D9E3" +"#D8D9E3" +"#D8DAE3" +"#D9DAE3" +"#D9DAE3" +"#D9DAE3" +"#D9DBE3" +"#DADBE3" +"#DADBE3" +"#DADBE3" +"#DBDCE3" +"#DBDCE3" +"#DBDCE3" +"#DBDCE3" +"#DCDDE3" +"#DCDDE3" +"#DCDDE3" +"#DCDDE3" +"#DDDDE3" +"#DDDEE3" +"#DDDEE3" +"#DEDEE3" +"#DEDEE3" +"#DEDFE2" +"#DEDFE2" +"#DFDFE2" +"#DFDFE2" +"#DFE0E2" +"#DFE0E2" +"#E0E0E2" +"#E0E0E2" +"#E0E1E2" +"#E1E1E2" +"#E1E1E2" +"#E1E1E2" +"#E1E1E2" +"#E2E2E2" +"#E2E2E2" +"#E2E2E2" +"#E2E2E2" +"#E2E2E2" +"#E2E2E2" +"#E3E1E1" +"#E3E1E1" +"#E3E1E1" +"#E3E0E1" +"#E3E0E0" +"#E3E0E0" +"#E3DFE0" +"#E3DFE0" +"#E3DFDF" +"#E3DEDF" +"#E3DEDF" +"#E3DEDF" +"#E3DEDE" +"#E3DDDE" +"#E3DDDE" +"#E3DDDE" +"#E3DCDD" +"#E3DCDD" +"#E3DCDD" +"#E3DBDD" +"#E3DBDC" +"#E4DBDC" +"#E4DADC" +"#E4DADC" +"#E4DADB" +"#E4DADB" +"#E4D9DB" +"#E4D9DB" +"#E4D9DA" +"#E4D8DA" +"#E4D8DA" +"#E4D8DA" +"#E4D7D9" +"#E4D7D9" +"#E4D7D9" +"#E4D6D9" +"#E4D6D8" +"#E4D6D8" +"#E4D6D8" +"#E4D5D8" +"#E4D5D7" +"#E4D5D7" +"#E4D4D7" +"#E4D4D7" +"#E4D4D6" +"#E4D3D6" +"#E4D3D6" +"#E4D3D6" +"#E5D2D5" +"#E5D2D5" +"#E5D2D5" +"#E5D2D5" +"#E5D1D4" +"#E5D1D4" +"#E5D1D4" +"#E5D0D4" +"#E5D0D3" +"#E5D0D3" +"#E5CFD3" +"#E5CFD3" +"#E5CFD2" +"#E5CED2" +"#E5CED2" +"#E5CED2" +"#E5CED1" +"#E5CDD1" +"#E5CDD1" +"#E5CDD1" +"#E5CCD0" +"#E5CCD0" +"#E5CCD0" +"#E5CBD0" +"#E5CBCF" +"#E5CBCF" +"#E5CACF" +"#E5CACF" +"#E5CACE" +"#E5CACE" +"#E5C9CE" +"#E5C9CE" +"#E5C9CD" +"#E5C8CD" +"#E5C8CD" +"#E5C8CD" +"#E5C7CD" +"#E5C7CC" +"#E5C7CC" +"#E5C6CC" +"#E5C6CC" +"#E5C6CB" +"#E6C6CB" +"#E6C5CB" +"#E6C5CB" +"#E6C5CA" +"#E6C4CA" +"#E6C4CA" +"#E6C4CA" +"#E6C3C9" +"#E6C3C9" +"#E6C3C9" +"#E6C3C9" +"#E6C2C8" +"#E6C2C8" +"#E6C2C8" +"#E6C1C8" +"#E6C1C7" +"#E6C1C7" +"#E6C0C7" +"#E6C0C7" +"#E6C0C6" +"#E6BFC6" +"#E6BFC6" +"#E6BFC6" +"#E6BFC5" +"#E6BEC5" +"#E6BEC5" +"#E6BEC5" +"#E6BDC4" +"#E6BDC4" +"#E6BDC4" +"#E6BCC4" +"#E6BCC3" +"#E6BCC3" +"#E6BBC3" +"#E6BBC3" +"#E6BBC2" +"#E6BBC2" +"#E6BAC2" +"#E6BAC2" +"#E6BAC1" +"#E6B9C1" +"#E6B9C1" +"#E6B9C1" +"#E6B8C0" +"#E6B8C0" +"#E6B8C0" +"#E6B7C0" +"#E6B7BF" +"#E6B7BF" +"#E6B7BF" +"#E6B6BF" +"#E6B6BE" +"#E6B6BE" +"#E6B5BE" +"#E6B5BE" +"#E6B5BD" +"#E6B4BD" +"#E6B4BD" +"#E6B4BD" +"#E6B3BC" +"#E6B3BC" +"#E6B3BC" +"#E6B2BC" +"#E6B2BC" +"#E6B2BB" +"#E6B2BB" +"#E6B1BB" +"#E6B1BB" +"#E6B1BA" +"#E6B0BA" +"#E6B0BA" +"#E6B0BA" +"#E6AFB9" +"#E6AFB9" +"#E6AFB9" +"#E6AEB9" +"#E6AEB8" +"#E6AEB8" +"#E6AEB8" +"#E6ADB8" +"#E6ADB7" +"#E6ADB7" +"#E6ACB7" +"#E6ACB7" +"#E6ACB6" +"#E6ABB6" +"#E6ABB6" +"#E6ABB6" +"#E5AAB5" +"#E5AAB5" +"#E5AAB5" +"#E5AAB5" +"#E5A9B4" +"#E5A9B4" +"#E5A9B4" +"#E5A8B4" +"#E5A8B3" +"#E5A8B3" +"#E5A7B3" +"#E5A7B3" +"#E5A7B2" +"#E5A6B2" +"#E5A6B2" +"#E5A6B2" +"#E5A6B2" +"#E5A5B1" +"#E5A5B1" +"#E5A5B1" +"#E5A4B1" +"#E5A4B0" +"#E5A4B0" +"#E5A3B0" +"#E5A3B0" +"#E5A3AF" +"#E5A2AF" +"#E5A2AF" +"#E5A2AF" +"#E5A1AE" +"#E5A1AE" +"#E5A1AE" +"#E5A1AE" +"#E5A0AD" +"#E5A0AD" +"#E5A0AD" +"#E59FAD" +"#E59FAC" +"#E59FAC" +"#E59EAC" +"#E59EAC" +"#E59EAB" +"#E59DAB" +"#E59DAB" +"#E59DAB" +"#E59DAA" +"#E49CAA" +"#E49CAA" +"#E49CAA" +"#E49BAA" +"#E49BA9" +"#E49BA9" +"#E49AA9" +"#E49AA9" +"#E49AA8" +"#E499A8" +"#E499A8" +"#E499A8" +"#E498A7" +"#E498A7" +"#E498A7" +"#E498A7" +"#E497A6" +"#E497A6" +"#E497A6" +"#E496A6" +"#E496A5" +"#E496A5" +"#E495A5" +"#E495A5" +"#E495A4" +"#E494A4" +"#E494A4" +"#E494A4" +"#E493A3" +"#E493A3" +"#E393A3" +"#E393A3" +"#E392A3" +"#E392A2" +"#E392A2" +"#E391A2" +"#E391A2" +"#E391A1" +"#E390A1" +"#E390A1" +"#E390A1" +"#E38FA0" +"#E38FA0" +"#E38FA0" +"#E38EA0" +"#E38E9F" +"#E38E9F" +"#E38E9F" +"#E38D9F" +"#E38D9E" +"#E38D9E" +"#E38C9E" +"#E38C9E" +"#E38C9D" +"#E28B9D" +"#E28B9D" +"#E28B9D" +"#E28A9D" +"#E28A9C" +"#E28A9C" +"#E2899C" +"#E2899C" +"#E2899B" +"#E2889B" +"#E2889B" +"#E2889B" +"#E2879A" +"#E2879A" +"#E2879A" +"#E2879A" +"#E28699" +"#E28699" +"#E28699" +"#E28599" +"#E28598" +"#E18598" +"#E18498" +"#E18498" +"#E18498" +"#E18397" +"#E18397" +"#E18397" +"#E18297" +"#E18296" +"#E18296" +"#E18196" +"#E18196" +"#E18195" +"#E18095" +"#E18095" +"#E18095" +"#E18094" +"#E17F94" +"#E17F94" +"#E07F94" +"#E07E93" +"#E07E93" +"#E07E93" +"#E07D93" +"#E07D93" +"#E07D92" +"#E07C92" +"#E07C92" +"#E07C92" +"#E07B91" +"#E07B91" +"#E07B91" +"#E07A91" +"#E07A90" +"#E07A90" +"#E07990" +"#DF7990" +"#DF798F" +"#DF788F" +"#DF788F" +"#DF788F" +"#DF778E" +"#DF778E" +"#DF778E" +"#DF768E" +"#DF768E" +"#DF768D" +"#DF758D" +"#DF758D" +"#DF758D" +"#DF758C" +"#DF748C" +"#DE748C" +"#DE748C" +"#DE738B" +"#DE738B" +"#DE738B" +"#DE728B" +"#DE728A" +"#DE728A" +"#DE718A" +"#DE718A" +"#DE7189" +"#DE7089" +"#DE7089" +"#DE7089" +"#DE6F89" +"#DD6F88" +"#DD6F88" +"#DD6E88" +"#DD6E88" +"#DD6E87" +"#DD6D87" +"#DD6D87" +"#DD6D87" +"#DD6C86" +"#DD6C86" +"#DD6C86" +"#DD6B86" +"#DD6B85" +"#DD6B85" +"#DC6A85" +"#DC6A85" +"#DC6A85" +"#DC6984" +"#DC6984" +"#DC6984" +"#DC6884" +"#DC6883" +"#DC6883" +"#DC6783" +"#DC6783" +"#DC6782" +"#DC6682" +"#DC6682" +"#DB6582" +"#DB6581" +"#DB6581" +"#DB6481" +"#DB6481" +"#DB6481" +"#DB6380" +"#DB6380" +"#DB6380" +"#DB6280" +"#DB627F" +"#DB627F" +"#DB617F" +"#DA617F" +"#DA617E" +"#DA607E" +"#DA607E" +"#DA607E" +"#DA5F7D" +"#DA5F7D" +"#DA5F7D" +"#DA5E7D" +"#DA5E7D" +"#DA5E7C" +"#DA5D7C" +"#D95D7C" +"#D95C7C" +"#D95C7B" +"#D95C7B" +"#D95B7B" +"#D95B7B" +"#D95B7A" +"#D95A7A" +"#D95A7A" +"#D95A7A" +"#D9597A" +"#D95979" +"#D85979" +"#D85879" +"#D85879" +"#D85778" +"#D85778" +"#D85778" +"#D85678" +"#D85677" +"#D85677" +"#D85577" +"#D85577" +"#D85576" +"#D75476" +"#D75476" +"#D75376" +"#D75376" +"#D75375" +"#D75275" +"#D75275" +"#D75275" +"#D75174" +"#D75174" +"#D75174" +"#D65074" +"#D65073" +"#D64F73" +"#D64F73" +"#D64F73" +"#D64E72" +"#D64E72" +"#D64D72" +"#D64D72" +"#D64D72" +"#D64C71" +"#D54C71" +"#D54C71" +"#D54B71" +"#D54B70" +"#D54A70" +"#D54A70" +"#D54A70" +"#D5496F" +"#D5496F" +"#D5486F" +"#D5486F" +"#D4486F" +"#D4476E" +"#D4476E" +"#D4466E" +"#D4466E" +"#D4466D" +"#D4456D" +"#D4456D" +"#D4446D" +"#D4446C" +"#D3446C" +"#D3436C" +"#D3436C" +"#D3426C" +"#D3426B" +"#D3426B" +"#D3416B" +"#D3416B" +"#D3406A" +"#D3406A" +"#D33F6A" Modified: pkg/CHNOSZ/man/berman.Rd =================================================================== --- pkg/CHNOSZ/man/berman.Rd 2017-11-09 13:22:52 UTC (rev 284) +++ pkg/CHNOSZ/man/berman.Rd 2017-11-10 04:02:50 UTC (rev 285) @@ -102,7 +102,7 @@ \references{ Anderson, G. M. (2005) \emph{Thermodynamics of Natural Systems}, 2nd ed., Cambridge University Press, 648 p. \url{http://www.worldcat.org/oclc/474880901} -Berman, R. G. (1988) Internally-consistent thermodynamic data for minerals in the system Na{\s2}O?K{\s2}O?CaO?MgO?FeO?Fe{\s2}O{\s3}?Al{\s2}O{\s3}?SiO{\s2}?TiO{\s2}?H{\s2}O?CO{\s2}. \emph{J. Petrol.} \bold{29}, 445-522. \url{https://doi.org/10.1093/petrology/29.2.445} +Berman, R. G. (1988) Internally-consistent thermodynamic data for minerals in the system Na{\s2}O-K{\s2}O-CaO-MgO-FeO-Fe{\s2}O{\s3}-Al{\s2}O{\s3}-SiO{\s2}-TiO{\s2}-H{\s2}O-CO{\s2}. \emph{J. Petrol.} \bold{29}, 445-522. \url{https://doi.org/10.1093/petrology/29.2.445} Helgeson, H. C., Delany, J. M., Nesbitt, H. W. and Bird, D. K. (1978) Summary and critique of the thermodynamic properties of rock-forming minerals. \emph{Am. J. Sci.} \bold{278-A}, 1--229. \url{http://www.worldcat.org/oclc/13594862} Modified: pkg/CHNOSZ/man/diagram.Rd =================================================================== --- pkg/CHNOSZ/man/diagram.Rd 2017-11-09 13:22:52 UTC (rev 284) +++ pkg/CHNOSZ/man/diagram.Rd 2017-11-10 04:02:50 UTC (rev 285) @@ -136,7 +136,7 @@ \section{Activity Coefficients}{ The wording in this page and names of variables in functions refer exclusively to \samp{activities} of aqueous species. -However, if activity coefficients are calculated (using the \code{IS} argument in \code{\link{affinity}}), then these variables are effectively transformed to molalities (see \code{tests/testthat/test-logmolality.R}). +However, if activity coefficients are calculated (using the \code{IS} argument in \code{\link{affinity}}), then these variables are effectively transformed to molalities (see \code{tests/testthat/} \code{test-logmolality.R}). So that the labels on diagrams are adjusted accordingly, \code{\link{diagram}} sets the \code{use.molality} argument of \code{\link{axis.label}} to TRUE if \code{IS} was supplied as an argument to \code{\link{affinity}}. The labeling as molality takes effect even if \code{IS} is set to 0; this way, by including (or not) the \code{IS = 0} argument to \code{affinity}, the user decides whether to label aqueous species variables as molality (or activity) for calculations at zero ionic strength (where molality = activity). } Modified: pkg/CHNOSZ/man/examples.Rd =================================================================== --- pkg/CHNOSZ/man/examples.Rd 2017-11-09 13:22:52 UTC (rev 284) +++ pkg/CHNOSZ/man/examples.Rd 2017-11-10 04:02:50 UTC (rev 285) @@ -26,11 +26,9 @@ \code{examples} runs all the examples in the documentation for the package. \code{\link{example}} is called for each topic with \code{ask} set to \code{FALSE} (so all of the figures are shown without prompting the user). -\code{demos} is a function to run other examples that are provided as \code{\link{demo}s}. -\code{\link{demo}} is called with settings to not echo the source code and to not ask before making each plot. +\code{demos} runs all the \code{\link{demo}s} in the package. The demo(s) to run is/are specified by \code{which}; the default is to run them in the order of the list below. -Demos that are displayed on the CHNOSZ website (\url{http://chnosz.net/demos}) are indicated with an asterisk. -See the comments in the source code for more information about each demo. +(Demos that are displayed on the CHNOSZ website (\url{http://chnosz.net/demos}) are indicated with an asterisk.) \tabular{ll}{ \code{sources} \tab Cross-check the reference list with the thermodynamic database \cr @@ -48,12 +46,12 @@ \code{mosaic} \tab * Eh-pH diagram with two sets of changing basis species (Garrels and Christ, 1965) \cr \code{copper} \tab * Another example of \code{\link{mosaic}}: complexation of Cu with glycine (Aksu and Doyle, 2001) \cr \code{solubility} \tab * Solubility of calcite (cf. Manning et al., 2013) or \CO2 (cf. Stumm and Morgan, 1996) \cr - \code{wjd} \tab * Gibbs energy minimization: prebiological atmospheres (Dayhoff et al., 1964) and cell periphery of yeast \cr + \code{wjd} \tab * \eqn{G}{G} minimization: prebiological atmospheres (Dayhoff et al., 1964) and cell periphery of yeast \cr \code{dehydration} \tab * \logK of dehydration reactions; SVG file contains tooltips and links \cr \code{bugstab} \tab * Formation potential of microbial proteins in colorectal cancer (Dick, 2016) \cr \code{Shh} \tab * Affinities of transcription factors relative to Sonic hedgehog (Dick, 2015) \cr \code{activity_ratios} \tab * Mineral stability plots with activity ratios on the axes \cr - \code{adenine} \tab * HKF parameters regressed from heat capacity and volume of aqueous adenine (Lowe et al., 2017) \cr + \code{adenine} \tab * HKF regression of heat capacity and volume of aqueous adenine (Lowe et al., 2017) \cr \code{DEW} \tab * Deep Earth Water (DEW) model for high pressures (Sverjensky et al., 2014a and 2014b) \cr \code{lambda} \tab * Effects of lambda transition on thermodynamic properties of quartz (Berman, 1988) \cr \code{TCA} \tab * Standard Gibbs energies of the tricarboxylic (citric) acid cycle (Canovas and Shock, 2016) \cr @@ -81,7 +79,7 @@ Amend, J. P. and Shock, E. L. (2001) Energetics of overall metabolic reactions of thermophilic and hyperthermophilic Archaea and Bacteria. \emph{FEMS Microbiol. Rev.} \bold{25}, 175--243. \url{https://doi.org/10.1016/S0168-6445(00)00062-0} -Berman, R. G. (1988) Internally-consistent thermodynamic data for minerals in the system Na{\s2}O?K{\s2}O?CaO?MgO?FeO?Fe{\s2}O{\s3}?Al{\s2}O{\s3}?SiO{\s2}?TiO{\s2}?H{\s2}O?CO{\s2}. \emph{J. Petrol.} \bold{29}, 445-522. \url{https://doi.org/10.1093/petrology/29.2.445} +Berman, R. G. (1988) Internally-consistent thermodynamic data for minerals in the system Na{\s2}O-K{\s2}O-CaO-MgO-FeO-Fe{\s2}O{\s3}-Al{\s2}O{\s3}-SiO{\s2}-TiO{\s2}-H{\s2}O-CO{\s2}. \emph{J. Petrol.} \bold{29}, 445-522. \url{https://doi.org/10.1093/petrology/29.2.445} Canovas, P. A., III and Shock, E. L. (2016) Geobiochemistry of metabolism: Standard state thermodynamic properties of the citric acid cycle. \emph{Geochim. Cosmochim. Acta} \bold{195}, 293--322. \url{https://doi.org/10.1016/j.gca.2016.08.028} @@ -120,10 +118,6 @@ \dontshow{opar <- par(no.readonly=TRUE)} demos(c("ORP", "NaCl")) \dontshow{par(opar)} -\dontrun{ -# use the following to run examples in all help topics -examples()} } - \concept{Other tools} Modified: pkg/CHNOSZ/man/extdata.Rd =================================================================== --- pkg/CHNOSZ/man/extdata.Rd 2017-11-09 13:22:52 UTC (rev 284) +++ pkg/CHNOSZ/man/extdata.Rd 2017-11-10 04:02:50 UTC (rev 285) @@ -43,6 +43,7 @@ \item \code{SC10_Rainbow.csv} Values of temperature (\degC, pH and logarithms of activity of \CO2, \H2, \NH4plus, \H2S and \CH4 for mixing of seawater and hydrothermal fluid at Rainbow field (Mid-Atlantic Ridge), taken from Shock and Canovas, 2010. See the vignette \code{anintro.Rmd} for an example that uses this file. \item \code{SS98_Fig5a.csv}, \code{SS98_Fig5b.csv} Values of logarithm of fugacity of \O2 and pH as a function of temperature for mixing of seawater and hydrothermal fluid, digitized from Figs. 5a and b of Shock and Schulte, 1998. See the vignette \code{anintro.Rmd} for an example that uses this file. \item \code{rubisco.csv} UniProt IDs for Rubisco, ranges of optimal growth temperature of organisms, domain and name of organisms, and URL of reference for growth temperature, from Dick, 2014. See the vignette \code{anintro.Rmd} for an example that uses this file. + \item \code{bluered.txt} Blue - light grey - red color palette, computed using \CRANpkg{colorspace}\code{::diverge_hcl(1000,} \code{c = 100, l = c(50, 90), power = 1)}. This is used by \code{\link{ZC.col}}. } Files in \code{fasta} contain protein sequences: @@ -111,7 +112,7 @@ \references{ Bazarkina, E. F., Zotov, A. V. and Akinfiev, N. N. (2010) Pressure-dependent stability of cadmium chloride complexes: Potentiometric measurements at 1?1000 bar and 25?C. \emph{Geol. Ore Deposits} \bold{52}, 167--178. \url{https://doi.org/10.1134/S1075701510020054} -Berman, R. G. (1988) Internally-consistent thermodynamic data for minerals in the system Na{\s2}O?K{\s2}O?CaO?MgO?FeO?Fe{\s2}O{\s3}?Al{\s2}O{\s3}?SiO{\s2}?TiO{\s2}?H{\s2}O?CO{\s2}. \emph{J. Petrol.} \bold{29}, 445-522. \url{https://doi.org/10.1093/petrology/29.2.445} +Berman, R. G. (1988) Internally-consistent thermodynamic data for minerals in the system Na{\s2}O-K{\s2}O-CaO-MgO-FeO-Fe{\s2}O{\s3}-Al{\s2}O{\s3}-SiO{\s2}-TiO{\s2}-H{\s2}O-CO{\s2}. \emph{J. Petrol.} \bold{29}, 445-522. \url{https://doi.org/10.1093/petrology/29.2.445} Dayhoff, M. O. and Lippincott, E. R. and Eck, R. V. (1964) Thermodynamic Equilibria In Prebiological Atmospheres. \emph{Science} \bold{146}, 1461--1464. \url{https://doi.org/10.1126/science.146.3650.1461} @@ -133,8 +134,6 @@ Huh, W. K., Falvo, J. V., Gerke, L. C., Carroll, A. S., Howson, R. W., Weissman, J. S. and O'Shea, E. K. (2003) Global analysis of protein localization in budding yeast. \emph{Nature} \bold{425}(6959), 686--691. \url{https://doi.org/10.1038/nature02026} -HAMAP system. HAMAP FTP directory, \url{ftp://ftp.expasy.org/databases/hamap/} - Hn?dkovsk?, L., Wood, R. H. and Majer, V. (1996) Volumes of aqueous solutions of \CH4, \CO2, \H2S, and \NH3 at temperatures from 298.15 K to 705 K and pressures to 35 MPa. \emph{J. Chem. Thermodyn.} \bold{28}, 125--142. \url{https://doi.org/10.1006/jcht.1996.0011} Hn?dkovsk?, L. and Wood, R. H. (1997) Apparent molar heat capacities of aqueous solutions of \CH4, \CO2, \H2S, and \NH3 at temperatures from 304 K to 704 K at a pressure of 28 MPa. \emph{J. Chem. Thermodyn.} \bold{29}, 731--747. \url{https://doi.org/10.1006/jcht.1997.0192} Modified: pkg/CHNOSZ/man/findit.Rd =================================================================== --- pkg/CHNOSZ/man/findit.Rd 2017-11-09 13:22:52 UTC (rev 284) +++ pkg/CHNOSZ/man/findit.Rd 2017-11-10 04:02:50 UTC (rev 285) @@ -50,16 +50,16 @@ These settings have been selected to be able to run the function quickly in the higher dimensions. Detailed studies of a system might have to use more iterations and/or higher resolutions. - \tabular{rrrrr}{ - \code{nd} \tab \code{niter} \tab \code{res} \tab grid points (\code{res^nd}) \tab \code{rat} \cr - 1 \tab 4 \tab 128 \tab 128 \tab 0.7 \cr - 2 \tab 6 \tab 64 \tab 4096 \tab 0.7 \cr - 3 \tab 6 \tab 16 \tab 4096 \tab 0.8 \cr - 4 \tab 8 \tab 8 \tab 4096 \tab 0.9 \cr - 5 \tab 12 \tab 6 \tab 7776 \tab 0.9 \cr - 6 \tab 12 \tab 4 \tab 4096 \tab 0.95 \cr - 7 \tab 12 \tab 4 \tab 16384 \tab 0.95 \cr - } +\tabular{rrrrr}{ + \code{nd} \tab \code{niter} \tab \code{res} \tab grid points (\code{res^nd}) \tab \code{rat} \cr + 1 \tab 4 \tab 128 \tab 128 \tab 0.7 \cr + 2 \tab 6 \tab 64 \tab 4096 \tab 0.7 \cr + 3 \tab 6 \tab 16 \tab 4096 \tab 0.8 \cr + 4 \tab 8 \tab 8 \tab 4096 \tab 0.9 \cr + 5 \tab 12 \tab 6 \tab 7776 \tab 0.9 \cr + 6 \tab 12 \tab 4 \tab 4096 \tab 0.95 \cr + 7 \tab 12 \tab 4 \tab 16384 \tab 0.95 \cr +} The function performs \code{niter} iterations. At first, the limits of the parameters given in \code{lims} define the extent of a \eqn{nd}-dimensional box around the space of interest. Modified: pkg/CHNOSZ/man/nonideal.Rd =================================================================== --- pkg/CHNOSZ/man/nonideal.Rd 2017-11-09 13:22:52 UTC (rev 284) +++ pkg/CHNOSZ/man/nonideal.Rd 2017-11-10 04:02:50 UTC (rev 285) @@ -8,7 +8,8 @@ } \usage{ - nonideal(species, speciesprops, IS, T, P, A_DH, B_DH, method=get("thermo")$opt$nonideal) + nonideal(species, speciesprops, IS, T, P, A_DH, B_DH, + method=get("thermo")$opt$nonideal) Bdot(TC, P, showsplines = "") } @@ -74,11 +75,13 @@ lty <- 1:3 species <- c("H2PO4-", "HADP-2", "HATP-3", "ATP-4") col <- rainbow(4) -thermo.plot.new(xlim = range(IS), ylim = c(0, 1), xlab = axis.label("IS"), ylab = "gamma") +thermo.plot.new(xlim = range(IS), ylim = c(0, 1), + xlab = axis.label("IS"), ylab = "gamma") for(j in 1:3) { # use subcrt to generate speciesprops speciesprops <- subcrt(species, T = rep(T[j], length(IS)))$out - # use nonideal to calculate loggamma; this also adjusts G, H, S, Cp, but we don't use them here + # use nonideal to calculate loggamma; this also adjusts G, H, S, Cp, + # but we don't use them here nonidealprops <- nonideal(species, speciesprops, IS = IS, T = convert(T[j], "K")) for(i in 1:4) lines(IS, 10^(nonidealprops[[i]]$loggam), lty=lty[j], col=col[i]) } From noreply at r-forge.r-project.org Fri Nov 10 12:43:46 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 10 Nov 2017 12:43:46 +0100 (CET) Subject: [CHNOSZ-commits] r286 - in pkg/CHNOSZ: . R data inst man tests/testthat Message-ID: <20171110114346.4A02D188D5C@r-forge.r-project.org> Author: jedick Date: 2017-11-10 12:43:44 +0100 (Fri, 10 Nov 2017) New Revision: 286 Modified: pkg/CHNOSZ/DESCRIPTION pkg/CHNOSZ/R/info.R pkg/CHNOSZ/R/subcrt.R pkg/CHNOSZ/data/opt.csv pkg/CHNOSZ/inst/NEWS pkg/CHNOSZ/man/data.Rd pkg/CHNOSZ/man/info.Rd pkg/CHNOSZ/man/subcrt.Rd pkg/CHNOSZ/tests/testthat/test-subcrt.R Log: add thermo$opt$Berman and some checks to subcrt() Modified: pkg/CHNOSZ/DESCRIPTION =================================================================== --- pkg/CHNOSZ/DESCRIPTION 2017-11-10 04:02:50 UTC (rev 285) +++ pkg/CHNOSZ/DESCRIPTION 2017-11-10 11:43:44 UTC (rev 286) @@ -1,6 +1,6 @@ Date: 2017-11-10 Package: CHNOSZ -Version: 1.1.0-83 +Version: 1.1.0-84 Title: Thermodynamic Calculations for Geobiochemistry Author: Jeffrey Dick Maintainer: Jeffrey Dick Modified: pkg/CHNOSZ/R/info.R =================================================================== --- pkg/CHNOSZ/R/info.R 2017-11-10 04:02:50 UTC (rev 285) +++ pkg/CHNOSZ/R/info.R 2017-11-10 11:43:44 UTC (rev 286) @@ -131,7 +131,11 @@ # if a single name matches, use that one (useful for distinguishing pseudo-H4SiO4 and H4SiO4) 20171020 matches.name <- matches.species & thermo$obigt$name==species if(sum(matches.name)==1) ispecies.out <- which(matches.name) - else ispecies.out <- ispecies[1] # otherwise, return only the first species that matches + else { + # prefer the Berman minerals? + if(thermo$opt$Berman & "cr_Berman" %in% thermo$obigt$state[ispecies]) ispecies.out <- ispecies[thermo$obigt$state[ispecies]=="cr_Berman"] + else ispecies.out <- ispecies[1] # otherwise, return only the first species that matches + } # let user know if there is more than one state for this species mystate <- thermo$obigt$state[ispecies.out] ispecies.other <- ispecies[!ispecies %in% ispecies.out] Modified: pkg/CHNOSZ/R/subcrt.R =================================================================== --- pkg/CHNOSZ/R/subcrt.R 2017-11-10 04:02:50 UTC (rev 285) +++ pkg/CHNOSZ/R/subcrt.R 2017-11-10 11:43:44 UTC (rev 286) @@ -37,7 +37,6 @@ } do.reaction <- FALSE - #if(!missing(coeff) & coeff!=1) do.reaction <- TRUE if(!missing(coeff)) do.reaction <- TRUE # species and states are made the same length @@ -67,6 +66,9 @@ if(convert) P <- envert(P,'bar') } + # warn for too high temperatures for Psat 20171110 + if(identical(P, "Psat") & any(T > 647.067)) warning("attempting calculation at P = 'Psat' for some T > Tcritical; set P = 1 (or higher)") + # gridding? do.grid <- FALSE if(!is.null(grid)) if(!is.logical(grid)) do.grid <- TRUE @@ -145,6 +147,15 @@ ton <- thermo$obigt$name tos <- thermo$obigt$state + # warn if we're running a reaction with both Berman and Helgeson minerals 20171110 + if(do.reaction) { + ref1 <- thermo$obigt$ref1 + ref2 <- thermo$obigt$ref2 + hasHelgeson <- any(grepl("HDNB78", ref1[sinfo])) | any(grepl("HDNB78", ref2[sinfo])) + hasBerman <- any(tos[sinfo]=="cr_Berman") + if(hasHelgeson & hasBerman) warning("the reaction has minerals from both the Helgeson and Berman datasets; data may not be internally consistent") + } + # stop if species not found noname <- is.na(sinfo) if(TRUE %in% noname) @@ -174,9 +185,9 @@ } # where we keep info about the species involved - reaction <- data.frame( coeff=coeff.new,name=ton[inpho], - formula = thermo$obigt$formula[inpho],state=tos[inpho], - ispecies=inpho, stringsAsFactors=FALSE) + reaction <- data.frame(coeff = coeff.new, name = ton[inpho], + formula = thermo$obigt$formula[inpho], state = tos[inpho], + ispecies = inpho, stringsAsFactors = FALSE) # make the rownames readable ... but they have to be unique if(length(unique(inpho))==length(inpho)) rownames(reaction) <- as.character(inpho) @@ -347,7 +358,7 @@ # we don't warn here about the transition warn.above <- FALSE } - if(all(is.na(Ttr))) next + if(any(is.na(Ttr))) next if(!all(Ttr==0) & any(T >= Ttr)) { status.Ttr <- "(extrapolating G)" if(!exceed.Ttr) { @@ -425,9 +436,11 @@ for(j in 1:nrow(G)) { ps <- which.min(as.numeric(G[j,])) if(length(ps)==0) { - # minimum not found: NAs have crept in (like something wrong with Psat?) - # (or no non-NA value of G to begin with, e.g. aegerine) - ps <- 1 + # minimum not found (we have NAs) + # - no non-NA value of G to begin with, e.g. aegerine) --> probably should use lowest-T phase + #ps <- 1 + # - above temperature limit for the highest-T phase (subcrt.Rd skarn example) --> use highest-T phase 20171110 + ps <- ncol(G) if(exceed.Ttr) warning('subcrt: stable phase for ',reaction$name[iphases[ps]],' at T-P point ',j, ' undetermined (using ',reaction$state[iphases[ps]],')',call.=FALSE) } Modified: pkg/CHNOSZ/data/opt.csv =================================================================== --- pkg/CHNOSZ/data/opt.csv 2017-11-10 04:02:50 UTC (rev 285) +++ pkg/CHNOSZ/data/opt.csv 2017-11-10 11:43:44 UTC (rev 286) @@ -1,2 +1,2 @@ -cutoff,E.units,T.units,P.units,state,water,G.tol,Cp.tol,V.tol,varP,IAPWS.sat,paramin,ideal.H,ideal.e,nonideal -1E-10,cal,C,bar,aq,SUPCRT92,100,1,1,FALSE,liquid,1000,TRUE,TRUE,Helgeson +cutoff,E.units,T.units,P.units,state,water,G.tol,Cp.tol,V.tol,varP,IAPWS.sat,paramin,ideal.H,ideal.e,nonideal,Berman +1E-10,cal,C,bar,aq,SUPCRT92,100,1,1,FALSE,liquid,1000,TRUE,TRUE,Helgeson,FALSE Modified: pkg/CHNOSZ/inst/NEWS =================================================================== --- pkg/CHNOSZ/inst/NEWS 2017-11-10 04:02:50 UTC (rev 285) +++ pkg/CHNOSZ/inst/NEWS 2017-11-10 11:43:44 UTC (rev 286) @@ -1,4 +1,4 @@ -CHANGES IN CHNOSZ 1.1.0-80 (2017-11-08) +CHANGES IN CHNOSZ 1.1.0-84 (2017-11-10) --------------------------------------- MAJOR CHANGES: @@ -146,6 +146,9 @@ - Add 'tol' argument to equil.reaction() (convergence tolerance for uniroot()). +- Add thermo$opt$Berman to signal info(), subcrt(), etc. to prefer + minerals in Berman dataset over Helgeson dataset (default: FALSE). + REFACTORING AND CLEANUP: - In hkf() and cgl(), combine 'ghs' and 'eos' arguments into single Modified: pkg/CHNOSZ/man/data.Rd =================================================================== --- pkg/CHNOSZ/man/data.Rd 2017-11-10 04:02:50 UTC (rev 285) +++ pkg/CHNOSZ/man/data.Rd 2017-11-10 11:43:44 UTC (rev 286) @@ -10,21 +10,23 @@ \alias{buffers} \title{Thermodynamic Database and System Settings} \description{ -Run \code{data(thermo)} to initialize all of the data used in CHNOSZ. +Run \code{data(thermo)} to initialize or reset all of the data used in CHNOSZ. This includes the computational settings, thermodynamic database, and system settings (chemical species). The system settings are changed using \code{\link{basis}} and \code{\link{species}}. -To restore the default system settings (no species loaded), use \code{basis("")}. +To restore the default system settings (no species loaded), run \code{basis("")}. The thermodynamic database is changed using \code{\link{add.obigt}} and \code{\link{mod.obigt}}. -To restore the default database, use \code{data(OBIGT)}. +To restore the default database, run \code{data(OBIGT)}. -The computational settings are changed using \code{\link{water}}, \code{\link{P.units}}, \code{\link{T.units}}, \code{\link{E.units}} or by direct manipulation of \code{thermo$opt}, as well as some other commands (e.g. \code{\link{mod.buffer}}). -To restore the default computational settings, thermodynamic database, and system settings, use \code{data(thermo)}. +The computational settings are changed using \code{\link{water}}, \code{\link{P.units}}, \code{\link{T.units}}, \code{\link{E.units}}, and some other commands (e.g. \code{\link{mod.buffer}}). -In an interactive session, use \code{data(thermo)} to restore the thermodynamic database and computational and system settings to their initial state. -Or, use \code{basis("")} to clear the system settings (basis and species), or \code{data(OBIGT)} to restore the default database. +Some settings can only be changed by direct manipulation of \code{thermo$opt}. +In an interactive session, this should be done using the super-assignment operator (e.g. \code{thermo$opt$Berman <<- TRUE}) so that the \code{thermo} object is not copied to the global environment. +(Doing so would cause problems, as many functions are designed to access the \code{thermo} object in the \code{CHNOSZ} environment.) +To restore the default computational settings, thermodynamic database, and system settings, run \code{data(thermo)}. + The data files provided with CHNOSZ are in the \code{data} and \code{extdata/OBIGT} directories of the package. The \code{*.csv} files in these directories are used to build the \code{thermo} data object in an environment named \code{CHNOSZ}. The structure of the \code{thermo} object is described below. @@ -37,8 +39,6 @@ \format{ - The items in the \code{thermo} object are documented below. - \itemize{ \item \code{thermo$opt} @@ -57,7 +57,9 @@ \code{IAPWS.sat} \tab character \tab State of water for saturation properties [\samp{liquid}] (see \code{\link{util.water}})\cr \code{paramin} \tab integer \tab Minimum number of calculations to launch parallel processes [1000] (see \code{\link{palply}}) \cr \code{ideal.H} \tab logical \tab Should \code{\link{nonideal}} ignore the proton? [\code{TRUE}] \cr - \code{ideal.e} \tab logical \tab Should \code{\link{nonideal}} ignore the electron? [\code{TRUE}] + \code{ideal.e} \tab logical \tab Should \code{\link{nonideal}} ignore the electron? [\code{TRUE}] \cr + \code{nonideal} \tab character \tab Method for \code{\link{nonideal}} [\code{Helgeson}] \cr + \code{Berman} \tab logical \tab Should \code{\link{info}} preferentially return Berman minerals? [\code{FALSE}] } \item \code{thermo$element} @@ -217,7 +219,7 @@ } % end of format \seealso{ -Other data files, supporting the examples and vignettes, are documented separately at \code{\link{extdata}}. +Other data files, including those supporting the examples and vignettes, are documented separately at \code{\link{extdata}}. } \examples{ Modified: pkg/CHNOSZ/man/info.Rd =================================================================== --- pkg/CHNOSZ/man/info.Rd 2017-11-10 04:02:50 UTC (rev 285) +++ pkg/CHNOSZ/man/info.Rd 2017-11-10 11:43:44 UTC (rev 286) @@ -26,6 +26,9 @@ If there are multiple matches for the \code{species}, and \code{state} is NULL, the index of first match is returned. The order of entries in \code{thermo$obigt} is grouped by states in the order \samp{aq}, \samp{cr}, \samp{gas}, \samp{liq}, so for species in both aqueous and gaseous states the index of the aqueous species is returned, unless \code{state} is set to \samp{gas}. +Note that entries for minerals using the \code{\link{berman}} equations are placed after the dataset derived from Helgeson et al., 1978, so the latter data are used by default in case of duplicates. +This behavior can be changed by setting \code{\link{thermo}$opt$Berman} to TRUE; alternatively, individual minerals in the Berman dataset can be identifed by setting \code{state} to \samp{cr_Berman}. + Names of species including an underscore character are indicative of proteins, e.g. \samp{LYSC_CHICK}. If the name of a protein is provided to \code{info} and the composition of the protein can be found using \code{\link{protein}}, the thermodyamic properties and parameters of the nonionized protein (calculated using amino acid group additivity) are added to the thermodynamic database. Included in the return value, as for other species, is the index of the protein in the thermodynamic database or \code{NA} if the protein is not found. Names of proteins and other species can be mixed. Modified: pkg/CHNOSZ/man/subcrt.Rd =================================================================== --- pkg/CHNOSZ/man/subcrt.Rd 2017-11-10 04:02:50 UTC (rev 285) +++ pkg/CHNOSZ/man/subcrt.Rd 2017-11-10 11:43:44 UTC (rev 286) @@ -98,8 +98,6 @@ Changes were made in CHNOSZ 0.9-9 to improve the calculation of the \eqn{g}{g}- and \eqn{f}{f}-functions (Shock et al., 1992) for the partial derivatives of the omega parameter which are used by the \code{\link{hkf}} function, so thermodynamic properties of charged aqueous species over the temperature range 0 to 1000 \degC are now mostly consistent with \acronym{SUPCRT92}. Note, however, that while \acronym{SUPCRT92} limits calculations at Psat to 350 \degC (\dQuote{beyond range of applicability of aqueous species equations}), there is no corresponding limit in place in \code{subcrt} (or \code{\link{hkf}}), so that inapplicable calculations will be performed up to the critical temperature (373.917 \degC) without any warning. It is probably for this reason that there is a noticeable jump in the value of \logK at Psat shown in the one of the examples (\code{demo("NaCl")}). - -A known bug is misidentification of the stable polymorph of some minerals at high temperature; an example of this bug is shown in the \code{\link{stopifnot}} at the end of the skarn example below. } \value{ @@ -167,10 +165,13 @@ subcrt(c("pyrite", "pyrrhotite", "H2O", "H2S", "O2"), c(-1, 1, -1, 1, 0.5)) ## these produce messages about problems with the calculation +# above the T, P limits for the H2O equations of state +subcrt("alanine", T=c(2250, 2251), P=c(30000, 30001), grid="T") # Psat is not defined above the critical point +\dontrun{ +## (also gives a warning) subcrt("alanine", T=seq(0, 5000, by=1000)) -# above the T, P limits for the H2O equations of state -subcrt("alanine", T=c(2250, 2251), P=c(30000, 30001), grid="T") +} ## minerals with phase transitions # compare calculated values of heat capacity of iron with @@ -206,9 +207,9 @@ P=P, T=T, grid="P") # The results are not identical to SUPCRT92, as CHNOSZ has updated # parameters for species e.g. Cu+ from Shock et al., 1997. -# FIXME: the last 1 should be a 3 +# Check the calculated phase transitions for chalcopyrite stopifnot(all.equal(s$polymorphs$chalcopyrite[1:11], - c(1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 1))) + c(1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3))) ## Standard Gibbs energy of reactions with HCN and ## formaldehyde, after Schulte and Shock, 1995 Fig. 1 Modified: pkg/CHNOSZ/tests/testthat/test-subcrt.R =================================================================== --- pkg/CHNOSZ/tests/testthat/test-subcrt.R 2017-11-10 04:02:50 UTC (rev 285) +++ pkg/CHNOSZ/tests/testthat/test-subcrt.R 2017-11-10 11:43:44 UTC (rev 286) @@ -156,6 +156,10 @@ #expect_equal(as.numeric(a$values[[1]]), c(0, 0)) }) +test_that("warning is produced for reaction with Helgeson and Berman minerals", { + expect_warning(subcrt(c("quartz", "quartz"), c(-1, 1), c("cr", "cr_Berman")), "data may not be internally consistent") +}) + # references # Amend, J. P. and Shock, E. L. (2001) From noreply at r-forge.r-project.org Fri Nov 10 16:50:45 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 10 Nov 2017 16:50:45 +0100 (CET) Subject: [CHNOSZ-commits] r287 - in pkg/CHNOSZ: . inst/extdata/OBIGT inst/extdata/thermo Message-ID: <20171110155045.471CE188E70@r-forge.r-project.org> Author: jedick Date: 2017-11-10 16:50:44 +0100 (Fri, 10 Nov 2017) New Revision: 287 Modified: pkg/CHNOSZ/DESCRIPTION pkg/CHNOSZ/inst/extdata/OBIGT/DEW_aq.csv pkg/CHNOSZ/inst/extdata/thermo/obigt_check.csv Log: DEW_aq.csv: correct formula of H-succinate Modified: pkg/CHNOSZ/DESCRIPTION =================================================================== --- pkg/CHNOSZ/DESCRIPTION 2017-11-10 11:43:44 UTC (rev 286) +++ pkg/CHNOSZ/DESCRIPTION 2017-11-10 15:50:44 UTC (rev 287) @@ -1,6 +1,6 @@ Date: 2017-11-10 Package: CHNOSZ -Version: 1.1.0-84 +Version: 1.1.0-85 Title: Thermodynamic Calculations for Geobiochemistry Author: Jeffrey Dick Maintainer: Jeffrey Dick Modified: pkg/CHNOSZ/inst/extdata/OBIGT/DEW_aq.csv =================================================================== --- pkg/CHNOSZ/inst/extdata/OBIGT/DEW_aq.csv 2017-11-10 11:43:44 UTC (rev 286) +++ pkg/CHNOSZ/inst/extdata/OBIGT/DEW_aq.csv 2017-11-10 15:50:44 UTC (rev 287) @@ -69,7 +69,7 @@ glycine,GLYCINE,C2H5NO2,aq,DEW17,NA,26.Sep.17,-90950,-124780,39.3,9.49422936701518,43.290761466275875,10.8,1.3,7.6,-3.5,28,-8.2,0.2,0 glycolate,GLYCOLATE,C2H3O3-,aq,DEW17,NA,26.Sep.17,-121170,-154700,26.2,6.499727439000832,39.84996109167508,6.7382147870914615,13.19329654085941,1.8518815074471107,-3.3244108789991285,21.338956192235514,-1.7106055206755306,1.2334,-1 "glycolic acid",GLYCOLIC-ACID,C2H4O3,aq,DEW17,NA,26.Sep.17,-126400,-154890,43.1,45.50047069862751,51.75011333088785,11.426077661344983,6.59562315344203,-0.6922667598340677,-3.0516630611632936,30.05317260633247,6.233845881310423,-0.3017,0 -h-succinate,H-SUCCINATE,C4H504-,aq,DEW17,NA,26.Sep.17,-172060,-217350,45.2,9.2999823093372,69.99007711388036,15.566254786236048,10.53748248187552,-3.997478450724362,-3.2146195258007344,20.319411396387665,-1.1401936035880127,0.9446,-1 +H-succinate,H-SUCCINATE,C4H5O4-,aq,DEW17,NA,26.Sep.17,-172060,-217350,45.2,9.2999823093372,69.99007711388036,15.566254786236048,10.53748248187552,-3.997478450724362,-3.2146195258007344,20.319411396387665,-1.1401936035880127,0.9446,-1 H2AsO3-,H2AsO3(-),H2AsO3-,aq,DEW17,NA,26.Sep.17,-140330,-170840,26.4,-2.9001583614829087,26.399881711344126,7.2377362401525875,2.6079066370318795,2.651395748597695,-2.886810860374898,15.803326514833184,-3.6253622582340688,1.2305,-1 H2AsO4-,H2AsO4(-),H2AsO4-,aq,DEW17,NA,26.Sep.17,-180010,-217390,28,-0.7002543708804083,35.10010083490968,8.915414426514241,4.20522269611064,1.3120613704193662,-2.952843906257214,16.862284972885902,-3.1772418153483395,1.2055,-1 H2P2O7-2,H2P2O7(-2),H2P2O7-2,aq,DEW17,NA,26.Sep.17,-480400,-544600,39,-20.299643862440398,52.400027441768785,12.954568244885333,8.050897815225934,-1.9125007724709686,-3.1118241156814404,18.42397290198147,-7.169637454779109,2.6218,-2 Modified: pkg/CHNOSZ/inst/extdata/thermo/obigt_check.csv =================================================================== --- pkg/CHNOSZ/inst/extdata/thermo/obigt_check.csv 2017-11-10 11:43:44 UTC (rev 286) +++ pkg/CHNOSZ/inst/extdata/thermo/obigt_check.csv 2017-11-10 15:50:44 UTC (rev 287) @@ -251,7 +251,6 @@ "DEW",56,"FeCl3","aq",,,-14671 "DEW",57,"FeCl4-","aq",,,-21499 "DEW",63,"glutamate","aq",,,234035 -"DEW",71,"h-succinate","aq",,,2294200 "DEW",83,"HCN","aq",,,907 "DEW",89,"Hg2+2","aq",,,9334 "DEW",92,"HPO4-2","aq",,-1.02, From noreply at r-forge.r-project.org Fri Nov 10 19:11:18 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 10 Nov 2017 19:11:18 +0100 (CET) Subject: [CHNOSZ-commits] r288 - in pkg/CHNOSZ: . inst Message-ID: <20171110181118.E3DBA188A01@r-forge.r-project.org> Author: jedick Date: 2017-11-10 19:11:18 +0100 (Fri, 10 Nov 2017) New Revision: 288 Modified: pkg/CHNOSZ/DESCRIPTION pkg/CHNOSZ/inst/NEWS Log: update DESCRIPTION; add R Core Team as contributor Modified: pkg/CHNOSZ/DESCRIPTION =================================================================== --- pkg/CHNOSZ/DESCRIPTION 2017-11-10 15:50:44 UTC (rev 287) +++ pkg/CHNOSZ/DESCRIPTION 2017-11-10 18:11:18 UTC (rev 288) @@ -1,8 +1,15 @@ -Date: 2017-11-10 +Date: 2017-11-11 Package: CHNOSZ -Version: 1.1.0-85 +Version: 1.1.0-86 Title: Thermodynamic Calculations for Geobiochemistry -Author: Jeffrey Dick +Authors at R: c( + person("Jeffrey", "Dick", , "j3ffdick at gmail.com", role = c("aut", "cre"), + comment = c(ORCID = "0000-0002-0687-5890")), + person("R Core Team", role = "ctb", + comment = "code derived from R's pmax()") + ) +Author: Jeffrey Dick [aut, cre], + R Core Team [ctb] Maintainer: Jeffrey Dick Depends: R (>= 3.1.0) Suggests: limSolve, testthat, knitr, rmarkdown, tufte, RSVGTipsDevice Modified: pkg/CHNOSZ/inst/NEWS =================================================================== --- pkg/CHNOSZ/inst/NEWS 2017-11-10 15:50:44 UTC (rev 287) +++ pkg/CHNOSZ/inst/NEWS 2017-11-10 18:11:18 UTC (rev 288) @@ -1,4 +1,4 @@ -CHANGES IN CHNOSZ 1.1.0-84 (2017-11-10) +CHANGES IN CHNOSZ 1.1.0-86 (2017-11-11) --------------------------------------- MAJOR CHANGES: From noreply at r-forge.r-project.org Sat Nov 11 03:20:33 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sat, 11 Nov 2017 03:20:33 +0100 (CET) Subject: [CHNOSZ-commits] r289 - in pkg/CHNOSZ: . man man/macros Message-ID: <20171111022034.0967D1881D0@r-forge.r-project.org> Author: jedick Date: 2017-11-11 03:20:33 +0100 (Sat, 11 Nov 2017) New Revision: 289 Modified: pkg/CHNOSZ/DESCRIPTION pkg/CHNOSZ/man/CHNOSZ-package.Rd pkg/CHNOSZ/man/basis.Rd pkg/CHNOSZ/man/examples.Rd pkg/CHNOSZ/man/macros/macros.Rd pkg/CHNOSZ/man/nonideal.Rd pkg/CHNOSZ/man/subcrt.Rd pkg/CHNOSZ/man/util.water.Rd Log: document discontinuity in demo(NaCl); add \Psat to macros.Rd Modified: pkg/CHNOSZ/DESCRIPTION =================================================================== --- pkg/CHNOSZ/DESCRIPTION 2017-11-10 18:11:18 UTC (rev 288) +++ pkg/CHNOSZ/DESCRIPTION 2017-11-11 02:20:33 UTC (rev 289) @@ -1,6 +1,6 @@ Date: 2017-11-11 Package: CHNOSZ -Version: 1.1.0-86 +Version: 1.1.0-87 Title: Thermodynamic Calculations for Geobiochemistry Authors at R: c( person("Jeffrey", "Dick", , "j3ffdick at gmail.com", role = c("aut", "cre"), @@ -8,8 +8,6 @@ person("R Core Team", role = "ctb", comment = "code derived from R's pmax()") ) -Author: Jeffrey Dick [aut, cre], - R Core Team [ctb] Maintainer: Jeffrey Dick Depends: R (>= 3.1.0) Suggests: limSolve, testthat, knitr, rmarkdown, tufte, RSVGTipsDevice Modified: pkg/CHNOSZ/man/CHNOSZ-package.Rd =================================================================== --- pkg/CHNOSZ/man/CHNOSZ-package.Rd 2017-11-10 18:11:18 UTC (rev 288) +++ pkg/CHNOSZ/man/CHNOSZ-package.Rd 2017-11-11 02:20:33 UTC (rev 289) @@ -10,11 +10,9 @@ \section{Warm Tips}{ \itemize{ - \item Be sure to check out the vignette titled \emph{An Introduction to CHNOSZ}. Run \code{\link{help.start}()}, select \sQuote{Packages} then \sQuote{CHNOSZ} followed by \sQuote{User guides, package vignettes and other documentation}. - \item Running the examples from the help pages is a good way to become more familiar with the usage of the functions. After running \code{help.start()}, select \sQuote{Packages} then \sQuote{CHNOSZ} and then select a function of interest. Individual examples can be run by pasting the example block into the \R window. + \item To view the manual, run \code{help.start()} then select \sQuote{Packages} and \sQuote{CHNOSZ}. Examples in the function help pages can be run by pasting the code block into the \R console. + \item Be sure to check out the vignette titled \emph{An Introduction to CHNOSZ}, which is available by following the link in \code{help.start} to \sQuote{User guides, package vignettes and other documentation}. \item Run the command \code{\link{examples}()} to run all of the examples provided in CHNOSZ. This should take about a minute. - \item Also try out \code{\link{demos}()} to run the demos (longer examples that are not part of the main help pages). - \item To learn how to update the thermodynamic database, look at \code{\link{add.obigt}}. } } Modified: pkg/CHNOSZ/man/basis.Rd =================================================================== --- pkg/CHNOSZ/man/basis.Rd 2017-11-10 18:11:18 UTC (rev 288) +++ pkg/CHNOSZ/man/basis.Rd 2017-11-11 02:20:33 UTC (rev 289) @@ -4,8 +4,6 @@ \title{Define Basis Species} \description{ Define the basis species of a chemical system. -Change their physical states or chemical activities or fugacities. -Get the reaction coefficients of basis species in formation reactions of species. } \usage{ @@ -20,8 +18,6 @@ } \details{ -\code{basis} is used to define the basis species in a thermodynamic system. - The basis species represent the possible range of chemical compositions for all the species of interest. Any valid set of basis species used here must meet two conditions: 1) the number of basis species is the same as the number of chemical elements (including charge) in those species and 2) the square matrix representing the elemental stoichiometries of the basis species has a real inverse. @@ -37,9 +33,7 @@ Whenever \code{basis} is called with NULL values of both \code{state} and \code{logact}, the new set of species, if they are a valid basis set, completely replaces any existing basis definition. If this occurs, any existing species definition (created by the \code{species} function) is deleted. -However, \code{\link{swap.basis}} can be used to change the species (the compositions and/or physical states thereof) in the basis set while maintaining the list of species of interest, with the added benefit of equivalence of the chemical potentials of the elements before and after the swap. - -Call \code{basis} with \code{delete} set to TRUE or code{species} set to \code{""} to clear the basis definition. +Call \code{basis} with \code{delete} set to TRUE or \code{species} set to \samp{""} to clear the basis definition. This also deletes the \code{\link{species}} list, if any. If the value of \code{basis} is one of the keywords in the following table, the corresponding set of basis species is loaded, and their activities are given preset values. @@ -66,10 +60,6 @@ Returns the value of \code{thermo$basis} after any modifications; or, if \code{delete} is TRUE, its value before deletion (invisibly). } -\section{Side Effects}{ -If the new basis definition meets all requirements, it is stored in \code{\link{thermo}$basis}, replacing any previous basis definition. -} - \seealso{ \code{\link{info}} to query the thermodynamic database in order to find what species are available. \code{\link{makeup}} is used by \code{basis} to generate the stoichiometric matrix from chemical formulas. Modified: pkg/CHNOSZ/man/examples.Rd =================================================================== --- pkg/CHNOSZ/man/examples.Rd 2017-11-10 18:11:18 UTC (rev 288) +++ pkg/CHNOSZ/man/examples.Rd 2017-11-11 02:20:33 UTC (rev 289) @@ -70,6 +70,11 @@ The proteins in the calculation are 24 carboxylases from a variety of organisms. There are 12 ribulose phosphate carboxylase and 12 acetyl-coenzyme A carboxylase; 6 of each type are from nominally mesophilic organisms and 6 from nominally thermophilic organisms, shown as blue and red symbols on the diagrams. The activities of hydrogen at each temperature are calculated using \eqn{\log a_{\mathrm{H_{2}}_{\left(aq\right)}}=-11+3/\left(40\times T\left(^{\circ}C\right)\right)}{logaH2 = -11 + 3/40 * T(degC)}; this equation comes from a model of relative stabilities of proteins in a hot-spring environment (Dick and Shock, 2011). + +In the \samp{NaCl} demo, the \logK lines calculated at \Psat and P=500 bar show discontinuities at 355 \degC. +Although not realistic, this behavior is consistent with the output of \acronym{SUPCRT92} (Johnson et al., 1992) at 500 bar. +This is probably due to a transition between different regimes for the properties of water as coded in SUPCRT's \code{H2O92D.F}, which is used by CHNOSZ. +(Note that SUPCRT does not output thermodynamic properties above 350 \degC at \Psat; see Warning in \code{\link{subcrt}}.) } \references{ @@ -95,6 +100,8 @@ Garrels, R. M. and Christ, C. L. (1965) \emph{Solutions, Minerals, and Equilibria}, Harper & Row, New York, 450 p. \url{http://www.worldcat.org/oclc/517586} +Johnson, J. W., Oelkers, E. H. and Helgeson, H. C. (1992) SUPCRT92: A software package for calculating the standard molal thermodynamic properties of minerals, gases, aqueous species, and reactions from 1 to 5000 bar and 0 to 1000\degC. \emph{Comp. Geosci.} \bold{18}, 899--947. \url{https://doi.org/10.1016/0098-3004(92)90029-Q} + Lowe, A. R., Cox, J. S. and Tremaine, P. R. (2017) Thermodynamics of aqueous adenine: Standard partial molar volumes and heat capacities of adenine, adeninium chloride, and sodium adeninate from \emph{T} = 278.15 K to 393.15 K. \emph{J. Chem. Thermodyn.} \bold{112}, 129--145. \url{https://doi.org/10.1016/j.jct.2017.04.005} Manning, C. E., Shock, E. L. and Sverjensky, D. A. (2013) The chemistry of carbon in aqueous fluids at crustal and upper-mantle conditions: Experimental and theoretical constraints. \emph{Rev. Mineral. Geochem.} \bold{75}, 109--148. \url{https://doi.org/10.2138/rmg.2013.75.5} Modified: pkg/CHNOSZ/man/macros/macros.Rd =================================================================== --- pkg/CHNOSZ/man/macros/macros.Rd 2017-11-10 18:11:18 UTC (rev 288) +++ pkg/CHNOSZ/man/macros/macros.Rd 2017-11-11 02:20:33 UTC (rev 289) @@ -36,3 +36,4 @@ \newcommand{\degC}{\ifelse{latex}{\eqn{^{\circ}}C}{\ifelse{html}{\out{°}C}{?C}}} \newcommand{\le}{\ifelse{latex}{\eqn{\le}}{\ifelse{html}{\out{≤}}{?}}} \newcommand{\ge}{\ifelse{latex}{\eqn{\ge}}{\ifelse{html}{\out{≥}}{?}}} +\newcommand{\Psat}{\ifelse{latex}{\eqn{P_{\mathrm{SAT}}}}{\ifelse{html}{\out{PSAT}}{Psat}}} Modified: pkg/CHNOSZ/man/nonideal.Rd =================================================================== --- pkg/CHNOSZ/man/nonideal.Rd 2017-11-10 18:11:18 UTC (rev 288) +++ pkg/CHNOSZ/man/nonideal.Rd 2017-11-11 02:20:33 UTC (rev 289) @@ -46,7 +46,7 @@ Currently, \samp{G} is the only adjusted molal property that is calculated (but this can be used by \code{\link{subcrt}} to calculate adjusted equilibrium constants). \code{Bdot} calculates the \dQuote{B-dot} deviation function (Helgeson, 1969) a.k.a. extended term parameter (written as b_gamma; Helgeson et al., 1981) for activity coefficients in NaCl solutions at high temperature and pressure. -Data at Psat and 0.5 to 5 kb are taken from Helgeson (1969, Table 2 and Figure 3) and Helgeson et al. (1981, Table 27) and extrapolated values at 10 to 30 kb from Manning et al. (2013, Figure 11). +Data at \Psat and 0.5 to 5 kb are taken from Helgeson (1969, Table 2 and Figure 3) and Helgeson et al. (1981, Table 27) and extrapolated values at 10 to 30 kb from Manning et al. (2013, Figure 11). Furthermore, the 10 to 30 kb data were used to generate super-extrapolated values at 40, 50, and 60 kb, which may be encountered using the \code{\link{water.DEW}} calculations. If all \code{P} correspond to one of the isobaric conditions, the values of \code{Bdot} at \code{T} are calculated by spline fits to the isobaric data. Otherwise, particular (dependent on the \code{T}) isobaric spline fits are themselves used to construct isothermal splines for the given values of \code{T}; the isothermal splines are then used to generate the values of \code{Bdot} for the given \code{P}. Modified: pkg/CHNOSZ/man/subcrt.Rd =================================================================== --- pkg/CHNOSZ/man/subcrt.Rd 2017-11-10 18:11:18 UTC (rev 288) +++ pkg/CHNOSZ/man/subcrt.Rd 2017-11-11 02:20:33 UTC (rev 289) @@ -87,17 +87,16 @@ However, \code{NA}s may be produced in the output of \code{subcrt} if the requisite thermodynamic or electrostatic properties of water can not be calculated at given conditions. Specifically, \code{NA}s are produced for calculations at \samp{Psat} when the temperature exceeds the critical temperature of \H2O. -For calculations below 273.16 K, the pressure should be set to 1, as Psat is not defined in these conditions. +For calculations below 273.16 K, the pressure should be set to 1, as \Psat is not defined in these conditions. If \code{thermo$opt$varP} is \code{TRUE}, standard Gibbs energies of gases will be converted from a standard state at 1 bar (as used in SUPCRT) to a variable pressure standard state (see chapter 12 in Anderson and Crerar, 1993). This is useful for constructing e.g. boiling curves for organic compounds. } \section{Warning}{ -Comparison of the output of \code{subcrt} with that of \acronym{SUPCRT92} indicates the two give similar values of properties for neutral aqueous species up to 1000 \degC and 5000 bar. -Changes were made in CHNOSZ 0.9-9 to improve the calculation of the \eqn{g}{g}- and \eqn{f}{f}-functions (Shock et al., 1992) for the partial derivatives of the omega parameter which are used by the \code{\link{hkf}} function, so thermodynamic properties of charged aqueous species over the temperature range 0 to 1000 \degC are now mostly consistent with \acronym{SUPCRT92}. -Note, however, that while \acronym{SUPCRT92} limits calculations at Psat to 350 \degC (\dQuote{beyond range of applicability of aqueous species equations}), there is no corresponding limit in place in \code{subcrt} (or \code{\link{hkf}}), so that inapplicable calculations will be performed up to the critical temperature (373.917 \degC) without any warning. -It is probably for this reason that there is a noticeable jump in the value of \logK at Psat shown in the one of the examples (\code{demo("NaCl")}). +Although \acronym{SUPCRT92} prohibits calculations above 350 \degC at \Psat (\dQuote{beyond range of applicability of aqueous species equations}), there is no corresponding limit in place in \code{subcrt} (or \code{\link{hkf}}). +Therefore, CHNOSZ can perform calculations up to the critical temperature (373.917 \degC) at \Psat, but these settings represent untested extrapolations. +Unexpected results are evident in the discontinuity in the value of \logK at \Psat shown in \code{\link{demos}("NaCl")}. } \value{ Modified: pkg/CHNOSZ/man/util.water.Rd =================================================================== --- pkg/CHNOSZ/man/util.water.Rd 2017-11-10 18:11:18 UTC (rev 288) +++ pkg/CHNOSZ/man/util.water.Rd 2017-11-11 02:20:33 UTC (rev 289) @@ -30,7 +30,7 @@ The \code{property} for this function can be one of \samp{P.sigma} (saturation vapor pressure in MPa), \samp{dP.sigma.dT} (derivative of saturation vapor pressure with respect to temperature), or \samp{rho.liquid} or \samp{rho.vapor} (density of liquid or vapor in kg m\eqn{^{-3}}{^-3}). \code{rho.IAPWS95} implements a root-finding technique (using \code{\link{uniroot}}) to determine the values of density for the stable phase of \H2O at the given temperature and pressure. -The \code{state} option is used internally in order to determine the stable phase at conditions close to saturation (0.9999*Psat <= P <= 1.00005*Psat, where Psat is the saturation pressure calculated by \code{\link{WP02.auxiliary}}). +The \code{state} option is used internally in order to determine the stable phase at conditions close to saturation (0.9999*\Psat <= P <= 1.00005*\Psat, where \Psat is the saturation pressure calculated by \code{\link{WP02.auxiliary}}). Alternatively, the user can specify a \code{state} of \samp{liquid} or \samp{vapor} to force the calculation of density for the corresponding phase, even if it is metastable (e.g. superheated water, supercooled steam; this option has no effect in the supercritical region). The \code{state} is set in calls by \code{\link{water.IAPWS95}} to the value in \code{thermo$opt$IAPWS.sat} (default \samp{liquid}) so that higher-level functions (\code{\link{water}}, \code{\link{subcrt}}) take properties for that state along the saturation curve. Diagnostic messages are printed if \code{trace} is positive (it is also included in the call to \code{uniroot}). From noreply at r-forge.r-project.org Sat Nov 11 03:35:55 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sat, 11 Nov 2017 03:35:55 +0100 (CET) Subject: [CHNOSZ-commits] r290 - www Message-ID: <20171111023555.E9AF51891A4@r-forge.r-project.org> Author: jedick Date: 2017-11-11 03:35:55 +0100 (Sat, 11 Nov 2017) New Revision: 290 Modified: www/index.php Log: www: use PHP nl2br() function to insert line breaks Modified: www/index.php =================================================================== --- www/index.php 2017-11-11 02:20:33 UTC (rev 289) +++ www/index.php 2017-11-11 02:35:55 UTC (rev 290) @@ -40,7 +40,7 @@ $contents .= fread($handle, 8192); } fclose($handle); -echo $contents; } ?> +echo nl2br($contents); } ?> From noreply at r-forge.r-project.org Sun Nov 12 02:39:09 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 12 Nov 2017 02:39:09 +0100 (CET) Subject: [CHNOSZ-commits] r291 - in pkg/CHNOSZ: . inst vignettes Message-ID: <20171112013909.C26D41884C8@r-forge.r-project.org> Author: jedick Date: 2017-11-12 02:39:09 +0100 (Sun, 12 Nov 2017) New Revision: 291 Modified: pkg/CHNOSZ/DESCRIPTION pkg/CHNOSZ/inst/NEWS pkg/CHNOSZ/vignettes/equilibrium.Rnw pkg/CHNOSZ/vignettes/equilibrium.lyx Log: prepare version 1.1.1 for CRAN submission Modified: pkg/CHNOSZ/DESCRIPTION =================================================================== --- pkg/CHNOSZ/DESCRIPTION 2017-11-11 02:35:55 UTC (rev 290) +++ pkg/CHNOSZ/DESCRIPTION 2017-11-12 01:39:09 UTC (rev 291) @@ -1,6 +1,6 @@ Date: 2017-11-11 Package: CHNOSZ -Version: 1.1.0-87 +Version: 1.1.1 Title: Thermodynamic Calculations for Geobiochemistry Authors at R: c( person("Jeffrey", "Dick", , "j3ffdick at gmail.com", role = c("aut", "cre"), @@ -8,6 +8,8 @@ person("R Core Team", role = "ctb", comment = "code derived from R's pmax()") ) +Author: Jeffrey Dick [aut, cre] (0000-0002-0687-5890), + R Core Team [ctb] (code derived from R's pmax()) Maintainer: Jeffrey Dick Depends: R (>= 3.1.0) Suggests: limSolve, testthat, knitr, rmarkdown, tufte, RSVGTipsDevice Modified: pkg/CHNOSZ/inst/NEWS =================================================================== --- pkg/CHNOSZ/inst/NEWS 2017-11-11 02:35:55 UTC (rev 290) +++ pkg/CHNOSZ/inst/NEWS 2017-11-12 01:39:09 UTC (rev 291) @@ -1,5 +1,5 @@ -CHANGES IN CHNOSZ 1.1.0-86 (2017-11-11) ---------------------------------------- +CHANGES IN CHNOSZ 1.1.1 (2017-11-11) +------------------------------------ MAJOR CHANGES: Modified: pkg/CHNOSZ/vignettes/equilibrium.Rnw =================================================================== --- pkg/CHNOSZ/vignettes/equilibrium.Rnw 2017-11-11 02:35:55 UTC (rev 290) +++ pkg/CHNOSZ/vignettes/equilibrium.Rnw 2017-11-12 01:39:09 UTC (rev 291) @@ -19,7 +19,6 @@ {hyperref} \hypersetup{ citecolor=magenta, urlcolor=blue} -\usepackage{breakurl} \makeatletter %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands. @@ -327,7 +326,7 @@ # figure B st <- system.time(dB <- aaB()) showtime(st) -title(main=paste("loga(total species) =", round(dB$loga.balance, 2)), cex.main=1) +title(main=paste("loga(total species) =", round(dB$loga.balance[1], 2)), cex.main=1) label.figure("B", col="blue", yfrac=0.9, xfrac=0.1) ## row 2 (balance = nCO2) @@ -343,7 +342,7 @@ # figure D st <- system.time(dD <- aaD()) showtime(st) -title(main=paste("loga(total CO2) =", round(dD$loga.balance, 2)), cex.main=1) +title(main=paste("loga(total CO2) =", round(dD$loga.balance[1], 2)), cex.main=1) label.figure("D", col="blue", yfrac=0.9, xfrac=0.1) ## right (speciation at different total activity of CO2) @@ -354,12 +353,12 @@ # figure E st <- system.time(dE <- aaE()) showtime(st) -title(main=paste("loga(total CO2) =", round(dE$loga.balance, 2)), cex.main=1) +title(main=paste("loga(total CO2) =", round(dE$loga.balance[1], 2)), cex.main=1) label.figure("E", col="blue", yfrac=0.9, xfrac=0.1) # figure F st <- system.time(dF <- aaF()) showtime(st) -title(main=paste("loga(total CO2) =", round(dF$loga.balance, 2)), cex.main=1) +title(main=paste("loga(total CO2) =", round(dF$loga.balance[1], 2)), cex.main=1) label.figure("F", col="blue", yfrac=0.9, xfrac=0.1) @ Modified: pkg/CHNOSZ/vignettes/equilibrium.lyx =================================================================== --- pkg/CHNOSZ/vignettes/equilibrium.lyx 2017-11-11 02:35:55 UTC (rev 290) +++ pkg/CHNOSZ/vignettes/equilibrium.lyx 2017-11-12 01:39:09 UTC (rev 291) @@ -1326,7 +1326,8 @@ \begin_layout Plain Layout -title(main=paste("loga(total species) =", round(dB$loga.balance, 2)), cex.main=1) +title(main=paste("loga(total species) =", round(dB$loga.balance[1], 2)), + cex.main=1) \end_layout \begin_layout Plain Layout @@ -1405,7 +1406,7 @@ \begin_layout Plain Layout -title(main=paste("loga(total CO2) =", round(dD$loga.balance, 2)), cex.main=1) +title(main=paste("loga(total CO2) =", round(dD$loga.balance[1], 2)), cex.main=1) \end_layout \begin_layout Plain Layout @@ -1459,7 +1460,7 @@ \begin_layout Plain Layout -title(main=paste("loga(total CO2) =", round(dE$loga.balance, 2)), cex.main=1) +title(main=paste("loga(total CO2) =", round(dE$loga.balance[1], 2)), cex.main=1) \end_layout \begin_layout Plain Layout @@ -1484,7 +1485,7 @@ \begin_layout Plain Layout -title(main=paste("loga(total CO2) =", round(dF$loga.balance, 2)), cex.main=1) +title(main=paste("loga(total CO2) =", round(dF$loga.balance[1], 2)), cex.main=1) \end_layout \begin_layout Plain Layout From noreply at r-forge.r-project.org Sun Nov 12 17:14:01 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 12 Nov 2017 17:14:01 +0100 (CET) Subject: [CHNOSZ-commits] r292 - in pkg/CHNOSZ: . inst vignettes Message-ID: <20171112161401.1650D188CE5@r-forge.r-project.org> Author: jedick Date: 2017-11-12 17:14:00 +0100 (Sun, 12 Nov 2017) New Revision: 292 Modified: pkg/CHNOSZ/DESCRIPTION pkg/CHNOSZ/inst/NEWS pkg/CHNOSZ/vignettes/obigt.bib Log: fix 404 URL; submit version 1.1.2 to CRAN Modified: pkg/CHNOSZ/DESCRIPTION =================================================================== --- pkg/CHNOSZ/DESCRIPTION 2017-11-12 01:39:09 UTC (rev 291) +++ pkg/CHNOSZ/DESCRIPTION 2017-11-12 16:14:00 UTC (rev 292) @@ -1,6 +1,6 @@ -Date: 2017-11-11 +Date: 2017-11-12 Package: CHNOSZ -Version: 1.1.1 +Version: 1.1.2 Title: Thermodynamic Calculations for Geobiochemistry Authors at R: c( person("Jeffrey", "Dick", , "j3ffdick at gmail.com", role = c("aut", "cre"), Modified: pkg/CHNOSZ/inst/NEWS =================================================================== --- pkg/CHNOSZ/inst/NEWS 2017-11-12 01:39:09 UTC (rev 291) +++ pkg/CHNOSZ/inst/NEWS 2017-11-12 16:14:00 UTC (rev 292) @@ -1,4 +1,4 @@ -CHANGES IN CHNOSZ 1.1.1 (2017-11-11) +CHANGES IN CHNOSZ 1.1.2 (2017-11-12) ------------------------------------ MAJOR CHANGES: Modified: pkg/CHNOSZ/vignettes/obigt.bib =================================================================== --- pkg/CHNOSZ/vignettes/obigt.bib 2017-11-12 01:39:09 UTC (rev 291) +++ pkg/CHNOSZ/vignettes/obigt.bib 2017-11-12 16:14:00 UTC (rev 292) @@ -1111,13 +1111,13 @@ } @TechReport{AS04, - author = {Apps, J. and Spycher, N.}, - title = {{D}ata qualification for thermodynamic data used to support {THC} calculations}, - institution = {Bechtel SAIC Company, LLC}, - year = {2004}, - number = {ANL-NBS-HS-000043 REV 00 (DOC.20041118.0004)}, - address = {Las Vegas, NV}, - pages = {172}, + author = {Apps, J. and Spycher, N.}, + title = {{D}ata qualification for thermodynamic data used to support {THC} calculations}, + institution = {Bechtel SAIC Company, LLC}, + year = {2004}, + number = {ANL-NBS-HS-000043 REV 00 (DOC.20041118.0004)}, + address = {Las Vegas, NV}, + pages = {172}, } @Incollection{NA03, @@ -1214,14 +1214,14 @@ } @Article{DS10, - author = {Delgado Mart?n, Jordi and Soler i Gil, Albert}, - journal = {European Journal of Mineralogy}, - title = {{I}lvaite stability in skarns from the northern contact of the {M}aladeta batholith, {C}entral {P}yrenees ({S}pain)}, - year = {2010}, - volume = {22}, - number = {3}, - pages = {363--380}, - doi = {10.1127/0935-1221/2010/0022-2021}, - issn = {0935-1221}, + author = {Delgado Mart?n, Jordi and Soler i Gil, Albert}, + journal = {European Journal of Mineralogy}, + title = {{I}lvaite stability in skarns from the northern contact of the {M}aladeta batholith, {C}entral {P}yrenees ({S}pain)}, + year = {2010}, + volume = {22}, + number = {3}, + pages = {363--380}, + issn = {0935-1221}, + url = {http://www.ingentaconnect.com/content/10.1127/0935-1221/2010/0022-2021}, } From noreply at r-forge.r-project.org Thu Nov 16 16:42:37 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 16 Nov 2017 16:42:37 +0100 (CET) Subject: [CHNOSZ-commits] r293 - in pkg/CHNOSZ: . inst man vignettes Message-ID: <20171116154237.CA686188E71@r-forge.r-project.org> Author: jedick Date: 2017-11-16 16:42:37 +0100 (Thu, 16 Nov 2017) New Revision: 293 Modified: pkg/CHNOSZ/DESCRIPTION pkg/CHNOSZ/inst/NEWS pkg/CHNOSZ/man/extdata.Rd pkg/CHNOSZ/vignettes/vig.bib Log: submit version 1.1.3 to CRAN Modified: pkg/CHNOSZ/DESCRIPTION =================================================================== --- pkg/CHNOSZ/DESCRIPTION 2017-11-12 16:14:00 UTC (rev 292) +++ pkg/CHNOSZ/DESCRIPTION 2017-11-16 15:42:37 UTC (rev 293) @@ -1,6 +1,6 @@ -Date: 2017-11-12 +Date: 2017-11-13 Package: CHNOSZ -Version: 1.1.2 +Version: 1.1.3 Title: Thermodynamic Calculations for Geobiochemistry Authors at R: c( person("Jeffrey", "Dick", , "j3ffdick at gmail.com", role = c("aut", "cre"), Modified: pkg/CHNOSZ/inst/NEWS =================================================================== --- pkg/CHNOSZ/inst/NEWS 2017-11-12 16:14:00 UTC (rev 292) +++ pkg/CHNOSZ/inst/NEWS 2017-11-16 15:42:37 UTC (rev 293) @@ -1,4 +1,4 @@ -CHANGES IN CHNOSZ 1.1.2 (2017-11-12) +CHANGES IN CHNOSZ 1.1.3 (2017-11-13) ------------------------------------ MAJOR CHANGES: Modified: pkg/CHNOSZ/man/extdata.Rd =================================================================== --- pkg/CHNOSZ/man/extdata.Rd 2017-11-12 16:14:00 UTC (rev 292) +++ pkg/CHNOSZ/man/extdata.Rd 2017-11-16 15:42:37 UTC (rev 293) @@ -116,7 +116,7 @@ Dayhoff, M. O. and Lippincott, E. R. and Eck, R. V. (1964) Thermodynamic Equilibria In Prebiological Atmospheres. \emph{Science} \bold{146}, 1461--1464. \url{https://doi.org/10.1126/science.146.3650.1461} -Dayhoff, M. O. and Lippincott, E. R., Eck, R. V. and Nagarajan (1967) Thermodynamic Equilibrium In Prebiological Atmospheres of C, H, O, N, P, S, and Cl. Report SP-3040, National Aeronautics and Space Administration. \url{http://ntrs.nasa.gov/search.jsp?R=19670017966} +Dayhoff, M. O. and Lippincott, E. R., Eck, R. V. and Nagarajan (1967) Thermodynamic Equilibrium In Prebiological Atmospheres of C, H, O, N, P, S, and Cl. Report SP-3040, National Aeronautics and Space Administration. Dick, J. M. (2014) Average oxidation state of carbon in proteins. \emph{J. R. Soc. Interface} \bold{11}, 20131095. \url{https://doi.org/10.1098/rsif.2013.1095} Modified: pkg/CHNOSZ/vignettes/vig.bib =================================================================== --- pkg/CHNOSZ/vignettes/vig.bib 2017-11-12 16:14:00 UTC (rev 292) +++ pkg/CHNOSZ/vignettes/vig.bib 2017-11-16 15:42:37 UTC (rev 293) @@ -57,13 +57,12 @@ @TechReport{DLEN67, author = {Dayhoff, M. O. and Lippincott, E. R. and Eck, R. V. and Nagarajan, G.}, - title = {Thermodynamic equilibrium in prebiological atmospheres of {C}, {H}, {O}, {N}, {P}, {S}, and {C}l}, + title = {{T}hermodynamic equilibrium in prebiological atmospheres of {C}, {H}, {O}, {N}, {P}, {S}, and {C}l}, institution = {National Aeronautics and Space Administration}, year = {1967}, type = {Report}, number = {SP-3040}, address = {Washington, D. C.}, - url = {http://ntrs.nasa.gov/search.jsp?R=19670017966}, } @Article{Dic08, From noreply at r-forge.r-project.org Thu Nov 16 18:12:39 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 16 Nov 2017 18:12:39 +0100 (CET) Subject: [CHNOSZ-commits] r294 - in pkg/CHNOSZ: . R inst man Message-ID: <20171116171240.1170D1804BD@r-forge.r-project.org> Author: jedick Date: 2017-11-16 18:12:39 +0100 (Thu, 16 Nov 2017) New Revision: 294 Modified: pkg/CHNOSZ/DESCRIPTION pkg/CHNOSZ/R/diagram.R pkg/CHNOSZ/inst/NEWS pkg/CHNOSZ/man/diagram.Rd Log: diagram(): add spline.method argument to control plotting 1-D lines as splines Modified: pkg/CHNOSZ/DESCRIPTION =================================================================== --- pkg/CHNOSZ/DESCRIPTION 2017-11-16 15:42:37 UTC (rev 293) +++ pkg/CHNOSZ/DESCRIPTION 2017-11-16 17:12:39 UTC (rev 294) @@ -1,6 +1,6 @@ -Date: 2017-11-13 +Date: 2017-11-17 Package: CHNOSZ -Version: 1.1.3 +Version: 1.1.3-1 Title: Thermodynamic Calculations for Geobiochemistry Authors at R: c( person("Jeffrey", "Dick", , "j3ffdick at gmail.com", role = c("aut", "cre"), Modified: pkg/CHNOSZ/R/diagram.R =================================================================== --- pkg/CHNOSZ/R/diagram.R 2017-11-16 15:42:37 UTC (rev 293) +++ pkg/CHNOSZ/R/diagram.R 2017-11-16 17:12:39 UTC (rev 294) @@ -9,6 +9,7 @@ #source("equilibrate.R") #source("util.plot.R") #source("util.character.R") +#source("util.misc.R") diagram <- function( # primary input @@ -23,7 +24,7 @@ # sizes cex=par("cex"), cex.names=1, cex.axis=par("cex"), # line styles - lty=NULL, lwd=par("lwd"), dotted=NULL, + lty=NULL, lwd=par("lwd"), dotted=NULL, spline.method=NULL, # colors col=par("col"), col.names=par("col"), fill=NULL, fill.NA="slategray1", limit.water=TRUE, @@ -262,10 +263,10 @@ ### 1-D diagram - lines for properties or chemical activities xvalues <- eout$vals[[1]] + if(missing(xlim)) xlim <- range(xvalues) # TODO: this is backward if the vals are not increasing # initialize the plot if(!add) { if(missing(xlab)) xlab <- axis.label(eout$vars[1], basis=eout$basis, use.molality=use.molality) - if(missing(xlim)) xlim <- range(xvalues) # TODO: this is backward if the vals are not increasing if(missing(ylab)) ylab <- axis.label(plotvar, units="", use.molality=use.molality) # to get range for y-axis, use only those points that are in the xrange if(is.null(ylim)) { @@ -278,7 +279,17 @@ else plot(0, 0, type="n", xlim=xlim, ylim=ylim, xlab=xlab, ylab=ylab, ...) } # draw the lines - for(i in 1:length(plotvals)) lines(xvalues, plotvals[[i]], col=col[i], lty=lty[i], lwd=lwd[i]) + spline.n <- 256 # the number of values at which to calculate splines + if(is.null(spline.method) | length(xvalues) > spline.n) { + for(i in 1:length(plotvals)) lines(xvalues, plotvals[[i]], col=col[i], lty=lty[i], lwd=lwd[i]) + } else { + # plot splines instead of lines connecting the points 20171116 + spline.x <- seq(xlim[1], xlim[2], length.out=spline.n) + for(i in 1:length(plotvals)) { + spline.y <- splinefun(xvalues, plotvals[[i]], method=spline.method)(spline.x) + lines(spline.x, spline.y, col=col[i], lty=lty[i], lwd=lwd[i]) + } + } if(!add & !is.null(legend.x)) { # 20120521: use legend.x=NA to label lines rather than make legend if(is.na(legend.x)) { Modified: pkg/CHNOSZ/inst/NEWS =================================================================== --- pkg/CHNOSZ/inst/NEWS 2017-11-16 15:42:37 UTC (rev 293) +++ pkg/CHNOSZ/inst/NEWS 2017-11-16 17:12:39 UTC (rev 294) @@ -1,3 +1,10 @@ +CHANGES IN CHNOSZ 1.1.3-1 (2017-11-17) +-------------------------------------- + +- Lines in 1-D diagram()s can optionally be drawn as splines using the + method for splinefun() given in the 'spline.method' argument (the + default of NULL means no splines). + CHANGES IN CHNOSZ 1.1.3 (2017-11-13) ------------------------------------ Modified: pkg/CHNOSZ/man/diagram.Rd =================================================================== --- pkg/CHNOSZ/man/diagram.Rd 2017-11-16 15:42:37 UTC (rev 293) +++ pkg/CHNOSZ/man/diagram.Rd 2017-11-16 17:12:39 UTC (rev 294) @@ -14,7 +14,7 @@ xrange=NULL, mar=NULL, yline=par("mgp")[1]+0.3, side=1:4, ylog=TRUE, xlim=NULL, ylim=NULL, xlab=NULL, ylab=NULL, cex=par("cex"), cex.names=1, cex.axis=par("cex"), - lty=NULL, lwd=par("lwd"), dotted=NULL, + lty=NULL, lwd=par("lwd"), dotted=NULL, spline.method = NULL, col=par("col"), col.names=par("col"), fill=NULL, fill.NA="slategray1", limit.water=TRUE, names=NULL, main=NULL, legend.x=NA, format.names=TRUE, adj=0.5, dy=0, @@ -47,6 +47,7 @@ \item{lty}{numeric, line types to be used in plots} \item{lwd}{numeric, line width} \item{dotted}{numeric, how often to skip plotting points on predominance field boundaries (to gain the effect of dotted or dashed boundary lines)} + \item{spline.method}{character, method used in \code{\link{splinefun}}} \item{col}{character, color of activity lines (1D diagram) or predominance field boundaries (2D diagram), or colors of bars in a strip diagram (\code{strip})} \item{col.names}{character, colors for labels of species} \item{fill}{character, colors used to fill predominance fields} @@ -101,6 +102,7 @@ If \code{alpha} is TRUE, the fractional degrees of formation (ratios of activities to total activity) are plotted. Or, setting \code{alpha} to \samp{balance} allows the activities to be multiplied by the number of the balancing component; this is useful for making \dQuote{percent carbon} diagrams where the species differ in carbon number. The line type and line width can be controlled with \code{lty} and \code{lwd}, respectively. +To connect the points with splines instead of lines, set \code{spline.method} to one of the methods in \code{\link{splinefun}}. } \section{2-D diagrams}{ From noreply at r-forge.r-project.org Tue Nov 21 16:16:10 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 21 Nov 2017 16:16:10 +0100 (CET) Subject: [CHNOSZ-commits] r295 - in pkg/CHNOSZ: . R demo inst man Message-ID: <20171121151611.06407183F4B@r-forge.r-project.org> Author: jedick Date: 2017-11-21 16:16:10 +0100 (Tue, 21 Nov 2017) New Revision: 295 Modified: pkg/CHNOSZ/DESCRIPTION pkg/CHNOSZ/NAMESPACE pkg/CHNOSZ/R/util.data.R pkg/CHNOSZ/demo/DEW.R pkg/CHNOSZ/inst/NEWS pkg/CHNOSZ/man/util.data.Rd Log: add dumpdata() Modified: pkg/CHNOSZ/DESCRIPTION =================================================================== --- pkg/CHNOSZ/DESCRIPTION 2017-11-16 17:12:39 UTC (rev 294) +++ pkg/CHNOSZ/DESCRIPTION 2017-11-21 15:16:10 UTC (rev 295) @@ -1,6 +1,6 @@ -Date: 2017-11-17 +Date: 2017-11-21 Package: CHNOSZ -Version: 1.1.3-1 +Version: 1.1.3-2 Title: Thermodynamic Calculations for Geobiochemistry Authors at R: c( person("Jeffrey", "Dick", , "j3ffdick at gmail.com", role = c("aut", "cre"), Modified: pkg/CHNOSZ/NAMESPACE =================================================================== --- pkg/CHNOSZ/NAMESPACE 2017-11-16 17:12:39 UTC (rev 294) +++ pkg/CHNOSZ/NAMESPACE 2017-11-21 15:16:10 UTC (rev 295) @@ -58,7 +58,9 @@ # added 20170301 or later "GHS_Tr", "calculateDensity", "calculateGibbsOfWater", "calculateEpsilon", "calculateQ", "water.DEW", "berman", - "maxdiff", "expect_maxdiff", "Bdot" + "maxdiff", "expect_maxdiff", "Bdot", +# added 20171121 or later + "dumpdata" ) # Load shared objects Modified: pkg/CHNOSZ/R/util.data.R =================================================================== --- pkg/CHNOSZ/R/util.data.R 2017-11-16 17:12:39 UTC (rev 294) +++ pkg/CHNOSZ/R/util.data.R 2017-11-21 15:16:10 UTC (rev 295) @@ -353,6 +353,23 @@ return(out) } +# dump all thermodynamic data in CHNOSZ 20171121 +dumpdata <- function(file=NULL) { + # default database (OBIGT) + Odata <- get("thermo")$obigt + Odata <- cbind(source="OBIGT", Odata) + # optional data + Ddata <- read.csv(system.file("extdata/OBIGT/DEW_aq.csv", package="CHNOSZ"), as.is=TRUE) + Ddata <- cbind(source="DEW", Ddata) + Sdata <- read.csv(system.file("extdata/OBIGT/SUPCRTBL.csv", package="CHNOSZ"), as.is=TRUE) + Sdata <- cbind(source="SUPCRTBL", Sdata) + # put it all together + out <- rbind(Odata, Ddata, Sdata) + # quote columns 2 (name) and 3 (abbrv) because they have commas for some entries + if(!is.null(file)) write.csv(out, file, row.names=FALSE, quote=c(2, 3)) + else(return(out)) +} + ### unexported functions ### # Take a data frame in the format of thermo$obigt of one or more rows, Modified: pkg/CHNOSZ/demo/DEW.R =================================================================== --- pkg/CHNOSZ/demo/DEW.R 2017-11-16 17:12:39 UTC (rev 294) +++ pkg/CHNOSZ/demo/DEW.R 2017-11-21 15:16:10 UTC (rev 295) @@ -150,28 +150,33 @@ mod.buffer("QFM_Berman", c("quartz", "fayalite", "magnetite"), "cr_Berman", 0) ## calculate logfO2 in QFM buffer basis("O2", "QFM_Berman") -T <- seq(600, 1000, 5); T100 <- seq(600, 1000, 100) +T <- seq(600, 1000, 100) buf <- affinity(T=T, P=50000, return.buffer=TRUE) ## add species species(c(inorganics, organics)) ## generate spline functions from IS, pH, and molC values at every 100 degC -IS <- splinefun(T100, c(0.39, 0.57, 0.88, 1.45, 2.49)) -pH <- splinefun(T100, c(3.80, 3.99, 4.14, 4.25, 4.33)) -molC <- splinefun(T100, c(0.03, 0.2, 1, 4, 20)) +IS <- c(0.39, 0.57, 0.88, 1.45, 2.49) +pH <- c(3.80, 3.99, 4.14, 4.25, 4.33) +molC <- c(0.03, 0.2, 1, 4, 20) ## use Debye-Huckel equation with B-dot set to zero nonideal("Helgeson0") ## calculate affinities on the T-logfO2-pH-IS transect -a <- affinity(T = T, O2 = buf$O2 - 2, IS = IS(T), pH = pH(T), P = 50000) +a <- affinity(T = T, O2 = buf$O2 - 2, IS = IS, pH = pH, P = 50000) ## calculate metastable equilibrium activities using the total ## carbon molality as an approximation of total activity -e <- equilibrate(a, loga.balance = log10(molC(T))) +e <- equilibrate(a, loga.balance = log10(molC)) ## make the diagram; don't plot names of low-abundance species names <- c(inorganics, organics) names[c(4, 5, 7, 9)] <- "" col <- rep("black", length(names)) col[c(1, 3, 6, 8, 10)] <- c("red", "darkgreen", "purple", "orange", "navyblue") -diagram(e, alpha = "balance", ylab = "carbon fraction", names = names, col = col, ylim = c(0, 0.8)) +if(packageVersion("CHNOSZ") > "1.1.3") { + diagram(e, alpha = "balance", names = names, col = col, ylim = c(0, 0.8), ylab="carbon fraction", spline.method="natural") +} else { + diagram(e, alpha = "balance", names = names, col = col, ylim = c(0, 0.8), ylab="carbon fraction") +} + ## add legend and title ltxt1 <- "P = 50000 bar" ltxt2 <- substitute(logfO2=="QFM-2", list(logfO2 = axis.label("O2"))) @@ -184,7 +189,7 @@ ### additional checks ## check that we're within 0.1 of the QFM-2 values used by SSH14 -stopifnot(maxdiff((buf$O2-2)[!T%%100], c(-17.0, -14.5, -12.5, -10.8, -9.4)) < 0.1) +stopifnot(maxdiff((buf$O2-2), c(-17.0, -14.5, -12.5, -10.8, -9.4)) < 0.1) # Here are the logKs of aqueous species dissociation reactions at 600 degC and 50000 bar, # values from EQ3NR output in Supporting Information of the paper (p. 103-109): Modified: pkg/CHNOSZ/inst/NEWS =================================================================== --- pkg/CHNOSZ/inst/NEWS 2017-11-16 17:12:39 UTC (rev 294) +++ pkg/CHNOSZ/inst/NEWS 2017-11-21 15:16:10 UTC (rev 295) @@ -1,10 +1,13 @@ -CHANGES IN CHNOSZ 1.1.3-1 (2017-11-17) +CHANGES IN CHNOSZ 1.1.3-2 (2017-11-21) -------------------------------------- - Lines in 1-D diagram()s can optionally be drawn as splines using the method for splinefun() given in the 'spline.method' argument (the default of NULL means no splines). +- Add dumpdata() for returning/writing all packaged data (including + default database and optional data files). + CHANGES IN CHNOSZ 1.1.3 (2017-11-13) ------------------------------------ Modified: pkg/CHNOSZ/man/util.data.Rd =================================================================== --- pkg/CHNOSZ/man/util.data.Rd 2017-11-16 17:12:39 UTC (rev 294) +++ pkg/CHNOSZ/man/util.data.Rd 2017-11-21 15:16:10 UTC (rev 295) @@ -5,6 +5,7 @@ \alias{checkEOS} \alias{checkGHS} \alias{check.obigt} +\alias{dumpdata} \alias{RH2obigt} \title{Functions for Checking Thermodynamic Data} \description{ @@ -17,6 +18,7 @@ checkEOS(eos, state, prop, ret.diff = FALSE) checkGHS(ghs, ret.diff = FALSE) check.obigt() + dumpdata(file) RH2obigt(compound = NULL, state = "cr", file = system.file("extdata/thermo/RH98_Table15.csv", package = "CHNOSZ")) } @@ -28,8 +30,8 @@ \item{prop}{character, property of interest (\samp{Cp} or \samp{V})} \item{ret.diff}{logical, return the difference between calculated and tabulated values?} \item{ghs}{dataframe, containing G, H and S, in the format of \code{thermo$obigt}} + \item{file}{character, path to a file} \item{compound}{character, name of compound(s) in group additivity calculation} - \item{file}{character, path to a file} } \details{ @@ -53,6 +55,9 @@ \code{check.obigt} is a function to check self-consistency of each entry in the thermodynamic database, using \code{checkEOS} and \code{checkGHS}. The output is a table listing only species that exceed at least one of the tolerance limits, giving the species index (rownumber in `thermo$obigt`), species name and state, and DCp, DV and DG, for the calculated differences (only those above the tolerances are given). This function is used to generate the file found at \code{extdata/thermo/obigt_check.csv}. +\code{dumpdata} returns all of the available data, from both the default and optional data files, or writes it to a file if \code{file} is not NULL. +The format is the same as \code{\link{thermo}$obigt}, except for a single prepended column named \samp{source}, giving the source of the data (\samp{OBIGT} refers to the default database, and \samp{DEW} and \samp{SUPCRTBL} are the optional data files). + \code{RH2obigt} implements a group additivity algorithm for standard molal thermodynamic properties and equations of state parameters of crystalline and liquid organic molecules from Richard and Helgeson, 1998. The names of the \code{compound}s and their physical \code{state} are searched for in the indicated \code{file}, that also contains chemical formulas and group stoichiometries; the names of the groups are stored in the column names of this file, and must be present in \code{\link{thermo}$obigt}. The default \code{file} (\code{\link{extdata}/thermo/RH98_Table15.csv}) includes data taken from Table 15 of Richard and Helgeson, 1998 for high molecular weight compounds in \samp{cr}ystalline and \samp{liq}uid states. An error is produced if any of the \code{compound}-\code{state} combinations is not found in the \code{file}, if any of the group names for a given \code{compound}-\code{state} combination is not found in \code{thermo$obigt}, or if the chemical formula calculated from group additivity (with the aid of \code{\link{i2A}} and \code{\link{as.chemical.formula}}) is not identical to that listed in the \code{file}. }