-
Notifications
You must be signed in to change notification settings - Fork 167
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
34_urban exo_nov21 Realisation PR #340
Changes from all commits
fc57c07
42fb888
9d72cd6
b8192b3
305bb8b
6a0a011
236c830
e456a09
aaca0aa
9bb30d0
6010e14
effaa12
d32a4fb
00f0194
2c88746
70a7c08
a28c528
6ed00e6
59efc48
441d8cd
ec0d0dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
*** | (C) 2008-2021 Potsdam Institute for Climate Impact Research (PIK) | ||
*** | authors, and contributors see CITATION.cff file. This file is part | ||
*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of | ||
*** | AGPL-3.0, you are granted additional permissions described in the | ||
*** | MAgPIE License Exception, version 1.0 (see LICENSE file). | ||
*** | Contact: magpie@pik-potsdam.de | ||
|
||
parameters | ||
i34_urban_area(t_all, j) Cellular urban area | ||
; | ||
|
||
positive variables | ||
vm_cost_urban(j) Technical adjustment costs | ||
v34_cost1(j) Technical adjustment costs | ||
v34_cost2(j) Technical adjustment costs | ||
; | ||
|
||
equations | ||
q34_urban_cell(j) Constraint for urban land | ||
q34_urban_land(i) Prescribe total regional urban land | ||
q34_urban_cost1(j) Technical punishment equation | ||
q34_urban_cost2(j) Technical punishment equation | ||
; | ||
|
||
*#################### R SECTION START (OUTPUT DECLARATIONS) #################### | ||
parameters | ||
ov_cost_urban(t,j,type) Technical adjustment costs | ||
ov34_cost1(t,j,type) Technical adjustment costs | ||
ov34_cost2(t,j,type) Technical adjustment costs | ||
oq34_urban_cell(t,j,type) Constraint for urban land | ||
oq34_urban_land(t,i,type) Prescribe total regional urban land | ||
oq34_urban_cost1(t,j,type) Technical punishment equation | ||
oq34_urban_cost2(t,j,type) Technical punishment equation | ||
; | ||
*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
*** | (C) 2008-2020 Potsdam Institute for Climate Impact Research (PIK) | ||
*** | authors, and contributors see CITATION.cff file. This file is part | ||
*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of | ||
*** | AGPL-3.0, you are granted additional permissions described in the | ||
*** | MAgPIE License Exception, version 1.0 (see LICENSE file). | ||
*** | Contact: magpie@pik-potsdam.de | ||
|
||
*' @equations | ||
*' Cellular level land is prescribed via a very strong incentive not to deviate | ||
*' from cellular input data. v34_cost1 and v34_cost2 are the cost variables that | ||
*' implement this, for when vm_land(j2,"urban") is less than and greater than the input data | ||
*' i.e. when reducing or establishing more urban land than in input.This safeguards against infeasible outcomes, | ||
*' where urban land should expand but can not due to NPI or other protected land constraints. In this case it incurs the cost and shifts the land elsewhere in the region. | ||
|
||
|
||
|
||
q34_urban_cost1(j2) .. | ||
v34_cost1(j2) =g= sum(ct, i34_urban_area(ct, j2)) - vm_land(j2,"urban"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is that required? why not just use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We thought that this way safeguards against infeasible outcomes. Where urban land should expand but can not due to NPI or other protected land constraints. In this case it can have high costs and shift it elsewhere in the region. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be added to the explanation text above |
||
|
||
q34_urban_cost2(j2) .. | ||
v34_cost2(j2) =g= vm_land(j2,"urban") - sum(ct, i34_urban_area(ct, j2)); | ||
|
||
*' Sum up cost terms with high punishment | ||
|
||
q34_urban_cell(j2) .. | ||
vm_cost_urban(j2) =e= (v34_cost1(j2) + v34_cost2(j2)) * s34_urban_deviation_cost; | ||
|
||
*' Regional level urban land must match | ||
|
||
q34_urban_land(i2) .. | ||
sum(cell(i2,j2), vm_land(j2,"urban")) =e= sum((ct,cell(i2,j2)), i34_urban_area(ct,j2)); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
*** | (C) 2008-2021 Potsdam Institute for Climate Impact Research (PIK) | ||
*** | authors, and contributors see CITATION.cff file. This file is part | ||
*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of | ||
*** | AGPL-3.0, you are granted additional permissions described in the | ||
*** | MAgPIE License Exception, version 1.0 (see LICENSE file). | ||
*** | Contact: magpie@pik-potsdam.de | ||
|
||
|
||
scalars | ||
s34_urban_deviation_cost Artificial cost for urban deviation variables (USD05MER per ha) / 1e+06 / | ||
; | ||
|
||
table f34_urbanland(t_all, j, gdp_scen09) Urban land | ||
$ondelim | ||
$include "./modules/34_urban/exo_nov21/input/f34_urbanland.cs3" | ||
$offdelim | ||
; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* list of files that are required here | ||
f34_urbanland.cs3 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### | ||
ov_cost_urban(t,j,"marginal") = vm_cost_urban.m(j); | ||
ov34_cost1(t,j,"marginal") = v34_cost1.m(j); | ||
ov34_cost2(t,j,"marginal") = v34_cost2.m(j); | ||
oq34_urban_cell(t,j,"marginal") = q34_urban_cell.m(j); | ||
oq34_urban_land(t,i,"marginal") = q34_urban_land.m(i); | ||
oq34_urban_cost1(t,j,"marginal") = q34_urban_cost1.m(j); | ||
oq34_urban_cost2(t,j,"marginal") = q34_urban_cost2.m(j); | ||
ov_cost_urban(t,j,"level") = vm_cost_urban.l(j); | ||
ov34_cost1(t,j,"level") = v34_cost1.l(j); | ||
ov34_cost2(t,j,"level") = v34_cost2.l(j); | ||
oq34_urban_cell(t,j,"level") = q34_urban_cell.l(j); | ||
oq34_urban_land(t,i,"level") = q34_urban_land.l(i); | ||
oq34_urban_cost1(t,j,"level") = q34_urban_cost1.l(j); | ||
oq34_urban_cost2(t,j,"level") = q34_urban_cost2.l(j); | ||
ov_cost_urban(t,j,"upper") = vm_cost_urban.up(j); | ||
ov34_cost1(t,j,"upper") = v34_cost1.up(j); | ||
ov34_cost2(t,j,"upper") = v34_cost2.up(j); | ||
oq34_urban_cell(t,j,"upper") = q34_urban_cell.up(j); | ||
oq34_urban_land(t,i,"upper") = q34_urban_land.up(i); | ||
oq34_urban_cost1(t,j,"upper") = q34_urban_cost1.up(j); | ||
oq34_urban_cost2(t,j,"upper") = q34_urban_cost2.up(j); | ||
ov_cost_urban(t,j,"lower") = vm_cost_urban.lo(j); | ||
ov34_cost1(t,j,"lower") = v34_cost1.lo(j); | ||
ov34_cost2(t,j,"lower") = v34_cost2.lo(j); | ||
oq34_urban_cell(t,j,"lower") = q34_urban_cell.lo(j); | ||
oq34_urban_land(t,i,"lower") = q34_urban_land.lo(i); | ||
oq34_urban_cost1(t,j,"lower") = q34_urban_cost1.lo(j); | ||
oq34_urban_cost2(t,j,"lower") = q34_urban_cost2.lo(j); | ||
*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
*** | (C) 2008-2021 Potsdam Institute for Climate Impact Research (PIK) | ||
*** | authors, and contributors see CITATION.cff file. This file is part | ||
*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of | ||
*** | AGPL-3.0, you are granted additional permissions described in the | ||
*** | MAgPIE License Exception, version 1.0 (see LICENSE file). | ||
*** | Contact: magpie@pik-potsdam.de | ||
|
||
* get the scenario GDP & Populaiton data for iso countries | ||
loop(t_all, | ||
if(m_year(t_all) <= sm_fix_SSP2, | ||
i34_urban_area(t_all, j) = f34_urbanland(t_all, j,"SSP2"); | ||
else | ||
i34_urban_area(t_all, j) = f34_urbanland(t_all, j,"%c09_gdp_scenario%"); | ||
); | ||
); | ||
|
||
pcm_land(j,"urban") = i34_urban_area("y1995",j); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
*** | (C) 2008-2021 Potsdam Institute for Climate Impact Research (PIK) | ||
*** | authors, and contributors see CITATION.cff file. This file is part | ||
*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of | ||
*** | AGPL-3.0, you are granted additional permissions described in the | ||
*** | MAgPIE License Exception, version 1.0 (see LICENSE file). | ||
*** | Contact: magpie@pik-potsdam.de | ||
|
||
vm_carbon_stock.fx(j,"urban",c_pools) = 0; | ||
*' Biodiversity value (BV) | ||
vm_bv.fx(j,"urban", potnatveg) = pcm_land(j,"urban") * fm_bii_coeff("urban",potnatveg) * fm_luh2_side_layers(j,potnatveg); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is exisiting code, but all these biodiv variable names are quite cryptic... no idea what side-layers should mean, and bv=biodiv is not clear, and bii is also only clear to insiders... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, there is room for improvement. Also the "Bending the curve" paper should be added as reference. But this should be done as part of a dedicated PR, not as part of this PR. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
*** | (C) 2008-2021 Potsdam Institute for Climate Impact Research (PIK) | ||
*** | authors, and contributors see CITATION.cff file. This file is part | ||
*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of | ||
*** | AGPL-3.0, you are granted additional permissions described in the | ||
*** | MAgPIE License Exception, version 1.0 (see LICENSE file). | ||
*** | Contact: magpie@pik-potsdam.de | ||
|
||
*' @description Urban Land based on LUH2v2 (Hurtt 2020) cellular (0.5 degree) input dataset, varying with SSP. | ||
*' Cellular level is prescribed via a very high punishment term for deviating from original input values. | ||
*' Regional sums of urban land must add be equal for both model and input data. | ||
|
||
*' @limitations Urban land is exogenous and does not interact with other model dynamics, except for reducing available non-urban land pool. | ||
*' Cellular urban land may not exactly match input data due to other land needs in the same cell. | ||
|
||
*####################### R SECTION START (PHASES) ############################## | ||
$Ifi "%phase%" == "declarations" $include "./modules/34_urban/exo_nov21/declarations.gms" | ||
$Ifi "%phase%" == "input" $include "./modules/34_urban/exo_nov21/input.gms" | ||
$Ifi "%phase%" == "equations" $include "./modules/34_urban/exo_nov21/equations.gms" | ||
$Ifi "%phase%" == "preloop" $include "./modules/34_urban/exo_nov21/preloop.gms" | ||
$Ifi "%phase%" == "presolve" $include "./modules/34_urban/exo_nov21/presolve.gms" | ||
$Ifi "%phase%" == "postsolve" $include "./modules/34_urban/exo_nov21/postsolve.gms" | ||
*######################## R SECTION END (PHASES) ############################### |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
*** | (C) 2008-2021 Potsdam Institute for Climate Impact Research (PIK) | ||
*** | authors, and contributors see CITATION.cff file. This file is part | ||
*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of | ||
*** | AGPL-3.0, you are granted additional permissions described in the | ||
*** | MAgPIE License Exception, version 1.0 (see LICENSE file). | ||
*** | Contact: magpie@pik-potsdam.de | ||
|
||
|
||
positive variables | ||
vm_cost_urban(j) Technical adjustment cost | ||
; | ||
|
||
*#################### R SECTION START (OUTPUT DECLARATIONS) #################### | ||
parameters | ||
ov_cost_urban(t,j,type) Technical adjustment cost | ||
; | ||
*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# | (C) 2008-2021 Potsdam Institute for Climate Impact Research (PIK) | ||
# | authors, and contributors see CITATION.cff file. This file is part | ||
# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of | ||
# | AGPL-3.0, you are granted additional permissions described in the | ||
# | MAgPIE License Exception, version 1.0 (see LICENSE file). | ||
# | Contact: magpie@pik-potsdam.de | ||
|
||
name,type,reason | ||
sm_fix_SSP2, input, not needed |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### | ||
ov_cost_urban(t,j,"marginal") = vm_cost_urban.m(j); | ||
ov_cost_urban(t,j,"level") = vm_cost_urban.l(j); | ||
ov_cost_urban(t,j,"upper") = vm_cost_urban.up(j); | ||
ov_cost_urban(t,j,"lower") = vm_cost_urban.lo(j); | ||
*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe 1e+5 is sufficient. Not sure whether high costs are good (punishmnet) or bad (scaling9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strange name "s10_cost_balance"; shouldnt it be rather "s10_punishment_area_deviation" or something like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not one of my changes. It is just a renaming of the unit, I think it comes from Florian's branch when i cloned it.