[CHNOSZ-commits] r237 - in pkg/CHNOSZ: . R data inst/extdata/Berman inst/extdata/OBIGT tests/testthat vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Oct 2 16:42:02 CEST 2017


Author: jedick
Date: 2017-10-02 16:42:02 +0200 (Mon, 02 Oct 2017)
New Revision: 237

Added:
   pkg/CHNOSZ/inst/extdata/Berman/Ber90.csv
   pkg/CHNOSZ/inst/extdata/Berman/SHD91.csv
   pkg/CHNOSZ/inst/extdata/Berman/ZS92.csv
Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/R/berman.R
   pkg/CHNOSZ/data/refs.csv
   pkg/CHNOSZ/inst/extdata/OBIGT/Berman_cr.csv.xz
   pkg/CHNOSZ/tests/testthat/test-berman.R
   pkg/CHNOSZ/vignettes/obigt.bib
Log:
add modifications to Berman data (1990 to 1992)


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2017-10-02 11:35:03 UTC (rev 236)
+++ pkg/CHNOSZ/DESCRIPTION	2017-10-02 14:42:02 UTC (rev 237)
@@ -1,6 +1,6 @@
 Date: 2017-10-02
 Package: CHNOSZ
-Version: 1.1.0-35
+Version: 1.1.0-36
 Title: Thermodynamic Calculations for Geobiochemistry
 Author: Jeffrey Dick
 Maintainer: Jeffrey Dick <j3ffdick at gmail.com>

Modified: pkg/CHNOSZ/R/berman.R
===================================================================
--- pkg/CHNOSZ/R/berman.R	2017-10-02 11:35:03 UTC (rev 236)
+++ pkg/CHNOSZ/R/berman.R	2017-10-02 14:42:02 UTC (rev 237)
@@ -11,8 +11,14 @@
   # the number of conditions we have
   ncond <- max(length(T), length(P))
   # get thermodynamic parameters
