Skip to content

Commit

Permalink
Create new Biodiv default realization with RR layer
Browse files Browse the repository at this point in the history
  • Loading branch information
jansteinhauser committed Apr 8, 2024
1 parent d600367 commit 174c29a
Show file tree
Hide file tree
Showing 14 changed files with 251 additions and 14 deletions.
7 changes: 4 additions & 3 deletions config/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -1195,9 +1195,10 @@ cfg$gms$water_availability <- "total_water_aug13" # def = total_water_aug13
cfg$gms$c43_watavail_scenario <- "cc" # def = "cc"

# ***------------------------- 44_biodiversity ------------------------------
# * (bii_target): Biodiversity Intactness Index (BII) for 71 biomes with the option to define a lower bound for BII at biome level
# * (bii_target_apr24): Biodiversity Intactness Index (BII) for 71 biomes with the option to define a lower bound for BII at biome level, including range-rarity weighting
# * (bii_target): Biodiversity Intactness Index (BII) for 71 biomes with the option to define a lower bound for BII at biome level, without range-rarity weighting
# * (bv_btc_mar21): Global optimization of range-rarity weighted biodiversity stocks based on a price for losses and gains
cfg$gms$biodiversity <- "bii_target" # def = bii_target
cfg$gms$biodiversity <- "bii_target_apr24" # def = bii_target_apr24

# * Start year for linear increase towards BII target value (in bii_target) or biodiversity target price (in bv_btc_mar21)
cfg$gms$s44_start_year <- 2025 #def = 2025
Expand Down Expand Up @@ -1756,7 +1757,7 @@ cfg$gms$s60_2ndgen_bioenergy_dem_min_post_fix <- 1 # def = 1
# * (1stgen_priced_dec18): c60_bioenergy_subsidy is applied constant over historic and model horizon, c60_bioenergy_subsidy_fix_SSP2 has no effect
# * (1st2ndgen_priced_feb24): c60_bioenergy_subsidy_fix_SSP2 is applied constant to historic time steps (up until sm_fix_SSP2).
# * c60_bioenergy_subsidy is applied constant to model horizon (after sm_fix_SSP2)
# * If GJ-based prices are used (setting below), c60_bioenergy_subsidy should be set to 0
# * If GJ-based prices are used (setting below), c60_bioenergy_subsidy should be set to 0.
cfg$gms$c60_bioenergy_subsidy <- 300 # def = 300
cfg$gms$c60_bioenergy_subsidy_fix_SSP2 <- 300 # def = 300

Expand Down
3 changes: 1 addition & 2 deletions modules/44_biodiversity/bii_target/equations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
*' @equations

*' The Biodiversity Intactness Index (BII) is calculated at the level of 71 biomes.
*' Biodiversity stock weighted by range-rarity restoration prioritization layer (`f44_rr_layer`)
*' The regional layer is needed for compatibility with the high resolution parallel optimization output script (scripts/output/extra/highres.R)

q44_bii(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)) > 0) .. v44_bii(i2,biome44)
=e=
(sum((cell(i2,j2),potnatveg,landcover44), vm_bv(j2,landcover44,potnatveg) * f44_rr_layer(j2) * f44_biome(j2,biome44)) / sum((cell(i2,j2),land), pcm_land(j2,land) * f44_rr_layer(j2) * f44_biome(j2,biome44)));
(sum((cell(i2,j2),potnatveg,landcover44), vm_bv(j2,landcover44,potnatveg) * f44_biome(j2,biome44)) / sum((cell(i2,j2),land), pcm_land(j2,land) * f44_biome(j2,biome44)));

*' For each of the 71 biomes, the BII has to meet a minium level based on `s44_bii_lower_bound`.
*' `v44_bii_missing` is a technical variable to maintain feasibility in case `v44_bii` cannot be increased.
Expand Down
8 changes: 0 additions & 8 deletions modules/44_biodiversity/bii_target/input.gms
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,3 @@ $ondelim
$include "./modules/44_biodiversity/bii_target/input/biorealm_biome.cs3"
$offdelim
;

parameters
f44_rr_layer(j) Range-rarity restoration prioritization layer (unitless)
/
$ondelim
$include "./modules/44_biodiversity/bii_target/input/rr_layer.cs2"
$offdelim
/
1 change: 0 additions & 1 deletion modules/44_biodiversity/bii_target/input/files
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
* list of files that are required here
f44_bii_coeff.cs3
biorealm_biome.cs3
rr_layer.cs2
40 changes: 40 additions & 0 deletions modules/44_biodiversity/bii_target_apr24/declarations.gms
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
*** | (C) 2008-2023 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: [email protected]


