diff --git a/CRAN-RELEASE b/CRAN-RELEASE index 3e11b98..686cb1e 100644 --- a/CRAN-RELEASE +++ b/CRAN-RELEASE @@ -1,2 +1,2 @@ -This package was submitted to CRAN on 2021-07-02. -Once it is accepted, delete this file and tag the release (commit 7d1ccf3). +This package was submitted to CRAN on 2021-07-05. +Once it is accepted, delete this file and tag the release (commit 58cf0d3). diff --git a/DESCRIPTION b/DESCRIPTION index 7f5f781..8aee61b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: ShellChron Title: Builds Chronologies from Oxygen Isotope Profiles in Shells -Version: 0.4.0 +Version: 0.4.1 Authors@R: person(given = "Niels", family = "de Winter", @@ -10,10 +10,9 @@ Authors@R: Description: Takes as input a stable oxygen isotope (d18O) profile measured in growth direction (D) through a shell + uncertainties in both variables (d18O_err & D_err). It then models the seasonality in the d18O record by fitting a combination of a growth and temperature sine wave to year-length chunks of - the data (see Judd et al., (2018) ). This modeling is carried out along a sliding window through the data and yields estimates of - the day of the year (Julian Day) and local growth rate for each data point. Uncertainties in both modeling - routine and the data itself are propagated and pooled to obtain a confidence envelope around the age of - each data point in the shell. The end result is a shell chronology consisting of estimated ages of shell + the data (see Judd et al., (2018) ). This modeling is carried out along a sliding window through the data and yields estimates of the day of the year (Julian Day) and local growth rate for each data point. + Uncertainties in both modeling routine and the data itself are propagated and pooled to obtain a confidence envelope + around the age of each data point in the shell. The end result is a shell chronology consisting of estimated ages of shell formation relative to the annual cycle with their uncertainties. All formulae in the package serve this purpose, but the user can customize the model (e.g. number of days in a year and the mineralogy of the shell carbonate) through input parameters. diff --git a/NEWS.md b/NEWS.md index 6bf112f..51bc9cf 100644 --- a/NEWS.md +++ b/NEWS.md @@ -16,4 +16,8 @@ Previous versions of ShellChron underestimated the seasonal d18Oc range and retu 1. The boundaries on the growth rate sinusoid were set too liberally, causing growth rates to vary by several orders of magnitude within years and allowing growth rate variability over time to be nearly flat or vertical. The run_model function was modified to make the growth rate boundaries more restrictive, and dependent on the estimated initial value for the mean growth rate. The new boundaries still allow growth rate to vary by a factor 10 within a year, which should cover the natural variability of growth rates in d18Oc archives. 2. Constant d18Oc solutions in modeling windows were often a result of the number of years of d18Oc that were modeled within a window. If the window contained more time than expected the samples outside the d18Oc curve were assigned a constant value, resulting in a flat d18Oc profile. This issue also explained why the mean modeled d18Oc values underestimated the true d18Oc variability in the record. -3. Slight modifications were made to the cumulative_day function that aligns results from individual modeling windows to a common time axis. The previous version of ShellChron added too many or too little days to the age results in modeling windows in which either none or multiple year transitions occur. This resulted in sudden jumps in time in the age-distance relationship. \ No newline at end of file +3. Slight modifications were made to the cumulative_day function that aligns results from individual modeling windows to a common time axis. The previous version of ShellChron added too many or too little days to the age results in modeling windows in which either none or multiple year transitions occur. This resulted in sudden jumps in time in the age-distance relationship. + +## 0.4.0 +Added citation data of the now-published paper +Slightly modified d18O_model.r to update the function for VPDB to VSMOW conversion \ No newline at end of file diff --git a/R/d18O_model.r b/R/d18O_model.r index ad922ae..eb2741f 100644 --- a/R/d18O_model.r +++ b/R/d18O_model.r @@ -31,6 +31,10 @@ #' international reference materials for isotope-ratio analysis (IUPAC Technical #' Report), _Pure and Applied Chemistry_ **2014**, _86.3_, 425-467. #' \doi{10.1515/pac-2013-1023} +#' Kim, S.-T., Coplen, T. B., and Horita, J.: Normalization of stable +#' isotope data for carbonate minerals: Implementation of IUPAC +#' guidelines, Geochim. Cosmochim. Ac. **2015** 158, 276-289. +#' \doi{10.1016/j.gca.2015.02.011} #' @examples #' # Create dummy SST data #' t <- seq(1, 40, 1) @@ -52,7 +56,7 @@ d18O_model <- function(SST, # Function that converts SST values into d18O d18Ow <- c(0, rep(d18Ow, length(SST[,1])/length(d18Ow))) # If d18Ow is a vector with more than one value, multiply it to reach the same length of SST (multiply by "years") } if(transfer_function == "KimONeil97"){ - d18Oc <- cbind(SST[,1], (exp((18.03 * 1000 / (SST[,2] + 273.15) - 32.42) / 1000) - 1) * 1000 + (0.97002 * d18Ow - 29.98)) # Use Kim and O'Neil (1997) with conversion between VSMOW and VPDB by Brand et al. (2014) + d18Oc <- cbind(SST[,1], (exp((18.03 * 1000 / (SST[,2] + 273.15) - 32.42) / 1000) - 1) * 1000 + (0.97001 * d18Ow - 29.99)) # Use Kim and O'Neil (1997) with conversion between VSMOW and VPDB by Brand et al. (2014) and Kim et al. (2015) }else if(transfer_function == "GrossmanKu86"){ d18Oc <- cbind(SST[,1], (20.6 - SST[,2]) / 4.34 + d18Ow + 0.2) # Use Grossmann and Ku (1986) modified by Dettmann et al. (1999) }else{ diff --git a/README.Rmd b/README.Rmd index 24c5d98..e948194 100644 --- a/README.Rmd +++ b/README.Rmd @@ -51,6 +51,9 @@ The model builds on previous work by [Judd et al. 2018](https://doi.org/10.1016/ **column 5: d18Oc_err** stable oxygen isotope value uncertainty, in permille. +When you use ShellChron, please cite [de Winter, 2022](https://gmd.copernicus.org/articles/15/1247/2022/): + +**de Winter, N.J. (2022) "ShellChron 0.4.0: a new tool for constructing chronologies in accretionary carbonate archives from stable oxygen isotope profiles" Geoscientific Model Development 15, 1247-1267, DOI: 10.5194/gmd-15-1247-2022** ## Installation diff --git a/README.html b/README.html new file mode 100644 index 0000000..9d8010d --- /dev/null +++ b/README.html @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + +

ShellChron

+ + +

Travis build status

+ + +

The ShellChron package contains all formulae and documentation required to run the ShellChron model. The ShellChron model uses stable oxygen isotope records (d18O) from seasonal paleo-archives to create an age model for the archive.

+

In short, ShellChron feeds a temperature sinusoid (Figure 1; see details in “temperature_curve()” function) and a skewed growth rate sinusoid (Figure 2; see details in “growth_rate_curve()” function) to a d18O model (see details in “d18O_model()” function). The resulting modeled d18O is then compared with the user-provided d18O data and the parameters of the temperature and growth rate functions are optimized using the SCEUA algorithm (see Duan et al., 1992) to match the d18O data. As a result, the timing of each data point with reference to the seasonal cycle is exported, from which an age model for the entire record can be constructed.

+

Figure 1: Temperature sinusoid Figure 2: Growth rate sinusoid

+

The model builds on previous work by Judd et al. 2018 and expands on this previous model in several key ways:

+
    +
  1. ShellChron allows SCEUA optimization to be carried out in a sliding window through the data and recognizes year transitions (see “cumulative_day()” formula) to produce seamless age models through multiple years. Overlapping windows are used to estimate the reproducibility of model results.
  2. +
  3. ShellChron provides the option to take uncertainties on the input data (“D_err” and “d18Oc_err”) into account in error estimation (see “mc_err_orth()” and "export_results() functions), providing realistic errors on the age estimation which were previously unsupported.
  4. +
  5. ShellChron supports different empirical formulae for converting temperature and d18O of the precipitation fluid into d18O records, providing compatibility with records consisting of various mineralogies (e.g. calcite and aragonite).
  6. +
  7. ShellChron offers more dynamic input options for data on the variable that is not modeled (usually d18O of precipitation fluid), circumventing the (often false) assumption that this variable remains constant throughout the year and preventing fixed values for this variable hardcoded in the model.
  8. +
  9. ShellChron achieves more efficient SCEUA modeling by pre-guessing the parameters of temperature and growth rate sinusoids using a sinusoidal regression (see “sinreg()” formula). This is an essential feature that allows ShellChron to process more optimization windows while retaining competitive processing time (see Figure 3).
  10. +
+

Figure 3: Timing of whole model run at various data resolutions

+

NOTE: To run optimally, ShellChron requires sampling distance data to be provided in micrometers (see “data_import()” function). The optimal structure of the input CSV should be as follows (see description in “Virtual_shell” example):

+

column 1: D Sampling distance, in micrometers along the virtual record.

+

column 2: d18Oc stable oxygen isotope value, in permille VPDB.

+

column 3: YEARMARKER Vector of zeroes with “1” marking year transitions.

+

column 4: D_err Sampling distance uncertainty, in micrometers.

+

column 5: d18Oc_err stable oxygen isotope value uncertainty, in permille.

+

When you use ShellChron, please cite de Winter, 2022:

+

de Winter, N.J. (2022) “ShellChron 0.4.0: a new tool for constructing chronologies in accretionary carbonate archives from stable oxygen isotope profiles” Geoscientific Model Development 15, 1247-1267, DOI: 10.5194/gmd-15-1247-2022

+

Installation

+

You can install the released version of ShellChron from CRAN with:

+
install.packages("ShellChron")
+

And the development version from GitHub with:

+
# install.packages("devtools")
+devtools::install_github("nielsjdewinter/ShellChron")
+

Example

+

This is a basic example which shows you how to solve a common problem:

+
library(ShellChron)
+## Full model run
+# WARNING: Running the full ShellChron model (even on small example data) always takes some time (usually in the order of 30-60 minutes)
+# example <- wrap_function(path = getwd(),
+#  file_name = system.file("extdata", "Virtual_shell.csv",
+#  package = "ShellChron"),
+#  "calcite",
+#  1,
+#  365,
+#  d18Ow = 0,
+#  t_maxtemp = 182.5,
+#  MC = 1000,
+#  plot = FALSE,
+#  plot_export = FALSE,
+#  export_raw = FALSE)"
+
+# Quick demo on how to create an SST curve
+# Set parameters
+T_amp <- 20
+T_per <- 365
+T_pha <- 150
+T_av <- 15
+T_par <- c(T_amp, T_per, T_pha, T_av)
+SST <- temperature_curve(T_par, 1, 1) # Run the function
+ + + diff --git a/README.md b/README.md index 0239f77..6d7f063 100644 --- a/README.md +++ b/README.md @@ -20,11 +20,11 @@ in “temperature\_curve()” function) and a skewed growth rate sinusoid model (see details in “d18O\_model()” function). The resulting modeled d18O is then compared with the user-provided d18O data and the parameters of the temperature and growth rate functions are optimized -using the SCEUA algorithm (see [Duan et -al., 1992](https://doi.org/10.1029/91WR02985)) to match the d18O data. -As a result, the timing of each data point with reference to the -seasonal cycle is exported, from which an age model for the entire -record can be constructed. +using the SCEUA algorithm (see [Duan et al., +1992](https://doi.org/10.1029/91WR02985)) to match the d18O data. As a +result, the timing of each data point with reference to the seasonal +cycle is exported, from which an age model for the entire record can be +constructed. ![Figure 1: Temperature sinusoid](man/figures/README-SSTcurve.png) ![Figure 2: Growth rate sinusoid](man/figures/README-GRcurve.png) @@ -35,8 +35,8 @@ this previous model in several key ways: 1. ShellChron allows SCEUA optimization to be carried out in a sliding window through the data and recognizes year transitions (see - “cumulative\_day()” formula) to produce seamless age models - through multiple years. Overlapping windows are used to estimate the + “cumulative\_day()” formula) to produce seamless age models through + multiple years. Overlapping windows are used to estimate the reproducibility of model results. 2. ShellChron provides the option to take uncertainties on the input data (“D\_err” and “d18Oc\_err”) into account in error estimation @@ -79,6 +79,14 @@ transitions. **column 5: d18Oc\_err** stable oxygen isotope value uncertainty, in permille. +When you use ShellChron, please cite [de Winter, +2022](https://gmd.copernicus.org/articles/15/1247/2022/): + +**de Winter, N.J. (2022) “ShellChron 0.4.0: a new tool for constructing +chronologies in accretionary carbonate archives from stable oxygen +isotope profiles” Geoscientific Model Development 15, 1247-1267, DOI: +10.5194/gmd-15-1247-2022** + ## Installation You can install the released version of ShellChron from diff --git a/inst/CITATION b/inst/CITATION new file mode 100644 index 0000000..1dbd02c --- /dev/null +++ b/inst/CITATION @@ -0,0 +1,15 @@ +citHeader("To cite ShellChron in publications use:") + +citEntry( + entry = "Article", + title = "ShellChron 0.4.0: a new tool for constructing chronologies in accretionary carbonate archives from stable oxygen isotope profiles", + author = person("Niels J.", "de Winter"), + journal = "Geoscientific Model Development", + year = "2022", + volume = "15", + pages = "1247-1267", + url = "https://gmd.copernicus.org/articles/15/1247/2022/", + textVersion = paste( + "de Winter, N.J. (2022) ShellChron 0.4.0: a new tool for constructing chronologies in accretionary carbonate archives from stable oxygen isotope profiles. Geoscientific Model Development 15, 1247-1267, DOI: 10.5194/gmd-15-1247-2022" + ) +) diff --git a/man/d18O_model.Rd b/man/d18O_model.Rd index d75195a..d3e7709 100644 --- a/man/d18O_model.Rd +++ b/man/d18O_model.Rd @@ -53,4 +53,8 @@ Brand, W.A., Coplen, T.B., Vogl, J., Rosner, M., Prohaska, T., Assessment of international reference materials for isotope-ratio analysis (IUPAC Technical Report), \emph{Pure and Applied Chemistry} \strong{2014}, \emph{86.3}, 425-467. \doi{10.1515/pac-2013-1023} +Kim, S.-T., Coplen, T. B., and Horita, J.: Normalization of stable +isotope data for carbonate minerals: Implementation of IUPAC +guidelines, Geochim. Cosmochim. Ac. \strong{2015} 158, 276-289. +\doi{10.1016/j.gca.2015.02.011} }