Skip to content

Commit

Permalink
Merge pull request #745 from flohump/f_fixOpti
Browse files Browse the repository at this point in the history
follow-up fix for PR744
  • Loading branch information
flohump authored Nov 15, 2024
2 parents d785b7f + 3bb99fc commit 408e5a8
Show file tree
Hide file tree
Showing 50 changed files with 292 additions and 195 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### added
- **62_material** added switch to turn off future material demand for bioplastic
- **config** added SSP1-POP-GDP SSP2-POP-GDP and SSP5-POP-GDP
- **modules[29-35]** added initial values for ov_bv for better starting point

### removed
-
Expand All @@ -31,8 +32,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- **scripts** script/output/extra/resubmit.R
- **28_ageclass** bugfix input data unit and code clean-up. Renamed `feb21` realization to `oct24`
- **70_livestock** bugfix scaling.gms file in wrong folder
- **10_land** bugfix land transition matrix for improved feasibility (variables and parameters have different accuracy)
- **44_biodiversity** avoid division by zero and improved consistency between realisations for fixing variables
- **10_land** Simplified land transition matrix for improved feasibility
- **44_biodiversity** bugfix biorealm_biome.cs3 in input data (shares did not add-up to 1)

## [4.8.2] - 2024-09-24

Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Imports:
m4fsdp,
madrat,
magclass (>= 6.14.0),
magpie4 (>= 2.13.9),
magpie4 (>= 2.15.1),
MagpieNCGains,
magpiesets (>= 0.46.1),
mip,
Expand Down
13 changes: 3 additions & 10 deletions config/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ cfg$model <- "main.gms" #def = "main.gms"
#### input settings ####

