Skip to content

Commit

Permalink
in REMIND standalone, fix landuse on reference run
Browse files Browse the repository at this point in the history
  • Loading branch information
orichters committed Feb 20, 2024
1 parent ef8a82f commit 7b73d87
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion config/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ cfg$repositories <- getOption("remind_repos")
cfg$runstatistics <- "/p/projects/rd3mod/models/statistics/remind"

#### Folder containing magicc files that can not be published open source. These files are automatically
# copied into remind when starting a run and required to calcualte climate responses (e.g. temperature).
# copied into remind when starting a run and required to calculate climate responses (e.g. temperature).
cfg$magicc_template <- "/p/projects/rd3mod/magicc/"

#### Output folder of the modeltests generated by running config/scenario_config_AMT.csv
Expand Down
2 changes: 1 addition & 1 deletion modules/21_tax/off/not_used.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ cm_bioenergy_EF_for_tax,input,questionnaire
cm_startyear, switch, ???
cm_fetaxscen, switch, ???
cm_gdximport_target, switch, ???
pm_gdp_gdx,parameter,???
pm_pop,parameter,???
cm_so2tax_scen,switch,???
sm_DpGJ_2_TDpTWa,switch,???
Expand Down Expand Up @@ -72,3 +71,4 @@ vm_changeProdStartyearCost, variable, ???
vm_costInvTeDir,input,only needed if tax is on
vm_costInvTeAdj,input,only needed if tax is on
pm_cintraw,input,only needed if tax is on
pm_gdp,input,only needed if tax is on
4 changes: 4 additions & 0 deletions modules/21_tax/on/datainput.gms
Original file line number Diff line number Diff line change
Expand Up @@ -247,4 +247,8 @@ Execute_Loadpoint 'input_ref' p21_ref_costInvTeDir_RE = vm_costInvTeDir.l;
Execute_Loadpoint 'input_ref' p21_ref_costInvTeAdj_RE = vm_costInvTeAdj.l;
$endif.importtaxrc

if (cm_startyear gt 2005,
execute_load "input_ref.gdx", pm_taxrevCO2LUC0;
);

*** EOF ./modules/21_tax/on/datainput.gms
2 changes: 1 addition & 1 deletion modules/21_tax/on/postsolve.gms
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pm_taxCO2eqSum(ttot,regi) = pm_taxCO2eq(ttot,regi) + pm_taxCO2eqRegi(ttot,regi)
*** Do not forget to update the other file.
pm_taxrevGHG0(ttot,regi) = pm_taxCO2eqSum(ttot,regi) * (vm_co2eq.l(ttot,regi) - vm_emiMacSector.l(ttot,regi,"co2luc")$(cm_multigasscen ne 3));
pm_taxrevCO2Sector0(ttot,regi,emi_sectors) = p21_CO2TaxSectorMarkup(ttot,regi,emi_sectors) * pm_taxCO2eqSum(ttot,regi) * vm_emiCO2Sector.l(ttot,regi,emi_sectors);
pm_taxrevCO2LUC0(ttot,regi) = pm_taxCO2eqSum(ttot,regi) * vm_emiMacSector.l(ttot,regi,"co2luc")$(cm_multigasscen ne 3);
pm_taxrevCO2LUC0(t,regi) = pm_taxCO2eqSum(t,regi) * vm_emiMacSector.l(t,regi,"co2luc")$(cm_multigasscen ne 3);
p21_taxrevCCS0(ttot,regi) = cm_frac_CCS * pm_data(regi,"omf","ccsinje") * pm_inco0_t(ttot,regi,"ccsinje")
* ( sum(teCCS2rlf(te,rlf), sum(ccs2te(ccsCO2(enty),enty2,te), vm_co2CCS.l(ttot,regi,enty,enty2,te,rlf) ) ) )
* (1/pm_ccsinjecrate(regi)) * sum(teCCS2rlf(te,rlf), sum(ccs2te(ccsCO2(enty),enty2,te), vm_co2CCS.l(ttot,regi,enty,enty2,te,rlf) ) ) / pm_dataccs(regi,"quan","1");
Expand Down
6 changes: 3 additions & 3 deletions modules/21_tax/on/presolve.gms
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
*** SOF ./modules/21_tax/on/presolve.gms
*JS*
*** calculation of tax rate, as a function of per-capita gdp levels
p21_tau_so2_tax(ttot,regi)$(ttot.val ge 2005)=s21_so2_tax_2010*pm_gdp_gdx(ttot,regi)/pm_pop(ttot,regi); !! scaled by GDP/cap in the unit [trn US$/bn people]
p21_tau_so2_tax(ttot,regi)$(ttot.val ge 2005)=s21_so2_tax_2010*pm_gdp(ttot,regi)/pm_pop(ttot,regi); !! scaled by GDP/cap in the unit [trn US$/bn people]
p21_tau_so2_tax("2005",regi)=0;
p21_tau_so2_tax("2100",regi)=s21_so2_tax_2010*pm_gdp_gdx("2100",regi)/pm_pop("2100",regi);
p21_tau_so2_tax("2100",regi)=s21_so2_tax_2010*pm_gdp("2100",regi)/pm_pop("2100",regi);
p21_tau_so2_tax(ttot,regi)$(ttot.val>2100)=p21_tau_so2_tax("2100",regi);