positive variables
vm_cost_bv_loss(j) Biodiversity cost (mio USD)
vm_bv(j,landcover44,potnatveg) Biodiversity stock for all land cover classes (Mha)
v44_bii(i,biome44) Biodiversity Intactness Index BII (1)
v44_bii_missing(i,biome44) Missing BII increase for compliance with BII target (1)
;

parameters
p44_bii_lower_bound(t,i,biome44) Interpolated lower bound for BII over time (1)
p44_start_value(i,biome44) Start value for BII lower bound (1)
p44_target_value(i,biome44) Target value for BII lower bound (1)
;

equations
q44_bii(i,biome44) Biodiversity Intactness Index BII (1)
q44_bii_target(i,biome44) Missing BII increase for compliance with BII target (1)
q44_cost(i) Biodiversity cost (mio USD)
;


*#################### R SECTION START (OUTPUT DECLARATIONS) ####################
parameters
ov_cost_bv_loss(t,j,type) Biodiversity cost (mio USD)
ov_bv(t,j,landcover44,potnatveg,type) Biodiversity stock for all land cover classes (Mha)
ov44_bii(t,i,biome44,type) Biodiversity Intactness Index BII (1)
ov44_bii_missing(t,i,biome44,type) Missing BII increase for compliance with BII target (1)
oq44_bii(t,i,biome44,type) Biodiversity Intactness Index BII (1)
oq44_bii_target(t,i,biome44,type) Missing BII increase for compliance with BII target (1)
oq44_cost(t,i,type) Biodiversity cost (mio USD)
;
*##################### R SECTION END (OUTPUT DECLARATIONS) #####################

28 changes: 28 additions & 0 deletions modules/44_biodiversity/bii_target_apr24/equations.gms
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
*** | (C) 2008-2023 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: [email protected]

*' @equations

*' The Biodiversity Intactness Index (BII) is calculated at the level of 71 biomes.
*' Biodiversity stock weighted by range-rarity restoration prioritization layer (`f44_rr_layer`)
*' The regional layer is needed for compatibility with the high resolution parallel optimization output script (scripts/output/extra/highres.R)

q44_bii(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)) > 0) .. v44_bii(i2,biome44)
=e=
(sum((cell(i2,j2),potnatveg,landcover44), vm_bv(j2,landcover44,potnatveg) * f44_rr_layer(j2) * f44_biome(j2,biome44)) / sum((cell(i2,j2),land), pcm_land(j2,land) * f44_rr_layer(j2) * f44_biome(j2,biome44)));

*' For each of the 71 biomes, the BII has to meet a minium level based on `s44_bii_lower_bound`.
*' `v44_bii_missing` is a technical variable to maintain feasibility in case `v44_bii` cannot be increased.

q44_bii_target(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)) > 0) ..
v44_bii(i2,biome44) + v44_bii_missing(i2,biome44) =g= sum(ct, p44_bii_lower_bound(ct,i2,biome44));

*' Costs accrue only for `v44_bii_missing`. In the best case costs should be zero or close to zero.
*' Costs strongly depend on the choice of `s44_bii_lower_bound`.

q44_cost(i2) .. sum(cell(i2,j2), vm_cost_bv_loss(j2)) =e=
sum(biome44, v44_bii_missing(i2,biome44)) * s44_cost_bii_missing;
35 changes: 35 additions & 0 deletions modules/44_biodiversity/bii_target_apr24/input.gms
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
*** | (C) 2008-2023 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: [email protected]

scalars
s44_bii_lower_bound Lower bound for BII (1) / 0 /
c44_bii_decrease Implementation of lower bound for BII (binary) / 1 /
s44_target_year Year in which the BII lower bound is reached (1) / 2100 /
s44_start_year Start year for interpolation towards BII lower bound (1) / 2025 /
s44_cost_bii_missing Technical costs for missing BII increase (USD per unit of BII) / 1000000 /
;


table fm_bii_coeff(bii_class44,potnatveg) Biodiversity Intactness Index coefficients (unitless)
$ondelim
$include "./modules/44_biodiversity/bii_target/input/f44_bii_coeff.cs3"
$offdelim
;

table f44_biome(j,biome44) Share of biome type in each spatial unit (1)
$ondelim
$include "./modules/44_biodiversity/bii_target/input/biorealm_biome.cs3"
$offdelim
;

parameters
f44_rr_layer(j) Range-rarity restoration prioritization layer (unitless)
/
$ondelim
$include "./modules/44_biodiversity/bii_target/input/rr_layer.cs2"
$offdelim
/
4 changes: 4 additions & 0 deletions modules/44_biodiversity/bii_target_apr24/input/files
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* list of files that are required here
f44_bii_coeff.cs3
biorealm_biome.cs3
rr_layer.cs2
38 changes: 38 additions & 0 deletions modules/44_biodiversity/bii_target_apr24/postsolve.gms
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
*** | (C) 2008-2023 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: [email protected]

