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

MAgPIE release 4.9.1 #770

Merged
merged 66 commits into from
Jan 31, 2025
Merged
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
869b9ed
merge master into develop
pascal-sauer Dec 6, 2024
4623164
Merge pull request #757 from pascal-sauer/develop
pascal-sauer Dec 6, 2024
624d2d1
FSEC AMTs one folder per scenario, inputdelete spamplots
pascal-sauer Dec 9, 2024
2b8f0d3
Merge branch 'develop' of https://github.com/magpiemodel/magpie into …
pascal-sauer Dec 9, 2024
02fe329
Merge pull request #758 from pascal-sauer/develop
pascal-sauer Dec 10, 2024
76e251d
automatic peatland allocation during SEALS downscaling
pvjeetze Dec 12, 2024
2e53021
changelog
pvjeetze Dec 12, 2024
255fd28
input file fix
pvjeetze Dec 12, 2024
4bb6050
modified rewetting criterion
pvjeetze Dec 13, 2024
85b6902
additional fixes
pvjeetze Dec 13, 2024
794e636
file path fix
pvjeetze Dec 13, 2024
cd11062
bugfix BII
flohump Dec 13, 2024
bec50ed
test
flohump Dec 14, 2024
a8299bf
update scaling
flohump Dec 14, 2024
6846f7a
test
flohump Dec 14, 2024
9b3a59c
revert
flohump Dec 14, 2024
55f248b
cleanup
flohump Dec 14, 2024
b3a7ba7
bugfix
flohump Dec 14, 2024
043e72a
bugfix
flohump Dec 14, 2024
0a68dcf
bugfix
flohump Dec 14, 2024
fb8fe70
lock_timeout
flohump Dec 14, 2024
9f0e4a0
Merge pull request #759 from pvjeetze/f_mag-seals
pvjeetze Dec 17, 2024
72dffb6
increase R package versions
flohump Dec 20, 2024
d0e13f2
Merge pull request #760 from flohump/f_fixBII
flohump Dec 20, 2024
3a48f3f
mitiConsv start script
pvjeetze Jan 6, 2025
297d3b7
changelog
pvjeetze Jan 6, 2025
223bb0a
scenario config
pvjeetze Jan 6, 2025
f593ccc
fixes
pvjeetze Jan 6, 2025
c077dff
removed commented code
pvjeetze Jan 6, 2025
e07076b
additional fix
pvjeetze Jan 6, 2025
c2e7928
Update scripts/start/projects/paper_MitiConsv.R
pvjeetze Jan 6, 2025
07e0460
fixes
pvjeetze Jan 6, 2025
6aae0c1
Merge branch 'f_MitiConsv' of https://github.com/pvjeetze/magpie into…
pvjeetze Jan 6, 2025
446c189
renamed Aff to AR
pvjeetze Jan 6, 2025
1d84279
update path in EL2 start scripts
FelicitasBeier Jan 7, 2025
c17458b
Merge branch 'DeepDive_Develop' of github.com:FelicitasBeier/magpie i…
FelicitasBeier Jan 7, 2025
953319d
avoid duplication of path
FelicitasBeier Jan 7, 2025
ff1eba7
further simplifications
pvjeetze Jan 7, 2025
d611a9d
empty lines
pvjeetze Jan 7, 2025
11f3222
more empty lines
pvjeetze Jan 7, 2025
9161484
Merge pull request #761 from pvjeetze/f_MitiConsv
pvjeetze Jan 8, 2025
2b19c89
calibration and coupled NPI fixes
pvjeetze Jan 13, 2025
0a644fb
Merge pull request #763 from pvjeetze/f_MitiConsv
pvjeetze Jan 13, 2025
33bdb32
bugfix
pvjeetze Jan 13, 2025
49aeb4a
change order
pvjeetze Jan 13, 2025
183c89c
Merge pull request #764 from pvjeetze/f_MitiConsv
pvjeetze Jan 14, 2025
68fd7b7
updated c30_bioen_water setting and added sensitivity for PB Deep Div…
FelicitasBeier Jan 16, 2025
0cae50d
Merge pull request #762 from FelicitasBeier/DeepDive_Develop
pascal-sauer Jan 17, 2025
3d433ba
start script to be run on release
pascal-sauer Jan 17, 2025
11ee8bf
fixes start script
pvjeetze Jan 17, 2025
9fffc09
calibration added to scenario config
pvjeetze Jan 20, 2025
c830370
calibration update
pvjeetze Jan 20, 2025
39539c3
minimal changes
pascal-sauer Jan 22, 2025
5087b78
changelog
pascal-sauer Jan 22, 2025
fb39ad6
Merge pull request #765 from pascal-sauer/develop
pascal-sauer Jan 22, 2025
7a3aeed
intermediate update
pvjeetze Jan 22, 2025
b002590
changed land conversion cost calib defaults
pvjeetze Jan 22, 2025
f3115dc
calib restart false
pvjeetze Jan 22, 2025
e7f3ba4
unnecessary line
pvjeetze Jan 22, 2025
056dd02
shortened scenario names
pvjeetze Jan 23, 2025
6588a30
update start script
pvjeetze Jan 27, 2025
ccb6b2c
minor fix
pvjeetze Jan 27, 2025
267ac50
Merge pull request #766 from pvjeetze/f_MitiConsv
pvjeetze Jan 28, 2025
6bcb1a4
magpie release 4.9.1
pascal-sauer Jan 28, 2025
54bad42
clarify fsec in test runs
pascal-sauer Jan 28, 2025
47de031
new renv version
pascal-sauer Jan 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cleanup
  • Loading branch information
flohump committed Dec 14, 2024
commit 55f248b4fba4ef023b4802352342bcce4fa314a7
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
-