-  file <- system.file("extdata/Berman/Ber88.csv", package="CHNOSZ")
-  dat <- read.csv(file, as.is=TRUE)
+  dir <- system.file("extdata/Berman/", package="CHNOSZ")
+  Ber88 <- read.csv(paste0(dir, "/Ber88.csv"), as.is=TRUE)
+  Ber90 <- read.csv(paste0(dir, "/Ber90.csv"), as.is=TRUE)
+  SHD91 <- read.csv(paste0(dir, "/SHD91.csv"), as.is=TRUE)
+  ZS92 <- read.csv(paste0(dir, "/ZS92.csv"), as.is=TRUE)
+  # assemble the files and remove duplicates (keep the latest)
+  dat <- rbind(ZS92, SHD91, Ber90, Ber88)
+  dat <- dat[!duplicated(dat$name), ]
   # remove the multipliers
   multexp <- c(0, 0, 0, 0,          # Ber88 Table 2
                0, -2, -5, -7,             # Table 3a
@@ -36,7 +42,8 @@
   if(check.G) {
     GfPrTr_calc <- HfPrTr - Tr * (SPrTr - SPrTr_elements)
     Gdiff <- GfPrTr_calc - GfPrTr
-    if(abs(Gdiff) >= 1000) warning(paste0(name, ": GfPrTr(calc) - GfPrTr(table) is too big! == ",
+    if(is.na(GfPrTr)) warning(paste0(name, ": GfPrTr(table) is NA"), call.=FALSE)
+    else if(abs(Gdiff) >= 1000) warning(paste0(name, ": GfPrTr(calc) - GfPrTr(table) is too big! == ",
                                           round(GfPrTr_calc - GfPrTr), " J/mol"), call.=FALSE)
     # (the tabulated GfPrTr is unused below)
   }

Modified: pkg/CHNOSZ/data/refs.csv
===================================================================
--- pkg/CHNOSZ/data/refs.csv	2017-10-02 11:35:03 UTC (rev 236)
+++ pkg/CHNOSZ/data/refs.csv	2017-10-02 14:42:02 UTC (rev 237)
@@ -20,10 +20,16 @@
 Ber88,"R. G. Berman",1988,"J. Petrol. 29, 445-522","minerals",https://doi.org/10.1093/petrology/29.2.445
 SH88,"E. L. Shock and H. C. Helgeson",1988,"Geochim. Cosmochim. Acta 52, 2009-2036","ionic species",https://doi.org/10.1016/0016-7037(88)90181-0
 SHS89,"E. L. Shock, H. C. Helgeson and D. A. Sverjensky",1989,"Geochim. Cosmochim. Acta 53, 2157-2183","inorganic neutral species",https://doi.org/10.1016/0016-7037(89)90341-4
+Ber90,"R. G. Berman",1990,"Am. Mineral. 75, 328-344","annite",http://ammin.geoscienceworld.org/content/75/3-4/328
+Ber90.1,"R. G. Berman",1990,"Am. Mineral. 75, 328-344","almandine and ilmenite: revised H and/or S",http://ammin.geoscienceworld.org/content/75/3-4/328
 SH90,"E. L. Shock and H. C. Helgeson",1990,"Geochim. Cosmochim. Acta 54, 915-945","organic species",https://doi.org/10.1016/0016-7037(90)90429-O
+SHD91,"D. A. Sverjensky, J. J. Hemley and W. M. D'Angelo",1991,"Geochim. Cosmochim. Acta 55, 989-1004","G and H corrections for K- and Al-bearing silicates",https://doi.org/10.1016/0016-7037(89)90341-4
 SPRONS92.1,"H. C. Helgeson et al.",1992,"sprons92.dat computer data file","titanite: @BH83 + "Gibbs free energies and enthalpies were corrected to be consistent with updated values of Gibbs free energies of Ca<sup>2+</sup> and CO<sub>3</sub><sup>2-</sup> [@SH88] together with the solubilities of calcite and aragonite reported by @PB82 "",
 SPRONS92.2,"H. C. Helgeson et al.",1992,"sprons92.dat computer data file","Ca-bearing minerals; "Gibbs free energies and enthalpies were corrected to be consistent with updated values of Gibbs free energies of Ca<sup>2+</sup> and CO<sub>3</sub><sup>2-</sup> [@SH88] together with the solubilities of calcite and aragonite reported by @PB82 "",
 Sho92,"E. L. Shock",1992,"Geochim. Cosmochim. Acta 56, 3481-3491","diglycine, alanylglycine, leucylglycine, and diketopiperazine",https://doi.org/10.1016/0016-7037(92)90392-V
+ZS92,"C. Zhu and D. A. Sverjensky",1982,"Geochim. Cosmochim. Acta 56, 3435-3467","F,Cl,OH biotite and apatite endmembers. GHS and V were taken from Table 6 of @ZS92; heat capacity and volume parameters from `berman.dat` in SUPCRT92b.zip file on the [DEW website](http://www.dewcommunity.org/resources.html).",https://doi.org/10.1016/0016-7037(92)90390-5
+ZS92.1,"C. Zhu and D. A. Sverjensky",1982,"Geochim. Cosmochim. Acta 56, 3435-3467","phlogopite: updated by @Ber90, then revised G and H using correction for K-bearing silicates [@SHD91]",https://doi.org/10.1016/0016-7037(92)90390-5
+ZS92.2,"C. Zhu and D. A. Sverjensky",1982,"Geochim. Cosmochim. Acta 56, 3435-3467","annite: revised G and H",https://doi.org/10.1016/0016-7037(92)90390-5
 Sho93,"E. L. Shock",1993,"Geochim. Cosmochim. Acta 57, 3341-3349","ethylacetate and acetamide",https://doi.org/10.1016/0016-7037(93)90542-5
 Sho93.1,"E. L. Shock",1993,"Geochim. Cosmochim. Acta 57, 3341-3349","carbon monoxide and ethylene",https://doi.org/10.1016/0016-7037(93)90542-5
 SK93,"E. L. Shock and C. M. Koretsky",1993,"Geochim. Cosmochim. Acta 57, 4899-4922","metal-acetate complexes",https://doi.org/10.1016/0016-7037(93)90128-J

Added: pkg/CHNOSZ/inst/extdata/Berman/Ber90.csv
===================================================================
--- pkg/CHNOSZ/inst/extdata/Berman/Ber90.csv	                        (rev 0)
+++ pkg/CHNOSZ/inst/extdata/Berman/Ber90.csv	2017-10-02 14:42:02 UTC (rev 237)
@@ -0,0 +1,5 @@
+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
+almandine,-4941728,-5267216,340.007,11.511,573.96,-14.831,-292.92,502.208,-0.558,0.321,18.613,74.539,,,,,,,,,,,,,,
+annite,,-5142800,420,15.408,727.21,-47.7504,-138.319,211.906,-1.697,0,34.447,0,,,,,,,,,,,,,,
+ilmenite,-1155320,-1232448,108.628,3.17,150,-4.416,-33.237,34.815,-0.584,1.23,27.248,29.968,,,,,,,,,,,,,,
+phlogopite,-5827224,-6210391,334.346,14.977,610.38,-20.838,-215.33,284.104,-1.697,0,34.447,0,,,,,,,,,,,,,,

Added: pkg/CHNOSZ/inst/extdata/Berman/SHD91.csv
===================================================================
--- pkg/CHNOSZ/inst/extdata/Berman/SHD91.csv	                        (rev 0)
+++ pkg/CHNOSZ/inst/extdata/Berman/SHD91.csv	2017-10-02 14:42:02 UTC (rev 237)
@@ -0,0 +1,11 @@
+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
+muscovite,-5603417,-5983434,293.157,14.087,651.49,-38.732,-185.232,274.247,-1.717,4.295,33.527,0,,,,,,,,,,,,,,
+phlogopite,-5833918,-6214036,334.158,14.977,610.38,-20.838,-215.33,284.104,-1.697,0,34.447,0,,,,,,,,,,,,,,
+K-feldspar,-3752109,-3977485,214.145,10.869,381.37,-19.41,-120.373,183.643,-1.805,5.112,15.145,54.85,,,,,,,1436,298,282.98,-4.83,36.21,-15.733,34.77,41.063
+"K-feldspar,high",-3745498,-3966398,229.157,10.896,381.37,-19.41,-120.373,183.643,-1.805,5.112,15.145,54.85,,,,,,,,,,,,,,
+"K-feldspar,low",-3752109,-3977485,214.145,10.869,381.37,-19.41,-120.373,183.643,-1.805,5.112,15.145,54.85,,,,,,,,,,,,,,
+paragonite,-5570375,-5951011,277.699,13.216,577.57,-14.728,-322.144,505.008,-1.973,4.933,39.424,59.701,,,,,,,,,,,,,,
+albite,-3710096,-3928421,224.412,10.083,393.64,-24.155,-78.928,107.064,-1.945,4.861,26.307,32.407,,,,,,,,,,,,,,
+"albite,high",-3710096,-3928421,224.412,10.083,393.64,-24.155,-78.928,107.064,-1.945,4.861,26.307,32.407,,,,,,,,,,,,,,
+"albite,low",-3718518,-3941903,207.443,10.043,393.64,-24.155,-78.928,107.064,-1.945,4.861,26.307,32.407,,,,,,,,,,,,,,
+jadeite,-2853285,-3031921,133.574,6.034,311.29,-20.051,-53.503,66.257,-0.86,2.149,23.118,25.785,,,,,,,,,,,,,,

Added: pkg/CHNOSZ/inst/extdata/Berman/ZS92.csv
===================================================================
--- pkg/CHNOSZ/inst/extdata/Berman/ZS92.csv	                        (rev 0)
+++ pkg/CHNOSZ/inst/extdata/Berman/ZS92.csv	2017-10-02 14:42:02 UTC (rev 237)
@@ -0,0 +1,13 @@
+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
+annite,-4799801,-5151031,420,15.408,727.208,-47.7504,-138.319,211.906,-1.6969784,0,34.4473262,0,NA,NA,NA,NA,NA,NA,NA,NA,,,,,,
+phlogopite,-5836969,-6218621,334.346,14.977,610.38,-20.838,-215.33,284.104,-1.697,0,34.447,0,,,,,,,,,,,,,,
+fluormuscovite,-5772803,-6111401,299.03,14.087,680.36024,-65.15743,0,11.058312,-1.7169021,4.2947,33.5273302,0,NA,NA,NA,NA,NA,NA,NA,NA,,,,,,
+fluorphlogopite,-6063382,-6403168,336.394,14.637,653.70816,-51.7519,0,-32.459472,-1.6969784,0,34.4473262,0,NA,NA,NA,NA,NA,NA,NA,NA,,,,,,
+fluorannite,-4983910,-5293254,422.291,15.075,742.82736,-68.1741,0,41.844184,-1.6969784,0,34.4473262,0,NA,NA,NA,NA,NA,NA,NA,NA,,,,,,
+fluortremolite,-11782144,-12457969,570.279,27.045,1272.64728,-94.93496,0,-1.05177392,-1.3917727,3.4809,24.3738877,98.338,NA,NA,NA,NA,NA,NA,NA,NA,,,,,,
+fluorapatite,-6443050,-6823447,387.857,15.753,668.77056,-45.34201,0,-74.634192,0,0,0,0,NA,NA,NA,NA,NA,NA,NA,NA,,,,,,
+hydroxyapatite,-6297702,-6694689,398.735,15.822,758.81024,-64.80598,0,-44.793904,0,0,0,0,NA,NA,NA,NA,NA,NA,NA,NA,,,,,,
+chlorapatite,-6217424,-6597260,399.907,16.403,663.87528,-44.35877,0,-69.023448,0,0,0,0,NA,NA,NA,NA,NA,NA,NA,NA,,,,,,
+fluortalc,-5717018,-6056244,264.052,13.33,602.74704,-47.66831,0,-29.2588712,-1.6988979,5.665,29.4468112,0,NA,NA,NA,NA,NA,NA,NA,NA,,,,,,
+chlorphlogopite,-5600840,-5939422,360.703,16.59,573.45904,-20.63549,-164.657136,210.576536,-1.6969784,0,34.4473262,0,NA,NA,NA,NA,NA,NA,NA,NA,,,,,,
+chlorannite,-4582036,-4890196,449.529,17.247,690.44368,-47.60137,-87.253136,137.682888,-1.6969784,0,34.4473262,0,NA,NA,NA,NA,NA,NA,NA,NA,,,,,,

Modified: pkg/CHNOSZ/inst/extdata/OBIGT/Berman_cr.csv.xz
===================================================================
(Binary files differ)

Modified: pkg/CHNOSZ/tests/testthat/test-berman.R
===================================================================
--- pkg/CHNOSZ/tests/testthat/test-berman.R	2017-10-02 11:35:03 UTC (rev 236)
+++ pkg/CHNOSZ/tests/testthat/test-berman.R	2017-10-02 14:42:02 UTC (rev 237)
@@ -2,8 +2,14 @@
 context("berman")
 
 # calculate properties for all available minerals at Tr,Pr
-file <- system.file("extdata/Berman/Ber88.csv", package="CHNOSZ")
-dat <- read.csv(file, as.is=TRUE)
+dir <- system.file("extdata/Berman/", package="CHNOSZ")
+Ber88 <- read.csv(paste0(dir, "/Ber88.csv"), as.is=TRUE)
+Ber90 <- read.csv(paste0(dir, "/Ber90.csv"), as.is=TRUE)
+SHD91 <- read.csv(paste0(dir, "/SHD91.csv"), as.is=TRUE)
+ZS92 <- read.csv(paste0(dir, "/ZS92.csv"), as.is=TRUE)
+# assemble the files and remove duplicates (keep the latest)
+dat <- rbind(ZS92, SHD91, Ber90, Ber88)
+dat <- dat[!duplicated(dat$name), ]
 mineral <- unique(dat$name)
 prop_Berman <- NULL
 
@@ -11,7 +17,10 @@
   # running this without error means that:
   # - formulas for the minerals are found in thermo$obigt
   # - there are no warnings for minerals with GfPrTr(calc) >= 1000 J/cal different from GfPrTr(table)
-  expect_silent(properties <- lapply(mineral, berman, check.G=TRUE))
+  #expect_silent(properties <- lapply(mineral, berman, check.G=TRUE))
+  # - warnings are produced for 3 minerals with GfPrTr(calc) >= 1000 J/cal different from GfPrTr(table)
+  expect_warning(properties <- lapply(mineral, berman, check.G=TRUE),
+                 "almandine|annite|phlogopite|fluortremolite", all=TRUE)
   # save the results so we can use them in the next tests
   assign("prop_Berman", properties, inherits=TRUE)
   
@@ -39,7 +48,7 @@
   # which minerals differ in DGf by more than 4 kcal/mol?
   idiffG <- which(abs(prop_Berman$G - prop_Helgeson$G) > 4000)
   expect_match(mineral[idiffG],
-               "anthophyllite|antigorite|Ca-Al-pyroxene|lawsonite|margarite|merwinite")
+               "paragonite|anthophyllite|antigorite|Ca-Al-pyroxene|lawsonite|margarite|merwinite")
   ## we find 9 of them, as follow:
   #expect_match(mineral[idiffG],
   #             "anthophyllite|antigorite|Ca-Al-pyroxene|cordierite,dry|cordierite,hydrous|lawsonite|margarite|merwinite|paragonite")
@@ -48,16 +57,16 @@
   idiffH <- which(abs(prop_Berman$H - prop_Helgeson$H) > 4000)
   # we get the above, plus phlogopite and clinozoisite:
   expect_match(mineral[idiffH],
-               "anthophyllite|antigorite|Ca-Al-pyroxene|lawsonite|margarite|merwinite|phlogopite|clinozoisite")
+               "paragonite|anthophyllite|antigorite|Ca-Al-pyroxene|lawsonite|margarite|merwinite|phlogopite|clinozoisite")
 
   # 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|almandine")
+  expect_match(mineral[idiffS], "albite|annite|almandine|fluortremolite")
   #expect_match(mineral[idiffS], "albite|almandine|annite|cordierite,hydrous|fluortremolite")
 
   # 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], "antigorite|cristobalite,beta|K-feldspar")
+  expect_match(mineral[idiffCp], "antigorite|cristobalite,beta|K-feldspar|fluortremolite")
   #expect_match(mineral[idiffCp],
   #             "antigorite|cordierite,hydrous|cristobalite,beta|fluortremolite|glaucophane|greenalite|K-feldspar")
 

Modified: pkg/CHNOSZ/vignettes/obigt.bib
===================================================================
--- pkg/CHNOSZ/vignettes/obigt.bib	2017-10-02 11:35:03 UTC (rev 236)
+++ pkg/CHNOSZ/vignettes/obigt.bib	2017-10-02 14:42:02 UTC (rev 237)
@@ -913,3 +913,39 @@
   issn      = {0016-7037},
 }
 
