diff --git a/CHANGELOG.md b/CHANGELOG.md index 9943bd454b..6aea51d87a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 - @@ -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 diff --git a/DESCRIPTION b/DESCRIPTION index 103c305a10..a86101ab14 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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, diff --git a/config/default.cfg b/config/default.cfg index f15f836398..913fabc11f 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -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") @@ -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 diff --git a/config/projects/scenario_config_el2.csv b/config/projects/scenario_config_el2.csv index 4fb7c28973..e48b47aae1 100644 --- a/config/projects/scenario_config_el2.csv +++ b/config/projects/scenario_config_el2.csv @@ -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 diff --git a/config/projects/scenario_config_fsec.csv b/config/projects/scenario_config_fsec.csv index a007d17c34..dda4e130b0 100644 --- a/config/projects/scenario_config_fsec.csv +++ b/config/projects/scenario_config_fsec.csv @@ -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;; diff --git a/config/scenario_config.csv b/config/scenario_config.csv index fe9e64437b..6f00b24aa8 100755 --- a/config/scenario_config.csv +++ b/config/scenario_config.csv @@ -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 diff --git a/main.gms b/main.gms index ee3826c8b8..3789d6775f 100644 --- a/main.gms +++ b/main.gms @@ -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 @@ -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 diff --git a/modules/10_land/landmatrix_dec18/declarations.gms b/modules/10_land/landmatrix_dec18/declarations.gms index 2b7346ff73..b0fb5b0616 100644 --- a/modules/10_land/landmatrix_dec18/declarations.gms +++ b/modules/10_land/landmatrix_dec18/declarations.gms @@ -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) @@ -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) diff --git a/modules/10_land/landmatrix_dec18/equations.gms b/modules/10_land/landmatrix_dec18/equations.gms index 55ee823251..aab102ce92 100644 --- a/modules/10_land/landmatrix_dec18/equations.gms +++ b/modules/10_land/landmatrix_dec18/equations.gms @@ -7,18 +7,14 @@ *' @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= @@ -26,7 +22,7 @@ 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. @@ -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] diff --git a/modules/10_land/landmatrix_dec18/input.gms b/modules/10_land/landmatrix_dec18/input.gms index d0c305c988..54b958cffa 100644 --- a/modules/10_land/landmatrix_dec18/input.gms +++ b/modules/10_land/landmatrix_dec18/input.gms @@ -5,10 +5,6 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -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" diff --git a/modules/10_land/landmatrix_dec18/postsolve.gms b/modules/10_land/landmatrix_dec18/postsolve.gms index 75565d91fc..f3cbeb531e 100644 --- a/modules/10_land/landmatrix_dec18/postsolve.gms +++ b/modules/10_land/landmatrix_dec18/postsolve.gms @@ -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); @@ -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); @@ -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); @@ -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); diff --git a/modules/10_land/landmatrix_dec18/preloop.gms b/modules/10_land/landmatrix_dec18/preloop.gms deleted file mode 100644 index 3a209b115b..0000000000 --- a/modules/10_land/landmatrix_dec18/preloop.gms +++ /dev/null @@ -1,6 +0,0 @@ -*** | (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 diff --git a/modules/10_land/landmatrix_dec18/realization.gms b/modules/10_land/landmatrix_dec18/realization.gms index 0a32fde34d..1fdcc37d64 100644 --- a/modules/10_land/landmatrix_dec18/realization.gms +++ b/modules/10_land/landmatrix_dec18/realization.gms @@ -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) ############################### diff --git a/modules/10_land/landmatrix_dec18/scaling.gms b/modules/10_land/landmatrix_dec18/scaling.gms index 4bb36e606e..7cf3630df2 100644 --- a/modules/10_land/landmatrix_dec18/scaling.gms +++ b/modules/10_land/landmatrix_dec18/scaling.gms @@ -6,5 +6,3 @@ *** | Contact: magpie@pik-potsdam.de vm_landdiff.scale = 10e3; -v10_balance_positive.scale(j,land_from) = 10e-7; -v10_balance_negative.scale(j,land_from) = 10e-7; diff --git a/modules/20_processing/substitution_may21/scaling.gms b/modules/20_processing/substitution_may21/scaling.gms index e6a6e99a3c..eeacde45a8 100644 --- a/modules/20_processing/substitution_may21/scaling.gms +++ b/modules/20_processing/substitution_may21/scaling.gms @@ -5,6 +5,5 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -vm_secondary_overproduction.scale(i,kall,kpr) = 10e-4; vm_cost_processing.scale(i) = 10e5; vm_processing_substitution_cost.scale(i) = 10e4; diff --git a/modules/29_cropland/detail_apr24/preloop.gms b/modules/29_cropland/detail_apr24/preloop.gms index 34c0fe6eac..d116470844 100644 --- a/modules/29_cropland/detail_apr24/preloop.gms +++ b/modules/29_cropland/detail_apr24/preloop.gms @@ -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); diff --git a/modules/29_cropland/detail_apr24/presolve.gms b/modules/29_cropland/detail_apr24/presolve.gms index 1b521039ff..99e6d3014d 100644 --- a/modules/29_cropland/detail_apr24/presolve.gms +++ b/modules/29_cropland/detail_apr24/presolve.gms @@ -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); diff --git a/modules/30_croparea/detail_apr24/preloop.gms b/modules/30_croparea/detail_apr24/preloop.gms index cdef528e7f..54fe834d90 100644 --- a/modules/30_croparea/detail_apr24/preloop.gms +++ b/modules/30_croparea/detail_apr24/preloop.gms @@ -39,3 +39,12 @@ p30_country_dummy(policy_countries30) = 1; * share is calculated that translates the countries' influence to regional level. * Countries are weighted by available cropland area. p30_country_weight(i) = sum(i_to_iso(i,iso), p30_country_dummy(iso) * pm_avl_cropland_iso(iso)) / sum(i_to_iso(i,iso), pm_avl_cropland_iso(iso)); + +* Initialize biodiversity value +vm_bv.l(j,"crop_ann",potnatveg) = + sum((crop_ann30,w), fm_croparea("y1995",j,w,crop_ann30)) * fm_bii_coeff("crop_ann",potnatveg) + * fm_luh2_side_layers(j,potnatveg); + +vm_bv.l(j,"crop_per",potnatveg) = + sum((crop_per30,w), fm_croparea("y1995",j,w,crop_per30)) * fm_bii_coeff("crop_per",potnatveg) + * fm_luh2_side_layers(j,potnatveg); diff --git a/modules/30_croparea/simple_apr24/preloop.gms b/modules/30_croparea/simple_apr24/preloop.gms index adffa58780..119943f4a2 100644 --- a/modules/30_croparea/simple_apr24/preloop.gms +++ b/modules/30_croparea/simple_apr24/preloop.gms @@ -23,3 +23,12 @@ p30_country_dummy(policy_countries30) = 1; * share is calculated that translates the countries' influence to regional level. * Countries are weighted by available cropland area. p30_country_weight(i) = sum(i_to_iso(i,iso), p30_country_dummy(iso) * pm_avl_cropland_iso(iso)) / sum(i_to_iso(i,iso), pm_avl_cropland_iso(iso)); + +* Initialize biodiversity value +vm_bv.l(j,"crop_ann",potnatveg) = + sum((crop_ann30,w), fm_croparea("y1995",j,w,crop_ann30)) * fm_bii_coeff("crop_ann",potnatveg) + * fm_luh2_side_layers(j,potnatveg); + +vm_bv.l(j,"crop_per",potnatveg) = + sum((crop_per30,w), fm_croparea("y1995",j,w,crop_per30)) * fm_bii_coeff("crop_per",potnatveg) + * fm_luh2_side_layers(j,potnatveg); diff --git a/modules/31_past/endo_jun13/not_used.txt b/modules/31_past/endo_jun13/not_used.txt index 2b47ed0ec1..2c2efa6670 100644 --- a/modules/31_past/endo_jun13/not_used.txt +++ b/modules/31_past/endo_jun13/not_used.txt @@ -1,5 +1,4 @@ name,type,reason -pcm_land, input, not needed vm_tau,input,questionnaire fm_pastr_tau_hist,input,questionnaire sm_fix_cc, input, not needed diff --git a/modules/58_peatland/v2/scaling.gms b/modules/31_past/endo_jun13/preloop.gms similarity index 52% rename from modules/58_peatland/v2/scaling.gms rename to modules/31_past/endo_jun13/preloop.gms index ad96fe3e35..0a411a741f 100644 --- a/modules/58_peatland/v2/scaling.gms +++ b/modules/31_past/endo_jun13/preloop.gms @@ -5,6 +5,10 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -v58_balance.scale(j,manPeat58) = 10e-5; -v58_balance2.scale(j,manPeat58) = 10e-5; -v58_peatlandChange.scale(j,land58) = 10e-3; +* Initialize biodiversity value +vm_bv.l(j,"manpast",potnatveg) = + pcm_land(j,"past") * fm_luh2_side_layers(j,"manpast") * fm_bii_coeff("manpast",potnatveg) * fm_luh2_side_layers(j,potnatveg); + +vm_bv.l(j,"rangeland",potnatveg) = + pcm_land(j,"past") * fm_luh2_side_layers(j,"rangeland") * fm_bii_coeff("rangeland",potnatveg) * fm_luh2_side_layers(j,potnatveg); + diff --git a/modules/31_past/endo_jun13/realization.gms b/modules/31_past/endo_jun13/realization.gms index f85b630f32..d06a7405f6 100644 --- a/modules/31_past/endo_jun13/realization.gms +++ b/modules/31_past/endo_jun13/realization.gms @@ -21,6 +21,7 @@ $Ifi "%phase%" == "declarations" $include "./modules/31_past/endo_jun13/declarations.gms" $Ifi "%phase%" == "input" $include "./modules/31_past/endo_jun13/input.gms" $Ifi "%phase%" == "equations" $include "./modules/31_past/endo_jun13/equations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/31_past/endo_jun13/preloop.gms" $Ifi "%phase%" == "presolve" $include "./modules/31_past/endo_jun13/presolve.gms" $Ifi "%phase%" == "postsolve" $include "./modules/31_past/endo_jun13/postsolve.gms" *######################## R SECTION END (PHASES) ############################### diff --git a/modules/31_past/grasslands_apr22/not_used.txt b/modules/31_past/grasslands_apr22/not_used.txt index d1f943c5f1..85a13d5fd2 100644 --- a/modules/31_past/grasslands_apr22/not_used.txt +++ b/modules/31_past/grasslands_apr22/not_used.txt @@ -1,3 +1,2 @@ name,type,reason -pcm_land, input, not needed vm_yld,variable, not needed diff --git a/modules/31_past/grasslands_apr22/preloop.gms b/modules/31_past/grasslands_apr22/preloop.gms index 4b32591636..0f54f10b19 100644 --- a/modules/31_past/grasslands_apr22/preloop.gms +++ b/modules/31_past/grasslands_apr22/preloop.gms @@ -93,3 +93,12 @@ i31_grass_yields(t,j,"pastr") = i31_grass_yields(t,j,"pastr") * i31_grass_calib( *' Note that the calculation is split into two parts for better readability. *' @stop + +* Initialize biodiversity value +vm_bv.l(j,"manpast",potnatveg) = + pcm_land(j,"past") * fm_luh2_side_layers(j,"manpast") * fm_bii_coeff("manpast",potnatveg) * fm_luh2_side_layers(j,potnatveg); + +vm_bv.l(j,"rangeland",potnatveg) = + pcm_land(j,"past") * fm_luh2_side_layers(j,"rangeland") * fm_bii_coeff("rangeland",potnatveg) * fm_luh2_side_layers(j,potnatveg); + + diff --git a/modules/32_forestry/dynamic_may24/preloop.gms b/modules/32_forestry/dynamic_may24/preloop.gms index bcf1b96ed1..edccee7402 100644 --- a/modules/32_forestry/dynamic_may24/preloop.gms +++ b/modules/32_forestry/dynamic_may24/preloop.gms @@ -228,3 +228,16 @@ p32_land(t,j,type32,ac) = 0; * initialize forest disturbance losses p32_disturbance_loss_ftype32(t,j,"aff",ac) = 0; + +* Initialize biodiversity value +vm_bv.l(j,"aff_co2p",potnatveg) = + sum(bii_class_secd, sum(ac_to_bii_class_secd(ac,bii_class_secd), pc32_land(j,"aff",ac)) * + p32_bii_coeff("aff",bii_class_secd,potnatveg)) * fm_luh2_side_layers(j,potnatveg); + +vm_bv.l(j,"aff_ndc",potnatveg) = + sum(bii_class_secd, sum(ac_to_bii_class_secd(ac,bii_class_secd), pc32_land(j,"ndc",ac)) * + p32_bii_coeff("ndc",bii_class_secd,potnatveg)) * fm_luh2_side_layers(j,potnatveg); + +vm_bv.l(j,"plant",potnatveg) = + sum(bii_class_secd, sum(ac_to_bii_class_secd(ac,bii_class_secd), pc32_land(j,"plant",ac)) * + p32_bii_coeff("plant",bii_class_secd,potnatveg)) * fm_luh2_side_layers(j,potnatveg); diff --git a/modules/32_forestry/dynamic_may24/presolve.gms b/modules/32_forestry/dynamic_may24/presolve.gms index 97d717c3eb..000f614f94 100644 --- a/modules/32_forestry/dynamic_may24/presolve.gms +++ b/modules/32_forestry/dynamic_may24/presolve.gms @@ -183,4 +183,17 @@ pm_land_conservation(t,j,"secdforest","restore")$(pm_land_conservation(t,j,"secd = pm_land_conservation(t,j,"secdforest","restore") - (sum(ac, p32_land(t,j,"ndc",ac) + p32_land(t,j,"aff",ac) + v32_land.lo(j,"plant",ac)) + p32_aff_pol_timestep(t,j)); pm_land_conservation(t,j,"secdforest","restore")$(pm_land_conservation(t,j,"secdforest","restore") <= sum(ac, p32_land(t,j,"ndc",ac) + p32_land(t,j,"aff",ac) + v32_land.lo(j,"plant",ac)) + p32_aff_pol_timestep(t,j)) = 0; +* Update biodiversity value +vm_bv.l(j,"aff_co2p",potnatveg) = + sum(bii_class_secd, sum(ac_to_bii_class_secd(ac,bii_class_secd), pc32_land(j,"aff",ac)) * + p32_bii_coeff("aff",bii_class_secd,potnatveg)) * fm_luh2_side_layers(j,potnatveg); + +vm_bv.l(j,"aff_ndc",potnatveg) = + sum(bii_class_secd, sum(ac_to_bii_class_secd(ac,bii_class_secd), pc32_land(j,"ndc",ac)) * + p32_bii_coeff("ndc",bii_class_secd,potnatveg)) * fm_luh2_side_layers(j,potnatveg); + +vm_bv.l(j,"plant",potnatveg) = + sum(bii_class_secd, sum(ac_to_bii_class_secd(ac,bii_class_secd), pc32_land(j,"plant",ac)) * + p32_bii_coeff("plant",bii_class_secd,potnatveg)) * fm_luh2_side_layers(j,potnatveg); + *** EOF presolve.gms *** diff --git a/modules/32_forestry/dynamic_may24/scaling.gms b/modules/32_forestry/dynamic_may24/scaling.gms index 029d892a2e..d6b52732fc 100644 --- a/modules/32_forestry/dynamic_may24/scaling.gms +++ b/modules/32_forestry/dynamic_may24/scaling.gms @@ -9,4 +9,3 @@ v32_cost_establishment.scale(i) = 10e4; v32_cost_recur.scale(i) = 10e4; vm_cost_fore.scale(i) = 10e5; v32_cost_hvarea.scale(i)$(s32_hvarea = 1 OR s32_hvarea = 2) = 10e4; -vm_cdr_aff.scale(j,ac,aff_effect) = 10e-4; diff --git a/modules/34_urban/exo_nov21/preloop.gms b/modules/34_urban/exo_nov21/preloop.gms index a313f1a29b..af2f0c4700 100644 --- a/modules/34_urban/exo_nov21/preloop.gms +++ b/modules/34_urban/exo_nov21/preloop.gms @@ -15,3 +15,7 @@ i34_urban_area(t_all, j) = f34_urbanland(t_all, j,"%c34_urban_scenario%"); ); pcm_land(j,"urban") = i34_urban_area("y1995",j); + +* Initialize biodiversity value +vm_bv.l(j2,"urban", potnatveg) = + pcm_land(j2,"urban") * fm_bii_coeff("urban",potnatveg) * fm_luh2_side_layers(j2,potnatveg); diff --git a/modules/34_urban/exo_nov21/scaling.gms b/modules/34_urban/exo_nov21/scaling.gms index f66056dbbd..3b13d1a8d0 100644 --- a/modules/34_urban/exo_nov21/scaling.gms +++ b/modules/34_urban/exo_nov21/scaling.gms @@ -6,5 +6,5 @@ *** | Contact: magpie@pik-potsdam.de vm_cost_urban.scale(j) = 10e3; -v34_cost1.scale(j) = 10e-4; -v34_cost2.scale(j) = 10e-4; +*v34_cost1.scale(j) = 10e-4; +*v34_cost2.scale(j) = 10e-4; diff --git a/modules/34_urban/static/presolve.gms b/modules/34_urban/static/presolve.gms index 00ee7576bb..4a9eb9e4a5 100644 --- a/modules/34_urban/static/presolve.gms +++ b/modules/34_urban/static/presolve.gms @@ -8,7 +8,7 @@ vm_land.fx(j,"urban") = pcm_land(j,"urban"); vm_carbon_stock.fx(j,"urban",ag_pools,stockType) = 0; -*' Biodiveristy value (BV) +* Biodiveristy value (BV) vm_bv.fx(j,"urban", potnatveg) = pcm_land(j,"urban") * fm_bii_coeff("urban",potnatveg) * fm_luh2_side_layers(j,potnatveg); vm_cost_urban.fx(j) = 0; diff --git a/modules/35_natveg/pot_forest_may24/preloop.gms b/modules/35_natveg/pot_forest_may24/preloop.gms index bad3110864..178ff03bbd 100644 --- a/modules/35_natveg/pot_forest_may24/preloop.gms +++ b/modules/35_natveg/pot_forest_may24/preloop.gms @@ -85,3 +85,15 @@ m_sigmoid_time_interpol(p35_damage_fader,sm_fix_SSP2,s35_forest_damage_end,0,1); pc35_secdforest(j,ac) = i35_secdforest(j,ac); pc35_land_other(j,othertype35,ac) = i35_land_other(j,othertype35,ac); + +* Initialize biodiversity value +vm_bv.l(j,"primforest",potnatveg) = + pcm_land(j,"primforest") * fm_bii_coeff("primary",potnatveg) * fm_luh2_side_layers(j,potnatveg); + +vm_bv.l(j,"secdforest",potnatveg) = + sum(bii_class_secd, sum(ac_to_bii_class_secd(ac,bii_class_secd), i35_secdforest(j,ac)) * + fm_bii_coeff(bii_class_secd,potnatveg)) * fm_luh2_side_layers(j,potnatveg); + +vm_bv.l(j,"other",potnatveg) = + sum(bii_class_secd, sum(ac_to_bii_class_secd(ac,bii_class_secd), sum(othertype35, i35_land_other(j,othertype35,ac))) * + fm_bii_coeff(bii_class_secd,potnatveg)) * fm_luh2_side_layers(j,potnatveg); diff --git a/modules/35_natveg/pot_forest_may24/presolve.gms b/modules/35_natveg/pot_forest_may24/presolve.gms index d6e63de4a6..96daaca500 100644 --- a/modules/35_natveg/pot_forest_may24/presolve.gms +++ b/modules/35_natveg/pot_forest_may24/presolve.gms @@ -244,3 +244,15 @@ elseif s35_hvarea = 1, v35_hvarea_primforest.fx(j) = (vm_land.l(j,"primforest") - vm_land.lo(j,"primforest"))*s35_hvarea_primforest*m_timestep_length_forestry; v35_hvarea_other.fx(j,othertype35,ac_sub) = (vm_land_other.l(j,othertype35,ac_sub) - vm_land_other.lo(j,othertype35,ac_sub))*s35_hvarea_other*m_timestep_length_forestry; ); + +* Update biodiversity value +vm_bv.l(j,"primforest",potnatveg) = + pcm_land(j,"primforest") * fm_bii_coeff("primary",potnatveg) * fm_luh2_side_layers(j,potnatveg); + +vm_bv.l(j,"secdforest",potnatveg) = + sum(bii_class_secd, sum(ac_to_bii_class_secd(ac,bii_class_secd), pc35_secdforest(j,ac)) * + fm_bii_coeff(bii_class_secd,potnatveg)) * fm_luh2_side_layers(j,potnatveg); + +vm_bv.l(j,"other",potnatveg) = + sum(bii_class_secd, sum(ac_to_bii_class_secd(ac,bii_class_secd), sum(othertype35, pc35_land_other(j,othertype35,ac))) * + fm_bii_coeff(bii_class_secd,potnatveg)) * fm_luh2_side_layers(j,potnatveg); diff --git a/modules/44_biodiversity/bii_target/declarations.gms b/modules/44_biodiversity/bii_target/declarations.gms index c73b4a6f04..7f4552e059 100644 --- a/modules/44_biodiversity/bii_target/declarations.gms +++ b/modules/44_biodiversity/bii_target/declarations.gms @@ -7,22 +7,24 @@ positive variables - vm_cost_bv_loss(j) Biodiversity cost (mio USD17MER) - 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) + vm_cost_bv_loss(j) Biodiversity cost (mio USD17MER) + 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_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) ; 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 USD17MER) + 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 USD17MER) ; diff --git a/modules/44_biodiversity/bii_target/equations.gms b/modules/44_biodiversity/bii_target/equations.gms index eb730f0a96..d372e2a7c3 100644 --- a/modules/44_biodiversity/bii_target/equations.gms +++ b/modules/44_biodiversity/bii_target/equations.gms @@ -10,15 +10,16 @@ *' The Biodiversity Intactness Index (BII) is calculated at the level of 71 biomes. *' 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)) > 1e-10) .. - v44_bii(i2,biome44) * sum((cell(i2,j2),land), pcm_land(j2,land) * f44_biome(j2,biome44)) + 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) * f44_biome(j2,biome44)); + sum((cell(i2,j2),potnatveg,landcover44), 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)$(sum(cell(i2,j2), f44_biome(j2,biome44)) > 1e-10) .. + q44_bii_target(i2,biome44)$(i44_biome_area_reg(i2,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. diff --git a/modules/44_biodiversity/bii_target/input.gms b/modules/44_biodiversity/bii_target/input.gms index 624e4e8799..65f4f864ee 100644 --- a/modules/44_biodiversity/bii_target/input.gms +++ b/modules/44_biodiversity/bii_target/input.gms @@ -6,11 +6,11 @@ *** | Contact: magpie@pik-potsdam.de scalars - s44_bii_lower_bound Lower bound for BII (1) / 0 / + 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 (USD17MER per unit of BII) / 1e+06 / + s44_cost_bii_missing Technical costs for missing BII increase (USD17MER per unit of BII) / 1e+06 / ; @@ -20,7 +20,7 @@ $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) +table f44_biome_area(j,biome44) Area of biome type in each spatial unit (mio. ha) $ondelim $include "./modules/44_biodiversity/bii_target/input/biorealm_biome.cs3" $offdelim diff --git a/modules/44_biodiversity/bii_target/preloop.gms b/modules/44_biodiversity/bii_target/preloop.gms index e14172dca5..962ffcaea1 100644 --- a/modules/44_biodiversity/bii_target/preloop.gms +++ b/modules/44_biodiversity/bii_target/preloop.gms @@ -5,10 +5,12 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -v44_bii.l(i,biome44) = 0.75; +* 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); -v44_bii.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)) <= 1e-10) = 0; -v44_bii_missing.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)) <= 1e-10) = 0; -p44_bii_lower_bound(t,i,biome44) = 0; +* 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)); -vm_bv.l(j,landcover44,potnatveg) = 0; +p44_bii_lower_bound(t,i,biome44) = 0; diff --git a/modules/44_biodiversity/bii_target/presolve.gms b/modules/44_biodiversity/bii_target/presolve.gms index 88dc5aba91..edca9fc629 100644 --- a/modules/44_biodiversity/bii_target/presolve.gms +++ b/modules/44_biodiversity/bii_target/presolve.gms @@ -5,6 +5,20 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de +* Update v44_bii.l based on vm_bv.l +loop(i, + loop(biome44, + if(i44_biome_area_reg(i,biome44) <= 0, + v44_bii.fx(i,biome44) = 0; + 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)) + / i44_biome_area_reg(i,biome44); + ); + ); +); + * 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); * The target value for the linear interpolation is the lower bound defined in `s44_bii_lower_bound`. @@ -17,13 +31,13 @@ else 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); + 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(t2,i,biome44)$(v44_bii.l(i,biome44) >= p44_target_value(i,biome44)) = p44_target_value(i,biome44); + p44_bii_lower_bound(t,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)) <= 1e-10) = 0; + 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; diff --git a/modules/44_biodiversity/bii_target/sets.gms b/modules/44_biodiversity/bii_target/sets.gms index fb93906e40..69751ecef9 100644 --- a/modules/44_biodiversity/bii_target/sets.gms +++ b/modules/44_biodiversity/bii_target/sets.gms @@ -30,3 +30,5 @@ sets 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 / ; + +alias(biome44,biome44_2); diff --git a/modules/44_biodiversity/bii_target_apr24/declarations.gms b/modules/44_biodiversity/bii_target_apr24/declarations.gms index 8beb0dabed..12eb55056c 100644 --- a/modules/44_biodiversity/bii_target_apr24/declarations.gms +++ b/modules/44_biodiversity/bii_target_apr24/declarations.gms @@ -7,22 +7,24 @@ positive variables - vm_cost_bv_loss(j) Biodiversity cost (mio USD17MER) - vm_bv(j,landcover44,potnatveg) Biodiversity stock for all land cover classes (Mha) - v44_bii(i,biome44) Biodiversity Intactness Index BII (1) + vm_cost_bv_loss(j) Biodiversity cost (mio USD17MER) + 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_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) ; 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 USD17MER) + 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 USD17MER) ; diff --git a/modules/44_biodiversity/bii_target_apr24/equations.gms b/modules/44_biodiversity/bii_target_apr24/equations.gms index e0584c0b98..19c78350ce 100644 --- a/modules/44_biodiversity/bii_target_apr24/equations.gms +++ b/modules/44_biodiversity/bii_target_apr24/equations.gms @@ -11,15 +11,16 @@ *' 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)*f44_rr_layer(j2)) > 1e-10) .. - v44_bii(i2,biome44) * sum((cell(i2,j2),land), pcm_land(j2,land) * f44_rr_layer(j2) * f44_biome(j2,biome44)) + 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) * f44_rr_layer(j2) * f44_biome(j2,biome44)); + sum((cell(i2,j2),potnatveg,landcover44), vm_bv(j2,landcover44,potnatveg) * f44_rr_layer(j2) * 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)$(sum(cell(i2,j2), f44_biome(j2,biome44)*f44_rr_layer(j2)) > 1e-10) .. + q44_bii_target(i2,biome44)$(i44_biome_area_reg(i2,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. diff --git a/modules/44_biodiversity/bii_target_apr24/input.gms b/modules/44_biodiversity/bii_target_apr24/input.gms index b04e933504..042c3e03fb 100644 --- a/modules/44_biodiversity/bii_target_apr24/input.gms +++ b/modules/44_biodiversity/bii_target_apr24/input.gms @@ -6,11 +6,11 @@ *** | Contact: magpie@pik-potsdam.de scalars - s44_bii_lower_bound Lower bound for BII (1) / 0 / + 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 (USD17MER per unit of BII) / 1e+06 / + s44_cost_bii_missing Technical costs for missing BII increase (USD17MER per unit of BII) / 1e+06 / ; @@ -20,7 +20,7 @@ $include "./modules/44_biodiversity/bii_target_apr24/input/f44_bii_coeff.cs3" $offdelim ; -table f44_biome(j,biome44) Share of biome type in each spatial unit (1) +table f44_biome_area(j,biome44) Area of biome type in each spatial unit (mio. ha) $ondelim $include "./modules/44_biodiversity/bii_target_apr24/input/biorealm_biome.cs3" $offdelim diff --git a/modules/44_biodiversity/bii_target_apr24/preloop.gms b/modules/44_biodiversity/bii_target_apr24/preloop.gms index 717263d631..f296466db2 100644 --- a/modules/44_biodiversity/bii_target_apr24/preloop.gms +++ b/modules/44_biodiversity/bii_target_apr24/preloop.gms @@ -5,10 +5,12 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -v44_bii.l(i,biome44) = 0.75; +* 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); -v44_bii.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)*f44_rr_layer(j)) <= 1e-10) = 0; -v44_bii_missing.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)*f44_rr_layer(j)) <= 1e-10) = 0; -p44_bii_lower_bound(t,i,biome44) = 0; +* Set i44_biome_area_reg +i44_biome_area_reg(i,biome44) = + sum((cell(i,j),land), pcm_land(j,land) * f44_rr_layer(j) * i44_biome_share(j,biome44)); -vm_bv.l(j,landcover44,potnatveg) = 0; +p44_bii_lower_bound(t,i,biome44) = 0; diff --git a/modules/44_biodiversity/bii_target_apr24/presolve.gms b/modules/44_biodiversity/bii_target_apr24/presolve.gms index 5a3ee7f43f..f9cd49db45 100644 --- a/modules/44_biodiversity/bii_target_apr24/presolve.gms +++ b/modules/44_biodiversity/bii_target_apr24/presolve.gms @@ -5,6 +5,20 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de +* Update v44_bii.l based on vm_bv.l +loop(i, + loop(biome44, + if(i44_biome_area_reg(i,biome44) <= 0, + v44_bii.fx(i,biome44) = 0; + 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) * f44_rr_layer(j) * i44_biome_share(j,biome44)) + / i44_biome_area_reg(i,biome44); + ); + ); +); + * 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); * The target value for the linear interpolation is the lower bound defined in `s44_bii_lower_bound`. @@ -17,14 +31,15 @@ else 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); + 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(t2,i,biome44)$(v44_bii.l(i,biome44) >= p44_target_value(i,biome44)) = p44_target_value(i,biome44); + p44_bii_lower_bound(t,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)*f44_rr_layer(j)) <= 1e-10) = 0; + 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; ); + diff --git a/modules/44_biodiversity/bii_target_apr24/sets.gms b/modules/44_biodiversity/bii_target_apr24/sets.gms index c4e1566ef6..4e19d2313d 100644 --- a/modules/44_biodiversity/bii_target_apr24/sets.gms +++ b/modules/44_biodiversity/bii_target_apr24/sets.gms @@ -30,3 +30,5 @@ sets 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 / ; + +alias(biome44,biome44_2); diff --git a/modules/58_peatland/v2/realization.gms b/modules/58_peatland/v2/realization.gms index 8fef618fcf..f00746f3f5 100644 --- a/modules/58_peatland/v2/realization.gms +++ b/modules/58_peatland/v2/realization.gms @@ -36,7 +36,6 @@ $Ifi "%phase%" == "sets" $include "./modules/58_peatland/v2/sets.gms" $Ifi "%phase%" == "declarations" $include "./modules/58_peatland/v2/declarations.gms" $Ifi "%phase%" == "input" $include "./modules/58_peatland/v2/input.gms" $Ifi "%phase%" == "equations" $include "./modules/58_peatland/v2/equations.gms" -$Ifi "%phase%" == "scaling" $include "./modules/58_peatland/v2/scaling.gms" $Ifi "%phase%" == "preloop" $include "./modules/58_peatland/v2/preloop.gms" $Ifi "%phase%" == "presolve" $include "./modules/58_peatland/v2/presolve.gms" $Ifi "%phase%" == "postsolve" $include "./modules/58_peatland/v2/postsolve.gms" diff --git a/modules/73_timber/default/scaling.gms b/modules/73_timber/default/scaling.gms index 4741722426..1c85838a24 100644 --- a/modules/73_timber/default/scaling.gms +++ b/modules/73_timber/default/scaling.gms @@ -6,4 +6,3 @@ *** | Contact: magpie@pik-potsdam.de vm_cost_timber.scale(i)$(s73_timber_demand_switch = 1) = 10e4; -v73_prod_heaven_timber.scale(j,kforestry) = 10e-3; diff --git a/scripts/start/extra/recalibrateH16.R b/scripts/start/extra/recalibrateH16.R index f2d3fa5cd9..79c532c9f2 100644 --- a/scripts/start/extra/recalibrateH16.R +++ b/scripts/start/extra/recalibrateH16.R @@ -17,10 +17,10 @@ source("scripts/start_functions.R") #start MAgPIE run source("config/default.cfg") -cfg$input['regional'] <- "rev4.115_36f73207_magpie.tgz" -cfg$input['validation'] <- "rev4.115_36f73207_validation.tgz" +cfg$input['regional'] <- "rev4.116_36f73207_magpie.tgz" +cfg$input['validation'] <- "rev4.116_36f73207_validation.tgz" cfg$input['calibration'] <- "calibration_H16_27Sep24.tgz" -cfg$input['cellular'] <- "rev4.115_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" +cfg$input['cellular'] <- "rev4.116_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$results_folder <- "output/:title:" cfg$recalibrate <- FALSE diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index 43dccf6672..ed4526b597 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -23,14 +23,14 @@ source("scripts/start_functions.R") source("config/default.cfg") # create additional information to describe the runs -cfg$info$flag <- "PTax36" +cfg$info$flag <- "PTax42" cfg$results_folder <- "output/:title:" cfg$results_folder_highres <- "output" -cfg$output <- c(cfg$output, "extra/highres") +#cfg$output <- c(cfg$output, "extra/highres") cfg$force_replace <- TRUE cfg$force_download <- FALSE -cfg$qos <- "standby_highMem_dayMax" +cfg$qos <- "standby_dayMax" # support function to create standardized title .title <- function(cfg, ...) @@ -44,10 +44,10 @@ cfg$repositories <- append( getOption("magpie_repos") ) -cfg$input['regional'] <- "rev4.115_36f73207_magpie.tgz" -cfg$input['validation'] <- "rev4.115_36f73207_validation.tgz" -cfg$input['calibration'] <- "calibration_H16_27Sep24.tgz" -cfg$input['cellular'] <- "rev4.115_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" +cfg$input['regional'] <- "rev4.116_5d9a2237_magpie.tgz" +cfg$input['validation'] <- "rev4.116_5d9a2237_validation.tgz" +cfg$input['calibration'] <- "calibration_H15_27Sep24.tgz" +cfg$input['cellular'] <- "rev4.116_36f73207_bd86374e_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" download_and_update(cfg) ## Create patch file for GHG prices @@ -55,7 +55,7 @@ calc_ghgprice <- function() { T0 <- read.magpie("modules/56_ghg_policy/input/f56_pollutant_prices.cs3") T0 <- collapseNames(T0[, , getNames(T0, dim = 2)[1]]) T0[, , ] <- 0 - + #T200 200 USD/tCO2 in 2050 T200 <- new.magpie(getRegions(T0), c(seq(1995, 2025, by = 5), 2050, 2100, 2150), getNames(T0), fill = 0) T200[, "y2025", "co2_c"] <- 0 @@ -68,13 +68,13 @@ calc_ghgprice <- function() { T200[, , "n2o_n_direct"] <- T200[, , "co2_c"] * 265 * 44 / 28 T200[, , "n2o_n_indirect"] <- T200[, , "co2_c"] * 265 * 44 / 28 T200[, , "co2_c"] <- T200[, , "co2_c"] * 44 / 12 - + T25 <- T200 * 0.125 T50 <- T200 * 0.25 T100 <- T200 * 0.5 T400 <- T200 * 2 T800 <- T200 * 4 - + GHG <- mbind( add_dimension(T0, dim = 3.2, add = "scen", nm = "T0-GHG"), add_dimension( @@ -114,16 +114,16 @@ calc_ghgprice <- function() { nm = "T800-GHG" ) ) - + CO2 <- GHG CO2[, , c("ch4", "n2o_n_direct", "n2o_n_indirect")] <- 0 getNames(CO2, dim = 2) <- gsub("GHG", "CO2", getNames(CO2, dim = 2)) - + GHGCH4GWP20 <- GHG GHGCH4GWP20[, , "ch4"] <- GHGCH4GWP20[, , "ch4"] / 28 * 84 getNames(GHGCH4GWP20, dim = 2) <- gsub("GHG", "GHG-GWP20", getNames(GHGCH4GWP20, dim = 2)) - + GHG <- mbind(CO2, GHG, GHGCH4GWP20) if (!dir.exists("./patch_inputdata")) dir.create("./patch_inputdata") @@ -133,7 +133,7 @@ calc_ghgprice <- function() { write.magpie(GHG, file_name = "patch_inputdata/patchGHGprices/f56_pollutant_prices.cs3") tardir("patch_inputdata/patchGHGprices", "patch_inputdata/patchGHGprices.tgz") - + unlink("patch_inputdata/patchGHGprices", recursive = TRUE) return(getNames(GHG, dim = 2)) } @@ -152,30 +152,23 @@ cfg$gms$livestock <- "fbask_jan16_sticky" cfg$gms$s56_c_price_induced_aff <- 0 ## Start scenarios -for (res in c("c400")) { - if (res == "c400") - cfg$input['cellular'] <- "rev4.115_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" - else if (res == "c1000") { - cfg$input['cellular'] <- "rev4.115_36f73207_10f98ac1_cellularmagpie_c1000_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" - } - ## Ref scenario - cfg$title <- .title(cfg, paste(res, ssp, "Ref", sep = "-")) - cfg$gms$c56_mute_ghgprices_until <- "y2150" - cfg$gms$c56_pollutant_prices <- "T0-CO2" +## Ref scenario +cfg$title <- .title(cfg, paste(ssp, "Ref", sep = "-")) +cfg$gms$c56_mute_ghgprices_until <- "y2150" +cfg$gms$c56_pollutant_prices <- "T0-CO2" +start_run(cfg, codeCheck = FALSE) + +## GHG policy scenarios +for (tax in c("T25-CO2", + "T50-CO2", + "T100-CO2", + "T200-CO2", + "T400-CO2", + "T400-GHG", + "T400-GHG-GWP20")) { + cfg$title <- .title(cfg, paste(ssp, tax, sep = "-")) + cfg$gms$c56_mute_ghgprices_until <- "y2025" + cfg$gms$s58_cost_drain_intact_onetime <- 10000 + cfg$gms$c56_pollutant_prices <- tax start_run(cfg, codeCheck = FALSE) - - ## Policy scenarios - for (tax in c("T25-CO2", - "T50-CO2", - "T100-CO2", - "T200-CO2", - "T400-CO2", - "T400-GHG", - "T400-GHG-GWP20")) { - cfg$title <- .title(cfg, paste(res, ssp, tax, sep = "-")) - cfg$gms$c56_mute_ghgprices_until <- "y2025" - cfg$gms$s58_cost_drain_intact_onetime <- 10000 - cfg$gms$c56_pollutant_prices <- tax - start_run(cfg, codeCheck = FALSE) - } } diff --git a/scripts/start/projects/project_ABCDR.R b/scripts/start/projects/project_ABCDR.R index a36e9c200a..c37eb41942 100644 --- a/scripts/start/projects/project_ABCDR.R +++ b/scripts/start/projects/project_ABCDR.R @@ -19,22 +19,22 @@ source("config/default.cfg") #download_and_update(cfg) # create additional information to describe the runs -cfg$info$flag <- "ABCDR18" +cfg$info$flag <- "ABCDR20" cfg$results_folder <- "output/:title:" cfg$force_replace <- TRUE cfg$force_download <- FALSE -cfg$qos <- "standby_highMem_dayMax" +cfg$qos <- "standby_dayMax" # support function to create standardized title .title <- function(cfg, ...) return(paste(cfg$info$flag, sep="_",...)) -cfg$input['regional'] <- "rev4.115_36f73207_magpie.tgz" -cfg$input['validation'] <- "rev4.115_36f73207_validation.tgz" +cfg$input['regional'] <- "rev4.116_36f73207_magpie.tgz" +cfg$input['validation'] <- "rev4.116_36f73207_validation.tgz" cfg$input['calibration'] <- "calibration_H16_27Sep24.tgz" -cfg$input['cellular'] <- "rev4.115_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" +cfg$input['cellular'] <- "rev4.116_36f73207_bd86374e_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" ssp <- "SSP2" @@ -54,19 +54,19 @@ for (pol in c("NDC","1p5deg","1p5deg-Diet")) { cfg$title <- .title(cfg, paste(ssp,pol,ifelse(growth==0,"natveg","plant"),paste0("AFS_tree_",sub("\\.","p",as.character(shr*100))),sep="-")) if (pol == "NDC") { cfg <- setScenario(cfg,c(ssp,"NDC","rcp4p5")) - cfg$input['cellular'] <- "rev4.115_36f73207_30c9dc61_cellularmagpie_c400_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.116_36f73207_582d657c_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$gms$c56_mute_ghgprices_until <- "y2150" cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NDC") cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NDC") } else if (pol == "1p5deg") { cfg <- setScenario(cfg,c(ssp,"NDC","rcp1p9")) - cfg$input['cellular'] <- "rev4.115_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.116_36f73207_ab632bd4_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$gms$c56_mute_ghgprices_until <- "y2030" cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") } else if (pol == "1p5deg-Diet") { cfg <- setScenario(cfg,c(ssp,"NDC","rcp1p9","eat_lancet_diet_v1")) - cfg$input['cellular'] <- "rev4.115_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.116_36f73207_ab632bd4_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$gms$c56_mute_ghgprices_until <- "y2030" cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") diff --git a/scripts/start/projects/project_EAT2p0.R b/scripts/start/projects/project_EAT2p0.R index fdc7042f28..40763095df 100644 --- a/scripts/start/projects/project_EAT2p0.R +++ b/scripts/start/projects/project_EAT2p0.R @@ -90,7 +90,7 @@ bau <- function(cfg) { cfg$gms$c60_2ndgen_biodem <- "R21M42-SSP2-NPi" # default # Climate Change - cfg$input["cellular"] <- "rev4.115EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz" + cfg$input["cellular"] <- "rev4.116EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz" return(cfg) }