### fixed
-
- **44_biodiversity** bugfix i44_biome_share, code cleanup, added scaling of `q44_bii`

## [4.9.0] - 2024-12-05

1 change: 0 additions & 1 deletion modules/44_biodiversity/bii_target/declarations.gms
Original file line number Diff line number Diff line change
@@ -16,7 +16,6 @@ positive variables
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)
i44_biome_share(j,biome44) Share of biome type in each spatial unit (1)
i44_biome_area_reg(i,biome44) Area of range-rarity weighted biome type in each region (mio. ha)
;
4 changes: 2 additions & 2 deletions modules/44_biodiversity/bii_target/equations.gms
Original file line number Diff line number Diff line change
@@ -13,13 +13,13 @@
q44_bii(i2,biome44)$(i44_biome_area_reg(i2,biome44) > 0) ..
v44_bii(i2,biome44)
=e=
sum((cell(i2,j2),potnatveg,landcover44), vm_bv(j2,landcover44,potnatveg) * i44_biome_share(j2,biome44))
sum((cell(i2,j2),landcover44,potnatveg), vm_bv(j2,landcover44,potnatveg) * i44_biome_share(j2,biome44))
/ i44_biome_area_reg(i2,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)$(i44_biome_area_reg(i2,biome44) > 0) ..
q44_bii_target(i2,biome44) ..
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.
9 changes: 5 additions & 4 deletions modules/44_biodiversity/bii_target/preloop.gms
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
*** | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK)
*** | (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: magpie@pik-potsdam.de

* Calculate biome share
i44_biome_share(j,biome44) =
(f44_biome_area(j,biome44) + 1e-10) / sum(biome44_2, f44_biome_area(j,biome44_2) + 1e-10);
i44_biome_share(j,biome44) = 0;
i44_biome_share(j,biome44)$(sum(biome44_2, f44_biome_area(j,biome44_2)) > 0) =
f44_biome_area(j,biome44) / sum(biome44_2, f44_biome_area(j,biome44_2));

* Set i44_biome_area_reg
i44_biome_area_reg(i,biome44) =
sum((cell(i,j),land), pcm_land(j,land) * i44_biome_share(j,biome44));
sum((cell(i,j),land), pcm_land(j,land) * f44_rr_layer(j) * i44_biome_share(j,biome44));

p44_bii_lower_bound(t,i,biome44) = 0;
31 changes: 15 additions & 16 deletions modules/44_biodiversity/bii_target/presolve.gms
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*** | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK)
*** | (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
@@ -13,32 +13,31 @@ loop(i,
v44_bii_missing.fx(i,biome44) = 0;
else
v44_bii.l(i,biome44) =
sum((cell(i,j),potnatveg,landcover44), vm_bv.l(j,landcover44,potnatveg) * i44_biome_share(j,biome44))
sum((cell(i,j),landcover44,potnatveg), vm_bv.l(j,landcover44,potnatveg) * f44_rr_layer(j) * i44_biome_share(j,biome44))
/ i44_biome_area_reg(i,biome44);
);
);
);

if (m_year(t) = s44_start_year AND s44_bii_lower_bound > 0,
* The start value for the linear interpolation is the BII at biome level in the start year.
p44_start_value(i,biome44)$(m_year(t) = s44_start_year) = v44_bii.l(i,biome44);
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)) * (s44_bii_lower_bound - p44_start_value(i,biome44));
p44_bii_lower_bound(t2,i,biome44)$(m_year(t2) > s44_target_year) = s44_bii_lower_bound;
* Avoid implausible values
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)$(i44_biome_area_reg(i,biome44) <= 0) = 0;
);

if (m_year(t) <= sm_fix_SSP2,
v44_bii.lo(i,biome44) = 0;
else
* 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);
v44_bii.lo(i,biome44) = p44_bii_lower_bound(t,i,biome44);
if(c44_bii_decrease = 0,
p44_bii_lower_bound(t,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(t,i,biome44)$(v44_bii.l(i,biome44) >= p44_target_value(i,biome44)) = p44_target_value(i,biome44);
v44_bii.lo(i,biome44)$(v44_bii.l(i,biome44) >= s44_bii_lower_bound) = v44_bii.l(i,biome44);
);
p44_bii_lower_bound(t,i,biome44)$(p44_bii_lower_bound(t,i,biome44) >= 1) = 1;
p44_bii_lower_bound(t,i,biome44)$(m_year(t) < s44_start_year) = 0;
p44_bii_lower_bound(t,i,biome44)$(i44_biome_area_reg(i,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;
);

1 change: 1 addition & 0 deletions modules/44_biodiversity/bii_target/realization.gms
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ $Ifi "%phase%" == "sets" $include "./modules/44_biodiversity/bii_target/sets.gms
$Ifi "%phase%" == "declarations" $include "./modules/44_biodiversity/bii_target/declarations.gms"
$Ifi "%phase%" == "input" $include "./modules/44_biodiversity/bii_target/input.gms"
$Ifi "%phase%" == "equations" $include "./modules/44_biodiversity/bii_target/equations.gms"
$Ifi "%phase%" == "scaling" $include "./modules/44_biodiversity/bii_target/scaling.gms"
$Ifi "%phase%" == "preloop" $include "./modules/44_biodiversity/bii_target/preloop.gms"
$Ifi "%phase%" == "presolve" $include "./modules/44_biodiversity/bii_target/presolve.gms"
$Ifi "%phase%" == "postsolve" $include "./modules/44_biodiversity/bii_target/postsolve.gms"
8 changes: 8 additions & 0 deletions modules/44_biodiversity/bii_target/scaling.gms
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*** | (C) 2008-2024 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

q44_bii.scale(i,biome44) = 1e10;