Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

45_carbonprice: added flexibility for starting point of linear curve to diffLin2Lin #1776

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

laurinks
Copy link
Contributor

@laurinks laurinks commented Aug 8, 2024

Purpose of this PR

  1. Introduction of cm_co2_tax_hist and cm_year_co2_tax_hist to enable flexible start point of linear CO2 price trajectory in diffLin2Lin of 45_carbonprice. By default, cm_year_co2_tax_hist is the last time period before cm_startyear (e.g. 2020 if start year is 2025) and cm_co2_tax_hist is level of CO2 tax (defined as maximum of pm_taxCO2eq over all regions) from path_gdx_ref in cm_year_co2_tax_hist (e.g. 25$ in 2020).
  2. Improve structure and documentation of realizations diffLin2Lin and diffExp2Lin
  3. Add option to use diffLin2Lin and diffExp2Lin with cm_iterative_target_adj = 0 in order to easily create exogenous CO2 price trajectories using the switches cm_co2_tax_startyear and cm_peakBudgYr

Type of change

  • New feature
  • Refactoring

Checklist:

  • My code follows the coding etiquette
  • I performed a self-review of my own code
  • I explained my changes within the PR, particularly in hard-to-understand areas
  • I checked that the in-code documentation is up-to-date
  • I adjusted the reporting in remind2 where it was needed
  • I adjusted forbiddenColumnNames in readCheckScenarioConfig.R in case the PR leads to deprecated switches
  • All automated model tests pass (FAIL 0 in the output of make test)
  • The changelog CHANGELOG.md has been updated correctly

Further information:

  • Test runs are here: /p/tmp/laurinko/hpc/remind/output (all folders created on 08/08/2024). Information on convergence:
    image
    The execution errors for SSP2-PkBudg500 runs with start year 2030 are a consequence of the shifted start year (compared to 2025 in default runs) together with a very tight budget. The repeated non-convergence for SSP2-PkBudg650-Hotelling runs (i.e. uniform exponentially increasing CO2 price trajectory until peak year, then constant) is due to failed markets and failed tax convergence. However, the successful convergence of runs with other budget (500 or 1050) but otherwise identical settings indicates that this is not an general problem of the diffExp2Lin realization
  • Comparison of results (what changes by this PR?): Default runs with start year 2025 are not affected by this PR since the new switches cm_co2_tax_hist and cm_year_co2_tax_hist have values 25 $ / t CO2 and 2020 which agrees with the values for the starting point of the linear curve that had been hard-coded so far. For completeness, here are the CO2 price trajectories:
    image
  • Test runs compare default settings (diffLin2Lin) with Hotelling price curve (diffExp2Lin without regional differentiation)
    image
    image
  • Test runs with start year 2025 compare default setting of diffLin2Lin realization, i.e. linear curve going through (2020,25$), with an alternative setting, where the linear curve goes through (2024, 25$).
    image
    image
  • Test runs with start year 2030 compare default setting of diffLin2Lin realization, i.e. linear curve going through (period before start year = 2025, maximal CO2 price among all regions in 2025 in NPi run = 25$), with an alternative setting, where the linear curve goes through (2025, 100$).
    image

