Skip to content

Commit

Permalink
Merge branch 'fredi_methane_dev' into fredi_methane_reorg
Browse files Browse the repository at this point in the history
  • Loading branch information
knoiva-indecon committed Nov 22, 2024
2 parents c93af21 + d38ff6f commit 4d30193
Show file tree
Hide file tree
Showing 289 changed files with 2,314 additions and 2,113 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/test_fredi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,3 @@ jobs:
path: |
data_tests/*.rd*
data_tests/*.xlsx
7 changes: 6 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: FrEDI
Title: The Framework for Evaluating Damages and Impacts (FrEDI)
Version: 4.1.0
Version: 4.1.1
Authors@R: c(person("Corinne", "Hartin",
email = "[email protected]",
role = c("aut","cre"),
Expand All @@ -11,6 +11,11 @@ Authors@R: c(person("Corinne", "Hartin",
role = c("aut","ctb"),
comment = c(ORCID = "0000-0002-6845-6077",
github = "emcduffie")),
person("Marcus","Sarofim",
email = "[email protected]",
role = c("aut","ctb"),
comment = c(ORCID = "0000-0001-7753-1676",
github = "emcduffie")),
person("Karen","Noiva",
role = c("aut","ctb"),
comment = c(ORCID = "0000-0002-4412-5302",
Expand Down
50 changes: 50 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,53 @@
# FrEDI v4.1.1

_See FrEDI v4.1 for full release notes_

* Bug fixes - n/a
* Updates -
** Major updates: n/a
** Minor updates include: updated the `includeaggregate` flag for the suicide sector in `run_fredi()` and `run_fredi_sv()`, to alert users of an alternative sector aggregation approach to avoid possible double counting with the impacts in the default temperature-related mortality sector; updated R package documentation to reflect updates; updated github page
* Additional sectors added - n/a
* Documentation fixes - n/a
* New features - n/a

# FrEDI v4.1

This release corresponds to FrEDI v4.1, which accompanies the publication of the 2024 FrEDI Technical Documentation.

* Bug fixes - n/a
* Updates -
** Major updates: impacts and damages now calculated at the state-level (previously region-level) for all 25 impact-category sectors; FrEDI default max year was changed from 2090 to 2100
** Minor updates include: updated import_inputs() to accept population datafiles containing U.S. national, contiguous U.S., or U.S. state populations and set temperature values outside the allowed range (<=0C and >= 30C) to zero; updated run_fredi_sv() to accept state-level population inputs; updated R package documentation to reflect new features
* Additional sectors added - n/a
* Documentation fixes - minor updates to account for new default max year and state-level population input formatting features
* New features - FrEDI outputs include damages and impacts at the state-level (48 contiguous states and the District of Columbia) for all 25 impact category sectors; FrEDI default max year was changed from 2090 to 2100

# FrEDI v4.0.2 (peer-review)

Starting in February 2024, the FrEDI Technical Documentation and v4.0 of the FrEDI R package will be subject to a public review comment period and independent, external peer-review.
This release corresponds to FrEDI v4.0.2, the peer-review release version.

* Bug fixes - fixes to GDP input reference in and meta data documentation in run_fredi()
* Updates -
** Major updates include: impacts and damages now calculated at the state-level (previously region-level) for 17 impact-category sectors
** Minor updates include: n/a
* Additional sectors added - n/a
* Documentation fixes - n/a
* New features - FrEDI outputs include damages and impacts at the state-level (48 contiguous states and the District of Columbia) for 17 impact category sectors.

# FrEDI v4.0.1 (public review)

Starting in February 2024, the FrEDI Technical Documentation and v4.0 of the FrEDI R package will be subject to a public review comment period and independent, external peer-review.
This release corresponds to FrEDI v4.0.1, the public comment release version.

* Bug fixes - file paths in function documentation for run_fredi(), import_inputs(), and aggregate_impacts(); income elasticity for SLR sectors post-2090 in run_fredi() (no longer dependent on argument elasticity)
* Updates -
** Major updates include: impacts and damages now calculated at the state-level (previously region-level) for 12 impact-category sectors; population inputs for `run_fredi()` now requires state-level population instead of region-level inputs; damage function extrapolation approach for warmer temperatures for `run_fredi()` and `run_fredi_sv()`; default income elasticity (argument `elasticity` in `run_fredi()`) from 0.4 to 1.0; updated `run_fredi()` user inputs to remove options to calculate present values (arguments `pv`, `rate`, `baseYear`) and add option to output intermediate calculation columns
** Minor updates include: `magrittr` pipe operator `%>%` to the native pipe operator `|>`; Added monitoring of default `run_fredi()` parameter use; output columns from `aggregate_impacts` (added columns `“sectorprimary”` and `“includeaggregate”` for all aggregation levels and added columns `“physical_impacts”`, `“physicalmeasure”` for all aggregation levels except `aggLevels=”impacttype”`); removed option to output `run_fredi_sv()` module results to an Excel template
* Documentation fixes - this version corresponds to the February 2024 version of the FrEDI Technical Documentation (see https://www.epa.gov/cira/about-fredi). Function documentation updated to correspond to updates.
* Additional sectors added - n/a
* New features - FrEDI outputs include damages and impacts at the state-level (48 contiguous states and the District of Columbia) for 12 impact category sectors.

# FrEDI v3.4

* Bug fixes - minor fixes to inputs used in run_fredi() and run_fredi_sv()
Expand Down
10 changes: 7 additions & 3 deletions R/convertTemps.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@ convertTemps <- function(
c0 <- 0 ### Update
c1 <- 1.421 ### Update

toType <- from |> tolower()
if(from == "global"){
## Make "from" argument lowercase
fromType <- from |> tolower()

if(fromType == "global"){
temp_global <- temps
new_temps <- c1*temp_global + c0
} else{
} else if(fromType == "conus"){
temp_conus <- temps
new_temps <- (temp_conus - c0)/c1
} else {
stop("Warning! In convertTemps(): Invalid value provided to from argument. Please enter a valid value. Exiting...")
}

###### Return ######
Expand Down
23 changes: 23 additions & 0 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,26 @@
#' }
#' @source \url{https://epa.gov/cira/FrEDI/}
"gdpDefault"



###### ch4Default ######
#' Scenario with changes in US methane concentrations for the years 2020 through 2100, which can be passed as an input to [FrEDI:run_fredi_methane()].
#'
#' `ch4Default` is a data frame object that contains projections with changes in annual US methane concentrations, at the national level, for the period from 2020 to 2100. Values for changes in annual US methane concentrations are provided in parts per billion by volume (ppbv) relative to a 1995-2006 baseline era. This scenario represents the SSP245 mean emissions pathway from RCMIP5, with methane concentrations produced using the FaIR model. For more information on the SSP245 mean emissions pathway and the FaIR model, see Nichols et al. (2020) and Leach, et al. (2021), respectively.
#'
#' To use `ch4Default` as an input to the FrEDI Methane module, pass the data frame via the named element `ch4` in a list passed to the `inputsList` argument in function calls to [FrEDI:run_fredi_methane()], e.g.: `run_fredi_methane(inputsList=list(ch4=ch4Default))`. `ch4Default` can also be combined with other provided scenarios (`gdpDefault`, `popDefault`) in function calls (e.g., `run_fredi(inputsList=list(gdp=gdpDefault, pop=popDefault))`) or user-provided data frames. For more information, see documentation for [FrEDI:run_fredi_methane()], and [FrEDI::import_inputs()].
#'
#' Leach, N. J., Jenkins, S., Nicholls, Z., Smith, C. J., Lynch, J., Cain, M., Walsh, T., Wu, B., Tsutsui, J., and Allen, M. R. 2021. FaIRv2.0.0: a generalized impulse response model for climate uncertainty and future scenario exploration, Geosci. Model Dev., 14, 3007--3036, https://doi.org/10.5194/gmd-14-3007-2021.
#'
#' Nicholls, Z. R. J., Meinshausen, M., Lewis, J., Gieseke, R., Dommenget, D., Dorheim, K., Fan, C.-S., Fuglestvedt, J. S., Gasser, T., Goluke, U., Goodwin, P., Hartin, C., Hope, A. P., Kriegler, E., Leach, N., Marchegiani, D., McBride, L. A., Quilcaille, Y., Rogelj, J., Xie, Z. (2020). Reduced Complexity Model Intercomparison Project Phase 1: introduction and evaluation of global-mean temperature response. Geoscientific Model Development. 13. 5175-5190. 10.5194/gmd-13-5175-2020.
#'
#' Environmental Protection Agency (EPA). Forthcoming. Technical Documentation on The Framework for Evaluating Damages and Impacts (FrEDI). Technical Report, EPA, Washington, DC. Available at <https://epa.gov/cira/FrEDI/>.
#'
#' @format A data frame with 81 rows and 2 columns:
#' \describe{
#' \item{year }{Year}
#' \item{CH4_ppbv}{Change in U.S. methane concentrations, in parts per billion by volume (ppbv), relative to a 1995-2006 baseline era.}
#' }
#' @source \url{https://epa.gov/cira/FrEDI/}
"gdpDefault"
Loading

0 comments on commit 4d30193

Please sign in to comment.