# which input data sets should be used?
cfg$input <- c(regional = "rev4.115_h12_magpie.tgz",
cellular = "rev4.115_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz",
validation = "rev4.115_h12_validation.tgz",
cfg$input <- c(regional = "rev4.116_h12_magpie.tgz",
cellular = "rev4.116_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz",
validation = "rev4.116_h12_validation.tgz",
additional = "additional_data_rev4.57.tgz",
calibration = "calibration_H12_27Sep24.tgz")

Expand Down Expand Up @@ -206,13 +206,6 @@ cfg$gms$sm_fix_cc <- 2025
# * (landmatrix_dec18): includes a land transition matrix
cfg$gms$land <- "landmatrix_dec18" # def = landmatrix_dec18

# * Artificial cost for balance variables (USD17MER per ha)
# * The balance variables in the land module avoid infeasibilities due to
# * differences in accuracy between parameters and variables in GAMS.
# * High costs make sure that the balance variables are only used as a last resort.
cfg$gms$s10_cost_balance <- 1e+06 # def = 1e+06


# ***--------------------- 11_costs ------ --------------------------------
# * (default): default cost realization
cfg$gms$costs <- "default" # def = default
Expand Down
2 changes: 1 addition & 1 deletion config/projects/scenario_config_el2.csv
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ gms$s15_exo_alcohol;1;1;1
gms$s15_alc_scen;0;0;0
gms$factor_costs;sticky_labor;sticky_labor;sticky_labor
gms$c70_feed_scen;ssp1;ssp2;ssp2
input['cellular'];rev4.115EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz;;
input['cellular'];rev4.116EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz;;
magicc_emis_scen;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif
6 changes: 3 additions & 3 deletions config/projects/scenario_config_fsec.csv
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ gms$s62_max_dem_bioplastic;0;;;;400;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gms$c70_fac_req_regr;reg;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gms$c70_feed_scen;;;;;;;;;;;;;;;;;;ssp1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gms$c73_build_demand;;;;;;;;;;;;;;;;;;;;;;;;50pc;;;;;;;;;;;;;;;;;;;;;;;;;;;
input['cellular'];rev4.115_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.115_FSEC_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.115_FSEC_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;;rev4.115_FSEC_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.115_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.115_FSEC_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.115_FSEC_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;;;
input['regional'];rev4.115_FSEC_magpie.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
input['validation'];rev4.115_FSEC_validation.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
input['cellular'];rev4.116_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.116_FSEC_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.116_FSEC_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;;rev4.116_FSEC_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.116_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.116_FSEC_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.116_FSEC_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;;;
input['regional'];rev4.116_FSEC_magpie.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
input['validation'];rev4.116_FSEC_validation.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
input['additional'];additional_data_rev4.57.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
input['calibration'];calibration_FSEC_27Sep24.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
magicc_emis_scen;bjoernAR6_C_SSP2-NDC.mif;;;bjoernAR6_C_SSP2-PkBudg900.mif;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;bjoernAR6_C_SSP1-NDC.mif;;;;;;;;;;;;bjoernAR6_C_RemSDP-900-MagSSP1.mif;;
2 changes: 1 addition & 1 deletion config/scenario_config.csv
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ gms$c60_biodem_level;;;;;;;;;;;;;;;;;;;;1;0;;;;;;;;;;;;
gms$c60_res_2ndgenBE_dem;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;sdp;ssp2;sdp;sdp;;;;;;;;;;;;;;;;;;;;
gms$c70_feed_scen;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp5;ssp1;ssp1;;;;;;;;;;;;;;;;;;;;
gms$s73_timber_demand_switch;;;;;;;;;;;;;;;;;;;;;;;;;1;1;0;;;;;;
input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.115_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.115_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.115_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.115_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.115_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.115_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz
input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.116_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.116_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.116_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.116_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.116_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.116_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz
38 changes: 19 additions & 19 deletions main.gms
Original file line number Diff line number Diff line change
Expand Up @@ -147,44 +147,44 @@ $title magpie
*' * Always try to access model outputs through the corresponding magpie package instead of accessing them directly with readGDX. It cannot be guaranteed that your script will work in the future if you do otherwise (as only the corresponding magpie package will be continuously adapted to changes in the GAMS code).

*##################### R SECTION START (VERSION INFO) ##########################
*
* Used data set: rev4.114_h12_magpie.tgz
*
* Used data set: rev4.116_h12_magpie.tgz
* md5sum: NA
* Repository: https://rse.pik-potsdam.de/data/magpie/public
*
* Used data set: rev4.114_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz
*
* Used data set: rev4.116_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz
* md5sum: NA
* Repository: https://rse.pik-potsdam.de/data/magpie/public
*
* Used data set: rev4.114_h12_validation.tgz
*
* Used data set: rev4.116_h12_validation.tgz
* md5sum: NA
* Repository: https://rse.pik-potsdam.de/data/magpie/public
*
* Used data set: additional_data_rev4.56.tgz
*
* Used data set: additional_data_rev4.57.tgz
* md5sum: NA
* Repository: https://rse.pik-potsdam.de/data/magpie/public
*
*
* Used data set: calibration_H12_27Sep24.tgz
* md5sum: NA
* Repository: https://rse.pik-potsdam.de/data/magpie/public
*
*
* Low resolution: c200
* High resolution: 0.5
*
*
* Total number of cells: 200
*
*
* Number of cells per region:
* CAZ CHA EUR IND JPN LAM MEA NEU OAS REF SSA USA
* 14 23 10 7 4 26 21 9 16 23 32 15
*
*
* Regionscode: 62eff8f7
*
*
* Regions data revision: 4.114
*
*
* lpj2magpie settings:
* * LPJmL data: MRI-ESM2-0:ssp370
* * Revision: 4.114
*
*
* aggregation settings:
* * Input resolution: 0.5
* * Output resolution: c200
Expand All @@ -193,10 +193,10 @@ $title magpie
* CAZ CHA EUR IND JPN LAM MEA NEU OAS REF SSA USA
* 14 23 10 7 4 26 21 9 16 23 32 15
* * Call: withCallingHandlers(expr, message = messageHandler, warning = warningHandler, error = errorHandler)
*
*
*
*
* Last modification (input data): Sun Oct 27 00:37:36 2024
*
*
*###################### R SECTION END (VERSION INFO) ###########################

$offupper
Expand Down
8 changes: 2 additions & 6 deletions modules/10_land/landmatrix_dec18/declarations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@ positive variables
vm_landreduction(j,land) Land reduction (mio. ha)
vm_cost_land_transition(j) Costs for lu transitions (mio. USD17MER per yr)
vm_lu_transitions(j,land_from,land_to) Land transitions between time steps (mio. ha)
v10_balance_positive(j,land_from) Balance variable for land transitions (mio. ha)
v10_balance_negative(j,land_from) Balance variable for land transitions (mio. ha)
;

equations
q10_transition_matrix(j) Land transition constraint cell area (mio. ha)
q10_land_area(j) Land transition constraint cell area (mio. ha)
q10_transition_to(j,land_to) Land transition constraint to (mio. ha)
q10_transition_from(j,land_from) Land transition constraint from (mio. ha)
q10_landexpansion(j,land_to) Land expansion constraint (mio. ha)
Expand All @@ -43,9 +41,7 @@ parameters
ov_landreduction(t,j,land,type) Land reduction (mio. ha)
ov_cost_land_transition(t,j,type) Costs for lu transitions (mio. USD17MER per yr)
ov_lu_transitions(t,j,land_from,land_to,type) Land transitions between time steps (mio. ha)
ov10_balance_positive(t,j,land_from,type) Balance variable for land transitions (mio. ha)
ov10_balance_negative(t,j,land_from,type) Balance variable for land transitions (mio. ha)
oq10_transition_matrix(t,j,type) Land transition constraint cell area (mio. ha)
oq10_land_area(t,j,type) Land transition constraint cell area (mio. ha)
oq10_transition_to(t,j,land_to,type) Land transition constraint to (mio. ha)
oq10_transition_from(t,j,land_from,type) Land transition constraint from (mio. ha)
oq10_landexpansion(t,j,land_to,type) Land expansion constraint (mio. ha)
Expand Down
25 changes: 10 additions & 15 deletions modules/10_land/landmatrix_dec18/equations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,22 @@

*' @equations

*' The following three equations describe the general structure of the land transition matrix.
*' The first equation defines the total amount of land to be constant over time.
*' The two balancing variables `v10_balance_positive` and `v10_balance_negative` are needed
*' to avoid technical infeasibilities due to small differences in accuracy between
*' variables and parameters in GAMS. The use of `v10_balance_positive` and
*' `v10_balance_negative` is minimized by putting a high cost factor on these variables
*' (`q10_cost`). In practice, `v10_balance_positive` and
*' `v10_balance_negative`should deviate from zero only in exceptional cases.

q10_transition_matrix(j2) ..
sum((land_from,land_to), vm_lu_transitions(j2,land_from,land_to)) =e=
sum(land, vm_land(j2,land));

*' This equation defines the total amount of land to be constant over time.

q10_land_area(j2) ..
sum(land, vm_land(j2,land)) =e=
sum(land, pcm_land(j2,land));

*' The following two equations describe the land transition matrix.

q10_transition_to(j2,land_to) ..
sum(land_from, vm_lu_transitions(j2,land_from,land_to)) =e=
vm_land(j2,land_to);

q10_transition_from(j2,land_from) ..
sum(land_to, vm_lu_transitions(j2,land_from,land_to)) =e=
vm_land.l(j2,land_from) + v10_balance_positive(j2,land_from) - v10_balance_negative(j2,land_from);
pcm_land(j2,land_from);

*' The following two equations calculate land expansion and land contraction based
*' on the above land transition matrix.
Expand All @@ -45,8 +41,7 @@

q10_cost(j2) ..
vm_cost_land_transition(j2) =e=
sum(land, vm_landexpansion(j2,land) + vm_landreduction(j2,land)) * 1
+ sum(land_from, v10_balance_positive(j2,land_from) + v10_balance_negative(j2,land_from)) * s10_cost_balance;
sum(land, vm_landexpansion(j2,land) + vm_landreduction(j2,land)) * 1;

*' The gross changes in land are calculated based on land expansion, land
*' contraction and land changes from within the modules [35_natveg]
Expand Down
4 changes: 0 additions & 4 deletions modules/10_land/landmatrix_dec18/input.gms
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
*** | MAgPIE License Exception, version 1.0 (see LICENSE file).
*** | Contact: [email protected]

scalars
s10_cost_balance Artificial cost for balance variable (USD17MER per ha) / 1e+06 /
;

table f10_land(t_ini10,j,land) Different land type areas (mio. ha)
$ondelim
$include "./modules/10_land/input/avl_land_t.cs3"
Expand Down
16 changes: 4 additions & 12 deletions modules/10_land/landmatrix_dec18/postsolve.gms
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ pcm_land(j,land) = vm_land.l(j,land);
ov_landreduction(t,j,land,"marginal") = vm_landreduction.m(j,land);
ov_cost_land_transition(t,j,"marginal") = vm_cost_land_transition.m(j);
ov_lu_transitions(t,j,land_from,land_to,"marginal") = vm_lu_transitions.m(j,land_from,land_to);
ov10_balance_positive(t,j,land_from,"marginal") = v10_balance_positive.m(j,land_from);
ov10_balance_negative(t,j,land_from,"marginal") = v10_balance_negative.m(j,land_from);
oq10_transition_matrix(t,j,"marginal") = q10_transition_matrix.m(j);
oq10_land_area(t,j,"marginal") = q10_land_area.m(j);
oq10_transition_to(t,j,land_to,"marginal") = q10_transition_to.m(j,land_to);
oq10_transition_from(t,j,land_from,"marginal") = q10_transition_from.m(j,land_from);
oq10_landexpansion(t,j,land_to,"marginal") = q10_landexpansion.m(j,land_to);
Expand All @@ -30,9 +28,7 @@ pcm_land(j,land) = vm_land.l(j,land);
ov_landreduction(t,j,land,"level") = vm_landreduction.l(j,land);
ov_cost_land_transition(t,j,"level") = vm_cost_land_transition.l(j);
ov_lu_transitions(t,j,land_from,land_to,"level") = vm_lu_transitions.l(j,land_from,land_to);
ov10_balance_positive(t,j,land_from,"level") = v10_balance_positive.l(j,land_from);
ov10_balance_negative(t,j,land_from,"level") = v10_balance_negative.l(j,land_from);
oq10_transition_matrix(t,j,"level") = q10_transition_matrix.l(j);
oq10_land_area(t,j,"level") = q10_land_area.l(j);
oq10_transition_to(t,j,land_to,"level") = q10_transition_to.l(j,land_to);
oq10_transition_from(t,j,land_from,"level") = q10_transition_from.l(j,land_from);
oq10_landexpansion(t,j,land_to,"level") = q10_landexpansion.l(j,land_to);
Expand All @@ -45,9 +41,7 @@ pcm_land(j,land) = vm_land.l(j,land);
ov_landreduction(t,j,land,"upper") = vm_landreduction.up(j,land);
ov_cost_land_transition(t,j,"upper") = vm_cost_land_transition.up(j);
ov_lu_transitions(t,j,land_from,land_to,"upper") = vm_lu_transitions.up(j,land_from,land_to);
ov10_balance_positive(t,j,land_from,"upper") = v10_balance_positive.up(j,land_from);
ov10_balance_negative(t,j,land_from,"upper") = v10_balance_negative.up(j,land_from);
oq10_transition_matrix(t,j,"upper") = q10_transition_matrix.up(j);
oq10_land_area(t,j,"upper") = q10_land_area.up(j);
oq10_transition_to(t,j,land_to,"upper") = q10_transition_to.up(j,land_to);
oq10_transition_from(t,j,land_from,"upper") = q10_transition_from.up(j,land_from);
oq10_landexpansion(t,j,land_to,"upper") = q10_landexpansion.up(j,land_to);
Expand All @@ -60,9 +54,7 @@ pcm_land(j,land) = vm_land.l(j,land);
ov_landreduction(t,j,land,"lower") = vm_landreduction.lo(j,land);
ov_cost_land_transition(t,j,"lower") = vm_cost_land_transition.lo(j);
ov_lu_transitions(t,j,land_from,land_to,"lower") = vm_lu_transitions.lo(j,land_from,land_to);
ov10_balance_positive(t,j,land_from,"lower") = v10_balance_positive.lo(j,land_from);
ov10_balance_negative(t,j,land_from,"lower") = v10_balance_negative.lo(j,land_from);
oq10_transition_matrix(t,j,"lower") = q10_transition_matrix.lo(j);
oq10_land_area(t,j,"lower") = q10_land_area.lo(j);
oq10_transition_to(t,j,land_to,"lower") = q10_transition_to.lo(j,land_to);
oq10_transition_from(t,j,land_from,"lower") = q10_transition_from.lo(j,land_from);
oq10_landexpansion(t,j,land_to,"lower") = q10_landexpansion.lo(j,land_to);
Expand Down
6 changes: 0 additions & 6 deletions modules/10_land/landmatrix_dec18/preloop.gms

This file was deleted.

1 change: 0 additions & 1 deletion modules/10_land/landmatrix_dec18/realization.gms
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ $Ifi "%phase%" == "input" $include "./modules/10_land/landmatrix_dec18/input.gms
$Ifi "%phase%" == "equations" $include "./modules/10_land/landmatrix_dec18/equations.gms"
$Ifi "%phase%" == "scaling" $include "./modules/10_land/landmatrix_dec18/scaling.gms"
$Ifi "%phase%" == "start" $include "./modules/10_land/landmatrix_dec18/start.gms"
$Ifi "%phase%" == "preloop" $include "./modules/10_land/landmatrix_dec18/preloop.gms"
$Ifi "%phase%" == "presolve" $include "./modules/10_land/landmatrix_dec18/presolve.gms"
$Ifi "%phase%" == "postsolve" $include "./modules/10_land/landmatrix_dec18/postsolve.gms"
*######################## R SECTION END (PHASES) ###############################
2 changes: 0 additions & 2 deletions modules/10_land/landmatrix_dec18/scaling.gms
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@
*** | Contact: [email protected]

vm_landdiff.scale = 10e3;
v10_balance_positive.scale(j,land_from) = 10e-7;
v10_balance_negative.scale(j,land_from) = 10e-7;
1 change: 0 additions & 1 deletion modules/20_processing/substitution_may21/scaling.gms
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
*** | MAgPIE License Exception, version 1.0 (see LICENSE file).
*** | Contact: [email protected]

vm_secondary_overproduction.scale(i,kall,kpr) = 10e-4;
vm_cost_processing.scale(i) = 10e5;
vm_processing_substitution_cost.scale(i) = 10e4;
9 changes: 9 additions & 0 deletions modules/29_cropland/detail_apr24/preloop.gms
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,12 @@ p29_country_dummy(policy_countries29) = 1;
* Countries are weighted by available cropland area.
pm_avl_cropland_iso(iso) = f29_avl_cropland_iso(iso,"%c29_marginal_land%");
p29_country_weight(i) = sum(i_to_iso(i,iso), p29_country_dummy(iso) * pm_avl_cropland_iso(iso)) / sum(i_to_iso(i,iso), pm_avl_cropland_iso(iso));

* Initialize biodiversity value
vm_fallow.l(j) = 0;
vm_bv.l(j,"crop_fallow",potnatveg) =
vm_fallow.l(j) * fm_bii_coeff("crop_per",potnatveg) * fm_luh2_side_layers(j,potnatveg);

vm_bv.l(j2,"crop_tree",potnatveg) =
sum(bii_class_secd, sum(ac_to_bii_class_secd(ac,bii_class_secd), pc29_treecover(j2,ac)) *
p29_treecover_bii_coeff(bii_class_secd,potnatveg)) * fm_luh2_side_layers(j2,potnatveg);
8 changes: 8 additions & 0 deletions modules/29_cropland/detail_apr24/presolve.gms
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,11 @@ else
vm_fallow.lo(j) = 0;
vm_fallow.up(j) = p29_avl_cropland(t,j);
m_boundfix(vm_fallow,(j),l,1e-6);

* Update biodiversity value
vm_bv.l(j,"crop_fallow",potnatveg) =
vm_fallow.l(j) * fm_bii_coeff("crop_per",potnatveg) * fm_luh2_side_layers(j,potnatveg);

vm_bv.l(j,"crop_tree",potnatveg) =
sum(bii_class_secd, sum(ac_to_bii_class_secd(ac,bii_class_secd), pc29_treecover(j,ac)) *
p29_treecover_bii_coeff(bii_class_secd,potnatveg)) * fm_luh2_side_layers(j,potnatveg);
Loading

0 comments on commit 408e5a8

Please sign in to comment.