…to diffLin2Lin, restructured code and improved documentation of diffLin2Lin and diffExp2Lin
@laurinks laurinks force-pushed the carbon-price-trajectories-2 branch from bbb3187 to 11b5d20 Compare August 21, 2024 14:42
@laurinks laurinks marked this pull request as ready for review August 21, 2024 14:48
@@ -1,4 +1,4 @@
title;start;copyConfigFrom;.description;CES_parameters;c_keep_iteration_gdxes;cm_calibration_string;optimization;c_testOneRegi_region;cm_solver_try_max;cm_nash_mode;cm_startIter_EDGET;subsidizeLearning;trade;cm_trade_SE_exog;cm_EnSecScen_price;cm_EnSecScen_limit;cm_Ger_Pol;c_ccsinjecratescen;c_ccsinjecrateRegi;cm_ccsinjeCost;cm_frac_NetNegEmi;cm_bioprod_regi_lim;c_tech_earlyreti_rate;cm_import_tax;cm_1stgen_phaseout;c_agricult_base_shift;cm_altFeEmiFac;cm_PriceDurSlope_elh2;cm_SEtaxRampUpParam;cm_build_H2costAddH2Inv;cm_steel_secondary_max_share_scenario;cm_CESMkup_build;cm_CESMkup_ind;cm_CESMkup_ind_data;cm_exogDem_scen;cm_wasteIncinerationCCSshare;cm_feedstockEmiUnknownFate;cm_ind_energy_limit;cm_ind_energy_limit_manual;cm_FEtax_trajectory_abs;cm_FEtax_trajectory_rel;cm_inco0Factor;cm_adj_coeff_multiplier;cm_adj_seed_multiplier;regionmapping;extramappings_historic;cm_rcp_scen;cm_iterative_target_adj;c_budgetCO2from2020;carbonprice;cm_co2_tax_2020;cm_peakBudgYr;c_taxCO2inc_after_peakBudgYr;techpol;regipol;cm_regiExoPrice;cm_emiMktTarget;cm_emiMktTarget_tolerance;cm_NucRegiPol;cm_CoalRegiPol;cm_EDGEtr_scen;cm_emiscen;cm_multigasscen;cm_POPscen;cm_GDPscen;cm_demScen;cm_startyear;path_gdx;path_gdx_ref
title;start;copyConfigFrom;.description;CES_parameters;c_keep_iteration_gdxes;cm_calibration_string;optimization;c_testOneRegi_region;cm_solver_try_max;cm_nash_mode;cm_startIter_EDGET;subsidizeLearning;trade;cm_trade_SE_exog;cm_EnSecScen_price;cm_EnSecScen_limit;cm_Ger_Pol;c_ccsinjecratescen;c_ccsinjecrateRegi;cm_ccsinjeCost;cm_frac_NetNegEmi;cm_bioprod_regi_lim;c_tech_earlyreti_rate;cm_import_tax;cm_1stgen_phaseout;c_agricult_base_shift;cm_altFeEmiFac;cm_PriceDurSlope_elh2;cm_SEtaxRampUpParam;cm_build_H2costAddH2Inv;cm_steel_secondary_max_share_scenario;cm_CESMkup_build;cm_CESMkup_ind;cm_CESMkup_ind_data;cm_exogDem_scen;cm_wasteIncinerationCCSshare;cm_feedstockEmiUnknownFate;cm_ind_energy_limit;cm_ind_energy_limit_manual;cm_FEtax_trajectory_abs;cm_FEtax_trajectory_rel;cm_inco0Factor;cm_adj_coeff_multiplier;cm_adj_seed_multiplier;regionmapping;extramappings_historic;cm_rcp_scen;cm_iterative_target_adj;c_budgetCO2from2020;carbonprice;cm_co2_tax_2020;cm_peakBudgYr;cm_taxCO2inc_after_peakBudgYr;techpol;regipol;cm_regiExoPrice;cm_emiMktTarget;cm_emiMktTarget_tolerance;cm_NucRegiPol;cm_CoalRegiPol;cm_EDGEtr_scen;cm_emiscen;cm_multigasscen;cm_POPscen;cm_GDPscen;cm_demScen;cm_startyear;path_gdx;path_gdx_ref
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only changed c_taxCO2inc_after_peakBudgYr to cm_taxCO2inc_after_peakBudgYr

@@ -1,4 +1,4 @@
title;start;slurmConfig;climate;cm_import_tax;cm_taxrc_RE;cm_magicc_calibrateTemperature2000;cm_damage_KWSE;cm_magicc_config;cm_magicc_temperatureImpulseResponse;cm_damage_DiceLike_specification;cm_damages_BurkeLike_persistenceTime;cm_damages_BurkeLike_specification;cm_damages_SccHorizon;cm_VRE_supply_assumptions;c_CES_calibration_new_structure;buildings;transport;industry;cm_wasteIncinerationCCSshare;cm_DiscRateScen;c_shBioTrans;cm_EDGEtr_scen;cm_reducCostB;cm_CES_calibration_default_prices;c_ccsinjecratescen;.CDR;cm_bioenergy_SustTax;cm_rcp_scen;cm_iterative_target_adj;subsidizeLearning;cm_LearningSpillover;c_budgetCO2from2020;carbonprice;carbonpriceRegi;cm_netZeroScen;cm_co2_tax_2020;cm_peakBudgYr;c_taxCO2inc_after_peakBudgYr;cm_CO2priceRegConvEndYr;cm_emiscen;c_regi_earlyreti_rate;c_tech_earlyreti_rate;cm_fetaxscen;cm_co2_tax_growth;cm_maxProdBiolc;c_ccscapratescen;techpol;c_techAssumptScen;cm_nucscen;cm_so2tax_scen;cm_multigasscen;cm_LU_emi_scen;cm_tradecostBio;cm_1stgen_phaseout;c_SSP_forcing_adjust;cm_APscen;water;cm_startyear;path_gdx_carbonprice;path_gdx;path_gdx_ref;path_gdx_bau;description
title;start;slurmConfig;climate;cm_import_tax;cm_taxrc_RE;cm_magicc_calibrateTemperature2000;cm_damage_KWSE;cm_magicc_config;cm_magicc_temperatureImpulseResponse;cm_damage_DiceLike_specification;cm_damages_BurkeLike_persistenceTime;cm_damages_BurkeLike_specification;cm_damages_SccHorizon;cm_VRE_supply_assumptions;c_CES_calibration_new_structure;buildings;transport;industry;cm_wasteIncinerationCCSshare;cm_DiscRateScen;c_shBioTrans;cm_EDGEtr_scen;cm_reducCostB;cm_CES_calibration_default_prices;c_ccsinjecratescen;.CDR;cm_bioenergy_SustTax;cm_rcp_scen;cm_iterative_target_adj;subsidizeLearning;cm_LearningSpillover;c_budgetCO2from2020;carbonprice;carbonpriceRegi;cm_netZeroScen;cm_co2_tax_2020;cm_peakBudgYr;cm_taxCO2inc_after_peakBudgYr;cm_CO2priceRegConvEndYr;cm_emiscen;c_regi_earlyreti_rate;c_tech_earlyreti_rate;cm_fetaxscen;cm_co2_tax_growth;cm_maxProdBiolc;c_ccscapratescen;techpol;c_techAssumptScen;cm_nucscen;cm_so2tax_scen;cm_multigasscen;cm_LU_emi_scen;cm_tradecostBio;cm_1stgen_phaseout;c_SSP_forcing_adjust;cm_APscen;water;cm_startyear;path_gdx_carbonprice;path_gdx;path_gdx_ref;path_gdx_bau;description
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only changed c_taxCO2inc_after_peakBudgYr to cm_taxCO2inc_after_peakBudgYr

