Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:remindmodel/remind into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
dklein-pik committed Jul 9, 2024
2 parents 80f2c68 + 5171e35 commit 0a6c8c5
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 30 deletions.
11 changes: 9 additions & 2 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,18 @@
},
{
"name": "Klein, David",
"affiliation": "Potsdam Institute for Climate Impact Research"
"affiliation": "Potsdam Institute for Climate Impact Research",
"orcid": "0009-0001-7917-8041"
},
{
"name": "Koch, Johannes",
"affiliation": "Potsdam Institute for Climate Impact Research"
"affiliation": "Potsdam Institute for Climate Impact Research",
"orcid": "0000-0003-2920-8086"
},
{
"name": "Köhler-Schindler, Laurin",
"affiliation": "Potsdam Institute for Climate Impact Research",
"orcid": "0000-0003-4268-3084"
},
{
"name": "Körner, Alexander"
Expand Down
10 changes: 8 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ authors:

- family-names: "Koch"
given-names: "Johannes"
orcid: https://orcid.org/0000-0003-2920-8086
affiliation: "Potsdam Institute for Climate Impact Research"

- family-names: "Köhler-Schindler"
given-names: "Laurin"
orcid: https://orcid.org/0000-0003-4268-3084
affiliation: "Potsdam Institute for Climate Impact Research"

- family-names: "Körner"
Expand Down Expand Up @@ -260,8 +266,8 @@ abstract: REMIND (REgional Model of Investment and Development) is a numerical
technology, policy and climate constraints. It also accounts for regional trade
characteristics on goods, energy fuels, and emissions allowances. All greenhouse
gas emissions due to human activities are represented in the model.
version: "3.3.2.dev110"
date-released: 2024-07-08
version: "3.3.2.dev118"
date-released: 2024-07-09
repository-code: https://github.com/remindmodel/remind
keywords:
- energy
Expand Down
2 changes: 1 addition & 1 deletion config/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ cfg$validationmodel_name <- "VALIDATIONREMIND"

#### model version of the overall model (used for run statistics only).
# automatically generated for development versions, updated by hand for releases
cfg$model_version <- "3.3.2.dev110"
cfg$model_version <- "3.3.2.dev118"

#### settings ####
cfg$gms <- list()
Expand Down
3 changes: 3 additions & 0 deletions main.gms
Original file line number Diff line number Diff line change
Expand Up @@ -1627,6 +1627,9 @@ $setglobal cm_ind_energy_limit_manual "2050 . GLO . (ue_cement, ue_steel_prima
*** 2050.GLO 0.5, 2050.EUR 0.8: means that 50% of waste incineration emissions are captured for all regions from 2050 onward, except for Europe that has 80% of its waste incineration emissions captured.
*** The CCS share of waste incineration increases linearly from zero, in 2025, to the value set at the switch, and it is kept constant for years afterwards.
$setglobal cm_wasteIncinerationCCSshare off !! def = off
*** cm_wastelag, does waste from plastics lag ten years behind plastics
*** production, or not?
$setglobal cm_wastelag YES !! def = YES !! regexp = YES|NO
*** cm_feedstockEmiUnknownFate, account for chemical feedstock emissions with unknown fate
*** off: assume that these emissions are trapped and do not account for total anthropogenic emissions
*** on: account for chemical feedstock emissions with unknown fate as re-emitted to the atmosphere
Expand Down
28 changes: 17 additions & 11 deletions modules/37_industry/subsectors/equations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -278,22 +278,28 @@ q37_plasticsCarbon(t,regi,sefe(entySe,entyFe),emiMkt)$(
* s37_plasticsShare
;

*' calculate plastic waste generation, shifted by mean lifetime of plastic products
*' shift by 2 time steps when we have 5-year steps and 1 when we have 10-year steps
*' allocate averge of 2055 and 2060 to 2070
*' calculate plastic waste generation, shifted by mean lifetime of plastic
*' products shift by 2 time steps when we have 5-year steps and 1 when we have
*' 10-year steps allocate averge of 2055 and 2060 to 2070, unless `cm_wastelag`
*' is `NO`, in which case waste is incurred in the same period plastics are
*' produced
q37_plasticWaste(ttot,regi,sefe(entySe,entyFe),emiMkt)$(
entyFE2sector2emiMkt_NonEn(entyFe,"indst",emiMkt)
AND ttot.val ge max(2015, cm_startyear) ) ..
v37_plasticWaste(ttot,regi,entySe,entyFe,emiMkt)
=e=
v37_plasticsCarbon(ttot-2,regi,entySe,entyFe,emiMkt)$( ttot.val lt 2070 )
+ ( ( v37_plasticsCarbon(ttot-2,regi,entySe,entyFe,emiMkt)
+ v37_plasticsCarbon(ttot-1,regi,entySe,entyFe,emiMkt)
)
/ 2
)$( ttot.val eq 2070 )
+ v37_plasticsCarbon(ttot-1,regi,entySe,entyFe,emiMkt)$( ttot.val gt 2070 )
;
!! prompt waste
v37_plasticsCarbon(ttot,regi,entySe,entyFe,emiMkt)$( NOT %cm_wastelag% )
!! lagged waste
+ ( v37_plasticsCarbon(ttot-2,regi,entySe,entyFe,emiMkt)$( ttot.val lt 2070 )
+ ( ( v37_plasticsCarbon(ttot-2,regi,entySe,entyFe,emiMkt)
+ v37_plasticsCarbon(ttot-1,regi,entySe,entyFe,emiMkt)
)
/ 2
)$( ttot.val eq 2070 )
+ v37_plasticsCarbon(ttot-1,regi,entySe,entyFe,emiMkt)$( ttot.val gt 2070 )
)$( %cm_wastelag% )
;

*' emissions from plastics incineration as a share of total plastic waste,
*' discounted by captured amount
Expand Down
23 changes: 12 additions & 11 deletions modules/45_carbonprice/diffCurvPhaseIn2Lin/datainput.gms
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*** | Contact: [email protected]
*** SOF ./modules/45_carbonprice/diffCurvPhaseIn2Lin/datainput.gms
***------------------------------------------------------------------------------------------------------------------------
*** *BS* 20190930 linear convergence with starting points differentiated by GDP/capita, global price from 2040
*** linear convergence with starting points differentiated by GDP/capita, global price from 2050
***-----------------------------------------------------------------------------------------------------------------------


Expand All @@ -31,31 +31,32 @@ if(cm_co2_tax_2020 lt 0,
abort "please choose a valid cm_co2_tax_2020"
elseif cm_co2_tax_2020 ge 0,
*** convert tax value from $/t CO2eq to T$/GtC
p45_CO2priceTrajDeveloped("2040")= 3 * cm_co2_tax_2020 * sm_DptCO2_2_TDpGtC; !! shifted to 2040 to make sure that even in delay scenarios the fixpoint of the linear price path is inside the "t" range, otherwise the CO2 prices from reference run may be overwritten
p45_CO2priceTrajDeveloped("2040") = 3 * cm_co2_tax_2020 * sm_DptCO2_2_TDpGtC;
*** shifted to 2040 to make sure that even in delay scenarios the fixpoint of the linear price path is inside the "t" range, otherwise the CO2 prices from reference run may be overwritten
*** The factor 3 comes from shifting the 2020 value 20 years into the future at linear increase of 10% of 2020 value per year.
);



p45_CO2priceTrajDeveloped(ttot)$((ttot.val gt 2005) AND (ttot.val ge cm_startyear)) = p45_CO2priceTrajDeveloped("2040")*( 1 + 0.1/3 * (ttot.val-2040)); !! no CO2 price in 2005 and only change CO2 prices after ;
p45_CO2priceTrajDeveloped(t)$(t.val gt 2005) = p45_CO2priceTrajDeveloped("2040")*( 1 + 0.1/3 * (t.val-2040)); !! no CO2 price in 2005 and only change CO2 prices afterwards
*** annual increase by (10/3)% of the 2040 value is the same as a 10% increase of the 2020 value is the same as a linear increase from 0 in 2010 to the 2020/2040 value


*** Then create regional phase-in:
loop(ttot$((ttot.val ge cm_startyear) AND (ttot.val le cm_CO2priceRegConvEndYr) ),
p45_regCO2priceFactor(ttot,regi) =
loop(t$(t.val le cm_CO2priceRegConvEndYr),
p45_regCO2priceFactor(t,regi) =
min(1,
max(0,
p45_phasein_2025ratio(regi) + (1 - p45_phasein_2025ratio(regi))
* Power(
( (ttot.val - 2025) + (cm_CO2priceRegConvEndYr - 2025) * 0.1 )
max(0,
p45_phasein_2025ratio(regi) + (1 - p45_phasein_2025ratio(regi))
* Power(
( (t.val - 2025) + (cm_CO2priceRegConvEndYr - 2025) * 0.1 )
/ ( (cm_CO2priceRegConvEndYr - 2025) * 1.1 )
, 2
) !! use Power instead of ** to allow ttot be smaller than 2025, and thus the base to be negative
)
)
);
);
p45_regCO2priceFactor(ttot,regi)$(ttot.val ge cm_CO2priceRegConvEndYr) = 1;
p45_regCO2priceFactor(t,regi)$(t.val ge cm_CO2priceRegConvEndYr) = 1;


*** transition to global price - starting point depends on GDP/cap
Expand Down
1 change: 1 addition & 0 deletions modules/45_carbonprice/diffCurvPhaseIn2Lin/not_used.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ pm_prtp,input,questionnaire
vm_demFeSector,input,questionnaire
pm_emifac,input,questionnaire
cm_co2_tax_spread,input,added by codeCheck
cm_startyear,parameter,not needed
2 changes: 1 addition & 1 deletion scripts/output/single/MAGICC7_AR6.R
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ runHarmoniseAndInfillCmd <- paste(

runClimateEmulatorCmd <- paste(
"python", file.path(scriptsFolder, "run_clim.py"),
normalizePath(file.path(climateAssessmentFolder, paste0(baseFileName, "_harmonized_infilled.csv"))),
normalizePath(file.path(climateAssessmentFolder, paste0(baseFileName, "_harmonized_infilled.csv")), mustWork = FALSE),
climateAssessmentFolder,
"--num-cfgs", nparsets,
"--scenario-batch-size", 1,
Expand Down
2 changes: 1 addition & 1 deletion scripts/output/single/fixOnRef.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ fixOnMif <- function(outputdir) {
dref <- quitte::as.quitte(refmif)
d <- fixMAGICC(d, dref, startyear, title)
failfile <- file.path(outputdir, "log_fixOnRef.csv")
fixeddata <- piamInterfaces::fixOnRef(d, dref, ret = "TRUE_or_fixed", startyear = startyear, failfile = failfile)
fixeddata <- piamInterfaces::fixOnRef(d, dref, ret = "TRUE_or_fixed", startyear = startyear, failfile = failfile, relDiff = 0.00002)

update <- paste0("MAGICC data. ", if (! isTRUE(fixeddata)) "Run output.R -> single -> fixOnRef to fix the rest.")
if (! isTRUE(fixeddata) && isTRUE(envi$cfg$fixOnRefAuto)) {
Expand Down
2 changes: 1 addition & 1 deletion tutorials/11_ManagingRenv.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ REMIND uses [renv](https://rstudio.github.io/renv/) for managing required R pack
The `piamenv` functions explained earlier should cover all common tasks, use the following for more control.
- `renv::install("[email protected]")` install specific package version
- `renv::install("githubuser/package", ref = "<commit hash>")` install package from GitHub, optionally provide commit hash
- `renv::install("/p/tmp/username/yourpackagefolder")` install package from sources
- `renv::install("/p/tmp/username/yourpackagefolder")` install package from sources. Always use an absolute path!
- `renv::remove("package")` uninstall package
- `renv::update(exclude = "renv")` (`make update-renv-all`) update all packages except renv (please do not update renv itself)
- `renv::update("package")` update package
Expand Down

0 comments on commit 0a6c8c5

Please sign in to comment.