*#################### R SECTION START (OUTPUT DEFINITIONS) #####################
ov_cost_bv_loss(t,j,"marginal") = vm_cost_bv_loss.m(j);
ov_bv(t,j,landcover44,potnatveg,"marginal") = vm_bv.m(j,landcover44,potnatveg);
ov44_bii(t,i,biome44,"marginal") = v44_bii.m(i,biome44);
ov44_bii_missing(t,i,biome44,"marginal") = v44_bii_missing.m(i,biome44);
oq44_bii(t,i,biome44,"marginal") = q44_bii.m(i,biome44);
oq44_bii_target(t,i,biome44,"marginal") = q44_bii_target.m(i,biome44);
oq44_cost(t,i,"marginal") = q44_cost.m(i);
ov_cost_bv_loss(t,j,"level") = vm_cost_bv_loss.l(j);
ov_bv(t,j,landcover44,potnatveg,"level") = vm_bv.l(j,landcover44,potnatveg);
ov44_bii(t,i,biome44,"level") = v44_bii.l(i,biome44);
ov44_bii_missing(t,i,biome44,"level") = v44_bii_missing.l(i,biome44);
oq44_bii(t,i,biome44,"level") = q44_bii.l(i,biome44);
oq44_bii_target(t,i,biome44,"level") = q44_bii_target.l(i,biome44);
oq44_cost(t,i,"level") = q44_cost.l(i);
ov_cost_bv_loss(t,j,"upper") = vm_cost_bv_loss.up(j);
ov_bv(t,j,landcover44,potnatveg,"upper") = vm_bv.up(j,landcover44,potnatveg);
ov44_bii(t,i,biome44,"upper") = v44_bii.up(i,biome44);
ov44_bii_missing(t,i,biome44,"upper") = v44_bii_missing.up(i,biome44);
oq44_bii(t,i,biome44,"upper") = q44_bii.up(i,biome44);
oq44_bii_target(t,i,biome44,"upper") = q44_bii_target.up(i,biome44);
oq44_cost(t,i,"upper") = q44_cost.up(i);
ov_cost_bv_loss(t,j,"lower") = vm_cost_bv_loss.lo(j);
ov_bv(t,j,landcover44,potnatveg,"lower") = vm_bv.lo(j,landcover44,potnatveg);
ov44_bii(t,i,biome44,"lower") = v44_bii.lo(i,biome44);
ov44_bii_missing(t,i,biome44,"lower") = v44_bii_missing.lo(i,biome44);
oq44_bii(t,i,biome44,"lower") = q44_bii.lo(i,biome44);
oq44_bii_target(t,i,biome44,"lower") = q44_bii_target.lo(i,biome44);
oq44_cost(t,i,"lower") = q44_cost.lo(i);
*##################### R SECTION END (OUTPUT DEFINITIONS) ######################

14 changes: 14 additions & 0 deletions modules/44_biodiversity/bii_target_apr24/preloop.gms
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
*** | (C) 2008-2023 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: [email protected]

v44_bii.l(i,biome44) = 0.75;

v44_bii.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)) = 0) = 0;
v44_bii_missing.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)) = 0) = 0;
p44_bii_lower_bound(t,i,biome44) = 0;

vm_bv.l(j,landcover44,potnatveg) = 0;
29 changes: 29 additions & 0 deletions modules/44_biodiversity/bii_target_apr24/presolve.gms
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
*** | (C) 2008-2023 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: [email protected]

if(m_year(t) = s44_start_year,
* The start value for the linear interpolation is the BII at biome level in the start year.
p44_start_value(i,biome44) = v44_bii.l(i,biome44);
* The target value for the linear interpolation is the lower bound defined in `s44_bii_lower_bound`.
p44_target_value(i,biome44) = s44_bii_lower_bound;

* Linear increase of BII target values at biome level from start year to target year, and constant values thereafter.
p44_bii_lower_bound(t2,i,biome44) = p44_start_value(i,biome44) + ((m_year(t2) - s44_start_year) / (s44_target_year - s44_start_year)) * (p44_target_value(i,biome44) - p44_start_value(i,biome44));
p44_bii_lower_bound(t2,i,biome44)$(m_year(t2) > s44_target_year) = p44_target_value(i,biome44);
if(c44_bii_decrease = 0,
p44_bii_lower_bound(t2,i,biome44)$(v44_bii.l(i,biome44) >= p44_target_value(i,biome44)) = v44_bii.l(i,biome44);
elseif c44_bii_decrease = 1,
p44_bii_lower_bound(t2,i,biome44)$(v44_bii.l(i,biome44) >= p44_target_value(i,biome44)) = p44_target_value(i,biome44);
);
p44_bii_lower_bound(t2,i,biome44)$(p44_bii_lower_bound(t2,i,biome44) >= 1) = 1;
p44_bii_lower_bound(t2,i,biome44)$(m_year(t2) < s44_start_year) = 0;
p44_bii_lower_bound(t2,i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)) = 0) = 0;
* The lower bound of `v44_bii` is set to `p44_bii_lower_bound` to avoid a reduction of BII in combination with `v44_bii_missing`.
v44_bii.lo(i,biome44) = p44_bii_lower_bound(t,i,biome44);
display p44_bii_lower_bound;
);

