Function to process climate data to calculate delta P and delta T.

calculate_deltas_from_climate(
  climate_dir = NULL,
  write_dir = "step1_calculate_delta_from_climate",
  esm_name = NULL,
  scn_name = NULL,
  crops = c("Corn", "Spring wheat", "Winter wheat", "Rice", "Soy"),
  irrigation_rainfed = c("IRR", "RFD"),
  minlat = -89.75,
  minlon = -179.75,
  monthly_growing_season = NULL,
  rollingAvgYears = 15,
  growing_season_dir = NULL,
  tas_historical = NULL,
  tas_projected = NULL,
  pr_historical = NULL,
  pr_projected = NULL,
  historical_start_year = NULL,
  projection_start_year = NULL
)

Arguments

climate_dir

Default = NULL

write_dir

Default = "step1_calculate_delta_from_climate". Output Folder

esm_name

Default = NULL

scn_name

Default = NULL

crops

Default = c("Corn", "Spring wheat", "Winter wheat", "Rice", "Soy")

irrigation_rainfed

Default = c("IRR", "RFD")

minlat

Default = -89.75

minlon

Default = -179.75

monthly_growing_season

Default = NULL. A csv file with columns latgrid, longrid, crop, irr, pmonth, gslength, areamask

rollingAvgYears

Default = 15

growing_season_dir

Default = NULL

tas_historical

= NULL. Filename of historical temperature ncdf.

tas_projected

= NULL. Filename of projected (hot or cold) temperature ncdf.

pr_historical

= NULL. Filename of historical precipitation flux ncdf.

pr_projected

= NULL. Filename of projected (hot or cold) precipitation flux ncdf.

historical_start_year

= NULL. Start year of historical data.

projection_start_year

= NULL. Start year of projection data.

Value

number

Examples

if (FALSE) {
library(osiris)
osiris::calculate_deltas_from_climate()
}