*** sum all 4 CO2eq tax components
Expand All @@ -21,7 +21,7 @@ pm_taxCO2eqSum(ttot,regi) = pm_taxCO2eq(ttot,regi) + pm_taxCO2eqRegi(ttot,regi)
*** save level value of all taxes
pm_taxrevGHG0(ttot,regi) = pm_taxCO2eqSum(ttot,regi) * (vm_co2eq.l(ttot,regi) - vm_emiMacSector.l(ttot,regi,"co2luc")$(cm_multigasscen ne 3));
pm_taxrevCO2Sector0(ttot,regi,emi_sectors) = p21_CO2TaxSectorMarkup(ttot,regi,emi_sectors) * pm_taxCO2eqSum(ttot,regi) * vm_emiCO2Sector.l(ttot,regi,emi_sectors);
pm_taxrevCO2LUC0(ttot,regi) = pm_taxCO2eqSum(ttot,regi) * vm_emiMacSector.l(ttot,regi,"co2luc")$(cm_multigasscen ne 3);
pm_taxrevCO2LUC0(t,regi) = pm_taxCO2eqSum(t,regi) * vm_emiMacSector.l(t,regi,"co2luc")$(cm_multigasscen ne 3);
p21_taxrevCCS0(ttot,regi) = cm_frac_CCS * pm_data(regi,"omf","ccsinje") * pm_inco0_t(ttot,regi,"ccsinje")
* ( sum(teCCS2rlf(te,rlf), sum(ccs2te(ccsCO2(enty),enty2,te), vm_co2CCS.l(ttot,regi,enty,enty2,te,rlf) ) ) )
* (1/pm_ccsinjecrate(regi)) * sum(teCCS2rlf(te,rlf), sum(ccs2te(ccsCO2(enty),enty2,te), vm_co2CCS.l(ttot,regi,enty,enty2,te,rlf) ) ) / pm_dataccs(regi,"quan","1");
Expand Down
2 changes: 1 addition & 1 deletion modules/26_agCosts/costs/datainput.gms
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ $if %cm_MAgPIE_coupling% == "off" p26_totLUcosts_withMAC(ttot,regi) = p26_totLUc
$if %cm_MAgPIE_coupling% == "on" p26_totLUcosts_withMAC(ttot,regi) = p26_totLUcost_coupling(ttot,regi);

*' **Land use emissions MAC cost**
*' In *standalone runs* land use MAC costs are calcualted endogenously in REMIND. Since they are also included
*' In *standalone runs* land use MAC costs are calculated endogenously in REMIND. Since they are also included
*' in the exogenous total landuse costs (p26_totLUcostLookup) they need to besubstracted from these total
*' landuse costs. In coupled runs the land use MAC is deactivated in REMIND and MAC costs are included in the total land use
*' costs that are transferred from MAgPIE.
Expand Down
5 changes: 5 additions & 0 deletions modules/30_biomass/magpie_40/datainput.gms
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ $offdelim
/
;


if (cm_startyear gt 2005,
execute_load "input_ref.gdx", p30_pebiolc_costs_emu_preloop;
);

*** Select bioenergy bioenergy supply curve according to SSP scenario
i30_bioen_price_a(ttot,regi) = f30_bioen_price(ttot,regi,"%cm_LU_emi_scen%","%cm_rcp_scen%","a");
i30_bioen_price_b(ttot,regi) = f30_bioen_price(ttot,regi,"%cm_LU_emi_scen%","%cm_rcp_scen%","b");
Expand Down
2 changes: 1 addition & 1 deletion modules/30_biomass/magpie_40/equations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ q30_costFuBio(ttot,regi)$(ttot.val ge cm_startyear)..
+
$if %cm_MAgPIE_coupling% == "on" (v30_pebiolc_costs(ttot,regi) * v30_multcost(ttot,regi))
$if %cm_MAgPIE_coupling% == "off" (v30_pebiolc_costs(ttot,regi))
- p30_pebiolc_costs_emu_preloop(ttot,regi) !! Need to be substracted since they are also inculded in the total agricultural production costs
- p30_pebiolc_costs_emu_preloop(ttot,regi) !! Need to be substracted since they are also included in the total agricultural production costs
+
sum(peren2cont30(enty,rlf), vm_fuExtr(ttot,regi,enty,rlf) * pm_costsTradePeFinancial(regi,"use",enty));

Expand Down
4 changes: 2 additions & 2 deletions modules/30_biomass/magpie_40/preloop.gms
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ $endif
***------------ Step 3: calculate bioenergy costs -------------
*** The costs are calculated applying the regular cost equation.
*** This equation integrates the shifted (!) price supply curve over the demand.
*** It requires the price shift factor to be calcualted before (see above).
*** It requires the price shift factor to be calculated before (see above).

if (execError > 0,
execute_unload "abort.gdx";
Expand All @@ -102,7 +102,7 @@ if (execError > 0,

solve model_biopresolve_c using cns; !!! nothing has to be optimized here, just pure calculation

p30_pebiolc_costs_emu_preloop(ttot,regi) = v30_pebiolc_costs.l(ttot,regi);
p30_pebiolc_costs_emu_preloop(t,regi) = v30_pebiolc_costs.l(t,regi);

display p30_pebiolc_costs_emu_preloop;

Expand Down

0 comments on commit 7b73d87

Please sign in to comment.