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

calculate_deltas_from_climate(
  climate_dir = NULL,
  write_dir = "outputs_calculate_delta_from_climate",
  esm_name = "CanESM5",
  crops = c("Corn", "Wheat", "Rice", "Soy"),
  irrigation_rainfed = c("IRR", "RFD"),
  minlat = -87.8638,
  minlon = -179.75,
  monthly_growing_season = NULL,
  monthly_harvest_season = NULL,
  rollingAvgYears = 15,
  growing_season_dir = NULL
)

Arguments

climate_dir

Default = NULL

write_dir

Default = "outputs_calculate_delta_from_climate". Output Folder

esm_name

Default = 'CanESM5'

crops

Default = c("Corn", "Wheat", "Rice", "Soy")

irrigation_rainfed

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

minlat

Default = -87.8638

minlon

Default = -179.75

monthly_growing_season

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

monthly_harvest_season

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

rollingAvgYears

Default = 15

growing_season_dir

Default = NULL

Value

number

Examples

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