@laurinks
Copy link
Contributor Author

A few additional comments for the reviewers:

  • This PR implements the planned changes in the realizations diffExp2Lin and diffLin2Lin, i.e. turning the previous hot fix (regarding the starting point of the linear curve) into a (hopefully) clean default solution.
  • I decided to keep the switches cm_co2_tax_startyear and cm_peakBudgYr as initializations (they are then changed by the core/postsolve.gms algorithms to reach prescribed budgets) since I find it more transparent than initializing it somewhere in the code. These should then be regularly adjusted to appropriate values in the scenario_config.csv file to help fast convergence. @LaviniaBaumstark : Any suggestion on where to put this recurring "Todo" note? I will do it after the next AMT runs using this PR, but it might get forgotten on the long run.
  • Once this PR is merged, I will do another PR to delete the realizations "exponential", "linear" and "diffCurvPhaseIn2Lin", i.e. cleaning up the 45_carbonprice module.

@laurinks laurinks requested review from orichters and LaviniaBaumstark and removed request for orichters August 21, 2024 16:07
@LaviniaBaumstark
Copy link
Member

  • delete the realizations "exponential", "linear" and "diffCurvPhaseIn2Lin"

looking forward!

@LaviniaBaumstark
Copy link
Member

  • Any suggestion on where to put this recurring "Todo" note? I will do it after the next AMT runs using this PR, but it might get forgotten on the long run.

hmmm, I would say as part of teh description of teh set it would be good. In general, we know that from time to time we need to check, if our carbon price is still working as intended. So, we should think about it from time to time....

Copy link
Member

@LaviniaBaumstark LaviniaBaumstark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you also need to adjust scenario_config.csv?; Did you check that you do not need to adjust the reporting?

@laurinks
Copy link
Contributor Author

do you also need to adjust scenario_config.csv?

No, since the switch taxCO2inc_after_peakBudgYr is not used in scenario_config.csv (i.e. kept to default value = 0). That's why I only adjusted three specific config files, where that switch is used. The general changes to use diffLin2Lin instead of diffCurvPhaseIn2Lin was done in PR #1747 .

@@ -160,7 +160,7 @@ readCheckScenarioConfig <- function(filename, remindPath = ".", testmode = FALSE
"cm_calibration_FE" = "Deleted, only used for old hand made industry trajectories, see https://github.com/remindmodel/remind/pull/1468",
"cm_DAC_eff" = "Deleted, not used anymore, see https://github.com/remindmodel/remind/pull/1487",
"cm_peakBudgYr" = "Rename to c_peakBudgYr, see https://github.com/remindmodel/remind/pull/1488",
"cm_taxCO2inc_after_peakBudgYr" = "Rename to c_taxCO2inc_after_peakBudgYr, see https://github.com/remindmodel/remind/pull/1488",
"c_taxCO2inc_after_peakBudgYr" = "Rename to cm_taxCO2inc_after_peakBudgYr, see https://github.com/remindmodel/remind/pull/1776",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At some point, I wonder whether it would be easier to just accept both cm_taxCO2inc_after_peakBudgYr and c_taxCO2inc_after_peakBudgYr as a switch :D

@@ -8,6 +8,18 @@

*#' @description: This realization implements linearly increasing carbon price - either until 2100 or until peak year (constant or linear thereafter). Optional carbon price differentiation and quadratic phase-in can be activated via switch cm_co2_tax_spread.

***--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for adding precise documentation

@laurinks
Copy link
Contributor Author

Did you check that you do not need to adjust the reporting?

Yes, but I did not see any changes that might affect the reporting. Did you have a specific aspect in mind?

Copy link
Contributor

@orichters orichters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine from my side, thanks for the detailed explanation and documentation!

@LaviniaBaumstark
Copy link
Member

Did you check that you do not need to adjust the reporting?

Yes, but I did not see any changes that might affect the reporting. Did you have a specific aspect in mind?

no, thanks

@laurinks laurinks merged commit c38df01 into remindmodel:develop Aug 22, 2024
1 of 2 checks passed
@laurinks laurinks deleted the carbon-price-trajectories-2 branch August 22, 2024 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants