From af4be5e4704783def58234a1d362341504a8d301 Mon Sep 17 00:00:00 2001 From: Zarrar Khan Date: Fri, 22 Jul 2022 14:42:50 -0400 Subject: [PATCH] Updating package to work with gcam6p0. Working for Thailand, Malaysia and Chile. Errors with Nigeria, Australia. --- R/data.R | 151 ++-- R/restore.R | 6 +- data/mapping_modules.rda | Bin 1099 -> 1331 bytes ...esbio_input_irr_mgmt_breakout_gcamv6p0.rda | Bin 0 -> 5006 bytes ...change_cost_irr_mgmt_breakout_gcamv6p0.rda | Bin 0 -> 5562 bytes ...062.ag_Fert_irr_mgmt_breakout_gcamv6p0.rda | Bin 0 -> 3822 bytes ...72.ag_water_irr_mgmt_breakout_gcamv6p0.rda | Bin 0 -> 5595 bytes ...2.ag_nonco2_IRR_MGMT_breakout_gcamv6p0.rda | Bin 0 -> 3601 bytes ...unk_L2231.wind_update_breakout_gcamv60.rda | Bin 5894 -> 5652 bytes ...nk_L2231.wind_update_breakout_gcamv6p0.rda | Bin 0 -> 5670 bytes ...k_L242.ssp34_pasture_breakout_gcamv6p0.rda | Bin 0 -> 2646 bytes ...ate_zchunk_L252.MACC_breakout_gcamv6p0.rda | Bin 0 -> 7826 bytes ...k_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0.rda | Bin 0 -> 5921 bytes ...LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv60.rda | Bin 6033 -> 6147 bytes ...C_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0.rda | Bin 0 -> 6486 bytes ...LC_R_Cropland_Yh_GLU_breakout_gcamv6p0.rda | Bin 0 -> 8558 bytes ...e_zchunk_LB125.LC_tot_breakout_gcamv60.rda | Bin 0 -> 2722 bytes ..._Cropland_Yh_GLU_irr_breakout_gcamv6p0.rda | Bin 0 -> 3114 bytes ...io_base_IRR_MGMT_xml_breakout_gcamv6p0.rda | Bin 0 -> 1837 bytes ...externality_cost_xml_breakout_gcamv6p0.rda | Bin 0 -> 1655 bytes ...input_4_IRR_MGMT_xml_breakout_gcamv6p0.rda | Bin 0 -> 1633 bytes ...input_5_IRR_MGMT_xml_breakout_gcamv6p0.rda | Bin 0 -> 1916 bytes inst/extras/devTests.R | 78 +- inst/extras/saveDataFiles.R | 86 +- ....resbio_input_irr_mgmt_breakout_gcamv6p0.R | 349 ++++++++ ...odchange_cost_irr_mgmt_breakout_gcamv6p0.R | 422 +++++++++ ...L2062.ag_Fert_irr_mgmt_breakout_gcamv6p0.R | 228 +++++ ...2072.ag_water_irr_mgmt_breakout_gcamv6p0.R | 428 ++++++++++ ...112.ag_nonco2_IRR_MGMT_breakout_gcamv6p0.R | 272 ++++++ ...hunk_L2231.wind_update_breakout_gcamv6p0.R | 386 +++++++++ ...unk_L242.ssp34_pasture_breakout_gcamv6p0.R | 161 ++++ .../zchunk_L252.MACC_breakout_gcamv6p0.R | 803 ++++++++++++++++++ ...unk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0.R | 390 +++++++++ ...LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0.R} | 100 ++- ...2.LC_R_Cropland_Yh_GLU_breakout_gcamv6p0.R | 652 ++++++++++++++ ..._R_Cropland_Yh_GLU_irr_breakout_gcamv6p0.R | 204 +++++ ..._bio_base_IRR_MGMT_xml_breakout_gcamv6p0.R | 133 +++ ...o_externality_cost_xml_breakout_gcamv6p0.R | 96 +++ ...d_input_4_IRR_MGMT_xml_breakout_gcamv6p0.R | 98 +++ ...d_input_5_IRR_MGMT_xml_breakout_gcamv6p0.R | 155 ++++ ...water_demand_livestock_breakout_gcamv60.Rd | 25 - ...hunk_L171.desalination_breakout_gcamv60.Rd | 25 - ...e_zchunk_L203.water_td_breakout_gcamv60.Rd | 25 - ...resbio_input_irr_mgmt_breakout_gcamv6p0.Rd | 25 + ...dchange_cost_irr_mgmt_breakout_gcamv6p0.Rd | 25 + ...2062.ag_Fert_irr_mgmt_breakout_gcamv6p0.Rd | 25 + ...072.ag_water_irr_mgmt_breakout_gcamv6p0.Rd | 25 + ...12.ag_nonco2_IRR_MGMT_breakout_gcamv6p0.Rd | 25 + ...chunk_L223.electricity_breakout_gcamv60.Rd | 25 - ...hunk_L2231.wind_update_breakout_gcamv60.Rd | 25 - ...unk_L2231.wind_update_breakout_gcamv6p0.Rd | 37 + ...nk_L242.ssp34_pasture_breakout_gcamv6p0.Rd | 25 + ...late_zchunk_L252.MACC_breakout_gcamv6p0.Rd | 25 + ...00.0_LDS_preprocessing_breakout_gcamv60.Rd | 25 - ...100.IEA_downscale_ctry_breakout_gcamv60.Rd | 25 - ...nk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0.Rd | 25 + ...hunk_LA1012.en_bal_EFW_breakout_gcamv60.Rd | 25 - ...nk_LA111.rsrc_fos_Prod_breakout_gcamv60.Rd | 25 - ...nk_LA120.offshore_wind_breakout_gcamv60.Rd | 25 - ...e_zchunk_LA1321.cement_breakout_gcamv60.Rd | 25 - ...C_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0.Rd} | 26 +- ....LC_R_Cropland_Yh_GLU_breakout_gcamv6p0.Rd | 25 + ...LC_R_MgdPastFor_Yh_GLU_breakout_gcamv60.Rd | 25 - ...321.regional_ag_prices_breakout_gcamv60.Rd | 25 - ...2.ag_Fert_IO_R_C_Y_GLU_breakout_gcamv60.Rd | 25 - ...R_Cropland_Yh_GLU_irr_breakout_gcamv6p0.Rd | 25 + ...bio_base_IRR_MGMT_xml_breakout_gcamv6p0.Rd | 25 + ..._externality_cost_xml_breakout_gcamv6p0.Rd | 25 + ..._input_4_IRR_MGMT_xml_breakout_gcamv6p0.Rd | 25 + ..._input_5_IRR_MGMT_xml_breakout_gcamv6p0.Rd | 25 + 70 files changed, 5486 insertions(+), 475 deletions(-) create mode 100644 data/template_zchunk_L2042.resbio_input_irr_mgmt_breakout_gcamv6p0.rda create mode 100644 data/template_zchunk_L2052.ag_prodchange_cost_irr_mgmt_breakout_gcamv6p0.rda create mode 100644 data/template_zchunk_L2062.ag_Fert_irr_mgmt_breakout_gcamv6p0.rda create mode 100644 data/template_zchunk_L2072.ag_water_irr_mgmt_breakout_gcamv6p0.rda create mode 100644 data/template_zchunk_L2112.ag_nonco2_IRR_MGMT_breakout_gcamv6p0.rda create mode 100644 data/template_zchunk_L2231.wind_update_breakout_gcamv6p0.rda create mode 100644 data/template_zchunk_L242.ssp34_pasture_breakout_gcamv6p0.rda create mode 100644 data/template_zchunk_L252.MACC_breakout_gcamv6p0.rda create mode 100644 data/template_zchunk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0.rda create mode 100644 data/template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0.rda create mode 100644 data/template_zchunk_LB122.LC_R_Cropland_Yh_GLU_breakout_gcamv6p0.rda create mode 100644 data/template_zchunk_LB125.LC_tot_breakout_gcamv60.rda create mode 100644 data/template_zchunk_LB171.LC_R_Cropland_Yh_GLU_irr_breakout_gcamv6p0.rda create mode 100644 data/template_zchunk_batch_ag_For_Past_bio_base_IRR_MGMT_xml_breakout_gcamv6p0.rda create mode 100644 data/template_zchunk_batch_bio_externality_cost_xml_breakout_gcamv6p0.rda create mode 100644 data/template_zchunk_batch_land_input_4_IRR_MGMT_xml_breakout_gcamv6p0.rda create mode 100644 data/template_zchunk_batch_land_input_5_IRR_MGMT_xml_breakout_gcamv6p0.rda create mode 100644 inst/extras/zchunk_L2042.resbio_input_irr_mgmt_breakout_gcamv6p0.R create mode 100644 inst/extras/zchunk_L2052.ag_prodchange_cost_irr_mgmt_breakout_gcamv6p0.R create mode 100644 inst/extras/zchunk_L2062.ag_Fert_irr_mgmt_breakout_gcamv6p0.R create mode 100644 inst/extras/zchunk_L2072.ag_water_irr_mgmt_breakout_gcamv6p0.R create mode 100644 inst/extras/zchunk_L2112.ag_nonco2_IRR_MGMT_breakout_gcamv6p0.R create mode 100644 inst/extras/zchunk_L2231.wind_update_breakout_gcamv6p0.R create mode 100644 inst/extras/zchunk_L242.ssp34_pasture_breakout_gcamv6p0.R create mode 100644 inst/extras/zchunk_L252.MACC_breakout_gcamv6p0.R create mode 100644 inst/extras/zchunk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0.R rename inst/extras/{zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv60.R => zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0.R} (85%) create mode 100644 inst/extras/zchunk_LB122.LC_R_Cropland_Yh_GLU_breakout_gcamv6p0.R create mode 100644 inst/extras/zchunk_LB171.LC_R_Cropland_Yh_GLU_irr_breakout_gcamv6p0.R create mode 100644 inst/extras/zchunk_batch_ag_For_Past_bio_base_IRR_MGMT_xml_breakout_gcamv6p0.R create mode 100644 inst/extras/zchunk_batch_bio_externality_cost_xml_breakout_gcamv6p0.R create mode 100644 inst/extras/zchunk_batch_land_input_4_IRR_MGMT_xml_breakout_gcamv6p0.R create mode 100644 inst/extras/zchunk_batch_land_input_5_IRR_MGMT_xml_breakout_gcamv6p0.R delete mode 100644 man/template_zchunk_L133.water_demand_livestock_breakout_gcamv60.Rd delete mode 100644 man/template_zchunk_L171.desalination_breakout_gcamv60.Rd delete mode 100644 man/template_zchunk_L203.water_td_breakout_gcamv60.Rd create mode 100644 man/template_zchunk_L2042.resbio_input_irr_mgmt_breakout_gcamv6p0.Rd create mode 100644 man/template_zchunk_L2052.ag_prodchange_cost_irr_mgmt_breakout_gcamv6p0.Rd create mode 100644 man/template_zchunk_L2062.ag_Fert_irr_mgmt_breakout_gcamv6p0.Rd create mode 100644 man/template_zchunk_L2072.ag_water_irr_mgmt_breakout_gcamv6p0.Rd create mode 100644 man/template_zchunk_L2112.ag_nonco2_IRR_MGMT_breakout_gcamv6p0.Rd delete mode 100644 man/template_zchunk_L223.electricity_breakout_gcamv60.Rd delete mode 100644 man/template_zchunk_L2231.wind_update_breakout_gcamv60.Rd create mode 100644 man/template_zchunk_L2231.wind_update_breakout_gcamv6p0.Rd create mode 100644 man/template_zchunk_L242.ssp34_pasture_breakout_gcamv6p0.Rd create mode 100644 man/template_zchunk_L252.MACC_breakout_gcamv6p0.Rd delete mode 100644 man/template_zchunk_LA100.0_LDS_preprocessing_breakout_gcamv60.Rd delete mode 100644 man/template_zchunk_LA100.IEA_downscale_ctry_breakout_gcamv60.Rd create mode 100644 man/template_zchunk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0.Rd delete mode 100644 man/template_zchunk_LA1012.en_bal_EFW_breakout_gcamv60.Rd delete mode 100644 man/template_zchunk_LA111.rsrc_fos_Prod_breakout_gcamv60.Rd delete mode 100644 man/template_zchunk_LA120.offshore_wind_breakout_gcamv60.Rd delete mode 100644 man/template_zchunk_LA1321.cement_breakout_gcamv60.Rd rename man/{template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv60.Rd => template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0.Rd} (57%) create mode 100644 man/template_zchunk_LB122.LC_R_Cropland_Yh_GLU_breakout_gcamv6p0.Rd delete mode 100644 man/template_zchunk_LB123.LC_R_MgdPastFor_Yh_GLU_breakout_gcamv60.Rd delete mode 100644 man/template_zchunk_LB1321.regional_ag_prices_breakout_gcamv60.Rd delete mode 100644 man/template_zchunk_LB142.ag_Fert_IO_R_C_Y_GLU_breakout_gcamv60.Rd create mode 100644 man/template_zchunk_LB171.LC_R_Cropland_Yh_GLU_irr_breakout_gcamv6p0.Rd create mode 100644 man/template_zchunk_batch_ag_For_Past_bio_base_IRR_MGMT_xml_breakout_gcamv6p0.Rd create mode 100644 man/template_zchunk_batch_bio_externality_cost_xml_breakout_gcamv6p0.Rd create mode 100644 man/template_zchunk_batch_land_input_4_IRR_MGMT_xml_breakout_gcamv6p0.Rd create mode 100644 man/template_zchunk_batch_land_input_5_IRR_MGMT_xml_breakout_gcamv6p0.Rd diff --git a/R/data.R b/R/data.R index 51b6ece..3eb4ef0 100644 --- a/R/data.R +++ b/R/data.R @@ -185,172 +185,203 @@ # GCAM 6.0 #----------------- -#' Template for template_zchunk_LB142.ag_Fert_IO_R_C_Y_GLU_breakout_gcamv60 +#' Template for template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0 #' -#' @source created by BY +#' @source created by ZK #' @format R script #' @examples #' \dontrun{ #' library(gcambreakout); -#' gcambreakout::template_zchunk_LB142.ag_Fert_IO_R_C_Y_GLU_breakout_gcamv60 +#' gcambreakout::template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0 #' } -"template_zchunk_LB142.ag_Fert_IO_R_C_Y_GLU_breakout_gcamv60" +"template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0" -#' Template for template_zchunk_LA1012.en_bal_EFW_breakout_gcamv60 +#' Template for template_zchunk_L2231.wind_update_breakout_gcamv6p0 #' -#' @source created by BY +#' @source created by ZK #' @format R script #' @examples #' \dontrun{ #' library(gcambreakout); -#' gcambreakout::template_zchunk_LA1012.en_bal_EFW_breakout_gcamv60 +#' gcambreakout::template_zchunk_L2231.wind_update_breakout_gcamv6p0 #' } -"template_zchunk_LA1012.en_bal_EFW_breakout_gcamv60" +"template_zchunk_L2231.wind_update_breakout_gcamv6p0" -#' Template for template_zchunk_LB1321.regional_ag_prices_breakout_gcamv60 +#' Template for template_zchunk_batch_ag_For_Past_bio_base_IRR_MGMT_xml_breakout_gcamv6p0 #' -#' @source created by BY +#' @source created by ZK #' @format R script #' @examples #' \dontrun{ #' library(gcambreakout); -#' gcambreakout::template_zchunk_LB1321.regional_ag_prices_breakout_gcamv60 +#' gcambreakout::template_zchunk_batch_ag_For_Past_bio_base_IRR_MGMT_xml_breakout_gcamv6p0 #' } -"template_zchunk_LB1321.regional_ag_prices_breakout_gcamv60" +"template_zchunk_batch_ag_For_Past_bio_base_IRR_MGMT_xml_breakout_gcamv6p0" -#' Template for template_zchunk_LA1321.cement_breakout_gcamv60 +#' Template for template_zchunk_batch_bio_externality_cost_xml_breakout_gcamv6p0 #' -#' @source created by BY +#' @source created by ZK #' @format R script #' @examples #' \dontrun{ #' library(gcambreakout); -#' gcambreakout::template_zchunk_LA1321.cement_breakout_gcamv60 +#' gcambreakout::template_zchunk_batch_bio_externality_cost_xml_breakout_gcamv6p0 #' } -"template_zchunk_LA1321.cement_breakout_gcamv60" +"template_zchunk_batch_bio_externality_cost_xml_breakout_gcamv6p0" -#' Template for template_zchunk_LA100.0_LDS_preprocessing_breakout_gcamv60 +#' Template for template_zchunk_batch_land_input_4_IRR_MGMT_xml_breakout_gcamv6p0 #' -#' @source created by BY +#' @source created by ZK #' @format R script #' @examples #' \dontrun{ #' library(gcambreakout); -#' gcambreakout::template_zchunk_LA100.0_LDS_preprocessing_breakout_gcamv60 +#' gcambreakout::template_zchunk_batch_land_input_4_IRR_MGMT_xml_breakout_gcamv6p0 #' } -"template_zchunk_LA100.0_LDS_preprocessing_breakout_gcamv60" +"template_zchunk_batch_land_input_4_IRR_MGMT_xml_breakout_gcamv6p0" -#' Template for template_zchunk_L223.electricity_breakout_gcamv60 +#' Template for template_zchunk_batch_land_input_5_IRR_MGMT_xml_breakout_gcamv6p0 #' -#' @source created by BY +#' @source created by ZK #' @format R script #' @examples #' \dontrun{ #' library(gcambreakout); -#' gcambreakout::template_zchunk_L223.electricity_breakout_gcamv60 +#' gcambreakout::template_zchunk_batch_land_input_5_IRR_MGMT_xml_breakout_gcamv6p0 #' } -"template_zchunk_L223.electricity_breakout_gcamv60" +"template_zchunk_batch_land_input_5_IRR_MGMT_xml_breakout_gcamv6p0" -#' Template for template_zchunk_LA120.offshore_wind_breakout_gcamv60 +#' Template for template_zchunk_L2042.resbio_input_irr_mgmt_breakout_gcamv6p0 #' -#' @source created by BY +#' @source created by ZK #' @format R script #' @examples #' \dontrun{ #' library(gcambreakout); -#' gcambreakout::template_zchunk_LA120.offshore_wind_breakout_gcamv60 +#' gcambreakout::template_zchunk_L2042.resbio_input_irr_mgmt_breakout_gcamv6p0 #' } -"template_zchunk_LA120.offshore_wind_breakout_gcamv60" +"template_zchunk_L2042.resbio_input_irr_mgmt_breakout_gcamv6p0" -#' Template for template_zchunk_L203.water_td_breakout_gcamv60 +#' Template for template_zchunk_L2052.ag_prodchange_cost_irr_mgmt_breakout_gcamv6p0 #' -#' @source created by BY +#' @source created by ZK #' @format R script #' @examples #' \dontrun{ #' library(gcambreakout); -#' gcambreakout::template_zchunk_L203.water_td_breakout_gcamv60 +#' gcambreakout::template_zchunk_L2052.ag_prodchange_cost_irr_mgmt_breakout_gcamv6p0 #' } -"template_zchunk_L203.water_td_breakout_gcamv60" +"template_zchunk_L2052.ag_prodchange_cost_irr_mgmt_breakout_gcamv6p0" +#' Template for template_zchunk_L2062.ag_Fert_irr_mgmt_breakout_gcamv6p0 +#' +#' @source created by ZK +#' @format R script +#' @examples +#' \dontrun{ +#' library(gcambreakout); +#' gcambreakout::template_zchunk_L2062.ag_Fert_irr_mgmt_breakout_gcamv6p0 +#' } +"template_zchunk_L2062.ag_Fert_irr_mgmt_breakout_gcamv6p0" -#' Template for template_zchunk_L133.water_demand_livestock_breakout_gcamv60 +#' Template for template_zchunk_L2072.ag_water_irr_mgmt_breakout_gcamv6p0 #' -#' @source created by BY +#' @source created by ZK #' @format R script #' @examples #' \dontrun{ #' library(gcambreakout); -#' gcambreakout::template_zchunk_L133.water_demand_livestock_breakout_gcamv60 +#' gcambreakout::template_zchunk_L2072.ag_water_irr_mgmt_breakout_gcamv6p0 #' } -"template_zchunk_L133.water_demand_livestock_breakout_gcamv60" +"template_zchunk_L2072.ag_water_irr_mgmt_breakout_gcamv6p0" -#' Template for template_zchunk_LB123.LC_R_MgdPastFor_Yh_GLU_breakout_gcamv60 +#' Template for template_zchunk_L2112.ag_nonco2_IRR_MGMT_breakout_gcamv6p0 #' -#' @source created by BY +#' @source created by ZK #' @format R script #' @examples #' \dontrun{ #' library(gcambreakout); -#' gcambreakout::template_zchunk_LB123.LC_R_MgdPastFor_Yh_GLU_breakout_gcamv60 +#' gcambreakout::template_zchunk_L2112.ag_nonco2_IRR_MGMT_breakout_gcamv6p0 #' } -"template_zchunk_LB123.LC_R_MgdPastFor_Yh_GLU_breakout_gcamv60" +"template_zchunk_L2112.ag_nonco2_IRR_MGMT_breakout_gcamv6p0" -#' Template for template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv60 +#' Template for template_zchunk_L2231.wind_update_breakout_gcamv6p0 #' -#' @source created by BY +#' @source created by ZK #' @format R script #' @examples #' \dontrun{ #' library(gcambreakout); -#' gcambreakout::template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv60 +#' gcambreakout::template_zchunk_L2231.wind_update_breakout_gcamv6p0 #' } -"template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv60" +"template_zchunk_L2231.wind_update_breakout_gcamv6p0" +#' Template for template_zchunk_L242.ssp34_pasture_breakout_gcamv6p0 +#' +#' @source created by ZK +#' @format R script +#' @examples +#' \dontrun{ +#' library(gcambreakout); +#' gcambreakout::template_zchunk_L242.ssp34_pasture_breakout_gcamv6p0 +#' } +"template_zchunk_L242.ssp34_pasture_breakout_gcamv6p0" + +#' Template for template_zchunk_L252.MACC_breakout_gcamv6p0 +#' +#' @source created by ZK +#' @format R script +#' @examples +#' \dontrun{ +#' library(gcambreakout); +#' gcambreakout::template_zchunk_L252.MACC_breakout_gcamv6p0 +#' } +"template_zchunk_L252.MACC_breakout_gcamv6p0" -#' Template for template_zchunk_LA100.IEA_downscale_ctry_breakout_gcamv60 +#' Template for template_zchunk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0 #' -#' @source created by BY +#' @source created by ZK #' @format R script #' @examples #' \dontrun{ #' library(gcambreakout); -#' gcambreakout::template_zchunk_LA100.IEA_downscale_ctry_breakout_gcamv60 +#' gcambreakout::template_zchunk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0 #' } -"template_zchunk_LA100.IEA_downscale_ctry_breakout_gcamv60" +"template_zchunk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0" -#' Template for template_zchunk_L2231.wind_update_breakout_gcamv60 +#' Template for template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0 #' -#' @source created by BY +#' @source created by ZK #' @format R script #' @examples #' \dontrun{ #' library(gcambreakout); -#' gcambreakout::template_zchunk_L2231.wind_update_breakout_gcamv60 +#' gcambreakout::template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0 #' } -"template_zchunk_L2231.wind_update_breakout_gcamv60" +"template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0" -#' Template for template_zchunk_L171.desalination_breakout_gcamv60 +#' Template for template_zchunk_LB122.LC_R_Cropland_Yh_GLU_breakout_gcamv6p0 #' -#' @source created by BY +#' @source created by ZK #' @format R script #' @examples #' \dontrun{ #' library(gcambreakout); -#' gcambreakout::template_zchunk_L171.desalination_breakout_gcamv60 +#' gcambreakout::template_zchunk_LB122.LC_R_Cropland_Yh_GLU_breakout_gcamv6p0 #' } -"template_zchunk_L171.desalination_breakout_gcamv60" +"template_zchunk_LB122.LC_R_Cropland_Yh_GLU_breakout_gcamv6p0" -#' Template for template_zchunk_LA111.rsrc_fos_Prod_breakout_gcamv60 +#' Template for template_zchunk_LB171.LC_R_Cropland_Yh_GLU_irr_breakout_gcamv6p0 #' -#' @source created by BY +#' @source created by ZK #' @format R script #' @examples #' \dontrun{ #' library(gcambreakout); -#' gcambreakout::template_zchunk_LA111.rsrc_fos_Prod_breakout_gcamv60 +#' gcambreakout::template_zchunk_LB171.LC_R_Cropland_Yh_GLU_irr_breakout_gcamv6p0 #' } -"template_zchunk_LA111.rsrc_fos_Prod_breakout_gcamv60" +"template_zchunk_LB171.LC_R_Cropland_Yh_GLU_irr_breakout_gcamv6p0" #----------------- diff --git a/R/restore.R b/R/restore.R index 4bfe63d..22c2655 100644 --- a/R/restore.R +++ b/R/restore.R @@ -31,6 +31,9 @@ restore <- function(gcamdataFolder = NULL) { file_energy_A_regions = paste(gcamdataFolder,"/inst/extdata/energy/A_regions.csv",sep = "") file_offshore_wind_potential_scaler = paste(gcamdataFolder,"/inst/extdata/energy/offshore_wind_potential_scaler.csv",sep = "") file_EPA_country_map = paste(gcamdataFolder,"/inst/extdata/emissions/EPA_country_map.csv",sep = "") + file_A323.inc_elas_parameter = paste(gcamdataFolder,"/inst/extdata/socioeconomics/A323.inc_elas_parameter.csv",sep = "") + file_A326.inc_elas_parameter = paste(gcamdataFolder,"/inst/extdata/socioeconomics/A326.inc_elas_parameter.csv",sep = "") + file_list <- list(file_iso_GCAM_regID, file_GCAM_region_names, file_A_bio_frac_prod_R, file_A_soil_time_scale_R, file_A_soil_time_scale_R, file_emissions_A_regions, @@ -46,7 +49,8 @@ restore <- function(gcamdataFolder = NULL) { file_energy_A_regions_orig = paste(gcamdataFolder,"/inst/extdata/energy/A_regions_Original.csv",sep = "") file_offshore_wind_potential_scaler_orig = paste(gcamdataFolder,"/inst/extdata/energy/offshore_wind_potential_scaler_Original.csv",sep = "") file_EPA_country_map_orig = paste(gcamdataFolder,"/inst/extdata/emissions/EPA_country_map_Original.csv",sep = "") - + file_A323.inc_elas_parameter_orig = paste(gcamdataFolder,"/inst/extdata/socioeconomics/A323.inc_elas_parameter_Original.csv",sep = "") + file_A326.inc_elas_parameter_orig = paste(gcamdataFolder,"/inst/extdata/socioeconomics/A326.inc_elas_parameter_Original.csv",sep = "") file_list_orig <- list(file_iso_GCAM_regID_orig, file_GCAM_region_names_orig, file_A_bio_frac_prod_R_orig, file_A_soil_time_scale_R_orig, file_A_soil_time_scale_R_orig, file_emissions_A_regions_orig, diff --git a/data/mapping_modules.rda b/data/mapping_modules.rda index 09abaefbfcda320fe05ec688069f8b9fa878f351..cfc2436676f61e3a2369176dd9458ee07c7f17be 100644 GIT binary patch literal 1331 zcmV-31$YqfCGpfuIA1fB4Uz>DKnAmNNhn!@KA#9H+nG8BY+Sl z2?Jokq>vEO5WD`|2$MoP3ffv-ksHmnPOcJOMYbqg23??3IY8QzUx1V^wKNm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9dF^rp7%bgZ1MoVXrcGp9vP5?O~_%deT?93Ykg`J;|TglyDF>gF#*fq53aV!b$2=;17O zt)*vz!6qzd@QF9XS#5*el9PGWRY~C9)G=0CU~07Jej(3oSF&r>OaRG`xR#O@F+5r=aV3v5%3*`t zhTL(tMrx&t_2GejB_s#AN7^<x zPq(JuUB%_y^nmWH2BfE@Ox%do5fLVVvE>O#WUk@EDfF(Fq~cVGQI{?v z!QiUMJL1Bynzg@%WVm{i=1ldl7|e;Spsgs}UN^9n#q9}zG?WbgoT)9S#RmBNN^z`- zE}FpE$DWW3m903)TM-h&Q9f5XoM_Lm8TT zl5`z%XEclvw5p3LD4lY_5E4WYRhXP)d4>)pD@G9{mEkFf^zk4{YzzeB8&X!6ov>bR z`MaE8RRIY`(n|bZF#u>uUjmt!(xzFJF%o2r0?m<_BUYWmKAQBmkAb*f1MLs3%`+wb RV8Ng9cO+AV2?y2)pFnO!|Iq*d diff --git a/data/template_zchunk_L2042.resbio_input_irr_mgmt_breakout_gcamv6p0.rda b/data/template_zchunk_L2042.resbio_input_irr_mgmt_breakout_gcamv6p0.rda new file mode 100644 index 0000000000000000000000000000000000000000..109ea52e43210e8fa3d64c7492addb49e7333b5e GIT binary patch literal 5006 zcmV;96LIW9T4*^jL0KkKS^8bSk^m9d|M35Qe*gdf|NsC0-~PY<|NndOa0&nc00Cea zUt7mPa5uaUKmZ(jyyM4EHA0r_ffpix0!^|)f=y{dMyMzvP^toeC^Sk>O%(B!Jx?j8 zq{Q}$evy>g2A))Unq>5usp@(o)OrMZAlVudFf|19C#cZVGJz-{nGFPJi9bRU(s~n9 zN2tgirjJpe000000000014PPbk)Qwo00000000000000000f#+BS8&R{3Oj&(^JJ8 z)jcCXXgy5IG#;P^fuII}0009(03g5tFaSdn1i%0hfD};SfEqFeKmY?k0BNQff)#iOQfVp=wGl)=y43*=5Obd4kRS+! zefj5D%_{hzw=JK7VBE5GY%G;0b`nkdl0t#!B-S`T0}lILtO)(aVjE|RVIp&jj1i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r8YRL;ik(srIx`#xs0yiTH7-vUL zi}NDn<&98b4461Uj5B~@2^}<9HfNr84xubOaW7CYD5#iocB4RI^J8vzRxW{pw6d2Wc%_FQtwRDl9WCXz+Q7{o3R z9rt5`%26Hj4S!Z%b3vUY+jyJJ^ zt~i;6z^DyiLRqT~CT9|Z-Un63F*Q$E4DdzX1BAg#B#E36g3G?}HyXN>sFnOT-;1VkK^psPR<#lgUKdB|txY*|?Vk?S=y6Q(C;ixJa$6XUfX Y4L$bZvs#sVivRe#k}1N3htlo*kTbm1KmY&$ literal 0 HcmV?d00001 diff --git a/data/template_zchunk_L2052.ag_prodchange_cost_irr_mgmt_breakout_gcamv6p0.rda b/data/template_zchunk_L2052.ag_prodchange_cost_irr_mgmt_breakout_gcamv6p0.rda new file mode 100644 index 0000000000000000000000000000000000000000..3d74ed3ffefa9ab237cb88a128bdb533953c3102 GIT binary patch literal 5562 zcmV;r6-DYoT4*^jL0KkKSsr4~$N(1Vf6)Iocl-bU|NsC0|L_0*|N0_ffdBvjU>lyf z8_r+&0TG&`OSsg12KJS3uAfzyM2D#Dy|wtUv$* z2}q_O(H^MTPbunpo{v+~3F>+$kv#%tr>UlxX{qXIk*0w4Jx!_PC!wkOqab7&38{o- zJpnYDL}+QX9;4I@KmgDH0D6D`003wLND@;)27#ae&;SEX00006L7)K8000D~OXc4EVG-NbldWL`i0|d}8BSuUipwIw`MKsAY+D%i<6xl||)E+6cN1%+GQ$X~F znE+@F0009+L7+sD0%!@LFiew8G$sO@Q)*f5h&d$9q5Ru z{8dDxzBf(yD1r%(%X8bzFvf2~1;gq-Ulvn_)GOF)Y8MCm8OSpCNoLjdWKmf;uWs342!nI*3n8|W#RYgAnz@|-j9oede;r8#$A|Avi- zh_Mj&Ia#R1O;Os;tEsMxmH)l<-$y|8e%1QBm!gGowsbi2u(t4WGQ0BD3$k}T#%g~o z9J64mno{N*oBcJ09lG1UObZ4zy4KTWfT=&r-1MI6po~#;A_3AtA|eti5eTTsAhCc* zf((op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X@cV ziFn9aq+(w8m$t)X7g1~&4p4%JGW}#kKkHx}G6NXE@(Bb>w*oWL!lAsm(Yq~y*kUj6 zmvmAczF_iBzQeE%^9#j#5n}eBY>Tx^0fz#88yvk9bOPm_#m^i~$%&vB zJ4r$|JAk6$L{z6ZD}SJy%N7jaB_obfCLE7qxPeh%Tb0#0E#E2RWosr^%cA!v#0+@Z z%)=XJOQJ|Hh3%ap(wYIh-vV$VxOhQBUhdy_6y&Glt{CFVUzqQ<`&f9$=uiAz$rRy2 IKzWNlAX}*4+W-In literal 0 HcmV?d00001 diff --git a/data/template_zchunk_L2062.ag_Fert_irr_mgmt_breakout_gcamv6p0.rda b/data/template_zchunk_L2062.ag_Fert_irr_mgmt_breakout_gcamv6p0.rda new file mode 100644 index 0000000000000000000000000000000000000000..57a4cc85cae5617cdf24d97ab3566d9861d1a9c5 GIT binary patch literal 3822 zcmZvYX&@5}1Au3?Ip&zT=E`UjqRbiTwK2>wG1qvJv*yTAxg%!g&fKhMn>BNvMTyrj zXX!mU_@Rdpc z05bqI06-{EW?;}Dwy({D*x<*yG7FG2T*_yG#pQ9fz;Yp^!NPpKogLG7YFjzH?5yi5 zlQJv0lV!&=3}?-z$goQoli_7p!~%#T3!4t-FfC<{ZJ#Bix}Mc4Lr(34resN)KmbfD zS1o2R#eis#1po~JoB{s>Jc5wHn=>s>=V>v7&+2UaH=V*1%H!p50RRf%vl0OCe;iGi z2CK%Hf;863+bNzq;;z#ZT*vz1x?1c`JVR7A1{~pKsJI_%Oox@WSvyuU6J|49%yzE; z1n<}y$Nn69XnF5f+3()0hOGOPKf19~4)wn$@E+CwP#l0i-b&zc;Z4=IKj3(Dl7tTD z?%?*s^Ut!RlcmQo#@UFNp0&C7T$R!7>j_ogLOz_cz4j}lDCpEKXVEe zD_-Y(-D{UZ<~a#4+a9k^XDVYhz7&R2I#1TLdA6iDMxW)VJa`}TXj<X5NIX8wFmWX` zXZ%SfIhLzubcK_b>S(mq`|-=}80!+R;(W!JZNnG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`N_`_g;8(Q^|piL9GTM7d{+i4U(y#Qq1+QMLd8 literal 0 HcmV?d00001 diff --git a/data/template_zchunk_L2072.ag_water_irr_mgmt_breakout_gcamv6p0.rda b/data/template_zchunk_L2072.ag_water_irr_mgmt_breakout_gcamv6p0.rda new file mode 100644 index 0000000000000000000000000000000000000000..744effe2e93d934a4835da6ab4693e3ee26aab4e GIT binary patch literal 5595 zcmV<16(s6HT4*^jL0KkKS!t`|yZ{#R|M34j{@?%q|NsC0|L*_)|Nn|yKmY&)00Cee zA9KB*dxrQ7-ud-Pp+LUfd_KPE(F=7`XAHPPZ|4RmzLqK#FsGy$Lv zRI09kk){$#OqxwJ^)pn@RLSTeqbI4RjG8u$JyX+DKxAp5iRAzRlO~xTr9C4iAW8xW zp%H?ZBT{~mJtyj#H1z?50MHr$0000000E{bf}2LEqcs2k00w|CfB*mh03M;HfB*p| zlvK#4rb2p*6Vg3QBS1YtpwXs)000dD&@009z`Vhv9!o}Q*;CZ=j+Y3MZ?Xfz(C zO&V=L(9kph0000Cff7Ur$RL_w1Z2<>JX64+^)$(mf*NSh0B8UPfCEf2RVwgQr#VDD z$O5TA4$;aU^iV_y)#p8bHiloj~Y5-6(mV|b_-n$)l}Wr86!9n>*~ z^o(PDmxG+SxnYyOSY!$RY+%TY~)MNHhjmU|KLSB;*MJ zPWu*tdP;Jn49u4d#IT|g9oHD-qKL&;pdvvF&6ognP3aX$Y5k(-fK~#$*QbtA!p$LoxAPOQvMO79-WEDvfgccE1W>QE(V1RTj z@YobEB>^KqfKh-15kL>l|Le2<_Pbwqk?QUEiri8`om*7ZwP!Tq;OEH+-P@{W8bOiq z-8_U*{_^zC%&()bzhLu~22}G$3Cd9Ys`7R&`}tM%>5k#!=TxI@5O85dX5VYnVxo@5 z|GdFdQz7HH;&D+gAfFzEWVJXTKD#>1LfB_F=MYWHZaz9rImqiJlf$85;M56dg6ffv zueBMAUk^iiujw8hy?LBGi#b{L@-%nvZ|J)QNKwzqr@1B**v$o9YbT`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Bv$2{{J*3~zc8>M5BkvbZrE;l!92ZR`*?)M<_&#CHqCj$v{c5Rx*+nZZWx zLKhNUGO1nJ=qE^;3_2@XP@uCT6><{sqL(3)Uzka#Fja~oDiA^{K`=vk1%P7L5H6_@ z44tYn8aKbRzYh3Po+@a1%xI8 zyo8h_3E4`sDZAkEg%QOeU0g&O`(o*_W|1VG23I{xhi+y=qtMm8T;K*{#WBG2d6T1` z-sYjNke7ov#(}eaK|MtR%GSYmSmFuVHC=aeKo}!%a5tFR##*uYPB1A@aL_Q84Jf3E z2udwP3iub13PYsC)Xpi9V3*5|LYb_zfY#dD8-sI7)rjI4!_(Tf+EJrY;!}PBg7U0d zRxcVr#FU1R-RrLBc(>#&=Pj*?(A2}28Rq3-0sx)vcxkJ=;HLE5NSn!wOdPxk-|8}y zaK}fR8yyj1gQ-rvrY0uAShBwNWiZW{Iq|ErTdS@mF-DCVEoG*hVyd8R#(*P@E{R#j4dHwVT%wC=JW)Md_Usw@NTIG|r}3;Y3|8x>o*#rN+)h3?PHu zQ!(3k7+MX6TJ;)Z10~t5_>NZ`3X%n361AF~a_mvu7)@%9fB4Z3MIi~=pcfV)3&Nxq z^Bga41BX$_MCBdz;D#F%HlTKT&~}awixS-;({Q)rcMHA1h5>~Y;Se)80(>hxs#xtc zl7Zt6NjP9KgEnLXb-w3toM4AtmF=l%D@Y8Yg%-nMqGWcS9hIlMLmtQ=Z|K`0G80yl Xy&WY>Yq+gJ5By!p6yZWZaA_AnVjrTx literal 0 HcmV?d00001 diff --git a/data/template_zchunk_L2231.wind_update_breakout_gcamv60.rda b/data/template_zchunk_L2231.wind_update_breakout_gcamv60.rda index feef43f51a30f79b8e498d3c1ce9d4e7a4f9f1c4..471402487c2be8531dc209c745d340c24cfd867e 100644 GIT binary patch literal 5652 zcmV+v7VGIkT4*^jL0KkKS<z=PJpny5Ljy$Gr=wA)l=U&DjjCw%9+Bz;(H@h^dY-1#W}_$SWPoTIXdoj<&_Su9 zZ3-R~+J~X3ra*c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ATk9gOCQTrRRClkaGu&w&IB_0BMWIQ-c_45|NP!@sAS{f5 z2oxw@8|Fian9JmnFP+nftH=%gy@K$Ri0$)mf~ z5b}==b*f_?qf(y3vuSOmPZ(81z%o2$paa@RkY#f!2uER{a-+OXy(*k{0?02~9vRe= zWRY5s@EM~6QmeS>_22_@1%|~dPJZ%Q_ZVP7ZH*Y5GT&ig8RFA?t>8;$P^d@VHzU@=cM30N$Ej4BGjo; zEaH#J<`*&;XuWTO@}m`cT#+}rNbaeLoz=*dDbC1=Ef*wY0ud3wfhNI%z4)4A6vB%p z0MdSdM{q4b4nik)lfkguGYtUe(rQiT7OpkjDo8MdBEaZ^Q3jQO=v~etEXN)ivgVcx z0P4zxq#_+SiGl@nfu_O545Cs7h^J2A?#cQtEpZbMlXmNF$*50v&p3HN>pZv!aJm#@ z>%g*`{n8f1JtreMtiZ(agxDP^Q;V@z6R&w!P~RMup{82)DUN}PY6FnG&hkM%mZ8>9 zFEyN~&h}CG5`tQ5HI_?h9@J-3#|!5VNdnq9c|)*0T=r0>j{A6FTsNaIV8a;OS*DF> ztQRR_UuNP#U~cJVIS|MuHpHOFP(>J*7FamEV;x)EBn|x3IRchRo}vtGR;n9Bh>M3| zvG+PtiH7~_gl+4ioV74F$Id0g0|YA$tZsoJ66o`)LaQrMLUAGO8KlVguKYU+L#Iv) zW24%HDQbyLXh4p}=2u0D1xcdKHMCG^apFW_6K5Qv zDYQsb$caiMR6gmrdn_X?*^(JKkAPvq@PtnzUVb?R@|AHpD*6O{Exl@tkuJ!op8%$gI}3*rtK zdE9W2Mr3WGjZirWA`k=6P*@@&5Vg-lG!hy@f*kH~$z-*IQK<&6U>cwgXIl>Bj@exZ z#+9)tYx|W2mgz?BAh5lBb;9-fa3MKoB#j- diff --git a/data/template_zchunk_L2231.wind_update_breakout_gcamv6p0.rda b/data/template_zchunk_L2231.wind_update_breakout_gcamv6p0.rda new file mode 100644 index 0000000000000000000000000000000000000000..d5d11beb8d925f943c9f6a1dd206d7433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MR3>?qgJlsQHHiwD z8A>EnKH0c?EF&!0k{NEu3X(4?Aw*Q;I|)&w7z#AnBL;(OCcq7+L={P?ZuhHBI&UUb zcF1q+feD`W^Fq(qgeT?3kF7v!UFN+jp`q!IHG7yKHMKpth*cbCIcqrXy&`iY+Cb-y$oSDVuFS$zxo0hedU7n!R#&UJ zb*)>OT&2oZTdip5a6JsVX}P`D``fmRRH$RPhOVOENU}4ye zBY}o$I*hx{JV?k8kszjGnvo>YD>ZEZNiQ?q*X>y4ITBu4*iT3>xh3QZqogxm~z0v#3FQ1o6h)ZfCf0>O`N7^5U(R^ZmxB5_E0Qs#l){RpYD-zZh}%q* z467U!pj6b13CRqeC?&d#doIeE$U>yB>TKEWnmZ9Kj~3Gn&XKN#pN>{^QPMR_BLDGs MBvXY61?bo1aDewZK>z>% literal 0 HcmV?d00001 diff --git a/data/template_zchunk_L242.ssp34_pasture_breakout_gcamv6p0.rda b/data/template_zchunk_L242.ssp34_pasture_breakout_gcamv6p0.rda new file mode 100644 index 0000000000000000000000000000000000000000..61fc6b0e6c7d5a0ed1da248e05498bfb478d710d GIT binary patch literal 2646 zcmV-c3aRx%T4*^jL0KkKSymOo3IGVe|MLGaa(n;(|NsC0{{FxJ|NbBV2>>7f0Du4i zU<==8jm>o(PJNv{5Ul02%-R4HZ2k^){!d^*oSh*+3dS5IsSl^)%De^qBxX zA)wlT27ojHkqUZgJfjMm)jU&2lm=>HlxPha007Vc13&?w0l)w>01W|<001-q2ATi> z001-qNvb6pnm<%MMo-lqri0P|13{nzKmY*H0B8UJ2&EL-Xc|vSG|B0bXl+K+JwcOA zGBg@!000000MG#vLI@K;6B9{-2C0wApfL4KHj~i+Jwre}KmZI)9;P!;tHla*l|8Wp z4YTrG2TAe75j{WXbJOpSNV8AmEe`@ZDdwDNzdm@i!|0&e2+1g5$QEUOiveJQsA>gC zm52)kNHbw+&Ecq$Y@uuak8Y#m>1c9nJ}S^#`V8uj$6&tgj%h6yx+ryGanv{$G|^KJh*vz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;`!?=s1fym&3HhR}iD9&3O%0y)AB+54 z#cy@Y4!C)uWI%%0tHfj%G>VqHOA}@RYTK36ahcJYEKkaHA)bp38hN{JPD zcDbY{t2bx{!28u(wj}{>Y^Y1agfHKyl)MYb4B;ws1%nB7Ak6~_+jFG<;N%*+k|sb{ zfSEBAuy#-fjeTU~&hxL^@d<)_=}EcVQW@^v8;@qx<@P3dru6VE=W*!(&$EWlqj+>; zq8mNL^pF^P6UaUS=uys=I&{-q?s}78Z@*E+mdrLeg^3D@4bp~iN*mZnkR)Vi3V7R8 zx2Xsiq&m*tP}KH@kS8FpVnq01yPMSR<%n^dc*HNz@`u{I#Zxiq$xfzn$Kuo9)7GjB+En5KNO-TWF`l( zfE~B;VQ1iS^H%hn0?Ei5Lrq|Gf@1DH?9iKS2_*n*esQrwdk%0(IRC}mkxmpO6@_qu EfY|iCasU7T literal 0 HcmV?d00001 diff --git a/data/template_zchunk_L252.MACC_breakout_gcamv6p0.rda b/data/template_zchunk_L252.MACC_breakout_gcamv6p0.rda new file mode 100644 index 0000000000000000000000000000000000000000..89af98e5099fc57404e39d894c5d158f8fedcce0 GIT binary patch literal 7826 zcmV;D9&O=5T4*^jL0KkKSsCv1Rsbtif589sfB*mg|NsC0|NsC0|Nj+PfB|4AezEhW zz5qM`BXuD8F;BhSPppJ}w}I{VVd)aqbtzJN-PNlO?eKlNprM;W@=E05oW54Kic~ zfY1OmGyu>52AGN^8hV4&0B8UJ8UdgH8UQi?13&?w002UgMARt%Nlz&KPfC7@9;3*b zHlsBF8U}zgdW`@80qOt)LFyU-5=o+HjHifAG{qB7PfbbrMAOvKrh`ols5CS*00000 z000C@2oMMY35_EvpS4l!N`9F#n^CFlD0+ZBKpv)^h%_1i&;vjV<|>th6-so#s4trk z6i?}80m^L7Ng#p&+3^Fv(t!81OLBb{)~C(S1`GpHq#~~pf|R7CFn(0D*0p^!2hKdfLG4D(~Efd1-{0H^WvYyc!*V*#_Z zwnNN`0(f19U1a=;(nSQ)2`~>K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*Io?GBc&uwua=fEli$M4%)+(WIKz{OK6LqBl8lc1W=aL|L&?Fep1V zNHbl6WXfh~ifJ(ppMq~e6(dX=R2zwI2)iNzS+SEm1`e`n%*z+5D3Spk;%-I>u(1<@ z;C_Q5_6+!4n~g0dxgczDDFeV*mx}AQVg`vrf;bxnh(n*&_v$F3>KW_y?e|m18*qIA z4co2IxOB2s8X60QV3YuS8%A~xYns)GBK(bBpd)X!G>WHo5LY>9TwD+m%an< zhthT?0>z}CwB%5Q#5+x-7(%EI*I}`>!q4C>W5i$rV?PIpZn%^z$w#yoF}HvdM7m-D zkqyLqz=L1}>>Hc#Bp5>=m@Lrvm{9NA36KseUv7(%$^H|V(v7-$OMS6&GFnhNd55sK zVc2#mTIOOqrzCa%5NB)OciuWQR*8 zgS%4Xb&!a_vdToDhg!K{kbua5M9P6>1sJ`J_}Mg4jt+=BhUggi#0ik)fI#L7#&=ej$@ERZaYw%pblDPn^$TfrTU9zFx-;m={U|!QGgx0NdX`c zBvcOCN==Tz3*c!~tvK67qap!_-kEd-H@aDQEL_A%2TT#vmQ;ckE!!7NfejM~Lz-to zUs;qW5P*It$socoBM1n2ps929Fb>)|lR|NrmQ?%E^f&|ly9GfVf%>x(Q1*vuJA^&9 zF0mlaXquosEpS={+^Br%7?umCbYl_f_iFC~*L?nXo+?WmVg{}ZS5@3Yavl)ao&7uj zoe7}{pFEZa0~IVMOm2V}vSS$lWlMzmOnZV2qM1Z0b_gF~6fCa|!tDiisy}%&E}G;d z3Io$x*{DjXxnw|~3PW|v;euMiOVv9daYVE>$isH=mw}0-+1pJf>mo>D3J|r?E~$_% z?VpeK==9k4Bp-5KLZR4_lF29vh~Xh_k`UuS=)zPTEl>{D#|^?0goQf=B-saz!{$kQwguR>IIF*#H0l literal 0 HcmV?d00001 diff --git a/data/template_zchunk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0.rda b/data/template_zchunk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0.rda new file mode 100644 index 0000000000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Rj-NE32zydJoe32aE<+zh}QGhqp z#jpX$8aaltd2r2Mo%0c|U_FRZa09A`1y9Dkq&n{bO!xydfY7R0a$SUxBwoY{x?TM? zL73XjjM=0qG{p0E`?tiM&fW#Uf~f&*yLE~S*=G~F3+Iba?|9d`?@@!gF*l>91VI>r zE=J9ztwZSZZWP}01&ddlp~M5GAXFgPnSLjSoIVr{V(AO(g|fMfv34y&jAaBDwGS}w z+_Es8B;;76j6u!tiz5Vq2r)=S2uOhI=kD<2b@S=Q1NGu^6Bl+@ZyGr`gD?QRQ~wuo LML1B9;>rk6A3)lC diff --git a/data/template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0.rda b/data/template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0.rda new file mode 100644 index 0000000000000000000000000000000000000000..6f0032c02df10c8ba773f3cb120c3840c4eff1dc GIT binary patch literal 6486 zcmV-c8L8$%T4*^jL0KkKSyS=yU;rF&fB*kK{{R2~|Nnpg|NsC0|NgSkFaQD|0B`~T z03Z+m0wG`^Jz!uM1aCvWzyK(xgHZPX=x}v9p^DRx06V*J%Rybv;+hE#5!)yL08ly$ zwzLeWIDtZgy9*5@m_|XOXnLbh3J+)!W+~}BrbEhRqh!i6N$6SEIGCfTXDe5+$ zWDiqnZBI}oG$5J?38sXYgv^xLOlo?M)M|Qqp!EiU>NL;*03N2AdYT4-paGyD!eV5= zObLmjOhy0+fJT`bFcVCe1jxVu07eO;0Rj|~O%*+*H>zfn)Xf7;6KXN2dJxg3)G}s~ zkN{{hGz^*m0LTUjh$2x4(rKorq)#Z>BWg4}lSWTOdLvDwXda+?ni>EA000Jn0iXzy z5I{_m0w!n#%6d%`)bf+`)i#<9MkCN^qfh~a$iy);2AKc{siy7f0h>wzj|^n@vIvj! z)=B|flEl#rK!}KoiWQqzE*Gx4A=c_wWHLkq4BX%pzM=r|lLIhkFY-IDO|4lnyV)b( z_n2@%--eA6Lt!vm*CJw@>*qy8ND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CTI+>EQACt4{`p{Sbw8a%T8Bz&Z<$WU^R5^XtJ&zn%87W1`??# zo<)c_ba4t0Ds!FcpkQ#g7%-{~{VpkT17px18xWqFD%&BrtXpRr5jj#NU@q zg!RrLGBEBY0ok2;E3&Bin)s`>xh@x<2iZ6g3JQs{Ey$L19=PWbI^ZB5kB&`2Il$OU zB47nX!|+N+S7i?O&*kdbhimjU24Zi-a$fXfyjRFjOjOSE5Q#2FPHH4xoI|8@z8M7) zFoazZQyf7n98xM6he&&XIo-{8f#~F8LzEFolWAsj&76Yq&}d8`jd}?qA%`G}3HEL& z{iZLEtTwN@a!`1w4M%2|5krVW8$6IoOiqL0ztF7V7)0JcG#&4E#q~WM%Y;ZqKP)?k z)KKLPN!uzYK=e^lsE8Cjo*yptU}+A$_VJv&vrQj=JuO5ehthKwuiF?o?T&-HACL1hG7bj?d3#B zK6@r~EdZEF3W67vl~7CI7=g-DNcTbE@v_Nakv=srblQR%C_++@I-ak90w#ixrDV^T o5Hz002;S&Te1kkoX+j+PS2CUFBxT6;(LeEbBvXY65577FPz(nA%K!iX literal 0 HcmV?d00001 diff --git a/data/template_zchunk_LB125.LC_tot_breakout_gcamv60.rda b/data/template_zchunk_LB125.LC_tot_breakout_gcamv60.rda new file mode 100644 index 0000000000000000000000000000000000000000..428b719211cc217a2c86f74ec3bc379d2b50b868 GIT binary patch literal 2722 zcmV;T3SIR=T4*^jL0KkKS@6D8djJV5fAIgff4~3#|NsC0-~a#r|M~z3AOHXa00CeN zpH<;IZ+EJXdFJ4y_jg3g+!=HL0BF?%hC)*bPtaJI=)Mi9_hMOp89;S~|4NVD8X_8M#=$=ze4GjZ800uxB0000000Tf6nn)x^l=U$H z8Xl*qpwa3EfB!XUYjm^OQGKx>Ext(Pk{FPxB$D$4uf7F3k6v5gt- z8E;9DA5@koQp^LQK_H0$-vD4hWCS3h!AQkLP^b~KK!YLJFcgtuDk3amvIJ5nvMh?Q ziveQDQe|r-gbCIpDe zg$K;0CR6AE0J%nvo1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@ zqwxlgl_?wS;;SXrySQ(g&N);tIR+Rs*g(c5EvZTZMHzvHBr}J76jMf#)80l#a&31} zt4+dzp-$d)zol4p`XzvjK*kB?-@#KIt!CL7PGRHPyS3IH9`W8bqf*#|VTpEx*vr#6 zqDo`hh)YDDJP^&B<9d9ovQ|zS<#`1%osn8{ZAQw5q1Q`7hoB*h0xi2xyb}rQC|q4C zmnbH~#*9%WQrHngqfchKsxH@|HF#TdB{!z9xyrv&*euHEuE?`SXc9>zh>PTjn@US5 z$e@CyMO0eShK-Z;cLo=t>n(S2zZ3+k=0v1#i&=Q{7wGJa*)13=P_YN!vc&FH+$+H6ebDhruiGEFsX6QKEuyaW@v446Y(WUaxM!3bmXyyn)hS~Xv> c@@35j61OY7rzLa($^(pD$rRy2L&Et{?9CS3j{pDw literal 0 HcmV?d00001 diff --git a/data/template_zchunk_LB171.LC_R_Cropland_Yh_GLU_irr_breakout_gcamv6p0.rda b/data/template_zchunk_LB171.LC_R_Cropland_Yh_GLU_irr_breakout_gcamv6p0.rda new file mode 100644 index 0000000000000000000000000000000000000000..d4500c3dbe58433064a32221cbe1756427917cef GIT binary patch literal 3114 zcmV+_4At{OT4*^jL0KkKS&8=DQveF^fA#;iZ-4*)|Nnpg|8Bqk|N8@oK>z{(00aOa z0s&wSe^$JG;^%fej!Ff3Rb(lnO&SFNPykQ>3L1hG#Qjr8siP*18UxfaX{LsnG|*xi z00z_m^)ViiklKv{)B{r@o~h>KXtv0ie(xQw-HA@KT*6 z6WofTZH1I_hpH$e=4ztn5eib$e9Kj5fT3MDsE{^O6_TZqG!!7DLzia&z-kyDcHw&^ zoh@t(z8gC(QI;EMu_QV4stW}eK>EmlAZX=UL@EXg?8X}nUFk6z1jGzW?J%eSFqGy| zPYqR+kpCL;_nu@>VgvTjA|geA2*DIcBEUtEtdOm+lw^Q0f&s%wuviNsq7W1!$g)L% zC`E!RBN76viWxWC`q@4I9!xhzqB?u6xi>LOrk+{YAlPP^(xil0G51$TarC~Q2 zhi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$^P&t{?y*2I6 z1t1;B;fk3inaL1r=13XWxON%|NS$JBUAg3@yatOeW)vb^61!-1qVYIk!QeAXr$Yei z%AUv-AO(t}X+k!#_k_0)Y&J}yY6XxCAPpuqt4K^Zum!~r&CfOS;A{_`gCx}k4Q@L+ z)QUmv``loipmTy|*l6Pe`+)7!0n0^#C(Dv(1d<`3!3*aXBRDE!0%a}a@+A<6cBVO| zcqSU7o%aSWejWZ4y@T|wxtWf)Z%UVT3Sb7Khm}r6tQ2V5TruVo(;b zWr<|EFm5ACh0;rRE3?{&Lnj2oM5_sCfl1n>ZVO;=12G~81ok9LZi)5UgH7ESzK0J< z0y!F$wOWeUas)I-lDIbxr?5E0`V@)J--faWlPnEpHAPb*VRFzZ$;cwcO0Rst#4X+$lT+#2tSkmy;$yh= zCysXnx0LQ_BMn1s5#tU!mYY(qbSxc|Z`YRD9x&4|wu{HBjUGFg)w#4yx=sUKdcygJYFK5l z1_o9Q9bs^|+73ZZo8WB=qHaeaI);FsQ9%uYW?bYx#LAur7VzjPIS}IwVQ+N{smndJ zFt$CR%ZqU9%YX)?`v?>d7-T79pQgZcIH3!e7oPyim`Y3&Wf+!8^6ugT9;B-yG^mi^ zj#(Ef1t~HO-5_wkY95m^5HpFq6J+7CAoF&0Vw@NG>u<+So^X|MK41SAaz!{$kcsx) EQ{pwCwg3PC literal 0 HcmV?d00001 diff --git a/data/template_zchunk_batch_ag_For_Past_bio_base_IRR_MGMT_xml_breakout_gcamv6p0.rda b/data/template_zchunk_batch_ag_For_Past_bio_base_IRR_MGMT_xml_breakout_gcamv6p0.rda new file mode 100644 index 0000000000000000000000000000000000000000..652863527a23527f61ee97f01bb7c70d7b640ae9 GIT binary patch literal 1837 zcmV+|2h#XLT4*^jL0KkKSwLSFC;$ew|G@unc0d3B`~Uy{|9-#!|M~(z00CeJ-(BMm zJ>N7b@13rs0QwK7O#sOS6Vp+q3FnWPc=5744MD{0000000000GLKR007Vc0000000f$mNi;np zKn#ry01W`qpa1{>0000C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Op~#XDv=!weukI(SOPVnJHV9Ihq(IRSfRTEu;el z_7&s80MAfkQ~hoB`S?w#p%Z##@oaCMKw9dy3s6@Bp`K=?c2Bj`LNJRB+jRJ9iBy6H bo%m@@3Exkh9vG9thyNFHML1B9KwlOp7#2iY literal 0 HcmV?d00001 diff --git a/data/template_zchunk_batch_bio_externality_cost_xml_breakout_gcamv6p0.rda b/data/template_zchunk_batch_bio_externality_cost_xml_breakout_gcamv6p0.rda new file mode 100644 index 0000000000000000000000000000000000000000..fc5b6e2c0eb0ad60797b8ff3cec9f688d111e7c7 GIT binary patch literal 1655 zcmV--28j7WT4*^jL0KkKS)F4a-2ent|G@unc6`2s@VCmMU460FaFPtC0IQXXYAM4C&qQ;O7RI#IP^t!_Os9M_(};aD&eKsjNz*8lSP5%= zn`_Z&zn-mR4&Ou1t7cpys(Uc$)oiuaD_DH=rwi*U+f^w_4KBix-t%~*RXjid01yNK z0wg0KYZzD%#$PiR@Hg4t_`LpKC-}J?%>$Z2Bc(vNbXVUGG0Dy<9mr##{NA%}7+klg3*qlKL$;U@#|1mp$ z07Fok^d3TjJn9?1nf>87z;80TulWllK6V8s^*8Fnjo$oSD1;Z+eGk}8mwG~xMyu4yiiI#bbY!tdA zw+#Zr$by0N-g;UKYurKN+S^n}i1?CPyy|{0jTylvvzXgui|E!Zyquo`?*_jCtKBA% zr2o-*eq?*qAt3S#n#UoAk!n{jUGq*}q(ORV<}nngEg34ewHaWLvcmlmQH=p}AiD9O zR-odmG7$x5tfNV((KAP0&OO<1eOSa2rddFqg5u)pa#oXqL@5`e+!hMOLi&D|TNuv} zJ&Km4?6E5>RfVcMv=n8{(zf%|zy(9vxS628sp(B_1|l{LY+&8us>p&+767?5C4vm7 z-y@b2Nzm;Yl6IxY4x40H9Y z5rPZuUO*OU-^r6Z!?RR&7io^pdGT|Y*ylDxu|ZCP%>a~!n;Tmt%e0!g1#&GqbLQiP zoDkw`GJ?cbNxUg|Oh!blJUjVMSgRw~tJ}wG(u>)#7j_H5Gh^=*vPxk+1ch-6kXk@e z-l$Ak>}aw+&nU*5Ns<8D!ra+~(Ml4c86g<*--<6sraBo;xHVD!F64@Ep&>fPKe~f| B1WEt^ literal 0 HcmV?d00001 diff --git a/data/template_zchunk_batch_land_input_4_IRR_MGMT_xml_breakout_gcamv6p0.rda b/data/template_zchunk_batch_land_input_4_IRR_MGMT_xml_breakout_gcamv6p0.rda new file mode 100644 index 0000000000000000000000000000000000000000..f788354e43f78bd10781090adad0c2322302e568 GIT binary patch literal 1633 zcmV-n2A=ssT4*^jL0KkKS*32PX#fPAf5886cANkI|Nno#-)_JE|N1}x00CeIe|oHO z&c0{4o3Q8rN|Z7}M9iZ`fuW|FWHiWaPe{?HsgpxZGy_I}14BRo2#NZdrrJsQDf*|W z={>3*qd+ud01W^D0B8n4X`mcvXlQ5#fW!>}kN^gn02%?1000amM3FHDr;|YSCXEJ~ z88il(0AvB7rhw2iX`lewsgg(JqclJb4H^bO05kvq000000!0MSLsQiBj7>BlwMI=n zAkY}n14BbV0MHr@8L2wZ5R*VbSm5@w2rgmdkda&Ju?Svog!pZ7&*uNTPk(m2YFxBv z_3l*`XrodTI}U7VP05N9?@}yP3Ag*Yo@r1=kS7A+e!} zwhf7dF$6edAWT?{O|~JnHrUc_3}|dkq?>GP5hrs<0bw0V)kTnu2mlHol0{0H)1~M; z5kr1{)t0YlbWM@FG7|4K=;1|fmDHth+HLcXxmWb#8uArUHl^ZMjE+`^2E@oRY2SkK zZz2RoK{n98LV{5NfWPrztO>2cAC&5}<4!6in2+1$9VmhM)*Ne0adS}a#>>(;s);^h z8^qW~WGwc9y(&9ar9Ob4RO^hUqEH!-N;BIf;~rc`I1T}*Y&thUn2IyP2~6i9DK1i* zdDfz%3#8?z{sdSFdR8Z=r!V-7G{=dP36*BOB-e)HsT@z zTr}W?7gpmI(U)UF_j8BV`r1|B9-WXp~?xWm)|1=GB<5DT6d8)yo<63FUyM zbyKlQ%PgHHrlz=6yrcu@^^{a@pyZXfxyqtjuQPa((s~-I+UR9sTFGhQ2&60P1}*7S zas1?7r>Kh3F@;XJD-@-V$dc)Up<^IVAQEzQu{CGeh)k^93N;FGAb_6Kp)kiPp@iBI z&cxAlzTpa)Raz0jQV{&_mhx0+M`TBU1tKi}oozl%ngkr;55JJnTFM~OoFEWRDZ_7D zpSlw62@O_wk7N?K!HP>jooWNV1OUQk3yWdXxeXo;K@6(uJh??(w2 z5~^2X0=JWaOaqP7X0x&D-O(c99D*#KfH17GozM)LQtKwHH&;Iq1ZbCny}IN_4%_qE zA=YVj7@&uU`DjUe5F?Th02ND8K&&fAm$K;#lqQj)QxU8^C}I@^CMk(Ew1p7xZ1fOQ zv|CCUVKOsXMgg0d65`lFf43exIVdlOOKnsN5ca_H7L*%uP=QW#0)cr71dJl z->qQ|;_+{X$nZbNQ@5b!71#wx=%(r%e29TsY2`gJMrho&v}lO@ z;MSDxN(jUv@q$$nLMVb}wwXQ_aj&OfcR(>UIH8`<26*GWWvdk;zF|wgmIlOKu+lZ0 zMF}FtklHkt^of`C8Nb$0#>5)4WW{1$OENDtD)>vG2OVsI5sVuo#x7h7?%FWVy-SFe zqfyJ3LjqQAYKW{2@K)pyU|FTAGbDsui)1CWB>)V(H43x^;YyLEuAbruk%JKilmzZn zX3Zi0(Rt$Hc&B>}lsnIN*#km=yu9%2`AN^8;wr#Z-cVE$o*DlyAy)#-iuDLHLs~d(#~_Bs7z<<$#1IQqK@yzORc#8G z>i#W);ygMDkb{B7YKzL6iE50_!9|C4;8#OlOVfP5#YSD6p-7_VI6@sDH<23k3jS1F zi;!DPk*otXx4U@>*evj4Dr<5QrI7#0!0s*jXV@~!VC1yot7vD|K5)*Sp;_ literal 0 HcmV?d00001 diff --git a/data/template_zchunk_batch_land_input_5_IRR_MGMT_xml_breakout_gcamv6p0.rda b/data/template_zchunk_batch_land_input_5_IRR_MGMT_xml_breakout_gcamv6p0.rda new file mode 100644 index 0000000000000000000000000000000000000000..44cc6fdebdcc09fe9b1f02ddb0d98a82eac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Aw$q4JD9|>O+h%+fXN&M5DQSLY#{}B!On-#)(?mSNwy}W9~cIy z>DP7clqg%?2A+is=M=-l*h8pG4rEHHdO$!dEJB-1-Gc#}q7GkimanJ+^f%_mt=4BL zl}yI>tYV3AfQpx{N8WmdnYR)ZT2zvIVD{0JH$VKKg@%PEib4#7zbr(Afq` z35749y-1P(%htd)pqa$80-Isz%|t>L6-Yu;B@xFm88KzqgoJKsM)=Y1?)Rt-ihNOk zW`|#zOrT;I87I560Ne4PbICMoG!_A8*j-`;aETEcWe^sO1fYlnMHCSf5fo5RGg%G} zG6oA|oCm%&% select(region, : left_join_no_match: NA values in new data columns", -# "zchunk_LA1321.cement_breakout_gcamv60.R", "6.0","NAs in xml cement.xml", -"zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv60.R", "6.0", "Error in left_join_error_no_match(., L123.LC_bm2_R_Past_Y_GLU, by = c('GCAM_region_ID', : left_join_no_match: NA values in new data columns", -# "zchunk_LB123.LC_R_MgdPastFor_Yh_GLU_breakout_gcamv60.R", "6.0","Error in left_join_error_no_match(., L123.LC_bm2_R_Past_Y_GLU, by = c('GCAM_region_ID', : left_join_no_match: NA values in new data columns", -# "zchunk_LB1321.regional_ag_prices_breakout_gcamv60.R", "6.0","NAs in xml en_supply.xml", -# "zchunk_LB142.ag_Fert_IO_R_C_Y_GLU_breakout_gcamv60.R", "6.0",'Error in module_aglu_LB142.ag_Fert_IO_R_C_Y_GLU("MAKE", list(`common/iso_GCAM_regID` = list( : Fertilizer input-output coefficients need to be specified in all historical years' +"zchunk_batch_ag_For_Past_bio_base_IRR_MGMT_xml_breakout_gcamv6p0.R","6.0","gcamdata: GLU GCAM_region_ID", +"zchunk_batch_bio_externality_cost_xml_breakout_gcamv6p0.R","6.0","gcamdata: GLU GCAM_region_ID", +"zchunk_batch_land_input_4_IRR_MGMT_xml_breakout_gcamv6p0.R","6.0","gcamdata: GLU GCAM_region_ID", +"zchunk_batch_land_input_5_IRR_MGMT_xml_breakout_gcamv6p0.R","6.0","gcamdata: GLU GCAM_region_ID", +"zchunk_L2042.resbio_input_irr_mgmt_breakout_gcamv6p0.R","6.0","gcamdata: GLU GCAM_region_ID", +"zchunk_L2052.ag_prodchange_cost_irr_mgmt_breakout_gcamv6p0.R","6.0","gcamdata: GLU GCAM_region_ID", +"zchunk_L2062.ag_Fert_irr_mgmt_breakout_gcamv6p0.R","6.0","gcamdata: GLU GCAM_region_ID", +"zchunk_L2072.ag_water_irr_mgmt_breakout_gcamv6p0.R","6.0","gcamdata: GLU GCAM_region_ID", +"zchunk_L2112.ag_nonco2_IRR_MGMT_breakout_gcamv6p0.R","6.0","gcamdata: GLU GCAM_region_ID", +"zchunk_L2231.wind_update_breakout_gcamv6p0.R","6.0","gcamdata: GLU GCAM_region_ID", +"zchunk_L242.ssp34_pasture_breakout_gcamv6p0.R","6.0","gcamdata: GLU GCAM_region_ID", +"zchunk_L252.MACC_breakout_gcamv6p0.R","6.0","gcamdata: GLU GCAM_region_ID", +"zchunk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0.R","6.0","gcamdata: GLU GCAM_region_ID", +"zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0.R","6.0","gcamdata: GLU GCAM_region_ID", +"zchunk_LB122.LC_R_Cropland_Yh_GLU_breakout_gcamv6p0.R","6.0","gcamdata: GLU GCAM_region_ID", +"zchunk_LB171.LC_R_Cropland_Yh_GLU_irr_breakout_gcamv6p0.R","6.0","gcamdata: GLU GCAM_region_ID" )%>% dplyr::arrange(module) @@ -56,11 +57,60 @@ usethis::use_data(mapping_modules, version=3, overwrite=T) # GCAM v 6.0 #............................................ +# template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0 +template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0 <- readr::read_lines(paste0(dataFileFolder,"/zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0.R")) +use_data(template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0,version=3, overwrite=T) -# template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv60 -template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv60 <- readr::read_lines(paste0(dataFileFolder,"/zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv60.R")) -use_data(template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv60,version=3, overwrite=T) +template_zchunk_L2231.wind_update_breakout_gcamv6p0 <- readr::read_lines(paste0(dataFileFolder,"/zchunk_L2231.wind_update_breakout_gcamv6p0.R")) +use_data(template_zchunk_L2231.wind_update_breakout_gcamv6p0,version=3, overwrite=T) +template_zchunk_batch_ag_For_Past_bio_base_IRR_MGMT_xml_breakout_gcamv6p0 <- readr::read_lines(paste0(dataFileFolder,"/zchunk_batch_ag_For_Past_bio_base_IRR_MGMT_xml_breakout_gcamv6p0.R")) +use_data(template_zchunk_batch_ag_For_Past_bio_base_IRR_MGMT_xml_breakout_gcamv6p0,version=3, overwrite=T) + +template_zchunk_batch_bio_externality_cost_xml_breakout_gcamv6p0 <- readr::read_lines(paste0(dataFileFolder,"/zchunk_batch_bio_externality_cost_xml_breakout_gcamv6p0.R")) +use_data(template_zchunk_batch_bio_externality_cost_xml_breakout_gcamv6p0,version=3, overwrite=T) + +template_zchunk_batch_land_input_4_IRR_MGMT_xml_breakout_gcamv6p0 <- readr::read_lines(paste0(dataFileFolder,"/zchunk_batch_land_input_4_IRR_MGMT_xml_breakout_gcamv6p0.R")) +use_data(template_zchunk_batch_land_input_4_IRR_MGMT_xml_breakout_gcamv6p0,version=3, overwrite=T) + +template_zchunk_batch_land_input_5_IRR_MGMT_xml_breakout_gcamv6p0 <- readr::read_lines(paste0(dataFileFolder,"/zchunk_batch_land_input_5_IRR_MGMT_xml_breakout_gcamv6p0.R")) +use_data(template_zchunk_batch_land_input_5_IRR_MGMT_xml_breakout_gcamv6p0,version=3, overwrite=T) + +template_zchunk_L2042.resbio_input_irr_mgmt_breakout_gcamv6p0 <- readr::read_lines(paste0(dataFileFolder,"/zchunk_L2042.resbio_input_irr_mgmt_breakout_gcamv6p0.R")) +use_data(template_zchunk_L2042.resbio_input_irr_mgmt_breakout_gcamv6p0, version=3, overwrite=T) + +template_zchunk_L2052.ag_prodchange_cost_irr_mgmt_breakout_gcamv6p0 <- readr::read_lines(paste0(dataFileFolder,"/zchunk_L2052.ag_prodchange_cost_irr_mgmt_breakout_gcamv6p0.R")) +use_data(template_zchunk_L2052.ag_prodchange_cost_irr_mgmt_breakout_gcamv6p0,version=3, overwrite=T) + +template_zchunk_L2062.ag_Fert_irr_mgmt_breakout_gcamv6p0 <- readr::read_lines(paste0(dataFileFolder,"/zchunk_L2062.ag_Fert_irr_mgmt_breakout_gcamv6p0.R")) +use_data(template_zchunk_L2062.ag_Fert_irr_mgmt_breakout_gcamv6p0,version=3, overwrite=T) + +template_zchunk_L2072.ag_water_irr_mgmt_breakout_gcamv6p0 <- readr::read_lines(paste0(dataFileFolder,"/zchunk_L2072.ag_water_irr_mgmt_breakout_gcamv6p0.R")) +use_data(template_zchunk_L2072.ag_water_irr_mgmt_breakout_gcamv6p0,version=3, overwrite=T) + +template_zchunk_L2112.ag_nonco2_IRR_MGMT_breakout_gcamv6p0 <- readr::read_lines(paste0(dataFileFolder,"/zchunk_L2112.ag_nonco2_IRR_MGMT_breakout_gcamv6p0.R")) +use_data(template_zchunk_L2112.ag_nonco2_IRR_MGMT_breakout_gcamv6p0,version=3, overwrite=T) + +template_zchunk_L2231.wind_update_breakout_gcamv6p0 <- readr::read_lines(paste0(dataFileFolder,"/zchunk_L2231.wind_update_breakout_gcamv6p0.R")) +use_data(template_zchunk_L2231.wind_update_breakout_gcamv6p0,version=3, overwrite=T) + +template_zchunk_L242.ssp34_pasture_breakout_gcamv6p0 <- readr::read_lines(paste0(dataFileFolder,"/zchunk_L242.ssp34_pasture_breakout_gcamv6p0.R")) +use_data(template_zchunk_L242.ssp34_pasture_breakout_gcamv6p0,version=3, overwrite=T) + +template_zchunk_L252.MACC_breakout_gcamv6p0 <- readr::read_lines(paste0(dataFileFolder,"/zchunk_L252.MACC_breakout_gcamv6p0.R")) +use_data(template_zchunk_L252.MACC_breakout_gcamv6p0,version=3, overwrite=T) + +template_zchunk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0 <- readr::read_lines(paste0(dataFileFolder,"/zchunk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0.R")) +use_data(template_zchunk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0,version=3, overwrite=T) + +template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0 <- readr::read_lines(paste0(dataFileFolder,"/zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0.R")) +use_data(template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0,version=3, overwrite=T) + +template_zchunk_LB122.LC_R_Cropland_Yh_GLU_breakout_gcamv6p0 <- readr::read_lines(paste0(dataFileFolder,"/zchunk_LB122.LC_R_Cropland_Yh_GLU_breakout_gcamv6p0.R")) +use_data(template_zchunk_LB122.LC_R_Cropland_Yh_GLU_breakout_gcamv6p0,version=3, overwrite=T) + +template_zchunk_LB171.LC_R_Cropland_Yh_GLU_irr_breakout_gcamv6p0 <- readr::read_lines(paste0(dataFileFolder,"/zchunk_LB171.LC_R_Cropland_Yh_GLU_irr_breakout_gcamv6p0.R")) +use_data(template_zchunk_LB171.LC_R_Cropland_Yh_GLU_irr_breakout_gcamv6p0,version=3, overwrite=T) #............................................. # GCAM v 5.4 diff --git a/inst/extras/zchunk_L2042.resbio_input_irr_mgmt_breakout_gcamv6p0.R b/inst/extras/zchunk_L2042.resbio_input_irr_mgmt_breakout_gcamv6p0.R new file mode 100644 index 0000000..cb3f5a3 --- /dev/null +++ b/inst/extras/zchunk_L2042.resbio_input_irr_mgmt_breakout_gcamv6p0.R @@ -0,0 +1,349 @@ +# Copyright 2019 Battelle Memorial Institute; see the LICENSE file. + +#' module_aglu_L2042.resbio_input_irr_mgmt +#' +#' Produce a table of global Mill Residue Biomass Paramters by year, a table of regional Forest Residue Biomass Paramters by year, and a table of +#' Agricultural Residue Biomass Paramters by irrigation-management level-year. This chunk also produces tables by region and year of residue biomass supply +#' curves for Mill, Forest, and Agriculture. +#' +#' @param command API command to execute +#' @param ... other optional parameters, depending on command +#' @return Depends on \code{command}: either a vector of required inputs, +#' a vector of output names, or (if \code{command} is "MAKE") all +#' the generated outputs: \code{L2042.AgResBio_For}, \code{L2042.AgResBioCurve_For}, \code{L2042.GlobalResBio_Mill}, \code{L2042.StubResBioCurve_Mill}, \code{L2042.AgResBio_ag_irr_mgmt}, \code{L2042.AgResBioCurve_ag_irr_mgmt}. The corresponding file in the +#' original data system was \code{L2042.resbio_input_irr_mgmt.R} (aglu level2). +#' @details For Forest Residue Biomass, each GCAM region-commodity-GLU combination in L123.For_Prod_bm3_R_Y_GLU is converted to a +#' region-supplySector-supplySubsector-ProductionTech combination, and externally set parameters are added to form the table of Forest +#' residue biomass parameters for each region and year. For each region-supplySector-supplySubsector-ProductionTech combination in +#' this table, base supply curves are read in from A_resbio_curves and then, in specified calibration years MODEL_BASE_YEARS, replaced by +#' fractions in A_bio_frac_prod_R to form the table of Forest resbio supply curves for each region and year. +#' +#' For Mill Residue Biomass, sector, subsector, and technology combinations for NonFoodDeman_Forest are pulled from A_demand_technology, +#' and externally set parameters are added to form the table of global Mill residue biomass parameters in each year. Sector, subsector, +#' and technology combinations from this table are repeated for each GCAM region and year, base supply curves are read in from +#' A_resbio_curves and then, in specified calibration years MODEL_BASE_YEARS, replaced by fractions in A_bio_frac_prod_R to form the table of +#' Mill resbio supply curves for each region and year. +#' +#' For Agriculture Residue Biomass, each GCAM region-commodity-GLU combination in L101.ag_Prod_Mt_R_C_Y_GLU is converted to a +#' region-supplySector-supplySubsector-ProductionTech combination, and parameters from L111.ag_resbio_R_C are joined and rounded +#' for each region-supplySector. These parameters are then repeated for model years, irrigation types, and management technology levels. +#' Finally, for each region-supplySector-supplySubsector-ProductionTech-irrigation-tech combination in this table, base +#' supply curves are read in from A_resbio_curves to form the table of Agriculture resbio supply curves for each region and year. +#' @importFrom assertthat assert_that +#' @importFrom dplyr bind_cols bind_rows distinct filter if_else left_join mutate select +#' @author ACS July 2017 +module_aglu_L2042.resbio_input_irr_mgmt <- function(command, ...) { + if(command == driver.DECLARE_INPUTS) { + return(c(FILE = "common/iso_GCAM_regID", + FILE = "common/GCAM_region_names", + FILE = "water/basin_to_country_mapping", + FILE = "aglu/A_demand_technology", + FILE = "aglu/A_resbio_curves", + FILE = "aglu/A_bio_frac_prod_R", + "L111.ag_resbio_R_C", + "L101.ag_Prod_Mt_R_C_Y_GLU", + "L123.For_Prod_bm3_R_Y_GLU")) + } else if(command == driver.DECLARE_OUTPUTS) { + return(c("L2042.AgResBio_For", + "L2042.AgResBioCurve_For", + "L2042.GlobalResBio_Mill", + "L2042.StubResBioCurve_Mill", + "L2042.AgResBio_ag_irr_mgmt", + "L2042.AgResBioCurve_ag_irr_mgmt")) + } else if(command == driver.MAKE) { + + all_data <- list(...)[[1]] + + year <- GCAM_region_ID <- GCAM_commodity <- GLU <- AgSupplySubsector <- supplysector <- + subsector <- technology <- region <- AgSupplySector <- AgProductionTechnology <- + residue.biomass.production <- sector.name <- subsector.name <- price <- For <- + Mill <- colID <- fract.harvested <- HarvestIndex <- ErosCtrl_tHa <- ResEnergy_GJt <- + WaterContent <- mass.conversion <- harvest.index <- eros.ctrl <- mass.to.energy <- + water.content <- Irr_Rfd <- level <- ag <- GCAM_subsector <- NULL # silence package check notes + + # Load required inputs + GCAM_region_names <- get_data(all_data, "common/GCAM_region_names") + basin_to_country_mapping <- get_data(all_data, "water/basin_to_country_mapping") + A_demand_technology <- get_data(all_data, "aglu/A_demand_technology", strip_attributes = TRUE) + A_resbio_curves <- get_data(all_data, "aglu/A_resbio_curves") + A_bio_frac_prod_R <- get_data(all_data, "aglu/A_bio_frac_prod_R") + L111.ag_resbio_R_C <- get_data(all_data, "L111.ag_resbio_R_C") + L101.ag_Prod_Mt_R_C_Y_GLU <- get_data(all_data, "L101.ag_Prod_Mt_R_C_Y_GLU", strip_attributes = TRUE) + L123.For_Prod_bm3_R_Y_GLU <- get_data(all_data, "L123.For_Prod_bm3_R_Y_GLU", strip_attributes = TRUE) + + #........................ + # gcambreakout 17 July 2022 + # Temporary fix until circular dependency on + # L123.LC_bm2_R_MgdFor_Yh_GLU_beforeadjust is fixed. + #........................ + + iso_GCAM_regID <- get_data(all_data, "common/iso_GCAM_regID") + + # Valid GLU Region combos + glu_gcam <- get_data(all_data, "water/basin_to_country_mapping") %>% + dplyr::select(iso=ISO, GLU=GLU_code) %>% + dplyr::mutate(iso = tolower(iso)) %>% + dplyr::left_join(iso_GCAM_regID, by=c("iso")) %>% + dplyr::select(GLU, GCAM_region_ID) %>% + dplyr::filter(GCAM_region_ID > 32) %>% + unique(); glu_gcam + + remove_glu <- glu_gcam$GLU %>% unique(); remove_glu + + L101.ag_Prod_Mt_R_C_Y_GLU %>% + dplyr::mutate(remove = dplyr::if_else(((GLU %in% remove_glu) & (GCAM_region_ID <33)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L101.ag_Prod_Mt_R_C_Y_GLU + + #............breakout close edits + + # the following lines convert basin identification from the current GLU### level 1 names to the + # level 2 names. + L101.ag_Prod_Mt_R_C_Y_GLU %>% + replace_GLU(map = basin_to_country_mapping) -> + L101.ag_Prod_Mt_R_C_Y_GLU + + L123.For_Prod_bm3_R_Y_GLU %>% + replace_GLU(map = basin_to_country_mapping) -> + L123.For_Prod_bm3_R_Y_GLU + + # add actual region names to table A_bio_frac_prod_R for joining later + A_bio_frac_prod_R %>% + left_join_error_no_match(GCAM_region_names, by = "GCAM_region_ID") -> + A_bio_frac_prod_R + + + # Forestry and Mill residue bio + + # The function, add_bio_res_params_For_Mill, takes a data frame and adds user specified parameters and + # then repeats the resulting data frame for all MODEL_YEARS to form the AgResBio_source + # output table + add_bio_res_params_For_Mill <- function(df, residueBiomassProduction = "biomass", massConversion = aglu.AVG_WOOD_DENSITY_KGM3, + harvestIndex = aglu.FOREST_HARVEST_INDEX, erosCtrl, + massToEnergy = aglu.WOOD_ENERGY_CONTENT_GJKG, waterContent = aglu.WOOD_WATER_CONTENT) { + df %>% + mutate(residue.biomass.production = residueBiomassProduction, + mass.conversion = massConversion, + harvest.index = harvestIndex, + eros.ctrl = erosCtrl, + mass.to.energy = massToEnergy, + water.content = waterContent) %>% + repeat_add_columns(tibble(year = MODEL_YEARS)) + } # end add_bio_res_params_For_Mill + + + # 1. Form a table of Forest Residue Biomass Paramters by region-glu-year + L123.For_Prod_bm3_R_Y_GLU %>% + # Set up identifying information to fill in with parameters, incl 2. + select(GCAM_region_ID, GCAM_commodity, GLU) %>% + distinct %>% + left_join_error_no_match(GCAM_region_names, by = "GCAM_region_ID") %>% + mutate(AgSupplySector = GCAM_commodity, + AgSupplySubsector = paste(GCAM_commodity, GLU, sep = aglu.CROP_GLU_DELIMITER), + AgProductionTechnology = AgSupplySubsector) %>% + add_bio_res_params_For_Mill(erosCtrl = aglu.FOREST_EROSION_CTRL_KGM2) %>% + select(-GCAM_region_ID, -GCAM_commodity, -GLU) -> + L204.AgResBio_For + + + # 2. Form a table of global Mill Residue Biomass Paramters by year + A_demand_technology %>% + filter(supplysector == "NonFoodDemand_Forest") %>% + select(supplysector, subsector, technology) %>% + rename(sector.name = supplysector, + subsector.name = subsector) %>% + add_bio_res_params_For_Mill(erosCtrl = aglu.MILL_EROSION_CTRL_KGM2) -> + L204.GlobalResBio_Mill + + + # 3. Forestry and Mill residue supply curves + # First, the Forest and Mill information are processed and given an additional identifying column, colID. The processed + # Forest data is then bound to the processed Mill data to form a single data frame for further calculations of the supply + # curves. + # Then build in a base residue biomass supply curve table, adding in the relevant residual bio forest vs price curve for + # each Region - agsupply-year combo, and rename to reflect the fact that For = Fraction of forest harvested for a + # given price level. + L204.AgResBio_For %>% + select(region, AgSupplySector, AgSupplySubsector, AgProductionTechnology, year, residue.biomass.production) %>% + mutate(colID = "For") -> + For.tmp + + # Mill gets its OWN base resbio_curve from A_resbio_curves + L204.GlobalResBio_Mill %>% + # rename columns just for binding and working in a single pipeline + rename(AgSupplySector = sector.name, + AgSupplySubsector = subsector.name, + AgProductionTechnology = technology) %>% + select(AgSupplySector, AgSupplySubsector, AgProductionTechnology, residue.biomass.production) %>% + write_to_all_regions(names = c("region", "AgSupplySector", "AgSupplySubsector", "AgProductionTechnology", "residue.biomass.production"), + GCAM_region_names) %>% + filter(! region %in% aglu.NO_AGLU_REGIONS) %>% + repeat_add_columns(bind_cols(tibble(year = MODEL_YEARS))) %>% + mutate(colID = "Mill") %>% + # bind to processed Forest data + bind_rows(For.tmp) %>% + # join in base resbio curves + repeat_add_columns(select(A_resbio_curves, price, For, Mill)) %>% + # assign appropriate fraction harvested based on colID + mutate(fract.harvested = if_else(colID == "Mill", Mill, For)) %>% + select(-For, -Mill) -> + # store in a temporary table for further processing + For.Mill.tmp + + # In base years, replace the "fraction produced" at specified price aglu.PRICE_BIO_FRAC in the model BASE_YEAR, + # in order to calibrate resbio production. The fract.harvested for these prices-years are replaced by + # the GCAM_region's Base-year fraction of residue biomass produced by region for Forest/Mill as appropriate, + # from assumption file A_bio_frac_prod_R + For.Mill.tmp %>% + filter(price == aglu.PRICE_BIO_FRAC, year %in% MODEL_BASE_YEARS) %>% + left_join_error_no_match(select(A_bio_frac_prod_R, region, For, Mill), by = "region") %>% + select(-fract.harvested) %>% + # assign appropriate fraction harvested based on colID + mutate(fract.harvested = if_else(colID == "Mill", Mill, For)) %>% + select(-For, -Mill) %>% + bind_rows(filter(For.Mill.tmp, !( price == aglu.PRICE_BIO_FRAC & year %in% MODEL_BASE_YEARS))) -> + For.Mill.tmp2 + + # Forest + For.Mill.tmp2 %>% + filter(colID == "For") %>% + select(-colID) -> + L204.AgResBioCurve_For + + # Mill + For.Mill.tmp2 %>% + filter(colID == "Mill") %>% + select(-colID) %>% + # return correct column names + rename(supplysector = AgSupplySector, + subsector = AgSupplySubsector, + stub.technology = AgProductionTechnology) -> + L204.StubResBioCurve_Mill + + + # AGRICULTURE RESIDUE BIO + # 4. Form a table of Agricultural Residue Biomass Paramters by region-glu-year + L101.ag_Prod_Mt_R_C_Y_GLU %>% + select(GCAM_region_ID, GCAM_commodity, GCAM_subsector, GLU) %>% + distinct %>% + left_join_error_no_match(GCAM_region_names, by = "GCAM_region_ID") %>% + # have to use left_join + na.omit to match m e r g e behavior in old DS + left_join(L111.ag_resbio_R_C, by = c("GCAM_region_ID", "GCAM_commodity")) %>% + na.omit %>% + mutate(AgSupplySector = GCAM_commodity, + AgSupplySubsector = paste(GCAM_subsector, GLU, sep = aglu.CROP_GLU_DELIMITER), + AgProductionTechnology = AgSupplySubsector, + residue.biomass.production = "biomass", + # fill in parameters + mass.conversion = aglu.AVG_AG_DENSITY, + harvest.index = round(HarvestIndex, aglu.DIGITS_HARVEST_INDEX), + eros.ctrl = round(ErosCtrl_tHa * CONV_THA_KGM2, aglu.DIGITS_EROS_CTRL), + mass.to.energy = round(ResEnergy_GJt * CONV_KG_T, aglu.DIGITS_RES_ENERGY), + water.content = round(WaterContent, aglu.DIGITS_WATER_CONTENT)) %>% + repeat_add_columns(tibble(year = MODEL_YEARS)) %>% + select(region, AgSupplySector, AgSupplySubsector, AgProductionTechnology, year, residue.biomass.production, + mass.conversion, harvest.index, eros.ctrl, mass.to.energy, water.content) %>% + repeat_add_columns(tibble(Irr_Rfd = c("IRR", "RFD"))) %>% + repeat_add_columns(tibble(level = c("lo", "hi"))) %>% + mutate(AgProductionTechnology = paste(paste(AgProductionTechnology, Irr_Rfd, sep = aglu.IRR_DELIMITER), + level, sep = aglu.MGMT_DELIMITER)) %>% + select(-Irr_Rfd, -level) -> + L2042.AgResBio_ag_irr_mgmt + + # 5. Agricultural residue biomass supply curves + # Much simpler than for Mill or forest, no replacing of base year values. + L2042.AgResBio_ag_irr_mgmt %>% + select(region, AgSupplySector, AgSupplySubsector, AgProductionTechnology, year, residue.biomass.production) %>% + repeat_add_columns(select(A_resbio_curves, price, ag)) %>% + rename(fract.harvested = ag) -> + L2042.AgResBioCurve_ag_irr_mgmt + + + # Produce outputs + L204.AgResBio_For %>% + add_title("Forest residue biomass parameters") %>% + add_units("Varies") %>% + add_comments("Each GCAM region-commodity-GLU combination in L123.For_Prod_bm3_R_Y_GLU is converted ") %>% + add_comments("to a region-supplySector-supplySubsector-ProductionTech combination, and externally ") %>% + add_comments("set parameters are added to form the table of Forest residue biomass parameters for each region and year.") %>% + add_legacy_name("L2042.AgResBio_For") %>% + add_precursors("common/GCAM_region_names","common/iso_GCAM_regID", + "water/basin_to_country_mapping", + "L123.For_Prod_bm3_R_Y_GLU") -> + L2042.AgResBio_For + L204.AgResBioCurve_For %>% + add_title("Forest residue biomass supply curves") %>% + add_units("Fraction Harvested") %>% + add_comments("For each region-supplySector-supplySubsector-ProductionTech combination in L2042.AgResBio_For, ") %>% + add_comments("base supply curves are read in from A_resbio_curves and then in specified calibration years MODEL_BASE_YEARS, ") %>% + add_comments("replaced by fractions in A_bio_frac_prod_R to form the table of Forest resbio supply curves for each region and year.") %>% + add_legacy_name("L2042.AgResBioCurve_For") %>% + add_precursors("common/GCAM_region_names","common/iso_GCAM_regID", + "water/basin_to_country_mapping", + "aglu/A_resbio_curves", + "aglu/A_bio_frac_prod_R", + "L123.For_Prod_bm3_R_Y_GLU") -> + L2042.AgResBioCurve_For + + L204.GlobalResBio_Mill %>% + add_title("Global mill residue biomass parameters") %>% + add_units("Varies") %>% + add_comments("Sector, subsector, and technology combinations for NonFoodDeman_Forest are pulled from A_demand_technology, ") %>% + add_comments("and externally set parameters are added to form the table of global Mill residue biomass parameters in each year") %>% + add_legacy_name("L2042.GlobalResBio_Mill") %>% + add_precursors("water/basin_to_country_mapping","common/iso_GCAM_regID", + "aglu/A_demand_technology") -> + L2042.GlobalResBio_Mill + + L204.StubResBioCurve_Mill %>% + add_title("Mill residue biomass supply curves") %>% + add_units("Fraction harvested") %>% + add_comments("Sector, subsector, and technology combinations from L2042.GlobalResBio_Mill are repeated for each GCAM region and year, ") %>% + add_comments("base supply curves are read in from A_resbio_curves and then in specified calibration years MODEL_BASE_YEARS, ") %>% + add_comments("replaced by fractions in A_bio_frac_prod_R to form the table of Mill resbio supply curves for each region and year.") %>% + add_legacy_name("L2042.StubResBioCurve_Mill") %>% + add_precursors("common/GCAM_region_names","common/iso_GCAM_regID", + "water/basin_to_country_mapping", + "aglu/A_demand_technology", + "aglu/A_resbio_curves", + "aglu/A_bio_frac_prod_R") -> + L2042.StubResBioCurve_Mill + + L2042.AgResBio_ag_irr_mgmt %>% + add_title("Agriculture residue biomass parameters") %>% + add_units("Varies") %>% + add_comments("Each GCAM region-commodity-GLU combination in L101.ag_Prod_Mt_R_C_Y_GLU is converted ") %>% + add_comments("to a region-supplySector-supplySubsector-ProductionTech combination, and parameters from L111.ag_resbio_R_C") %>% + add_comments("are joined and rounded for each region-supplySector. These parameters are then repeated for model years, ") %>% + add_comments("irrigation types, and management technology levels.") %>% + add_legacy_name("L2042.AgResBio_ag_irr_mgmt") %>% + add_precursors("common/GCAM_region_names","common/iso_GCAM_regID", + "water/basin_to_country_mapping", + "aglu/A_demand_technology", + "aglu/A_resbio_curves", + "aglu/A_bio_frac_prod_R", + "L111.ag_resbio_R_C", + "L101.ag_Prod_Mt_R_C_Y_GLU") -> + L2042.AgResBio_ag_irr_mgmt + + L2042.AgResBioCurve_ag_irr_mgmt %>% + add_title("Agriculture residue biomass supply curves") %>% + add_units("Fraction harvested") %>% + add_comments("For each region-supplySector-supplySubsector-ProductionTech-irrigation-tech combination in L2042.AgResBio_ag_irr_mgmt, ") %>% + add_comments("base supply curves are read in from A_resbio_curves to form the table of Agriculture resbio supply curves for each region and year.") %>% + add_legacy_name("L2042.AgResBioCurve_ag_irr_mgmt") %>% + add_precursors("common/GCAM_region_names","common/iso_GCAM_regID", + "water/basin_to_country_mapping", + "aglu/A_demand_technology", + "aglu/A_resbio_curves", + "aglu/A_bio_frac_prod_R", + "L111.ag_resbio_R_C", + "L101.ag_Prod_Mt_R_C_Y_GLU") -> + L2042.AgResBioCurve_ag_irr_mgmt + + return_data(L2042.AgResBio_For, L2042.AgResBioCurve_For, L2042.GlobalResBio_Mill, L2042.StubResBioCurve_Mill, L2042.AgResBio_ag_irr_mgmt, L2042.AgResBioCurve_ag_irr_mgmt) + } else { + stop("Unknown command") + } +} diff --git a/inst/extras/zchunk_L2052.ag_prodchange_cost_irr_mgmt_breakout_gcamv6p0.R b/inst/extras/zchunk_L2052.ag_prodchange_cost_irr_mgmt_breakout_gcamv6p0.R new file mode 100644 index 0000000..52dc216 --- /dev/null +++ b/inst/extras/zchunk_L2052.ag_prodchange_cost_irr_mgmt_breakout_gcamv6p0.R @@ -0,0 +1,422 @@ +# Copyright 2019 Battelle Memorial Institute; see the LICENSE file. + +#' module_aglu_L2052.ag_prodchange_cost_irr_mgmt +#' +#' Specify production costs and future agricultural productivity changes for all technologies. +#' +#' @param command API command to execute +#' @param ... other optional parameters, depending on command +#' @return Depends on \code{command}: either a vector of required inputs, +#' a vector of output names, or (if \code{command} is "MAKE") all +#' the generated outputs: \code{L2052.AgCost_ag_irr_mgmt}, \code{L2052.AgCost_bio_irr_mgmt}, \code{L2052.AgCost_For}, \code{L2052.AgProdChange_ag_irr_ref}, \code{L2052.AgProdChange_bio_irr_ref}, \code{L2052.AgProdChange_irr_high}, \code{L2052.AgProdChange_irr_low}, \code{L2052.AgProdChange_irr_ssp4}. The corresponding file in the +#' original data system was \code{L2052.ag_prodchange_cost_irr_mgmt.R} (aglu level2). +#' @details This chunk maps the production costs of crops, biomass and forest to all four technologies (irrigated / rainfed; high / low), +#' and calculates future productivity change of crops and biomass for all technologies along reference, high, low and SSP4 scenarios. +#' @importFrom assertthat assert_that +#' @importFrom dplyr bind_rows filter mutate one_of pull select +#' @importFrom tidyr replace_na separate +#' @author RC July 2017 +module_aglu_L2052.ag_prodchange_cost_irr_mgmt <- function(command, ...) { + if(command == driver.DECLARE_INPUTS) { + return(c(FILE = "common/iso_GCAM_regID", + FILE = "common/GCAM_region_names", + FILE = "water/basin_to_country_mapping", + "L123.For_Yield_m3m2_R_GLU", + "L161.ag_irrProd_Mt_R_C_Y_GLU", + "L161.ag_rfdProd_Mt_R_C_Y_GLU", + "L162.ag_YieldRate_R_C_Y_GLU_irr", + "L162.bio_YieldRate_R_Y_GLU_irr", + "L164.ag_Cost_75USDkg_C", + "L132.ag_an_For_Prices", + "L2012.AgSupplySector", + "L201.AgYield_bio_grass", + "L201.AgYield_bio_tree", + "L102.pcgdp_thous90USD_Scen_R_Y", + "L1321.expP_R_F_75USDm3")) + } else if(command == driver.DECLARE_OUTPUTS) { + return(c("L2052.AgCost_ag_irr_mgmt", + "L2052.AgCost_bio_irr_mgmt", + "L2052.AgCost_For", + "L2052.AgProdChange_ag_irr_ref", + "L2052.AgProdChange_bio_irr_ref", + "L2052.AgProdChange_irr_high", + "L2052.AgProdChange_irr_low", + "L2052.AgProdChange_irr_ssp4")) + } else if(command == driver.MAKE) { + + all_data <- list(...)[[1]] + + names_AgTech <- names_AgCost <- names_AgProdChange <- GLU <- GLU_name <- IRR_RFD <- + MGMT <- AgSupplySector <- AgSupplySubsector <- AgProductionTechnology <- + AgProdChange <- nonLandVariableCost <- high_reg <- low_reg <- region <- + GCAM_region_ID <- year <- value <- GCAM_commodity <- Cost_75USDkg <- + Irr_Rfd <- scenario <- calPrice <- cost_PrP_ratio <- . <- GCAM_subsector <- NULL # silence package check notes + + # Load required inputs + GCAM_region_names <- get_data(all_data, "common/GCAM_region_names", strip_attributes = TRUE) + basin_to_country_mapping <- get_data(all_data, "water/basin_to_country_mapping", strip_attributes = TRUE) + L123.For_Yield_m3m2_R_GLU <- get_data(all_data, "L123.For_Yield_m3m2_R_GLU", strip_attributes = TRUE) + L161.ag_irrProd_Mt_R_C_Y_GLU <- get_data(all_data, "L161.ag_irrProd_Mt_R_C_Y_GLU", strip_attributes = TRUE) + L161.ag_rfdProd_Mt_R_C_Y_GLU <- get_data(all_data, "L161.ag_rfdProd_Mt_R_C_Y_GLU", strip_attributes = TRUE) + L162.ag_YieldRate_R_C_Y_GLU_irr <- get_data(all_data, "L162.ag_YieldRate_R_C_Y_GLU_irr", strip_attributes = TRUE) + L162.bio_YieldRate_R_Y_GLU_irr <- get_data(all_data, "L162.bio_YieldRate_R_Y_GLU_irr", strip_attributes = TRUE) + L164.ag_Cost_75USDkg_C <- get_data(all_data, "L164.ag_Cost_75USDkg_C", strip_attributes = TRUE) + L132.ag_an_For_Prices <- get_data(all_data, "L132.ag_an_For_Prices", strip_attributes = TRUE) + L2012.AgSupplySector <- get_data(all_data, "L2012.AgSupplySector", strip_attributes = TRUE) + L201.AgYield_bio_grass <- get_data(all_data, "L201.AgYield_bio_grass", strip_attributes = TRUE) + L201.AgYield_bio_tree <- get_data(all_data, "L201.AgYield_bio_tree", strip_attributes = TRUE) + L102.pcgdp_thous90USD_Scen_R_Y <- get_data(all_data, "L102.pcgdp_thous90USD_Scen_R_Y", strip_attributes = TRUE) + L1321.expP_R_F_75USDm3 <- get_data(all_data, "L1321.expP_R_F_75USDm3", strip_attributes = TRUE) + + # Define column names + names_AgTech <- LEVEL2_DATA_NAMES[["AgTech"]] + names_AgCost <- LEVEL2_DATA_NAMES[["AgCost"]] + names_AgProdChange <- LEVEL2_DATA_NAMES[["AgProdChange"]] + + # Production costs + # Assign nonLandVariableCost of crop production, assuming the same level to all four technologies + # Start with the L161 production tables to specify which region / GLU / crop will need costs assigned + L161.ag_irrProd_Mt_R_C_Y_GLU %>% + mutate(IRR_RFD = "IRR") %>% + bind_rows(mutate(L161.ag_rfdProd_Mt_R_C_Y_GLU, IRR_RFD = "RFD")) %>% + select(GCAM_region_ID, GCAM_commodity, GCAM_subsector, GLU, IRR_RFD) %>% + unique() %>% + # Map in costs data, same level for irrigated and rainfed + left_join_error_no_match(L164.ag_Cost_75USDkg_C, by = "GCAM_commodity") %>% + mutate(nonLandVariableCost = round(Cost_75USDkg, aglu.DIGITS_CALPRICE)) %>% + # Copy costs to high and low management levels + repeat_add_columns(tibble(MGMT = c("hi", "lo"))) %>% + left_join_error_no_match(GCAM_region_names, by = "GCAM_region_ID") %>% + left_join_error_no_match(basin_to_country_mapping[c("GLU_code", "GLU_name")], by = c("GLU" = "GLU_code")) %>% + # Add sector, subsector, technology names + mutate(AgSupplySector = GCAM_commodity, + AgSupplySubsector = paste(GCAM_subsector, GLU_name, sep = aglu.CROP_GLU_DELIMITER), + AgProductionTechnology = paste(paste(AgSupplySubsector, IRR_RFD, sep = aglu.IRR_DELIMITER), + MGMT, sep = aglu.MGMT_DELIMITER)) %>% + # Copy costs to all model years + repeat_add_columns(tibble(year = MODEL_YEARS)) %>% + select(names_AgCost) -> + L2052.AgCost_ag_irr_mgmt + + # 2/14/2019 ag trade modification (GPK): These costs need to be modified in order to accommodate any crops with + # regional markets, whose prices differ from the default (USA-based) assumptions for global markets. Failure to + # take this into account will result in inconsistency between cost assumptions (which are based on the USA) and + # crop prices, which may return distorted and potentially negative profit rates. + + # 9/23/2019 modification - the producer price data in L132 comes from a direct query of the "United States of + # America" country in FAOSTAT, whereas the L1321 and L2012 data come from a global query with regions mapped + # according to AGLU_ctry. For this reason, the latter datasets include Puerto Rico within the USA region. This + # causes a mismatch in computing costs and prices, and can lead to negative profit rates for crops that (a) tend to + # be grown in Puerto Rico, and (b) have lower producer prices in Puerto Rico than in the USA. + + # Specifically, the method applies the cost:price ratio of each crop in the USA to each crop in all regions + L132.ag_an_For_Prices %>% filter(GCAM_commodity %in% L164.ag_Cost_75USDkg_C$GCAM_commodity) %>% + mutate(region = gcam.USA_REGION) %>% + select(region, GCAM_commodity, calPrice) %>% + left_join_error_no_match(L164.ag_Cost_75USDkg_C, by = "GCAM_commodity") %>% + mutate(cost_PrP_ratio = Cost_75USDkg / calPrice) %>% + select(AgSupplySector = GCAM_commodity, cost_PrP_ratio)->L2052.AgCostRatio_USA + + L2052.AgCost_ag_irr_mgmt <- left_join_error_no_match(L2052.AgCost_ag_irr_mgmt, L2052.AgCostRatio_USA, + by = "AgSupplySector") %>% + left_join_error_no_match(select(L2012.AgSupplySector, region, AgSupplySector, calPrice), + by = c("region", "AgSupplySector")) %>% + mutate(nonLandVariableCost = round(calPrice * cost_PrP_ratio, aglu.DIGITS_CALPRICE)) %>% + select(LEVEL2_DATA_NAMES[["AgCost"]]) + + # Assign nonLandVariableCost of bioenergy production, assuming the same level to all four technologies + # Start with the yield table to determine where bioenergy crops are being read in, get both grass and tree crops + L201.AgYield_bio_grass %>% + select(names_AgTech) %>% + unique() %>% + bind_rows(unique(select(L201.AgYield_bio_tree, one_of(names_AgTech)))) %>% + mutate(nonLandVariableCost = aglu.BIO_GRASS_COST_75USD_GJ, + nonLandVariableCost = replace(nonLandVariableCost, grepl("Tree", AgProductionTechnology), + aglu.BIO_TREE_COST_75USD_GJ)) %>% + # Copy coefficients to all four technologies + repeat_add_columns(tibble(IRR_RFD = c("IRR", "RFD"))) %>% + repeat_add_columns(tibble(MGMT = c("hi", "lo"))) %>% + # Revise technology names, adding info of irr/rfd and hi/lo + mutate(AgProductionTechnology = paste(AgProductionTechnology, IRR_RFD, MGMT, sep = "_")) %>% + # Copy costs to all model years + repeat_add_columns(tibble(year = MODEL_YEARS)) %>% + select(names_AgCost) -> + L2052.AgCost_bio_irr_mgmt + + # Assign nonLandVariableCost of forest production + # Start with the yield table to determine where forest are being read in + # Differentiate regional cost for forest using aglu.FOR_COST_SHARE in constants.R + L123.For_Yield_m3m2_R_GLU %>% + select(GCAM_region_ID, GCAM_commodity, GLU) %>% + unique() %>% + # Copy costs to all model years + repeat_add_columns(tibble(year = MODEL_YEARS)) %>% + left_join_error_no_match(GCAM_region_names, by = "GCAM_region_ID") %>% + left_join_error_no_match(basin_to_country_mapping[c("GLU_code", "GLU_name")], by = c("GLU" = "GLU_code")) %>% + # Add sector, subsector, technology names + mutate(AgSupplySector = GCAM_commodity, + AgSupplySubsector = paste(GCAM_commodity, GLU_name, sep = aglu.CROP_GLU_DELIMITER), + AgProductionTechnology = AgSupplySubsector) %>% + left_join(L132.ag_an_For_Prices, by = "GCAM_commodity") %>% + left_join(L1321.expP_R_F_75USDm3, by = c("GCAM_region_ID", "GCAM_commodity")) %>% + mutate(nonLandVariableCost = if_else(is.na(value), + calPrice * aglu.FOR_COST_SHARE, + value * aglu.FOR_COST_SHARE) ) %>% + select(names_AgCost) -> + L2052.AgCost_For + # Future agricultural productivity changes + # Specify reference scenario agricultural productivity change for crops (not incl biomass) + L162.ag_YieldRate_R_C_Y_GLU_irr %>% + filter(year %in% MODEL_FUTURE_YEARS) %>% + mutate(AgProdChange = round(value, digits = aglu.DIGITS_AGPRODCHANGE)) %>% + # If the final calibration year is less than the final historical year, + # this method will return Inf for crops that are 0 in one year, + # and non-zero in subsequent years (e.g. Korea and FSU FodderGrass). + # Set the Inf to 0, and keep the technologies out. + mutate(AgProdChange = replace(AgProdChange, AgProdChange == Inf, 0)) %>% + # Copy costs to high and low management levels + repeat_add_columns(tibble(MGMT = c("hi", "lo"))) %>% + left_join_error_no_match(GCAM_region_names, by = "GCAM_region_ID") %>% + left_join_error_no_match(basin_to_country_mapping[c("GLU_code", "GLU_name")], by = c("GLU" = "GLU_code")) %>% + # Add sector, subsector, technology names + mutate(AgSupplySector = GCAM_commodity, + AgSupplySubsector = paste(GCAM_subsector, GLU_name, sep = aglu.CROP_GLU_DELIMITER), + AgProductionTechnology = paste(paste(AgSupplySubsector, Irr_Rfd, sep = aglu.IRR_DELIMITER), + MGMT, sep = aglu.MGMT_DELIMITER)) %>% + select(names_AgProdChange) -> + L2052.AgProdChange_ag_irr_ref + + # Specify reference scenario agricultural productivity change for biomass + L162.bio_YieldRate_R_Y_GLU_irr %>% + filter(year %in% MODEL_FUTURE_YEARS) %>% + mutate(AgProdChange = round(value, digits = aglu.DIGITS_AGPRODCHANGE)) %>% + left_join_error_no_match(GCAM_region_names, by = "GCAM_region_ID") %>% + left_join_error_no_match(basin_to_country_mapping[c("GLU_code", "GLU_name")], by = c("GLU" = "GLU_code")) -> + L2051.AgProdChange_bio_irr_ref + + # Use the yield table to determine where bioenergy crops are being read in, get both grass and tree crops + L201.AgYield_bio_grass %>% + select(names_AgTech) %>% + unique() %>% + bind_rows(unique(select(L201.AgYield_bio_tree, one_of(names_AgTech)))) %>% + # Copy to all future years + repeat_add_columns(tibble(year = MODEL_FUTURE_YEARS)) %>% + # Copy to both irrigated and rainfed technologies + repeat_add_columns(tibble(IRR_RFD = c("IRR", "RFD"))) %>% + # Separate the AgProductionTechnology variable to get GLU names for matching in the yield change rates + separate(AgProductionTechnology, c("biomass", "GLU_name"), sep = aglu.CROP_GLU_DELIMITER) %>% + # Map in yield change rates, the same values for bioenergy crops are applied equally to grass and tree crops. + left_join(L2051.AgProdChange_bio_irr_ref[c("region", "GLU_name", "Irr_Rfd", "year", "AgProdChange")], + by = c("region", "GLU_name", "IRR_RFD" = "Irr_Rfd", "year")) %>% + # Note: Grass crops are available in any land use regions with crop production, and tree crops are available in any region with forests. + # Because the yield growth rates are based on crops, some places that have forests but no cropland will not have yield improvement rates. + # These regions are assumed minor agriculturally and as such not assigned yield improvement for tree-based bioenergy crops. + replace_na(list(AgProdChange = 0)) %>% + # Copy coefficients to high and low management levels + repeat_add_columns(tibble(MGMT = c("hi", "lo"))) %>% + # Revise technology names to add all technologies + mutate(AgProductionTechnology = paste(paste(AgSupplySubsector, IRR_RFD, sep = aglu.CROP_GLU_DELIMITER), + MGMT, sep = aglu.MGMT_DELIMITER)) %>% + select(names_AgProdChange) -> + L2052.AgProdChange_bio_irr_ref + + # Specify the scenario with high agricultural productivity change (not incl biomass) + L2052.AgProdChange_ag_irr_ref %>% + # Use the high growth multiplier + mutate(AgProdChange = AgProdChange * aglu.HI_PROD_GROWTH_MULT) -> + L2052.AgProdChange_irr_high + + # Specify the scenario with low agricultural productivity change (not incl biomass) + L2052.AgProdChange_ag_irr_ref %>% + # Use the low growth multiplier + mutate(AgProdChange = AgProdChange * aglu.LOW_PROD_GROWTH_MULT) -> + L2052.AgProdChange_irr_low + + # Specify the SSP4 scenario with diverging agricultural productivity change + # between high, median, and low income regions (not incl biomass) + + # Get the region list of high income countries + get_ssp_regions(L102.pcgdp_thous90USD_Scen_R_Y, GCAM_region_names, "high") -> + high_reg + # Get the region list of low income countries + get_ssp_regions(L102.pcgdp_thous90USD_Scen_R_Y, GCAM_region_names, "low") -> + low_reg + + # Assign the reference agricultural productivity change to median income countries, + # high change to high income regions, and low change to low income regions + L2052.AgProdChange_ag_irr_ref %>% + filter(!region %in% c(high_reg, low_reg)) %>% + bind_rows(filter(L2052.AgProdChange_irr_high, region %in% high_reg), + filter(L2052.AgProdChange_irr_low, region %in% low_reg)) -> + L2052.AgProdChange_irr_ssp4 + + #........................ + # gcambreakout 17 July 2022 + # Temporary fix until circular dependency on + # L123.LC_bm2_R_MgdFor_Yh_GLU_beforeadjust is fixed. + #........................ + + iso_GCAM_regID <- get_data(all_data, "common/iso_GCAM_regID") + + + # Valid GLU Region combos + glu_gcam <- basin_to_country_mapping %>% + dplyr::select(iso=ISO, GLU=GLU_code, GLU_name) %>% + dplyr::mutate(iso = tolower(iso)) %>% + dplyr::left_join(iso_GCAM_regID, by=c("iso")) %>% + dplyr::select(GLU, GCAM_region_ID, GLU_name) %>% + dplyr::filter(GCAM_region_ID > 32) %>% + unique() %>% + dplyr::left_join(GCAM_region_names); glu_gcam + + remove_glu <- glu_gcam$GLU_name %>% unique(); remove_glu + regions_check <- GCAM_region_names$region[!GCAM_region_names$region %in% glu_gcam$region]; regions_check + + # Produce outputs + L2052.AgCost_ag_irr_mgmt %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2052.AgCost_ag_irr_mgmt + + L2052.AgCost_bio_irr_mgmt %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2052.AgCost_bio_irr_mgmt + + L2052.AgCost_For %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2052.AgCost_For + + L2052.AgProdChange_ag_irr_ref %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2052.AgProdChange_ag_irr_ref + + L2052.AgProdChange_bio_irr_ref %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2052.AgProdChange_bio_irr_ref + + L2052.AgProdChange_irr_high %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2052.AgProdChange_irr_high + + L2052.AgProdChange_irr_low %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2052.AgProdChange_irr_low + + L2052.AgProdChange_irr_ssp4 %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2052.AgProdChange_irr_ssp4 + + #............................gcambreakout close edits + + # Produce outputs + L2052.AgCost_ag_irr_mgmt %>% + add_title("Non-land variable costs of crops prodction by region / crop / GLU / technology") %>% + add_units("1975$ per kg") %>% + add_comments("The same costs are assigned to all four technologies") %>% + add_legacy_name("L2052.AgCost_ag_irr_mgmt") %>% + add_precursors("common/GCAM_region_names", + "common/iso_GCAM_regID", + "water/basin_to_country_mapping", + "L161.ag_irrProd_Mt_R_C_Y_GLU", + "L161.ag_rfdProd_Mt_R_C_Y_GLU", + "L164.ag_Cost_75USDkg_C", + "L132.ag_an_For_Prices", + "L2012.AgSupplySector") -> + L2052.AgCost_ag_irr_mgmt + + L2052.AgCost_bio_irr_mgmt %>% + add_title("Non-land variable costs of biomass crops production by region / crop / GLU / technology") %>% + add_units("1975$ per kg") %>% + add_comments("The same costs are assigned to all four technologies") %>% + add_legacy_name("L2052.AgCost_bio_irr_mgmt") %>% + add_precursors("L201.AgYield_bio_grass", + "L201.AgYield_bio_tree") -> + L2052.AgCost_bio_irr_mgmt + + L2052.AgCost_For %>% + add_title("Non-land variable costs of forest prodction by region / GLU") %>% + add_units("1975$ per kg") %>% + add_comments("Technologies are not specified for forest") %>% + add_legacy_name("L2052.AgCost_For") %>% + add_precursors("common/GCAM_region_names", + "common/iso_GCAM_regID", + "water/basin_to_country_mapping", + "L123.For_Yield_m3m2_R_GLU", + "L1321.expP_R_F_75USDm3") -> + L2052.AgCost_For + + L2052.AgProdChange_ag_irr_ref %>% + add_title("Reference agricultural productivity change of crops by region / crop / GLU / technology") %>% + add_units("Unitless") %>% + add_comments("The same productivity change are assigned to both high and low management") %>% + add_legacy_name("L2052.AgProdChange_ag_irr_ref") %>% + add_precursors("water/basin_to_country_mapping", "common/iso_GCAM_regID", + "L162.ag_YieldRate_R_C_Y_GLU_irr") -> + L2052.AgProdChange_ag_irr_ref + + L2052.AgProdChange_bio_irr_ref %>% + add_title("Reference agricultural productivity change of biomass crops by region / crop / GLU / technology") %>% + add_units("Unitless") %>% + add_comments("The same productivity change are assigned to both high and low management") %>% + add_legacy_name("L2052.AgProdChange_bio_irr_ref") %>% + add_precursors("L162.bio_YieldRate_R_Y_GLU_irr", + "L201.AgYield_bio_grass", + "L201.AgYield_bio_tree") -> + L2052.AgProdChange_bio_irr_ref + + L2052.AgProdChange_irr_high %>% + add_title("High agricultural productivity change of crops by region / crop / GLU / technology") %>% + add_units("Unitless") %>% + add_comments("Multiply reference productivity change with the high growth rate multiplier") %>% + add_comments("The same productivity change are assigned to both high and low management") %>% + add_legacy_name("L2052.AgProdChange_irr_high") %>% + same_precursors_as("L2052.AgProdChange_ag_irr_ref") %>% + add_precursors("L102.pcgdp_thous90USD_Scen_R_Y") -> + L2052.AgProdChange_irr_high + + L2052.AgProdChange_irr_low %>% + add_title("Low agricultural productivity change of crops by region / crop / GLU / technology") %>% + add_units("Unitless") %>% + add_comments("Multiply reference productivity change with the low growth rate multiplier") %>% + add_comments("The same productivity change are assigned to both high and low management") %>% + add_legacy_name("L2052.AgProdChange_irr_low") %>% + same_precursors_as("L2052.AgProdChange_ag_irr_ref") %>% + add_precursors( "common/iso_GCAM_regID","L102.pcgdp_thous90USD_Scen_R_Y") -> + L2052.AgProdChange_irr_low + + L2052.AgProdChange_irr_ssp4 %>% + add_title("SSP4 agricultural productivity change of crops by region / crop / GLU / technology") %>% + add_units("Unitless") %>% + add_comments("Assign reference productivity change to median income regions") %>% + add_comments("Assign high productivity change to high income regions") %>% + add_comments("Assign low productivity change to low income regions") %>% + add_comments("Region groups by income level are based on the 2010 GDP per capita") %>% + add_legacy_name("L2052.AgProdChange_irr_ssp4") %>% + same_precursors_as("L2052.AgProdChange_ag_irr_ref") %>% + add_precursors( "common/iso_GCAM_regID","L102.pcgdp_thous90USD_Scen_R_Y") -> + L2052.AgProdChange_irr_ssp4 + + return_data(L2052.AgCost_ag_irr_mgmt, L2052.AgCost_bio_irr_mgmt, + L2052.AgCost_For, + L2052.AgProdChange_ag_irr_ref, L2052.AgProdChange_bio_irr_ref, + L2052.AgProdChange_irr_high, L2052.AgProdChange_irr_low, + L2052.AgProdChange_irr_ssp4) + } else { + stop("Unknown command") + } +} diff --git a/inst/extras/zchunk_L2062.ag_Fert_irr_mgmt_breakout_gcamv6p0.R b/inst/extras/zchunk_L2062.ag_Fert_irr_mgmt_breakout_gcamv6p0.R new file mode 100644 index 0000000..a6b81a0 --- /dev/null +++ b/inst/extras/zchunk_L2062.ag_Fert_irr_mgmt_breakout_gcamv6p0.R @@ -0,0 +1,228 @@ +# Copyright 2019 Battelle Memorial Institute; see the LICENSE file. + +#' module_aglu_L2062.ag_Fert_irr_mgmt +#' +#' Specifies fertilizer coefficients for all technologies; adjusts nonLandVariableCost to remove fertilizer cost. +#' +#' @param command API command to execute +#' @param ... other optional parameters, depending on command +#' @return Depends on \code{command}: either a vector of required inputs, +#' a vector of output names, or (if \code{command} is "MAKE") all +#' the generated outputs: \code{L2062.AgCoef_Fert_ag_irr_mgmt}, \code{L2062.AgCoef_Fert_bio_irr_mgmt}, \code{L2062.AgCost_ag_irr_mgmt_adj}, \code{L2062.AgCost_bio_irr_mgmt_adj}. The corresponding file in the +#' original data system was \code{L2062.ag_Fert_irr_mgmt.R} (aglu level2). +#' @details This chunk maps the fertilizer coefficients calculated in LB142 to all agricultural technologies. +#' We assume coefficients (in kgN per kgCrop) are equal for all four technologies (irr v rfd; hi v lo). +#' Adjust nonLandVariableCost to remove the now explicitly computed fertilizer cost. +#' @importFrom assertthat assert_that +#' @importFrom dplyr bind_rows filter if_else left_join mutate select +#' @importFrom tidyr replace_na +#' @importFrom tibble tibble +#' @author KVC June 2017 +module_aglu_L2062.ag_Fert_irr_mgmt <- function(command, ...) { + if(command == driver.DECLARE_INPUTS) { + return(c( FILE = "common/GCAM_region_names", + FILE = "common/iso_GCAM_regID", + FILE = "water/basin_to_country_mapping", + FILE = "aglu/A_Fodderbio_chars", + "L142.ag_Fert_IO_R_C_Y_GLU", + "L2052.AgCost_ag_irr_mgmt", + "L2052.AgCost_bio_irr_mgmt")) + } else if(command == driver.DECLARE_OUTPUTS) { + return(c("L2062.AgCoef_Fert_ag_irr_mgmt", + "L2062.AgCoef_Fert_bio_irr_mgmt", + "L2062.AgCost_ag_irr_mgmt_adj", + "L2062.AgCost_bio_irr_mgmt_adj")) + } else if(command == driver.MAKE) { + + all_data <- list(...)[[1]] + + year <- value <- GCAM_region_ID <- GCAM_commodity <- GLU <- GLU_name <- IRR_RFD <- + MGMT <- region <- AgSupplySector <- AgSupplySubsector <- AgProductionTechnology <- + minicam.energy.input <- coefficient <- WaterContent <- nonLandVariableCost <- + FertCost <- GCAM_subsector <- NULL # silence package check notes + + # Load required inputs + GCAM_region_names <- get_data(all_data, "common/GCAM_region_names") + basin_to_country_mapping <- get_data(all_data, "water/basin_to_country_mapping") + A_Fodderbio_chars <- get_data(all_data, "aglu/A_Fodderbio_chars") + L142.ag_Fert_IO_R_C_Y_GLU <- get_data(all_data, "L142.ag_Fert_IO_R_C_Y_GLU", strip_attributes = TRUE) + L2052.AgCost_ag_irr_mgmt <- get_data(all_data, "L2052.AgCost_ag_irr_mgmt", strip_attributes = TRUE) + L2052.AgCost_bio_irr_mgmt <- get_data(all_data, "L2052.AgCost_bio_irr_mgmt", strip_attributes = TRUE) + + #........................ + # gcambreakout 17 July 2022 + # Temporary fix until circular dependency on + # L123.LC_bm2_R_MgdFor_Yh_GLU_beforeadjust is fixed. + #........................ + + iso_GCAM_regID <- get_data(all_data, "common/iso_GCAM_regID") + basin_to_country_mapping <- get_data(all_data, "water/basin_to_country_mapping") + GCAM_region_names <- get_data(all_data, "common/GCAM_region_names") + + # Valid GLU Region combos + glu_gcam <- basin_to_country_mapping %>% + dplyr::select(iso=ISO, GLU=GLU_code, GLU_name) %>% + dplyr::mutate(iso = tolower(iso)) %>% + dplyr::left_join(iso_GCAM_regID, by=c("iso")) %>% + dplyr::select(GLU, GCAM_region_ID, GLU_name) %>% + dplyr::filter(GCAM_region_ID > 32) %>% + unique() %>% + dplyr::left_join(GCAM_region_names); glu_gcam + + remove_glu <- glu_gcam$GLU_name %>% unique(); remove_glu + remove_glu_id <- glu_gcam$GLU %>% unique(); remove_glu_id + regions_check <- GCAM_region_names$region[!GCAM_region_names$region %in% glu_gcam$region]; regions_check + regions_check_id <- GCAM_region_names$GCAM_region_ID[!GCAM_region_names$GCAM_region_ID %in% glu_gcam$GCAM_region_ID]; regions_check_id + + L2052.AgCost_ag_irr_mgmt %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2052.AgCost_ag_irr_mgmt + + L2052.AgCost_bio_irr_mgmt %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2052.AgCost_bio_irr_mgmt + + L142.ag_Fert_IO_R_C_Y_GLU %>% + dplyr::mutate(remove = dplyr::if_else(((GLU %in% remove_glu_id) & (GCAM_region_ID %in% regions_check_id)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L142.ag_Fert_IO_R_C_Y_GLU + + #................ gcambreakout close edits + + # Process Fertilizer Coefficients: Copy coefficients to all four technologies (irr/rfd + hi/lo) + L142.ag_Fert_IO_R_C_Y_GLU %>% + filter(year %in% MODEL_BASE_YEARS) %>% + left_join_error_no_match(GCAM_region_names, by = "GCAM_region_ID") %>% + left_join_error_no_match(basin_to_country_mapping[ c("GLU_code", "GLU_name")], by = c("GLU" = "GLU_code")) %>% + + # Copy coefficients to all four technologies + repeat_add_columns(tibble(IRR_RFD = c("IRR", "RFD"))) %>% + repeat_add_columns(tibble(MGMT = c("hi", "lo"))) %>% + + # Add sector, subsector, technology names + mutate(AgSupplySector = GCAM_commodity, + AgSupplySubsector = paste(GCAM_subsector, GLU_name, sep = aglu.CROP_GLU_DELIMITER), + AgProductionTechnology = paste(paste(AgSupplySubsector, IRR_RFD, sep = aglu.IRR_DELIMITER), + MGMT, sep = aglu.MGMT_DELIMITER)) %>% + + # Add name of minicam.energy.input + mutate(minicam.energy.input = "N fertilizer") %>% + rename(coefficient = value) %>% + select(region, AgSupplySector, AgSupplySubsector, AgProductionTechnology, minicam.energy.input, year, coefficient) -> + L2062.AgCoef_Fert_ag_irr_mgmt + + # Copy final base year coefficients to all future years, bind with historic coefficients, then remove zeroes + # Note: this assumes constant fertilizer coefficients in the future + L2062.AgCoef_Fert_ag_irr_mgmt %>% + filter(year == max(MODEL_BASE_YEARS)) %>% + select(-year) %>% + repeat_add_columns(tibble(year = MODEL_FUTURE_YEARS)) %>% + bind_rows(L2062.AgCoef_Fert_ag_irr_mgmt) %>% + filter(coefficient > 0) -> + L2062.AgCoef_Fert_ag_irr_mgmt + + # Calculate fertilizer coefficients for grassy bioenergy crops + A_Fodderbio_chars %>% + filter(GCAM_commodity == "biomassGrass") %>% + mutate(coefficient = (aglu.BIO_GRASS_FERT_IO_GNM2 * CONV_G_KG / aglu.BIO_GRASS_YIELD_KGCM2 # Convert from application per unit area to per unit carbon + * aglu.CCONTENT_CELLULOSE * (1 - WaterContent)) # Convert from carbon to wet biomass + / (aglu.BIO_ENERGY_CONTENT_GJT * CONV_KG_T)) -> # Convert from biomass to energy + bio_grass_coef + + # Calculate fertilizer coefficients for tree bioenergy crops + A_Fodderbio_chars %>% + filter(GCAM_commodity == "biomassTree") %>% + mutate(coefficient = (aglu.BIO_TREE_FERT_IO_GNM2 * CONV_G_KG / aglu.BIO_TREE_YIELD_KGCM2 # Convert from application per unit area to per unit carbon + * aglu.CCONTENT_CELLULOSE * (1 - WaterContent)) # Convert from carbon to wet biomass + / (aglu.BIO_ENERGY_CONTENT_GJT * CONV_KG_T)) -> # Convert from biomass to energy + bio_tree_coef + + # Map fertilizer coefficients to all bioenergy technologies + L2052.AgCost_bio_irr_mgmt %>% + select(-nonLandVariableCost) %>% # We are just using this data.frame to get the region/sector/tech names + mutate(minicam.energy.input = "N fertilizer", + coefficient = if_else(grepl("^biomassGrass", AgSupplySubsector), + bio_grass_coef$coefficient, bio_tree_coef$coefficient)) -> + L2062.AgCoef_Fert_bio_irr_mgmt + + # Adjust nonLandVariableCost to separate fertilizer cost (which is accounted for specifically) + L2052.AgCost_ag_irr_mgmt %>% + # Note: using left_join because there are instances with cost but no fertilizer use. + left_join(L2062.AgCoef_Fert_ag_irr_mgmt, + by = c("region", "AgSupplySector", "AgSupplySubsector", "AgProductionTechnology", "year")) %>% + + # Set fertilizer coefficient to zero when missing. This will lead to zero fertilizer cost. + replace_na(list(coefficient = 0)) %>% + + # Calculate fertilizer cost using a fixed value (specified in constants.R in current $ per ton of NH3) + # and the fertilizer coefficient calculated above. Subtract from original nonLandVariableCost. + mutate(FertCost = coefficient * aglu.FERT_PRICE * gdp_deflator(1975, aglu.FERT_PRICE_YEAR) * CONV_KG_T / CONV_NH3_N, + nonLandVariableCost = round(nonLandVariableCost - FertCost, aglu.DIGITS_CALPRICE)) %>% + select(-minicam.energy.input, -coefficient, -FertCost) -> + L2062.AgCost_ag_irr_mgmt_adj + + # Adjust nonLandVariableCost to separate fertilizer cost (which is accounted for specifically) + L2052.AgCost_bio_irr_mgmt %>% + # Note: using left_join because there are instances with cost but no fertilizer use + left_join(L2062.AgCoef_Fert_bio_irr_mgmt, + by = c("region", "AgSupplySector", "AgSupplySubsector", "AgProductionTechnology", "year")) %>% + + # Set fertilizer coefficient to zero when missing. This will lead to zero fertilizer cost. + replace_na(list(coefficient = 0)) %>% + + # Calculate fertilizer cost using a fixed value (specified in constants.R in 2007$ per ton of NH3) + # and the fertilizer coefficient calculated above. Subtract from original nonLandVariableCost. + mutate(FertCost = coefficient * aglu.FERT_PRICE * gdp_deflator(1975, 2007) * CONV_KG_T / CONV_NH3_N, + nonLandVariableCost = round(nonLandVariableCost - FertCost, aglu.DIGITS_CALPRICE)) %>% + select(-minicam.energy.input, -coefficient, -FertCost) -> + L2062.AgCost_bio_irr_mgmt_adj + + # Produce outputs + L2062.AgCoef_Fert_ag_irr_mgmt %>% + add_title("Fertilizer coefficients for agricultural technologies") %>% + add_units("kgN per kg crop") %>% + add_comments("Map fertilizer coefficients in L142.ag_Fert_IO_R_C_Y_GLU to all technologies") %>% + add_comments("Note: we are using the same coefficient for all four management technologies (irrigated, rainfed, hi and lo") %>% + add_legacy_name("L2062.AgCoef_Fert_ag_irr_mgmt") %>% + add_precursors("common/GCAM_region_names", + "water/basin_to_country_mapping","common/iso_GCAM_regID", + "L142.ag_Fert_IO_R_C_Y_GLU") -> + L2062.AgCoef_Fert_ag_irr_mgmt + L2062.AgCoef_Fert_bio_irr_mgmt %>% + add_title("Fertilizer coefficients for bioenergy technologies") %>% + add_units("kgN per GJ") %>% + add_comments("Compute bioenergy fertilizer coefficients from read-in constants") %>% + add_comments("Note: L2052.AgCost_bio_irr_mgmt is only used to identify all bioenergy technologies") %>% + add_legacy_name("L2062.AgCoef_Fert_bio_irr_mgmt") %>% + add_precursors("aglu/A_Fodderbio_chars", + "L2052.AgCost_bio_irr_mgmt") -> + L2062.AgCoef_Fert_bio_irr_mgmt + L2062.AgCost_ag_irr_mgmt_adj %>% + add_title("Adjusted non-land variable cost for agricultural technologies") %>% + add_units("1975$ per kg") %>% + add_comments("Subtract cost of fertilizer from non-land variable cost.") %>% + add_comments("Fertilizer costs is computed using a fixed NH3 cost and the fertilizer coefficient") %>% + add_legacy_name("L2062.AgCost_ag_irr_mgmt_adj") %>% + same_precursors_as(L2062.AgCoef_Fert_ag_irr_mgmt) %>% + add_precursors("L2052.AgCost_ag_irr_mgmt") -> + L2062.AgCost_ag_irr_mgmt_adj + L2062.AgCost_bio_irr_mgmt_adj %>% + add_title("Adjusted non-land variable cost for agricultural technologies") %>% + add_units("1975$ per GJ") %>% + add_comments("Subtract cost of fertilizer from non-land variable cost.") %>% + add_comments("Fertilizer costs is computed using a fixed NH3 cost and the fertilizer coefficient") %>% + add_legacy_name("L2062.AgCost_bio_irr_mgmt_adj") %>% + same_precursors_as(L2062.AgCoef_Fert_bio_irr_mgmt) %>% + add_precursors("L2052.AgCost_bio_irr_mgmt") -> + L2062.AgCost_bio_irr_mgmt_adj + + return_data(L2062.AgCoef_Fert_ag_irr_mgmt, L2062.AgCoef_Fert_bio_irr_mgmt, L2062.AgCost_ag_irr_mgmt_adj, L2062.AgCost_bio_irr_mgmt_adj) + } else { + stop("Unknown command") + } +} diff --git a/inst/extras/zchunk_L2072.ag_water_irr_mgmt_breakout_gcamv6p0.R b/inst/extras/zchunk_L2072.ag_water_irr_mgmt_breakout_gcamv6p0.R new file mode 100644 index 0000000..399dc91 --- /dev/null +++ b/inst/extras/zchunk_L2072.ag_water_irr_mgmt_breakout_gcamv6p0.R @@ -0,0 +1,428 @@ +# Copyright 2019 Battelle Memorial Institute; see the LICENSE file. + +#' module_aglu_L2072.ag_water_irr_mgmt +#' +#' Calculate agriculture water Input-Output coefficients by region / crop / year / GLU / technology. +#' +#' @param command API command to execute +#' @param ... other optional parameters, depending on command +#' @return Depends on \code{command}: either a vector of required inputs, a vector of output names, or (if +#' \code{command} is "MAKE") all the generated outputs: \code{L2071.AgCoef_IrrBphysWater_ag_mgmt}, +#' \code{L2072.AgCoef_IrrWaterWdraw_ag_mgmt}, \code{L2072.AgCoef_IrrWaterCons_ag_mgmt}, +#' \code{L2072.AgCoef_RfdBphysWater_ag_mgmt}, \code{L2072.AgCoef_BphysWater_bio_mgmt}, +#' \code{L2072.AgCoef_IrrWaterWdraw_bio_mgmt}, \code{L2072.AgCoef_IrrWaterCons_bio_mgmt}, +#' \code{L2072.AgNonEnergyCost_IrrWaterWdraw}. The corresponding file in the original data system was +#' \code{L2072.ag_water_irr_mgmt.R} (aglu level2). +#' @details This chunk calculates the Input-Output coefficients of irrigation water withdrawals and consumption, and +#' biophysical water consumption of irrigated and rainfed crops, for each primary and dedicated bioenergy crop by +#' region / year / GLU / management level. +#' @importFrom assertthat assert_that +#' @importFrom dplyr bind_rows filter full_join group_by if_else left_join mutate right_join select semi_join summarise +#' @importFrom tidyr complete nesting replace_na separate +#' @importFrom tibble tibble +#' @author RC July 2017 +module_aglu_L2072.ag_water_irr_mgmt <- function(command, ...) { + if(command == driver.DECLARE_INPUTS) { + return(c(FILE = "common/GCAM_region_names", + FILE = "water/basin_to_country_mapping", + "L2012.AgSupplySector", + "L161.ag_irrProd_Mt_R_C_Y_GLU", + "L161.ag_rfdProd_Mt_R_C_Y_GLU", + "L165.BlueIrr_m3kg_R_C_GLU", + "L165.TotIrr_m3kg_R_C_GLU", + "L165.GreenRfd_m3kg_R_C_GLU", + "L165.ag_IrrEff_R", + "L172.Coef_GJm3_IrrEnergy_R", + "L2052.AgCost_ag_irr_mgmt", + "L2052.AgCost_bio_irr_mgmt", + FILE = "water/water_td_sectors")) + } else if(command == driver.DECLARE_OUTPUTS) { + return(c("L2072.AgCoef_IrrBphysWater_ag_mgmt", + "L2072.AgCoef_IrrWaterWdraw_ag_mgmt", + "L2072.AgCoef_IrrWaterCons_ag_mgmt", + "L2072.AgCoef_RfdBphysWater_ag_mgmt", + "L2072.AgCoef_BphysWater_bio_mgmt", + "L2072.AgCoef_IrrWaterWdraw_bio_mgmt", + "L2072.AgCoef_IrrWaterCons_bio_mgmt", + "L2072.AgNonEnergyCost_IrrWaterWdraw")) + } else if(command == driver.MAKE) { + + all_data <- list(...)[[1]] + + BlueIrr_m3kg <- BlueIrr_km3 <- TotIrr_m3kg <- TotIrr_km3 <- GreenRfd_m3kg <- water_sector <- water_type <- + Prod_Mt <- AgSupplySector <- AgSupplySubsector <- AgProductionTechnology <- minicam.energy.input <- + field.eff <- blue_fract <- conveyance.eff <- WaterPrice <- calPrice <- WaterCost <- nonLandVariableCost <- + biomass <- type <- region <- GCAM_region_ID <- year <- value <- GCAM_commodity <- GLU <- GLU_name <- + IRR_RFD <- MGMT <- coefficient <- Profit <- fuel <- elec_GJm3 <- input.cost <- minicam.non.energy.input <- + . <- GCAM_subsector <- NULL # silence package check notes + + # Load required inputs + GCAM_region_names <- get_data(all_data, "common/GCAM_region_names") + basin_to_country_mapping <- get_data(all_data, "water/basin_to_country_mapping") + L2012.AgSupplySector <- get_data(all_data, "L2012.AgSupplySector") + L161.ag_irrProd_Mt_R_C_Y_GLU <- get_data(all_data, "L161.ag_irrProd_Mt_R_C_Y_GLU") + L161.ag_rfdProd_Mt_R_C_Y_GLU <- get_data(all_data, "L161.ag_rfdProd_Mt_R_C_Y_GLU") + L165.BlueIrr_m3kg_R_C_GLU <- get_data(all_data, "L165.BlueIrr_m3kg_R_C_GLU", strip_attributes = TRUE) + L165.TotIrr_m3kg_R_C_GLU <- get_data(all_data, "L165.TotIrr_m3kg_R_C_GLU", strip_attributes = TRUE) + L165.GreenRfd_m3kg_R_C_GLU <- get_data(all_data, "L165.GreenRfd_m3kg_R_C_GLU", strip_attributes = TRUE) + L165.ag_IrrEff_R <- get_data(all_data, "L165.ag_IrrEff_R", strip_attributes = TRUE) + L172.Coef_GJm3_IrrEnergy_R <- get_data(all_data, "L172.Coef_GJm3_IrrEnergy_R", strip_attributes = TRUE) + L2052.AgCost_ag_irr_mgmt <- get_data(all_data, "L2052.AgCost_ag_irr_mgmt", strip_attributes = TRUE) + L2052.AgCost_bio_irr_mgmt <- get_data(all_data, "L2052.AgCost_bio_irr_mgmt", strip_attributes = TRUE) + water_td_sectors <- get_data(all_data, "water/water_td_sectors") + + # Primary crops + # Compute irrigation water consumption IO coefficients (km3/Mt crop = m3/kg) by region / irrigated crop / year / GLU / management level + L165.BlueIrr_m3kg_R_C_GLU %>% + # Initial adjustment: drop any water coefs for region/crop/GLU combinations that aren't written out + semi_join(L161.ag_irrProd_Mt_R_C_Y_GLU, by = c("GCAM_region_ID", "GCAM_commodity", "GCAM_subsector", "GLU")) %>% + mutate(IRR_RFD = "IRR", water_type = "water consumption") %>% + rename(value = BlueIrr_m3kg) -> + L2072.Blue_IRR_IO_R_C_GLU + + # Compute biophysical water consumption IO coefficients (km3/Mt crop = m3/kg) by region / irrigated crop / year / GLU / management level + L165.TotIrr_m3kg_R_C_GLU %>% + # Initial adjustment: drop any water coefs for region/crop/GLU combinations that aren't written out + semi_join(L161.ag_irrProd_Mt_R_C_Y_GLU, by = c("GCAM_region_ID", "GCAM_commodity", "GCAM_subsector", "GLU")) %>% + mutate(IRR_RFD = "IRR", water_type = "biophysical water consumption") %>% + rename(value = TotIrr_m3kg) -> + L2072.Bio_IRR_IO_R_C_GLU + + # Compute biophysical water consumption IO coefficients (km3/Mt crop = m3/kg) by region / rainfed crop / year / GLU / management level + L165.GreenRfd_m3kg_R_C_GLU %>% + # Initial adjustment: drop any water coefs for region/crop/GLU combinations that aren't written out + semi_join(L161.ag_rfdProd_Mt_R_C_Y_GLU, by = c("GCAM_region_ID", "GCAM_commodity", "GCAM_subsector", "GLU")) %>% + mutate(IRR_RFD = "RFD", water_type = "biophysical water consumption") %>% + rename(value = GreenRfd_m3kg) -> + L2072.Bio_RFD_IO_R_C_GLU + + # Following are repeated processing steps for the three files, so combine them all together + L2072.Blue_IRR_IO_R_C_GLU %>% + bind_rows(L2072.Bio_IRR_IO_R_C_GLU, L2072.Bio_RFD_IO_R_C_GLU) %>% + left_join_error_no_match(GCAM_region_names, by = "GCAM_region_ID") %>% + left_join_error_no_match(basin_to_country_mapping[c("GLU_code", "GLU_name")], by = c("GLU" = "GLU_code")) %>% + # Copy to both high and low management levels + repeat_add_columns(tibble(MGMT = c("hi", "lo"))) %>% + # Add sector, subsector, technology names + mutate(AgSupplySector = GCAM_commodity, + AgSupplySubsector = paste(GCAM_subsector, GLU_name, sep = aglu.CROP_GLU_DELIMITER), + AgProductionTechnology = paste(paste(AgSupplySubsector, IRR_RFD, sep = aglu.IRR_DELIMITER), + MGMT, sep = aglu.MGMT_DELIMITER), + coefficient = round(value, aglu.DIGITS_CALOUTPUT)) %>% + filter(coefficient > 0) %>% + # Assume coefs stay constant, copy to all model years + repeat_add_columns(tibble(year = MODEL_YEARS)) -> + L2072.AgCoef_Water_ag_mgmt + + # Separate irrigation water consumption IO coefficients + L2072.AgCoef_Water_ag_mgmt %>% + filter(water_type == "water consumption") %>% + # Standardize irrigation water input names + mutate(water_sector = "Irrigation", + minicam.energy.input = set_water_input_name(water_sector, water_type, water_td_sectors, GLU = GLU_name)) %>% + select(LEVEL2_DATA_NAMES[["AgCoef"]]) -> + L2072.AgCoef_IrrWaterCons_ag_mgmt + + # Separate biophysical water consumption IO coefficients + L2072.AgCoef_Water_ag_mgmt %>% + filter(water_type == "biophysical water consumption" & IRR_RFD == "IRR") %>% + # Standardize irrigation water input names + mutate(water_sector = "Irrigation", + minicam.energy.input = set_water_input_name(water_sector, water_type, water_td_sectors, GLU = GLU_name)) %>% + select(LEVEL2_DATA_NAMES[["AgCoef"]]) -> + L2072.AgCoef_IrrBphysWater_ag_mgmt + + # Separate biophysical water consumption IO coefficients + L2072.AgCoef_Water_ag_mgmt %>% + filter(water_type == "biophysical water consumption" & IRR_RFD == "RFD") %>% + # Standardize irrigation water input names + mutate(water_sector = "Irrigation", + minicam.energy.input = set_water_input_name(water_sector, water_type, water_td_sectors, GLU = GLU_name)) %>% + select(LEVEL2_DATA_NAMES[["AgCoef"]]) -> + L2072.AgCoef_RfdBphysWater_ag_mgmt + + # Dedicated bioenergy crops + # Compute biophysical water IO coefficients (km3/EJ biomass) by region / dedicated bioenergy crop / year / GLU / management level + L2052.AgCost_bio_irr_mgmt %>% + select(LEVEL2_DATA_NAMES[["AgTechYr"]]) %>% + mutate(minicam.energy.input = "biophysical water consumption", + coefficient = aglu.BIO_GRASS_WATER_IO_KM3EJ, + coefficient = replace(coefficient, grepl("biomassTree", AgProductionTechnology), aglu.BIO_TREE_WATER_IO_KM3EJ)) -> + L2072.AgCoef_BphysWater_bio_mgmt + + # Compute irrigation water consumption IO coefficients (km3/EJ biomass) by region / dedicated bioenergy crop / year / GLU / management level + # First compute % of blue water for irrigated bioenergy crops + # Match in green and blue water for existing crops in 2005 -- note for this we are only using blue & green from irrigated crops + L165.BlueIrr_m3kg_R_C_GLU %>% + full_join(L165.TotIrr_m3kg_R_C_GLU, by = c("GCAM_region_ID", "GCAM_commodity", "GCAM_subsector", "GLU")) %>% + # Initial adjustment: drop any water coefs for region/crop/GLU combinations that aren't written out + semi_join(L161.ag_irrProd_Mt_R_C_Y_GLU, by = c("GCAM_region_ID", "GCAM_commodity", "GCAM_subsector", "GLU")) %>% + # Match in 2010 irrigated crop production + left_join_error_no_match(filter(L161.ag_irrProd_Mt_R_C_Y_GLU, year == max(HISTORICAL_YEARS)), + by = c("GCAM_region_ID", "GCAM_commodity", "GCAM_subsector", "GLU")) %>% + # Use crop prodcution for weighting + mutate(BlueIrr_km3 = BlueIrr_m3kg * value, TotIrr_km3 = TotIrr_m3kg * value) %>% + group_by(GCAM_region_ID, GLU) %>% + summarise(Prod_Mt = sum(value), BlueIrr_km3 = sum(BlueIrr_km3), TotIrr_km3 = sum(TotIrr_km3)) %>% + ungroup() %>% + # Calculate production-weighted blue and green water of all irrigated crops by region / GLU + mutate(BlueIrr_m3kg = BlueIrr_km3 / Prod_Mt, TotIrr_m3kg = TotIrr_km3 / Prod_Mt, + # Calculate % of blue water use + blue_fract = BlueIrr_m3kg / TotIrr_m3kg) %>% + replace_na(list(blue_fract = 0)) %>% + left_join_error_no_match(GCAM_region_names, by = "GCAM_region_ID") %>% + left_join_error_no_match(basin_to_country_mapping[c("GLU_code", "GLU_name")], by = c("GLU" = "GLU_code")) -> + L2072.BlueFract_R_GLU + + # Use biophysical water consumption IO coefs to compute irrigation water consumption IO coefs for dedicated bioenergy crops + L2072.AgCoef_BphysWater_bio_mgmt %>% + mutate(water_type = "water consumption") %>% + # Separate subsector variale for GLU names + separate(AgSupplySubsector, c("biomass", "GLU_name"), sep = "_") %>% + # Match in % of blue water by region / GLU, create NAs, use left_join instead + left_join(select(L2072.BlueFract_R_GLU, region, GLU_name, blue_fract), by = c("region", "GLU_name")) %>% + # Multiply biophysical water consumption IO coefs and blue water % + mutate(coefficient = round(coefficient * blue_fract, aglu.DIGITS_CALOUTPUT)) %>% + replace_na(list(coefficient = 0)) %>% + # Irrigated water consumption only applies to the irrigated techs, which are assumed to end in the string "IRR" + filter(grepl("IRR", AgProductionTechnology)) %>% + mutate(AgSupplySubsector = paste(biomass, GLU_name, sep = "_")) %>% + # Standardize irrigation water input names + mutate(water_sector = "Irrigation", + minicam.energy.input = set_water_input_name(water_sector, water_type, water_td_sectors, GLU = GLU_name)) %>% + # Remove extra columns + select(LEVEL2_DATA_NAMES[["AgCoef"]]) -> + L2072.AgCoef_IrrWaterCons_bio_mgmt + + # Create tables for water withdrawals IO coefs (consumption divided by irrigation efficiency) + L165.ag_IrrEff_R %>% + left_join_error_no_match(GCAM_region_names, by = "GCAM_region_ID") %>% + right_join(bind_rows(L2072.AgCoef_IrrWaterCons_ag_mgmt, L2072.AgCoef_IrrWaterCons_bio_mgmt), by = "region") %>% + # Calculate water withdrawals using consumption divided by irrigation efficiency + mutate(coefficient = round(coefficient / field.eff, aglu.DIGITS_CALOUTPUT), + # Replace the last character "C" with "W" for input name + minicam.energy.input = gsub(".{1}$", "W", minicam.energy.input)) %>% + # Remove extra columns + select(LEVEL2_DATA_NAMES[["AgCoef"]]) -> + L2072.AgCoef_IrrWaterWdraw_mgmt + + # Separate table of water withdrawals IO coefs into 2: one for bioenergy crops, another for non-bio crops + L2072.AgCoef_IrrWaterWdraw_mgmt %>% + filter(AgSupplySector != "biomass") -> + L2072.AgCoef_IrrWaterWdraw_ag_mgmt + + L2072.AgCoef_IrrWaterWdraw_mgmt %>% + filter(AgSupplySector == "biomass") -> + L2072.AgCoef_IrrWaterWdraw_bio_mgmt + + #........................ + # gcambreakout 17 July 2022 + # Temporary fix until circular dependency on + # L123.LC_bm2_R_MgdFor_Yh_GLU_beforeadjust is fixed. + #........................ + + + L2052.AgCost_ag_irr_mgmt %>% + dplyr::select(region, AgSupplySubsector) %>% + unique() %>% + dplyr::mutate(keep=1)-> + region_subsectors; region_subsectors + + L2072.AgCoef_IrrWaterWdraw_ag_mgmt %>% + dplyr::left_join(region_subsectors) %>% + dplyr::filter(keep==1)%>% + dplyr::select(-keep) -> + L2072.AgCoef_IrrWaterWdraw_ag_mgmt + + #.................... gcambreakout close edits + + + # Ad hoc assignment of subsidies to observations with negative profit. In GCAM, the land profit rate is calculated + # as price minus cost times yield, so if the cost exceeds the price, then the profit goes negative. By adding in the + # water cost without modifying the non-land variable costs, we risk having costs that exceed commodity prices. This + # calculation checks whether any of our costs exceed the prices, and uses this information to determine a "water + # subsidy", applied as a negative cost to the price paid for irrigation water. + + # NOTE: The electricity price used for this purpose is approximate, not calculated from each region's + # fuel mix and primary energy prices; as such, the resulting profit rates are not exact. + + L2072.Coef_GJm3_IrrEnergy_R <- rename(L172.Coef_GJm3_IrrEnergy_R, elec_GJm3 = coefficient) %>% + filter(fuel == "electricity", + year %in% MODEL_BASE_YEARS) %>% + left_join_error_no_match(GCAM_region_names, by = "GCAM_region_ID") %>% + select(region, year, elec_GJm3) %>% + complete(region = region, year = MODEL_YEARS) %>% + group_by(region) %>% + mutate(elec_GJm3 = if_else(year %in% MODEL_FUTURE_YEARS, elec_GJm3[year == max(MODEL_BASE_YEARS)], elec_GJm3)) %>% + ungroup() + + + + L165.ag_IrrEff_R %>% + left_join_error_no_match(GCAM_region_names, by = "GCAM_region_ID") %>% + right_join(L2072.AgCoef_IrrWaterWdraw_ag_mgmt, by = "region") %>% + # Calculate water price and water cost, including abstraction-related energy costs + left_join_error_no_match(L2072.Coef_GJm3_IrrEnergy_R, + by = c("region", "year")) %>% + # Calculate water price and water cost + mutate(WaterCost = coefficient * (water.DEFAULT_IRR_WATER_PRICE + + (elec_GJm3 * efw.DEFAULT_IRR_ELEC_PRICE_75USDGJ * water.IRR_PRICE_SUBSIDY_MULT)) / + conveyance.eff) %>% + # Join in non-land variable costs + left_join_error_no_match(L2052.AgCost_ag_irr_mgmt, + by = c("region", "AgSupplySector", "AgSupplySubsector", "AgProductionTechnology", "year")) %>% + # Join in commodity price + left_join(select(L2012.AgSupplySector, region, AgSupplySector, calPrice), + by = c("region", "AgSupplySector")) %>% + mutate(Profit = calPrice - WaterCost - nonLandVariableCost) -> + L2072.AgNonEnergyCost_IrrWaterWdraw + + # Assume an exogenous floor on profit rates to prevent negative, zero, and very low profit rates + # Set a floor on profit rates, equal to the minimum observed profit rate not considering water costs + minProfitMargin <- min(with(L2072.AgNonEnergyCost_IrrWaterWdraw, calPrice - nonLandVariableCost)) + + # Note: there is no need to write out zero subsidy values in region/supplysector/subsector/technology observations + # where all years are 0. The following steps ensure that there aren't observations with subsidies in some years but + # not others. + L2072.AgNonEnergyCost_IrrWaterWdraw %>% + mutate(minicam.non.energy.input = "water subsidy", + # Round to the same number of digits as cal-output rather than cal-price; many are close to zero + input.cost = if_else(Profit < minProfitMargin, round(Profit - minProfitMargin, aglu.DIGITS_CALOUTPUT), 0)) %>% + filter(input.cost < 0) %>% + complete(nesting(region, AgSupplySector, AgSupplySubsector, AgProductionTechnology, minicam.non.energy.input), year = MODEL_YEARS) %>% + replace_na(list(input.cost = 0)) %>% + select(LEVEL2_DATA_NAMES[["AgNonEnergyCost"]]) -> + L2072.AgNonEnergyCost_IrrWaterWdraw + + #........................ + # gcambreakout 17 July 2022 + # Temporary fix until circular dependency on + # L123.LC_bm2_R_MgdFor_Yh_GLU_beforeadjust is fixed. + #........................ + + L2072.AgCoef_IrrWaterCons_ag_mgmt %>% + dplyr::left_join(region_subsectors) %>% + dplyr::filter(keep==1)%>% + dplyr::select(-keep) -> + L2072.AgCoef_IrrWaterCons_ag_mgmt + + L2072.AgCoef_IrrBphysWater_ag_mgmt %>% + dplyr::left_join(region_subsectors) %>% + dplyr::filter(keep==1)%>% + dplyr::select(-keep) -> + L2072.AgCoef_IrrBphysWater_ag_mgmt + + L2072.AgCoef_RfdBphysWater_ag_mgmt %>% + dplyr::left_join(region_subsectors) %>% + dplyr::filter(keep==1)%>% + dplyr::select(-keep) -> + L2072.AgCoef_RfdBphysWater_ag_mgmt + + #.................... gcambreakout close edits + + # Produce outputs + L2072.AgCoef_IrrWaterCons_ag_mgmt %>% + add_title("Irrigation water consumption IO coefficients by region / irrigated crop / year / GLU / management level") %>% + add_units("km3/Mt") %>% + add_comments("The same IO coefficients are assigned to both high and low management and keep constant for all model years") %>% + add_legacy_name("L2072.AgCoef_IrrWaterCons_ag_mgmt") %>% + add_precursors("common/GCAM_region_names", + "water/basin_to_country_mapping", + "L165.BlueIrr_m3kg_R_C_GLU", + "L161.ag_irrProd_Mt_R_C_Y_GLU", + "water/water_td_sectors") -> + L2072.AgCoef_IrrWaterCons_ag_mgmt + + L2072.AgCoef_IrrWaterWdraw_ag_mgmt %>% + add_title("Irrigation water withdrawals IO coefficients by region / irrigated crop / year / GLU / management level") %>% + add_units("km3/Mt") %>% + add_comments("Withdrawals coefs are calculated as consumption coefs divided by irrigation efficiency") %>% + add_comments("Set a floor on profit and adjust the coefs to ensure the profit floor is met") %>% + add_comments("The same IO coefficients are assigned to both high and low management and keep constant for all model years") %>% + add_legacy_name("L2072.AgCoef_IrrWaterWdraw_ag_mgmt") %>% + same_precursors_as("L2072.AgCoef_IrrWaterCons_ag_mgmt") %>% + add_precursors("L165.ag_IrrEff_R") -> + L2072.AgCoef_IrrWaterWdraw_ag_mgmt + + L2072.AgCoef_IrrBphysWater_ag_mgmt %>% + add_title("Biophysical water consumption IO coefficients by region / irrigated crop / year / GLU / management level") %>% + add_units("km3/Mt") %>% + add_comments("The same IO coefficients are assigned to both high and low management and keep constant for all model years") %>% + add_legacy_name("L2072.AgCoef_IrrBphysWater_ag_mgmt") %>% + add_precursors("common/GCAM_region_names", + "water/basin_to_country_mapping", + "L165.TotIrr_m3kg_R_C_GLU", + "L161.ag_irrProd_Mt_R_C_Y_GLU", + "water/water_td_sectors") -> + L2072.AgCoef_IrrBphysWater_ag_mgmt + + L2072.AgCoef_RfdBphysWater_ag_mgmt %>% + add_title("Biophysical water consumption IO coefficients by region / rainfed crop / year / GLU / management level") %>% + add_units("km3/Mt") %>% + add_comments("The same IO coefficients are assigned to both high and low management and keep constant for all model years") %>% + add_legacy_name("L2072.AgCoef_RfdBphysWater_ag_mgmt") %>% + add_precursors("common/GCAM_region_names", + "water/basin_to_country_mapping", + "L165.GreenRfd_m3kg_R_C_GLU", + "L161.ag_rfdProd_Mt_R_C_Y_GLU", + "water/water_td_sectors") -> + L2072.AgCoef_RfdBphysWater_ag_mgmt + + L2072.AgCoef_BphysWater_bio_mgmt %>% + add_title("Biophysical water IO coefficients by region / dedicated bioenergy crop / year / GLU / management level") %>% + add_units("km3/EJ") %>% + add_comments("The same IO coefficients are assigned to both high and low management and keep constant for all model years") %>% + add_legacy_name("L2072.AgCoef_BphysWater_bio_mgmt") %>% + add_precursors("L2052.AgCost_bio_irr_mgmt", + "water/water_td_sectors") -> + L2072.AgCoef_BphysWater_bio_mgmt + + L2072.AgCoef_IrrWaterCons_bio_mgmt %>% + add_title("Irrigation water consumption IO coefficients by region / dedicated bioenergy crop / year / GLU / management level") %>% + add_units("km3/EJ") %>% + add_comments("Multiply biophysical water coefs of bioenergy crops with the average % of blue water for primary crops by region / GLU") %>% + add_comments("The same IO coefficients are assigned to both high and low management and keep constant for all model years") %>% + add_legacy_name("L2072.AgCoef_IrrWaterCons_bio_mgmt") %>% + add_precursors("common/GCAM_region_names", + "water/basin_to_country_mapping", + "L165.BlueIrr_m3kg_R_C_GLU", + "L165.TotIrr_m3kg_R_C_GLU", + "L161.ag_irrProd_Mt_R_C_Y_GLU", + "water/water_td_sectors") -> + L2072.AgCoef_IrrWaterCons_bio_mgmt + + L2072.AgCoef_IrrWaterWdraw_bio_mgmt %>% + add_title("Irrigation water withdrawals IO coefficients by region / dedicated bioenergy crop / year / GLU / management level") %>% + add_units("km3/EJ") %>% + add_comments("Withdrawals coefs are calculated as consumption coefs divided by irrigation efficiency") %>% + add_comments("The same IO coefficients are assigned to both high and low management and keep constant for all model years") %>% + add_legacy_name("L2072.AgCoef_IrrWaterWdraw_bio_mgmt") %>% + same_precursors_as("L2072.AgCoef_IrrWaterCons_bio_mgmt") %>% + add_precursors("L165.ag_IrrEff_R") -> + L2072.AgCoef_IrrWaterWdraw_bio_mgmt + + L2072.AgNonEnergyCost_IrrWaterWdraw %>% + add_title("Irrigation water subsidies by region / crop / year / GLU / management level") %>% + add_units("1975$/kg") %>% + add_comments("Water subsidies are calculated to keep profit rates of irrigated technologies above a minimum level") %>% + add_comments("While implemented using , all values are negative so these reduce net costs") %>% + same_precursors_as("L2072.AgCoef_IrrWaterWdraw_ag_mgmt") %>% + add_precursors("L172.Coef_GJm3_IrrEnergy_R", + "L2012.AgSupplySector", + "L2052.AgCost_ag_irr_mgmt") -> + L2072.AgNonEnergyCost_IrrWaterWdraw + + return_data(L2072.AgCoef_IrrBphysWater_ag_mgmt, + L2072.AgCoef_IrrWaterWdraw_ag_mgmt, + L2072.AgCoef_IrrWaterCons_ag_mgmt, + L2072.AgCoef_RfdBphysWater_ag_mgmt, + L2072.AgCoef_BphysWater_bio_mgmt, + L2072.AgCoef_IrrWaterWdraw_bio_mgmt, + L2072.AgCoef_IrrWaterCons_bio_mgmt, + L2072.AgNonEnergyCost_IrrWaterWdraw) + } else { + stop("Unknown command") + } +} + + diff --git a/inst/extras/zchunk_L2112.ag_nonco2_IRR_MGMT_breakout_gcamv6p0.R b/inst/extras/zchunk_L2112.ag_nonco2_IRR_MGMT_breakout_gcamv6p0.R new file mode 100644 index 0000000..f66bce6 --- /dev/null +++ b/inst/extras/zchunk_L2112.ag_nonco2_IRR_MGMT_breakout_gcamv6p0.R @@ -0,0 +1,272 @@ +# Copyright 2019 Battelle Memorial Institute; see the LICENSE file. + +#' module_emissions_L2112.ag_nonco2_IRR_MGMT +#' +#' Disaggregate non-CO2 agricultral emissions by production technology +#' +#' @param command API command to execute +#' @param ... other optional parameters, depending on command +#' @return Depends on \code{command}: either a vector of required inputs, +#' a vector of output names, or (if \code{command} is "MAKE") all +#' the generated outputs: \code{object}, \code{L2112.AWBEmissions}, \code{L2112.AGREmissions}. The corresponding file in the +#' original data system was \code{L2112.ag_nonco2_IRR_MGMT.R} (emissions level2). +#' @details Disaggregates agricultural emissions the basis of production by scaling emissions by a technology factor +#' @importFrom assertthat assert_that +#' @importFrom dplyr bind_rows filter if_else group_by left_join mutate select summarise +#' @importFrom tidyr replace_na unite +#' @author KD July 2017 +module_emissions_L2112.ag_nonco2_IRR_MGMT <- function(command, ...) { + if(command == driver.DECLARE_INPUTS) { + return(c(FILE = "common/iso_GCAM_regID", + FILE = "common/GCAM_region_names", + FILE = "water/basin_to_country_mapping", + "L2111.AGREmissions", + "L2111.AGRBio", + "L2111.AWB_BCOC_EmissCoeff", + "L2111.nonghg_max_reduction", + "L2111.nonghg_steepness", + "L2111.AWBEmissions", + "L2012.AgProduction_ag_irr_mgmt")) + } else if(command == driver.DECLARE_OUTPUTS) { + return(c("L2112.AGRBio", "L2112.AWB_BCOC_EmissCoeff", "L2112.nonghg_max_reduction", + "L2112.nonghg_steepness", "L2112.AWBEmissions", "L2112.AGREmissions")) + } else if(command == driver.MAKE) { + + all_data <- list(...)[[1]] + + AgProductionTechnology <- level <- year <- region <- AgSupplySector <- AgSupplySubsector <- + AgProductionTechnology_nolvl <- calOutputValue <- AgProductionTechnology_lvl <- total <- + share_tech <- input.emissions <- Non.CO2 <- NULL # silence package check notes + + # Load required inputs + L2111.AWBEmissions <- get_data(all_data, "L2111.AWBEmissions") + L2111.AGREmissions <- get_data(all_data, "L2111.AGREmissions") + L2111.AGRBio <- get_data(all_data, "L2111.AGRBio") + L2111.AWB_BCOC_EmissCoeff <- get_data(all_data, "L2111.AWB_BCOC_EmissCoeff") + L2111.nonghg_max_reduction <- get_data(all_data, "L2111.nonghg_max_reduction") + L2111.nonghg_steepness <- get_data(all_data, "L2111.nonghg_steepness") + L2012.AgProduction_ag_irr_mgmt <- get_data(all_data, "L2012.AgProduction_ag_irr_mgmt", strip_attributes = TRUE) + + #........................ + # gcambreakout 17 July 2022 + # Temporary fix until circular dependency on + # L123.LC_bm2_R_MgdFor_Yh_GLU_beforeadjust is fixed. + #........................ + + iso_GCAM_regID <- get_data(all_data, "common/iso_GCAM_regID") + basin_to_country_mapping <- get_data(all_data, "water/basin_to_country_mapping") + GCAM_region_names <- get_data(all_data, "common/GCAM_region_names") + + # Valid GLU Region combos + glu_gcam <- basin_to_country_mapping %>% + dplyr::select(iso=ISO, GLU=GLU_code, GLU_name) %>% + dplyr::mutate(iso = tolower(iso)) %>% + dplyr::left_join(iso_GCAM_regID, by=c("iso")) %>% + dplyr::select(GLU, GCAM_region_ID, GLU_name) %>% + dplyr::filter(GCAM_region_ID > 32) %>% + unique() %>% + dplyr::left_join(GCAM_region_names); glu_gcam + + remove_glu <- glu_gcam$GLU_name %>% unique(); remove_glu + regions_check <- GCAM_region_names$region[!GCAM_region_names$region %in% glu_gcam$region]; regions_check + + L2111.AWBEmissions %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2111.AWBEmissions + + L2111.AGREmissions %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2111.AGREmissions + + L2111.AGRBio %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2111.AGRBio + + L2111.AWB_BCOC_EmissCoeff %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2111.AWB_BCOC_EmissCoeff + + L2111.nonghg_max_reduction %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2111.nonghg_max_reduction + + L2111.nonghg_steepness %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2111.nonghg_steepness + + L2012.AgProduction_ag_irr_mgmt %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2012.AgProduction_ag_irr_mgmt + + + #............breakout close edits + + # =================================================== + # For all of the animal emission tables add high and low management level + L2111.AGRBio %>% + repeat_add_columns(tibble(level = c("hi", "lo"))) %>% + unite(AgProductionTechnology, AgProductionTechnology, level, sep = "_") -> + L2112.AGRBio + + L2111.AWB_BCOC_EmissCoeff %>% + repeat_add_columns(tibble(level = c("hi", "lo"))) %>% + unite(AgProductionTechnology, AgProductionTechnology, level, sep = "_") -> + L2112.AWB_BCOC_EmissCoeff + + L2111.nonghg_max_reduction %>% + repeat_add_columns(tibble(level = c("hi", "lo"))) %>% + unite(AgProductionTechnology, AgProductionTechnology, level, sep = "_") -> + L2112.nonghg_max_reduction + + L2111.nonghg_steepness %>% + repeat_add_columns(tibble(level = c("hi", "lo"))) %>% + unite(AgProductionTechnology, AgProductionTechnology, level, sep = "_") -> + L2112.nonghg_steepness + + + # For the tables whose emissions are read as quantities rather than rates, + # disaggregate emissions on the basis of production. + + # First calculate the total emissions for each region, supply sector, subsector, + # technology level in the most recent model base year. This total will latter be + # used to calculate share weights. + L2012.AgProduction_ag_irr_mgmt %>% + filter(year == max(MODEL_BASE_YEARS)) %>% + mutate(AgProductionTechnology_nolvl = gsub("_hi|_lo", "", AgProductionTechnology)) %>% + group_by(region, AgSupplySector, AgSupplySubsector, AgProductionTechnology_nolvl, year) %>% + summarise(total = sum(calOutputValue)) %>% + ungroup() -> + L2112.AgProduction_ag_irr_nomgmt_aggergate + + # Now subset the table of agricultural production for the most recent model base year + # and format the data frame so that so that the AgProductionTechnology_level column + # will match the column in the aggeregated data frame. + L2012.AgProduction_ag_irr_mgmt %>% + filter(year == max(MODEL_BASE_YEARS)) %>% + select(region, AgSupplySector, AgSupplySubsector, AgProductionTechnology_lvl = AgProductionTechnology, year, calOutputValue) %>% + mutate(AgProductionTechnology_nolvl = gsub("_hi|_lo", "", AgProductionTechnology_lvl)) -> + L2112.AgProduction_ag + + # Calculate the share weights or the fraction of emissions for each region, sector, subsector, + # technology and level for the using the aggrated total emissions determined above. + # Eventually these emission shares will be used as a factor to disaggregate the emissions input. + L2112.AgProduction_ag %>% + left_join_error_no_match(L2112.AgProduction_ag_irr_nomgmt_aggergate, + by = c("region", "AgSupplySector", "year", "AgSupplySubsector", c("AgProductionTechnology_nolvl"))) %>% + mutate(share_tech = calOutputValue / total) -> + L2112.AgProduction_ag_share + + + # Combine non agricultural waste burning emissions and agricultural waste burning + # emissions into a single data frame. Add management level information to production + # technology column. + L2111.AWBEmissions %>% + bind_rows(L2111.AGREmissions) %>% + repeat_add_columns(tibble(level = c("hi", "lo"))) %>% + unite(AgProductionTechnology_lvl, AgProductionTechnology, level, sep = "_", remove = FALSE) -> + L2112.awb_agr_emissions + + # Match the shares(fraction of emissions) to the data frames containing + # emissions quantities for the agricultural water burning and agricultural + # non waste burning emissions. + L2112.AgProduction_ag_share %>% + select(-year, -AgSupplySubsector) %>% + left_join(L2112.awb_agr_emissions, by = c("region", "AgSupplySector", "AgProductionTechnology_lvl")) -> + L2112.awb_agr_emissions + + + # Where shares allocated to lo/hi are NA but emissions are positive, split it 50/50 between + # the techs. For all others, set share to zero. Then scale the input emissions by the emission + # shares. + L2112.awb_agr_emissions %>% + mutate(share_tech = if_else(is.na(share_tech) & input.emissions > 1e-6, 0.5, share_tech)) %>% + replace_na(list(share_tech = 0)) %>% + mutate(input.emissions = input.emissions * share_tech) %>% + select(region, AgSupplySector, AgProductionTechnology = AgProductionTechnology_lvl, AgSupplySubsector, + year, Non.CO2, input.emissions, level) -> + L2112.awb_agr_emissions_disag + + # The disaggregated agricultural waste burning emissions. + L2112.awb_agr_emissions_disag %>% + filter(grepl("AWB", Non.CO2)) -> + L2112.AWBEmissions + + # The disaggregated non agricultural waste burning emissions. + L2112.awb_agr_emissions_disag %>% + filter(!grepl("AWB", Non.CO2)) -> + L2112.AGREmissions + + # =================================================== + # Produce outputs + L2112.AGRBio %>% + add_title("Bio N2O Coefficients by region, technology, and management level ") %>% + add_units("kg N2O per GJ bioenergy") %>% + add_comments("L211.AGRBio repeated by IRR and RFD technologies") %>% + add_legacy_name("L2112.AGRBio") %>% + add_precursors("L2111.AGRBio","common/iso_GCAM_regID","water/basin_to_country_mapping", + "common/GCAM_region_names") -> + L2112.AGRBio + + + L2112.AWB_BCOC_EmissCoeff %>% + add_title("Agricultural Waste Burning BC/OC Emissions Coefficients by management") %>% + add_units("kt/Mt") %>% + add_comments("L2111.AWB_BCOC_EmissCoeff repeated high and low management") %>% + add_legacy_name("L2112.AWB_BCOC_EmissCoeff") %>% + add_precursors("L2111.AWB_BCOC_EmissCoeff") -> + L2112.AWB_BCOC_EmissCoeff + + L2112.nonghg_max_reduction %>% + add_title("Non-GHG maximum emissions coefficient reduction by agricultural technology and management") %>% + add_units("Percent reduction from base-year emissions coefficient") %>% + add_comments("L2111.nonghg_max_reduction repeated by high and low management") %>% + add_legacy_name("L2112.nonghg_max_reduction") %>% + add_precursors("L2111.nonghg_max_reduction") -> + L2112.nonghg_max_reduction + + L2112.nonghg_steepness %>% + add_title("Steepness of non-GHG emissions reduction for agricultural technologies") %>% + add_units("Unitless") %>% + add_comments("L2111.nonghg_steepness repeated by high and low management level") %>% + add_legacy_name("L2112.nonghg_steepness") %>% + add_precursors("L2111.nonghg_steepness") -> + L2112.nonghg_steepness + + L2112.AWBEmissions %>% + add_title("Input table of agricultural waste burning emissions by production") %>% + add_units("Tg") %>% + add_comments("Production share weights are set for irrigated vs. rainfed, same for high and low management.") %>% + add_legacy_name("L2112.AWBEmissions") %>% + add_precursors("L2111.AWBEmissions", "L2012.AgProduction_ag_irr_mgmt") -> + L2112.AWBEmissions + + L2112.AGREmissions %>% + add_title("Input table for the agricultural emissions by production") %>% + add_units("Tg") %>% + add_comments("Production share weights are set for irrigated vs. rainfed, same for high and low management.") %>% + add_legacy_name("L2112.AGREmissions") %>% + add_precursors("L2111.AGREmissions", "L2012.AgProduction_ag_irr_mgmt", + "common/iso_GCAM_regID","water/basin_to_country_mapping","common/GCAM_region_names") -> + L2112.AGREmissions + + return_data(L2112.AGRBio, L2112.AWB_BCOC_EmissCoeff, L2112.nonghg_max_reduction, L2112.AWBEmissions, + L2112.nonghg_steepness, L2112.AGREmissions) + + } else { + stop("Unknown command") + } +} diff --git a/inst/extras/zchunk_L2231.wind_update_breakout_gcamv6p0.R b/inst/extras/zchunk_L2231.wind_update_breakout_gcamv6p0.R new file mode 100644 index 0000000..904beb3 --- /dev/null +++ b/inst/extras/zchunk_L2231.wind_update_breakout_gcamv6p0.R @@ -0,0 +1,386 @@ +# Copyright 2019 Battelle Memorial Institute; see the LICENSE file. + +#' module_energy_L2231.wind_update +#' +#' Updates region-specific onshore wind supply curves using improved global wind resource estimate from Eurek et al. (2016). +#' +#' @param command API command to execute +#' @param ... other optional parameters, depending on command +#' @return Depends on \code{command}: either a vector of required inputs, +#' a vector of output names, or (if \code{command} is "MAKE") all +#' the generated outputs: \code{L2231.SmthRenewRsrcCurves_onshore_wind}, \code{L2231.StubTechCapFactor_onshore_wind}, \code{L2231.SmthRenewRsrcTechChange_onshore_wind}, +#' \code{L2231.StubTechCost_onshore_wind}. The corresponding file in the +#' original data system was \code{L2231.wind_update.R} (energy level2). +#' @details Updates region-specific onshore wind supply curves using improved global wind resource estimate from Eurek et al. (2016). +#' @importFrom assertthat assert_that +#' @importFrom dplyr filter mutate select group_by summarise distinct arrange bind_rows rename count +#' @importFrom tidyr gather +#' @importFrom stats optimize +#' @author MB GI AJS March 2019 +module_energy_L2231.wind_update <- function(command, ...) { + if(command == driver.DECLARE_INPUTS) { + return(c(FILE = "common/iso_GCAM_regID", + FILE = "common/GCAM_region_names", + FILE = "energy/mappings/fuel_energy_input", + FILE = "energy/A20.wind_class_CFs", + FILE = "energy/NREL_onshore_energy", + FILE = "energy/onshore_wind_grid_cost", + FILE = "energy/NREL_wind_energy_distance_range", + "L113.globaltech_capital_ATB", + "L113.globaltech_OMfixed_ATB", + "L223.StubTechCapFactor_elec")) + } else if(command == driver.DECLARE_OUTPUTS) { + return(c("L2231.SmthRenewRsrcCurves_onshore_wind", + "L2231.StubTechCapFactor_onshore_wind", + "L2231.SmthRenewRsrcTechChange_onshore_wind", + "L2231.StubTechCost_onshore_wind")) + } else if(command == driver.MAKE) { + + all_data <- list(...)[[1]] + + country_name <- GCAM_region_ID <- IAM.Country.Name <- wind_class <- resource.potential.EJ <- region <- + distance <- X_final_model_base_year <- fixed.charge.rate <- capital.overnight <- fcr <- OM.fixed <- CFmax <- price <- + supply <- base.price <- Pvar <- maxSubResource <- percent.supply <- P1 <- Q1 <- mid.price <- P2 <- Q2 <- curve.exponent <- + sector.name<- subsector.name <- intermittent.technology <- input.capital <- capacity.factor <- + capital.overnight.lag <- capital.tech.change.5yr <- k1 <- tech.change.5yr <- + tech.change <- year <- bin <- cost <- Wind_Resource_Region <- Wind_Class <- grid.cost <- + renewresource <- smooth.renewable.subresource <- capacity.factor.capital <- capacity.factor.OM <- + supplysector <- subsector <- stub.technology <- input.OM.fixed <- year.fillout <- + techChange <- minicam.energy.input <- input.cost <- total <- IAM_country <- technology <- value <- + CF <- k2 <- rep_dist_for_bin <- share <- cost_per_kW_km <- capital.tech.change.period <- tech.change.period <- + time.change <- NULL # silence package check notes + + # Load required inputs + iso_GCAM_regID <- get_data(all_data, "common/iso_GCAM_regID") + GCAM_region_names <- get_data(all_data, "common/GCAM_region_names") + fuel_energy_input <- get_data(all_data, "energy/mappings/fuel_energy_input") + A20.wind_class_CFs <- get_data(all_data, "energy/A20.wind_class_CFs") + L113.globaltech_OMfixed_ATB <- get_data(all_data, "L113.globaltech_OMfixed_ATB") + L113.globaltech_capital_ATB <- get_data(all_data, "L113.globaltech_capital_ATB") + NREL_onshore_energy <- get_data(all_data, "energy/NREL_onshore_energy") + onshore_wind_grid_cost <- get_data(all_data, "energy/onshore_wind_grid_cost") + NREL_wind_energy_distance_range <- get_data(all_data, "energy/NREL_wind_energy_distance_range") + L223.StubTechCapFactor_elec <- get_data(all_data, "L223.StubTechCapFactor_elec", strip_attributes = TRUE) + + # =================================================== + # Perform Computations + + # First, map NREL data on resource potential by country to GCAM 32 regions, convert PWh to EJ + # Second, aggregate by GCAM region/ wind class + + NREL_onshore_energy %>% + select(-total) %>% + left_join_error_no_match(iso_GCAM_regID %>% + select(country_name, GCAM_region_ID), + by = c("IAM_country" = "country_name")) %>% + left_join_error_no_match(GCAM_region_names, by = c("GCAM_region_ID")) %>% + select(-IAM_country, -GCAM_region_ID) %>% + gather(wind_class, resource.potential.EJ, -region, -distance) %>% + mutate(resource.potential.EJ = resource.potential.EJ * 1000 * CONV_TWH_EJ ) %>% + group_by(region, wind_class) %>% + summarise(resource.potential.EJ = sum(resource.potential.EJ)) %>% + ungroup() %>% + filter(resource.potential.EJ != 0) -> L2231.onshore_wind_potential_EJ + + L113.globaltech_capital_ATB %>% + gather_years() %>% + filter(technology == "wind", + year == max(MODEL_BASE_YEARS)) %>% + distinct(value)-> L2231.onshore_wind_capital + L2231.onshore_wind_capital <- as.numeric(L2231.onshore_wind_capital) + + L113.globaltech_capital_ATB %>% + filter(technology == "wind") %>% + select(fixed.charge.rate) -> L2231.onshore_wind_fcr + L2231.onshore_wind_fcr <- as.numeric(L2231.onshore_wind_fcr) + + L113.globaltech_OMfixed_ATB %>% + gather_years() %>% + filter(technology == "wind", + year == max(MODEL_BASE_YEARS)) %>% + distinct(value)-> L2231.onshore_wind_OMfixed + L2231.onshore_wind_OMfixed <- as.numeric(L2231.onshore_wind_OMfixed) + + L2231.onshore_wind_potential_EJ %>% + left_join_error_no_match(A20.wind_class_CFs, by = c("wind_class")) %>% + mutate(capital.overnight = L2231.onshore_wind_capital, + fcr = L2231.onshore_wind_fcr, + OM.fixed = L2231.onshore_wind_OMfixed) %>% + mutate(price = fcr * capital.overnight / CF / CONV_YEAR_HOURS / CONV_KWH_GJ + OM.fixed / CF / CONV_YEAR_HOURS / CONV_KWH_GJ) %>% + group_by(region) %>% + mutate(CFmax = max(CF)) %>% + arrange(region, price) %>% + mutate(supply = cumsum(resource.potential.EJ)) %>% + ungroup() %>% + select(region, price, supply, CFmax) -> L2231.onshore_wind_matrix + + # Calculate maxSubResource, base.price, and Pvar. + # base.price represents the minimum cost of generating electricity from the resource. + # base.price comprises of the cost of generating power at the most optimal location. + # Pvar represents costs that are expected to increase from base.price as deployment increases. + # This models the increase in costs as more optimal locations are used first. + + L2231.onshore_wind_matrix %>% + group_by(region) %>% + arrange(region, price) %>% + mutate(base.price = min(price), + Pvar = price - base.price, + maxSubResource = round(max(supply), energy.DIGITS_MAX_SUB_RESOURCE)) %>% + ungroup() -> L2231.onshore_wind_curve + + # Approximate mid-price using first supply points that are less than (p1, Q1) and greater than (p2,Q2) 50% of maxSubResource. + # Using these points, the mid-price can be estimated as: + # mid.price = ((P2-P1)*maxSubResource + 2*Q2*P1 - 2*Q1*P2)/(2*(Q2-Q1)) + # This assumes that the curve is largely linear between the two points above. + + # Calculating P1 and Q1 + L2231.onshore_wind_curve %>% + mutate(percent.supply = supply / maxSubResource) %>% + group_by(region) %>% + filter(percent.supply <= energy.WIND_CURVE_MIDPOINT) %>% + # filter for highest price point below 50% of total resource + filter(Pvar == max(Pvar)) %>% + ungroup() %>% + select(region, P1 = Pvar, Q1 = supply, maxSubResource) -> L2231.mid.price_1 + + # Calculating P2 and Q2 + L2231.onshore_wind_curve %>% + mutate(percent.supply = supply / maxSubResource) %>% + group_by(region) %>% + filter(percent.supply >= energy.WIND_CURVE_MIDPOINT) %>% + # filter for lowest price point above 50% of total resource + filter(Pvar == min(Pvar)) %>% + ungroup() %>% + select(region, P2 = Pvar, Q2 = supply) -> L2231.mid.price_2 + + # Calculating mid.price + L2231.mid.price_1 %>% + left_join_error_no_match(L2231.mid.price_2, by = "region") %>% + mutate(mid.price = round(((P2 - P1) * maxSubResource + (2 * Q2 * P1) - (2 * Q1 * P2)) / (2 * (Q2 - Q1)), + energy.DIGITS_MAX_SUB_RESOURCE)) %>% + select(region, mid.price) -> L2231.mid.price + + + #...................... + # gcambreakout 17 July 2022 + # Add mid.price for regions with only one price point + #...................... + (L2231.onshore_wind_curve %>% + dplyr::count(region) %>% + dplyr::filter(n==1))$region %>% + unique()-> L2231.onshore_wind_curve_single_regions + + # Set mid.price to available price + L2231.onshore_wind_curve %>% + dplyr::filter(region %in% L2231.onshore_wind_curve_single_regions) %>% + dplyr::select(region, mid.price = price)-> L2231.mid.price_singleprice + + # Combine with L2231.mid.price + L2231.mid.price %>% + dplyr::bind_rows(L2231.mid.price_singleprice) -> L2231.mid.price + #....................... gcambreakout close edits + + L2231.onshore_wind_curve %>% + left_join_error_no_match(L2231.mid.price, by = c("region")) -> L2231.onshore_wind_curve + + # Defining variables to be used later. + region_list <- unique(L2231.onshore_wind_curve$region) + L2231.curve.exponent <- tibble() + + for (L2231.region in region_list) { + + L2231.onshore_wind_curve %>% + filter(region == L2231.region) -> L2231.onshore_wind_curve_region + + L2231.onshore_wind_curve_region %>% + select(price, supply) -> L2231.supply_points_region + + L2231.error_min_curve.exp <- optimize(f = smooth_res_curve_approx_error, interval = c(1.0,15.0), + L2231.onshore_wind_curve_region$mid.price, + L2231.onshore_wind_curve_region$base.price, + L2231.onshore_wind_curve_region$maxSubResource, + L2231.onshore_wind_curve_region ) + + L2231.onshore_wind_curve_region$curve.exponent <- round(L2231.error_min_curve.exp$minimum,energy.DIGITS_MAX_SUB_RESOURCE) + L2231.onshore_wind_curve_region %>% + distinct(region, curve.exponent) -> L2231.curve.exponent_region + + L2231.curve.exponent %>% + bind_rows(L2231.curve.exponent_region) -> L2231.curve.exponent + + } + + L2231.onshore_wind_curve %>% + left_join_error_no_match(L2231.curve.exponent, by = "region") -> L2231.onshore_wind_curve + + # Technological change in the supply curve is related to assumed improvements in capital cost. + # If capital cost changes from CC to a.CC, then every price point of the curve will scale by a factor a' given as follows: + # a' = (k1.a.CC + k2. OM-fixed) / (k1.CC + k2. OM-fixed) where k1 = FCR/(8760*kWh_GJ) and k2 = 1/(8760*kWh_GJ) + # Thus, we calculate model input parameter techChange (which is the reduction per year) as 1-a'^(1/5) + + # First, calculate capital cost over time for "wind_offshore" technology + L113.globaltech_capital_ATB %>% + filter(technology == "wind") %>% + fill_exp_decay_extrapolate(c(MODEL_BASE_YEARS, MODEL_FUTURE_YEARS)) %>% + rename(capital.overnight = value, intermittent.technology = technology) -> L2231.onshore_wind_cap_cost + + # Second, calculate technological change + L2231.onshore_wind_cap_cost %>% + filter(intermittent.technology == "wind") %>% + select(year, capital.overnight) %>% + mutate(capital.tech.change.period = lag(capital.overnight, 1) / capital.overnight, + time.change = year - lag(year), + fixed.charge.rate = L2231.onshore_wind_fcr, + OM.fixed = L2231.onshore_wind_OMfixed, + k1 = fixed.charge.rate / (CONV_YEAR_HOURS * CONV_KWH_GJ), + k2 = 1 / (CONV_YEAR_HOURS * CONV_KWH_GJ), + tech.change.period = (k1 * capital.tech.change.period * capital.overnight + k2 * OM.fixed) / + (k1 * capital.overnight + k2 * OM.fixed), + tech.change = round(abs(1 - (tech.change.period) ^ ( 1 / time.change)), energy.DIGITS_TECHCHANGE)) %>% + select(year, tech.change) %>% + filter(!is.na(tech.change), + year > max(MODEL_BASE_YEARS)) -> L2231.TechChange_onshore_wind + + # Calculate capacity factor for all GCAM regions + L223.StubTechCapFactor_elec %>% + filter(subsector == "wind", + !grepl("_offshore", stub.technology)) %>% + left_join_error_no_match(L2231.onshore_wind_curve %>% + distinct(region, CFmax), + by = c("region")) %>% + mutate(capacity.factor= round(CFmax, energy.DIGITS_CAPACITY_FACTOR)) %>% + select(region, supplysector, subsector, stub.technology, year, capacity.factor) -> L2231.StubTechCapFactor_onshore_wind + + # Grid connection costs are read in as fixed non-energy cost adders (in $/GJ). This is calculated using three things: + # 1. the average onshore wind $/kW-km data + # 2. representative distances from bins used by NREL to assess wind potential, and + # 3. Share of wind potential at various distance bins. + # The shares and the representative distances for the bins are multiplied to determine the effective average distance + # to grid for a given region, which is then multiplied to the $/kW-km cost to obtain the $/kW grid connection data. + # GCAM region capacity factors calculated above to convert data into $/kWh which is then converted to $/GJ, and the + # final number is obtained for each region by using the apporpriate FCR and deflator. The representative distance for + # each bin are respectively 25 miles (40 km), 75 miles (120 km) and 100 miles (160 km) - for bins of 0-50 miles, + # 50-100 miles, and 100+ miles. The literature generally assumes a 25-75 mile grid distance for onshore wind projects, + # so midpoints of the first two bins are utilized, while there are only a few projects developed beyond a 100 miles + # from the grid, so the minimum point for that bin is used to avoid skewing grid connection costs towards higher costs + # based on resources which are less likely to be developed. + + # First, get share of potential by each distance bin for each GCAM region + NREL_onshore_energy %>% + select(IAM_country, distance, total) %>% + left_join_error_no_match(iso_GCAM_regID %>% + select(country_name, GCAM_region_ID), + by = c("IAM_country" = "country_name")) %>% + left_join_error_no_match(GCAM_region_names, by = c("GCAM_region_ID")) %>% + select(-IAM_country, -GCAM_region_ID) %>% + group_by(region, distance) %>% + summarise(total = sum(total)) %>% + ungroup() %>% + group_by(region) %>% + mutate(share = total / sum(total)) %>% + ungroup() -> L2231.onshore_wind_potential_share + + # Then, generate bins for each cost point using representative distances + NREL_wind_energy_distance_range %>% + filter(technology == "onshore_wind") %>% + mutate(max = max * CONV_MILE_KM) -> NREL_wind_energy_distance_range + + # Add representative distances and cost to the potential share tables and calculate + # average cost per kW by region. + L2231.onshore_wind_potential_share %>% + left_join_error_no_match(onshore_wind_grid_cost %>% + select(-technology), + by = c("distance" = "distance_bin")) %>% + select(-distance, -total) %>% + mutate(cost = share * cost_per_kW_km * rep_dist_for_bin) %>% + group_by(region) %>% + summarise(cost = sum(cost)) %>% + ungroup() -> L2231.onshore_wind_cost_per_kW + + # Now to convert 2010 $/kW cost to 1975 $/GJ cost + L2231.onshore_wind_cost_per_kW %>% + left_join_error_no_match(L2231.StubTechCapFactor_onshore_wind %>% + select(region, capacity.factor) %>% + unique(), + by = c("region")) %>% + mutate(fcr = L2231.onshore_wind_fcr, + grid.cost = fcr * cost / (CONV_YEAR_HOURS * capacity.factor * CONV_KWH_GJ) * gdp_deflator(1975, 2010)) -> L2231.grid.cost + + # Set grid connection cost for all regions + GCAM_region_names %>% + select(region) %>% + left_join_error_no_match(L2231.grid.cost %>% + select(region, grid.cost), + by = "region") -> L2231.GridCost_onshore_wind + + # Preparing final tables + region_order <- unique(GCAM_region_names$region) + + L2231.onshore_wind_curve %>% + distinct(region, maxSubResource, mid.price, curve.exponent) %>% + mutate(renewresource = "onshore wind resource", + smooth.renewable.subresource = "onshore wind resource", + year.fillout = min(MODEL_BASE_YEARS)) %>% + select(region, renewresource, smooth.renewable.subresource, year.fillout, maxSubResource, mid.price, curve.exponent) %>% + mutate(region = factor(region, levels = region_order)) %>% + arrange(region) -> L2231.SmthRenewRsrcCurves_onshore_wind + + # Copying tech change to all regions + L2231.SmthRenewRsrcTechChange_onshore_wind <- write_to_all_regions(L2231.TechChange_onshore_wind, c("region", "year", "tech.change"), GCAM_region_names) + L2231.SmthRenewRsrcTechChange_onshore_wind %>% + mutate(renewresource = "onshore wind resource", + smooth.renewable.subresource = "onshore wind resource") %>% + select(region,renewresource, smooth.renewable.subresource, + year.fillout = year, techChange = tech.change) -> L2231.SmthRenewRsrcTechChange_onshore_wind + + # Reading the grid connection cost as a state-level non-energy cost adder + L223.StubTechCapFactor_elec %>% + filter(subsector == "wind", + !grepl("_offshore", stub.technology)) %>% + select(region, supplysector, subsector, stub.technology, year) %>% + mutate(minicam.non.energy.input = "regional price adjustment") %>% + left_join_error_no_match(L2231.GridCost_onshore_wind, by = c("region")) %>% + mutate(grid.cost = round(grid.cost, energy.DIGITS_COST)) %>% + rename(input.cost = grid.cost) -> L2231.StubTechCost_onshore_wind + + # =================================================== + # Produce outputs + + L2231.SmthRenewRsrcCurves_onshore_wind %>% + add_title("Smooth Renewable Resource Curve Onshore Wind") %>% + add_units("Unitless") %>% + add_comments("Resource curve and prices for onshore wind by region") %>% + add_legacy_name("L2231.SmthRenewRsrcCurves_onshore_wind") %>% + add_precursors( "common/iso_GCAM_regID", "common/GCAM_region_names", "energy/mappings/fuel_energy_input", "energy/A20.wind_class_CFs", "L113.globaltech_capital_ATB", "L113.globaltech_OMfixed_ATB", "energy/NREL_onshore_energy", "L223.StubTechCapFactor_elec") -> + L2231.SmthRenewRsrcCurves_onshore_wind + + L2231.StubTechCapFactor_onshore_wind %>% + add_title("Capacity factor Onshore Wind") %>% + add_units("Unitless") %>% + add_comments("Capital and O&M Capacity factor for onshore wind by region") %>% + add_legacy_name("L2231.StubTechCapFactor_onshore_wind") %>% + same_precursors_as("L2231.SmthRenewRsrcCurves_onshore_wind") -> + L2231.StubTechCapFactor_onshore_wind + + L2231.SmthRenewRsrcTechChange_onshore_wind %>% + add_title("Smooth Renewable Resource Technological Change Onshore Wind") %>% + add_units("Unitless") %>% + add_comments("Technological change associated with onshore wind by region and period") %>% + add_legacy_name("L2231.SmthRenewRsrcTechChange_onshore_wind") %>% + same_precursors_as("L2231.SmthRenewRsrcCurves_onshore_wind") -> + L2231.SmthRenewRsrcTechChange_onshore_wind + + L2231.StubTechCost_onshore_wind %>% + add_title("Cost of onshore wind") %>% + add_units("Unitless") %>% + add_comments("Regional price adjustment of input cost by region") %>% + add_legacy_name("L2231.StubTechCost_onshore_wind") %>% + same_precursors_as("L2231.SmthRenewRsrcCurves_onshore_wind") %>% + add_precursors("energy/onshore_wind_grid_cost", "energy/NREL_wind_energy_distance_range") -> + L2231.StubTechCost_onshore_wind + + return_data(L2231.SmthRenewRsrcCurves_onshore_wind, L2231.StubTechCapFactor_onshore_wind, L2231.SmthRenewRsrcTechChange_onshore_wind, L2231.StubTechCost_onshore_wind) + } else { + stop("Unknown command") + } +} diff --git a/inst/extras/zchunk_L242.ssp34_pasture_breakout_gcamv6p0.R b/inst/extras/zchunk_L242.ssp34_pasture_breakout_gcamv6p0.R new file mode 100644 index 0000000..f219c9e --- /dev/null +++ b/inst/extras/zchunk_L242.ssp34_pasture_breakout_gcamv6p0.R @@ -0,0 +1,161 @@ +# Copyright 2019 Battelle Memorial Institute; see the LICENSE file. + +#' module_aglu_L242.ssp34_pasture +#' +#' Construct the managed and unmanaged pasture allocation datasets for SSP3 and SSP4 +#' +#' @param command API command to execute +#' @param ... other optional parameters, depending on command +#' @return Depends on \code{command}: either a vector of required inputs, +#' a vector of output names, or (if \code{command} is "MAKE") all +#' the generated outputs: \code{L242.LN2_HistUnmgdAllocation_SSP34}, \code{L242.LN2_UnmgdAllocation_SSP34}, \code{L242.LN2_HistMgdAllocation_SSP34}, \code{L242.LN2_MgdAllocation_SSP34}. The corresponding file in the +#' original data system was \code{L242.ssp34_pasture.R} (aglu level2). +#' @details For unmanaged and managed pasture, adjust data so that their ratio is 0.25 and add node leaf names. +#' We do this for both historical and model base periods, isolating low-growth regions (defined by \code{aglu.LOW_GROWTH_PCGDP}). +#' @importFrom assertthat assert_that +#' @importFrom dplyr filter left_join mutate pull select +#' @author BBL June 2017 +module_aglu_L242.ssp34_pasture <- function(command, ...) { + if(command == driver.DECLARE_INPUTS) { + return(c(FILE = "common/GCAM_region_names", + FILE = "water/basin_to_country_mapping", + FILE = "aglu/GCAMLandLeaf_CdensityLT", + FILE = "aglu/A_LandLeaf_Unmgd2", + FILE = "aglu/A_LandLeaf2", + "L125.LC_bm2_R_LT_Yh_GLU", + "L102.pcgdp_thous90USD_Scen_R_Y")) + } else if(command == driver.DECLARE_OUTPUTS) { + return(c("L242.LN2_HistUnmgdAllocation_SSP34", + "L242.LN2_UnmgdAllocation_SSP34", + "L242.LN2_HistMgdAllocation_SSP34", + "L242.LN2_MgdAllocation_SSP34")) + } else if(command == driver.MAKE) { + + all_data <- list(...)[[1]] + + Land_Type <- value <- year <- region <- LandAllocatorRoot <- LandNode1 <- LandNode2 <- + UnmanagedLandLeaf <- allocation <- GCAM_region_ID <- GLU <- value.x <- value.y <- + LandLeaf <- scenario <- . <- NULL # silence package check notes + + # Load required inputs + GCAM_region_names <- get_data(all_data, "common/GCAM_region_names") + basin_to_country_mapping <- get_data(all_data, "water/basin_to_country_mapping") + GCAMLandLeaf_CdensityLT <- get_data(all_data, "aglu/GCAMLandLeaf_CdensityLT") + A_LandLeaf_Unmgd2 <- get_data(all_data, "aglu/A_LandLeaf_Unmgd2") + A_LandLeaf2 <- get_data(all_data, "aglu/A_LandLeaf2") + get_data(all_data, "L125.LC_bm2_R_LT_Yh_GLU", strip_attributes = TRUE) %>% + replace_GLU(basin_to_country_mapping) -> + L125.LC_bm2_R_LT_Yh_GLU + L102.pcgdp_thous90USD_Scen_R_Y <- get_data(all_data, "L102.pcgdp_thous90USD_Scen_R_Y") + + # Build tables + + FRACT_UNMGD_TO_MGD <- 0.25 + + # LAND ALLOCATION AND LAND USE HISTORY + # Subset the relevant land types from table with land cover by all land types + # Unmanaged land (lines 43-58 in old file) + L125.LC_bm2_R_LT_Yh_GLU %>% + filter(Land_Type == "UnmanagedPasture") %>% + left_join_error_no_match(GCAM_region_names, by = "GCAM_region_ID") %>% + # Adjust land cover downwards so more pasture is in the managed category + mutate(allocation = value * (1 - FRACT_UNMGD_TO_MGD)) %>% + add_node_leaf_names(nesting_table = A_LandLeaf_Unmgd2, leaf_name = "UnmanagedLandLeaf", "LandNode1", "LandNode2") %>% + #.................. + # gcambreakout - 06 Aug 2021 zarrar.khan@pnnl.gov + # Replacing NA's with 0's + #.................. + mutate(value = if_else(is.nan(value)|is.na(value),0,value))-> + L242.LC_bm2_R_Unmgd2_Yh_GLU.mlt + + # Historical land cover, unmanaged land in the second nest + L242.LC_bm2_R_Unmgd2_Yh_GLU.mlt %>% + filter(year %in% aglu.LAND_HISTORY_YEARS) %>% + select(region, LandAllocatorRoot, LandNode1, LandNode2, UnmanagedLandLeaf, year, allocation) -> + L242.LN2_HistUnmgdAllocation_ALL + + # Model base period land cover, unmanaged land in the second nest + L242.LC_bm2_R_Unmgd2_Yh_GLU.mlt %>% + filter(year %in% MODEL_BASE_YEARS) %>% + select(region, LandAllocatorRoot, LandNode1, LandNode2, UnmanagedLandLeaf, year, allocation) -> + L242.LN2_UnmgdAllocation_ALL + + # Managed land (60-75) + L125.LC_bm2_R_LT_Yh_GLU %>% + filter(Land_Type == "Pasture") %>% + left_join_error_no_match(GCAM_region_names, by = "GCAM_region_ID") %>% + left_join_error_no_match(select(L242.LC_bm2_R_Unmgd2_Yh_GLU.mlt, GCAM_region_ID, year, GLU, value), by = c("GCAM_region_ID", "year", "GLU")) %>% + mutate(allocation = value.x + FRACT_UNMGD_TO_MGD * value.y) %>% + select(GCAM_region_ID, Land_Type, GLU, year, value = value.x, region, allocation) %>% + add_node_leaf_names(nesting_table = A_LandLeaf2, leaf_name = "LandLeaf", "LandNode1", "LandNode2") -> + L242.LC_bm2_R_Mgd2_Yh_GLU.mlt + + # Historical land cover, managed land in the second nest + L242.LC_bm2_R_Mgd2_Yh_GLU.mlt %>% + filter(year %in% aglu.LAND_HISTORY_YEARS) %>% + select(region, LandAllocatorRoot, LandNode1, LandNode2, LandLeaf, year, allocation) -> + L242.LN2_HistMgdAllocation_ALL + + # Model base period land cover, managed land in the second nest + L242.LC_bm2_R_Mgd2_Yh_GLU.mlt %>% + filter(year %in% MODEL_BASE_YEARS) %>% + select(region, LandAllocatorRoot, LandNode1, LandNode2, LandLeaf, year, allocation) -> + L242.LN2_MgdAllocation_ALL + + # Create SSP4 pasture inputs, isolating poor (low GDP) regions for subsequent filtering + get_ssp_regions(L102.pcgdp_thous90USD_Scen_R_Y, GCAM_region_names, "low") -> + low_gdp_regions + + # Produce outputs + + L242.LN2_HistUnmgdAllocation_ALL %>% + filter(region %in% low_gdp_regions) %>% + add_title("Historical unmanaged pasture allocation for low-GDP regions") %>% + add_units("billion square meters (bm2)") %>% + add_comments("For unmanaged and managed pasture, adjust data so that their ratio is 0.25; add node leaf names.") %>% + add_comments("Do this for both historical and model base periods, isolating low-GDP regions.") %>% + add_legacy_name("L242.LN2_HistUnmgdAllocation_SSP34") %>% + add_precursors("common/GCAM_region_names", + "water/basin_to_country_mapping", + "aglu/GCAMLandLeaf_CdensityLT", + "aglu/A_LandLeaf_Unmgd2", + "aglu/A_LandLeaf2", + "L125.LC_bm2_R_LT_Yh_GLU", + "L102.pcgdp_thous90USD_Scen_R_Y") -> + L242.LN2_HistUnmgdAllocation_SSP34 + + L242.LN2_UnmgdAllocation_ALL %>% + filter(region %in% low_gdp_regions) %>% + add_title("Model period unmanaged pasture allocation for low-GDP regions") %>% + add_units("billion square meters (bm2)") %>% + add_comments("For unmanaged and managed pasture, adjust data so that their ratio is 0.25; add node leaf names.") %>% + add_comments("Do this for both historical and model base periods, isolating low-GDP regions.") %>% + add_legacy_name("L242.LN2_UnmgdAllocation_SSP34") %>% + same_precursors_as(L242.LN2_HistUnmgdAllocation_SSP34) -> + L242.LN2_UnmgdAllocation_SSP34 + + L242.LN2_HistMgdAllocation_ALL %>% + filter(region %in% low_gdp_regions) %>% + add_title("Historical managed pasture allocation for low-GDP regions") %>% + add_units("billion square meters (bm2)") %>% + add_comments("For unmanaged and managed pasture, adjust data so that their ratio is 0.25; add node leaf names.") %>% + add_comments("Do this for both historical and model base periods, isolating low-GDP regions.") %>% + add_legacy_name("L242.LN2_HistMgdAllocation_SSP34") %>% + same_precursors_as(L242.LN2_HistUnmgdAllocation_SSP34) -> + L242.LN2_HistMgdAllocation_SSP34 + + L242.LN2_MgdAllocation_ALL %>% + filter(region %in% low_gdp_regions) %>% + add_title("Model period managed pasture allocation for low-GDP regions") %>% + add_units("billion square meters (bm2)") %>% + add_comments("For unmanaged and managed pasture, adjust data so that their ratio is 0.25; add node leaf names.") %>% + add_comments("Do this for both historical and model base periods, isolating low-GDP regions.") %>% + add_legacy_name("L242.LN2_MgdAllocation_SSP34") %>% + same_precursors_as(L242.LN2_HistUnmgdAllocation_SSP34) -> + L242.LN2_MgdAllocation_SSP34 + + return_data(L242.LN2_HistUnmgdAllocation_SSP34, L242.LN2_UnmgdAllocation_SSP34, L242.LN2_HistMgdAllocation_SSP34, L242.LN2_MgdAllocation_SSP34) + } else { + stop("Unknown command") + } +} diff --git a/inst/extras/zchunk_L252.MACC_breakout_gcamv6p0.R b/inst/extras/zchunk_L252.MACC_breakout_gcamv6p0.R new file mode 100644 index 0000000..b79a26b --- /dev/null +++ b/inst/extras/zchunk_L252.MACC_breakout_gcamv6p0.R @@ -0,0 +1,803 @@ +# Copyright 2019 Battelle Memorial Institute; see the LICENSE file. + +#' module_emissions_L252.MACC +#' +#' Creates marginal abatement cost curves "MACC", for fossil resources, agriculture, animals, and processing. +#' +#' @param command API command to execute +#' @param ... other optional parameters, depending on command +#' @return Depends on \code{command}: either a vector of required inputs, +#' a vector of output names, or (if \code{command} is "MAKE") all +#' the generated outputs: \code{L252.ResMAC_fos}, \code{L252.AgMAC}, \code{L252.MAC_an}, \code{L252.MAC_prc}, +#' \code{L252.MAC_higwp}, \code{L252.ResMAC_fos_tc_average}, \code{L252.AgMAC_tc_average}, \code{L252.MAC_an_tc_average}, +#' \code{L252.MAC_prc_tc_average}, \code{L252.MAC_higwp_tc_average}, +#' \code{L252.MAC_Ag_TC_SSP1}, \code{L252.MAC_An_TC_SSP1}, \code{L252.MAC_prc_TC_SSP1}, \code{L252.MAC_higwp_TC_SSP1}, +#' \code{L252.MAC_res_TC_SSP1}, \code{L252.MAC_Ag_TC_SSP2}, \code{L252.MAC_An_TC_SSP2}, \code{L252.MAC_prc_TC_SSP2}, +#' \code{L252.MAC_res_TC_SSP2}, \code{L252.MAC_higwp_TC_SSP2}, \code{L252.MAC_Ag_TC_SSP5}, \code{L252.MAC_An_TC_SSP5}, +#' \code{L252.MAC_prc_TC_SSP5}, \code{L252.MAC_res_TC_SSP5}, \code{L252.MAC_higwp_TC_SSP5}. The corresponding file in the +#' original data system was \code{L252.MACC.R} (emissions level2). +#' @details Creates marginal abatement cost curves "MACC", for fossil resources, agriculture, animals, and processing. +#' @importFrom assertthat assert_that +#' @importFrom dplyr arrange bind_rows distinct filter left_join matches mutate select slice +#' @importFrom tidyr gather +#' @author RH August 2017 +module_emissions_L252.MACC <- function(command, ...) { + if(command == driver.DECLARE_INPUTS) { + return(c(FILE = "emissions/A_regions", + FILE = "emissions/A_MACC_TechChange_omit", + FILE = "emissions/A_MACC_TechChange_SSP_Mult", + FILE = "emissions/mappings/CEDS_sector_tech_proc", + FILE = "emissions/mappings/CEDS_sector_tech_proc_revised", + FILE = "common/GCAM_region_names", + FILE = "common/iso_GCAM_regID", + FILE = "water/basin_to_country_mapping", + FILE = "emissions/EPA_MACC_PhaseInTime", + "L152.MAC_pct_R_S_Proc_EPA", + "L201.ghg_res", + "L211.AGREmissions", + "L211.AnEmissions", + "L211.AGRBio", + "L232.nonco2_prc", + "L241.hfc_all", + "L241.pfc_all")) + } else if(command == driver.DECLARE_OUTPUTS) { + return(c("L252.ResMAC_fos", + "L252.AgMAC", + "L252.MAC_an", + "L252.MAC_prc", + "L252.MAC_higwp", + "L252.ResMAC_fos_phaseInTime", + "L252.MAC_prc_phaseInTime", + "L252.MAC_higwp_phaseInTime", + "L252.ResMAC_fos_tc_average", + "L252.AgMAC_tc_average", + "L252.MAC_an_tc_average", + "L252.MAC_prc_tc_average", + "L252.MAC_higwp_tc_average", + "L252.MAC_Ag_TC_SSP1", + "L252.MAC_An_TC_SSP1", + "L252.MAC_prc_TC_SSP1", + "L252.MAC_res_TC_SSP1", + "L252.MAC_higwp_TC_SSP1", + "L252.MAC_Ag_TC_SSP2", + "L252.MAC_An_TC_SSP2", + "L252.MAC_prc_TC_SSP2", + "L252.MAC_res_TC_SSP2", + "L252.MAC_higwp_TC_SSP2", + "L252.MAC_Ag_TC_SSP5", + "L252.MAC_An_TC_SSP5", + "L252.MAC_prc_TC_SSP5", + "L252.MAC_res_TC_SSP5", + "L252.MAC_higwp_TC_SSP5")) + } else if(command == driver.MAKE) { + + # Silence package checks + . <- AgProductionTechnology <- AgSupplySector <- AgSupplySubsector <- EPA_MACC_Sector <- EPA_region <- + MAC_region <- Non.CO2 <- PCT_ABATE <- Process <- Species <- Year <- bio_N2O_coef <- + resource <- emiss.coef <- input.emissions <- mac.control <- mac.reduction <- region <- + scenario <- sector <- stub.technology <- subsector <- supplysector <- tax <- tech_change <- + market.name <- year <- Irr_Rfd <- mgmt <- tech.change.year <- tech.change <- Non.CO2.join <- + multiplier <- omit <- NULL + + all_data <- list(...)[[1]] + + #silence packages + base.year <- subresource <- technology <- key <- mac.reduction.base <- Sector <- GCAM_region_ID <- EPA_country <- iso <- EPA_sector <- NULL + + + # Load required inputs + A_regions <- get_data(all_data, "emissions/A_regions") + GCAM_region_names <- get_data(all_data, "common/GCAM_region_names") + A_MACC_TechChange_omit <- get_data(all_data, "emissions/A_MACC_TechChange_omit") + A_MACC_TechChange_SSP_Mult <- get_data(all_data, "emissions/A_MACC_TechChange_SSP_Mult") + GCAM_sector_tech <- get_data(all_data, "emissions/mappings/CEDS_sector_tech_proc") + if (energy.TRAN_UCD_MODE == "rev.mode"){ + GCAM_sector_tech <- get_data(all_data, "emissions/mappings/CEDS_sector_tech_proc_revised") + + } + + L152.MAC_pct_R_S_Proc_EPA <- get_data(all_data, "L152.MAC_pct_R_S_Proc_EPA") + L201.ghg_res <- get_data(all_data, "L201.ghg_res", strip_attributes = TRUE) + L211.AGREmissions <- get_data(all_data, "L211.AGREmissions", strip_attributes = TRUE) + L211.AnEmissions <- get_data(all_data, "L211.AnEmissions", strip_attributes = TRUE) + L211.AGRBio <- get_data(all_data, "L211.AGRBio", strip_attributes = TRUE) + L232.nonco2_prc <- get_data(all_data, "L232.nonco2_prc", strip_attributes = TRUE) + L241.hfc_all <- get_data(all_data, "L241.hfc_all", strip_attributes = TRUE) + L241.pfc_all <- get_data(all_data, "L241.pfc_all", strip_attributes = TRUE) + EPA_MACC_PhaseInTime <- get_data(all_data, "emissions/EPA_MACC_PhaseInTime") + + + #........................ + # gcambreakout 17 July 2022 + # Temporary fix until circular dependency on + # L123.LC_bm2_R_MgdFor_Yh_GLU_beforeadjust is fixed. + #........................ + + iso_GCAM_regID <- get_data(all_data, "common/iso_GCAM_regID") + basin_to_country_mapping <- get_data(all_data, "water/basin_to_country_mapping") + + # Valid GLU Region combos + glu_gcam <- basin_to_country_mapping %>% + dplyr::select(iso=ISO, GLU=GLU_code, GLU_name) %>% + dplyr::mutate(iso = tolower(iso)) %>% + dplyr::left_join(iso_GCAM_regID, by=c("iso")) %>% + dplyr::select(GLU, GCAM_region_ID, GLU_name) %>% + dplyr::filter(GCAM_region_ID > 32) %>% + unique() %>% + dplyr::left_join(GCAM_region_names); glu_gcam + + remove_glu <- glu_gcam$GLU_name %>% unique(); remove_glu + regions_check <- GCAM_region_names$region[!GCAM_region_names$region %in% glu_gcam$region]; regions_check + + L211.AGREmissions %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L211.AGREmissions + + L211.AGRBio %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L211.AGRBio + #.................... gcambreakout close edits + + # update MAC using 2019 EPA + # Prepare the table with all MAC curves for matching + # This contains all tax and mac.reduction values + L152.MAC_pct_R_S_Proc_EPA %>% + left_join(GCAM_region_names, by = "GCAM_region_ID") %>% + select(-GCAM_region_ID, -Sector) -> + L252.MAC_pct_R_S_Proc_EPA + + MAC_taxes <- unique(L252.MAC_pct_R_S_Proc_EPA$tax) + + # This is a function to add in the mac.reduction curves to data + # Function needed because these steps are repeated 5 times + + mac_reduction_adder <- function(df, error_no_match = TRUE) { + df <- df %>% + # Add tax values + repeat_add_columns(tibble(tax = MAC_taxes)) %>% + repeat_add_columns(tibble(year = emissions.EPA_MACC_YEAR)) %>% + # we don't need MACs for calibration years + filter(!year %in% MODEL_BASE_YEARS) + # Next, add in mac.reduction values + if(error_no_match) { + # Usually we use left_join_error_no_match + df <- df %>% + left_join_error_no_match(L252.MAC_pct_R_S_Proc_EPA, by = c("region", "mac.control", "tax", "year")) %>% + mutate(mac.reduction = round(mac.reduction, emissions.DIGITS_MACC)) + } else { + # There are times where the data does not match, so using left_join is necessary + df <- df %>% + left_join(L252.MAC_pct_R_S_Proc_EPA, by = c("region", "mac.control", "tax", "year")) %>% + mutate(mac.reduction = round(mac.reduction, emissions.DIGITS_MACC)) + } + return(df) + } + + # Part 1: calculate year-specific technological change for all region/sector + # -------------------------------------------------------------------------------------------------------- + # L252.ResMAC_fos: Fossil resource MAC curves + # NOTE: only applying the fossil resource MAC curves to the CH4 emissions + # L252.ResMAC_fos_full contains year-specific MACs for all future modeling periods till 2050 + L252.ResMAC_fos_full <- L201.ghg_res %>% + select(-emiss.coef, -year) %>% + distinct() %>% + filter(Non.CO2 == "CH4") %>% + # Add in mac.control + left_join_error_no_match(GCAM_sector_tech %>% + filter(sector == "out_resources") %>% + select(mac.control = EPA_MACC_Sector, subsector), + by = c("resource" = "subsector")) %>% + mac_reduction_adder %>% + arrange(region, resource) %>% + # Add column for market variable + mutate(market.name = emissions.MAC_MARKET) %>% + # Remove EPA_Region - useful up to now for diagnostic, but not needed for csv->xml conversion + select(LEVEL2_DATA_NAMES[["ResMAC"]]) + + # L252.AgMAC: Agricultural abatement (including bioenergy) + # L252.AgMAC_full contains year-specific MACs for all future modeling periods till 2050 + L252.AgMAC_full <- L211.AGREmissions %>% + select(-input.emissions, -year) %>% + bind_rows(L211.AGRBio %>% + select(-bio_N2O_coef, -year)) %>% + distinct() %>% + filter(Non.CO2 %in% emissions.AG_MACC_GHG_NAMES) %>% + # Add in mac.control + left_join_error_no_match(GCAM_sector_tech %>% + select(mac.control = EPA_MACC_Sector, supplysector) %>% + distinct, # taking distinct values because there were repeats for AEZs + by = c("AgSupplySector" = "supplysector")) %>% + mac_reduction_adder %>% + arrange(region, AgProductionTechnology) %>% + # Add column for market variable + mutate(market.name = emissions.MAC_MARKET) %>% + repeat_add_columns(tibble(Irr_Rfd = paste0(aglu.IRR_DELIMITER, c("IRR", "RFD")))) %>% + repeat_add_columns(tibble(mgmt = paste0(aglu.MGMT_DELIMITER, c("lo", "hi")))) %>% + unite(AgProductionTechnology, AgProductionTechnology, Irr_Rfd, mgmt, sep = "") %>% + # Remove EPA_Region - useful up to now for diagnostic, but not needed for csv->xml conversion + select(region, AgSupplySector, AgSupplySubsector, AgProductionTechnology, year, Non.CO2, + mac.control, tax, mac.reduction, market.name) + + # L252.MAC_an: Abatement from animal production + # L252.MAC_an_full contains year-specific MACs for all future modeling periods till 2050 + L252.MAC_an_full <- L211.AnEmissions %>% + select(-input.emissions, -year) %>% + distinct() %>% + filter(Non.CO2 %in% emissions.AG_MACC_GHG_NAMES) %>% + # Add in mac.control + left_join_error_no_match(GCAM_sector_tech %>% + select(mac.control = EPA_MACC_Sector, supplysector) %>% + distinct, # taking distinct values because there are repeats for different technologies + by = "supplysector") %>% + mac_reduction_adder %>% + arrange(region, supplysector, subsector, stub.technology, Non.CO2) %>% + # Add column for market variable + mutate(market.name = emissions.MAC_MARKET) %>% + # Remove EPA_Region - useful up to now for diagnostic, but not needed for csv->xml conversion + select(region, supplysector, subsector, stub.technology, year, Non.CO2, mac.control, + tax, mac.reduction, market.name) + + # L252.MAC_prc: Abatement from industrial and urban processes + # L252.MAC_prc_full contains year-specific MACs for all future modeling periods till 2050 + L252.MAC_prc_full <- L232.nonco2_prc %>% + select(-input.emissions, -year) %>% + distinct() %>% + filter(Non.CO2 %in% emissions.GHG_NAMES) %>% + # Add in mac.control + # Using left_join b/c mac.control for "other industrial processes" is NA + left_join(GCAM_sector_tech %>% + select(mac.control = EPA_MACC_Sector, supplysector, subsector, stub.technology), + by = c("supplysector", "subsector", "stub.technology")) %>% + mac_reduction_adder(# error_no_match is F, which means we use left_join(L252.MAC_pct_R_S_Proc_EPA) + # because not all mac.controls and regions in L252.MAC_pct_R_S_Proc_EPA + error_no_match = FALSE) %>% + arrange(region, supplysector, subsector, stub.technology, Non.CO2) %>% + na.omit() %>% + # Add column for market variable + mutate(market.name = emissions.MAC_MARKET) %>% + # Remove EPA_Region - useful up to now for diagnostic, but not needed for csv->xml conversion + select(region, supplysector, subsector, stub.technology, year, Non.CO2, mac.control, tax, mac.reduction, market.name) + + # L252.MAC_higwp: Abatement from HFCs, PFCs, and SF6 + # L252.MAC_higwp_full contains year-specific MACs for all future modeling periods till 2050 + L252.MAC_higwp_full <- bind_rows(L241.hfc_all, L241.pfc_all) %>% + select(-input.emissions, -year) %>% + distinct() %>% + # Add in mac.control + # Using left_join b/c mac.control for "other industrial processes" is NA + left_join(GCAM_sector_tech %>% + select(mac.control = EPA_MACC_Sector, supplysector, subsector, stub.technology), + by = c("supplysector", "subsector", "stub.technology")) %>% + # use error_no_match = FALSE becuase not all regions/sectors have the same MAC controls + mac_reduction_adder(error_no_match = FALSE) %>% + arrange(region, supplysector, subsector, stub.technology, Non.CO2) %>% + # Add column for market variable + mutate(market.name = emissions.MAC_MARKET) %>% + # Remove EPA_Region - useful up to now for diagnostic, but not needed for csv->xml conversion + select(region, supplysector, subsector, stub.technology, year, Non.CO2, mac.control, tax, mac.reduction, market.name) + + # combine MACs from all sectors together, including year-specific MACs from 2020 to 2050 + # in order to backward calculate tech.change for future periods relative to base MAC values + L252.MAC_summary <- L252.MAC_higwp_full %>% + bind_rows(L252.MAC_prc_full) %>% + bind_rows(L252.MAC_an_full) %>% + bind_rows(L252.AgMAC_full %>% + rename(supplysector = AgSupplySector, + subsector = AgSupplySubsector, + stub.technology = AgProductionTechnology)) %>% + bind_rows(L252.ResMAC_fos_full %>% + rename(supplysector = resource, + subsector = subresource, + stub.technology = technology)) %>% + filter(tax == max(tax)) %>% + select(-tax, -market.name) %>% + distinct() + + # some region/sector have mac.reductions of zeros at all prices (so no MAC for these region/sector) + # here remove unnecessary region/technology without any mac.reduction + L252.MAC_remove <- L252.MAC_summary %>% + group_by(region, supplysector, subsector, stub.technology, Non.CO2, mac.control) %>% + summarise(sum = sum(mac.reduction)) %>% + ungroup() %>% + filter(sum == 0) %>% + select(region, supplysector, subsector, stub.technology, Non.CO2, mac.control) %>% + distinct() %>% + mutate(key = paste(region, supplysector, subsector, stub.technology, Non.CO2, sep = "-")) + + # We will only defind MAC one time at a base MAC year, which is the first non-all-zero-MAC year + # first non-all-zero-MAC year can be different acorss region/sector but mostly is 2020 + L252.MAC_base_TC <- L252.MAC_summary %>% + mutate(key = paste(region, supplysector, subsector, stub.technology, Non.CO2, sep = "-")) %>% + filter(!(key %in% L252.MAC_remove$key)) %>% + select(-key, -mac.control) %>% + filter(mac.reduction > 0) %>% + rename(mac.reduction.base = mac.reduction) %>% + # use left_join to only keep omit != 1 rows (NAs) + # here cooling' mitigation potential increased a lot (leading to tech.change > 1), so use the + # second non-all-zero-MAC year has its MAC Tech.change base year + left_join(A_MACC_TechChange_omit, by = c("supplysector", "year")) %>% + filter(is.na(omit)) %>% + select(-omit) %>% + # first tech.change year is the next modeling period of the MAC defined years + # here add 5 years so they can be used to match with their corresponding "next period" + mutate(year = year + emissions.EPA_TC_TIMESTEP) + + # based on EPA's year's specific MACs (2020-2050 by every 5 year) to backward calculate technology.change + # these are tech.change before 2050, based on actual EPA MAC data + L252.MAC_summary_TC_before2050 <- L252.MAC_summary %>% + mutate(key = paste(region, supplysector, subsector, stub.technology, Non.CO2, sep = "-")) %>% + filter(!(key %in% L252.MAC_remove$key)) %>% + select(-key) %>% + filter(mac.reduction > 0) %>% + left_join(L252.MAC_base_TC, + by = c("region", "supplysector", "subsector", "stub.technology", "Non.CO2", "year")) %>% + na.omit() %>% + mutate(tech.change = (mac.reduction / mac.reduction.base)^(1/emissions.EPA_TC_TIMESTEP) - 1) %>% + # round to 4 digits otherwise it will be > 10 digits and long in xmls + mutate(tech.change = round(tech.change, emissions.DIGITS_MACC_TC)) %>% + replace_na(list(tech.change = 0)) %>% + select(region, supplysector, subsector, stub.technology, year, Non.CO2, mac.control, tech.change) %>% + mutate(key = paste(supplysector, subsector, Non.CO2, sep = "-")) %>% + # replace negative tech.change into 0s + mutate(tech.change = if_else(tech.change < 0, 0, tech.change)) + + + # since the current EPA MAC data (2019 version) only covers 2020 to 2050 + # we assume constant post-2050 TCs as the average of pre-2050 values + + # copy and paste average values for all future years, assuming constant tech.change (the average tech.change) + L252.MAC_summary_TC_post2050_average <- L252.MAC_summary_TC_before2050 %>% + group_by(region, supplysector, subsector, stub.technology, Non.CO2, mac.control, key) %>% + summarise(tech.change = mean(tech.change)) %>% + ungroup() %>% + repeat_add_columns(tibble(year = emissions.EPA_MACC_FUTURE_YEAR)) + + # combine together + # L252.MAC_summary_TC_average contains TC for all future periods greater than MAC base-year for each region/sector + L252.MAC_summary_TC_average <- bind_rows(L252.MAC_summary_TC_before2050, L252.MAC_summary_TC_post2050_average) + + + # Part 2: calculate the MAC curve for each region/sector, so the TCs above can be applied to + # therefore we only need to define MAC once in a base year, combined with year-specific TCs to adjust it for future years + # -------------------------------------------------------------------------------------------------------- + + # find the first non-all-zero-MAC year, maybe different by region/sector + # here conduct this process at this combined tibble (L252.MAC_summary) containing all sectors + # the idea is creating a varible called "key" containing the combined information of sector-subsector-technology-gas-base.year + # both the one-time MAC (MAC at base year) and all TCs will be defined at this sector/subsector/technology/gas/base.year in xmls + L252.MAC_base_year <- L252.MAC_summary %>% + # use left_join to only keep omit != 1 rows (NAs) + # here cooling' mitigation potential increased a lot (leading to tech.change > 1), so use the + # second non-all-zero-MAC year has its MAC Tech.change base year + left_join(A_MACC_TechChange_omit, by = c("supplysector", "year")) %>% + filter(is.na(omit)) %>% + select(-omit) %>% + mutate(key = paste(region, supplysector, subsector, stub.technology, Non.CO2, sep = "-")) %>% + filter(!(key %in% L252.MAC_remove$key)) %>% + filter(mac.reduction > 0) %>% + group_by(key) %>% + arrange() %>% + slice(1) %>% + ungroup() %>% + rename(mac.reduction.base = mac.reduction) %>% + rename(base.year = year) %>% + mutate(key = paste(region, supplysector, subsector, stub.technology, Non.CO2, base.year, sep = "-")) %>% + select(key, base.year) + + # next will create MAC file for each broad catagory as usual + + # 1) AgMAC for agriculture + # base-year MAC curve + L252.AgMAC <- L252.AgMAC_full %>% + mutate(key = paste(region, AgSupplySector, AgSupplySubsector, AgProductionTechnology, Non.CO2, year, sep = "-")) %>% + left_join(L252.MAC_base_year, by = "key") %>% + na.omit() %>% + select(-key, -base.year) + + # combination of sector/subsector/gas used to isolate TC rows from the combined TC file (L252.MAC_summary_TC_average) + Ag_key <- L252.AgMAC %>% + select(AgSupplySector, AgSupplySubsector, Non.CO2) %>% + distinct() %>% + mutate(key = paste(AgSupplySector, AgSupplySubsector, Non.CO2, sep = "-")) + + L252.AgMAC_tc_average <- L252.MAC_summary_TC_average %>% + filter(key %in% Ag_key$key) %>% + rename(AgSupplySector = supplysector, + AgSupplySubsector = subsector, + AgProductionTechnology = stub.technology, + tech.change.year = year) %>% + left_join_error_no_match(L252.AgMAC %>% select(-tax, -mac.reduction) %>% distinct(), + by = c("region", "AgSupplySector", "AgSupplySubsector", "AgProductionTechnology", "Non.CO2", "mac.control")) %>% + select(region, AgSupplySector, AgSupplySubsector, AgProductionTechnology, year, Non.CO2, mac.control, tech.change.year, tech.change) + + # 2) L252.MAC_an for livestock + # base-year MAC curve + L252.MAC_an <- L252.MAC_an_full %>% + mutate(key = paste(region, supplysector, subsector, stub.technology, Non.CO2, year, sep = "-")) %>% + left_join(L252.MAC_base_year, by = "key") %>% + na.omit() %>% + select(-key, -base.year) + + # combination of sector/subsector/gas used to isolate TC rows from the combined TC file (L252.MAC_summary_TC_average) + An_key <- L252.MAC_an %>% + select(supplysector, subsector, Non.CO2) %>% + distinct() %>% + mutate(key = paste(supplysector, subsector, Non.CO2, sep = "-")) + + L252.MAC_an_tc_average <- L252.MAC_summary_TC_average %>% + filter(key %in% An_key$key) %>% + rename(tech.change.year = year) %>% + left_join_error_no_match(L252.MAC_an %>% select(-tax, -mac.reduction) %>% distinct(), + by = c("region", "supplysector", "subsector", "stub.technology", "Non.CO2", "mac.control")) %>% + select(region, supplysector, subsector, stub.technology, year, Non.CO2, mac.control, tech.change.year, tech.change) + + # 3) L252.MAC_prc for process emissions + # base-year MAC curve + L252.MAC_prc <- L252.MAC_prc_full %>% + mutate(key = paste(region, supplysector, subsector, stub.technology, Non.CO2, year, sep = "-")) %>% + left_join(L252.MAC_base_year, by = "key") %>% + na.omit() %>% + select(-key, -base.year) + + # combination of sector/subsector/gas used to isolate TC rows from the combined TC file (L252.MAC_summary_TC_average) + Proc_key <- L252.MAC_prc %>% + select(supplysector, subsector, Non.CO2) %>% + distinct() %>% + mutate(key = paste(supplysector, subsector, Non.CO2, sep = "-")) + + L252.MAC_prc_tc_average <- L252.MAC_summary_TC_average %>% + filter(key %in% Proc_key$key) %>% + rename(tech.change.year = year) %>% + left_join_error_no_match(L252.MAC_prc %>% select(-tax, -mac.reduction) %>% distinct(), + by = c("region", "supplysector", "subsector", "stub.technology", "Non.CO2", "mac.control")) %>% + select(region, supplysector, subsector, stub.technology, year, Non.CO2, mac.control, tech.change.year, tech.change) + + # 4) L252.MAC_higwp for F-gases + # base-year MAC curve + L252.MAC_higwp <- L252.MAC_higwp_full %>% + mutate(key = paste(region, supplysector, subsector, stub.technology, Non.CO2, year, sep = "-")) %>% + left_join(L252.MAC_base_year, by = "key") %>% + na.omit() %>% + select(-key, -base.year) + + # combination of sector/subsector/gas used to isolate TC rows from the combined TC file (L252.MAC_summary_TC_average) + HighGwp_key <- L252.MAC_higwp %>% + select(supplysector, subsector, Non.CO2) %>% + distinct() %>% + mutate(key = paste(supplysector, subsector, Non.CO2, sep = "-")) + + L252.MAC_higwp_tc_average <- L252.MAC_summary_TC_average %>% + filter(key %in% HighGwp_key$key) %>% + rename(tech.change.year = year) %>% + left_join_error_no_match(L252.MAC_higwp %>% select(-tax, -mac.reduction) %>% distinct(), + by = c("region", "supplysector", "subsector", "stub.technology", "Non.CO2", "mac.control")) %>% + select(region, supplysector, subsector, stub.technology, year, Non.CO2, mac.control, tech.change.year, tech.change) + + # 5) L252.ResMAC_fos for resource production + # base-year MAC curve + L252.ResMAC_fos <- L252.ResMAC_fos_full %>% + mutate(key = paste(region, resource, subresource, technology, Non.CO2, year, sep = "-")) %>% + left_join(L252.MAC_base_year, by = "key") %>% + na.omit() %>% + select(-key, -base.year) %>% + mutate(year = emissions.CTRL_BASE_YEAR) + + # combination of sector/subsector/gas used to isolate TC rows from the combined TC file (L252.MAC_summary_TC_average) + Res_key <- L252.ResMAC_fos %>% + select(resource, subresource, Non.CO2) %>% + distinct() %>% + mutate(key = paste(resource, subresource, Non.CO2, sep = "-")) + + L252.ResMAC_fos_tc_average <- L252.MAC_summary_TC_average %>% + filter(key %in% Res_key$key) %>% + rename(resource = supplysector, + subresource = subsector, + technology = stub.technology, + tech.change.year = year) %>% + mutate(year = emissions.CTRL_BASE_YEAR) %>% + select(region, resource, subresource, technology, year, Non.CO2, mac.control, tech.change.year, tech.change) + + + # create mac-phase-in-time for MAC data + + # explicitly process this for separated tibbles in case in these phase-in-fractions varied by sector + # currently only apply to energy and industry process sectors + # NOTE: agricultre sectors will not apply phaseInTime + # phase-in-fraction should be just applied to the year when MAC read in + # so it would be convenient to just use the current technology-change data files to replace columns + + L252.ResMAC_fos_tc_average %>% + select(region, resource, subresource, technology, year, Non.CO2, mac.control) %>% + distinct() %>% + left_join_error_no_match(EPA_MACC_PhaseInTime, by = c("mac.control")) -> + L252.ResMAC_fos_phaseInTime + + L252.MAC_higwp_tc_average %>% + select(region, supplysector, subsector, stub.technology, year, Non.CO2, mac.control) %>% + distinct() %>% + left_join_error_no_match(EPA_MACC_PhaseInTime, by = c("mac.control")) -> + L252.MAC_higwp_phaseInTime + + L252.MAC_prc_tc_average %>% + select(region, supplysector, subsector, stub.technology, year, Non.CO2, mac.control) %>% + distinct() %>% + left_join_error_no_match(EPA_MACC_PhaseInTime, by = c("mac.control")) -> + L252.MAC_prc_phaseInTime + + # Put the tech change pipeline into a helper function since it will be repeated for each + # of the emissions sectors + # here we directly process the XXX_tc tables for SSPs + adjust_tech_change_ssp <- function(df) { + df %>% + repeat_add_columns(tibble(scenario = A_MACC_TechChange_SSP_Mult$scenario)) %>% + left_join_error_no_match(A_MACC_TechChange_SSP_Mult, by = c("scenario")) %>% + mutate(tech.change = tech.change * multiplier) %>% + select(-multiplier) + } + + # L252.MAC_TC: Tech Change on MACCs + # For all tibbles, add in scenarios and tech change, then split by scenario and add in documentation + L252.MAC_Ag_TC <- L252.AgMAC_tc_average %>% + adjust_tech_change_ssp() %>% + split(.$scenario) %>% + lapply(function(df) { + df %>% + add_title("Marginal Abatement Cost Curves with Technology Changes for Agriculture crop") %>% + add_units("tax: 1990 USD; mac.reduction: % reduction; tech_change: Unitless") %>% + add_comments("adjust L252.AgMAC_tc_average to reflect variations in SSPs") %>% + add_comments("Technology change data added in from A_MACC_TechChange_SSP_Mult") %>% + same_precursors_as("L252.AgMAC_tc_average") %>% + add_precursors("emissions/A_MACC_TechChange_SSP_Mult") %>% + select(-scenario) + }) + + + L252.MAC_An_TC <- L252.MAC_an_tc_average %>% + adjust_tech_change_ssp() %>% + split(.$scenario) %>% + lapply(function(df) { + df %>% + add_title("Marginal Abatement Cost Curves with Technology Changes for Animals") %>% + add_units("tax: 1990 USD; mac.reduction: % reduction; tech_change: Unitless") %>% + add_comments("adjust L252.MAC_an_tc_average to reflect variations in SSPs") %>% + add_comments("Technology change data added in from A_MACC_TechChange_SSP_Mult") %>% + same_precursors_as("L252.MAC_an_tc_average") %>% + add_precursors("emissions/A_MACC_TechChange_SSP_Mult") %>% + select(-scenario) + }) + + L252.MAC_prc_TC <- L252.MAC_prc_tc_average %>% + adjust_tech_change_ssp() %>% + split(.$scenario) %>% + lapply(function(df) { + df %>% + add_title("Marginal Abatement Cost Curves with Technology Changes for Industrial and Urban Processing Greenhouse Gases") %>% + add_units("tax: 1990 USD; mac.reduction: % reduction; tech_change: Unitless") %>% + add_comments("adjust L252.MAC_prc_tc_average to reflect variations in SSPs") %>% + add_comments("Technology change data added in from A_MACC_TechChange_SSP_Mult") %>% + same_precursors_as("L252.MAC_prc_tc_average") %>% + add_precursors("emissions/A_MACC_TechChange_SSP_Mult") %>% + select(-scenario) + }) + + L252.MAC_res_TC <- L252.ResMAC_fos_tc_average %>% + adjust_tech_change_ssp() %>% + split(.$scenario) %>% + lapply(function(df) { + df %>% + add_title("Marginal Abatement Cost Curves with Technology Changes for Fossil Resources") %>% + add_units("tax: 1990 USD; mac.reduction: % reduction; tech_change: Unitless") %>% + add_comments("adjust L252.ResMAC_fos_tc_average to reflect variations in SSPs") %>% + add_comments("Technology change data added in from A_MACC_TechChange") %>% + same_precursors_as("L252.ResMAC_fos_tc_average") %>% + add_precursors("emissions/A_MACC_TechChange_SSP_Mult", + "common/iso_GCAM_regID","water/basin_to_country_mapping") %>% + select(-scenario) + }) + + L252.MAC_higwp_TC <- L252.MAC_higwp_tc_average %>% + adjust_tech_change_ssp() %>% + split(.$scenario) %>% + lapply(function(df) { + df %>% + add_title("Marginal Abatement Cost Curves with Technology Changes for F-gases") %>% + add_units("tax: 1990 USD; mac.reduction: % reduction; tech_change: Unitless") %>% + add_comments("adjust L252.MAC_higwp_tc_average to reflect variations in SSPs") %>% + add_comments("Technology change data added in from A_MACC_TechChange") %>% + same_precursors_as("L252.MAC_higwp_tc_average") %>% + add_precursors("emissions/A_MACC_TechChange_SSP_Mult") %>% + select(-scenario) + }) + + # =================================================== + + # Produce outputs + L252.ResMAC_fos %>% + add_title("Marginal Abatement Cost Curves for Fossil Resources based on EPA 2020 level") %>% + add_units("tax: 1990 USD; mac.reduction: % reduction") %>% + add_comments("Category data from L201.ghg_res given tax and mac.reduction data from L152.MAC_pct_R_S_Proc_EPA") %>% + add_legacy_name("L252.ResMAC_fos") %>% + add_precursors("emissions/A_regions", "emissions/mappings/CEDS_sector_tech_proc", "emissions/mappings/CEDS_sector_tech_proc_revised", + "L152.MAC_pct_R_S_Proc_EPA", "L201.ghg_res") -> + L252.ResMAC_fos + + L252.ResMAC_fos_phaseInTime %>% + add_title("mac.phase.in.time for Fossil Resources MAC") %>% + add_units("years of fully phasing in MAC reductions") %>% + add_comments("smooth phase in for early modeling periods") %>% + add_legacy_name("L252.ResMAC_fos_phaseInTime") %>% + same_precursors_as("L252.ResMAC_fos_tc") %>% + add_precursors("emissions/EPA_MACC_PhaseInTime") -> + L252.ResMAC_fos_phaseInTime + + L252.ResMAC_fos_tc_average %>% + add_title("Tech.change for Fossil Resources MAC based on EPA 2020 level") %>% + add_units("tax: 1990 USD; mac.reduction: % reduction") %>% + add_comments("Category data from L201.ghg_res given tax and mac.reduction data from L152.MAC_pct_R_S_Proc_EPA") %>% + add_legacy_name("L252.ResMAC_fos") %>% + same_precursors_as("L252.ResMAC_fos_tc") %>% + add_precursors("common/iso_GCAM_regID","water/basin_to_country_mapping") -> + L252.ResMAC_fos_tc_average + + L252.AgMAC %>% + add_title("Marginal Abatement Cost Curves for Agriculture based on EPA 2020 level") %>% + add_units("tax: 1990 USD; mac.reduction: % reduction") %>% + add_comments("Category data from L211.AGREmissions and L211.AGRBio given tax and mac.reduction data from L152.MAC_pct_R_S_Proc_EPA") %>% + add_legacy_name("L252.AgMAC") %>% + add_precursors("emissions/A_regions", "emissions/mappings/CEDS_sector_tech_proc", "emissions/mappings/CEDS_sector_tech_proc_revised", + "L152.MAC_pct_R_S_Proc_EPA", "L211.AGREmissions", "L211.AGRBio") -> + L252.AgMAC + + L252.AgMAC_tc_average %>% + add_title("tech.change for Agriculture MAC based on EPA 2020 level") %>% + add_units("tax: 1990 USD; mac.reduction: % reduction") %>% + add_comments("Category data from L211.AGREmissions and L211.AGRBio given tax and mac.reduction data from L152.MAC_pct_R_S_Proc_EPA") %>% + add_legacy_name("L252.AgMAC") %>% + same_precursors_as("L252.AgMAC_tc") -> + L252.AgMAC_tc_average + + L252.MAC_an %>% + add_title("Marginal Abatement Cost Curves for Animals based on EPA 2020 level") %>% + add_units("tax: 1990 USD; mac.reduction: % reduction") %>% + add_comments("Category data from L211.AnEmissions given tax and mac.reduction data from L152.MAC_pct_R_S_Proc_EPA") %>% + add_legacy_name("L252.MAC_an") %>% + add_precursors("emissions/A_regions", "emissions/mappings/CEDS_sector_tech_proc", "emissions/mappings/CEDS_sector_tech_proc_revised", + "L152.MAC_pct_R_S_Proc_EPA", "L211.AnEmissions") -> + L252.MAC_an + + L252.MAC_an_tc_average %>% + add_title("Tech.chage for Animals MAC based on EPA 2020 level") %>% + add_units("tax: 1990 USD; mac.reduction: % reduction") %>% + add_comments("Category data from L211.AnEmissions given tax and mac.reduction data from L152.MAC_pct_R_S_Proc_EPA") %>% + add_legacy_name("L252.MAC_an") %>% + same_precursors_as("L252.MAC_an_tc") -> + L252.MAC_an_tc_average + + L252.MAC_prc %>% + add_title("Marginal Abatement Cost Curves for Industrial and Urban Processing Greenhouse Gases based on EPA 2020 level") %>% + add_units("tax: 1990 USD; mac.reduction: % reduction") %>% + add_comments("Category data from L232.nonco2_prc given tax and mac.reduction data from L152.MAC_pct_R_S_Proc_EPA") %>% + add_legacy_name("L252.MAC_prc") %>% + add_precursors("emissions/A_regions", "emissions/mappings/CEDS_sector_tech_proc", "emissions/mappings/CEDS_sector_tech_proc_revised", + "L152.MAC_pct_R_S_Proc_EPA", "L232.nonco2_prc") -> + L252.MAC_prc + + L252.MAC_prc_phaseInTime %>% + add_title("mac.phase.in.time for Industrial and Urban Processing Greenhouse Gases MAC") %>% + add_units("years of fully phasing in MAC reductions") %>% + add_comments("smooth phase in for early modeling periods") %>% + add_legacy_name("L252.MAC_prc_phaseInTime") %>% + same_precursors_as("L252.MAC_prc_tc") %>% + add_precursors("emissions/EPA_MACC_PhaseInTime") -> + L252.MAC_prc_phaseInTime + + L252.MAC_prc_tc_average %>% + add_title("tech.change for Industrial and Urban Processing Greenhouse Gases MAC based on EPA 2020 level") %>% + add_units("tax: 1990 USD; mac.reduction: % reduction") %>% + add_comments("Category data from L232.nonco2_prc given tax and mac.reduction data from L152.MAC_pct_R_S_Proc_EPA") %>% + add_legacy_name("L252.MAC_prc") %>% + same_precursors_as("L252.MAC_prc_tc") -> + L252.MAC_prc_tc_average + + L252.MAC_higwp %>% + add_title("Marginal Abatement Cost Curves for High GWP Gases based on EPA 2020 level") %>% + add_units("tax: 1990 USD; mac.reduction: % reduction") %>% + add_comments("Category data from L241.hfc_all and L241.pfc_all given tax and mac.reduction data from L152.MAC_pct_R_S_Proc_EPA") %>% + add_legacy_name("L252.MAC_higwp") %>% + add_precursors("emissions/A_regions", "emissions/mappings/CEDS_sector_tech_proc", "emissions/mappings/CEDS_sector_tech_proc_revised", + "L152.MAC_pct_R_S_Proc_EPA", "L241.hfc_all", "L241.pfc_all", "common/GCAM_region_names", + "emissions/A_MACC_TechChange_omit") -> + L252.MAC_higwp + + L252.MAC_higwp_phaseInTime %>% + add_title("mac.phase.in.time for High GWP Gases MAC") %>% + add_units("years of fully phasing in MAC reductions") %>% + add_comments("smooth phase in for early modeling periods") %>% + add_legacy_name("L252.MAC_higwp_phaseInTime") %>% + same_precursors_as("L252.MAC_higwp_tc") %>% + add_precursors("emissions/EPA_MACC_PhaseInTime") -> + L252.MAC_higwp_phaseInTime + + L252.MAC_higwp_tc_average %>% + add_title("tech.change for High GWP Gases MAC based on EPA 2020 level") %>% + add_units("tax: 1990 USD; mac.reduction: % reduction") %>% + add_comments("Category data from L241.hfc_all and L241.pfc_all given tax and mac.reduction data from L152.MAC_pct_R_S_Proc_EPA") %>% + add_legacy_name("L252.MAC_higwp") %>% + same_precursors_as("L252.MAC_higwp_tc") -> + L252.MAC_higwp_tc_average + + L252.MAC_Ag_TC[["SSP1"]] %>% + add_legacy_name("L252.MAC_Ag_TC_SSP1") -> + L252.MAC_Ag_TC_SSP1 + + L252.MAC_An_TC[["SSP1"]] %>% + add_legacy_name("L252.MAC_An_TC_SSP1") -> + L252.MAC_An_TC_SSP1 + + L252.MAC_prc_TC[["SSP1"]] %>% + add_legacy_name("L252.MAC_prc_TC_SSP1") -> + L252.MAC_prc_TC_SSP1 + + L252.MAC_res_TC[["SSP1"]] %>% + add_legacy_name("L252.MAC_res_TC_SSP1") -> + L252.MAC_res_TC_SSP1 + + L252.MAC_higwp_TC[["SSP1"]] %>% + add_legacy_name("L252.MAC_higwp_TC_SSP1") -> + L252.MAC_higwp_TC_SSP1 + + L252.MAC_Ag_TC[["SSP2"]] %>% + add_legacy_name("L252.MAC_Ag_TC_SSP2") -> + L252.MAC_Ag_TC_SSP2 + + L252.MAC_An_TC[["SSP2"]] %>% + add_legacy_name("L252.MAC_An_TC_SSP2") -> + L252.MAC_An_TC_SSP2 + + L252.MAC_prc_TC[["SSP2"]] %>% + add_legacy_name("L252.MAC_prc_TC_SSP2") -> + L252.MAC_prc_TC_SSP2 + + L252.MAC_res_TC[["SSP2"]] %>% + add_legacy_name("L252.MAC_res_TC_SSP2") -> + L252.MAC_res_TC_SSP2 + + L252.MAC_higwp_TC[["SSP2"]] %>% + add_legacy_name("L252.MAC_higwp_TC_SSP2") -> + L252.MAC_higwp_TC_SSP2 + + L252.MAC_Ag_TC[["SSP5"]] %>% + add_legacy_name("L252.MAC_Ag_TC_SSP5") -> + L252.MAC_Ag_TC_SSP5 + + L252.MAC_An_TC[["SSP5"]] %>% + add_legacy_name("L252.MAC_An_TC_SSP5") -> + L252.MAC_An_TC_SSP5 + + L252.MAC_prc_TC[["SSP5"]] %>% + add_legacy_name("L252.MAC_prc_TC_SSP5") -> + L252.MAC_prc_TC_SSP5 + + L252.MAC_res_TC[["SSP5"]] %>% + add_legacy_name("L252.MAC_res_TC_SSP5") -> + L252.MAC_res_TC_SSP5 + + L252.MAC_higwp_TC[["SSP5"]] %>% + add_legacy_name("L252.MAC_higwp_TC_SSP5") -> + L252.MAC_higwp_TC_SSP5 + + return_data(L252.ResMAC_fos, L252.AgMAC, L252.MAC_an, L252.MAC_prc, L252.MAC_higwp, + L252.ResMAC_fos_tc_average, L252.AgMAC_tc_average, L252.MAC_an_tc_average, + L252.MAC_prc_tc_average, L252.MAC_higwp_tc_average, + L252.ResMAC_fos_phaseInTime, L252.MAC_prc_phaseInTime, L252.MAC_higwp_phaseInTime, + L252.MAC_Ag_TC_SSP1, L252.MAC_An_TC_SSP1, L252.MAC_prc_TC_SSP1, L252.MAC_res_TC_SSP1, L252.MAC_higwp_TC_SSP1, + L252.MAC_Ag_TC_SSP2, L252.MAC_An_TC_SSP2, L252.MAC_prc_TC_SSP2, L252.MAC_res_TC_SSP2, L252.MAC_higwp_TC_SSP2, + L252.MAC_Ag_TC_SSP5, L252.MAC_An_TC_SSP5, L252.MAC_prc_TC_SSP5, L252.MAC_res_TC_SSP5, L252.MAC_higwp_TC_SSP5) + } else { + stop("Unknown command") + } +} diff --git a/inst/extras/zchunk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0.R b/inst/extras/zchunk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0.R new file mode 100644 index 0000000..061eadd --- /dev/null +++ b/inst/extras/zchunk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0.R @@ -0,0 +1,390 @@ +# Copyright 2019 Battelle Memorial Institute; see the LICENSE file. + +#' module_aglu_LA101.ag_FAO_R_C_Y +#' +#' Aggregate FAO food consumption, ag production, and harvested area +#' data to GCAM regions and GCAM commodities. +#' +#' @param command API command to execute +#' @param ... other optional parameters, depending on command +#' @return Depends on \code{command}: either a vector of required inputs, +#' a vector of output names, or (if \code{command} is "MAKE") all +#' the generated outputs: \code{L101.ag_Food_Mt_R_C_Y}, \code{L101.ag_Food_Pcal_R_C_Y}, \code{L101.ag_kcalg_R_C_Y}, \code{L101.ag_HA_bm2_R_C_Y}, \code{L101.ag_Prod_Mt_R_C_Y}. The corresponding file in the +#' original data system was \code{LA101.ag_FAO_R_C_Y.R} (aglu level1). +#' @details This chunk aggregates FAO food consumption, agricultural production, +#' and harvested area data up to GCAM commodities and GCAM regions. Data is converted +#' from FAO units (tons, hectares) to GCAM units (Mt, Pcal, billion km2). Note that +#' FAO's alfalfa production in the USA is divided by 4 "for consistency with USDA". +#' Note (August 2018 GPK revision) - The FAO production and harvested area are disaggregated +#' to basin PRIOR to aggregation by GCAM region. This reduces the bias from using a single +#' year (around 2000) to disaggregate to basin, in multi-country regions. +#' @importFrom assertthat assert_that +#' @importFrom dplyr anti_join arrange bind_rows distinct filter full_join if_else group_by inner_join left_join mutate right_join select summarise +#' @importFrom tidyr complete drop_na replace_na +#' @author KVC March 2017 (revised August 2018 by GPK) +module_aglu_LA101.ag_FAO_R_C_Y <- function(command, ...) { + if(command == driver.DECLARE_INPUTS) { + return(c(FILE = "common/iso_GCAM_regID", + FILE = "common/GCAM_region_names", + FILE = "water/basin_to_country_mapping", + FILE = "aglu/FAO/FAO_ag_items_PRODSTAT", + FILE = "aglu/FAO/FAO_ag_items_cal_SUA", + FILE = "aglu/LDS/LDS_land_types", + "L100.FAO_ag_Food_t", + "L100.FAO_ag_HA_ha", + "L100.FAO_ag_Prod_t", + "L100.LDS_ag_HA_ha", + "L100.LDS_ag_prod_t", + "L100.Land_type_area_ha")) + } else if(command == driver.DECLARE_OUTPUTS) { + return(c("L101.ag_Food_Mt_R_C_Y", + "L101.ag_Food_Pcal_R_C_Y", + "L101.ag_kcalg_R_C_Y", + "L101.ag_HA_bm2_R_C_Y", + "L101.ag_HA_bm2_R_C_Y_GLU", + "L101.ag_Prod_Mt_R_C_Y", + "L101.ag_Prod_Mt_R_C_Y_GLU", + "L101.ag_Yield_kgm2_R_C_Y_GLU")) + } else if(command == driver.MAKE) { + + all_data <- list(...)[[1]] + + GLU <- default_share_GLU <- HA_share_GLU <- prod_share_GLU <- + Category <- LT_SAGE <- LT_HYDE <- countries <- country.codes <- + item.codes <- element <- element.codes <- GCAM_commodity <- + value <- GCAM_region_ID <- year <- Mcal_t <- value.y <- value.x <- + item <- iso <- production <- harvested.area <- GCAM_subsector <- NULL # silence package check. + + # Load required inputs + iso_GCAM_regID <- get_data(all_data, "common/iso_GCAM_regID") + FAO_ag_items_PRODSTAT <- get_data(all_data, "aglu/FAO/FAO_ag_items_PRODSTAT") + FAO_ag_items_cal_SUA <- get_data(all_data, "aglu/FAO/FAO_ag_items_cal_SUA") + LDS_land_types <- get_data(all_data, "aglu/LDS/LDS_land_types") + L100.FAO_ag_Food_t <- get_data(all_data, "L100.FAO_ag_Food_t") + L100.FAO_ag_HA_ha <- get_data(all_data, "L100.FAO_ag_HA_ha") + L100.FAO_ag_Prod_t <- get_data(all_data, "L100.FAO_ag_Prod_t") + L100.LDS_ag_HA_ha <- get_data(all_data, "L100.LDS_ag_HA_ha") + L100.LDS_ag_prod_t <- get_data(all_data, "L100.LDS_ag_prod_t") + L100.Land_type_area_ha <- get_data(all_data, "L100.Land_type_area_ha") + + # Process FAO food consumption data (tons): remove unnecessary columns, convert units, aggregate to region and commodity + L100.FAO_ag_Food_t %>% + select(-countries, -country.codes, -item.codes, -element, -element.codes) %>% # Remove unnecessary columns + left_join_error_no_match(iso_GCAM_regID, by = "iso") %>% # Map in ISO codes + left_join(FAO_ag_items_cal_SUA, by = "item") %>% # Map in GCAM commodities + filter(!is.na(GCAM_commodity)) %>% # Remove commodities not included in GCAM + mutate(value = value * CONV_TON_MEGATON) %>% # Convert from tons to Mt + group_by(GCAM_region_ID, GCAM_commodity, year) %>% # Group by region, commodity, year + summarise(value = sum(value)) %>% # Aggregate then map to appropriate data frame + ungroup() %>% # Ungroup before complete + complete(GCAM_region_ID = unique(iso_GCAM_regID$GCAM_region_ID), + GCAM_commodity, year, fill = list(value = 0)) -> # Fill in missing region/commodity combinations with 0 + L101.ag_Food_Mt_R_C_Y + + # Process FAO food consumption data (Pcal): remove unnecessary columns, convert units, aggregate to region and commodity + L100.FAO_ag_Food_t %>% + select(-countries, -country.codes, -item.codes, -element, -element.codes) %>% # Remove unnecessary columns + left_join_error_no_match(iso_GCAM_regID, by = "iso") %>% # Map in ISO codes + left_join(FAO_ag_items_cal_SUA, by = "item") %>% # Map in GCAM commodities + filter(!is.na(GCAM_commodity)) %>% # Remove commodities not included in GCAM + mutate(value = value * Mcal_t * CONV_MCAL_PCAL) %>% # Convert from tons to Pcal + group_by(GCAM_region_ID, GCAM_commodity, year) %>% # Group by region, commodity, year + summarise(value = sum(value)) %>% # Aggregate then map to appropriate data frame + ungroup() %>% # Ungroup before complete + complete(GCAM_region_ID = unique(iso_GCAM_regID$GCAM_region_ID), + GCAM_commodity, year, fill = list(value = 0)) -> # Fill in missing region/commodity combinations with 0 + L101.ag_Food_Pcal_R_C_Y + + # Calculate average caloric content of consumed commodities (kcal/g) + L101.ag_Food_Pcal_R_C_Y %>% + left_join(L101.ag_Food_Mt_R_C_Y, by = c("GCAM_region_ID", "GCAM_commodity", "year")) %>% # Join food in Mt to food in Pcal + mutate(value = if_else(value.y == 0, 1, value.x / value.y)) %>% # Calculate average caloric content, set NA values to 1 + select(-value.x, -value.y) -> # Remove extra columns + L101.ag_kcalg_R_C_Y + + # Clean FAO production and harvested area tables + L100.FAO_ag_HA_ha %>% + select(-countries, -country.codes, -item.codes, -element, -element.codes) %>% # Remove unnecessary columns + mutate(iso = if_else(iso %in% c("srb", "mne"), "scg", iso)) %>% # Re-map Serbia (srb) and Montenegro (mne) to the iso code for the single country (scg) + group_by(item, iso, year) %>% # scg is the iso code in the Monfreda data because its base year is ~2000 + summarise(value = sum(value)) -> # Aggregate by ISO, item, and region (some iso codes apply to multiple lines in data) + FAO_ag_HA_ha + + L100.FAO_ag_Prod_t %>% + select(-countries, -country.codes, -item.codes, -element, -element.codes) %>% # Remove unnecessary columns + mutate(value = if_else(iso == "usa" & item == "Alfalfa for forage and silage", + value / 4, value), # Divide USA Alfalfa production by 4 "for consistency with USDA" + iso = if_else(iso %in% c("srb", "mne"), "scg", iso)) %>% # Re-map Serbia (srb) and Montenegro (mne) to the iso code for the single country (scg) + group_by(item, iso, year) %>% # scg is the iso code in the Monfreda data because its base year is ~2000 + summarise(value = sum(value)) -> # Aggregate by ISO, item, and region (some iso codes apply to multiple lines in data) + FAO_ag_Prod_t + + # Set production to zero when harvested area is zero and vice versa + FAO_ag_HA_ha %>% ungroup %>% + inner_join(FAO_ag_Prod_t, by = c("iso", "item", "year")) %>% # Join production and harvested area + rename(harvested.area = value.x, production = value.y) %>% # Rename variables + mutate(harvested.area = if_else(production == 0, 0, harvested.area), # Set harvested area to zero if production is zero + production = if_else(harvested.area == 0, 0, production)) -> # Set production to zero if harvested area is zero + FAO_PRODSTAT_MERGED + + # Next we downscale the data from countries to basins, using the basin-within-country shares + # of each GCAM commodity in the Monfreda (pre-processed by LDS) data on harvested area and production + # Note - using GCAM commodities rather than specific crops in this task. This avoids dropping data, particularly + # for the grass fodder crops which are poorly matched with the FAO data. + L100.LDS_ag_HA_ha %>% + left_join_error_no_match(L100.LDS_ag_prod_t, + by = c("iso", "GLU", "GTAP_crop")) %>% # Join the Monfreda/LDS datasets of production and harvested area + rename(harvested.area = value.x, + production = value.y) %>% + left_join(FAO_ag_items_PRODSTAT[c("GTAP_crop", "GCAM_commodity", "GCAM_subsector")], by = "GTAP_crop") %>% # Join in the GCAM commodities and aggregate. + drop_na(GCAM_commodity) %>% # drop any crops not considered in GCAM + group_by(iso, GCAM_commodity, GCAM_subsector, GLU) %>% + summarise(harvested.area = sum(harvested.area), + production = sum(production)) %>% + ungroup() %>% + group_by(iso, GCAM_commodity, GCAM_subsector) %>% + mutate(HA_share_GLU = harvested.area / sum(harvested.area), # Compute the shares of country/crop/GLU within country/crop + prod_share_GLU = production / sum(production)) %>% + ungroup() -> + LDS_ctry_crop_SHARES + + + # Compute default basin-within-country shares to be used where FAOSTAT has data but LDS/Monfreda does not. + # These shares are computed from the harvested area of all crops available in Monfreda. + # Harvested area is used to avoid compositional bias from different crop types in different basins. + LDS_ctry_crop_SHARES %>% + group_by(iso, GLU) %>% + summarise(harvested.area = sum(harvested.area)) %>% + ungroup() %>% + group_by(iso) %>% + mutate(default_share_GLU = harvested.area / sum(harvested.area)) %>% + ungroup() %>% + select(iso, GLU, default_share_GLU) -> + LDS_ctry_SHARES + + # only take the columns required for later steps in the LDS_ctry_crop_SHARES data table + LDS_ctry_crop_SHARES <- select(LDS_ctry_crop_SHARES, iso, GLU, GCAM_commodity, GCAM_subsector, HA_share_GLU, prod_share_GLU) + + # FAO_PRODSTAT_DOWNSCALED: FAO Prodstat data aggregated by GCAM commodity and downscaled to GLU. + FAO_PRODSTAT_MERGED %>% + left_join_error_no_match(distinct(select(FAO_ag_items_PRODSTAT, item, GCAM_commodity, GCAM_subsector)), by = "item", # distinct() to avoid duplicating data for items with multiple rows in FAO_ag_items_PRODSTAT + ignore_columns = c("GCAM_commodity", "GCAM_subsector")) %>% # ignore GCAM_commodity column to avoid error in ljenm (this column has NA for FAO items not modeled in GCAM) + filter(!is.na(GCAM_commodity)) %>% # Remove commodities not included in GCAM + group_by(iso, GCAM_commodity, GCAM_subsector, year) %>% + summarise(harvested.area = sum(harvested.area), + production = sum(production)) %>% + ungroup() -> + FAO_PRODSTAT_DOWNSCALED + + # First group: crops and countries in BOTH datasetes (LDS/Monfreda and FAOSTAT) + FAO_PRODSTAT_DOWNSCALED %>% + right_join(LDS_ctry_crop_SHARES, by = c("iso", "GCAM_commodity", "GCAM_subsector")) %>% # use right_join to exclude crops and countries not in the LDS data + drop_na() %>% # NAs are observations in LDS but not FAOSTAT. These are dropped. + mutate(harvested.area = harvested.area * HA_share_GLU, # multiply through by shares of GLU within country and crop + production = production * prod_share_GLU) %>% + select(-HA_share_GLU, -prod_share_GLU) -> + FAO_PRODSTAT_DOWNSCALED_matches + + # Second group: country/crop observations missing in LDS/Monfreda where some crops for the country are available + FAO_PRODSTAT_DOWNSCALED %>% + anti_join(LDS_ctry_crop_SHARES, by = c("iso", "GCAM_commodity", "GCAM_subsector")) %>% # Filter the dataset to only observations where the country and crop couldn't be matched + full_join(LDS_ctry_SHARES, by = "iso") %>% + drop_na() %>% # Drop places where entire country is not available in LDS/Monfreda data + mutate(harvested.area = harvested.area * default_share_GLU, # multiply through by shares of GLU within country and crop + production = production * default_share_GLU) %>% + select(-default_share_GLU) -> + FAO_PRODSTAT_DOWNSCALED_cropNA + + # Third group: country/crop observations in countries excluded from Monfreda/LDS, but that have cropland in Hyde. + # These use the Hyde data to downscale to basin. In this method, there is a fourth group that is dropped entirely: + # countries with data in FAOSTAT, but excluded from Monfreda/LDS and that have no cropland in Hyde. + # First, compute the cropland basin-within-country from the Hyde countries, for only the countries that are in FAOSTAT but not Monfreda/LDS + L100.Land_type_area_ha %>% + filter(iso %in% FAO_PRODSTAT_DOWNSCALED$iso & # countries in FAOSTAT + !iso %in% LDS_ctry_SHARES$iso) %>% # but not in Monfreda/LDS + left_join_error_no_match(select(LDS_land_types, Category, LT_SAGE, LT_HYDE), by = c(land_code = "Category")) %>% + filter(LT_HYDE == "Cropland", + LT_SAGE != "Unknown", # Do not assign crop production to lands that are "unknown" in SAGE as these have no land allocation in GCAM. + year == 2000) %>% + group_by(iso, GLU) %>% + summarise(value = sum(value)) %>% + ungroup() %>% + group_by(iso) %>% + mutate(default_share_GLU = value / sum(value)) %>% + ungroup() %>% + select(iso, GLU, default_share_GLU) -> + Hyde_cropland_share_basin + + FAO_PRODSTAT_DOWNSCALED %>% + filter(iso %in% Hyde_cropland_share_basin$iso) %>% # Filter to the same set of countries as above (in FAOSTAT, not Monfreda/LDS, with cropland in Hyde) + full_join(Hyde_cropland_share_basin, by = "iso") %>% + mutate(harvested.area = harvested.area * default_share_GLU, # multiply through by shares of GLU within country and crop + production = production * default_share_GLU) %>% + select(-default_share_GLU) -> + FAO_PRODSTAT_DOWNSCALED_countryNA + + # FAO downscaled data: bind the three groups together + FAO_PRODSTAT_DOWNSCALED <- bind_rows(FAO_PRODSTAT_DOWNSCALED_matches, + FAO_PRODSTAT_DOWNSCALED_cropNA, + FAO_PRODSTAT_DOWNSCALED_countryNA) + + # Process FAO production data: convert units, aggregate to region, commodity, and GLU + FAO_PRODSTAT_DOWNSCALED %>% + select(iso, GCAM_commodity, GCAM_subsector, GLU, year, production) %>% # Select relevant columns (not harvested.area) + rename(value = production) %>% # Rename column since tests are expecting "value" + left_join_error_no_match(iso_GCAM_regID, by = "iso") %>% # Map in ISO codes + group_by(GCAM_region_ID, GCAM_commodity, GCAM_subsector, GLU, year) %>% # Group by region, commodity, GLU, year + summarise(value = sum(value)) %>% # Aggregate then map to appropriate data frame + mutate(value = value * CONV_TON_MEGATON) %>% # Convert from tons to Mt + ungroup() -> # Ungroup before complete + L101.ag_Prod_Mt_R_C_Y_GLU + + + #........................ + # gcambreakout 17 July 2022 + # Temporary fix until circular dependency on + # L123.LC_bm2_R_MgdFor_Yh_GLU_beforeadjust is fixed. + #........................ + + basin_to_country_mapping <- get_data(all_data, "water/basin_to_country_mapping") + GCAM_region_names <- get_data(all_data, "common/GCAM_region_names") + + # Valid GLU Region combos + glu_gcam <- basin_to_country_mapping %>% + dplyr::select(iso=ISO, GLU=GLU_code, GLU_name) %>% + dplyr::mutate(iso = tolower(iso)) %>% + dplyr::left_join(iso_GCAM_regID, by=c("iso")) %>% + dplyr::select(GLU, GCAM_region_ID, GLU_name) %>% + dplyr::filter(GCAM_region_ID > 32) %>% + unique() %>% + dplyr::left_join(GCAM_region_names); glu_gcam + + remove_glu <- glu_gcam$GLU %>% unique(); remove_glu + regions_check <- GCAM_region_names$GCAM_region_ID[!GCAM_region_names$GCAM_region_ID %in% glu_gcam$GCAM_region_ID]; regions_check + + L101.ag_Prod_Mt_R_C_Y_GLU %>% + dplyr::mutate(remove = dplyr::if_else(((GLU %in% remove_glu) & (GCAM_region_ID %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L101.ag_Prod_Mt_R_C_Y_GLU + + #...............gcambreakout close edits + + # Also write out the production volumes without basin-level detail, or subsector differentiation (i.e. by region, crop, year) + L101.ag_Prod_Mt_R_C_Y_GLU %>% + group_by(GCAM_region_ID, GCAM_commodity, year) %>% + summarise(value = sum(value)) %>% + ungroup() %>% + complete(GCAM_region_ID = unique(iso_GCAM_regID$GCAM_region_ID), + GCAM_commodity, year, fill = list(value = 0)) -> # Fill in missing region/commodity combinations with 0 + L101.ag_Prod_Mt_R_C_Y + + # Now, Process FAO harvested area data: convert units, aggregate to region, commodity, and GLU + FAO_PRODSTAT_DOWNSCALED %>% + select(iso, GCAM_commodity, GCAM_subsector, GLU, year, harvested.area) %>% # Select relevant columns (not production) + rename(value = harvested.area) %>% # Rename column since tests are expecting "value" + left_join_error_no_match(iso_GCAM_regID, by = "iso") %>% # Map in ISO codes + group_by(GCAM_region_ID, GCAM_commodity, GCAM_subsector, GLU, year) %>% # Group by region, commodity, GLU, year + summarise(value = sum(value)) %>% # Aggregate then map to appropriate data frame + mutate(value = value * CONV_HA_BM2) %>% # Convert from hectares to billion m2 + ungroup() -> # Ungroup before complete + L101.ag_HA_bm2_R_C_Y_GLU + + L101.ag_HA_bm2_R_C_Y_GLU %>% + group_by(GCAM_region_ID, GCAM_commodity, year) %>% + summarise(value = sum(value)) %>% + ungroup() %>% + complete(GCAM_region_ID = unique(iso_GCAM_regID$GCAM_region_ID), + GCAM_commodity, year, fill = list(value = 0)) -> # Fill in missing region/commodity combinations with 0 + L101.ag_HA_bm2_R_C_Y + + # Calculate initial yield estimates in kilograms per square meter by region, crop, year, and GLU + # Yield in kilograms per square meter + L101.ag_Prod_Mt_R_C_Y_GLU %>% + left_join(L101.ag_HA_bm2_R_C_Y_GLU, by = c("GCAM_region_ID", "GCAM_commodity", "GCAM_subsector", "GLU", "year")) %>% + mutate(value = value.x / value.y) %>% + replace_na(list(value = 0)) %>% + select(-value.x, -value.y) %>% + arrange(GLU) -> # so we match old d.s. order + L101.ag_Yield_kgm2_R_C_Y_GLU + + # Produce outputs + L101.ag_Food_Mt_R_C_Y %>% + add_title("FAO food consumption by GCAM region, commodity, and year") %>% + add_units("Mt/yr") %>% + add_comments("Aggregates FAO data by GCAM region, commodity, and year") %>% + add_comments("Data is also converted from tons to Mt") %>% + add_legacy_name("L101.ag_Food_Mt_R_C_Y") %>% + add_precursors("L100.FAO_ag_Food_t", "aglu/FAO/FAO_ag_items_cal_SUA", "common/iso_GCAM_regID") -> + L101.ag_Food_Mt_R_C_Y + L101.ag_Food_Pcal_R_C_Y %>% + add_title("FAO food consumption by GCAM region, commodity, and year") %>% + add_units("Pcal/yr") %>% + add_comments("Aggregates FAO data by GCAM region, commodity, and year") %>% + add_comments("Data is also converted from tons to Pcal") %>% + add_legacy_name("L101.ag_Food_Pcal_R_C_Y") %>% + add_precursors("L100.FAO_ag_Food_t", "aglu/FAO/FAO_ag_items_cal_SUA", "common/iso_GCAM_regID") -> + L101.ag_Food_Pcal_R_C_Y + L101.ag_kcalg_R_C_Y %>% + add_title("Weighted average commodity caloric content by GCAM region, commodity, and year") %>% + add_units("kcal/g") %>% + add_comments("Combines the L101.ag_Food_Mt_R_C_Y and L101.ag_Food_Pcal_R_C_Y data frames") %>% + add_legacy_name("L101.ag_kcalg_R_C_Y") %>% + add_precursors("L100.FAO_ag_Food_t", "aglu/FAO/FAO_ag_items_cal_SUA", "common/iso_GCAM_regID") -> + L101.ag_kcalg_R_C_Y + + L101.ag_HA_bm2_R_C_Y_GLU %>% + add_title("Harvested area by GCAM region, commodity, year, and GLU") %>% + add_units("billion km2") %>% + add_comments("FAO data downscaled to GLU then aggregated by GCAM region, commodity, and GLU") %>% + add_comments("Data was also converted from HA to billion km2") %>% + add_legacy_name("L103.ag_HA_bm2_R_C_Y_GLU") %>% + add_precursors("L100.FAO_ag_HA_ha", "aglu/FAO/FAO_ag_items_PRODSTAT", "L100.LDS_ag_HA_ha", "common/iso_GCAM_regID", + "aglu/LDS/LDS_land_types", "L100.Land_type_area_ha") -> + L101.ag_HA_bm2_R_C_Y_GLU + L101.ag_HA_bm2_R_C_Y %>% + add_title("Harvested area by GCAM region, commodity, and year") %>% + add_units("billion km2") %>% + add_comments("FAO data downscaled to GLU then aggregated by GCAM region and commodity") %>% + add_comments("Data was also converted from HA to billion km2") %>% + add_comments("Country/crop combinations with zero production were assigned zero harvested area") %>% + add_legacy_name("L101.ag_HA_bm2_R_C_Y") %>% + same_precursors_as(L101.ag_HA_bm2_R_C_Y_GLU) -> + L101.ag_HA_bm2_R_C_Y + L101.ag_Prod_Mt_R_C_Y_GLU %>% + add_title("Agricultural production by GCAM region, commodity, year, and GLU") %>% + add_units("Mt/yr") %>% + add_comments("FAO data downscaled to GLU then aggregated by GCAM region, commodity, and GLU") %>% + add_comments("Data was also converted from tons to Mt") %>% + add_comments("USA alfalfa production was divided by 4 for consistency with USDA") %>% + add_comments("Country/crop combinations with zero harvested area were assigned zero production") %>% + add_legacy_name("L101.ag_Prod_Mt_R_C_Y_GLU") %>% + add_precursors("L100.FAO_ag_Prod_t", "aglu/FAO/FAO_ag_items_PRODSTAT", "L100.LDS_ag_prod_t", "common/iso_GCAM_regID", + "aglu/LDS/LDS_land_types", "L100.Land_type_area_ha", + "water/basin_to_country_mapping", + "common/GCAM_region_names") -> + L101.ag_Prod_Mt_R_C_Y_GLU + L101.ag_Prod_Mt_R_C_Y %>% + add_title("Agricultural production by GCAM region, commodity, and year") %>% + add_units("Mt/yr") %>% + add_comments("FAO data downscaled to GLU then aggregated by GCAM region and commodity") %>% + add_comments("Data was also converted from tons to Mt") %>% + add_comments("USA alfalfa production was divided by 4 for consistency with USDA") %>% + add_comments("Country/crop combinations with zero harvested area were assigned zero production") %>% + add_legacy_name("L101.ag_Prod_Mt_R_C_Y") %>% + same_precursors_as(L101.ag_Prod_Mt_R_C_Y_GLU) -> + L101.ag_Prod_Mt_R_C_Y + L101.ag_Yield_kgm2_R_C_Y_GLU %>% + add_title("Unadjusted agronomic yield by GCAM region / commodity / year / GLU") %>% + add_units("kg/m2") %>% + add_comments("Agricultural yield computed based on production and harvested area") %>% + add_legacy_name("L103.ag_Yield_kgm2_R_C_Y_GLU") %>% + same_precursors_as(L101.ag_Prod_Mt_R_C_Y_GLU) -> + L101.ag_Yield_kgm2_R_C_Y_GLU + + return_data(L101.ag_Food_Mt_R_C_Y, L101.ag_Food_Pcal_R_C_Y, L101.ag_kcalg_R_C_Y, L101.ag_HA_bm2_R_C_Y_GLU, + L101.ag_HA_bm2_R_C_Y, L101.ag_Prod_Mt_R_C_Y_GLU, L101.ag_Prod_Mt_R_C_Y, L101.ag_Yield_kgm2_R_C_Y_GLU) + } else { + stop("Unknown command") + } +} diff --git a/inst/extras/zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv60.R b/inst/extras/zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0.R similarity index 85% rename from inst/extras/zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv60.R rename to inst/extras/zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0.R index c4e5e74..9a77721 100644 --- a/inst/extras/zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv60.R +++ b/inst/extras/zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0.R @@ -21,6 +21,7 @@ module_aglu_LB120.LC_GIS_R_LTgis_Yh_GLU <- function(command, ...) { if(command == driver.DECLARE_INPUTS) { return(c(FILE = "common/iso_GCAM_regID", + FILE = "water/basin_to_country_mapping", FILE = "aglu/LDS/LDS_land_types", FILE = "aglu/SAGE_LT", FILE = "aglu/Various_CarbonData_LTsage", @@ -307,12 +308,19 @@ module_aglu_LB120.LC_GIS_R_LTgis_Yh_GLU <- function(command, ...) { ForScaler = if_else((Forest - MgdFor) < 0 & Forest > 0, MgdFor/Forest ,1)) %>% select(GCAM_region_ID, GLU, year, nonForScaler, ForScaler), by = c("GCAM_region_ID", "GLU", "year") ) %>% + #........................ + # gcambreakout 17 July 2022 + # Temporary fix until circular dependency on + # L123.LC_bm2_R_MgdFor_Yh_GLU_beforeadjust is fixed. + #........................ mutate(ForScaler= if_else(is.na(ForScaler),1,ForScaler), nonForScaler= if_else(is.na(nonForScaler),1,nonForScaler), value = if_else(Land_Type %in% c("Grassland", "Shrubland" , "Pasture"), value * nonForScaler, if_else(Land_Type == "Forest", value * ForScaler, value) )) %>% - select(-nonForScaler, -ForScaler) -> + select(-nonForScaler, -ForScaler) %>% + dplyr::filter(value >= 0 ) -> + #....................... gcambreakout close edits L120.LC_bm2_R_LT_Yh_GLU # Subset the land types that are not further modified @@ -344,6 +352,72 @@ module_aglu_LB120.LC_GIS_R_LTgis_Yh_GLU <- function(command, ...) { ungroup -> L120.LC_bm2_ctry_LTpast_GLU + #........................ + # gcambreakout 17 July 2022 + # Temporary fix until circular dependency on + # L123.LC_bm2_R_MgdFor_Yh_GLU_beforeadjust is fixed. + #........................ + + # Valid GLU Region combos + glu_gcam <- get_data(all_data, "water/basin_to_country_mapping") %>% + dplyr::select(iso=ISO, GLU=GLU_code) %>% + dplyr::mutate(iso = tolower(iso)) %>% + dplyr::left_join(iso_GCAM_regID, by=c("iso")) %>% + dplyr::select(GLU, GCAM_region_ID) %>% + dplyr::filter(GCAM_region_ID > 32) %>% + unique(); glu_gcam + + remove_glu <- glu_gcam$GLU %>% unique(); remove_glu + + L120.LC_bm2_R_LT_Yh_GLU <- + L120.LC_bm2_R_LT_Yh_GLU %>% + dplyr::mutate(remove = dplyr::if_else(((GLU %in% remove_glu) & (GCAM_region_ID <33)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) + + L120.LC_bm2_R_UrbanLand_Yh_GLU <- + L120.LC_bm2_R_UrbanLand_Yh_GLU %>% + dplyr::mutate(remove = dplyr::if_else(((GLU %in% remove_glu) & (GCAM_region_ID <33)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) + + L120.LC_bm2_R_Tundra_Yh_GLU <- + L120.LC_bm2_R_Tundra_Yh_GLU %>% + dplyr::mutate(remove = dplyr::if_else(((GLU %in% remove_glu) & (GCAM_region_ID <33)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) + + L120.LC_bm2_R_RckIceDsrt_Yh_GLU <- + L120.LC_bm2_R_RckIceDsrt_Yh_GLU %>% + dplyr::mutate(remove = dplyr::if_else(((GLU %in% remove_glu) & (GCAM_region_ID <33)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) + + L120.LC_bm2_ctry_LTsage_GLU <- + L120.LC_bm2_ctry_LTsage_GLU %>% + dplyr::mutate(remove = dplyr::if_else(((GLU %in% remove_glu) & (GCAM_region_ID <33)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) + + L120.LC_bm2_ctry_LTpast_GLU <- + L120.LC_bm2_ctry_LTpast_GLU %>% + dplyr::mutate(remove = dplyr::if_else(((GLU %in% remove_glu) & (GCAM_region_ID <33)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) + + L120.LC_prot_land_frac_GLU <- + L120.LC_prot_land_frac_GLU %>% + dplyr::mutate(remove = dplyr::if_else(((GLU %in% remove_glu) & (GCAM_region_ID <33)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) + + L120.LC_soil_veg_carbon_GLU <- + L120.LC_soil_veg_carbon_GLU %>% + dplyr::mutate(remove = dplyr::if_else(((GLU %in% remove_glu) & (GCAM_region_ID <33)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) + + #............................gcambreakout close edits # Produce outputs L120.LC_bm2_R_LT_Yh_GLU %>% @@ -352,7 +426,8 @@ module_aglu_LB120.LC_GIS_R_LTgis_Yh_GLU <- function(command, ...) { add_comments("Land types from SAGE, HYDE, WDPA merged and reconciled; missing zeroes backfilled; interpolated to AGLU land cover years") %>% add_legacy_name("L120.LC_bm2_R_LT_Yh_GLU") %>% add_precursors("common/iso_GCAM_regID", "aglu/LDS/LDS_land_types", "aglu/SAGE_LT", "L100.Land_type_area_ha", - "aglu/LDS/L123.LC_bm2_R_MgdFor_Yh_GLU_beforeadjust") -> + "aglu/LDS/L123.LC_bm2_R_MgdFor_Yh_GLU_beforeadjust", + "water/basin_to_country_mapping") -> L120.LC_bm2_R_LT_Yh_GLU L120.LC_bm2_R_UrbanLand_Yh_GLU %>% @@ -360,7 +435,8 @@ module_aglu_LB120.LC_GIS_R_LTgis_Yh_GLU <- function(command, ...) { add_units("bm2") %>% add_comments("Land types from SAGE, HYDE, WDPA merged and reconciled; missing zeroes backfilled; interpolated to AGLU land cover years") %>% add_legacy_name("L120.LC_bm2_R_UrbanLand_Yh_GLU") %>% - add_precursors("common/iso_GCAM_regID", "aglu/LDS/LDS_land_types", "aglu/SAGE_LT", "L100.Land_type_area_ha") -> + add_precursors("common/iso_GCAM_regID", "aglu/LDS/LDS_land_types", "aglu/SAGE_LT", "L100.Land_type_area_ha", + "water/basin_to_country_mapping") -> L120.LC_bm2_R_UrbanLand_Yh_GLU L120.LC_bm2_R_Tundra_Yh_GLU %>% @@ -368,7 +444,8 @@ module_aglu_LB120.LC_GIS_R_LTgis_Yh_GLU <- function(command, ...) { add_units("bm2") %>% add_comments("Land types from SAGE, HYDE, WDPA merged and reconciled; missing zeroes backfilled; interpolated to AGLU land cover years") %>% add_legacy_name("L120.LC_bm2_R_Tundra_Yh_GLU") %>% - add_precursors("common/iso_GCAM_regID", "aglu/LDS/LDS_land_types", "aglu/SAGE_LT", "L100.Land_type_area_ha") -> + add_precursors("common/iso_GCAM_regID", "aglu/LDS/LDS_land_types", "aglu/SAGE_LT", "L100.Land_type_area_ha", + "water/basin_to_country_mapping") -> L120.LC_bm2_R_Tundra_Yh_GLU L120.LC_bm2_R_RckIceDsrt_Yh_GLU %>% @@ -376,7 +453,8 @@ module_aglu_LB120.LC_GIS_R_LTgis_Yh_GLU <- function(command, ...) { add_units("bm2") %>% add_comments("Land types from SAGE, HYDE, WDPA merged and reconciled; missing zeroes backfilled; interpolated to AGLU land cover years") %>% add_legacy_name("L120.LC_bm2_R_RckIceDsrt_Yh_GLU") %>% - add_precursors("common/iso_GCAM_regID", "aglu/LDS/LDS_land_types", "aglu/SAGE_LT", "L100.Land_type_area_ha") -> + add_precursors("common/iso_GCAM_regID", "aglu/LDS/LDS_land_types", "aglu/SAGE_LT", "L100.Land_type_area_ha", + "water/basin_to_country_mapping") -> L120.LC_bm2_R_RckIceDsrt_Yh_GLU L120.LC_bm2_ctry_LTsage_GLU %>% @@ -385,7 +463,8 @@ module_aglu_LB120.LC_GIS_R_LTgis_Yh_GLU <- function(command, ...) { add_comments("Land types from SAGE, HYDE, WDPA merged and reconciled; missing zeroes backfilled; interpolated to AGLU land cover years") %>% add_comments("Mean computed for HYDE 'Unmanaged' over available historical years") %>% add_legacy_name("L120.LC_bm2_ctry_LTsage_GLU") %>% - add_precursors("common/iso_GCAM_regID", "aglu/LDS/LDS_land_types", "aglu/SAGE_LT", "L100.Land_type_area_ha") -> + add_precursors("common/iso_GCAM_regID", "aglu/LDS/LDS_land_types", "aglu/SAGE_LT", "L100.Land_type_area_ha", + "water/basin_to_country_mapping") -> L120.LC_bm2_ctry_LTsage_GLU L120.LC_bm2_ctry_LTpast_GLU %>% @@ -394,7 +473,8 @@ module_aglu_LB120.LC_GIS_R_LTgis_Yh_GLU <- function(command, ...) { add_comments("Land types from SAGE, HYDE, WDPA merged and reconciled; missing zeroes backfilled; interpolated to AGLU land cover years") %>% add_comments("Mean computed for HYDE 'Pasture' over available historical years") %>% add_legacy_name("L120.LC_bm2_ctry_LTpast_GLU") %>% - add_precursors("common/iso_GCAM_regID", "aglu/LDS/LDS_land_types", "aglu/SAGE_LT", "L100.Land_type_area_ha") -> + add_precursors("common/iso_GCAM_regID", "aglu/LDS/LDS_land_types", "aglu/SAGE_LT", "L100.Land_type_area_ha", + "water/basin_to_country_mapping") -> L120.LC_bm2_ctry_LTpast_GLU L120.LC_prot_land_frac_GLU %>% @@ -402,7 +482,8 @@ module_aglu_LB120.LC_GIS_R_LTgis_Yh_GLU <- function(command, ...) { add_units("fraction") %>% add_comments("Land types from SAGE, HYDE, WDPA merged and reconciled; missing zeroes backfilled; interpolated to AGLU land cover years") %>% add_legacy_name("L120.LC_prot_land_frac_GLU") %>% - add_precursors("common/iso_GCAM_regID", "aglu/LDS/LDS_land_types", "aglu/SAGE_LT", "L100.Land_type_area_ha") -> + add_precursors("common/iso_GCAM_regID", "aglu/LDS/LDS_land_types", "aglu/SAGE_LT", "L100.Land_type_area_ha", + "water/basin_to_country_mapping") -> L120.LC_prot_land_frac_GLU L120.LC_soil_veg_carbon_GLU %>% @@ -410,7 +491,8 @@ module_aglu_LB120.LC_GIS_R_LTgis_Yh_GLU <- function(command, ...) { add_units("kg/m2") %>% add_comments("Land types from SAGE, HYDE, WDPA merged and reconciled; missing zeroes backfilled; interpolated to AGLU land cover years. Soil carbon is at a depth of 0-30 cms and vegetation carbon is a combination of above and below ground biomass.") %>% add_legacy_name("L120.LC_soil_veg_carbon_GLU") %>% - add_precursors("common/iso_GCAM_regID", "aglu/LDS/LDS_land_types", "aglu/SAGE_LT", "L100.Land_type_area_ha","L100.Ref_veg_carbon_Mg_per_ha","aglu/Various_CarbonData_LTsage")->L120.LC_soil_veg_carbon_GLU + add_precursors("common/iso_GCAM_regID", + "water/basin_to_country_mapping", "aglu/LDS/LDS_land_types", "aglu/SAGE_LT", "L100.Land_type_area_ha","L100.Ref_veg_carbon_Mg_per_ha","aglu/Various_CarbonData_LTsage")->L120.LC_soil_veg_carbon_GLU return_data(L120.LC_bm2_R_LT_Yh_GLU, L120.LC_bm2_R_UrbanLand_Yh_GLU, L120.LC_bm2_R_Tundra_Yh_GLU, L120.LC_bm2_R_RckIceDsrt_Yh_GLU, L120.LC_bm2_ctry_LTsage_GLU, L120.LC_bm2_ctry_LTpast_GLU, L120.LC_prot_land_frac_GLU, L120.LC_soil_veg_carbon_GLU) } else { diff --git a/inst/extras/zchunk_LB122.LC_R_Cropland_Yh_GLU_breakout_gcamv6p0.R b/inst/extras/zchunk_LB122.LC_R_Cropland_Yh_GLU_breakout_gcamv6p0.R new file mode 100644 index 0000000..3856fb1 --- /dev/null +++ b/inst/extras/zchunk_LB122.LC_R_Cropland_Yh_GLU_breakout_gcamv6p0.R @@ -0,0 +1,652 @@ +# Copyright 2019 Battelle Memorial Institute; see the LICENSE file. + +#' module_aglu_LB122.LC_R_Cropland_Yh_GLU +#' +#' Integrate disparate data sources for land cover and harvested area from FAO, Monfreda, and Hyde in +#' order to calculate cropland cover by specific crop type, other arable land, harvested:cropped ratio, economic +#' yield (i.e., production per unit cropland area per year, rather than production per unit area per harvest), and +#' "extra" cropland that needs to be taken from other land use types. All data tables are written out +#' at the GCAM region-GLU level for each historical year, including carbon cycle model spinup years. +#' +#' @param command API command to execute +#' @param ... other optional parameters, depending on command +#' @return Depends on \code{command}: either a vector of required inputs, +#' a vector of output names, or (if \code{command} is "MAKE") all +#' the generated outputs: \code{L122.ag_HA_to_CropLand_R_Y_GLU}, \code{L122.ag_EcYield_kgm2_R_C_Y_GLU}, +#' \code{L122.LC_bm2_R_OtherArableLand_Yh_GLU}, \code{L122.LC_bm2_R_ExtraCropLand_Yh_GLU}, +#' \code{L122.LC_bm2_R_HarvCropLand_C_Yh_GLU}, \code{L122.LC_bm2_R_HarvCropLand_Yh_GLU}. +#' The corresponding file in the original data system was \code{LB122.LC_R_Cropland_Yh_GLU.R} (aglu level1). +#' @details First, Hyde cropland cover is aggregated to the region-GLU level in each year, and supplemented with Monfreda +#' harvested area information when necessary. Second, FAO fallowland, cropland, and harvested area are aggregated from +#' the country level to the region level, and used to calculate the "residual" cropland in each land use region: +#' total cropland (Hyde) - known fallow (FAO) - harvested crops (FAO/Monfreda). +#' The harvested area : cropland ratio (HA:CL) is computed as (sum of harvested area) / (cropland - fallow land). +#' Where HA:CL < 1, HA:CL is set to 1, and the balance (the "residual" above) is added to OtherArableLand. +#' Where HA:CL > 3, HA:CL is set to 3, and additional cropland (ExtraCropLand) is written out, to be taken from +#' other land use types (determined in different code chunks). +#' @importFrom assertthat assert_that +#' @importFrom dplyr anti_join arrange bind_rows distinct filter if_else group_by left_join mutate select summarise summarise_all +#' @importFrom tidyr replace_na +#' @author ACS April 2017 +module_aglu_LB122.LC_R_Cropland_Yh_GLU <- function(command, ...) { + if(command == driver.DECLARE_INPUTS) { + return(c(FILE = "common/iso_GCAM_regID", + FILE = "water/basin_to_country_mapping", + "L100.FAO_fallowland_kha", + "L100.FAO_CL_kha", + "L100.FAO_harv_CL_kha", + "L101.ag_HA_bm2_R_C_Y_GLU", + "L101.ag_Prod_Mt_R_C_Y_GLU", + "L120.LC_bm2_R_LT_Yh_GLU")) + } else if(command == driver.DECLARE_OUTPUTS) { + return(c("L122.ag_HA_to_CropLand_R_Y_GLU", + "L122.ag_EcYield_kgm2_R_C_Y_GLU", + "L122.LC_bm2_R_OtherArableLand_Yh_GLU", + "L122.LC_bm2_R_ExtraCropLand_Yh_GLU", + "L122.LC_bm2_R_HarvCropLand_C_Yh_GLU", + "L122.LC_bm2_R_HarvCropLand_Yh_GLU")) + } else if(command == driver.MAKE) { + + Land_Type <- year <- . <- GCAM_region_ID <- GLU <- GCAM_commodity <- + value <- iso <- countries <- cropland <- fallow <- fallow_frac <- cropped <- + cropped_frac <- uncropped_frac <- nonharvested_frac <- value.x <- + value.y <- Land_Type.y <- Land_Type.x <- GCAM_subsector <- NULL # silence package check. + + all_data <- list(...)[[1]] + + # Load required inputs + iso_GCAM_regID <- get_data(all_data, "common/iso_GCAM_regID") + L100.FAO_fallowland_kha <- get_data(all_data, "L100.FAO_fallowland_kha") + L100.FAO_CL_kha <- get_data(all_data, "L100.FAO_CL_kha") + L100.FAO_harv_CL_kha <- get_data(all_data, "L100.FAO_harv_CL_kha") + L101.ag_HA_bm2_R_C_Y_GLU <- get_data(all_data, "L101.ag_HA_bm2_R_C_Y_GLU", strip_attributes = TRUE) + L101.ag_Prod_Mt_R_C_Y_GLU <- get_data(all_data, "L101.ag_Prod_Mt_R_C_Y_GLU") + L120.LC_bm2_R_LT_Yh_GLU <- get_data(all_data, "L120.LC_bm2_R_LT_Yh_GLU") + + #........................ + # gcambreakout 17 July 2022 + # Temporary fix until circular dependency on + # L123.LC_bm2_R_MgdFor_Yh_GLU_beforeadjust is fixed. + #........................ + + # Valid GLU Region combos + glu_gcam <- get_data(all_data, "water/basin_to_country_mapping") %>% + dplyr::select(iso=ISO, GLU=GLU_code) %>% + dplyr::mutate(iso = tolower(iso)) %>% + dplyr::left_join(iso_GCAM_regID, by=c("iso")) %>% + dplyr::select(GLU, GCAM_region_ID) %>% + dplyr::filter(GCAM_region_ID > 32) %>% + unique(); glu_gcam + + remove_glu <- glu_gcam$GLU %>% unique(); remove_glu + + L101.ag_HA_bm2_R_C_Y_GLU %>% + dplyr::mutate(remove = dplyr::if_else(((GLU %in% remove_glu) & (GCAM_region_ID <33)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove)-> + L101.ag_HA_bm2_R_C_Y_GLU + + L101.ag_Prod_Mt_R_C_Y_GLU %>% + dplyr::mutate(remove = dplyr::if_else(((GLU %in% remove_glu) & (GCAM_region_ID <33)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove)-> + L101.ag_Prod_Mt_R_C_Y_GLU + + L120.LC_bm2_R_LT_Yh_GLU %>% + dplyr::mutate(remove = dplyr::if_else(((GLU %in% remove_glu) & (GCAM_region_ID <33)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove)-> + L120.LC_bm2_R_LT_Yh_GLU + + #....................... gcambreakout close edits + + + # Line 36 in original file + # take a subset of the land cover table L120.LC_bm2_R_LT_YH_GLU: cropland, and only in aglu historical years + L120.LC_bm2_R_LT_Yh_GLU %>% + filter(Land_Type == "Cropland", year %in% aglu.AGLU_HISTORICAL_YEARS) -> + # store in table Land Cover in bm2 by Region, Year and GLU for Cropland. + L122.LC_bm2_R_CropLand_Y_GLU + + # Lines 40-45 in original file + # The harvested area/production tables L103.ag.X (from Monfreda) may have R_GLUs not in the cropland table + # L122.LC_bm2_R_CropLand_Y_GLU (from Hyde), and vice versa. + # Fill out the cropland table to include all R_GLUs in Monfreda: + L122.LC_bm2_R_CropLand_Y_GLU %>% + # find the region-GLU combos in the Monfreda harvested area table L101.ag_HA_bm2_R_C_Y_GLU NOT contained + # in the L122.LC_bm2_R_CropLand_Y_GLU land cover table: + anti_join(L101.ag_HA_bm2_R_C_Y_GLU[,c("GCAM_region_ID", "GLU", "year")], ., + by = c("GCAM_region_ID", "GLU", "year")) %>% + # save only the unique combinations: + unique() %>% + # arrange so rows occur in more sensible order: + arrange(GCAM_region_ID, GLU, year) %>% + # add values of 0 everywhere for now: + mutate(value = 0, + # add a Land_Type identifier: + Land_Type = "Cropland") %>% + # add these rows to the original Land Cover table: + bind_rows(L122.LC_bm2_R_CropLand_Y_GLU) -> + # save as the Land C over table: + L122.LC_bm2_R_CropLand_Y_GLU + + # Line 48 in original file + # old comment: compile harvested area across all crops + # Take the input historical harvested area table, L101.ag_HA_bm2_R_C_Y_GLU, and sum over GCAM_commodity, so that each + # region-GLU-year combo has a single value. + L101.ag_HA_bm2_R_C_Y_GLU %>% + group_by(GCAM_region_ID, GLU, year) %>% + # and sum by region-GLU-year: + summarise(value = sum(value)) %>% + ungroup() -> + L122.ag_HA_bm2_R_Y_GLU + + # Calculating the average percent of cropland that is fallow in each region + # using the average cropland, fallow land, and land in temporary crops from FAO RESOURCESTAT + # The time series is unreliable, so using the average of all available years between 2008 and 2012 + # (and applying to all historical years) + # And continue with calculating average crop land, fallow land, land in temporary crops: + # compile the ratio of "temporary crops" to total arable land in each region + # make table with fallow land compared to total arable land + # FAO fallow land data, L100.FAO_fallowland_kha, is appended to the FAO cropland data table. Quantities are aggregated + # from iso to GCAM region and the fraction of fallowland is calculated. + # + # The old data sytem uses match to append FAO fallow land data to FAO cropland data by iso. However, Ethiopia, + # Sudan, and Belgium-Luxembourg have all split into two distinct countries and FAO produces data for each. + # Specifically, there are two rows with iso = "eth" and two rows with iso = "sdn" and two rows with iso = "bel" in some FAO data. + # Because match only pulls the first value when there are multiple potential matches, both "eth" cropland rows get the first + # "eth" fallowland row, rather than their correct value. The same occurs for the two "sdn" and "bel" rows. The solution is simple: + # joining by iso and countries (or country.codes) instead of simply iso. Alternatively, aggregating to the iso level in each + # FAO table (L100.FAO_X) BEFORE doing further joins and calculations should also lead to the correct answer. + + # Take the FAO cropland table, L100.FAO_CL_kha: + L100.FAO_CL_kha %>% + # only include data in the right fallow land year range + filter(year %in% aglu.FALLOW_YEARS) %>% + # keep only the iso country and the value for each: + select(iso, countries, cropland = value, year) %>% + # append in fallow land data in aglu.FALLOW_YEARS from FAO, L100.FAO_fallowland_kha, keeping NA values: + left_join(L100.FAO_fallowland_kha, by = c("iso", "countries", "year")) %>% + # rename value to fallow and remove NAs: + rename(fallow = value) %>% + na.omit() %>% + # add GCAM region information from iso_GCAM_regID + mutate(GCAM_region_ID = left_join(., iso_GCAM_regID, by = "iso")[['GCAM_region_ID']]) %>% + select(GCAM_region_ID, cropland, fallow) %>% + ungroup() %>% + # aggregate cropland and fallow values to the GCAM region level: + group_by(GCAM_region_ID) %>% + summarise_all(sum) %>% + # calculate the fraction of total land in each GCAM region that is fallow: + mutate(fallow_frac = fallow / cropland) -> + # store in a table of cropland, fallow information by region: + L122.cropland_fallow_R + + # Lines 55-74 in original file + # Calculating the average percent of cropland that is not in active crop rotations in each region + # make table with cropped land compared to total arable land + # FAO harvested area data, L100.FAO_harv_CL_kha, is appended to the FAO cropland data table. Quantities are aggregated + # from iso to GCAM region and the fraction of cropped land is calculated. + # + # These lines of code also pull FAO data that is susceptible to the double labeling in Ethiopia, Sudan, and Belgium. + # The same match error occurs as above, and we fix in the same way: + + # Take the FAO cropland table, L100.FAO_CL_kha: + L100.FAO_CL_kha %>% + # only include data in the right fallow land year range + filter(year %in% aglu.FALLOW_YEARS) %>% + # keep only the iso country and the value for each: + select(iso, countries, cropland = value, year) %>% + # append in cropped land data in aglu.FALLOW_YEARS from FAO, L100.FAO_harv_CL_kha, keeping NA values: + left_join(L100.FAO_harv_CL_kha, by = c("iso", "countries", "year")) %>% + # rename value to cropped and remove NAs: + rename(cropped = value) %>% + na.omit() %>% + # add GCAM region information from iso_GCAM_regID + mutate(GCAM_region_ID = left_join(., iso_GCAM_regID, by = "iso")[['GCAM_region_ID']]) %>% + # remove all columns that are not GCAM_region_ID, cropland, and cropped values: + select(GCAM_region_ID, cropland, cropped) %>% + ungroup() %>% + # aggregate cropland and cropped values to the GCAM region level: + group_by(GCAM_region_ID) %>% + summarise_all(sum) %>% + # calculate the fraction of total land in each GCAM region that is cropped: + mutate(cropped_frac = cropped/cropland) -> + # store in a table of cropland, cropped information by region: + L122.cropland_cropped_R + + # Lines 76-89 in original file + # calculate the average amount of cropland that is not in production as the fallow land fraction, + # where available, or else the non-cropped cropland + # based on availability, using (1) fallow land fraction, (2) fraction of cropland not in crop rotations, or (3) 0 + # Calculating cropland not in production is done via a series of nested if statements. + + # take the unique GCAM regions + tibble::tibble(GCAM_region_ID = unique(iso_GCAM_regID$GCAM_region_ID)) %>% + # sort the ids: + arrange(GCAM_region_ID) %>% + # add a land type identifier for each region: + mutate(Land_Type = "Cropland") %>% + # join in fallow land table, L122.cropland_fallow_R, to get the fallow_frac for each region, + # maintaining NA's for use in determining data availability to calculate nonharvested_frac: + mutate(fallow_frac = left_join(., L122.cropland_fallow_R, by = "GCAM_region_ID")[['fallow_frac']]) %>% + # join in cropped land table, L122.cropland_cropped_R, to get the cropped_frac for each region, and + # use to calculate the uncropped fraction, maintaining NA's to set to 0 later: + mutate(uncropped_frac = 1 - left_join(., L122.cropland_cropped_R, by = "GCAM_region_ID")[['cropped_frac']]) %>% + # calculate the nonharvested fraction of land via nested if statements + # based on availability, using (1) fallow land fraction, (2) land not in crop rotations, or (3) 0 + # This step determines (1) versus (2): + # If there is no available fallow land data + mutate(nonharvested_frac = if_else(is.na(fallow_frac), + # use the uncropped fraction + uncropped_frac, + # otherwise, use the available fallow land data: + fallow_frac)) %>% + # This step determines (3) when (1) and (2) are not available: + replace_na(list(nonharvested_frac = 0)) -> + # store in a table of nonharvested cropland fractions by region: + L122.nonharvested_cropland_R + + + # Lines 91-99 in original file + # applying regional average fallow fractions to all GLUs within each region + # making two tables: the fallow land table and then, using the fallow land table, the available cropland table + + # take cropland table with region, landtype and glu information for each year: + L122.LC_bm2_R_CropLand_Y_GLU %>% + # join in the non harvested fraction for each region: + # Note that there is no information for GCAM region 30 in L122.LC_bm2_R_CropLand_Y_GLU, even though + # a nonharvested fraction (of 0) is calculated in L122.nonharvested_cropland_R. + left_join(L122.nonharvested_cropland_R, by = c("GCAM_region_ID", "Land_Type")) %>% + # drop unnecessary columns that come from the join: + select(-fallow_frac, -uncropped_frac) %>% + # use the nonharvested_frac and the cropland area information (value) for each Region-GLU-Year to calculate + # the amouunt of fallowland in that Region-GLU-Year = value * nonharvested_frac + mutate(value = value * nonharvested_frac, + # update the Land_Type identifier to reflect that this is now FallowLand, not Cropland + Land_Type = "FallowLand") %>% + # drop nonharvested_frac since no longer necessary: + select(-nonharvested_frac) -> + # store in a table of fallowland land cover in bm2 for each region-glu-year + L122.LC_bm2_R_FallowLand_Y_GLU + + # Use the just made fallow land table to calculate a table of Available CropLand in each region-glu-year + # Available cropland = totalcropland from L122.LC_bm2_R_CropLand_Y_GLU - fallowland from L122.LC_bm2_R_FallowLand_Y_GLU + # Take the table of total cropland in each region-GLU-year: + L122.LC_bm2_R_CropLand_Y_GLU %>% + # join in the land that is fallow in each region-glu-year + # absolutely should match up and it's a problem at this point if they don't, so left_join_error_no_match: + left_join_error_no_match(L122.LC_bm2_R_FallowLand_Y_GLU, by = c("GCAM_region_ID", "GLU", "year")) %>% + # value.x = value from Cropland table, the total amount of cropland in the region-glu-year + # value.y = value from FallowLand table, the amount of fallowland in the region-glu-year + # therefore, available cropland value = value.x-value.y: + mutate(value = value.x-value.y) %>% + # remove value.x, value.y and Land_Type.y as now unnecessary: + select(-value.x, -value.y, -Land_Type.y) %>% + # rename Land_Type.x to Land_Type: + rename(Land_Type = Land_Type.x) -> + # store in a table of available cropland: + L122.LC_bm2_R_AvailableCropLand_Y_GLU + + + # Lines 101-114 in original file + # Calculate the harvested to cropped land ratio for all crops, by region, year, and GLU + # applying minimum and maximum harvested:cropped ratios + # Maximum harvested:cropped ratio may cause cropland to expand + # This additional cropland will need to be balanced by a deduction from other land types later on, so it is tracked below + # take harvested area by region-glu-year: + L122.ag_HA_bm2_R_Y_GLU %>% + # join the available cropland by region-glu-year + left_join_error_no_match(L122.LC_bm2_R_AvailableCropLand_Y_GLU, by = c("GCAM_region_ID", "GLU", "year")) %>% + # value.x = value from L122.ag_HA_bm2_R_Y_GLU, the harvested area + # value.y = value from L122.LC_bm2_R_AvailableCropLand_Y_GLU, the available cropland + # harvested area to available cropland ratio is value.x/value.y + mutate(value = value.x / value.y) %>% + # remove unneeded columns: + select(-value.x, -value.y, -Land_Type) %>% + # if the harvested to cropland ratio, value, is less than the min acceptable harvested area to cropland, + # aglu.MIN_HA_TO_CROPLAND, replace with aglu.MIN_HA_TO_CROPLAND + mutate(value = if_else(value < aglu.MIN_HA_TO_CROPLAND, aglu.MIN_HA_TO_CROPLAND, value), + # if the harvested to cropland ratio is greater than the max acceptable harvested area to cropland, + # aglu.MAX_HA_TO_CROPLAND, replace with aglu.MAX_HA_TO_CROPLAND + value = if_else(value > aglu.MAX_HA_TO_CROPLAND, aglu.MAX_HA_TO_CROPLAND, value)) -> + # store in a table of HA to cropland ratios by region-glu-year + L122.ag_HA_to_CropLand_R_Y_GLU + + # Lines 116-126 in original file + # The ag_HA_to_CropLand ratio is assumed to be a property of the region and GLU (not specific to individual crops) + # Calculate cropland requirements of each crop as harvested area divided by regional ag_HA_to_CropLand ratio + # Take input harvested area by region-commodity-glu-year: + L101.ag_HA_bm2_R_C_Y_GLU %>% + # join the harvested area to cropland ratios, L122.ag_HA_to_CropLand_R_Y_GLU: + left_join_error_no_match(L122.ag_HA_to_CropLand_R_Y_GLU, by = c("GCAM_region_ID", "GLU", "year")) %>% + # value.x = original harvested area info for each GCAM_commodity from L101.ag_HA_bm2_R_C_Y_GLU + # value.y = HA:CL ratio from L122.ag_HA_to_CropLand_R_Y_GLU just joined + # calculate the harvested cropland for each commodity as value = value.x/value.y: + mutate(value = value.x / value.y) %>% + select(-value.x, -value.y) %>% + # add a Land_Type identifier: + mutate(Land_Type = "HarvCropLand") -> + # store in a table of Harvested Cropland by region-commodity-glu-year: + L122.LC_bm2_R_HarvCropLand_C_Y_GLU + + # Lines 125:128 in original file + # Aggregate across crops to get harvested cropland area, by region/GLU/year + # The harvested cropland area by region-commodity-glu-year table, L122.LC_bm2_R_HarvCropLand_C_Y_GLU, + # is used for other calculations below. That is why this is not part of the previous pipeline + # Take harvested cropland area by region-commodity-glu-year: + L122.LC_bm2_R_HarvCropLand_C_Y_GLU %>% + group_by(GCAM_region_ID, GLU, Land_Type, year) %>% + summarise(value = sum(value)) -> + # store in a table of Harvested cropland by region-glu-year: + L122.LC_bm2_R_HarvCropLand_Y_GLU + + + # Lines 130-136 in original file + # Calculate economic yield by each crop as production divided by cropland. Write out this preliminary table. + # Production by region-glu-commodity-year comes from input data L101.ag_Prod_Mt_R_C_Y_GLU. + # Cropland area by region-glu-commodity-year was calculated as table L122.LC_bm2_R_HarvCropLand_C_Y_GLU + # Take cropland by region-glu-commodity-year: + L122.LC_bm2_R_HarvCropLand_C_Y_GLU %>% + # join the production by region-glu-commodity-year information: + left_join_error_no_match(L101.ag_Prod_Mt_R_C_Y_GLU, by = c("GCAM_region_ID", "GCAM_commodity", "GCAM_subsector", "GLU", "year")) %>% + # value.x = the cropland area by region-commodity-glu-year from L122.LC_bm2_R_HarvCropLand_C_Y_GLU + # value.y = production by region-commodity-glu-year from L101.ag_Prod_Mt_R_C_Y_GLU + # Calculate yield by region-commodity-glu-year as value = value.y/value.x: + mutate(value = value.y / value.x) %>% + select(-value.x, -value.y, -Land_Type) %>% + # set any NA values to 0 yield: + replace_na(list(value = 0)) -> + # store in a table of Economic Yield by region-commodity-glu-year: + L122.ag_EcYield_kgm2_R_C_Y_GLU + + + # Calculating OtherArableLand: + + # Lines 138:148 in original file + # The minimum threshold on HA:CL means that some cropland in Hyde will not be assigned to a crop. This is mapped to "other arable land" + # The maximum threshold on HA:CL means that cropland in Hyde in some ag regions may be less than cropland in GCAM + # In the latter case, land needs to be mapped to cropland from other uses. + # The first step in executing the three above lines of comment is to calculate the residual land cover that is + # cropland (may be positive or negative): residual = cropland - fallow land - harvested area by crop type + # Take harvested cropland by region-glu-year: + L122.LC_bm2_R_HarvCropLand_Y_GLU %>% + # update the landtype to be residual cropland + ungroup() %>% mutate(Land_Type = "ResidualCropLand") %>% + # Join in the available cropland by region-glu-year + left_join_error_no_match(L122.LC_bm2_R_AvailableCropLand_Y_GLU, by = c("GCAM_region_ID", "GLU", "year")) %>% + # value.x = region-glu-year harvested cropland from L122.LC_bm2_R_HarvCropLand_Y_GLU + # value.y = region-glu-year available cropland from L122.LC_bm2_R_AvailableCropLand_Y_GLU + # Calculate residual cropland as harvested-available, value = value.x-value.y: + mutate(value = value.x - value.y) %>% + # remove unnecessary columns: + select(-value.x, -value.y, -Land_Type.y) %>% + rename(Land_Type = Land_Type.x) -> + # store in a table of Residual Cropland by region-glu-year + L122.LC_bm2_R_ResidualCropLand_Y_GLU + + # second step to execute max/min comments above is to process the residuals + # Lines 150-161 in original file + # Calculating unused cropland; this is added with fallow land to calculate other arable land + # Where residuals are negative, this is "unused" cropland that will be mapped to other arable land + # Take the residual cropland by region-glu-year: + L122.LC_bm2_R_ResidualCropLand_Y_GLU %>% + # update the Land_Type identifier + ungroup() %>% mutate(Land_Type = "UnusedCropLand") %>% + # positive residuals cannot be remapped to OtherArableLand. Therefore, they do not count as UnusedCropLand + # and region-glu-years with positive residual have 0 UnusedCropLand: + mutate(value = if_else(value > 0, 0, value), + # negative residuals ARE UnusedCropLand. -1 * the negative residual is the amount of UnusuedCropLand that + # can be mapped to OtherArable Land. Calculate UnusedCropLand: + value = -1 * value) -> + # store in a table of UnusedCropLand by region-glu-year + L122.LC_bm2_R_UnusedCropLand_Y_GLU + + # Calculating extra cropland; this will be balanced by a deduction from unmanaged lands + # Where residuals are positive, this is "extra" land that will later be deducted from other categories. + # Take the residual cropland by region-glu-year: + L122.LC_bm2_R_ResidualCropLand_Y_GLU %>% + # update the Land_Type identifier + ungroup() %>% mutate(Land_Type = "ExtraCropLand") %>% + # negative residuals do not count as ExtraCropLand. Therefore, any negative values in value are + # remapped to 0 to represent 0 ExtraCropLand: + mutate(value = if_else(value < 0, 0, value)) -> + # store in a table of ExtraCropLand by region-glu-year: + L122.LC_bm2_R_ExtraCropLand_Y_GLU + + # Lines 163-178 in original file + # Calculating other arable land: known fallow plus discrepancy between sum of harvested area and cropland + # Assigning all cropland to other arable land wherever harvested area is zero + # If there are any land use regions with 0 harvested area (Monfreda) but positive cropland cover (Hyde), these are missing + # values in the above table, and all of this cropland should be assigned to other arable land. + # + # Take FallowLand by region-GLU-year: + L122.LC_bm2_R_FallowLand_Y_GLU %>% + # update the Land_Type identifier + ungroup() %>% mutate(Land_Type = "OtherArableLand") %>% + # join the table of unused cropland by region-glu-year, L122.LC_bm2_UnusedCropLand_Y_GLU + # NAs retained as in old DS: + left_join(L122.LC_bm2_R_UnusedCropLand_Y_GLU, by = c("GCAM_region_ID", "GLU", "year")) %>% + # value.x = fallow land in region-glu-year from L122.LC_bm2_R_FallowLand_Y_GLU + # value.y = unused land in region-glu-year from L122.LC_bm2_R_FallowLand_Y_GLU + # OtherArableLand = fallow + unused <=> value = value.x + value.y: + mutate(value = value.x + value.y) %>% + # remove unnecessary columns: + select(-value.x, -value.y, -Land_Type.y) %>% + rename(Land_Type = Land_Type.x) %>% + # join the cropland info so that can handle NA's + left_join(L122.LC_bm2_R_CropLand_Y_GLU, by = c("GCAM_region_ID", "GLU", "year")) %>% + # value.x = OtherArableLand value + # value.y = Cropland value + # Assigning cropland to other arable land wherever harvested area is zero + # If there are any land use regions with 0 harvested area (Monfreda) but positive cropland cover (Hyde), these are missing + # values in the above table, and all of this cropland should be assigned to other arable land. + # for NA values in OtherArableLand (value.x), replace with the cropland value (value.y): + mutate(value = if_else(is.na(value.x), value.y, value.x)) %>% + # remove unnecessary columns + select(-value.x, -value.y, -Land_Type.y) %>% + rename(Land_Type = Land_Type.x) -> + # store in a table of OtherArableLand by region-glu-year: + L122.LC_bm2_R_OtherArableLand_Y_GLU + + + # Land use history + # Lines 181 - 200 in original file + # Cropland quantities prior to the first AGLU historical year, for spinup of simple carbon cycle model + # NOTE: Simply assigning this to other arable land + # This method differs from prior versions of GCAM, where 1971 land cover quantities were rolled back on the basis of the cropland ratios + # between each land history year and 1971. The problem with this method is that zero values in 1971 can not match non-zero values in prior years. + # The current method instead will have apparent land use change in going from the land history years to the model base years, but due to equal + # soil carbon contents, and similar/small vegetative carbon contents, the net emissions signal should be negligible. + # First, make a table with cropland in the pre-aglu years + L120.LC_bm2_R_LT_Yh_GLU %>% + ungroup %>% + # only save the years in pre-AGLU years: + filter(year %in% aglu.PREAGLU_YEARS) %>% ungroup() %>% + # insure that there is cropland for each GCAM region-glu that appear L122.LC_bm2_R_CropLand_Y_GLU: + tidyr::complete(Land_Type = unique(L122.LC_bm2_R_CropLand_Y_GLU[['Land_Type']]), + tidyr::nesting(GCAM_region_ID, GLU, year), fill = list(value = NA)) %>% + unique() %>% + # join this historical cropland information to the region-glu-landtypes of L122.LC_bm2_R_CropLand_Y_GLU, preserving + # NAs as in old DS: + left_join( + unique(select(L122.LC_bm2_R_CropLand_Y_GLU, GCAM_region_ID, GLU, + Land_Type)), + ., + by = c("GCAM_region_ID", "GLU", "Land_Type")) %>% + # missing values are overwritten to 0: + replace_na(list(value = 0)) %>% + # bind to the table of OtherArableLand information by region-glu-year: + bind_rows(L122.LC_bm2_R_OtherArableLand_Y_GLU, .) %>% + # update the landtype identifier + mutate(Land_Type = "OtherArableLand") -> + # store in a table of OtherArableLand by region-glu-year, including historical years: + L122.LC_bm2_R_OtherArableLand_Yh_GLU + + + # Lines 202-205 in original file + # All other cropland uses are zero in the pre-aglu years + # ExtraCropLand is expanded to include historical years in each region-glu, with a value of 0. + # Take ExtraCropLand by region-glu-year: + L122.LC_bm2_R_ExtraCropLand_Y_GLU %>% + # expand to include history years and fill in those values to be 0: + tidyr::complete(year = c(aglu.PREAGLU_YEARS, aglu.AGLU_HISTORICAL_YEARS), + nesting(GCAM_region_ID, GLU, Land_Type), + fill = list(value = 0)) -> + # store in a table of ExtraCropland by region-glu-year, including historical years: + L122.LC_bm2_R_ExtraCropLand_Yh_GLU + + + # Lines 207-210 in original file + # Harvested cropland history + # HarvCropLand is expanded to include historical years for each region-glu-commodity, with a value of 0. + # Take HarvCropLand by region-commodity-glu-year: + L122.LC_bm2_R_HarvCropLand_C_Y_GLU %>% + ungroup %>% + # expand to include history years and fill in those values to be 0: + tidyr::complete(year = c(aglu.PREAGLU_YEARS, aglu.AGLU_HISTORICAL_YEARS), + nesting(GCAM_region_ID, GCAM_commodity, GCAM_subsector, GLU, Land_Type), + fill = list(value = 0)) -> + # store in a table of HarvCropland by region-commodity-glu-year, including historical years: + L122.LC_bm2_R_HarvCropLand_C_Yh_GLU + + # Lines 212-217 in original file + # Combine crop types to get land use history by all harvested cropland. + # Use the table of HarvCropland by region-commodity-glu-year, including historical years, L122.LC_bm2_R_HarvCropLand_C_Yh_GLU, + # and aggregate across commodity to arrive at a table of All Harvested Cropland by region-glu-year, including historical years. + # Take HarvCropland by region-commodity-glu-year: + L122.LC_bm2_R_HarvCropLand_C_Yh_GLU %>% + # remove commodity because that is what aggregate over: + select(-GCAM_commodity) %>% + # group by region-glu-year to aggregate: + group_by(GCAM_region_ID, GLU, Land_Type, year) %>% + # aggregate: + summarise(value = sum(value)) -> + # store in a table of all HarvCropland by region-glu-year, including historical years: + L122.LC_bm2_R_HarvCropLand_Yh_GLU + + # remove the now-unneeded Land_Type identifier from HarvCropland by region-commodity-glu-year: + L122.LC_bm2_R_HarvCropLand_C_Yh_GLU %>% + select(-Land_Type) -> + L122.LC_bm2_R_HarvCropLand_C_Yh_GLU + + + # Force-Convert years and GCAM_region_IDs in some problematic outputs to integers: + L122.LC_bm2_R_ExtraCropLand_Yh_GLU %>% + ungroup() %>% + mutate(year = as.integer(year), + GCAM_region_ID = as.integer(GCAM_region_ID)) -> + L122.LC_bm2_R_ExtraCropLand_Yh_GLU + + L122.LC_bm2_R_HarvCropLand_C_Yh_GLU %>% + ungroup() %>% + mutate(year = as.integer(year), + GCAM_region_ID = as.integer(GCAM_region_ID)) -> + L122.LC_bm2_R_HarvCropLand_C_Yh_GLU + + L122.LC_bm2_R_HarvCropLand_Yh_GLU %>% + ungroup() %>% + mutate(year = as.integer(year), + GCAM_region_ID = as.integer(GCAM_region_ID)) -> + L122.LC_bm2_R_HarvCropLand_Yh_GLU + + + # Produce outputs + L122.ag_HA_to_CropLand_R_Y_GLU %>% + add_title("Harvested area to cropland ratio by GCAM region / year / GLU") %>% + add_units("Unitless ratio") %>% + add_comments("FAO harvested area, fallow area and land cover area, with Monfreda harvested area and Hyde") %>% + add_comments("land cover data are used to calculate harvested area:cropland for every GCAM region-GLU") %>% + add_legacy_name("L122.ag_HA_to_CropLand_R_Y_GLU") %>% + add_precursors("common/iso_GCAM_regID", + "water/basin_to_country_mapping", + "L100.FAO_fallowland_kha", + "L100.FAO_CL_kha", + "L100.FAO_harv_CL_kha", + "L101.ag_HA_bm2_R_C_Y_GLU", + "L120.LC_bm2_R_LT_Yh_GLU") -> + L122.ag_HA_to_CropLand_R_Y_GLU + + L122.ag_EcYield_kgm2_R_C_Y_GLU %>% + add_title("Economic yield by GCAM region / commodity / year / GLU") %>% + add_units("kilogram per meter squared (kg.m2)") %>% + add_comments("Monfreda agricultural production data is combined with aggregated harvested area data at the") %>% + add_comments("region-GLU-commodity level to calculate economic yield.") %>% + add_legacy_name("L122.ag_EcYield_kgm2_R_C_Y_GLU") %>% + add_precursors("common/iso_GCAM_regID", + "water/basin_to_country_mapping", + "L100.FAO_fallowland_kha", + "L100.FAO_CL_kha", + "L100.FAO_harv_CL_kha", + "L101.ag_HA_bm2_R_C_Y_GLU", + "L101.ag_Prod_Mt_R_C_Y_GLU", + "L120.LC_bm2_R_LT_Yh_GLU") -> + L122.ag_EcYield_kgm2_R_C_Y_GLU + + L122.LC_bm2_R_OtherArableLand_Yh_GLU %>% + add_title("Other arable land cover by GCAM region / year / GLU") %>% + add_units("billion meters squared (bm2)") %>% + add_comments("Other Arable Land cover is calculated at the region-GLU level by using FAO fallow land data and ") %>% + add_comments("adding the difference Harvested Cropland - Available Cropland. ") %>% + add_legacy_name("L122.LC_bm2_R_OtherArableLand_Yh_GLU") %>% + add_precursors("common/iso_GCAM_regID", + "water/basin_to_country_mapping", + "L100.FAO_fallowland_kha", + "L100.FAO_CL_kha", + "L100.FAO_harv_CL_kha", + "L101.ag_HA_bm2_R_C_Y_GLU", + "L120.LC_bm2_R_LT_Yh_GLU") -> + L122.LC_bm2_R_OtherArableLand_Yh_GLU + + L122.LC_bm2_R_ExtraCropLand_Yh_GLU %>% + add_title("Extra cropland cover by GCAM region / year / GLU") %>% + add_units("billion meters squared (bm2)") %>% + add_comments("Any land at the region-GLU level for which Harvested Cropland - Available Cropland is positive, ") %>% + add_comments("making it extra.") %>% + add_legacy_name("L122.LC_bm2_R_ExtraCropLand_Yh_GLU") %>% + add_precursors("common/iso_GCAM_regID", + "water/basin_to_country_mapping", + "L100.FAO_fallowland_kha", + "L100.FAO_CL_kha", + "L100.FAO_harv_CL_kha", + "L101.ag_HA_bm2_R_C_Y_GLU", + "L120.LC_bm2_R_LT_Yh_GLU") -> + L122.LC_bm2_R_ExtraCropLand_Yh_GLU + + L122.LC_bm2_R_HarvCropLand_C_Yh_GLU %>% + add_title("Harvested cropland cover by GCAM region / commodity / year / GLU") %>% + add_units("billion meters squared (bm2)") %>% + add_comments("Harvested cropland at the region-GLU-commodity level is calculated by dividing Monfreda harvested area") %>% + add_comments("values by the HarvestedArea:CropLand ratio calculated from Monfreda, FAO, and Hyde land cover and ") %>% + add_comments("harvested area data.") %>% + add_legacy_name("L122.LC_bm2_R_HarvCropLand_C_Yh_GLU") %>% + add_precursors("common/iso_GCAM_regID", + "water/basin_to_country_mapping", + "L100.FAO_fallowland_kha", + "L100.FAO_CL_kha", + "L100.FAO_harv_CL_kha", + "L101.ag_HA_bm2_R_C_Y_GLU", + "L120.LC_bm2_R_LT_Yh_GLU") -> + L122.LC_bm2_R_HarvCropLand_C_Yh_GLU + + L122.LC_bm2_R_HarvCropLand_Yh_GLU %>% + add_title("Harvested cropland cover by GCAM region / year / GLU") %>% + add_units("billion meters squared (bm2)") %>% + add_comments("Harvested cropland at the region-GLU-commodity level is calculated by dividing Monfreda harvested area") %>% + add_comments("values by the HarvestedArea:CropLand ratio calculated from Monfreda, FAO, and Hyde land cover and ") %>% + add_comments("harvested area data. This commodity information is then aggregated to the region-GLU level.") %>% + add_legacy_name("L122.LC_bm2_R_HarvCropLand_Yh_GLU") %>% + add_precursors("common/iso_GCAM_regID", + "water/basin_to_country_mapping", + "L100.FAO_fallowland_kha", + "L100.FAO_CL_kha", + "L100.FAO_harv_CL_kha", + "L101.ag_HA_bm2_R_C_Y_GLU", + "L120.LC_bm2_R_LT_Yh_GLU") -> + L122.LC_bm2_R_HarvCropLand_Yh_GLU + + return_data(L122.ag_HA_to_CropLand_R_Y_GLU, L122.ag_EcYield_kgm2_R_C_Y_GLU, L122.LC_bm2_R_OtherArableLand_Yh_GLU, L122.LC_bm2_R_ExtraCropLand_Yh_GLU, L122.LC_bm2_R_HarvCropLand_C_Yh_GLU, L122.LC_bm2_R_HarvCropLand_Yh_GLU) + } else { + stop("Unknown command") + } +} diff --git a/inst/extras/zchunk_LB171.LC_R_Cropland_Yh_GLU_irr_breakout_gcamv6p0.R b/inst/extras/zchunk_LB171.LC_R_Cropland_Yh_GLU_irr_breakout_gcamv6p0.R new file mode 100644 index 0000000..27f4528 --- /dev/null +++ b/inst/extras/zchunk_LB171.LC_R_Cropland_Yh_GLU_irr_breakout_gcamv6p0.R @@ -0,0 +1,204 @@ +# Copyright 2019 Battelle Memorial Institute; see the LICENSE file. + +#' module_aglu_LB171.LC_R_Cropland_Yh_GLU_irr +#' +#' Calculate irrigated/rainfed harvested cropland cover and economic yields by GCAM region / commodity / year / GLU. +#' +#' @param command API command to execute +#' @param ... other optional parameters, depending on command +#' @return Depends on \code{command}: either a vector of required inputs, +#' a vector of output names, or (if \code{command} is "MAKE") all +#' the generated outputs: \code{L171.LC_bm2_R_irrHarvCropLand_C_Yh_GLU}, \code{L171.LC_bm2_R_rfdHarvCropLand_C_Yh_GLU}, \code{L171.ag_irrEcYield_kgm2_R_C_Y_GLU}, \code{L171.ag_rfdEcYield_kgm2_R_C_Y_GLU}. The corresponding file in the +#' original data system was \code{LB171.LC_R_Cropland_Yh_GLU_irr.R} (aglu level1). +#' @details This chunk downscales total harvested cropland by GCAM region / commodity / year / GLU to irrigated/rainfed according to irrigated/rainfed shares in the base year, and calculates the economic yields as production divided by cropland. +#' @importFrom assertthat assert_that +#' @importFrom dplyr filter full_join if_else group_by left_join mutate select +#' @importFrom tidyr nesting +#' @author RC May 2017 +module_aglu_LB171.LC_R_Cropland_Yh_GLU_irr <- function(command, ...) { + if(command == driver.DECLARE_INPUTS) { + return(c( FILE = "common/iso_GCAM_regID", + FILE = "water/basin_to_country_mapping", + "L122.LC_bm2_R_HarvCropLand_C_Yh_GLU", + "L161.ag_irrProd_Mt_R_C_Y_GLU", + "L161.ag_rfdProd_Mt_R_C_Y_GLU", + "L161.ag_irrHA_frac_R_C_GLU")) + } else if(command == driver.DECLARE_OUTPUTS) { + return(c("L171.LC_bm2_R_irrHarvCropLand_C_Yh_GLU", + "L171.LC_bm2_R_rfdHarvCropLand_C_Yh_GLU", + "L171.ag_irrEcYield_kgm2_R_C_Y_GLU", + "L171.ag_rfdEcYield_kgm2_R_C_Y_GLU")) + } else if(command == driver.MAKE) { + + year <- value <- GCAM_region_ID <- GCAM_commodity <- GLU <- irrHA_frac <- + irr.harvarea <- rfd_share <- rfd.harvarea <- prod.irr <- irr.yld <- + prod.rfd <- rfd.yld <- GCAM_subsector <- NULL # silence package check. + + all_data <- list(...)[[1]] + + # Load required inputs + L122.LC_bm2_R_HarvCropLand_C_Yh_GLU <- get_data(all_data, "L122.LC_bm2_R_HarvCropLand_C_Yh_GLU", strip_attributes = TRUE) + L161.ag_irrProd_Mt_R_C_Y_GLU <- get_data(all_data, "L161.ag_irrProd_Mt_R_C_Y_GLU", strip_attributes = TRUE) + L161.ag_rfdProd_Mt_R_C_Y_GLU <- get_data(all_data, "L161.ag_rfdProd_Mt_R_C_Y_GLU", strip_attributes = TRUE) + L161.ag_irrHA_frac_R_C_GLU <- get_data(all_data, "L161.ag_irrHA_frac_R_C_GLU", strip_attributes = TRUE) + + # First, calculate the share of irrigated vs. rainfed cropland in the base year by GCAM region, commodity and GLU. + L161.ag_irrHA_frac_R_C_GLU %>% + select(GCAM_region_ID, GCAM_commodity, GCAM_subsector, GLU, irrHA_frac) %>% + # Get the share of rainfed cropland + mutate(rfd_share = 1 - irrHA_frac) -> + L171.ag_irrHA_frac_R_C_GLU + + # Second, downscale total harvested cropland to irrigated and rainfed by GCAM region, commodity, year and GLU. + # Apply the ~2000-era share of irrigated vs. rainfed cropland to all historial periods (due to lack of data indicating otherwise). + # Use left_join to allow missing values (for areas like islands excluded from MIRCA inventory) where production is assumed 100% rainfed + IrrRfdCropland <- + L122.LC_bm2_R_HarvCropLand_C_Yh_GLU %>% + left_join(L171.ag_irrHA_frac_R_C_GLU, + by = c("GCAM_region_ID", "GCAM_commodity", + "GCAM_subsector", "GLU")) %>% + mutate(irrHA_frac = if_else(is.na(irrHA_frac), 0, irrHA_frac), + rfd_share = if_else(is.na(rfd_share), 1, rfd_share), + irr.harvarea = value * irrHA_frac, + rfd.harvarea = value * rfd_share) + + ## Extend to cover all years 1700-2010. + idvars <- c('GCAM_region_ID', 'GCAM_commodity', 'GCAM_subsector', 'GLU', 'year') + allyr <- seq(min(HISTORICAL_YEARS), max(HISTORICAL_YEARS)) + IrrRfdCropland %>% + tidyr::expand(nesting(GCAM_region_ID, GCAM_commodity, GCAM_subsector, GLU), + year = allyr) %>% + left_join(IrrRfdCropland, by=idvars) %>% + group_by(GCAM_region_ID, GCAM_commodity, GCAM_subsector, GLU) %>% + mutate(irr.harvarea = approx_fun(year, irr.harvarea, rule = 2), + rfd.harvarea = approx_fun(year, rfd.harvarea, rule = 2)) %>% + ungroup -> IrrRfdCropland.interp + + ## Compute economic yield for each category as production divided by + ## harvested area. + prod.both <- + full_join(rename(L161.ag_rfdProd_Mt_R_C_Y_GLU, prod.rfd = value), + rename(L161.ag_irrProd_Mt_R_C_Y_GLU, prod.irr = value), + by = idvars) %>% + filter(year %in% c(HISTORICAL_YEARS, FUTURE_YEARS)) + + #........................ + # gcambreakout 17 July 2022 + # Temporary fix until circular dependency on + # L123.LC_bm2_R_MgdFor_Yh_GLU_beforeadjust is fixed. + #........................ + + iso_GCAM_regID <- get_data(all_data, "common/iso_GCAM_regID") + + # Valid GLU Region combos + glu_gcam <- get_data(all_data, "water/basin_to_country_mapping") %>% + dplyr::select(iso=ISO, GLU=GLU_code) %>% + dplyr::mutate(iso = tolower(iso)) %>% + dplyr::left_join(iso_GCAM_regID, by=c("iso")) %>% + dplyr::select(GLU, GCAM_region_ID) %>% + dplyr::filter(GCAM_region_ID > 32) %>% + unique(); glu_gcam + + remove_glu <- glu_gcam$GLU %>% unique(); remove_glu + + prod.both <- + prod.both %>% + dplyr::mutate(remove = dplyr::if_else(((GLU %in% remove_glu) & (GCAM_region_ID <33)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) + + #........................breakout close edit + + ecyield.both <- left_join_error_no_match(prod.both, IrrRfdCropland.interp, + by = idvars) %>% + mutate(irr.yld = prod.irr / irr.harvarea, + irr.yld = replace(irr.yld, is.na(irr.yld), 0.0), + rfd.yld = prod.rfd / rfd.harvarea, + rfd.yld = replace(rfd.yld, is.na(rfd.yld), 0.0)) + + + ## Produce outputs. Note that for harvested area, we use the values without + ## interpolation, stored in IrrRfdCropland (as opposed to IrrRfdCropland.interp) + select(IrrRfdCropland, GCAM_region_ID, GCAM_commodity, GCAM_subsector, GLU, year, + value = irr.harvarea) %>% + #........................ + # gcambreakout 17 July 2022 + # Temporary fix until circular dependency on + # L123.LC_bm2_R_MgdFor_Yh_GLU_beforeadjust is fixed. + #........................ + dplyr::mutate(remove = dplyr::if_else(((GLU %in% remove_glu) & (GCAM_region_ID <33)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) %>% + #........................breakout close edit + add_title("Irrigated harvested cropland cover by GCAM region / commodity / year / GLU") %>% + add_units("bm2") %>% + add_comments("Irrigated cropland cover is downscaled from total harvested cropland by GCAM region / commodity / year / GLU.") %>% + add_comments("The share of irrigated cropland in the base year is applied to all historical periods.") %>% + add_legacy_name("L171.LC_bm2_R_irrHarvCropLand_C_Yh_GLU") %>% + add_precursors("L122.LC_bm2_R_HarvCropLand_C_Yh_GLU", + "L161.ag_irrHA_frac_R_C_GLU","common/iso_GCAM_regID","water/basin_to_country_mapping") -> + L171.LC_bm2_R_irrHarvCropLand_C_Yh_GLU + + select(IrrRfdCropland, GCAM_region_ID, GCAM_commodity, GCAM_subsector, GLU, year, + value = rfd.harvarea) %>% + #........................ + # gcambreakout 17 July 2022 + # Temporary fix until circular dependency on + # L123.LC_bm2_R_MgdFor_Yh_GLU_beforeadjust is fixed. + #........................ + dplyr::mutate(remove = dplyr::if_else(((GLU %in% remove_glu) & (GCAM_region_ID <33)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) %>% + #........................breakout close edit + add_title("Rainfed harvested cropland cover by GCAM region / commodity / year / GLU") %>% + add_units("bm2") %>% + add_comments("Rainfed cropland cover is downscaled from total harvested cropland by GCAM region / commodity / year / GLU.") %>% + add_comments("The share of rainfed cropland in the base year is applied to all historical periods.") %>% + add_legacy_name("L171.LC_bm2_R_rfdHarvCropLand_C_Yh_GLU") %>% + add_precursors("L122.LC_bm2_R_HarvCropLand_C_Yh_GLU", + "L161.ag_irrHA_frac_R_C_GLU","common/iso_GCAM_regID","water/basin_to_country_mapping") -> + L171.LC_bm2_R_rfdHarvCropLand_C_Yh_GLU + + select(ecyield.both, GCAM_region_ID, GCAM_commodity, GCAM_subsector, GLU, year, value = + irr.yld) %>% + #........................ + # gcambreakout 17 July 2022 + # Temporary fix until circular dependency on + # L123.LC_bm2_R_MgdFor_Yh_GLU_beforeadjust is fixed. + #........................ + dplyr::mutate(remove = dplyr::if_else(((GLU %in% remove_glu) & (GCAM_region_ID <33)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) %>% + #........................breakout close edit + add_title("Adjusted economic yield for irrigated crops by GCAM region / commodity / year / GLU") %>% + add_units("kg/m2") %>% + add_comments("Adjusted economic yield for irrigated crops are calculated as irrigated crop production devided by irrigated cropland cover.") %>% + add_legacy_name("L171.ag_irrEcYield_kgm2_R_C_Y_GLU") %>% + add_precursors("L161.ag_irrProd_Mt_R_C_Y_GLU","common/iso_GCAM_regID","water/basin_to_country_mapping") -> + L171.ag_irrEcYield_kgm2_R_C_Y_GLU + + select(ecyield.both, GCAM_region_ID, GCAM_commodity, GCAM_subsector, GLU, year, value = + rfd.yld) %>% + #........................ + # gcambreakout 17 July 2022 + # Temporary fix until circular dependency on + # L123.LC_bm2_R_MgdFor_Yh_GLU_beforeadjust is fixed. + #........................ + dplyr::mutate(remove = dplyr::if_else(((GLU %in% remove_glu) & (GCAM_region_ID <33)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) %>% + #........................breakout close edit + add_title("Adjusted economic yield for rainfed crops by GCAM region / commodity / year / GLU") %>% + add_units("kg/m2") %>% + add_comments("Adjusted economic yield for rainfed crops are calculated as rainfed crop production devided by rainfed cropland cover.") %>% + add_legacy_name("L171.ag_rfdEcYield_kgm2_R_C_Y_GLU") %>% + add_precursors("L161.ag_rfdProd_Mt_R_C_Y_GLU","common/iso_GCAM_regID","water/basin_to_country_mapping") -> + L171.ag_rfdEcYield_kgm2_R_C_Y_GLU + + return_data(L171.LC_bm2_R_irrHarvCropLand_C_Yh_GLU, L171.LC_bm2_R_rfdHarvCropLand_C_Yh_GLU, L171.ag_irrEcYield_kgm2_R_C_Y_GLU, L171.ag_rfdEcYield_kgm2_R_C_Y_GLU) + } else { + stop("Unknown command") + } +} + + diff --git a/inst/extras/zchunk_batch_ag_For_Past_bio_base_IRR_MGMT_xml_breakout_gcamv6p0.R b/inst/extras/zchunk_batch_ag_For_Past_bio_base_IRR_MGMT_xml_breakout_gcamv6p0.R new file mode 100644 index 0000000..35d9305 --- /dev/null +++ b/inst/extras/zchunk_batch_ag_For_Past_bio_base_IRR_MGMT_xml_breakout_gcamv6p0.R @@ -0,0 +1,133 @@ +# Copyright 2019 Battelle Memorial Institute; see the LICENSE file. + +#' module_aglu_batch_ag_For_Past_bio_base_IRR_MGMT_xml +#' +#' Construct XML data structure for \code{ag_For_Past_bio_base_IRR_MGMT.xml}. +#' +#' @param command API command to execute +#' @param ... other optional parameters, depending on command +#' @return Depends on \code{command}: either a vector of required inputs, +#' a vector of output names, or (if \code{command} is "MAKE") all +#' the generated outputs: \code{ag_For_Past_bio_base_IRR_MGMT.xml}. The corresponding file in the +#' original data system was \code{batch_ag_For_Past_bio_base_IRR_MGMT.xml.R} (aglu XML). +module_aglu_batch_ag_For_Past_bio_base_IRR_MGMT_xml <- function(command, ...) { + if(command == driver.DECLARE_INPUTS) { + return(c(FILE = "common/iso_GCAM_regID", + FILE = "common/GCAM_region_names", + FILE = "water/basin_to_country_mapping", + "L2012.AgSupplySector", + "L2012.AgSupplySubsector", + "L2012.AgProduction_ag_irr_mgmt", + "L2012.AgProduction_For", + "L2012.AgProduction_Past", + "L2012.AgHAtoCL_irr_mgmt", + "L2012.AgYield_bio_ref", + "L2012.AgTechYr_Past")) + } else if(command == driver.DECLARE_OUTPUTS) { + return(c(XML = "ag_For_Past_bio_base_IRR_MGMT.xml")) + } else if(command == driver.MAKE) { + + all_data <- list(...)[[1]] + + # Load required inputs + L2012.AgSupplySector <- get_data(all_data, "L2012.AgSupplySector") + L2012.AgSupplySubsector <- get_data(all_data, "L2012.AgSupplySubsector") + L2012.AgProduction_ag_irr_mgmt <- get_data(all_data, "L2012.AgProduction_ag_irr_mgmt") + L2012.AgProduction_For <- get_data(all_data, "L2012.AgProduction_For") + L2012.AgProduction_Past <- get_data(all_data, "L2012.AgProduction_Past") + L2012.AgHAtoCL_irr_mgmt <- get_data(all_data, "L2012.AgHAtoCL_irr_mgmt") + L2012.AgYield_bio_ref <- get_data(all_data, "L2012.AgYield_bio_ref") + L2012.AgTechYr_Past <- get_data(all_data, "L2012.AgTechYr_Past") + + #........................ + # gcambreakout 17 July 2022 + # Temporary fix until circular dependency on + # L123.LC_bm2_R_MgdFor_Yh_GLU_beforeadjust is fixed. + #........................ + + iso_GCAM_regID <- get_data(all_data, "common/iso_GCAM_regID") + basin_to_country_mapping <- get_data(all_data, "water/basin_to_country_mapping") + GCAM_region_names <- get_data(all_data, "common/GCAM_region_names") + + # Valid GLU Region combos + glu_gcam <- basin_to_country_mapping %>% + dplyr::select(iso=ISO, GLU=GLU_code, GLU_name) %>% + dplyr::mutate(iso = tolower(iso)) %>% + dplyr::left_join(iso_GCAM_regID, by=c("iso")) %>% + dplyr::select(GLU, GCAM_region_ID, GLU_name) %>% + dplyr::filter(GCAM_region_ID > 32) %>% + unique() %>% + dplyr::left_join(GCAM_region_names); glu_gcam + + remove_glu <- glu_gcam$GLU_name %>% unique(); remove_glu + regions_check <- GCAM_region_names$region[!GCAM_region_names$region %in% glu_gcam$region]; regions_check + + L2012.AgSupplySubsector %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2012.AgSupplySubsector + + L2012.AgProduction_ag_irr_mgmt %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2012.AgProduction_ag_irr_mgmt + + L2012.AgProduction_For %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2012.AgProduction_For + + L2012.AgProduction_Past %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2012.AgProduction_Past + + L2012.AgHAtoCL_irr_mgmt %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2012.AgHAtoCL_irr_mgmt + + L2012.AgYield_bio_ref %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2012.AgYield_bio_ref + + L2012.AgTechYr_Past %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2012.AgTechYr_Past + + #............breakout close edits + + # =================================================== + + # Produce outputs + create_xml("ag_For_Past_bio_base_IRR_MGMT.xml") %>% + add_logit_tables_xml(L2012.AgSupplySector, "AgSupplySector") %>% + add_logit_tables_xml(L2012.AgSupplySubsector, "AgSupplySubsector") %>% + add_xml_data(L2012.AgProduction_ag_irr_mgmt, "AgProduction") %>% + add_xml_data(L2012.AgProduction_For, "AgProduction") %>% + add_xml_data(L2012.AgProduction_Past, "AgProduction") %>% + add_xml_data(L2012.AgHAtoCL_irr_mgmt, "AgHAtoCL") %>% + add_xml_data(L2012.AgYield_bio_ref, "AgYield") %>% + add_xml_data(L2012.AgTechYr_Past, "AgTechYr") %>% + add_precursors("L2012.AgSupplySubsector", "L2012.AgProduction_ag_irr_mgmt", + "L2012.AgProduction_For", "L2012.AgProduction_Past", "L2012.AgHAtoCL_irr_mgmt", + "L2012.AgYield_bio_ref", "L2012.AgSupplySector", "L2012.AgTechYr_Past", + "common/iso_GCAM_regID", + "water/basin_to_country_mapping", + "common/GCAM_region_names") -> + ag_For_Past_bio_base_IRR_MGMT.xml + + return_data(ag_For_Past_bio_base_IRR_MGMT.xml) + } else { + stop("Unknown command") + } +} diff --git a/inst/extras/zchunk_batch_bio_externality_cost_xml_breakout_gcamv6p0.R b/inst/extras/zchunk_batch_bio_externality_cost_xml_breakout_gcamv6p0.R new file mode 100644 index 0000000..3aa135f --- /dev/null +++ b/inst/extras/zchunk_batch_bio_externality_cost_xml_breakout_gcamv6p0.R @@ -0,0 +1,96 @@ +# Copyright 2019 Battelle Memorial Institute; see the LICENSE file. + +#' module_energy_batch_bio_externality_xml +#' +#' Construct XML data structure for \code{bio_externality.xml}. +#' +#' @param command API command to execute +#' @param ... other optional parameters, depending on command +#' @return Depends on \code{command}: either a vector of required inputs, +#' a vector of output names, or (if \code{command} is "MAKE") all +#' the generated outputs: \code{bio_externality.xml}. The corresponding file in the +#' original data system was \code{L270.limits.R} (energy XML). +module_energy_batch_bio_externality_xml <- function(command, ...) { + if(command == driver.DECLARE_INPUTS) { + return(c(FILE = "common/iso_GCAM_regID", + FILE = "common/GCAM_region_names", + FILE = "water/basin_to_country_mapping", + "L270.RenewRsrc", + "L270.RenewRsrcPrice", + "L270.GrdRenewRsrcCurves", + "L270.GrdRenewRsrcMax", + "L270.ResTechShrwt", + "L270.AgCoef_bioext")) + } else if(command == driver.DECLARE_OUTPUTS) { + return(c(XML = "bio_externality.xml")) + } else if(command == driver.MAKE) { + + all_data <- list(...)[[1]] + + # Load required inputs + L270.RenewRsrc <- get_data(all_data, "L270.RenewRsrc") + L270.RenewRsrcPrice <- get_data(all_data, "L270.RenewRsrcPrice") + L270.GrdRenewRsrcCurves <- get_data(all_data, "L270.GrdRenewRsrcCurves") + L270.GrdRenewRsrcMax <- get_data(all_data, "L270.GrdRenewRsrcMax") + L270.ResTechShrwt <- get_data(all_data, "L270.ResTechShrwt") + L270.AgCoef_bioext <- get_data(all_data, "L270.AgCoef_bioext") + + #........................ + # gcambreakout 17 July 2022 + # Temporary fix until circular dependency on + # L123.LC_bm2_R_MgdFor_Yh_GLU_beforeadjust is fixed. + #........................ + + iso_GCAM_regID <- get_data(all_data, "common/iso_GCAM_regID") + basin_to_country_mapping <- get_data(all_data, "water/basin_to_country_mapping") + GCAM_region_names <- get_data(all_data, "common/GCAM_region_names") + + # Valid GLU Region combos + glu_gcam <- basin_to_country_mapping %>% + dplyr::select(iso=ISO, GLU=GLU_code, GLU_name) %>% + dplyr::mutate(iso = tolower(iso)) %>% + dplyr::left_join(iso_GCAM_regID, by=c("iso")) %>% + dplyr::select(GLU, GCAM_region_ID, GLU_name) %>% + dplyr::filter(GCAM_region_ID > 32) %>% + unique() %>% + dplyr::left_join(GCAM_region_names); glu_gcam + + remove_glu <- glu_gcam$GLU_name %>% unique(); remove_glu + regions_check <- GCAM_region_names$region[!GCAM_region_names$region %in% glu_gcam$region]; regions_check + + L270.AgCoef_bioext %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",AgSupplySubsector) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L270.AgCoef_bioext + + #............breakout close edits + + # =================================================== + + # Produce outputs + create_xml("bio_externality.xml") %>% + add_xml_data(L270.RenewRsrc, "RenewRsrc") %>% + add_xml_data(L270.RenewRsrcPrice, "RenewRsrcPrice") %>% + add_xml_data(L270.GrdRenewRsrcCurves, "GrdRenewRsrcCurves") %>% + add_xml_data(L270.GrdRenewRsrcMax, "GrdRenewRsrcMax") %>% + add_node_equiv_xml("resource") %>% + add_node_equiv_xml("subresource") %>% + add_xml_data(L270.ResTechShrwt, "ResTechShrwt") %>% + add_xml_data(L270.AgCoef_bioext, "AgCoef") %>% + add_precursors("L270.RenewRsrc", + "L270.RenewRsrcPrice", + "L270.GrdRenewRsrcCurves", + "L270.GrdRenewRsrcMax", + "L270.ResTechShrwt", + "L270.AgCoef_bioext", + "common/iso_GCAM_regID", + "water/basin_to_country_mapping", + "common/GCAM_region_names") -> + bio_externality.xml + + return_data(bio_externality.xml) + } else { + stop("Unknown command") + } +} diff --git a/inst/extras/zchunk_batch_land_input_4_IRR_MGMT_xml_breakout_gcamv6p0.R b/inst/extras/zchunk_batch_land_input_4_IRR_MGMT_xml_breakout_gcamv6p0.R new file mode 100644 index 0000000..21c0df3 --- /dev/null +++ b/inst/extras/zchunk_batch_land_input_4_IRR_MGMT_xml_breakout_gcamv6p0.R @@ -0,0 +1,98 @@ +# Copyright 2019 Battelle Memorial Institute; see the LICENSE file. + +#' module_aglu_batch_land_input_4_IRR_MGMT_xml +#' +#' Construct XML data structure for \code{land_input_4_IRR_MGMT.xml}. +#' +#' @param command API command to execute +#' @param ... other optional parameters, depending on command +#' @return Depends on \code{command}: either a vector of required inputs, +#' a vector of output names, or (if \code{command} is "MAKE") all +#' the generated outputs: \code{land_input_4_IRR_MGMT.xml}. The corresponding file in the +#' original data system was \code{batch_land_input_4_IRR_MGMT.xml.R} (aglu XML). +module_aglu_batch_land_input_4_IRR_MGMT_xml <- function(command, ...) { + if(command == driver.DECLARE_INPUTS) { + return(c(FILE = "common/iso_GCAM_regID", + FILE = "common/GCAM_region_names", + FILE = "water/basin_to_country_mapping", + "L2242.LN4_Logit", + "L2242.LN4_NodeGhostShare", + "L2242.LN4_NodeIsGhostShareRel")) + } else if(command == driver.DECLARE_OUTPUTS) { + return(c(XML = "land_input_4_IRR_MGMT.xml")) + } else if(command == driver.MAKE) { + + all_data <- list(...)[[1]] + + # Load required inputs + L2242.LN4_Logit <- get_data(all_data, "L2242.LN4_Logit") + L2242.LN4_NodeGhostShare <- get_data(all_data, "L2242.LN4_NodeGhostShare") + L2242.LN4_NodeIsGhostShareRel <- get_data(all_data, "L2242.LN4_NodeIsGhostShareRel") + + #........................ + # gcambreakout 17 July 2022 + # Temporary fix until circular dependency on + # L123.LC_bm2_R_MgdFor_Yh_GLU_beforeadjust is fixed. + #........................ + + iso_GCAM_regID <- get_data(all_data, "common/iso_GCAM_regID") + basin_to_country_mapping <- get_data(all_data, "water/basin_to_country_mapping") + GCAM_region_names <- get_data(all_data, "common/GCAM_region_names") + + # Valid GLU Region combos + glu_gcam <- basin_to_country_mapping %>% + dplyr::select(iso=ISO, GLU=GLU_code, GLU_name) %>% + dplyr::mutate(iso = tolower(iso)) %>% + dplyr::left_join(iso_GCAM_regID, by=c("iso")) %>% + dplyr::select(GLU, GCAM_region_ID, GLU_name) %>% + dplyr::filter(GCAM_region_ID > 32) %>% + unique() %>% + dplyr::left_join(GCAM_region_names); glu_gcam + + remove_glu <- glu_gcam$GLU_name %>% unique(); remove_glu + regions_check <- GCAM_region_names$region[!GCAM_region_names$region %in% glu_gcam$region]; regions_check + + L2242.LN4_Logit %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",LandNode1) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2242.LN4_Logit + + L2242.LN4_NodeGhostShare %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",LandNode1) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2242.LN4_NodeGhostShare + + L2242.LN4_NodeIsGhostShareRel %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",LandNode1) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2242.LN4_NodeIsGhostShareRel + + + #............breakout close edits + + # =================================================== + + + # Produce outputs + create_xml("land_input_4_IRR_MGMT.xml") %>% + add_logit_tables_xml(L2242.LN4_Logit, "LN4_Logit") %>% + add_xml_data(L2242.LN4_NodeGhostShare, "LN4_NodeGhostShare") %>% + add_xml_data(L2242.LN4_NodeIsGhostShareRel, "LN4_NodeIsGhostShareRel") %>% + add_rename_landnode_xml() %>% + add_precursors("L2242.LN4_Logit", + "L2242.LN4_NodeGhostShare", + "L2242.LN4_NodeIsGhostShareRel", + "common/iso_GCAM_regID", + "water/basin_to_country_mapping", + "common/GCAM_region_names") -> + land_input_4_IRR_MGMT.xml + + + return_data(land_input_4_IRR_MGMT.xml) + } else { + stop("Unknown command") + } +} diff --git a/inst/extras/zchunk_batch_land_input_5_IRR_MGMT_xml_breakout_gcamv6p0.R b/inst/extras/zchunk_batch_land_input_5_IRR_MGMT_xml_breakout_gcamv6p0.R new file mode 100644 index 0000000..26273e6 --- /dev/null +++ b/inst/extras/zchunk_batch_land_input_5_IRR_MGMT_xml_breakout_gcamv6p0.R @@ -0,0 +1,155 @@ +# Copyright 2019 Battelle Memorial Institute; see the LICENSE file. + +#' module_aglu_batch_land_input_5_IRR_MGMT_xml +#' +#' Construct XML data structure for \code{land_input_5_IRR_MGMT.xml}. +#' +#' @param command API command to execute +#' @param ... other optional parameters, depending on command +#' @return Depends on \code{command}: either a vector of required inputs, +#' a vector of output names, or (if \code{command} is "MAKE") all +#' the generated outputs: \code{land_input_5_IRR_MGMT.xml}. The corresponding file in the +#' original data system was \code{batch_land_input_5_IRR_MGMT_xml.R} (aglu XML). +module_aglu_batch_land_input_5_IRR_MGMT_xml <- function(command, ...) { + if(command == driver.DECLARE_INPUTS) { + return(c(FILE = "common/iso_GCAM_regID", + FILE = "common/GCAM_region_names", + FILE = "water/basin_to_country_mapping", + "L2252.LN5_Logit", + "L2252.LN5_HistMgdAllocation_crop", + "L2252.LN5_MgdAllocation_crop", + "L2252.LN5_HistMgdAllocation_bio", + "L2252.LN5_MgdAllocation_bio", + "L2252.LN5_MgdCarbon_crop", + "L2252.LN5_MgdCarbon_bio", + "L2252.LN5_LeafGhostShare", + "L2252.LN5_NodeGhostShare")) + } else if(command == driver.DECLARE_OUTPUTS) { + return(c(XML = "land_input_5_IRR_MGMT.xml")) + } else if(command == driver.MAKE) { + + all_data <- list(...)[[1]] + + # Load required inputs + L2252.LN5_Logit <- get_data(all_data, "L2252.LN5_Logit") + L2252.LN5_HistMgdAllocation_crop <- get_data(all_data, "L2252.LN5_HistMgdAllocation_crop") + L2252.LN5_MgdAllocation_crop <- get_data(all_data, "L2252.LN5_MgdAllocation_crop") + L2252.LN5_HistMgdAllocation_bio <- get_data(all_data, "L2252.LN5_HistMgdAllocation_bio") + L2252.LN5_MgdAllocation_bio <- get_data(all_data, "L2252.LN5_MgdAllocation_bio") + L2252.LN5_MgdCarbon_crop <- get_data(all_data, "L2252.LN5_MgdCarbon_crop") + L2252.LN5_MgdCarbon_bio <- get_data(all_data, "L2252.LN5_MgdCarbon_bio") + L2252.LN5_LeafGhostShare <- get_data(all_data, "L2252.LN5_LeafGhostShare") + L2252.LN5_NodeGhostShare <- get_data(all_data, "L2252.LN5_NodeGhostShare") + + #........................ + # gcambreakout 17 July 2022 + # Temporary fix until circular dependency on + # L123.LC_bm2_R_MgdFor_Yh_GLU_beforeadjust is fixed. + #........................ + + iso_GCAM_regID <- get_data(all_data, "common/iso_GCAM_regID") + basin_to_country_mapping <- get_data(all_data, "water/basin_to_country_mapping") + GCAM_region_names <- get_data(all_data, "common/GCAM_region_names") + + # Valid GLU Region combos + glu_gcam <- basin_to_country_mapping %>% + dplyr::select(iso=ISO, GLU=GLU_code, GLU_name) %>% + dplyr::mutate(iso = tolower(iso)) %>% + dplyr::left_join(iso_GCAM_regID, by=c("iso")) %>% + dplyr::select(GLU, GCAM_region_ID, GLU_name) %>% + dplyr::filter(GCAM_region_ID > 32) %>% + unique() %>% + dplyr::left_join(GCAM_region_names); glu_gcam + + remove_glu <- glu_gcam$GLU_name %>% unique(); remove_glu + regions_check <- GCAM_region_names$region[!GCAM_region_names$region %in% glu_gcam$region]; regions_check + + L2252.LN5_Logit %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",LandNode1) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2252.LN5_Logit + + L2252.LN5_HistMgdAllocation_crop %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",LandNode1) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2252.LN5_HistMgdAllocation_crop + + L2252.LN5_MgdAllocation_crop %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",LandNode1) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2252.LN5_MgdAllocation_crop + + L2252.LN5_HistMgdAllocation_bio %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",LandNode1) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2252.LN5_HistMgdAllocation_bio + + L2252.LN5_MgdAllocation_bio %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",LandNode1) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2252.LN5_MgdAllocation_bio + + L2252.LN5_MgdCarbon_crop %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",LandNode1) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2252.LN5_MgdCarbon_crop + + L2252.LN5_MgdCarbon_bio %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",LandNode1) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2252.LN5_MgdCarbon_bio + + L2252.LN5_LeafGhostShare %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",LandNode1) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2252.LN5_LeafGhostShare + + L2252.LN5_NodeGhostShare %>% + dplyr::mutate(remove = dplyr::if_else(((gsub(".*_","",LandNode1) %in% remove_glu) & (region %in% regions_check)),1,0)) %>% + dplyr::filter(remove==0) %>% + dplyr::select(-remove) -> + L2252.LN5_NodeGhostShare + + #............breakout close edits + + # =================================================== + + # Produce outputs + create_xml("land_input_5_IRR_MGMT.xml") %>% + add_logit_tables_xml(L2252.LN5_Logit, "LN5_Logit") %>% + add_xml_data(L2252.LN5_HistMgdAllocation_crop, "LN5_HistMgdAllocation") %>% + add_xml_data(L2252.LN5_MgdAllocation_crop, "LN5_MgdAllocation") %>% + add_xml_data(L2252.LN5_HistMgdAllocation_bio, "LN5_HistMgdAllocation") %>% + add_xml_data(L2252.LN5_MgdAllocation_bio, "LN5_MgdAllocation") %>% + add_xml_data(L2252.LN5_MgdCarbon_crop, "LN5_MgdCarbon") %>% + add_xml_data(L2252.LN5_MgdCarbon_bio, "LN5_MgdCarbon") %>% + add_xml_data(L2252.LN5_LeafGhostShare, "LN5_LeafGhostShare") %>% + add_xml_data(L2252.LN5_NodeGhostShare, "LN5_NodeGhostShare") %>% + add_rename_landnode_xml() %>% + add_precursors("L2252.LN5_Logit", + "L2252.LN5_HistMgdAllocation_crop", + "L2252.LN5_MgdAllocation_crop", + "L2252.LN5_HistMgdAllocation_bio", + "L2252.LN5_MgdAllocation_bio", + "L2252.LN5_MgdCarbon_crop", + "L2252.LN5_MgdCarbon_bio", + "L2252.LN5_LeafGhostShare", + "L2252.LN5_NodeGhostShare", + "common/iso_GCAM_regID", + "water/basin_to_country_mapping", + "common/GCAM_region_names") -> + land_input_5_IRR_MGMT.xml + + return_data(land_input_5_IRR_MGMT.xml) + } else { + stop("Unknown command") + } +} diff --git a/man/template_zchunk_L133.water_demand_livestock_breakout_gcamv60.Rd b/man/template_zchunk_L133.water_demand_livestock_breakout_gcamv60.Rd deleted file mode 100644 index 87f851e..0000000 --- a/man/template_zchunk_L133.water_demand_livestock_breakout_gcamv60.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{template_zchunk_L133.water_demand_livestock_breakout_gcamv60} -\alias{template_zchunk_L133.water_demand_livestock_breakout_gcamv60} -\title{Template for template_zchunk_L133.water_demand_livestock_breakout_gcamv60} -\format{ -R script -} -\source{ -created by BY -} -\usage{ -template_zchunk_L133.water_demand_livestock_breakout_gcamv60 -} -\description{ -Template for template_zchunk_L133.water_demand_livestock_breakout_gcamv60 -} -\examples{ -\dontrun{ - library(gcambreakout); - gcambreakout::template_zchunk_L133.water_demand_livestock_breakout_gcamv60 -} -} -\keyword{datasets} diff --git a/man/template_zchunk_L171.desalination_breakout_gcamv60.Rd b/man/template_zchunk_L171.desalination_breakout_gcamv60.Rd deleted file mode 100644 index b4fe913..0000000 --- a/man/template_zchunk_L171.desalination_breakout_gcamv60.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{template_zchunk_L171.desalination_breakout_gcamv60} -\alias{template_zchunk_L171.desalination_breakout_gcamv60} -\title{Template for template_zchunk_L171.desalination_breakout_gcamv60} -\format{ -R script -} -\source{ -created by BY -} -\usage{ -template_zchunk_L171.desalination_breakout_gcamv60 -} -\description{ -Template for template_zchunk_L171.desalination_breakout_gcamv60 -} -\examples{ -\dontrun{ - library(gcambreakout); - gcambreakout::template_zchunk_L171.desalination_breakout_gcamv60 -} -} -\keyword{datasets} diff --git a/man/template_zchunk_L203.water_td_breakout_gcamv60.Rd b/man/template_zchunk_L203.water_td_breakout_gcamv60.Rd deleted file mode 100644 index b8f331f..0000000 --- a/man/template_zchunk_L203.water_td_breakout_gcamv60.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{template_zchunk_L203.water_td_breakout_gcamv60} -\alias{template_zchunk_L203.water_td_breakout_gcamv60} -\title{Template for template_zchunk_L203.water_td_breakout_gcamv60} -\format{ -R script -} -\source{ -created by BY -} -\usage{ -template_zchunk_L203.water_td_breakout_gcamv60 -} -\description{ -Template for template_zchunk_L203.water_td_breakout_gcamv60 -} -\examples{ -\dontrun{ - library(gcambreakout); - gcambreakout::template_zchunk_L203.water_td_breakout_gcamv60 -} -} -\keyword{datasets} diff --git a/man/template_zchunk_L2042.resbio_input_irr_mgmt_breakout_gcamv6p0.Rd b/man/template_zchunk_L2042.resbio_input_irr_mgmt_breakout_gcamv6p0.Rd new file mode 100644 index 0000000..10aa185 --- /dev/null +++ b/man/template_zchunk_L2042.resbio_input_irr_mgmt_breakout_gcamv6p0.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{template_zchunk_L2042.resbio_input_irr_mgmt_breakout_gcamv6p0} +\alias{template_zchunk_L2042.resbio_input_irr_mgmt_breakout_gcamv6p0} +\title{Template for template_zchunk_L2042.resbio_input_irr_mgmt_breakout_gcamv6p0} +\format{ +R script +} +\source{ +created by ZK +} +\usage{ +template_zchunk_L2042.resbio_input_irr_mgmt_breakout_gcamv6p0 +} +\description{ +Template for template_zchunk_L2042.resbio_input_irr_mgmt_breakout_gcamv6p0 +} +\examples{ +\dontrun{ + library(gcambreakout); + gcambreakout::template_zchunk_L2042.resbio_input_irr_mgmt_breakout_gcamv6p0 +} +} +\keyword{datasets} diff --git a/man/template_zchunk_L2052.ag_prodchange_cost_irr_mgmt_breakout_gcamv6p0.Rd b/man/template_zchunk_L2052.ag_prodchange_cost_irr_mgmt_breakout_gcamv6p0.Rd new file mode 100644 index 0000000..38a9bd7 --- /dev/null +++ b/man/template_zchunk_L2052.ag_prodchange_cost_irr_mgmt_breakout_gcamv6p0.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{template_zchunk_L2052.ag_prodchange_cost_irr_mgmt_breakout_gcamv6p0} +\alias{template_zchunk_L2052.ag_prodchange_cost_irr_mgmt_breakout_gcamv6p0} +\title{Template for template_zchunk_L2052.ag_prodchange_cost_irr_mgmt_breakout_gcamv6p0} +\format{ +R script +} +\source{ +created by ZK +} +\usage{ +template_zchunk_L2052.ag_prodchange_cost_irr_mgmt_breakout_gcamv6p0 +} +\description{ +Template for template_zchunk_L2052.ag_prodchange_cost_irr_mgmt_breakout_gcamv6p0 +} +\examples{ +\dontrun{ + library(gcambreakout); + gcambreakout::template_zchunk_L2052.ag_prodchange_cost_irr_mgmt_breakout_gcamv6p0 +} +} +\keyword{datasets} diff --git a/man/template_zchunk_L2062.ag_Fert_irr_mgmt_breakout_gcamv6p0.Rd b/man/template_zchunk_L2062.ag_Fert_irr_mgmt_breakout_gcamv6p0.Rd new file mode 100644 index 0000000..a0eaffe --- /dev/null +++ b/man/template_zchunk_L2062.ag_Fert_irr_mgmt_breakout_gcamv6p0.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{template_zchunk_L2062.ag_Fert_irr_mgmt_breakout_gcamv6p0} +\alias{template_zchunk_L2062.ag_Fert_irr_mgmt_breakout_gcamv6p0} +\title{Template for template_zchunk_L2062.ag_Fert_irr_mgmt_breakout_gcamv6p0} +\format{ +R script +} +\source{ +created by ZK +} +\usage{ +template_zchunk_L2062.ag_Fert_irr_mgmt_breakout_gcamv6p0 +} +\description{ +Template for template_zchunk_L2062.ag_Fert_irr_mgmt_breakout_gcamv6p0 +} +\examples{ +\dontrun{ + library(gcambreakout); + gcambreakout::template_zchunk_L2062.ag_Fert_irr_mgmt_breakout_gcamv6p0 +} +} +\keyword{datasets} diff --git a/man/template_zchunk_L2072.ag_water_irr_mgmt_breakout_gcamv6p0.Rd b/man/template_zchunk_L2072.ag_water_irr_mgmt_breakout_gcamv6p0.Rd new file mode 100644 index 0000000..fa136a0 --- /dev/null +++ b/man/template_zchunk_L2072.ag_water_irr_mgmt_breakout_gcamv6p0.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{template_zchunk_L2072.ag_water_irr_mgmt_breakout_gcamv6p0} +\alias{template_zchunk_L2072.ag_water_irr_mgmt_breakout_gcamv6p0} +\title{Template for template_zchunk_L2072.ag_water_irr_mgmt_breakout_gcamv6p0} +\format{ +R script +} +\source{ +created by ZK +} +\usage{ +template_zchunk_L2072.ag_water_irr_mgmt_breakout_gcamv6p0 +} +\description{ +Template for template_zchunk_L2072.ag_water_irr_mgmt_breakout_gcamv6p0 +} +\examples{ +\dontrun{ + library(gcambreakout); + gcambreakout::template_zchunk_L2072.ag_water_irr_mgmt_breakout_gcamv6p0 +} +} +\keyword{datasets} diff --git a/man/template_zchunk_L2112.ag_nonco2_IRR_MGMT_breakout_gcamv6p0.Rd b/man/template_zchunk_L2112.ag_nonco2_IRR_MGMT_breakout_gcamv6p0.Rd new file mode 100644 index 0000000..54c104a --- /dev/null +++ b/man/template_zchunk_L2112.ag_nonco2_IRR_MGMT_breakout_gcamv6p0.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{template_zchunk_L2112.ag_nonco2_IRR_MGMT_breakout_gcamv6p0} +\alias{template_zchunk_L2112.ag_nonco2_IRR_MGMT_breakout_gcamv6p0} +\title{Template for template_zchunk_L2112.ag_nonco2_IRR_MGMT_breakout_gcamv6p0} +\format{ +R script +} +\source{ +created by ZK +} +\usage{ +template_zchunk_L2112.ag_nonco2_IRR_MGMT_breakout_gcamv6p0 +} +\description{ +Template for template_zchunk_L2112.ag_nonco2_IRR_MGMT_breakout_gcamv6p0 +} +\examples{ +\dontrun{ + library(gcambreakout); + gcambreakout::template_zchunk_L2112.ag_nonco2_IRR_MGMT_breakout_gcamv6p0 +} +} +\keyword{datasets} diff --git a/man/template_zchunk_L223.electricity_breakout_gcamv60.Rd b/man/template_zchunk_L223.electricity_breakout_gcamv60.Rd deleted file mode 100644 index bb45145..0000000 --- a/man/template_zchunk_L223.electricity_breakout_gcamv60.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{template_zchunk_L223.electricity_breakout_gcamv60} -\alias{template_zchunk_L223.electricity_breakout_gcamv60} -\title{Template for template_zchunk_L223.electricity_breakout_gcamv60} -\format{ -R script -} -\source{ -created by BY -} -\usage{ -template_zchunk_L223.electricity_breakout_gcamv60 -} -\description{ -Template for template_zchunk_L223.electricity_breakout_gcamv60 -} -\examples{ -\dontrun{ - library(gcambreakout); - gcambreakout::template_zchunk_L223.electricity_breakout_gcamv60 -} -} -\keyword{datasets} diff --git a/man/template_zchunk_L2231.wind_update_breakout_gcamv60.Rd b/man/template_zchunk_L2231.wind_update_breakout_gcamv60.Rd deleted file mode 100644 index 5e84893..0000000 --- a/man/template_zchunk_L2231.wind_update_breakout_gcamv60.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{template_zchunk_L2231.wind_update_breakout_gcamv60} -\alias{template_zchunk_L2231.wind_update_breakout_gcamv60} -\title{Template for template_zchunk_L2231.wind_update_breakout_gcamv60} -\format{ -R script -} -\source{ -created by BY -} -\usage{ -template_zchunk_L2231.wind_update_breakout_gcamv60 -} -\description{ -Template for template_zchunk_L2231.wind_update_breakout_gcamv60 -} -\examples{ -\dontrun{ - library(gcambreakout); - gcambreakout::template_zchunk_L2231.wind_update_breakout_gcamv60 -} -} -\keyword{datasets} diff --git a/man/template_zchunk_L2231.wind_update_breakout_gcamv6p0.Rd b/man/template_zchunk_L2231.wind_update_breakout_gcamv6p0.Rd new file mode 100644 index 0000000..08f9799 --- /dev/null +++ b/man/template_zchunk_L2231.wind_update_breakout_gcamv6p0.Rd @@ -0,0 +1,37 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{template_zchunk_L2231.wind_update_breakout_gcamv6p0} +\alias{template_zchunk_L2231.wind_update_breakout_gcamv6p0} +\title{Template for template_zchunk_L2231.wind_update_breakout_gcamv6p0} +\format{ +R script + +R script +} +\source{ +created by ZK + +created by ZK +} +\usage{ +template_zchunk_L2231.wind_update_breakout_gcamv6p0 + +template_zchunk_L2231.wind_update_breakout_gcamv6p0 +} +\description{ +Template for template_zchunk_L2231.wind_update_breakout_gcamv6p0 + +Template for template_zchunk_L2231.wind_update_breakout_gcamv6p0 +} +\examples{ +\dontrun{ + library(gcambreakout); + gcambreakout::template_zchunk_L2231.wind_update_breakout_gcamv6p0 +} +\dontrun{ + library(gcambreakout); + gcambreakout::template_zchunk_L2231.wind_update_breakout_gcamv6p0 +} +} +\keyword{datasets} diff --git a/man/template_zchunk_L242.ssp34_pasture_breakout_gcamv6p0.Rd b/man/template_zchunk_L242.ssp34_pasture_breakout_gcamv6p0.Rd new file mode 100644 index 0000000..ff5dc18 --- /dev/null +++ b/man/template_zchunk_L242.ssp34_pasture_breakout_gcamv6p0.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{template_zchunk_L242.ssp34_pasture_breakout_gcamv6p0} +\alias{template_zchunk_L242.ssp34_pasture_breakout_gcamv6p0} +\title{Template for template_zchunk_L242.ssp34_pasture_breakout_gcamv6p0} +\format{ +R script +} +\source{ +created by ZK +} +\usage{ +template_zchunk_L242.ssp34_pasture_breakout_gcamv6p0 +} +\description{ +Template for template_zchunk_L242.ssp34_pasture_breakout_gcamv6p0 +} +\examples{ +\dontrun{ + library(gcambreakout); + gcambreakout::template_zchunk_L242.ssp34_pasture_breakout_gcamv6p0 +} +} +\keyword{datasets} diff --git a/man/template_zchunk_L252.MACC_breakout_gcamv6p0.Rd b/man/template_zchunk_L252.MACC_breakout_gcamv6p0.Rd new file mode 100644 index 0000000..ae6a638 --- /dev/null +++ b/man/template_zchunk_L252.MACC_breakout_gcamv6p0.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{template_zchunk_L252.MACC_breakout_gcamv6p0} +\alias{template_zchunk_L252.MACC_breakout_gcamv6p0} +\title{Template for template_zchunk_L252.MACC_breakout_gcamv6p0} +\format{ +R script +} +\source{ +created by ZK +} +\usage{ +template_zchunk_L252.MACC_breakout_gcamv6p0 +} +\description{ +Template for template_zchunk_L252.MACC_breakout_gcamv6p0 +} +\examples{ +\dontrun{ + library(gcambreakout); + gcambreakout::template_zchunk_L252.MACC_breakout_gcamv6p0 +} +} +\keyword{datasets} diff --git a/man/template_zchunk_LA100.0_LDS_preprocessing_breakout_gcamv60.Rd b/man/template_zchunk_LA100.0_LDS_preprocessing_breakout_gcamv60.Rd deleted file mode 100644 index f66ee08..0000000 --- a/man/template_zchunk_LA100.0_LDS_preprocessing_breakout_gcamv60.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{template_zchunk_LA100.0_LDS_preprocessing_breakout_gcamv60} -\alias{template_zchunk_LA100.0_LDS_preprocessing_breakout_gcamv60} -\title{Template for template_zchunk_LA100.0_LDS_preprocessing_breakout_gcamv60} -\format{ -R script -} -\source{ -created by BY -} -\usage{ -template_zchunk_LA100.0_LDS_preprocessing_breakout_gcamv60 -} -\description{ -Template for template_zchunk_LA100.0_LDS_preprocessing_breakout_gcamv60 -} -\examples{ -\dontrun{ - library(gcambreakout); - gcambreakout::template_zchunk_LA100.0_LDS_preprocessing_breakout_gcamv60 -} -} -\keyword{datasets} diff --git a/man/template_zchunk_LA100.IEA_downscale_ctry_breakout_gcamv60.Rd b/man/template_zchunk_LA100.IEA_downscale_ctry_breakout_gcamv60.Rd deleted file mode 100644 index c17bba6..0000000 --- a/man/template_zchunk_LA100.IEA_downscale_ctry_breakout_gcamv60.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{template_zchunk_LA100.IEA_downscale_ctry_breakout_gcamv60} -\alias{template_zchunk_LA100.IEA_downscale_ctry_breakout_gcamv60} -\title{Template for template_zchunk_LA100.IEA_downscale_ctry_breakout_gcamv60} -\format{ -R script -} -\source{ -created by BY -} -\usage{ -template_zchunk_LA100.IEA_downscale_ctry_breakout_gcamv60 -} -\description{ -Template for template_zchunk_LA100.IEA_downscale_ctry_breakout_gcamv60 -} -\examples{ -\dontrun{ - library(gcambreakout); - gcambreakout::template_zchunk_LA100.IEA_downscale_ctry_breakout_gcamv60 -} -} -\keyword{datasets} diff --git a/man/template_zchunk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0.Rd b/man/template_zchunk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0.Rd new file mode 100644 index 0000000..581f24a --- /dev/null +++ b/man/template_zchunk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{template_zchunk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0} +\alias{template_zchunk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0} +\title{Template for template_zchunk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0} +\format{ +R script +} +\source{ +created by ZK +} +\usage{ +template_zchunk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0 +} +\description{ +Template for template_zchunk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0 +} +\examples{ +\dontrun{ + library(gcambreakout); + gcambreakout::template_zchunk_LA101.ag_FAO_R_C_Y_breakout_gcamv6p0 +} +} +\keyword{datasets} diff --git a/man/template_zchunk_LA1012.en_bal_EFW_breakout_gcamv60.Rd b/man/template_zchunk_LA1012.en_bal_EFW_breakout_gcamv60.Rd deleted file mode 100644 index 94604d7..0000000 --- a/man/template_zchunk_LA1012.en_bal_EFW_breakout_gcamv60.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{template_zchunk_LA1012.en_bal_EFW_breakout_gcamv60} -\alias{template_zchunk_LA1012.en_bal_EFW_breakout_gcamv60} -\title{Template for template_zchunk_LA1012.en_bal_EFW_breakout_gcamv60} -\format{ -R script -} -\source{ -created by BY -} -\usage{ -template_zchunk_LA1012.en_bal_EFW_breakout_gcamv60 -} -\description{ -Template for template_zchunk_LA1012.en_bal_EFW_breakout_gcamv60 -} -\examples{ -\dontrun{ - library(gcambreakout); - gcambreakout::template_zchunk_LA1012.en_bal_EFW_breakout_gcamv60 -} -} -\keyword{datasets} diff --git a/man/template_zchunk_LA111.rsrc_fos_Prod_breakout_gcamv60.Rd b/man/template_zchunk_LA111.rsrc_fos_Prod_breakout_gcamv60.Rd deleted file mode 100644 index 97e44b2..0000000 --- a/man/template_zchunk_LA111.rsrc_fos_Prod_breakout_gcamv60.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{template_zchunk_LA111.rsrc_fos_Prod_breakout_gcamv60} -\alias{template_zchunk_LA111.rsrc_fos_Prod_breakout_gcamv60} -\title{Template for template_zchunk_LA111.rsrc_fos_Prod_breakout_gcamv60} -\format{ -R script -} -\source{ -created by BY -} -\usage{ -template_zchunk_LA111.rsrc_fos_Prod_breakout_gcamv60 -} -\description{ -Template for template_zchunk_LA111.rsrc_fos_Prod_breakout_gcamv60 -} -\examples{ -\dontrun{ - library(gcambreakout); - gcambreakout::template_zchunk_LA111.rsrc_fos_Prod_breakout_gcamv60 -} -} -\keyword{datasets} diff --git a/man/template_zchunk_LA120.offshore_wind_breakout_gcamv60.Rd b/man/template_zchunk_LA120.offshore_wind_breakout_gcamv60.Rd deleted file mode 100644 index df3742c..0000000 --- a/man/template_zchunk_LA120.offshore_wind_breakout_gcamv60.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{template_zchunk_LA120.offshore_wind_breakout_gcamv60} -\alias{template_zchunk_LA120.offshore_wind_breakout_gcamv60} -\title{Template for template_zchunk_LA120.offshore_wind_breakout_gcamv60} -\format{ -R script -} -\source{ -created by BY -} -\usage{ -template_zchunk_LA120.offshore_wind_breakout_gcamv60 -} -\description{ -Template for template_zchunk_LA120.offshore_wind_breakout_gcamv60 -} -\examples{ -\dontrun{ - library(gcambreakout); - gcambreakout::template_zchunk_LA120.offshore_wind_breakout_gcamv60 -} -} -\keyword{datasets} diff --git a/man/template_zchunk_LA1321.cement_breakout_gcamv60.Rd b/man/template_zchunk_LA1321.cement_breakout_gcamv60.Rd deleted file mode 100644 index 363bfef..0000000 --- a/man/template_zchunk_LA1321.cement_breakout_gcamv60.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{template_zchunk_LA1321.cement_breakout_gcamv60} -\alias{template_zchunk_LA1321.cement_breakout_gcamv60} -\title{Template for template_zchunk_LA1321.cement_breakout_gcamv60} -\format{ -R script -} -\source{ -created by BY -} -\usage{ -template_zchunk_LA1321.cement_breakout_gcamv60 -} -\description{ -Template for template_zchunk_LA1321.cement_breakout_gcamv60 -} -\examples{ -\dontrun{ - library(gcambreakout); - gcambreakout::template_zchunk_LA1321.cement_breakout_gcamv60 -} -} -\keyword{datasets} diff --git a/man/template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv60.Rd b/man/template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0.Rd similarity index 57% rename from man/template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv60.Rd rename to man/template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0.Rd index 48fb878..bdf4894 100644 --- a/man/template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv60.Rd +++ b/man/template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0.Rd @@ -1,25 +1,37 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} -\name{template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv60} -\alias{template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv60} -\title{Template for template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv60} +\name{template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0} +\alias{template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0} +\title{Template for template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0} \format{ +R script + R script } \source{ -created by BY +created by ZK + +created by ZK } \usage{ -template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv60 +template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0 + +template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0 } \description{ -Template for template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv60 +Template for template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0 + +Template for template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0 } \examples{ \dontrun{ library(gcambreakout); - gcambreakout::template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv60 + gcambreakout::template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0 +} +\dontrun{ + library(gcambreakout); + gcambreakout::template_zchunk_LB120.LC_GIS_R_LTgis_Yh_GLU_breakout_gcamv6p0 } } \keyword{datasets} diff --git a/man/template_zchunk_LB122.LC_R_Cropland_Yh_GLU_breakout_gcamv6p0.Rd b/man/template_zchunk_LB122.LC_R_Cropland_Yh_GLU_breakout_gcamv6p0.Rd new file mode 100644 index 0000000..e3bca4c --- /dev/null +++ b/man/template_zchunk_LB122.LC_R_Cropland_Yh_GLU_breakout_gcamv6p0.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{template_zchunk_LB122.LC_R_Cropland_Yh_GLU_breakout_gcamv6p0} +\alias{template_zchunk_LB122.LC_R_Cropland_Yh_GLU_breakout_gcamv6p0} +\title{Template for template_zchunk_LB122.LC_R_Cropland_Yh_GLU_breakout_gcamv6p0} +\format{ +R script +} +\source{ +created by ZK +} +\usage{ +template_zchunk_LB122.LC_R_Cropland_Yh_GLU_breakout_gcamv6p0 +} +\description{ +Template for template_zchunk_LB122.LC_R_Cropland_Yh_GLU_breakout_gcamv6p0 +} +\examples{ +\dontrun{ + library(gcambreakout); + gcambreakout::template_zchunk_LB122.LC_R_Cropland_Yh_GLU_breakout_gcamv6p0 +} +} +\keyword{datasets} diff --git a/man/template_zchunk_LB123.LC_R_MgdPastFor_Yh_GLU_breakout_gcamv60.Rd b/man/template_zchunk_LB123.LC_R_MgdPastFor_Yh_GLU_breakout_gcamv60.Rd deleted file mode 100644 index ea2cd44..0000000 --- a/man/template_zchunk_LB123.LC_R_MgdPastFor_Yh_GLU_breakout_gcamv60.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{template_zchunk_LB123.LC_R_MgdPastFor_Yh_GLU_breakout_gcamv60} -\alias{template_zchunk_LB123.LC_R_MgdPastFor_Yh_GLU_breakout_gcamv60} -\title{Template for template_zchunk_LB123.LC_R_MgdPastFor_Yh_GLU_breakout_gcamv60} -\format{ -R script -} -\source{ -created by BY -} -\usage{ -template_zchunk_LB123.LC_R_MgdPastFor_Yh_GLU_breakout_gcamv60 -} -\description{ -Template for template_zchunk_LB123.LC_R_MgdPastFor_Yh_GLU_breakout_gcamv60 -} -\examples{ -\dontrun{ - library(gcambreakout); - gcambreakout::template_zchunk_LB123.LC_R_MgdPastFor_Yh_GLU_breakout_gcamv60 -} -} -\keyword{datasets} diff --git a/man/template_zchunk_LB1321.regional_ag_prices_breakout_gcamv60.Rd b/man/template_zchunk_LB1321.regional_ag_prices_breakout_gcamv60.Rd deleted file mode 100644 index b8e6073..0000000 --- a/man/template_zchunk_LB1321.regional_ag_prices_breakout_gcamv60.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{template_zchunk_LB1321.regional_ag_prices_breakout_gcamv60} -\alias{template_zchunk_LB1321.regional_ag_prices_breakout_gcamv60} -\title{Template for template_zchunk_LB1321.regional_ag_prices_breakout_gcamv60} -\format{ -R script -} -\source{ -created by BY -} -\usage{ -template_zchunk_LB1321.regional_ag_prices_breakout_gcamv60 -} -\description{ -Template for template_zchunk_LB1321.regional_ag_prices_breakout_gcamv60 -} -\examples{ -\dontrun{ - library(gcambreakout); - gcambreakout::template_zchunk_LB1321.regional_ag_prices_breakout_gcamv60 -} -} -\keyword{datasets} diff --git a/man/template_zchunk_LB142.ag_Fert_IO_R_C_Y_GLU_breakout_gcamv60.Rd b/man/template_zchunk_LB142.ag_Fert_IO_R_C_Y_GLU_breakout_gcamv60.Rd deleted file mode 100644 index e4d990d..0000000 --- a/man/template_zchunk_LB142.ag_Fert_IO_R_C_Y_GLU_breakout_gcamv60.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{template_zchunk_LB142.ag_Fert_IO_R_C_Y_GLU_breakout_gcamv60} -\alias{template_zchunk_LB142.ag_Fert_IO_R_C_Y_GLU_breakout_gcamv60} -\title{Template for template_zchunk_LB142.ag_Fert_IO_R_C_Y_GLU_breakout_gcamv60} -\format{ -R script -} -\source{ -created by BY -} -\usage{ -template_zchunk_LB142.ag_Fert_IO_R_C_Y_GLU_breakout_gcamv60 -} -\description{ -Template for template_zchunk_LB142.ag_Fert_IO_R_C_Y_GLU_breakout_gcamv60 -} -\examples{ -\dontrun{ - library(gcambreakout); - gcambreakout::template_zchunk_LB142.ag_Fert_IO_R_C_Y_GLU_breakout_gcamv60 -} -} -\keyword{datasets} diff --git a/man/template_zchunk_LB171.LC_R_Cropland_Yh_GLU_irr_breakout_gcamv6p0.Rd b/man/template_zchunk_LB171.LC_R_Cropland_Yh_GLU_irr_breakout_gcamv6p0.Rd new file mode 100644 index 0000000..b20b035 --- /dev/null +++ b/man/template_zchunk_LB171.LC_R_Cropland_Yh_GLU_irr_breakout_gcamv6p0.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{template_zchunk_LB171.LC_R_Cropland_Yh_GLU_irr_breakout_gcamv6p0} +\alias{template_zchunk_LB171.LC_R_Cropland_Yh_GLU_irr_breakout_gcamv6p0} +\title{Template for template_zchunk_LB171.LC_R_Cropland_Yh_GLU_irr_breakout_gcamv6p0} +\format{ +R script +} +\source{ +created by ZK +} +\usage{ +template_zchunk_LB171.LC_R_Cropland_Yh_GLU_irr_breakout_gcamv6p0 +} +\description{ +Template for template_zchunk_LB171.LC_R_Cropland_Yh_GLU_irr_breakout_gcamv6p0 +} +\examples{ +\dontrun{ + library(gcambreakout); + gcambreakout::template_zchunk_LB171.LC_R_Cropland_Yh_GLU_irr_breakout_gcamv6p0 +} +} +\keyword{datasets} diff --git a/man/template_zchunk_batch_ag_For_Past_bio_base_IRR_MGMT_xml_breakout_gcamv6p0.Rd b/man/template_zchunk_batch_ag_For_Past_bio_base_IRR_MGMT_xml_breakout_gcamv6p0.Rd new file mode 100644 index 0000000..010d07f --- /dev/null +++ b/man/template_zchunk_batch_ag_For_Past_bio_base_IRR_MGMT_xml_breakout_gcamv6p0.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{template_zchunk_batch_ag_For_Past_bio_base_IRR_MGMT_xml_breakout_gcamv6p0} +\alias{template_zchunk_batch_ag_For_Past_bio_base_IRR_MGMT_xml_breakout_gcamv6p0} +\title{Template for template_zchunk_batch_ag_For_Past_bio_base_IRR_MGMT_xml_breakout_gcamv6p0} +\format{ +R script +} +\source{ +created by ZK +} +\usage{ +template_zchunk_batch_ag_For_Past_bio_base_IRR_MGMT_xml_breakout_gcamv6p0 +} +\description{ +Template for template_zchunk_batch_ag_For_Past_bio_base_IRR_MGMT_xml_breakout_gcamv6p0 +} +\examples{ +\dontrun{ + library(gcambreakout); + gcambreakout::template_zchunk_batch_ag_For_Past_bio_base_IRR_MGMT_xml_breakout_gcamv6p0 +} +} +\keyword{datasets} diff --git a/man/template_zchunk_batch_bio_externality_cost_xml_breakout_gcamv6p0.Rd b/man/template_zchunk_batch_bio_externality_cost_xml_breakout_gcamv6p0.Rd new file mode 100644 index 0000000..7135e22 --- /dev/null +++ b/man/template_zchunk_batch_bio_externality_cost_xml_breakout_gcamv6p0.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{template_zchunk_batch_bio_externality_cost_xml_breakout_gcamv6p0} +\alias{template_zchunk_batch_bio_externality_cost_xml_breakout_gcamv6p0} +\title{Template for template_zchunk_batch_bio_externality_cost_xml_breakout_gcamv6p0} +\format{ +R script +} +\source{ +created by ZK +} +\usage{ +template_zchunk_batch_bio_externality_cost_xml_breakout_gcamv6p0 +} +\description{ +Template for template_zchunk_batch_bio_externality_cost_xml_breakout_gcamv6p0 +} +\examples{ +\dontrun{ + library(gcambreakout); + gcambreakout::template_zchunk_batch_bio_externality_cost_xml_breakout_gcamv6p0 +} +} +\keyword{datasets} diff --git a/man/template_zchunk_batch_land_input_4_IRR_MGMT_xml_breakout_gcamv6p0.Rd b/man/template_zchunk_batch_land_input_4_IRR_MGMT_xml_breakout_gcamv6p0.Rd new file mode 100644 index 0000000..0cadf9d --- /dev/null +++ b/man/template_zchunk_batch_land_input_4_IRR_MGMT_xml_breakout_gcamv6p0.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{template_zchunk_batch_land_input_4_IRR_MGMT_xml_breakout_gcamv6p0} +\alias{template_zchunk_batch_land_input_4_IRR_MGMT_xml_breakout_gcamv6p0} +\title{Template for template_zchunk_batch_land_input_4_IRR_MGMT_xml_breakout_gcamv6p0} +\format{ +R script +} +\source{ +created by ZK +} +\usage{ +template_zchunk_batch_land_input_4_IRR_MGMT_xml_breakout_gcamv6p0 +} +\description{ +Template for template_zchunk_batch_land_input_4_IRR_MGMT_xml_breakout_gcamv6p0 +} +\examples{ +\dontrun{ + library(gcambreakout); + gcambreakout::template_zchunk_batch_land_input_4_IRR_MGMT_xml_breakout_gcamv6p0 +} +} +\keyword{datasets} diff --git a/man/template_zchunk_batch_land_input_5_IRR_MGMT_xml_breakout_gcamv6p0.Rd b/man/template_zchunk_batch_land_input_5_IRR_MGMT_xml_breakout_gcamv6p0.Rd new file mode 100644 index 0000000..ca1d05c --- /dev/null +++ b/man/template_zchunk_batch_land_input_5_IRR_MGMT_xml_breakout_gcamv6p0.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{template_zchunk_batch_land_input_5_IRR_MGMT_xml_breakout_gcamv6p0} +\alias{template_zchunk_batch_land_input_5_IRR_MGMT_xml_breakout_gcamv6p0} +\title{Template for template_zchunk_batch_land_input_5_IRR_MGMT_xml_breakout_gcamv6p0} +\format{ +R script +} +\source{ +created by ZK +} +\usage{ +template_zchunk_batch_land_input_5_IRR_MGMT_xml_breakout_gcamv6p0 +} +\description{ +Template for template_zchunk_batch_land_input_5_IRR_MGMT_xml_breakout_gcamv6p0 +} +\examples{ +\dontrun{ + library(gcambreakout); + gcambreakout::template_zchunk_batch_land_input_5_IRR_MGMT_xml_breakout_gcamv6p0 +} +} +\keyword{datasets}