+ at Article{ZS92,
+  author    = {Chen Zhu and Dimitri A Sverjensky},
+  journal   = {Geochimica et Cosmochimica Acta},
+  title     = {{F}-{C}l-{OH} partitioning between biotite and apatite},
+  year      = {1992},
+  volume    = {56},
+  number    = {9},
+  pages     = {3435 - 3467},
+  doi       = {10.1016/0016-7037(92)90390-5},
+  issn      = {0016-7037},
+}
+
+ at Article{Ber90,
+  author        = {Berman, R. G.},
+  journal       = {American Mineralogist},
+  title         = {{M}ixing properties of {C}a-{M}g-{F}e-{M}n garnets},
+  year          = {1990},
+  volume        = {75},
+  number        = {3-4},
+  pages         = {328--344},
+  issn          = {0003-004X},
+  publisher     = {Mineralogical Society of America},
+  url           = {http://ammin.geoscienceworld.org/content/75/3-4/328},
+}
+
+ at Article{SHD91,
+  author    = {Sverjensky, Dimitri A. and Hemley, J. J. and D'Angelo, W. M.},
+  journal   = {Geochimica et Cosmochimica Acta},
+  title     = {{T}hermodynamic assessment of hydrothermal alkali feldspar-mica-aluminosilicate equilibria},
+  year      = {1991},
+  volume    = {55},
+  number    = {4},
+  pages     = {989--1004},
+  doi       = {10.1016/0016-7037(91)90157-Z},
+}
+



More information about the CHNOSZ-commits mailing list