diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 0af57438..911eef67 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -26,8 +26,8 @@ jobs: id: getmsg run: | # Get your last commit message, not the merge commit. - msg=$(git log -1 --no-merges --pretty=%B) - echo "msg=$(git log -1 --no-merges --pretty=%B)" >> "$GITHUB_OUTPUT" + msg=$(git log -1 --no-merges --pretty=%s) + echo "msg=$(git log -1 --no-merges --pretty=%s)" >> "$GITHUB_OUTPUT" echo "commit message: $msg" R-CMD-check: diff --git a/DESCRIPTION b/DESCRIPTION index b35c488a..ddc57b07 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: climr Title: Downscaling climate data in R -Version: 0.1.0 +Version: 0.1.0.9000 Date: 23-05-2024 Authors@R: c( person("Kiri","Daust", email = "kiri.daust@gov.bc.ca", role = c("aut", "cre")), diff --git a/R/data-lists.R b/R/data-lists.R index 48530467..e0f93046 100644 --- a/R/data-lists.R +++ b/R/data-lists.R @@ -50,10 +50,10 @@ list_run <- function(dbCon, gcms) { } #' @description -#' `list_refmaps` lists available normals. +#' `list_refmaps` lists available reference maps of gridded climate normals #' #' @details -#' Currently available normals (`list_refmaps()`) are: +#' Currently available reference maps of gridded climate normals (`list_refmaps()`) are: #' * "refmap_climatena" for Climate NA derived normals #' * "refmap_prism" for British Columbia PRISM climatologies derived normals #' * "refmap_climr" for a composite of BC PRISM, adjusted US PRISM and @@ -68,7 +68,7 @@ list_refmaps <- function() { #' @description -#' `list_obs_periods` lists available obs periods +#' `list_obs_periods` lists available observational periods #' #' @rdname data-option-lists #' @export @@ -107,7 +107,7 @@ list_vars <- function(set = c("All", "Monthly", "Seasonal", "Annual"), only_extr #' @rdname data-option-lists #' @export list_obs_years <- function() { - 1902:2022 + 1901:2023 } #' @description diff --git a/R/plot_timeSeries_input.R b/R/plot_timeSeries_input.R index 1647de3b..582924e4 100644 --- a/R/plot_timeSeries_input.R +++ b/R/plot_timeSeries_input.R @@ -41,9 +41,9 @@ plot_timeSeries_input <- function( ssps = list_ssps(), max_run = 10, obs_ts_dataset = c("cru.gpcc", "climatena"), - obs_years = 1901:2022, - gcm_hist_years = 1850:2014, - gcm_ssp_years = 2015:2100, + obs_years = list_obs_years(), + gcm_hist_years = list_gcm_hist_years(), + gcm_ssp_years = list_gcm_ssp_years(), vars = list_vars() ) { data <- downscale(xyz = xyz, diff --git a/README.md b/README.md index 307e97bf..910a528b 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ The high resolution reference climate maps for Western Canada and Western US are Reference climatologies for North America are the 4km-resolution ClimateNA (Wang et al. 2016) mosaics of PRISM (BC, US, W. Canada) and WorldClim (rest of North America). The ClimateNA mosaics are accessed from [AdaptWest](https://adaptwest.databasin.org/pages/adaptwest-climatena/). -Historical observational time series are obtained from [ClimateNA](https://climatena.ca/) (Wang et al. 2016). +Historical observational time series are obtained from [ClimateNA](https://climatena.ca/) (Wang et al. 2016), [Climatic Research Unit](https://crudata.uea.ac.uk/cru/data/hrg/), and [Global Precipitation Climatology Centre](https://psl.noaa.gov/data/gridded/data.gpcc.html). CMIP6 global climate model simulations were downloaded from the [Earth System Grid Federation](https://aims2.llnl.gov/search/cmip6). The majority of these downloads were conducted by Tongli Wang, Associate Professor at the UBC Department of Forest and Conservation Sciences. The 13 global climate models selected for `climr`, and best practices for ensemble analysis, are described in Mahony et al. (2022) and summarized in `vignette("climr_methods_ensembleSelection")`. diff --git a/data-raw/namingChanges.csv b/data-raw/namingChanges.csv index e24e4a69..c0223a8d 100644 --- a/data-raw/namingChanges.csv +++ b/data-raw/namingChanges.csv @@ -30,7 +30,7 @@ parameter,normal_input(),normal,reference options,list_normal(),normal_na,refmap_climatena options,list_normal(),normal_bc,refmap_prism options,list_normal(),normal_composite,refmap_climr -function name,,gcm_input(),input_gcm() +function name,,gcm_input(),input_gcms() parameter,gcm_ts_input(),gcm,gcms parameter,gcm_hist_input(),gcm,gcms parameter,gcm_input(),gcm,gcms diff --git a/data/name_changes.rda b/data/name_changes.rda index b81f4ed0..fa509841 100644 Binary files a/data/name_changes.rda and b/data/name_changes.rda differ diff --git a/inst/CITATION b/inst/CITATION new file mode 100644 index 00000000..5b9fe1b1 --- /dev/null +++ b/inst/CITATION @@ -0,0 +1,8 @@ +bibentry( + bibtype = "Manual", + title = "climr: Downscaling climate data in R", + author = "Kiri Daust, Colin Mahony, Bruno Tremblay, Ceres Barros", + year = "2024", + version = "0.1.0", + url = "https://bcgov.github.io/climr/" +) diff --git a/man/climr-package.Rd b/man/climr-package.Rd index 18d89d3b..17668bdb 100644 --- a/man/climr-package.Rd +++ b/man/climr-package.Rd @@ -15,7 +15,7 @@ Authors: \itemize{ \item Colin Mahony \email{Colin.Mahony@gov.bc.ca} (\href{https://orcid.org/0000-0002-6111-5675}{ORCID}) \item Bruno Tremblay \email{bruno@boostao.ca} (\href{https://orcid.org/0000-0002-2945-356X}{ORCID}) - \item Ceres Barros \email{ceres.barros@gov.bc.ca} (\href{https://orcid.org/0000-0003-4036-977X}{ORCID}) + \item Ceres Barros \email{ceres.barros@nrcan-rncan.gc.ca} (\href{https://orcid.org/0000-0003-4036-977X}{ORCID}) } Other contributors: diff --git a/man/data-option-lists.Rd b/man/data-option-lists.Rd index 59eb8914..a4d81697 100644 --- a/man/data-option-lists.Rd +++ b/man/data-option-lists.Rd @@ -54,9 +54,9 @@ a character vector. \code{list_run} lists available runs for a given GCM. -\code{list_refmaps} lists available normals. +\code{list_refmaps} lists available reference maps of gridded climate normals -\code{list_obs_periods} lists available obs periods +\code{list_obs_periods} lists available observational periods \code{list_vars} lists climate variables @@ -67,7 +67,7 @@ a character vector. \code{list_gcm_hist_years} lists available years for obs projections' time series } \details{ -Currently available normals (\code{list_refmaps()}) are: +Currently available reference maps of gridded climate normals (\code{list_refmaps()}) are: \itemize{ \item "refmap_climatena" for Climate NA derived normals \item "refmap_prism" for British Columbia PRISM climatologies derived normals diff --git a/man/plot_timeSeries_input.Rd b/man/plot_timeSeries_input.Rd index 4a447639..5af98aae 100644 --- a/man/plot_timeSeries_input.Rd +++ b/man/plot_timeSeries_input.Rd @@ -10,9 +10,9 @@ plot_timeSeries_input( ssps = list_ssps(), max_run = 10, obs_ts_dataset = c("cru.gpcc", "climatena"), - obs_years = 1901:2022, - gcm_hist_years = 1850:2014, - gcm_ssp_years = 2015:2100, + obs_years = list_obs_years(), + gcm_hist_years = list_gcm_hist_years(), + gcm_ssp_years = list_gcm_ssp_years(), vars = list_vars() ) } diff --git a/vignettes/methods_ensembleSelection.Rmd b/vignettes/methods_ensembleSelection.Rmd index cc8585b2..52b0e714 100644 --- a/vignettes/methods_ensembleSelection.Rmd +++ b/vignettes/methods_ensembleSelection.Rmd @@ -6,7 +6,7 @@ output: toc: true toc_depth: 2 description: > - Recommended practices for selection of global climate model ensembles and use of emissions scenarios. + Criteria for climate model inclusion in climr, and rationale for the recommended 8-GCM general-purpose ensemble. vignette: > %\VignetteIndexEntry{Climate model and scenario selection} %\VignetteEngine{knitr::rmarkdown}