Skip to content

Commit

Permalink
Updating package to work with gcam6p0. Working for Thailand, Malaysia…
Browse files Browse the repository at this point in the history
… and Chile. Errors with Nigeria, Australia.
  • Loading branch information
Zarrar Khan committed Jul 22, 2022
1 parent c0ebd0e commit af4be5e
Show file tree
Hide file tree
Showing 70 changed files with 5,486 additions and 475 deletions.
151 changes: 91 additions & 60 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"


#-----------------
Expand Down
6 changes: 5 additions & 1 deletion R/restore.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
Binary file modified data/mapping_modules.rda
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified data/template_zchunk_L2231.wind_update_breakout_gcamv60.rda
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit af4be5e

Please sign in to comment.