25 changes: 25 additions & 0 deletions modules/44_biodiversity/bii_target_apr24/realization.gms
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
*** | (C) 2008-2023 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: [email protected]

*' @description In this realisation, the Biodiversity Intactness Index (BII) is
*' calculated separately for each biome type of each biogeographic realm, which results in 71 different spatial units (@olson_biome_2001).
*' The BII is a relative indicator, wich measures the intactness of local species assemblages (species richness)
*' compared to a reference state (space-for-time approach) (@purvis_chapter_2018).
*' The implementation uses the BII coefficients described in @leclere_biodiv_2018 and @leclere_bending_2020.
*' The realisation allows to set a lower bound for the BII in the future, based on an annual growth rate.

*' @limitations

*####################### R SECTION START (PHASES) ##############################
$Ifi "%phase%" == "sets" $include "./modules/44_biodiversity/bii_target_apr24/sets.gms"
$Ifi "%phase%" == "declarations" $include "./modules/44_biodiversity/bii_target_apr24/declarations.gms"
$Ifi "%phase%" == "input" $include "./modules/44_biodiversity/bii_target_apr24/input.gms"
$Ifi "%phase%" == "equations" $include "./modules/44_biodiversity/bii_target_apr24/equations.gms"
$Ifi "%phase%" == "preloop" $include "./modules/44_biodiversity/bii_target_apr24/preloop.gms"
$Ifi "%phase%" == "presolve" $include "./modules/44_biodiversity/bii_target_apr24/presolve.gms"
$Ifi "%phase%" == "postsolve" $include "./modules/44_biodiversity/bii_target_apr24/postsolve.gms"
*######################## R SECTION END (PHASES) ###############################
32 changes: 32 additions & 0 deletions modules/44_biodiversity/bii_target_apr24/sets.gms
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
*** | (C) 2008-2023 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: [email protected]

sets

landcover44 land cover classes used in bii calculation
/ crop_ann, crop_per, manpast, rangeland, urban, aff_ndc, aff_co2p, primforest, secdforest, other, plant /

bii_class44 bii coefficent land cover classes
/ crop_ann, crop_per, manpast, rangeland, urban, primary, secd_mature, secd_young, timber /

bii_class_secd(bii_class44) bii coefficent land cover classes secondary vegetation
/ secd_mature, secd_young /

ac_to_bii_class_secd(ac,bii_class_secd) Mapping between forest ageclasses and bii coefficent land cover classes
/ (ac0,ac5,ac10,ac15,ac20,ac25,ac30) . (secd_young)
(ac35,ac40,ac45,ac50,ac55,ac60,
ac65,ac70,ac75,ac80,ac85,ac90,
ac95,ac100,ac105,ac110,ac115,
ac120,ac125,ac130,ac135,ac140,
ac145,ac150,ac155,acx) . (secd_mature) /

biome44 biomes
/ AA1,AA2,AA4,AA7,AA8,AA10,AA11,AA14,AN11,AT1,AT2,AT7,AT8,AT9,AT10,AT12,AT13,AT14,IM1,
IM2,NA4,IM3,IM13,IM14,NA3,NA8,NA11,IM4,IM5,IM7,IM9,IM10,NT2,NA13,NT1,NT9,NT98,NT99,
OC1,OC2,OC7,NT3,NT4,NT7,NT8,NT10,NT12,NT13,NT14,PA11,PA12,PA13,NA5,PA1,PA4,PA5,PA6,
PA8,PA9,PA10,AN99,AT98,NA2,NA6,NA7,NA12,NA99,PA98,PA99,AA12,AA13 /
;
1 change: 1 addition & 0 deletions modules/44_biodiversity/module.gms
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@

*###################### R SECTION START (MODULETYPES) ##########################
$Ifi "%biodiversity%" == "bii_target" $include "./modules/44_biodiversity/bii_target/realization.gms"
$Ifi "%biodiversity%" == "bii_target_apr24" $include "./modules/44_biodiversity/bii_target_apr24/realization.gms"
$Ifi "%biodiversity%" == "bv_btc_mar21" $include "./modules/44_biodiversity/bv_btc_mar21/realization.gms"
*###################### R SECTION END (MODULETYPES) ############################

0 comments on commit 174c29a

Please sign in to comment.