diff --git a/.gitignore b/.gitignore index 940c33af94..af8224471a 100644 --- a/.gitignore +++ b/.gitignore @@ -20,13 +20,7 @@ magpie_calib.* .Rhistory #ignore documentation folder -/doc/*/ -/doc/*.pdf -/doc/*.rds -/doc/*.tex -/doc/*.aux -/doc/*.log -/doc/*.gz +/doc/ #ignore run specific files and folders /225*/ diff --git a/.travis.yml b/.travis.yml index 5d805917b7..63f6ed34b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,14 +3,13 @@ language: R repos: CRAN: https://cloud.r-project.org - PIK: https://rse.pik-potsdam.de/r/packages/ cache: packages latex: false pandoc: false sudo: false -r_packages: lucode install: - - echo "This echo is required as travis would otherwise complain a non-existing DESCRIPTION file (it just requires some entry under "install")!" + - Rscript -e "if(!requireNamespace('devtools')) install.packages('devtools')" + - Rscript -e "if(!requireNamespace('lucode')) devtools::install_github('pik-piam/lucode')" script: - Rscript -e "null <- lucode::codeCheck(strict=TRUE)" diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000..cb61c7d69e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,62 @@ + +# Changelog + +All notable changes to this project will be documented in this file. +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### added + + +### changed + - **modules** modular structure updated from version 1 to version 2 + + + ### fixed + + + +## [4.1.0] - 2019-05-02 + +This release version is focussed on consistency between the MAgPIE setup and the [REMIND model] and result of a validation exercise of the coupled REMIND-MAgPIE system. + +### added + - **80_optimization** added support for GAMS version 26.x.x + - **scripts** added new start and output scripts + - **license** added exception to the applied AGPL license to clarify handling of required GAMS environment, solver libraries and R libraries + +### changed + - **56_ghg_policy** apply reduction factor on CO2 price to account for potential negative side effects; lowers the economic incentive for CO2 emission reduction (avoided deforestation) and afforestation + - **56_ghg_policy** non-linar phase-in of GHG prices over 20 year period + - **56_ghg_policy** multiply GHG prices with development state to account for institutional requirements needed for implementing a GHG pricing scheme + - **40_transport** introduced transport costs for monogastric livestock products + - **NPI/NDC scripts** added forest protection policy for Brazilian Atlantic Forest in default NDC and NPI scenarios + - **NPI/NDC scripts** harmonized the starting year of the NDC policies 2020. + - **interpolation scripts** changed output files to seven magpie land use types, added additional cropsplit script for more detailed cropland output + - **15_food** clean-up and cosmetic changes (correction of comments, parameter names, structure of code); update BMI share calculations with the values of the last consistent MAgPIE/food-demand-model iteration + +### fixed + - **42_water_demand** bugfix environmental flow policy harmonization for historic period + - **57_maccs** correction of cost calculation; Conversion from USD per ton C to USD per ton N and USD per ton CH4 was missing. + - **71_diagg_lvst** adjusted monogastric disaggregation for more flexiblity to avoid infeasibilities with EFPs (see 42_water_demand) + - **15_food** correction regarding the convergence measure of the iterative execution of the food demand model and MAgPIE; correction accounting for unusual time step length in body height calculations; body height regression parameters updated + +## [4.0.1] - 2018-10-05 + +### fixed + - **FABLE** adapted FABLE-specific configuration so that it works with MAgPIE 4.0 + + +## [4.0.0] - 2018-10-04 + +First open source release of the framework. See [MAgPIE 4.0 paper](https://doi.org/10.5194/gmd-12-1299-2019) for more information. + + +[Unreleased]: https://github.com/magpiemodel/magpie/compare/v4.1.0...develop +[4.1.0]: https://github.com/magpiemodel/magpie/compare/v4.0.1...v4.1.0 +[4.0.1]: https://github.com/magpiemodel/magpie/compare/v4.0...v4.0.1 +[4.0.0]: https://github.com/magpiemodel/magpie/releases/tag/v4.0 + +[REMIND model]: https://www.pik-potsdam.de/research/transformation-pathways/models/remind diff --git a/CITATION.cff b/CITATION.cff index e88b30fcb8..e1c57fecc1 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -76,8 +76,8 @@ authors: email: popp@pik-potsdam.de title: MAgPIE - An Open Source land-use modeling framework -version: 4.0.1-dev -date-released: 2018-10-05 +version: 4.2dev +date-released: 2019-05-02 repository-code: https://github.com/magpiemodel/magpie keywords: - landuse diff --git a/LICENSE b/LICENSE index 344fa366dc..24ed8bf2cd 100644 --- a/LICENSE +++ b/LICENSE @@ -1,14 +1,45 @@ - NOTES + MAgPIE NOTES -Besides distribution and software-as-a-service applications the source code -should also be made available in the events of model based publications or -model-based consulting. +Following the principles of good scientific practice it is recommended +to make the source code available in the events of model based publications +or model-based consulting. When using a modified version of **MAgPIE** which is not identical to versions in the official main repository at https://github.com/magpiemodel add a suffix to the name to allow distinguishing versions (format **MAgPIE-suffix**). +-------------------------------------------------------------------------------- + + MAgPIE LICENSE EXCEPTION + Version 1.0 + +This MAgPIE Exception ("Exception") is an additional permission under +section 7 of the GNU Affero General Public License, version 3 (AGPL-3.0). It +applies to a given file that bears a notice placed by the copyright holder +of the file stating that the file is governed by AGPL-3.0 along with this +Exception. + +Grant of Additional Permissions. + +1. +In the event that you are required by any provision of the AGPL-3.0 to +provide or make available the Corresponding Source of the Program as defined +under section 1 of the AGPL-3.0, you are exempt from this obligation to the +extent that the definition of Corresponding Source would also cover solver +libraries or other components of the General Algebraic Modeling System +(GAMS) required to run the Program. + +2. +In the event that you convey the Program and the Program is linked with +libraries written for the R software environment ("R Libraries"), you are +not required to license these R Libraries under the AGPL-3-0 (or a +compatible license), provided the R Libraries are licensed under a Free and +Open Source license ("FOSS License"). A FOSS license is a license that meets +both the Open Source Definition of the Open Source Initaitive and the Free +Software Definition of the Free Software Foundation in its respective most +current form. + -------------------------------------------------------------------------------- GNU AFFERO GENERAL PUBLIC LICENSE diff --git a/README.md b/README.md index e60910c6af..7d86622b95 100644 --- a/README.md +++ b/README.md @@ -4,22 +4,25 @@ ## WHAT IS MAGPIE? The *Model of Agricultural Production and its Impact on the Environment* (MAgPIE) -is a modular open source framework for modeling global land-systems, which is -coupled to the grid-based dynamic vegetation model LPJmL, with a spatial resolution -of 0.5°x0.5°. It takes regional economic conditions such as demand for agricultural -commodities, technological development and production costs as well as spatially -explicit data on potential crop yields, land and water constraints (from LPJmL) into -account. Based on these, the model derives specific land use patterns, yields and -total costs of agricultural production for each grid cell. The objective function of -the land use model is to minimize total cost of production for a given amount of -regional food and bioenergy demand. Regional food energy demand is defined for an -exogenously given population in 10 food energy categories, based on regional diets. -Future trends in food demand are derived from a cross-country regression analysis, +is a modular open source framework for modeling global land-systems, which is +coupled to the grid-based dynamic vegetation model LPJmL, with a spatial resolution +of 0.5°x0.5°. It takes regional economic conditions such as demand for agricultural +commodities, technological development and production costs as well as spatially +explicit data on potential crop yields, land and water constraints (from LPJmL) into +account. Based on these, the model derives specific land use patterns, yields and +total costs of agricultural production for each grid cell. The objective function of +the land use model is to minimize total cost of production for a given amount of +regional food and bioenergy demand. Regional food energy demand is defined for an +exogenously given population in 10 food energy categories, based on regional diets. +Future trends in food demand are derived from a cross-country regression analysis, based on future scenarios on GDP and population growth. ## DOCUMENTATION -The model documentation for version 4 can be found at -https://rse.pik-potsdam.de/doc/magpie/version4/ +A framework description paper has been published in +Geoscientific Model Development (GMD): https://doi.org/10.5194/gmd-12-1299-2019 + +The model documentation for version 4.1 can be found at +https://rse.pik-potsdam.de/doc/magpie/4.1/ A most recent version of the documentation can also be extracted from the model source code via the R package goxygen @@ -34,7 +37,7 @@ The Coding Etiquette explains also the used name conventions and other structural characteristics. ## COPYRIGHT -Copyright 2008-2018 Potsdam Institute for Climate Impact Research (PIK) +Copyright 2008-2019 Potsdam Institute for Climate Impact Research (PIK) ## LICENSE This program is free software: you can redistribute it and/or modify @@ -42,12 +45,15 @@ it under the terms of the **GNU Affero General Public License** as published by the Free Software Foundation, **version 3** of the License or later. You should have received a copy of the GNU Affero General Public License along with this program. See the LICENSE file in the root directory. If not, see -http://www.gnu.org/licenses/ +https://www.gnu.org/licenses/agpl.txt + +Under Section 7 of AGPL-3.0, you are granted additional permissions described +in the MAgPIE License Exception, version 1.0 (see LICENSE file). ## NOTES -Besides distribution and software-as-a-service applications the source code -should also be made available in the events of model based publications or -model-based consulting. +Following the principles of good scientific practice it is recommended +to make the source code available in the events of model based publications +or model-based consulting. When using a modified version of **MAgPIE** which is not identical to versions in the official main repository at https://github.com/magpiemodel add a suffix @@ -120,7 +126,7 @@ pkgs <- c("ggplot2", "lusweave", "luscale", "goxygen", - "luplot") + "luplot") install.packages(pkgs) ``` For post-processing model outputs *Latex* is required diff --git a/config/default.cfg b/config/default.cfg index 2517cc211f..562d968e20 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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 ################## @@ -22,7 +23,7 @@ cfg$model <- "main.gms" #def = "main.gms" # which input data sets should be used? -cfg$input <- c("magpie4.0_default_sep18.tgz","additional_data_rev3.66.tgz") +cfg$input <- c("magpie4.1_default_apr19.tgz") #a list of repositories (please pay attention to the list format!) in which the #files should be searched for. Files will be searched in all repositories until @@ -187,7 +188,6 @@ cfg$gms$c18_burn_scen <- "phaseout" # def = phaseout # ***--------------------- 20_processing --------------------------------- -# * (coupleproducts_feb17): processing with couple products # * (substitution_dec18) : processing with couple products allowing for substitution # * (off): off cfg$gms$processing <- "substitution_dec18" # def = substitution_dec18 @@ -267,6 +267,7 @@ cfg$gms$natveg <- "dynamic_may18" # def = dynamic_may18 # * (CPD) Centres of Plant Diversity + WDPA # * (LW) last of the wild + WDPA # * (none) no protection +# * (forest) forest protection (primforest+secdforest) # * (full) full protection cfg$gms$c35_protect_scenario <- "WDPA" # def = WDPA @@ -421,7 +422,6 @@ cfg$gms$phosphorus <- "off" # def = off cfg$gms$awms <- "ipcc2006_aug16" # def = ipcc2006_aug16 # ***--------------------- 56_ghg_policy ---------------------------------- -# * (price_sep16): GHG emission pricing without phase-in # * (price_jan19): GHG emission pricing with phase-in over 20 year period and depending on development state cfg$gms$ghg_policy <- "price_jan19" # def = price_jan19 @@ -432,56 +432,34 @@ cfg$gms$s56_ghgprice_start <- 2025 # def = 2025 # * lowers the economic incentive for CO2 emission reduction (avoided deforestation) and afforestation cfg$gms$s56_cprice_red_factor <- 0.5 # def = 0.5 -# * pollutant price scenario -cfg$gms$c56_pollutant_prices <- "SSP2-Ref-SPA0-V15-REMIND-MAGPIE" # def = "SSP2-Ref-SPA0-V15-REMIND-MAGPIE" -# * options: -# * "SSP1-20-SPA1-V15-IMAGE", -# * "SSP1-26-SPA1-V15-IMAGE" , -# * "SSP1-34-SPA1-V15-IMAGE" , -# * "SSP1-45-SPA1-V15-IMAGE" , -# * "SSP1-Ref-SPA0-V15-IMAGE", -# -# * "SSP1-20-SPA1-V15-REMIND-MAGPIE", -# * "SSP1-26-SPA1-V15-REMIND-MAGPIE" , -# * "SSP1-34-SPA1-V15-REMIND-MAGPIE" , -# * "SSP1-37-SPA1-V15-REMIND-MAGPIE", -# * "SSP1-45-SPA1-V15-REMIND-MAGPIE" , -# * "SSP1-Ref-SPA0-V15-REMIND-MAGPIE", -# -# * "SSP2-18-SPA2-V15-MESSAGE-GLOBIOM" , -# * "SSP2-19-SPA2-V15-MESSAGE-GLOBIOM", -# * "SSP2-20-SPA2-V15-MESSAGE-GLOBIOM", -# * "SSP2-26-SPA2-V15-MESSAGE-GLOBIOM", -# * "SSP2-34-SPA2-V15-MESSAGE-GLOBIOM", -# * "SSP2-45-SPA2-V15-MESSAGE-GLOBIOM", -# * "SSP2-60-SPA2-V15-MESSAGE-GLOBIOM", -# * "SSP2-Ref-SPA0-V15-MESSAGE-GLOBIOM", -# -# * "SSP2-20-SPA2-V15-REMIND-MAGPIE", -# * "SSP2-26-SPA2-V15-REMIND-MAGPIE", -# * "SSP2-34-SPA2-V15-REMIND-MAGPIE", -# * "SSP2-37-SPA2-V15-REMIND-MAGPIE", -# * "SSP2-45-SPA2-V15-REMIND-MAGPIE", -# * "SSP2-60-SPA2-V15-REMIND-MAGPIE", -# * "SSP2-Ref-SPA0-V15-REMIND-MAGPIE", -# -# * "SSP3-34-SPA3-V15-AIM-CGE", -# * "SSP3-45-SPA3-V15-AIM-CGE", -# * "SSP3-60-SPA3-V15-AIM-CGE", -# -# * "SSP4-26-SPA4-V15-GCAM4", -# * "SSP4-34-SPA4-V15-GCAM4", -# * "SSP4-45-SPA4-V15-GCAM4", -# * "SSP4-60-SPA4-V15-GCAM4", -# * "SSP4-Ref-SPA0-V15-GCAM4", -# -# * "SSP5-20-SPA5-V15-REMIND-MAGPIE", -# * "SSP5-26-SPA5-V15-REMIND-MAGPIE", -# * "SSP5-34-SPA5-V15-REMIND-MAGPIE", -# * "SSP5-37-SPA5-V15-REMIND-MAGPIE", -# * "SSP5-45-SPA5-V15-REMIND-MAGPIE", -# * "SSP5-60-SPA5-V15-REMIND-MAGPIE", -# * "SSP5-Ref-SPA0-V15-REMIND-MAGPIE" +# * GHG pollutant price scenario +# * Available scenarios: +# * R2M41-SSP2-Budg1300,R2M41-SSP2-Budg600, +# * R2M41-SSP2-Budg950,R2M41-SSP2-NDC,R2M41-SSP2-NPi, +# * SSPDB-SSP1-20-IMAGE,SSPDB-SSP1-20-REMIND-MAGPIE, +# * SSPDB-SSP1-26-IMAGE,SSPDB-SSP1-26-REMIND-MAGPIE, +# * SSPDB-SSP1-34-IMAGE,SSPDB-SSP1-34-REMIND-MAGPIE, +# * SSPDB-SSP1-37-REMIND-MAGPIE, +# * SSPDB-SSP1-45-IMAGE,SSPDB-SSP1-45-REMIND-MAGPIE, +# * SSPDB-SSP1-Ref-IMAGE,SSPDB-SSP1-Ref-REMIND-MAGPIE, +# * SSPDB-SSP2-18-MESSAGE-GLOBIOM,SSPDB-SSP2-19-MESSAGE-GLOBIOM, +# * SSPDB-SSP2-20-MESSAGE-GLOBIOM,SSPDB-SSP2-20-REMIND-MAGPIE, +# * SSPDB-SSP2-26-MESSAGE-GLOBIOM,SSPDB-SSP2-26-REMIND-MAGPIE, +# * SSPDB-SSP2-34-MESSAGE-GLOBIOM,SSPDB-SSP2-34-REMIND-MAGPIE, +# * SSPDB-SSP2-37-REMIND-MAGPIE, +# * SSPDB-SSP2-45-MESSAGE-GLOBIOM,SSPDB-SSP2-45-REMIND-MAGPIE, +# * SSPDB-SSP2-60-MESSAGE-GLOBIOM,SSPDB-SSP2-60-REMIND-MAGPIE, +# * SSPDB-SSP2-Ref-MESSAGE-GLOBIOM,SSPDB-SSP2-Ref-REMIND-MAGPIE, +# * SSPDB-SSP3-34-AIM-CGE,SSPDB-SSP3-45-AIM-CGE, +# * SSPDB-SSP3-60-AIM-CGE,SSPDB-SSP4-26-GCAM4, +# * SSPDB-SSP4-34-GCAM4,SSPDB-SSP4-45-GCAM4, +# * SSPDB-SSP4-60-GCAM4,SSPDB-SSP4-Ref-GCAM4, +# * SSPDB-SSP5-20-REMIND-MAGPIE,SSPDB-SSP5-26-REMIND-MAGPIE, +# * SSPDB-SSP5-34-REMIND-MAGPIE,SSPDB-SSP5-37-REMIND-MAGPIE, +# * SSPDB-SSP5-45-REMIND-MAGPIE,SSPDB-SSP5-60-REMIND-MAGPIE, +# * SSPDB-SSP5-Ref-REMIND-MAGPIE, +# * coupling +cfg$gms$c56_pollutant_prices <- "R2M41-SSP2-NPi" # def = "R2M41-SSP2-NPi" # * Upper limit for CH4 and N2O GHG price (USD05MER per tC) # * Limits GHG prices selected in c56_pollutant_prices to the chosen value. @@ -498,21 +476,11 @@ cfg$gms$c56_emis_policy <- "ssp" # def = ssp # * Treatment of negative costs originating from negative co2 emissions # * reward negative co2 emissions (-Inf) or not (0) -# * s56_reward_neg_emis is applied on emission policy chosen in c56_emis_policy +# * s56_reward_neg_emis is applied the on emission policy chosen in c56_emis_policy # * In case of carbon pricing s56_reward_neg_emis = -Inf results in increase of other land # * For runs with afforestation s56_reward_neg_emis should be 0 (default setting) cfg$gms$s56_reward_neg_emis <- 0 # def = 0 -# * economic incentive for afforestation (only effective if forestry=affore_vegc_dec16) -# * options: none, all, all50, vegc50, vegc33, vegc25 -# * none: no carbon price applied on forestry carbon pools -# * all: full carbon price; all carbon pools -# * all50: 50% of carbon price; all carbon pools -# * vegc50: 50% of carbon price; only vegetation carbon pool -# * vegc33: 33% of carbon price; only vegetation carbon pool -# * vegc25: 25% of carbon price; only vegetation carbon pool -cfg$gms$c56_aff_policy <- "vegc50" # def = vegc50 - # ***--------------------- 57_maccs --------------------------------------- # * (on_sep16): maccs for non-CO2 emission mitigation activated # * (off_jul16): maccs for non-CO2 emission mitigation deactivated @@ -529,9 +497,6 @@ cfg$gms$som <- "off" # def = off cfg$gms$c59_som_scenario <- "nocc" # def = "nocc" # ***--------------------- 60_bioenergy ----------------------------------- -# * (standard_flexreg_may17): fixed 1st generation demand based on Lotze Campen (2014), -# * scenario-depending 2nd gen demand which can be -# * either fullfilled by begr or betr # * (1stgen_priced_dec18): exogenous and price-based 1st generation bioenergy # * demand, 2nd generation residues exogeneous, # * 2nd generation betr and begr coupled with REMIND. @@ -543,16 +508,34 @@ cfg$gms$bioenergy <- "1stgen_priced_dec18" # def = 1stgen_priced_dec18 # * (const2030): increase until 2030, constant thereafter cfg$gms$c60_1stgen_biodem <- "const2020" # def = const2020 -# * 2nd generation bioenergy demand scenarios for standard realization -# * options: SSP1-Ref-SPA0, SSP2-Ref-SPA0, SSP5-Ref-SPA0, -# * SSP1-26-SPA0, SSP1-37-SPA0, SSP1-45-SPA0, -# * SSP2-26-SPA0, SSP2-37-SPA0, SSP2-45-SPA0, SSP2-60-SPA0, -# * SSP5-26-SPA0, SSP5-37-SPA0, SSP5-45-SPA0, SSP5-60-SPA0, -# * SSP1-26-SPA1, SSP1-37-SPA1, SSP1-45-SPA1, -# * SSP2-26-SPA2, SSP2-37-SPA2, SSP2-45-SPA2, SSP2-60-SPA2, -# * SSP5-26-SPA5, SSP5-37-SPA5, SSP5-45-SPA5, SSP5-60-SPA5, -# * coupling -cfg$gms$c60_2ndgen_biodem <- "SSP2-Ref-SPA0" # def = SSP2-Ref-SPA0 +# * 2nd generation bioenergy demand scenario +# * Available scenarios: +# * R2M41-SSP2-Budg1300,R2M41-SSP2-Budg600, +# * R2M41-SSP2-Budg950,R2M41-SSP2-NDC,R2M41-SSP2-NPi, +# * SSPDB-SSP1-20-IMAGE,SSPDB-SSP1-20-REMIND-MAGPIE, +# * SSPDB-SSP1-26-IMAGE,SSPDB-SSP1-26-REMIND-MAGPIE, +# * SSPDB-SSP1-34-IMAGE,SSPDB-SSP1-34-REMIND-MAGPIE, +# * SSPDB-SSP1-37-REMIND-MAGPIE, +# * SSPDB-SSP1-45-IMAGE,SSPDB-SSP1-45-REMIND-MAGPIE, +# * SSPDB-SSP1-Ref-IMAGE,SSPDB-SSP1-Ref-REMIND-MAGPIE, +# * SSPDB-SSP2-18-MESSAGE-GLOBIOM,SSPDB-SSP2-19-MESSAGE-GLOBIOM, +# * SSPDB-SSP2-20-MESSAGE-GLOBIOM,SSPDB-SSP2-20-REMIND-MAGPIE, +# * SSPDB-SSP2-26-MESSAGE-GLOBIOM,SSPDB-SSP2-26-REMIND-MAGPIE, +# * SSPDB-SSP2-34-MESSAGE-GLOBIOM,SSPDB-SSP2-34-REMIND-MAGPIE, +# * SSPDB-SSP2-37-REMIND-MAGPIE, +# * SSPDB-SSP2-45-MESSAGE-GLOBIOM,SSPDB-SSP2-45-REMIND-MAGPIE, +# * SSPDB-SSP2-60-MESSAGE-GLOBIOM,SSPDB-SSP2-60-REMIND-MAGPIE, +# * SSPDB-SSP2-Ref-MESSAGE-GLOBIOM,SSPDB-SSP2-Ref-REMIND-MAGPIE, +# * SSPDB-SSP3-34-AIM-CGE,SSPDB-SSP3-45-AIM-CGE, +# * SSPDB-SSP3-60-AIM-CGE,SSPDB-SSP4-26-GCAM4, +# * SSPDB-SSP4-34-GCAM4,SSPDB-SSP4-45-GCAM4, +# * SSPDB-SSP4-60-GCAM4,SSPDB-SSP4-Ref-GCAM4, +# * SSPDB-SSP5-20-REMIND-MAGPIE,SSPDB-SSP5-26-REMIND-MAGPIE, +# * SSPDB-SSP5-34-REMIND-MAGPIE,SSPDB-SSP5-37-REMIND-MAGPIE, +# * SSPDB-SSP5-45-REMIND-MAGPIE,SSPDB-SSP5-60-REMIND-MAGPIE, +# * SSPDB-SSP5-Ref-REMIND-MAGPIE, +# * coupling +cfg$gms$c60_2ndgen_biodem <- "R2M41-SSP2-NPi" # def = R2M41-SSP2-NPi # * residue demand for 2nd generation bioenergy scenarios # * options: ssp1, ssp2, ssp3, ssp4, ssp5, off diff --git a/config/fable.cfg b/config/fable.cfg index dfcb93e479..47cd6a202b 100644 --- a/config/fable.cfg +++ b/config/fable.cfg @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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 ################## @@ -22,7 +23,7 @@ cfg$model <- "main.gms" #def = "main.gms" # which input data sets should be used? -cfg$input <- "magpie4.0_ind_oct18.tgz" +cfg$input <- "magpie4.1_ind_apr19.tgz" #a list of repositories (please pay attention to the list format!) in which the @@ -188,9 +189,9 @@ cfg$gms$c18_burn_scen <- "phaseout" # def = phaseout # ***--------------------- 20_processing --------------------------------- -# * (coupleproducts_feb17): processing with couple products +# * (substitution_dec18) : processing with couple products allowing for substitution # * (off): off -cfg$gms$processing <- "coupleproducts_feb17" # def = coupleproducts_feb17 +cfg$gms$processing <- "substitution_dec18" # def = substitution_dec18 # ***--------------------- 21_trade -------------------------------------- # * (free_apr16): free trade without restrictions @@ -232,7 +233,7 @@ cfg$gms$s31_fac_req_past <- 1 # def = 1 cfg$gms$forestry <- "affore_vegc_dec16" # def = affore_vegc_dec16 # * afforestation planing horizon (years) -cfg$gms$s32_planing_horizon <- 30 # def = 30 +cfg$gms$s32_planing_horizon <- 80 # def = 80 # Afforestation policy # * ("none"): no prescribed afforestation @@ -267,6 +268,7 @@ cfg$gms$natveg <- "dynamic_may18" # def = dynamic_may18 # * (CPD) Centres of Plant Diversity + WDPA # * (LW) last of the wild + WDPA # * (none) no protection +# * (forest) forest protection (primforest+secdforest) # * (full) full protection cfg$gms$c35_protect_scenario <- "WDPA" # def = WDPA @@ -421,59 +423,44 @@ cfg$gms$phosphorus <- "off" # def = off cfg$gms$awms <- "ipcc2006_aug16" # def = ipcc2006_aug16 # ***--------------------- 56_ghg_policy ---------------------------------- -# * (price_sep16): GHG emission pricing - same annuity as used in other modules -cfg$gms$ghg_policy <- "price_sep16" # def = price_sep16 - -# * pollutant price scenario -cfg$gms$c56_pollutant_prices <- "SSP2-Ref-SPA0-V15-REMIND-MAGPIE" # def = "SSP2-Ref-SPA0-V15-REMIND-MAGPIE" -# * options: -# * "SSP1-20-SPA1-V15-IMAGE", -# * "SSP1-26-SPA1-V15-IMAGE" , -# * "SSP1-34-SPA1-V15-IMAGE" , -# * "SSP1-45-SPA1-V15-IMAGE" , -# * "SSP1-Ref-SPA0-V15-IMAGE", -# -# * "SSP1-20-SPA1-V15-REMIND-MAGPIE", -# * "SSP1-26-SPA1-V15-REMIND-MAGPIE" , -# * "SSP1-34-SPA1-V15-REMIND-MAGPIE" , -# * "SSP1-37-SPA1-V15-REMIND-MAGPIE", -# * "SSP1-45-SPA1-V15-REMIND-MAGPIE" , -# * "SSP1-Ref-SPA0-V15-REMIND-MAGPIE", -# -# * "SSP2-18-SPA2-V15-MESSAGE-GLOBIOM" , -# * "SSP2-19-SPA2-V15-MESSAGE-GLOBIOM", -# * "SSP2-20-SPA2-V15-MESSAGE-GLOBIOM", -# * "SSP2-26-SPA2-V15-MESSAGE-GLOBIOM", -# * "SSP2-34-SPA2-V15-MESSAGE-GLOBIOM", -# * "SSP2-45-SPA2-V15-MESSAGE-GLOBIOM", -# * "SSP2-60-SPA2-V15-MESSAGE-GLOBIOM", -# * "SSP2-Ref-SPA0-V15-MESSAGE-GLOBIOM", -# -# * "SSP2-20-SPA2-V15-REMIND-MAGPIE", -# * "SSP2-26-SPA2-V15-REMIND-MAGPIE", -# * "SSP2-34-SPA2-V15-REMIND-MAGPIE", -# * "SSP2-37-SPA2-V15-REMIND-MAGPIE", -# * "SSP2-45-SPA2-V15-REMIND-MAGPIE", -# * "SSP2-60-SPA2-V15-REMIND-MAGPIE", -# * "SSP2-Ref-SPA0-V15-REMIND-MAGPIE", -# -# * "SSP3-34-SPA3-V15-AIM-CGE", -# * "SSP3-45-SPA3-V15-AIM-CGE", -# * "SSP3-60-SPA3-V15-AIM-CGE", -# -# * "SSP4-26-SPA4-V15-GCAM4", -# * "SSP4-34-SPA4-V15-GCAM4", -# * "SSP4-45-SPA4-V15-GCAM4", -# * "SSP4-60-SPA4-V15-GCAM4", -# * "SSP4-Ref-SPA0-V15-GCAM4", -# -# * "SSP5-20-SPA5-V15-REMIND-MAGPIE", -# * "SSP5-26-SPA5-V15-REMIND-MAGPIE", -# * "SSP5-34-SPA5-V15-REMIND-MAGPIE", -# * "SSP5-37-SPA5-V15-REMIND-MAGPIE", -# * "SSP5-45-SPA5-V15-REMIND-MAGPIE", -# * "SSP5-60-SPA5-V15-REMIND-MAGPIE", -# * "SSP5-Ref-SPA0-V15-REMIND-MAGPIE" +# * (price_jan19): GHG emission pricing with phase-in over 20 year period and depending on development state +cfg$gms$ghg_policy <- "price_jan19" # def = price_jan19 + +# * start year of GHG emission pricing phase-in (only used in price_jan19) +cfg$gms$s56_ghgprice_start <- 2025 # def = 2025 + +# * reduction factor for CO2 price (only used in price_jan19) +# * lowers the economic incentive for CO2 emission reduction (avoided deforestation) and afforestation +cfg$gms$s56_cprice_red_factor <- 0.5 # def = 0.5 + +# * GHG pollutant price scenario +# * Available scenarios: +# * R2M41-SSP2-Budg1300,R2M41-SSP2-Budg600, +# * R2M41-SSP2-Budg950,R2M41-SSP2-NDC,R2M41-SSP2-NPi, +# * SSPDB-SSP1-20-IMAGE,SSPDB-SSP1-20-REMIND-MAGPIE, +# * SSPDB-SSP1-26-IMAGE,SSPDB-SSP1-26-REMIND-MAGPIE, +# * SSPDB-SSP1-34-IMAGE,SSPDB-SSP1-34-REMIND-MAGPIE, +# * SSPDB-SSP1-37-REMIND-MAGPIE, +# * SSPDB-SSP1-45-IMAGE,SSPDB-SSP1-45-REMIND-MAGPIE, +# * SSPDB-SSP1-Ref-IMAGE,SSPDB-SSP1-Ref-REMIND-MAGPIE, +# * SSPDB-SSP2-18-MESSAGE-GLOBIOM,SSPDB-SSP2-19-MESSAGE-GLOBIOM, +# * SSPDB-SSP2-20-MESSAGE-GLOBIOM,SSPDB-SSP2-20-REMIND-MAGPIE, +# * SSPDB-SSP2-26-MESSAGE-GLOBIOM,SSPDB-SSP2-26-REMIND-MAGPIE, +# * SSPDB-SSP2-34-MESSAGE-GLOBIOM,SSPDB-SSP2-34-REMIND-MAGPIE, +# * SSPDB-SSP2-37-REMIND-MAGPIE, +# * SSPDB-SSP2-45-MESSAGE-GLOBIOM,SSPDB-SSP2-45-REMIND-MAGPIE, +# * SSPDB-SSP2-60-MESSAGE-GLOBIOM,SSPDB-SSP2-60-REMIND-MAGPIE, +# * SSPDB-SSP2-Ref-MESSAGE-GLOBIOM,SSPDB-SSP2-Ref-REMIND-MAGPIE, +# * SSPDB-SSP3-34-AIM-CGE,SSPDB-SSP3-45-AIM-CGE, +# * SSPDB-SSP3-60-AIM-CGE,SSPDB-SSP4-26-GCAM4, +# * SSPDB-SSP4-34-GCAM4,SSPDB-SSP4-45-GCAM4, +# * SSPDB-SSP4-60-GCAM4,SSPDB-SSP4-Ref-GCAM4, +# * SSPDB-SSP5-20-REMIND-MAGPIE,SSPDB-SSP5-26-REMIND-MAGPIE, +# * SSPDB-SSP5-34-REMIND-MAGPIE,SSPDB-SSP5-37-REMIND-MAGPIE, +# * SSPDB-SSP5-45-REMIND-MAGPIE,SSPDB-SSP5-60-REMIND-MAGPIE, +# * SSPDB-SSP5-Ref-REMIND-MAGPIE, +# * coupling +cfg$gms$c56_pollutant_prices <- "R2M41-SSP2-NPi" # def = "R2M41-SSP2-NPi" # * Upper limit for CH4 and N2O GHG price (USD05MER per tC) # * Limits GHG prices selected in c56_pollutant_prices to the chosen value. @@ -490,21 +477,11 @@ cfg$gms$c56_emis_policy <- "ssp" # def = ssp # * Treatment of negative costs originating from negative co2 emissions # * reward negative co2 emissions (-Inf) or not (0) -# * s56_reward_neg_emis is applied on emission policy chosen in c56_emis_policy +# * s56_reward_neg_emis is applied the on emission policy chosen in c56_emis_policy # * In case of carbon pricing s56_reward_neg_emis = -Inf results in increase of other land # * For runs with afforestation s56_reward_neg_emis should be 0 (default setting) cfg$gms$s56_reward_neg_emis <- 0 # def = 0 -# * economic incentive for afforestation (only effective if forestry=affore_vegc_dec16) -# * options: none, all, all50, vegc50, vegc33, vegc25 -# * none: no carbon price applied on forestry carbon pools -# * all: full carbon price; all carbon pools -# * all50: 50% of carbon price; all carbon pools -# * vegc50: 50% of carbon price; only vegetation carbon pool -# * vegc33: 33% of carbon price; only vegetation carbon pool -# * vegc25: 25% of carbon price; only vegetation carbon pool -cfg$gms$c56_aff_policy <- "vegc50" # def = vegc50 - # ***--------------------- 57_maccs --------------------------------------- # * (on_sep16): maccs for non-CO2 emission mitigation activated # * (off_jul16): maccs for non-CO2 emission mitigation deactivated @@ -521,10 +498,10 @@ cfg$gms$som <- "off" # def = off cfg$gms$c59_som_scenario <- "nocc" # def = "nocc" # ***--------------------- 60_bioenergy ----------------------------------- -# * (standard_flexreg_may17): fixed 1st generation demand based on Lotze Campen (2014), -# * scenario-depending 2nd gen demand which can be -# * either fullfilled by begr or betr -cfg$gms$bioenergy <- "standard_flexreg_may17" # def = standard_flexreg_may17 +# * (1stgen_priced_dec18): exogenous and price-based 1st generation bioenergy +# * demand, 2nd generation residues exogeneous, +# * 2nd generation betr and begr coupled with REMIND. +cfg$gms$bioenergy <- "1stgen_priced_dec18" # def = 1stgen_priced_dec18 # * 1st generation bioenergy demand scenarios based on Lotze Campen (2014) # * (phaseout2020): increase until 2020, followed by phaseout until 2050 @@ -532,16 +509,34 @@ cfg$gms$bioenergy <- "standard_flexreg_may17" # def = standard_flexreg_may17 # * (const2030): increase until 2030, constant thereafter cfg$gms$c60_1stgen_biodem <- "const2020" # def = const2020 -# * 2nd generation bioenergy demand scenarios for standard realization -# * options: SSP1-Ref-SPA0, SSP2-Ref-SPA0, SSP5-Ref-SPA0, -# * SSP1-26-SPA0, SSP1-37-SPA0, SSP1-45-SPA0, -# * SSP2-26-SPA0, SSP2-37-SPA0, SSP2-45-SPA0, SSP2-60-SPA0, -# * SSP5-26-SPA0, SSP5-37-SPA0, SSP5-45-SPA0, SSP5-60-SPA0, -# * SSP1-26-SPA1, SSP1-37-SPA1, SSP1-45-SPA1, -# * SSP2-26-SPA2, SSP2-37-SPA2, SSP2-45-SPA2, SSP2-60-SPA2, -# * SSP5-26-SPA5, SSP5-37-SPA5, SSP5-45-SPA5, SSP5-60-SPA5, -# * coupling -cfg$gms$c60_2ndgen_biodem <- "SSP2-Ref-SPA0" # def = SSP2-Ref-SPA0 +# * 2nd generation bioenergy demand scenario +# * Available scenarios: +# * R2M41-SSP2-Budg1300,R2M41-SSP2-Budg600, +# * R2M41-SSP2-Budg950,R2M41-SSP2-NDC,R2M41-SSP2-NPi, +# * SSPDB-SSP1-20-IMAGE,SSPDB-SSP1-20-REMIND-MAGPIE, +# * SSPDB-SSP1-26-IMAGE,SSPDB-SSP1-26-REMIND-MAGPIE, +# * SSPDB-SSP1-34-IMAGE,SSPDB-SSP1-34-REMIND-MAGPIE, +# * SSPDB-SSP1-37-REMIND-MAGPIE, +# * SSPDB-SSP1-45-IMAGE,SSPDB-SSP1-45-REMIND-MAGPIE, +# * SSPDB-SSP1-Ref-IMAGE,SSPDB-SSP1-Ref-REMIND-MAGPIE, +# * SSPDB-SSP2-18-MESSAGE-GLOBIOM,SSPDB-SSP2-19-MESSAGE-GLOBIOM, +# * SSPDB-SSP2-20-MESSAGE-GLOBIOM,SSPDB-SSP2-20-REMIND-MAGPIE, +# * SSPDB-SSP2-26-MESSAGE-GLOBIOM,SSPDB-SSP2-26-REMIND-MAGPIE, +# * SSPDB-SSP2-34-MESSAGE-GLOBIOM,SSPDB-SSP2-34-REMIND-MAGPIE, +# * SSPDB-SSP2-37-REMIND-MAGPIE, +# * SSPDB-SSP2-45-MESSAGE-GLOBIOM,SSPDB-SSP2-45-REMIND-MAGPIE, +# * SSPDB-SSP2-60-MESSAGE-GLOBIOM,SSPDB-SSP2-60-REMIND-MAGPIE, +# * SSPDB-SSP2-Ref-MESSAGE-GLOBIOM,SSPDB-SSP2-Ref-REMIND-MAGPIE, +# * SSPDB-SSP3-34-AIM-CGE,SSPDB-SSP3-45-AIM-CGE, +# * SSPDB-SSP3-60-AIM-CGE,SSPDB-SSP4-26-GCAM4, +# * SSPDB-SSP4-34-GCAM4,SSPDB-SSP4-45-GCAM4, +# * SSPDB-SSP4-60-GCAM4,SSPDB-SSP4-Ref-GCAM4, +# * SSPDB-SSP5-20-REMIND-MAGPIE,SSPDB-SSP5-26-REMIND-MAGPIE, +# * SSPDB-SSP5-34-REMIND-MAGPIE,SSPDB-SSP5-37-REMIND-MAGPIE, +# * SSPDB-SSP5-45-REMIND-MAGPIE,SSPDB-SSP5-60-REMIND-MAGPIE, +# * SSPDB-SSP5-Ref-REMIND-MAGPIE, +# * coupling +cfg$gms$c60_2ndgen_biodem <- "R2M41-SSP2-NPi" # def = R2M41-SSP2-NPi # * residue demand for 2nd generation bioenergy scenarios # * options: ssp1, ssp2, ssp3, ssp4, ssp5, off @@ -590,9 +585,14 @@ cfg$gms$s80_maxiter <- 30 # * (conopt4+conopt3): conopt4 followed by conopt3 cfg$gms$c80_nlp_solver <- "conopt4" # def = conopt4 +# number of allowed non-optimal variables +# Should be set to 0 for GAMS version 25.x.x or earlier +# Should be set to Inf for GAMS version 26.x.x or later +cfg$gms$s80_num_nonopt_allowed <- Inf + # * 1: using optfile for specified solver settings # * 0: default settings (optfile will be ignored) -cfg$gms$s80_optfile <- 1 +cfg$gms$s80_optfile <- 0 #*******************************END MODULE SETUP******************************** diff --git a/config/scenario_config.csv b/config/scenario_config.csv index 1b983e835c..fbda1f5810 100644 --- a/config/scenario_config.csv +++ b/config/scenario_config.csv @@ -10,9 +10,9 @@ c35_ad_policy;;;;;;;;none;npi;ndc;;;;;;;; c35_aolc_policy;;;;;;;;none;npi;ndc;;;;;;;; c42_env_flow_policy;;;on;off;off;mixed;on;;;;;;;on;off;off;mixed;on c50_scen_neff;;;neff65_70_starty2010;neff60_60_starty2010;neff55_60_starty2010;neff65_70_starty2010;neff55_60_starty2010;;;;;;;neff65_70_starty2010;neff60_60_starty2010;neff55_60_starty2010;neff65_70_starty2010;neff55_60_starty2010 -c56_pollutant_prices;;;;;;;;SSP2-Ref-SPA0-V15-REMIND-MAGPIE;;;coupling;emulator;coupling;SSP1-20-SPA1-V15-IMAGE;SSP2-26-SPA2-V15-MESSAGE-GLOBIOM;SSP3-60-SPA3-V15-AIM-CGE;SSP4-45-SPA4-V15-GCAM4;SSP5-45-SPA5-V15-REMIND-MAGPIE +c56_pollutant_prices;;;;;;;;;;;coupling;emulator;coupling;SSPDB-SSP1-20-IMAGE;SSPDB-SSP2-26-MESSAGE-GLOBIOM;SSPDB-SSP3-60-AIM-CGE;SSPDB-SSP4-45-GCAM4;SSPDB-SSP5-45-REMIND-MAGPIE maccs;;;;;;;;;;;;;;on_sep16;on_sep16;on_sep16;on_sep16;on_sep16 -c60_2ndgen_biodem;;;;;;;;SSP2-Ref-SPA0;;;coupling;emulator;coupling;SSP1-20-SPA1;SSP2-26-SPA2;SSP2-60-SPA2;SSP2-45-SPA2;SSP5-45-SPA5 +c60_2ndgen_biodem;;;;;;;;;;;coupling;emulator;coupling;SSPDB-SSP1-20-IMAGE;SSPDB-SSP2-26-MESSAGE-GLOBIOM;SSPDB-SSP3-60-AIM-CGE;SSPDB-SSP4-45-GCAM4;SSPDB-SSP5-45-REMIND-MAGPIE c60_1stgen_biodem;;;phaseout2020;const2020;const2030;const2020;phaseout2020;;;;;;;phaseout2020;const2020;const2030;const2020;phaseout2020 c60_biodem_level;;;;;;;;;;;1;0;;;;;; c60_res_2ndgenBE_dem;;;ssp1;ssp2;ssp3;ssp4;ssp5;;;;;;;ssp1;ssp2;ssp3;ssp4;ssp5 diff --git a/config/scenario_config_emulator.csv b/config/scenario_config_emulator.csv index 5ed6e01396..884c8a0bb7 100644 --- a/config/scenario_config_emulator.csv +++ b/config/scenario_config_emulator.csv @@ -1,8 +1,12 @@ title;start;mag_scen;co2tax_name;co2tax_2025 1;0;SSP1;26;48.1662949 -2;1;SSP2,BASE;Base;0 -3;1;SSP2,NDC;NDC;0 -4;1;SSP2,NDC;Budg1400;50.994783 -5;1;SSP2,NDC;Budg1050;76.6760042 -5;1;SSP2,NDC;Budg700;112.5146834 +2;0;SSP2,BASE;Base;0 +3;0;SSP2,NDC;NDC;0 +4;0;SSP2,NDC;Budg1300;45.6222 +5;0;SSP2,NDC;Budg950;75.2994 +5;0;SSP2,NDC;Budg600;109.097 6;0;SSP2;SSP2-26-SPA2-V15-REMIND-MAGPIE;built-in +7;1;SSP1,BASE;Base;0 +8;1;SSP1,NDC;NDC;0 +9;1;SSP1,NDC;Budg1300;48.31652 +11;1;SSP1,NDC;Budg600;114.629 diff --git a/core/calculations.gms b/core/calculations.gms index 7adff98c8d..77ca05b49e 100644 --- a/core/calculations.gms +++ b/core/calculations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 ****************************PREPROCESSING START********************************* diff --git a/core/declarations.gms b/core/declarations.gms index 842ba61bea..d2cb620761 100644 --- a/core/declarations.gms +++ b/core/declarations.gms @@ -1,11 +1,12 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de scalars sm_intersolve if 0 finish loop or if 1 iterate optimization (1) /0/ ; -*** EOF declarations.gms *** \ No newline at end of file +*** EOF declarations.gms *** diff --git a/core/load_gdx.gms b/core/load_gdx.gms index bcfe02e441..274a02e7eb 100644 --- a/core/load_gdx.gms +++ b/core/load_gdx.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 if((s_use_gdx > 0), diff --git a/core/macros.gms b/core/macros.gms index b3547492c3..f2441934c6 100644 --- a/core/macros.gms +++ b/core/macros.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 *****************************Technical macros*********************************** diff --git a/core/sets.gms b/core/sets.gms index 09b99570e1..345a9483a4 100644 --- a/core/sets.gms +++ b/core/sets.gms @@ -1,49 +1,50 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*************************BASIC SETS (INDICES)*********************************** - -*############################################################################### -*######################## R SECTION START (SETS) ############################### -*THIS CODE IS CREATED AUTOMATICALLY, DO NOT MODIFY THESE LINES DIRECTLY -*ANY DIRECT MODIFICATION WILL BE LOST AFTER NEXT INPUT DOWNLOAD -*CHANGES CAN BE DONE USING THE INPUT DOWNLOADER UNDER SCRIPTS/DOWNLOAD -*THERE YOU CAN ALSO FIND ADDITIONAL INFORMATION - -sets - - i World regions /CAZ,CHA,EUR,IND,JPN,LAM,MEA,NEU,OAS,REF,SSA,USA/ - - iso Countries / - ABW,AFG,AGO,AIA,ALA,ALB,AND,ARE,ARG,ARM, - ASM,ATA,ATF,ATG,AUS,AUT,AZE,BDI,BEL,BEN, - BES,BFA,BGD,BGR,BHR,BHS,BIH,BLM,BLR,BLZ, - BMU,BOL,BRA,BRB,BRN,BTN,BVT,BWA,CAF,CAN, - CCK,CHN,CHE,CHL,CIV,CMR,COD,COG,COK,COL, - COM,CPV,CRI,CUB,CUW,CXR,CYM,CYP,CZE,DEU, - DJI,DMA,DNK,DOM,DZA,ECU,EGY,ERI,ESH,ESP, - EST,ETH,FIN,FJI,FLK,FRA,FRO,FSM,GAB,GBR, - GEO,GGY,GHA,GIB,GIN,GLP,GMB,GNB,GNQ,GRC, - GRD,GRL,GTM,GUF,GUM,GUY,HKG,HMD,HND,HRV, - HTI,HUN,IDN,IMN,IND,IOT,IRL,IRN,IRQ,ISL, - ISR,ITA,JAM,JEY,JOR,JPN,KAZ,KEN,KGZ,KHM, - KIR,KNA,KOR,KWT,LAO,LBN,LBR,LBY,LCA,LIE, - LKA,LSO,LTU,LUX,LVA,MAC,MAF,MAR,MCO,MDA, - MDG,MDV,MEX,MHL,MKD,MLI,MLT,MMR,MNE,MNG, - MNP,MOZ,MRT,MSR,MTQ,MUS,MWI,MYS,MYT,NAM, - NCL,NER,NFK,NGA,NIC,NIU,NLD,NOR,NPL,NRU, - NZL,OMN,PAK,PAN,PCN,PER,PHL,PLW,PNG,POL, - PRI,PRK,PRT,PRY,PSE,PYF,QAT,REU,ROU,RUS, - RWA,SAU,SDN,SEN,SGP,SGS,SHN,SJM,SLB,SLE, - SLV,SMR,SOM,SPM,SRB,SSD,STP,SUR,SVK,SVN, - SWE,SWZ,SXM,SYC,SYR,TCA,TCD,TGO,THA,TJK, - TKL,TKM,TLS,TON,TTO,TUN,TUR,TUV,TWN,TZA, - UGA,UKR,UMI,URY,USA,UZB,VAT,VCT,VEN,VGB, - VIR,VNM,VUT,WLF,WSM,YEM,ZAF,ZMB,ZWE / - +*** | (C) 2008-2019 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 + +*************************BASIC SETS (INDICES)*********************************** + +*############################################################################### +*######################## R SECTION START (SETS) ############################### +*THIS CODE IS CREATED AUTOMATICALLY, DO NOT MODIFY THESE LINES DIRECTLY +*ANY DIRECT MODIFICATION WILL BE LOST AFTER NEXT INPUT DOWNLOAD +*CHANGES CAN BE DONE USING THE INPUT DOWNLOADER UNDER SCRIPTS/DOWNLOAD +*THERE YOU CAN ALSO FIND ADDITIONAL INFORMATION + +sets + + i World regions /CAZ,CHA,EUR,IND,JPN,LAM,MEA,NEU,OAS,REF,SSA,USA/ + + iso Countries / + ABW,AFG,AGO,AIA,ALA,ALB,AND,ARE,ARG,ARM, + ASM,ATA,ATF,ATG,AUS,AUT,AZE,BDI,BEL,BEN, + BES,BFA,BGD,BGR,BHR,BHS,BIH,BLM,BLR,BLZ, + BMU,BOL,BRA,BRB,BRN,BTN,BVT,BWA,CAF,CAN, + CCK,CHN,CHE,CHL,CIV,CMR,COD,COG,COK,COL, + COM,CPV,CRI,CUB,CUW,CXR,CYM,CYP,CZE,DEU, + DJI,DMA,DNK,DOM,DZA,ECU,EGY,ERI,ESH,ESP, + EST,ETH,FIN,FJI,FLK,FRA,FRO,FSM,GAB,GBR, + GEO,GGY,GHA,GIB,GIN,GLP,GMB,GNB,GNQ,GRC, + GRD,GRL,GTM,GUF,GUM,GUY,HKG,HMD,HND,HRV, + HTI,HUN,IDN,IMN,IND,IOT,IRL,IRN,IRQ,ISL, + ISR,ITA,JAM,JEY,JOR,JPN,KAZ,KEN,KGZ,KHM, + KIR,KNA,KOR,KWT,LAO,LBN,LBR,LBY,LCA,LIE, + LKA,LSO,LTU,LUX,LVA,MAC,MAF,MAR,MCO,MDA, + MDG,MDV,MEX,MHL,MKD,MLI,MLT,MMR,MNE,MNG, + MNP,MOZ,MRT,MSR,MTQ,MUS,MWI,MYS,MYT,NAM, + NCL,NER,NFK,NGA,NIC,NIU,NLD,NOR,NPL,NRU, + NZL,OMN,PAK,PAN,PCN,PER,PHL,PLW,PNG,POL, + PRI,PRK,PRT,PRY,PSE,PYF,QAT,REU,ROU,RUS, + RWA,SAU,SDN,SEN,SGP,SGS,SHN,SJM,SLB,SLE, + SLV,SMR,SOM,SPM,SRB,SSD,STP,SUR,SVK,SVN, + SWE,SWZ,SXM,SYC,SYR,TCA,TCD,TGO,THA,TJK, + TKL,TKM,TLS,TON,TTO,TUN,TUR,TUV,TWN,TZA, + UGA,UKR,UMI,URY,USA,UZB,VAT,VCT,VEN,VGB, + VIR,VNM,VUT,WLF,WSM,YEM,ZAF,ZMB,ZWE / + j Spatial clusters / CAZ_1*CAZ_28, CHA_29*CHA_52, @@ -56,268 +57,268 @@ sets OAS_151*OAS_172, REF_173*REF_179, SSA_180*SSA_190, - USA_191*USA_200/ - - cell(i,j) Mapping between regions i and clusters j - / - CAZ . CAZ_1*CAZ_28 - CHA . CHA_29*CHA_52 - EUR . EUR_53*EUR_62 - IND . IND_63*IND_69 - JPN . JPN_70*JPN_72 - LAM . LAM_73*LAM_125 - MEA . MEA_126*MEA_142 - NEU . NEU_143*NEU_150 - OAS . OAS_151*OAS_172 - REF . REF_173*REF_179 - SSA . SSA_180*SSA_190 - USA . USA_191*USA_200 - / - - i_to_iso(i,iso) Mapping between regions and countries - / - CAZ . (AUS,CAN,HMD,NZL,SPM) - CHA . (CHN,HKG,MAC,TWN) - EUR . (ALA,AUT,BEL,BGR,CYP,CZE,DEU,DNK,ESP,EST) - EUR . (FIN,FRA,FRO,GBR,GGY,GIB,GRC,HRV,HUN,IMN) - EUR . (IRL,ITA,JEY,LTU,LUX,LVA,MLT,NLD,POL,PRT) - EUR . (ROU,SVK,SVN,SWE) - IND . (IND) - JPN . (JPN) - LAM . (ABW,AIA,ARG,ATA,ATG,BES,BHS,BLM,BLZ,BMU) - LAM . (BOL,BRA,BRB,BVT,CHL,COL,CRI,CUB,CUW,CYM) - LAM . (DMA,DOM,ECU,FLK,GLP,GRD,GTM,GUF,GUY,HND) - LAM . (HTI,JAM,KNA,LCA,MAF,MEX,MSR,MTQ,NIC,PAN) - LAM . (PER,PRI,PRY,SGS,SLV,SUR,SXM,TCA,TTO,URY) - LAM . (VCT,VEN,VGB,VIR) - MEA . (ARE,BHR,DZA,EGY,ESH,IRN,IRQ,ISR,JOR,KWT) - MEA . (LBN,LBY,MAR,OMN,PSE,QAT,SAU,SDN,SYR,TUN) - MEA . (YEM) - NEU . (ALB,AND,BIH,CHE,GRL,ISL,LIE,MCO,MKD,MNE) - NEU . (NOR,SJM,SMR,SRB,TUR,VAT) - OAS . (AFG,ASM,ATF,BGD,BRN,BTN,CCK,COK,CXR,FJI) - OAS . (FSM,GUM,IDN,IOT,KHM,KIR,KOR,LAO,LKA,MDV) - OAS . (MHL,MMR,MNG,MNP,MYS,NCL,NFK,NIU,NPL,NRU) - OAS . (PAK,PCN,PHL,PLW,PNG,PRK,PYF,SGP,SLB,THA) - OAS . (TKL,TLS,TON,TUV,UMI,VNM,VUT,WLF,WSM) - REF . (ARM,AZE,BLR,GEO,KAZ,KGZ,MDA,RUS,TJK,TKM) - REF . (UKR,UZB) - SSA . (AGO,BDI,BEN,BFA,BWA,CAF,CIV,CMR,COD,COG) - SSA . (COM,CPV,DJI,ERI,ETH,GAB,GHA,GIN,GMB,GNB) - SSA . (GNQ,KEN,LBR,LSO,MDG,MLI,MOZ,MRT,MUS,MWI) - SSA . (MYT,NAM,NER,NGA,REU,RWA,SEN,SHN,SLE,SOM) - SSA . (SSD,STP,SWZ,SYC,TCD,TGO,TZA,UGA,ZAF,ZMB) - SSA . (ZWE) - USA . (USA) - / -; -*######################### R SECTION END (SETS) ################################ -*############################################################################### - -sets - i2(i) World regions (dynamic set) - j2(j) Spatial Clusters (dynamic set) -; -i2(i) = yes; -j2(j) = yes; - - -***TIME STEPS*** -* ATTENTION: check macros m_year and m_yeardiff if you change something -* here as they need to make some assumption about these settings, -* especially having 1965 as start year, having t2 as alias of t and -* having ct as current time step -sets time_annual Annual extended time steps - / y1965*y2150 / - - t_all 5-year time periods - / y1965, y1970, y1975, y1980, y1985, y1990, - y1995, y2000, y2005, y2010, y2015, y2020, y2025, y2030, y2035, y2040, - y2045, y2050, y2055, y2060, y2065, y2070, y2075, y2080, y2085, y2090, - y2095, y2100, y2105, y2110, y2115, y2120, y2125, y2130, y2135, y2140, - y2145, y2150 / - - t_past(t_all) Timesteps with observed data - / y1965, y1970, y1975, - y1980, y1985, y1990, - y1995, y2000, y2005, y2010 - / -; - -set t(t_all) Simulated time periods -$If "%c_timesteps%"== "less_TS" /y1995,y2000,y2005,y2010,y2015,y2020,y2025,y2030,y2035,y2040,y2045,y2050,y2055,y2060,y2070,y2080,y2090,y2100,y2110,y2130,y2150/; -$If "%c_timesteps%"== "coup2100" /y1995,y2000,y2005,y2010,y2015,y2020,y2025,y2030,y2035,y2040,y2045,y2050,y2055,y2060,y2070,y2080,y2090,y2100/; -$If "%c_timesteps%"== "test_TS" /y1995,y2000,y2005,y2010,y2020,y2030,y2040,y2050,y2070,y2090,y2110,y2130,y2150/; -$If "%c_timesteps%"== "TS_benni" /y1995,y2000,y2005,y2010,y2020,y2030,y2040,y2050/; -$If "%c_timesteps%"== "TS_WB" /y1995,y2000,y2005,y2010,y2020,y2030,y2040,y2050,y2060,y2070,y2080/; -$If "%c_timesteps%"== "5year" /y1995,y2000,y2005,y2010,y2015,y2020,y2025,y2030,y2035,y2040,y2045,y2050,y2055,y2060,y2065,y2070,y2075,y2080,y2085,y2090,y2095,y2100/; -$If "%c_timesteps%"== "5year2050" /y1995,y2000,y2005,y2010,y2015,y2020,y2025,y2030,y2035,y2040,y2045,y2050/; -$If "%c_timesteps%"== "quicktest" /y1995,y2010,y2025/; -$If "%c_timesteps%"== "1" /y1995/; -$If "%c_timesteps%"== "2" /y1995,y2000/; -$If "%c_timesteps%"== "3" /y1995,y2000,y2010/; -$If "%c_timesteps%"== "4" /y1995,y2000,y2010,y2020/; -$If "%c_timesteps%"== "5" /y1995,y2000,y2010,y2020,y2030/; -$If "%c_timesteps%"== "6" /y1995,y2000,y2010,y2020,y2030,y2040/; -$If "%c_timesteps%"== "7" /y1995,y2000,y2010,y2020,y2030,y2040,y2050/; -$If "%c_timesteps%"== "8" /y1995,y2000,y2010,y2020,y2030,y2040,y2050,y2060/; -$If "%c_timesteps%"== "9" /y1995,y2000,y2010,y2020,y2030,y2040,y2050,y2060,y2070/; -$If "%c_timesteps%"=="10" /y1995,y2000,y2010,y2020,y2030,y2040,y2050,y2060,y2070,y2080/; -$If "%c_timesteps%"=="11" /y1995,y2000,y2010,y2020,y2030,y2040,y2050,y2060,y2070,y2080,y2090/; -$If "%c_timesteps%"=="12" /y1995,y2000,y2010,y2020,y2030,y2040,y2050,y2060,y2070,y2080,y2090,y2100/; -$If "%c_timesteps%"=="13" /y1995,y2000,y2010,y2020,y2030,y2040,y2050,y2060,y2070,y2080,y2090,y2100,y2110/; -$If "%c_timesteps%"=="14" /y1995,y2000,y2010,y2020,y2030,y2040,y2050,y2060,y2070,y2080,y2090,y2100,y2110,y2120/; -$If "%c_timesteps%"=="15" /y1995,y2000,y2010,y2020,y2030,y2040,y2050,y2060,y2070,y2080,y2090,y2100,y2110,y2120,y2130/; -$If "%c_timesteps%"=="16" /y1995,y2000,y2010,y2020,y2030,y2040,y2050,y2060,y2070,y2080,y2090,y2100,y2110,y2120,y2130,y2140/; -$If "%c_timesteps%"=="17" /y1995,y2000,y2010,y2020,y2030,y2040,y2050,y2060,y2070,y2080,y2090,y2100,y2110,y2120,y2130,y2140,y2150/; -$If "%c_timesteps%"=="past" /y1965,y1970,y1975,y1980,y1985,y1990,y1995,y2000,y2005,y2010/; -$If "%c_timesteps%"=="pastandfuture" /y1965,y1970,y1975,y1980,y1985,y1990,y1995,y2000,y2005,y2010,y2015,y2020,y2025,y2030,y2035,y2040,y2045,y2050,y2055,y2060,y2065,y2070,y2075,y2080,y2085,y2090,y2095,y2100/; -set ct(t) Current time period; - -alias(t,t2); - -sets - -***Products*** - - kall All products in the sectoral version - / - tece,maiz,trce,rice_pro,soybean,rapeseed,groundnut,sunflower,oilpalm,puls_pro, - potato,cassav_sp,sugr_cane,sugr_beet,others,cottn_pro,foddr, pasture, begr, betr, - oils,oilcakes,sugar,molasses,alcohol,ethanol,distillers_grain,brans,scp,fibres, - livst_rum, livst_pig,livst_chick, livst_egg, livst_milk, fish, - res_cereals, res_fibrous, res_nonfibrous, wood, woodfuel - / - - dev Economic development status - / lic, mic, hic / - -***TYPE OF WATER SUPPLY*** - w Water supply type / rainfed, irrigated / - -***WATER SOURCES*** - wat_src Type of water source / surface, ground, technical, ren_ground / - -***WATER DEMAND sectors*** - wat_dem Water demand sectors / agriculture, industry, electricity, domestic, ecosystem / - -***LAND POOLS*** - land Land pools - / crop, past, forestry, primforest, secdforest, urban, other / - - land_ag(land) Agricultural land pools - / crop, past / - - land_natveg(land) Natural vegetation land pools - / primforest, secdforest, other / - - si Suitability classes - / si0, nsi0 / - -***Forestry** - ac Age classes / ac0,ac5,ac10,ac15,ac20,ac25,ac30,ac35,ac40,ac45,ac50, - ac55,ac60,ac65,ac70,ac75,ac80,ac85,ac90,ac95,ac100, - ac105,ac110,ac115,ac120,ac125,ac130,ac135,ac140,ac145,ac150, - ac155,ac160,ac165,ac170,ac175,ac180,ac185,ac190,ac195,ac200, - ac205,ac210,ac215,ac220,ac225,ac230,ac235,ac240,ac245,ac250, - ac255,ac260,ac265,ac270,ac275,ac280,ac285,ac290,ac295,acx / - - when Temporal location relative to optimization / before, after / - - chap_par Chapman-richards parameters / k,m / - -*** Nutrients - attributes Product attributes characterizing a product (such as weight or energy content) - /dm,ge,nr,p,k,wm,c/ -* dry matter, gross energy, reactive nitrogen, phosphorus, potash, wet matters - - nutrients(attributes) Nutrient related product attributes - /dm,ge,nr,p,k/ - - dm_ge_nr(nutrients) Attribtues relevant for nutrition - / dm,ge,nr / - - npk(nutrients) Plant nutrients - /nr,p,k/ - - cgf Residue production functions - /slope, intercept, bg_to_ag/ - -***Emissions *** - - emis_source Emission sources - / inorg_fert, man_crop, awms, resid, man_past, som, - rice, ent_ferm, - resid_burn, - crop_vegc, crop_litc, crop_soilc, - past_vegc, past_litc, past_soilc, - forestry_vegc, forestry_litc, forestry_soilc, - primforest_vegc, primforest_litc, primforest_soilc, -secdforest_vegc, secdforest_litc, secdforest_soilc, urban_vegc, urban_litc, urban_soilc, - other_vegc, other_litc, other_soilc, - beccs/ - - emis_source_reg(emis_source) Regional emission sources - / inorg_fert, man_crop, awms, resid, man_past, som, - rice, ent_ferm, beccs / - - emis_source_cell(emis_source) Cellular emission sources - / crop_vegc, crop_litc, crop_soilc, - past_vegc, past_litc, past_soilc, - forestry_vegc, forestry_litc, forestry_soilc, - primforest_vegc, primforest_litc, primforest_soilc, -secdforest_vegc, secdforest_litc, secdforest_soilc, urban_vegc, urban_litc, urban_soilc, - other_vegc, other_litc, other_soilc / - - emis_co2(emis_source_cell) Land pool CO2 emission sources - / crop_vegc, crop_litc, crop_soilc, - past_vegc, past_litc, past_soilc, - forestry_vegc, forestry_litc, forestry_soilc, - primforest_vegc, primforest_litc, primforest_soilc, -secdforest_vegc, secdforest_litc, secdforest_soilc, urban_vegc, urban_litc, urban_soilc, - other_vegc, other_litc, other_soilc / - - co2_forestry(emis_source_cell) Sources of forestry land CO2 emissions - /forestry_vegc, forestry_litc, forestry_soilc/ - - c_pools Carbon pools - /vegc,litc,soilc/ - -***TECHNICAL STUFF*** - type GAMS variable attribute used for the output / level, marginal, upper, lower / - -***RELATIONSHIPS BETWEEN DIFFERENT SETS*** - - emis_land(emis_co2,land,c_pools) Mapping between land and carbon pools - /crop_vegc . (crop) . (vegc) - crop_litc . (crop) . (litc) - crop_soilc . (crop) . (soilc) - past_vegc . (past) . (vegc) - past_litc . (past) . (litc) - past_soilc . (past) . (soilc) - forestry_vegc . (forestry) . (vegc) - forestry_litc . (forestry) . (litc) - forestry_soilc . (forestry) . (soilc) - primforest_vegc . (primforest) . (vegc) - primforest_litc . (primforest) . (litc) - primforest_soilc . (primforest) . (soilc) - secdforest_vegc . (secdforest) . (vegc) - secdforest_litc . (secdforest) . (litc) - secdforest_soilc . (secdforest) . (soilc) - urban_vegc . (urban) . (vegc) - urban_litc . (urban) . (litc) - urban_soilc . (urban) . (soilc) - other_vegc . (other) . (vegc) - other_litc . (other) . (litc) - other_soilc . (other) . (soilc) - / - - emis_co2_to_forestry(co2_forestry,c_pools) Mapping between forestry land and carbon pools - /forestry_vegc . (vegc) - forestry_litc . (litc) - forestry_soilc . (soilc) - / - -; - -*** EOF sets.gms *** + USA_191*USA_200/ + + cell(i,j) Mapping between regions i and clusters j + / + CAZ . CAZ_1*CAZ_28 + CHA . CHA_29*CHA_52 + EUR . EUR_53*EUR_62 + IND . IND_63*IND_69 + JPN . JPN_70*JPN_72 + LAM . LAM_73*LAM_125 + MEA . MEA_126*MEA_142 + NEU . NEU_143*NEU_150 + OAS . OAS_151*OAS_172 + REF . REF_173*REF_179 + SSA . SSA_180*SSA_190 + USA . USA_191*USA_200 + / + + i_to_iso(i,iso) Mapping between regions and countries + / + CAZ . (AUS,CAN,HMD,NZL,SPM) + CHA . (CHN,HKG,MAC,TWN) + EUR . (ALA,AUT,BEL,BGR,CYP,CZE,DEU,DNK,ESP,EST) + EUR . (FIN,FRA,FRO,GBR,GGY,GIB,GRC,HRV,HUN,IMN) + EUR . (IRL,ITA,JEY,LTU,LUX,LVA,MLT,NLD,POL,PRT) + EUR . (ROU,SVK,SVN,SWE) + IND . (IND) + JPN . (JPN) + LAM . (ABW,AIA,ARG,ATA,ATG,BES,BHS,BLM,BLZ,BMU) + LAM . (BOL,BRA,BRB,BVT,CHL,COL,CRI,CUB,CUW,CYM) + LAM . (DMA,DOM,ECU,FLK,GLP,GRD,GTM,GUF,GUY,HND) + LAM . (HTI,JAM,KNA,LCA,MAF,MEX,MSR,MTQ,NIC,PAN) + LAM . (PER,PRI,PRY,SGS,SLV,SUR,SXM,TCA,TTO,URY) + LAM . (VCT,VEN,VGB,VIR) + MEA . (ARE,BHR,DZA,EGY,ESH,IRN,IRQ,ISR,JOR,KWT) + MEA . (LBN,LBY,MAR,OMN,PSE,QAT,SAU,SDN,SYR,TUN) + MEA . (YEM) + NEU . (ALB,AND,BIH,CHE,GRL,ISL,LIE,MCO,MKD,MNE) + NEU . (NOR,SJM,SMR,SRB,TUR,VAT) + OAS . (AFG,ASM,ATF,BGD,BRN,BTN,CCK,COK,CXR,FJI) + OAS . (FSM,GUM,IDN,IOT,KHM,KIR,KOR,LAO,LKA,MDV) + OAS . (MHL,MMR,MNG,MNP,MYS,NCL,NFK,NIU,NPL,NRU) + OAS . (PAK,PCN,PHL,PLW,PNG,PRK,PYF,SGP,SLB,THA) + OAS . (TKL,TLS,TON,TUV,UMI,VNM,VUT,WLF,WSM) + REF . (ARM,AZE,BLR,GEO,KAZ,KGZ,MDA,RUS,TJK,TKM) + REF . (UKR,UZB) + SSA . (AGO,BDI,BEN,BFA,BWA,CAF,CIV,CMR,COD,COG) + SSA . (COM,CPV,DJI,ERI,ETH,GAB,GHA,GIN,GMB,GNB) + SSA . (GNQ,KEN,LBR,LSO,MDG,MLI,MOZ,MRT,MUS,MWI) + SSA . (MYT,NAM,NER,NGA,REU,RWA,SEN,SHN,SLE,SOM) + SSA . (SSD,STP,SWZ,SYC,TCD,TGO,TZA,UGA,ZAF,ZMB) + SSA . (ZWE) + USA . (USA) + / +; +*######################### R SECTION END (SETS) ################################ +*############################################################################### + +sets + i2(i) World regions (dynamic set) + j2(j) Spatial Clusters (dynamic set) +; +i2(i) = yes; +j2(j) = yes; + + +***TIME STEPS*** +* ATTENTION: check macros m_year and m_yeardiff if you change something +* here as they need to make some assumption about these settings, +* especially having 1965 as start year, having t2 as alias of t and +* having ct as current time step +sets time_annual Annual extended time steps + / y1965*y2150 / + + t_all 5-year time periods + / y1965, y1970, y1975, y1980, y1985, y1990, + y1995, y2000, y2005, y2010, y2015, y2020, y2025, y2030, y2035, y2040, + y2045, y2050, y2055, y2060, y2065, y2070, y2075, y2080, y2085, y2090, + y2095, y2100, y2105, y2110, y2115, y2120, y2125, y2130, y2135, y2140, + y2145, y2150 / + + t_past(t_all) Timesteps with observed data + / y1965, y1970, y1975, + y1980, y1985, y1990, + y1995, y2000, y2005, y2010 + / +; + +set t(t_all) Simulated time periods +$If "%c_timesteps%"== "less_TS" /y1995,y2000,y2005,y2010,y2015,y2020,y2025,y2030,y2035,y2040,y2045,y2050,y2055,y2060,y2070,y2080,y2090,y2100,y2110,y2130,y2150/; +$If "%c_timesteps%"== "coup2100" /y1995,y2000,y2005,y2010,y2015,y2020,y2025,y2030,y2035,y2040,y2045,y2050,y2055,y2060,y2070,y2080,y2090,y2100/; +$If "%c_timesteps%"== "test_TS" /y1995,y2000,y2005,y2010,y2020,y2030,y2040,y2050,y2070,y2090,y2110,y2130,y2150/; +$If "%c_timesteps%"== "TS_benni" /y1995,y2000,y2005,y2010,y2020,y2030,y2040,y2050/; +$If "%c_timesteps%"== "TS_WB" /y1995,y2000,y2005,y2010,y2020,y2030,y2040,y2050,y2060,y2070,y2080/; +$If "%c_timesteps%"== "5year" /y1995,y2000,y2005,y2010,y2015,y2020,y2025,y2030,y2035,y2040,y2045,y2050,y2055,y2060,y2065,y2070,y2075,y2080,y2085,y2090,y2095,y2100/; +$If "%c_timesteps%"== "5year2050" /y1995,y2000,y2005,y2010,y2015,y2020,y2025,y2030,y2035,y2040,y2045,y2050/; +$If "%c_timesteps%"== "quicktest" /y1995,y2010,y2025/; +$If "%c_timesteps%"== "1" /y1995/; +$If "%c_timesteps%"== "2" /y1995,y2000/; +$If "%c_timesteps%"== "3" /y1995,y2000,y2010/; +$If "%c_timesteps%"== "4" /y1995,y2000,y2010,y2020/; +$If "%c_timesteps%"== "5" /y1995,y2000,y2010,y2020,y2030/; +$If "%c_timesteps%"== "6" /y1995,y2000,y2010,y2020,y2030,y2040/; +$If "%c_timesteps%"== "7" /y1995,y2000,y2010,y2020,y2030,y2040,y2050/; +$If "%c_timesteps%"== "8" /y1995,y2000,y2010,y2020,y2030,y2040,y2050,y2060/; +$If "%c_timesteps%"== "9" /y1995,y2000,y2010,y2020,y2030,y2040,y2050,y2060,y2070/; +$If "%c_timesteps%"=="10" /y1995,y2000,y2010,y2020,y2030,y2040,y2050,y2060,y2070,y2080/; +$If "%c_timesteps%"=="11" /y1995,y2000,y2010,y2020,y2030,y2040,y2050,y2060,y2070,y2080,y2090/; +$If "%c_timesteps%"=="12" /y1995,y2000,y2010,y2020,y2030,y2040,y2050,y2060,y2070,y2080,y2090,y2100/; +$If "%c_timesteps%"=="13" /y1995,y2000,y2010,y2020,y2030,y2040,y2050,y2060,y2070,y2080,y2090,y2100,y2110/; +$If "%c_timesteps%"=="14" /y1995,y2000,y2010,y2020,y2030,y2040,y2050,y2060,y2070,y2080,y2090,y2100,y2110,y2120/; +$If "%c_timesteps%"=="15" /y1995,y2000,y2010,y2020,y2030,y2040,y2050,y2060,y2070,y2080,y2090,y2100,y2110,y2120,y2130/; +$If "%c_timesteps%"=="16" /y1995,y2000,y2010,y2020,y2030,y2040,y2050,y2060,y2070,y2080,y2090,y2100,y2110,y2120,y2130,y2140/; +$If "%c_timesteps%"=="17" /y1995,y2000,y2010,y2020,y2030,y2040,y2050,y2060,y2070,y2080,y2090,y2100,y2110,y2120,y2130,y2140,y2150/; +$If "%c_timesteps%"=="past" /y1965,y1970,y1975,y1980,y1985,y1990,y1995,y2000,y2005,y2010/; +$If "%c_timesteps%"=="pastandfuture" /y1965,y1970,y1975,y1980,y1985,y1990,y1995,y2000,y2005,y2010,y2015,y2020,y2025,y2030,y2035,y2040,y2045,y2050,y2055,y2060,y2065,y2070,y2075,y2080,y2085,y2090,y2095,y2100/; +set ct(t) Current time period; + +alias(t,t2); + +sets + +***Products*** + + kall All products in the sectoral version + / + tece,maiz,trce,rice_pro,soybean,rapeseed,groundnut,sunflower,oilpalm,puls_pro, + potato,cassav_sp,sugr_cane,sugr_beet,others,cottn_pro,foddr, pasture, begr, betr, + oils,oilcakes,sugar,molasses,alcohol,ethanol,distillers_grain,brans,scp,fibres, + livst_rum, livst_pig,livst_chick, livst_egg, livst_milk, fish, + res_cereals, res_fibrous, res_nonfibrous, wood, woodfuel + / + + dev Economic development status + / lic, mic, hic / + +***TYPE OF WATER SUPPLY*** + w Water supply type / rainfed, irrigated / + +***WATER SOURCES*** + wat_src Type of water source / surface, ground, technical, ren_ground / + +***WATER DEMAND sectors*** + wat_dem Water demand sectors / agriculture, industry, electricity, domestic, ecosystem / + +***LAND POOLS*** + land Land pools + / crop, past, forestry, primforest, secdforest, urban, other / + + land_ag(land) Agricultural land pools + / crop, past / + + land_natveg(land) Natural vegetation land pools + / primforest, secdforest, other / + + si Suitability classes + / si0, nsi0 / + +***Forestry** + ac Age classes / ac0,ac5,ac10,ac15,ac20,ac25,ac30,ac35,ac40,ac45,ac50, + ac55,ac60,ac65,ac70,ac75,ac80,ac85,ac90,ac95,ac100, + ac105,ac110,ac115,ac120,ac125,ac130,ac135,ac140,ac145,ac150, + ac155,ac160,ac165,ac170,ac175,ac180,ac185,ac190,ac195,ac200, + ac205,ac210,ac215,ac220,ac225,ac230,ac235,ac240,ac245,ac250, + ac255,ac260,ac265,ac270,ac275,ac280,ac285,ac290,ac295,acx / + + when Temporal location relative to optimization / before, after / + + chap_par Chapman-richards parameters / k,m / + +*** Nutrients + attributes Product attributes characterizing a product (such as weight or energy content) + /dm,ge,nr,p,k,wm,c/ +* dry matter, gross energy, reactive nitrogen, phosphorus, potash, wet matters + + nutrients(attributes) Nutrient related product attributes + /dm,ge,nr,p,k/ + + dm_ge_nr(nutrients) Attribtues relevant for nutrition + / dm,ge,nr / + + npk(nutrients) Plant nutrients + /nr,p,k/ + + cgf Residue production functions + /slope, intercept, bg_to_ag/ + +***Emissions *** + + emis_source Emission sources + / inorg_fert, man_crop, awms, resid, man_past, som, + rice, ent_ferm, + resid_burn, + crop_vegc, crop_litc, crop_soilc, + past_vegc, past_litc, past_soilc, + forestry_vegc, forestry_litc, forestry_soilc, + primforest_vegc, primforest_litc, primforest_soilc, +secdforest_vegc, secdforest_litc, secdforest_soilc, urban_vegc, urban_litc, urban_soilc, + other_vegc, other_litc, other_soilc, + beccs/ + + emis_source_reg(emis_source) Regional emission sources + / inorg_fert, man_crop, awms, resid, man_past, som, + rice, ent_ferm, beccs / + + emis_source_cell(emis_source) Cellular emission sources + / crop_vegc, crop_litc, crop_soilc, + past_vegc, past_litc, past_soilc, + forestry_vegc, forestry_litc, forestry_soilc, + primforest_vegc, primforest_litc, primforest_soilc, +secdforest_vegc, secdforest_litc, secdforest_soilc, urban_vegc, urban_litc, urban_soilc, + other_vegc, other_litc, other_soilc / + + emis_co2(emis_source_cell) Land pool CO2 emission sources + / crop_vegc, crop_litc, crop_soilc, + past_vegc, past_litc, past_soilc, + forestry_vegc, forestry_litc, forestry_soilc, + primforest_vegc, primforest_litc, primforest_soilc, +secdforest_vegc, secdforest_litc, secdforest_soilc, urban_vegc, urban_litc, urban_soilc, + other_vegc, other_litc, other_soilc / + + co2_forestry(emis_source_cell) Sources of forestry land CO2 emissions + /forestry_vegc, forestry_litc, forestry_soilc/ + + c_pools Carbon pools + /vegc,litc,soilc/ + +***TECHNICAL STUFF*** + type GAMS variable attribute used for the output / level, marginal, upper, lower / + +***RELATIONSHIPS BETWEEN DIFFERENT SETS*** + + emis_land(emis_co2,land,c_pools) Mapping between land and carbon pools + /crop_vegc . (crop) . (vegc) + crop_litc . (crop) . (litc) + crop_soilc . (crop) . (soilc) + past_vegc . (past) . (vegc) + past_litc . (past) . (litc) + past_soilc . (past) . (soilc) + forestry_vegc . (forestry) . (vegc) + forestry_litc . (forestry) . (litc) + forestry_soilc . (forestry) . (soilc) + primforest_vegc . (primforest) . (vegc) + primforest_litc . (primforest) . (litc) + primforest_soilc . (primforest) . (soilc) + secdforest_vegc . (secdforest) . (vegc) + secdforest_litc . (secdforest) . (litc) + secdforest_soilc . (secdforest) . (soilc) + urban_vegc . (urban) . (vegc) + urban_litc . (urban) . (litc) + urban_soilc . (urban) . (soilc) + other_vegc . (other) . (vegc) + other_litc . (other) . (litc) + other_soilc . (other) . (soilc) + / + + emis_co2_to_forestry(co2_forestry,c_pools) Mapping between forestry land and carbon pools + /forestry_vegc . (vegc) + forestry_litc . (litc) + forestry_soilc . (soilc) + / + +; + +*** EOF sets.gms *** diff --git a/doc/literature.bib b/literature.bib similarity index 99% rename from doc/literature.bib rename to literature.bib index 11486cdba9..ed5c607346 100644 --- a/doc/literature.bib +++ b/literature.bib @@ -1,3 +1,15 @@ +@Article{dietrich_magpie4, + AUTHOR = {Dietrich, J. P. and Bodirsky, B. L. and Humpen\"oder, F. and Weindl, I. and Stevanovi\'c, M. and Karstens, K. and Kreidenweis, U. and Wang, X. and Mishra, A. and Klein, D. and Ambr\'osio, G. and Araujo, E. and Yalew, A. W. and Baumstark, L. and Wirth, S. and Giannousakis, A. and Beier, F. and Chen, D. M.-C. and Lotze-Campen, H. and Popp, A.}, + TITLE = {MAgPIE 4 -- a~modular open-source framework for modeling global land systems}, + JOURNAL = {Geoscientific Model Development}, + VOLUME = {12}, + YEAR = {2019}, + NUMBER = {4}, + PAGES = {1299--1317}, + URL = {https://www.geosci-model-dev.net/12/1299/2019/}, + DOI = {10.5194/gmd-12-1299-2019} +} + @article{bodirsky_starved_nodate, title = {From starved to stuffed: {Long}-term dynamics of diets and anthropometrics.}, author = {Bodirsky, Benjamin Leon and Dietrich, Jan Philipp and Martinelli, Eleonora and Stenstad, Anthonia and Pradhan, Prajal and Rolinski, Susanne and Gabrysch, Sabine and Mishra, Abhijit and Le-Mouel, Chantal and Baumstark, Lavinia and Wang, Xiaoxi and Lotze-Campen, Hermann and Popp, Alexander} diff --git a/doc/images/logo.png b/logo.png similarity index 100% rename from doc/images/logo.png rename to logo.png diff --git a/main.gms b/main.gms index 5a935ca0b4..1af3a612ba 100644 --- a/main.gms +++ b/main.gms @@ -1,259 +1,255 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -$title magpie - -*' @title MAgPIE - Modelling Framework -*' -*' @description The *Model of Agricultural Production and its Impact on the -*' Environment* (MAgPIE) is developed and used to assess the competition for -*' land and water and the associated consequences for sustainable development -*' under future scenarios of rising food, energy and material demand as well -*' as production, climate change impacts and greenhouse gas mitigation and -*' different land related policies. -*' -*' MAgPIE is a global partial equilibrium model of the land-use sector that operates -*' in a recursive dynamic mode and incorporates spatially explicit information on -*' biophysical constraints into an economic decision making process (@lotze-campen_global_2008). -*' It takes regional economic conditions such as elastic demand for agricultural commodities, -*' technological development and production costs as well as spatially explicit data on biophysical -*' constraints into account. Geographically explicit data on biophysical conditions are provided -*' by the Lund-Potsdam-Jena managed land model (LPJmL) (@bondeau_lpjml_2007, @mueller_projecting_2014) -*' on a 0.5 degree resolution and include e.g. carbon densities of different vegetation types, -*' agricultural productivity such as crop yields and water availability for irrigation. Based on -*' the strong interaction with LPJmL, MAgPIE can also help to assess the consequences of climate -*' change and increased CO2 in the atmosphere on the land-use sector (@stevanovic_impact_2016) -*' -*' Available land types in MAgPIE are cropland, pasture area, forest, other land -*' (including non-forest natural vegetation, abandoned agricultural land and deserts) -*' and settlements. Cropland (rainfed and irrigated), pasture, forest and other land -*' are endogenously determined, while settlement areas are assumed to be constant over time. -*' The cropland covers cultivation of different crop types (e.g. temperate and tropical -*' cereals, maize, rice, oilseeds, roots), both rainfed and irrigated systems, and two -*' 2nd generation bioenergy crop types (grassy and woody). -*' -*' Taking into account international trade based on historical trade patterns and economic -*' competitiveness ([21_trade]), global production has to meet demand for food, -*' feed, seed, processing, bioenergy and material demand ([16_demand]). Food demand is -*' derived based on population growth ([09_drivers]) and dietary transitions, accounting -*' for changes in intake and food waste, the shift in the share of animal calories, -*' processed products, fruits and vegetables as well as staples ([15_food]). -*' Primary products can be processed to secondary products such as sugar, oil -*' or ethanol ([20_processing]). The quantity of livestock production in -*' combination with dynamic regional and livestock-specific feed baskets determines the -*' demand for feed ([70_livestock]). The supply of animal-based food commodities is divided into five livestock production -*' activities (ruminant meat, pig meat, poultry meat, eggs and milk) (@weindl_livestock_2017-1). -*' The spatial distribution of crops ([30_crop]), livestock ([71_disagg_lvst]) -*' and pasture ([31_past]) in MAgPIE is guided by geographically explicit -*' information on vegetation growth and the balance between crop water -*' demand and water availability, by initial land cover distribution maps -*' as well as by economic conditions like trade barriers ([21_trade]), management intensity ([13_tc]) -*' and transport costs ([40_transport]). It therefore integrates information about market access into -*' the model's optimization process that determines where cropping activities and livestock production -*' are allocated to. Parts of forests and other natural land area can be excluded from conversion into -*' agricultural land if designated for wood production or located in protected areas ([32_forestry], -*' [35_natveg]) (@kreidenweis_pasture_2018). -*' -*' Due to computational constraints, all model inputs in 0.5 degree resolution are aggregated -*' to simulation units for the optimization process ([80_optimization]) based on a clustering -*' algorithm (@dietrich_reducing_2013). -*' -*' MAgPIE estimates flows of different land-based greenhouse gases (GHGs). CO2 emissions are computed -*' from land-use change dynamics, i.e. from conversion of different biomes into agricultural land -*' and consequent loss of terrestrial carbon stocks (@popp_land-use_2014), also including the -*' depletion of organic matter in soils ([59_som]). The land also serves as a sink for atmospheric -*' carbon when agricultural land is set aside from production and the associated regrowth of natural -*' vegetation generates negative emissions from land-use change. -*' Nitrogen emissions ([51_nitrogen]) are estimated based on nitrogen budgets for croplands, -*' pastures ([50_nr_budgets]) and the livestock sector ([55_awms]) (@bodirsky_reactive_2014). -*' CH4 emissions are based on -*' livestock feed and rice cultivation areas (@popp_food_2010). In the case of mitigation -*' policies for the land sector, the model can reduce CO2 emissions by restraining land-use -*' conversion and consequent carbon release as well as CH4 and N emissions by applying improved -*' agricultural management (such as anaerobic digesters for CH4 capture from animal waste, or use -*' of fertilizer spreaders) (@popp_land-use_2014, @stevanovic_mitigation_2017). In addition, -*' the model covers land-based carbon removal technologies such as bioenergy with carbon capture -*' and sequestration (CCS) and afforestation (@humpenoder_investigating_2014, -*' @humpenoder_large-scale_2017, @kreidenweis_afforestation_2016). -*' -*' In response to all involved demand for agricultural commodities, costs of production, -*' biophysical constraints and land-related policies, MAgPIE simulates major dynamics of -*' the land-use sector like investments in research and development (R&D) ([13_tc]) (@dietrich_forecasting_2014) -*' and associated increases in both crop yields ([14_yields]) and biomass removal through grazing on -*' pastures ([31_past]), land use change ([39_landconversion]), interregional trade flows ([21_trade]), -*' and irrigation ([41_area_equipped_for_irrigation]). - - - - -*##################### R SECTION START (VERSION INFO) ########################## -* -* Used data set: magpie4.0_default_sep18.tgz -* md5sum: 98e158205482936e487aeb616dea5403 -* Repository: https://rse.pik-potsdam.de/data/magpie/public -* -* Used data set: additional_data_rev3.66.tgz -* md5sum: b3a269f6640883cb2cd69d65311800d3 -* Repository: /p/projects/landuse/data/input/archive -* -* 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 -* 28 24 10 7 3 53 17 8 22 7 11 10 -* -* Regionscode: 690d3718e151be1b450b394c1064b1c5 -* -* Regions data revision: 4.14 -* -* lpj2magpie settings: -* * LPJmL data folder: /p/projects/landuse/data/input/lpj_input/isimip_rcp/IPSL_CM5A_LR/rcp2p6/co2 -* * Additional input folder: /p/projects/landuse/data/input/other/rev34 -* * Revision: 34 -* * Call: lpj2magpie(input_folder = path(cfg$lpj_input_folder, gsub("-", "/", cfg$input)), input2_folder = path(cfg$additional_input_folder, paste("rev", floor(cfg$revision), sep = "")), output_file = lpj2magpie_file, rev = cfg$revision) -* -* aggregation settings: -* * Input resolution: 0.5 -* * Output resolution: c200 -* * Input file: /p/projects/landuse/data/input/archive/isimip_rcp-IPSL_CM5A_LR-rcp2p6-co2_rev34_0.5.tgz -* * Output file: /p/projects/landuse/data/input/archive/isimip_rcp-IPSL_CM5A_LR-rcp2p6-co2_rev34_c200_690d3718e151be1b450b394c1064b1c5.tgz -* * Regionscode: 690d3718e151be1b450b394c1064b1c5 -* * (clustering) n-repeat: 5 -* * (clustering) n-redistribute: 0 -* * Call: aggregation(input_file = lpj2magpie_file, regionmapping = paste0("../", cfg$regionmapping), output_file = aggregation_file, rev = cfg$revision, res_high = cfg$high_res, res_low = cfg$low_res, hcells = cfg$highres_cells, weight = cfg$cluster_weight, nrepeat = cfg$nrepeat, nredistribute = cfg$nredistribute, sum_spam_file = NULL, debug = FALSE) -* -* -* -* Last modification (input data): Fri Feb 15 12:55:12 2019 -* -*###################### R SECTION END (VERSION INFO) ########################### - -$offupper -$offsymxref -$offsymlist -$offlisting - -******************************************************************************** -*** WARNING **** WARNING **** WARNING **** WARNING **** WARNING **** WARNING *** -******************************************************************************** - -* PLEASE DO NOT PERFORM ANY CHANGES HERE! ALL SETTINGS WILL BE AUTOMATICALLY -* SET BY MAGPIE_START.R BASED ON THE SETTINGS OF THE CORRESPONDING CFG FILE -* PLEASE DO ALL SETTINGS IN THE CORRESPONDING CFG FILE (e.g. config/default.cfg) - -******************************************************************************** -*** WARNING **** WARNING **** WARNING **** WARNING **** WARNING **** WARNING *** -******************************************************************************** - -**************************MODEL SPECIFIC SCALARS******************************** -* Key parameters during model runs - -$setglobal c_timesteps coup2100 - -scalars - s_use_gdx use of gdx files / 2 / -; -******************************************************************************** - -*******************************MODULE SETUP************************************* - -$setglobal drivers aug17 -$setglobal land feb15 -$setglobal costs default -$setglobal interest_rate reg_feb18 -$setglobal tc endo_jun18 -$setglobal yields dynamic_aug18 - -$setglobal food anthropometrics_jan18 -$setglobal demand sector_may15 -$setglobal production flexreg_apr16 - -$setglobal residues flexreg_apr16 -$setglobal processing substitution_dec18 - -$setglobal trade selfsuff_reduced - -$setglobal crop endo_jun13 -$setglobal past endo_jun13 -$setglobal forestry affore_vegc_dec16 -$setglobal urban static -$setglobal natveg dynamic_may18 - -$setglobal factor_costs mixed_feb17 -$setglobal landconversion global_static_aug18 - -$setglobal transport gtap_nov12 -$setglobal area_equipped_for_irrigation endo_apr13 -$setglobal water_demand agr_sector_aug13 -$setglobal water_availability total_water_aug13 -$setglobal climate static - -$setglobal nr_soil_budget exoeff_aug16 -$setglobal nitrogen ipcc2006_sep16 -$setglobal carbon normal_dec17 -$setglobal methane ipcc2006_flexreg_apr16 -$setglobal phosphorus off -$setglobal awms ipcc2006_aug16 -$setglobal ghg_policy price_jan19 -$setglobal maccs on_sep16 -$setglobal carbon_removal off_sep16 -$setglobal som off - -$setglobal bioenergy 1stgen_priced_dec18 -$setglobal material exo_flexreg_apr16 -$setglobal livestock fbask_jan16 -$setglobal disagg_lvst foragebased_aug18 - -$setglobal optimization nlp_apr17 - -****************************END MODULE SETUP************************************ - -***************************PREDEFINED MACROS************************************ -$include "./core/macros.gms" -******************************************************************************** - -***************************BASIC SETS INDICES*********************************** -$include "./core/sets.gms" -$batinclude "./modules/include.gms" sets -******************************************************************************** - -**********INTRODUCE CALCULATION PARAMETERS, VARIABLES AND EQUATIONS************* -$include "./core/declarations.gms" -$batinclude "./modules/include.gms" declarations -******************************************************************************** - -*****************************IMPORT DATA FILES********************************** -$batinclude "./modules/include.gms" input -******************************************************************************** - -********************OBJECTIVE FUNCTION & CONSTRAINTS**************************** -$batinclude "./modules/include.gms" equations -******************************************************************************** - -*******************MODEL DEFINITION & SOLVER OPTIONS**************************** -model magpie / all - m15_food_demand /; - -option iterlim = 1000000 ; -option reslim = 1000000 ; -option sysout = Off ; -option limcol = 0 ; -option limrow = 0 ; -option decimals = 3 ; -option savepoint = 1 ; -******************************************************************************** - -*****************************VARIABLE SCALING*********************************** -$batinclude "./modules/include.gms" scaling -******************************************************************************** - -***************************GENERAL CALCULATIONS********************************* -$include "./core/calculations.gms" -******************************************************************************** - -*** EOF magpie.gms *** +*** | (C) 2008-2019 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 + +$title magpie + +*' @title MAgPIE - Modelling Framework +*' +*' @description The *Model of Agricultural Production and its Impact on the +*' Environment* (MAgPIE) is developed and used to assess the competition for +*' land and water and the associated consequences for sustainable development +*' under future scenarios of rising food, energy and material demand as well +*' as production, climate change impacts and greenhouse gas mitigation and +*' different land related policies (@dietrich_magpie4). +*' +*' MAgPIE is a global partial equilibrium model of the land-use sector that operates +*' in a recursive dynamic mode and incorporates spatially explicit information on +*' biophysical constraints into an economic decision making process (@lotze-campen_global_2008). +*' It takes regional economic conditions such as elastic demand for agricultural commodities, +*' technological development and production costs as well as spatially explicit data on biophysical +*' constraints into account. Geographically explicit data on biophysical conditions are provided +*' by the Lund-Potsdam-Jena managed land model (LPJmL) (@bondeau_lpjml_2007, @mueller_projecting_2014) +*' on a 0.5 degree resolution and include e.g. carbon densities of different vegetation types, +*' agricultural productivity such as crop yields and water availability for irrigation. Based on +*' the strong interaction with LPJmL, MAgPIE can also help to assess the consequences of climate +*' change and increased CO2 in the atmosphere on the land-use sector (@stevanovic_impact_2016) +*' +*' Available land types in MAgPIE are cropland, pasture area, forest, other land +*' (including non-forest natural vegetation, abandoned agricultural land and deserts) +*' and settlements. Cropland (rainfed and irrigated), pasture, forest and other land +*' are endogenously determined, while settlement areas are assumed to be constant over time. +*' The cropland covers cultivation of different crop types (e.g. temperate and tropical +*' cereals, maize, rice, oilseeds, roots), both rainfed and irrigated systems, and two +*' 2nd generation bioenergy crop types (grassy and woody). +*' +*' Taking into account international trade based on historical trade patterns and economic +*' competitiveness ([21_trade]), global production has to meet demand for food, +*' feed, seed, processing, bioenergy and material demand ([16_demand]). Food demand is +*' derived based on population growth ([09_drivers]) and dietary transitions, accounting +*' for changes in intake and food waste, the shift in the share of animal calories, +*' processed products, fruits and vegetables as well as staples ([15_food]). +*' Primary products can be processed to secondary products such as sugar, oil +*' or ethanol ([20_processing]). The quantity of livestock production in +*' combination with dynamic regional and livestock-specific feed baskets determines the +*' demand for feed ([70_livestock]). The supply of animal-based food commodities is divided into five livestock production +*' activities (ruminant meat, pig meat, poultry meat, eggs and milk) (@weindl_livestock_2017-1). +*' The spatial distribution of crops ([30_crop]), livestock ([71_disagg_lvst]) +*' and pasture ([31_past]) in MAgPIE is guided by geographically explicit +*' information on vegetation growth and the balance between crop water +*' demand and water availability, by initial land cover distribution maps +*' as well as by economic conditions like trade barriers ([21_trade]), management intensity ([13_tc]) +*' and transport costs ([40_transport]). It therefore integrates information about market access into +*' the model's optimization process that determines where cropping activities and livestock production +*' are allocated to. Parts of forests and other natural land area can be excluded from conversion into +*' agricultural land if designated for wood production or located in protected areas ([32_forestry], +*' [35_natveg]) (@kreidenweis_pasture_2018). +*' +*' Due to computational constraints, all model inputs in 0.5 degree resolution are aggregated +*' to simulation units for the optimization process ([80_optimization]) based on a clustering +*' algorithm (@dietrich_reducing_2013). +*' +*' MAgPIE estimates flows of different land-based greenhouse gases (GHGs). CO2 emissions are computed +*' from land-use change dynamics, i.e. from conversion of different biomes into agricultural land +*' and consequent loss of terrestrial carbon stocks (@popp_land-use_2014), also including the +*' depletion of organic matter in soils ([59_som]). The land also serves as a sink for atmospheric +*' carbon when agricultural land is set aside from production and the associated regrowth of natural +*' vegetation generates negative emissions from land-use change. +*' Nitrogen emissions ([51_nitrogen]) are estimated based on nitrogen budgets for croplands, +*' pastures ([50_nr_budgets]) and the livestock sector ([55_awms]) (@bodirsky_reactive_2014). +*' CH4 emissions are based on +*' livestock feed and rice cultivation areas (@popp_food_2010). In the case of mitigation +*' policies for the land sector, the model can reduce CO2 emissions by restraining land-use +*' conversion and consequent carbon release as well as CH4 and N emissions by applying improved +*' agricultural management (such as anaerobic digesters for CH4 capture from animal waste, or use +*' of fertilizer spreaders) (@popp_land-use_2014, @stevanovic_mitigation_2017). In addition, +*' the model covers land-based carbon removal technologies such as bioenergy with carbon capture +*' and sequestration (CCS) and afforestation (@humpenoder_investigating_2014, +*' @humpenoder_large-scale_2017, @kreidenweis_afforestation_2016). +*' +*' In response to all involved demand for agricultural commodities, costs of production, +*' biophysical constraints and land-related policies, MAgPIE simulates major dynamics of +*' the land-use sector like investments in research and development (R&D) ([13_tc]) (@dietrich_forecasting_2014) +*' and associated increases in both crop yields ([14_yields]) and biomass removal through grazing on +*' pastures ([31_past]), land use change ([39_landconversion]), interregional trade flows ([21_trade]), +*' and irrigation ([41_area_equipped_for_irrigation]). + + + + +*##################### R SECTION START (VERSION INFO) ########################## +* +* Used data set: magpie4.1_default_apr19.tgz +* md5sum: ea3959be0d5a45cf50cfc232571dc9bd +* 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 +* 28 24 10 7 3 53 17 8 22 7 11 10 +* +* Regionscode: 690d3718e151be1b450b394c1064b1c5 +* +* Regions data revision: 4.18 +* +* lpj2magpie settings: +* * LPJmL data folder: /p/projects/landuse/data/input/lpj_input/isimip_rcp/IPSL_CM5A_LR/rcp2p6/co2 +* * Additional input folder: /p/projects/landuse/data/input/other/rev34 +* * Revision: 34 +* * Call: lpj2magpie(input_folder = path(cfg$lpj_input_folder, gsub("-", "/", cfg$input)), input2_folder = path(cfg$additional_input_folder, paste("rev", floor(cfg$revision), sep = "")), output_file = lpj2magpie_file, rev = cfg$revision) +* +* aggregation settings: +* * Input resolution: 0.5 +* * Output resolution: c200 +* * Input file: /p/projects/landuse/data/input/archive/isimip_rcp-IPSL_CM5A_LR-rcp2p6-co2_rev34_0.5.tgz +* * Output file: /p/projects/landuse/data/input/archive/isimip_rcp-IPSL_CM5A_LR-rcp2p6-co2_rev34_c200_690d3718e151be1b450b394c1064b1c5.tgz +* * Regionscode: 690d3718e151be1b450b394c1064b1c5 +* * (clustering) n-repeat: 5 +* * (clustering) n-redistribute: 0 +* * Call: aggregation(input_file = lpj2magpie_file, regionmapping = paste0("../", cfg$regionmapping), output_file = aggregation_file, rev = cfg$revision, res_high = cfg$high_res, res_low = cfg$low_res, hcells = cfg$highres_cells, weight = cfg$cluster_weight, nrepeat = cfg$nrepeat, nredistribute = cfg$nredistribute, sum_spam_file = NULL, debug = FALSE) +* +* +* +* Last modification (input data): Sat Apr 27 13:45:25 2019 +* +*###################### R SECTION END (VERSION INFO) ########################### + +$offupper +$offsymxref +$offsymlist +$offlisting + +******************************************************************************** +*** WARNING **** WARNING **** WARNING **** WARNING **** WARNING **** WARNING *** +******************************************************************************** + +* PLEASE DO NOT PERFORM ANY CHANGES HERE! ALL SETTINGS WILL BE AUTOMATICALLY +* SET BY MAGPIE_START.R BASED ON THE SETTINGS OF THE CORRESPONDING CFG FILE +* PLEASE DO ALL SETTINGS IN THE CORRESPONDING CFG FILE (e.g. config/default.cfg) + +******************************************************************************** +*** WARNING **** WARNING **** WARNING **** WARNING **** WARNING **** WARNING *** +******************************************************************************** + +**************************MODEL SPECIFIC SCALARS******************************** +* Key parameters during model runs + +$setglobal c_timesteps coup2100 + +scalars + s_use_gdx use of gdx files / 2 / +; +******************************************************************************** + +*******************************MODULE SETUP************************************* + +$setglobal drivers aug17 +$setglobal land feb15 +$setglobal costs default +$setglobal interest_rate reg_feb18 +$setglobal tc endo_jun18 +$setglobal yields dynamic_aug18 + +$setglobal food anthropometrics_jan18 +$setglobal demand sector_may15 +$setglobal production flexreg_apr16 + +$setglobal residues flexreg_apr16 +$setglobal processing substitution_dec18 + +$setglobal trade selfsuff_reduced + +$setglobal crop endo_jun13 +$setglobal past endo_jun13 +$setglobal forestry affore_vegc_dec16 +$setglobal urban static +$setglobal natveg dynamic_may18 + +$setglobal factor_costs mixed_feb17 +$setglobal landconversion global_static_aug18 + +$setglobal transport gtap_nov12 +$setglobal area_equipped_for_irrigation endo_apr13 +$setglobal water_demand agr_sector_aug13 +$setglobal water_availability total_water_aug13 +$setglobal climate static + +$setglobal nr_soil_budget exoeff_aug16 +$setglobal nitrogen ipcc2006_sep16 +$setglobal carbon normal_dec17 +$setglobal methane ipcc2006_flexreg_apr16 +$setglobal phosphorus off +$setglobal awms ipcc2006_aug16 +$setglobal ghg_policy price_jan19 +$setglobal maccs on_sep16 +$setglobal som off + +$setglobal bioenergy 1stgen_priced_dec18 +$setglobal material exo_flexreg_apr16 +$setglobal livestock fbask_jan16 +$setglobal disagg_lvst foragebased_aug18 + +$setglobal optimization nlp_apr17 + +****************************END MODULE SETUP************************************ + +***************************PREDEFINED MACROS************************************ +$include "./core/macros.gms" +******************************************************************************** + +***************************BASIC SETS INDICES*********************************** +$include "./core/sets.gms" +$batinclude "./modules/include.gms" sets +******************************************************************************** + +**********INTRODUCE CALCULATION PARAMETERS, VARIABLES AND EQUATIONS************* +$include "./core/declarations.gms" +$batinclude "./modules/include.gms" declarations +******************************************************************************** + +*****************************IMPORT DATA FILES********************************** +$batinclude "./modules/include.gms" input +******************************************************************************** + +********************OBJECTIVE FUNCTION & CONSTRAINTS**************************** +$batinclude "./modules/include.gms" equations +******************************************************************************** + +*******************MODEL DEFINITION & SOLVER OPTIONS**************************** +model magpie / all - m15_food_demand /; + +option iterlim = 1000000 ; +option reslim = 1000000 ; +option sysout = Off ; +option limcol = 0 ; +option limrow = 0 ; +option decimals = 3 ; +option savepoint = 1 ; +******************************************************************************** + +*****************************VARIABLE SCALING*********************************** +$batinclude "./modules/include.gms" scaling +******************************************************************************** + +***************************GENERAL CALCULATIONS********************************* +$include "./core/calculations.gms" +******************************************************************************** + +*** EOF magpie.gms *** diff --git a/modules/09_drivers/aug17/declarations.gms b/modules/09_drivers/aug17/declarations.gms index 899a78608e..8f0fcb0965 100644 --- a/modules/09_drivers/aug17/declarations.gms +++ b/modules/09_drivers/aug17/declarations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de parameters @@ -27,4 +28,4 @@ parameters im_development_state(t,i) Development state according to the World Bank definition where 0=low income country 1=high income country in high income level (1) im_physical_inactivity(t,iso,sex,age) Share of population which is physically inactive (1) im_demography(t,iso,sex,age) Population by groups (mio. per yr) -; \ No newline at end of file +; diff --git a/modules/09_drivers/aug17/input.gms b/modules/09_drivers/aug17/input.gms index 5d819e576b..9e7142dea3 100644 --- a/modules/09_drivers/aug17/input.gms +++ b/modules/09_drivers/aug17/input.gms @@ -1,44 +1,45 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -$setglobal c09_pop_scenario SSP2 -* options: SSP: "SSP1", "SSP2", "SP3", "SSP4", "SSP5" -* SRES: "a1", "a2", "b1", "b2" - -$setglobal c09_gdp_scenario SSP2 -* options: SSP: "SSP1", "SSP2", "SSP3", "SSP4", "SSP5" -* SRES: "a1", "a2", "b1", "b2" - - -table f09_gdp_ppp_iso(t_all,iso,gdp_scen09) Income in purchasing power parity (mio. USD05PPP per yr) -$ondelim -$include "./modules/09_drivers/input/f09_gdp_ppp_iso.csv" -$offdelim; - -table f09_gdp_mer_iso(t_all,iso,gdp_scen09) Income in market exchange rates (mio. USD05MER per yr) -$ondelim -$include "./modules/09_drivers/input/f09_gdp_mer_iso.csv" -$offdelim; - -table f09_pop_iso(t_all,iso,pop_scen09) Population (mio. capita per yr) -$ondelim -$include "./modules/09_drivers/input/f09_pop_iso.csv" -$offdelim; - -table f09_development_state(t_all,i,gdp_scen09) Development state according to the World Bank definition where 0=low income country 1=high income country in high income level (1) -$ondelim -$include "./modules/09_drivers/input/f09_development_state.cs3" -$offdelim; - -table f09_demography(t_all,iso,pop_scen09,sex,age) Population (mio. capita per yr) -$ondelim -$include "./modules/09_drivers/input/f09_demography.cs3" -$offdelim; - -table f09_physical_inactivity(t_all,iso,gdp_scen09,sex,age) Share of population which is physically inactive (1) -$ondelim -$include "./modules/09_drivers/input/f09_physical_inactivity.cs3" -$offdelim; +*** | (C) 2008-2019 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 + +$setglobal c09_pop_scenario SSP2 +* options: SSP: "SSP1", "SSP2", "SP3", "SSP4", "SSP5" +* SRES: "a1", "a2", "b1", "b2" + +$setglobal c09_gdp_scenario SSP2 +* options: SSP: "SSP1", "SSP2", "SSP3", "SSP4", "SSP5" +* SRES: "a1", "a2", "b1", "b2" + + +table f09_gdp_ppp_iso(t_all,iso,gdp_scen09) Income in purchasing power parity (mio. USD05PPP per yr) +$ondelim +$include "./modules/09_drivers/input/f09_gdp_ppp_iso.csv" +$offdelim; + +table f09_gdp_mer_iso(t_all,iso,gdp_scen09) Income in market exchange rates (mio. USD05MER per yr) +$ondelim +$include "./modules/09_drivers/input/f09_gdp_mer_iso.csv" +$offdelim; + +table f09_pop_iso(t_all,iso,pop_scen09) Population (mio. capita per yr) +$ondelim +$include "./modules/09_drivers/input/f09_pop_iso.csv" +$offdelim; + +table f09_development_state(t_all,i,gdp_scen09) Development state according to the World Bank definition where 0=low income country 1=high income country in high income level (1) +$ondelim +$include "./modules/09_drivers/input/f09_development_state.cs3" +$offdelim; + +table f09_demography(t_all,iso,pop_scen09,sex,age) Population (mio. capita per yr) +$ondelim +$include "./modules/09_drivers/input/f09_demography.cs3" +$offdelim; + +table f09_physical_inactivity(t_all,iso,gdp_scen09,sex,age) Share of population which is physically inactive (1) +$ondelim +$include "./modules/09_drivers/input/f09_physical_inactivity.cs3" +$offdelim; diff --git a/modules/09_drivers/aug17/preloop.gms b/modules/09_drivers/aug17/preloop.gms index 1e76c9471e..7b396f061d 100644 --- a/modules/09_drivers/aug17/preloop.gms +++ b/modules/09_drivers/aug17/preloop.gms @@ -1,7 +1,10 @@ - -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de + * get the scenario GDP & Populaiton data for iso countries im_physical_inactivity(t,iso,sex,age) = f09_physical_inactivity(t,iso,"%c09_gdp_scenario%",sex,age); @@ -42,4 +45,4 @@ im_development_state(t,i) = f09_development_state(t,i,"%c09_gdp_scenario%"); * GDP per capita for ISO countries im_gdp_pc_ppp_iso(t,iso)=0; im_gdp_pc_ppp_iso(t,iso)$(i09_gdp_ppp_iso(t,iso)*im_pop_iso(t,iso)>0) = i09_gdp_ppp_iso(t,iso)/im_pop_iso(t,iso); -im_gdp_pc_ppp_iso(t,iso)$(im_gdp_pc_ppp_iso(t,iso)=0) = sum(i_to_iso(i,iso), im_gdp_pc_ppp(t,i)); \ No newline at end of file +im_gdp_pc_ppp_iso(t,iso)$(im_gdp_pc_ppp_iso(t,iso)=0) = sum(i_to_iso(i,iso), im_gdp_pc_ppp(t,i)); diff --git a/modules/09_drivers/aug17.gms b/modules/09_drivers/aug17/realization.gms similarity index 64% rename from modules/09_drivers/aug17.gms rename to modules/09_drivers/aug17/realization.gms index 324c3a0e23..60810e64ca 100644 --- a/modules/09_drivers/aug17.gms +++ b/modules/09_drivers/aug17/realization.gms @@ -1,15 +1,16 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description In the aug17 realization, inputs are taken into the module and are directly -*' delivered to the modules that require the data. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/09_drivers/aug17/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/09_drivers/aug17/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/09_drivers/aug17/input.gms" -$Ifi "%phase%" == "preloop" $include "./modules/09_drivers/aug17/preloop.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description In the aug17 realization, inputs are taken into the module and are directly +*' delivered to the modules that require the data. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/09_drivers/aug17/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/09_drivers/aug17/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/09_drivers/aug17/input.gms" +$Ifi "%phase%" == "preloop" $include "./modules/09_drivers/aug17/preloop.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/09_drivers/aug17/sets.gms b/modules/09_drivers/aug17/sets.gms index e30a8425c0..ac72c57f7f 100644 --- a/modules/09_drivers/aug17/sets.gms +++ b/modules/09_drivers/aug17/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets diff --git a/modules/09_drivers/09_drivers.gms b/modules/09_drivers/module.gms similarity index 63% rename from modules/09_drivers/09_drivers.gms rename to modules/09_drivers/module.gms index ec8ba93dba..e8cc8041f9 100644 --- a/modules/09_drivers/09_drivers.gms +++ b/modules/09_drivers/module.gms @@ -1,19 +1,20 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Drivers -*' -*' @description The Drivers module provides data on drivers -*' that are used by several other modules. It mainly aggregates inputs related -*' to population and GDP. If an input is required in one module or realization only, -*' the input driver is provided directly by the module that demands it, -*' rather than by the [09_drivers] module. -*' -*' @authors Benjamin Leon Bodirsky - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%drivers%" == "aug17" $include "./modules/09_drivers/aug17.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Drivers +*' +*' @description The Drivers module provides data on drivers +*' that are used by several other modules. It mainly aggregates inputs related +*' to population and GDP. If an input is required in one module or realization only, +*' the input driver is provided directly by the module that demands it, +*' rather than by the [09_drivers] module. +*' +*' @authors Benjamin Leon Bodirsky + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%drivers%" == "aug17" $include "./modules/09_drivers/aug17/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/10_land/feb15/declarations.gms b/modules/10_land/feb15/declarations.gms index 0d431ef321..979d13fdc2 100644 --- a/modules/10_land/feb15/declarations.gms +++ b/modules/10_land/feb15/declarations.gms @@ -1,41 +1,42 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -parameters - pm_land_start(j,land) Land initialization area (mio. ha) - pcm_land(j,land) Land area in previous time step (mio. ha) -; - -variables - vm_landdiff Aggregated difference in land between current and previous time step (mio. ha) -; - -positive variables - vm_land(j,land) Land area of the different land types (mio. ha) - vm_landexpansion(j,land) Land expansion (mio. ha) - v10_landreduction(j,land) Land reduction (mio. ha) -; - -equations - q10_land(j) Land conversion constraint (mio. ha) - q10_landexpansion(j,land) Land expansion constraint (mio. ha) - q10_landreduction(j,land) Land reduction constraint (mio. ha) - q10_landdiff Land difference constraint (mio. ha) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_landdiff(t,type) Aggregated difference in land between current and previous time step (mio. ha) - ov_land(t,j,land,type) Land area of the different land types (mio. ha) - ov_landexpansion(t,j,land,type) Land expansion (mio. ha) - ov10_landreduction(t,j,land,type) Land reduction (mio. ha) - oq10_land(t,j,type) Land conversion constraint (mio. ha) - oq10_landexpansion(t,j,land,type) Land expansion constraint (mio. ha) - oq10_landreduction(t,j,land,type) Land reduction constraint (mio. ha) - oq10_landdiff(t,type) Land difference constraint (mio. ha) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + +parameters + pm_land_start(j,land) Land initialization area (mio. ha) + pcm_land(j,land) Land area in previous time step (mio. ha) +; + +variables + vm_landdiff Aggregated difference in land between current and previous time step (mio. ha) +; + +positive variables + vm_land(j,land) Land area of the different land types (mio. ha) + vm_landexpansion(j,land) Land expansion (mio. ha) + v10_landreduction(j,land) Land reduction (mio. ha) +; + +equations + q10_land(j) Land conversion constraint (mio. ha) + q10_landexpansion(j,land) Land expansion constraint (mio. ha) + q10_landreduction(j,land) Land reduction constraint (mio. ha) + q10_landdiff Land difference constraint (mio. ha) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_landdiff(t,type) Aggregated difference in land between current and previous time step (mio. ha) + ov_land(t,j,land,type) Land area of the different land types (mio. ha) + ov_landexpansion(t,j,land,type) Land expansion (mio. ha) + ov10_landreduction(t,j,land,type) Land reduction (mio. ha) + oq10_land(t,j,type) Land conversion constraint (mio. ha) + oq10_landexpansion(t,j,land,type) Land expansion constraint (mio. ha) + oq10_landreduction(t,j,land,type) Land reduction constraint (mio. ha) + oq10_landdiff(t,type) Land difference constraint (mio. ha) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/10_land/feb15/equations.gms b/modules/10_land/feb15/equations.gms index 6dcf0a622f..ddeb0724e3 100644 --- a/modules/10_land/feb15/equations.gms +++ b/modules/10_land/feb15/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations diff --git a/modules/10_land/feb15/input.gms b/modules/10_land/feb15/input.gms index c2eda2b305..bc0bc13c57 100644 --- a/modules/10_land/feb15/input.gms +++ b/modules/10_land/feb15/input.gms @@ -1,11 +1,12 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -table f10_land(t_ini10,j,land) Different land type areas (mio. ha) -$ondelim -$include "./modules/10_land/input/avl_land_t.cs3" -$offdelim -; +*** | (C) 2008-2019 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 + +table f10_land(t_ini10,j,land) Different land type areas (mio. ha) +$ondelim +$include "./modules/10_land/input/avl_land_t.cs3" +$offdelim +; diff --git a/modules/10_land/feb15/postsolve.gms b/modules/10_land/feb15/postsolve.gms index b0e373c4af..517bd14c9f 100644 --- a/modules/10_land/feb15/postsolve.gms +++ b/modules/10_land/feb15/postsolve.gms @@ -1,43 +1,44 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*** Land Patterns are transferred to next timestep -pcm_land(j,land) = vm_land.l(j,land); - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_landdiff(t,"marginal") = vm_landdiff.m; - ov_land(t,j,land,"marginal") = vm_land.m(j,land); - ov_landexpansion(t,j,land,"marginal") = vm_landexpansion.m(j,land); - ov10_landreduction(t,j,land,"marginal") = v10_landreduction.m(j,land); - oq10_land(t,j,"marginal") = q10_land.m(j); - oq10_landexpansion(t,j,land,"marginal") = q10_landexpansion.m(j,land); - oq10_landreduction(t,j,land,"marginal") = q10_landreduction.m(j,land); - oq10_landdiff(t,"marginal") = q10_landdiff.m; - ov_landdiff(t,"level") = vm_landdiff.l; - ov_land(t,j,land,"level") = vm_land.l(j,land); - ov_landexpansion(t,j,land,"level") = vm_landexpansion.l(j,land); - ov10_landreduction(t,j,land,"level") = v10_landreduction.l(j,land); - oq10_land(t,j,"level") = q10_land.l(j); - oq10_landexpansion(t,j,land,"level") = q10_landexpansion.l(j,land); - oq10_landreduction(t,j,land,"level") = q10_landreduction.l(j,land); - oq10_landdiff(t,"level") = q10_landdiff.l; - ov_landdiff(t,"upper") = vm_landdiff.up; - ov_land(t,j,land,"upper") = vm_land.up(j,land); - ov_landexpansion(t,j,land,"upper") = vm_landexpansion.up(j,land); - ov10_landreduction(t,j,land,"upper") = v10_landreduction.up(j,land); - oq10_land(t,j,"upper") = q10_land.up(j); - oq10_landexpansion(t,j,land,"upper") = q10_landexpansion.up(j,land); - oq10_landreduction(t,j,land,"upper") = q10_landreduction.up(j,land); - oq10_landdiff(t,"upper") = q10_landdiff.up; - ov_landdiff(t,"lower") = vm_landdiff.lo; - ov_land(t,j,land,"lower") = vm_land.lo(j,land); - ov_landexpansion(t,j,land,"lower") = vm_landexpansion.lo(j,land); - ov10_landreduction(t,j,land,"lower") = v10_landreduction.lo(j,land); - oq10_land(t,j,"lower") = q10_land.lo(j); - oq10_landexpansion(t,j,land,"lower") = q10_landexpansion.lo(j,land); - oq10_landreduction(t,j,land,"lower") = q10_landreduction.lo(j,land); - oq10_landdiff(t,"lower") = q10_landdiff.lo; -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 + +*** Land Patterns are transferred to next timestep +pcm_land(j,land) = vm_land.l(j,land); + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_landdiff(t,"marginal") = vm_landdiff.m; + ov_land(t,j,land,"marginal") = vm_land.m(j,land); + ov_landexpansion(t,j,land,"marginal") = vm_landexpansion.m(j,land); + ov10_landreduction(t,j,land,"marginal") = v10_landreduction.m(j,land); + oq10_land(t,j,"marginal") = q10_land.m(j); + oq10_landexpansion(t,j,land,"marginal") = q10_landexpansion.m(j,land); + oq10_landreduction(t,j,land,"marginal") = q10_landreduction.m(j,land); + oq10_landdiff(t,"marginal") = q10_landdiff.m; + ov_landdiff(t,"level") = vm_landdiff.l; + ov_land(t,j,land,"level") = vm_land.l(j,land); + ov_landexpansion(t,j,land,"level") = vm_landexpansion.l(j,land); + ov10_landreduction(t,j,land,"level") = v10_landreduction.l(j,land); + oq10_land(t,j,"level") = q10_land.l(j); + oq10_landexpansion(t,j,land,"level") = q10_landexpansion.l(j,land); + oq10_landreduction(t,j,land,"level") = q10_landreduction.l(j,land); + oq10_landdiff(t,"level") = q10_landdiff.l; + ov_landdiff(t,"upper") = vm_landdiff.up; + ov_land(t,j,land,"upper") = vm_land.up(j,land); + ov_landexpansion(t,j,land,"upper") = vm_landexpansion.up(j,land); + ov10_landreduction(t,j,land,"upper") = v10_landreduction.up(j,land); + oq10_land(t,j,"upper") = q10_land.up(j); + oq10_landexpansion(t,j,land,"upper") = q10_landexpansion.up(j,land); + oq10_landreduction(t,j,land,"upper") = q10_landreduction.up(j,land); + oq10_landdiff(t,"upper") = q10_landdiff.up; + ov_landdiff(t,"lower") = vm_landdiff.lo; + ov_land(t,j,land,"lower") = vm_land.lo(j,land); + ov_landexpansion(t,j,land,"lower") = vm_landexpansion.lo(j,land); + ov10_landreduction(t,j,land,"lower") = v10_landreduction.lo(j,land); + oq10_land(t,j,"lower") = q10_land.lo(j); + oq10_landexpansion(t,j,land,"lower") = q10_landexpansion.lo(j,land); + oq10_landreduction(t,j,land,"lower") = q10_landreduction.lo(j,land); + oq10_landdiff(t,"lower") = q10_landdiff.lo; +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/10_land/feb15/preloop.gms b/modules/10_land/feb15/preloop.gms index 9bbc15b9eb..d29a486957 100644 --- a/modules/10_land/feb15/preloop.gms +++ b/modules/10_land/feb15/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/feb15/presolve.gms b/modules/10_land/feb15/presolve.gms index 2ca095c84a..4f1e5c980e 100644 --- a/modules/10_land/feb15/presolve.gms +++ b/modules/10_land/feb15/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de vm_land.l(j,land) = pcm_land(j,land); diff --git a/modules/10_land/feb15.gms b/modules/10_land/feb15/realization.gms similarity index 69% rename from modules/10_land/feb15.gms rename to modules/10_land/feb15/realization.gms index 9e57dcd32f..50fea9087e 100644 --- a/modules/10_land/feb15.gms +++ b/modules/10_land/feb15/realization.gms @@ -1,17 +1,18 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @limitations There are currently no known limitations of this realization. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/10_land/feb15/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/10_land/feb15/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/10_land/feb15/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/10_land/feb15/equations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/10_land/feb15/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/10_land/feb15/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/10_land/feb15/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 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 + +*' @limitations There are currently no known limitations of this realization. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/10_land/feb15/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/10_land/feb15/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/10_land/feb15/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/10_land/feb15/equations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/10_land/feb15/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/10_land/feb15/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/10_land/feb15/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/10_land/feb15/sets.gms b/modules/10_land/feb15/sets.gms index 70271b4812..c54db68365 100644 --- a/modules/10_land/feb15/sets.gms +++ b/modules/10_land/feb15/sets.gms @@ -1,9 +1,10 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -sets - t_ini10 Time periods with land initialization data - / y1995, y2000, y2005, y2010, y2015 / +*** | (C) 2008-2019 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 + +sets + t_ini10 Time periods with land initialization data + / y1995, y2000, y2005, y2010, y2015 / diff --git a/modules/10_land/10_land.gms b/modules/10_land/module.gms similarity index 54% rename from modules/10_land/10_land.gms rename to modules/10_land/module.gms index 1f53806204..e78a97e73f 100644 --- a/modules/10_land/10_land.gms +++ b/modules/10_land/module.gms @@ -1,18 +1,19 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Land - -*' @description The land module coordinates and analyzes all land related activities -*' by summing up all land types and calculating the gross changes in land use -*' between two time steps of optimization given the recursive dynamic structure of -*' MAgPIE model. - -*' @authors Jan Philipp Dietrich - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%land%" == "feb15" $include "./modules/10_land/feb15.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Land + +*' @description The land module coordinates and analyzes all land related activities +*' by summing up all land types and calculating the gross changes in land use +*' between two time steps of optimization given the recursive dynamic structure of +*' MAgPIE model. + +*' @authors Jan Philipp Dietrich + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%land%" == "feb15" $include "./modules/10_land/feb15/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/11_costs/default/declarations.gms b/modules/11_costs/default/declarations.gms index d33920136f..cc37899404 100644 --- a/modules/11_costs/default/declarations.gms +++ b/modules/11_costs/default/declarations.gms @@ -1,24 +1,25 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -variables - vm_cost_glo Total costs of production (mio. USD05MER per yr) - v11_cost_reg(i) Regional costs (mio. USD05MER per yr) -; - -equations - q11_cost_glo Objective function (mio. USD05MER per yr) - q11_cost_reg(i) Regional cost constraint (mio. USD05MER per yr) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_cost_glo(t,type) Total costs of production (mio. USD05MER per yr) - ov11_cost_reg(t,i,type) Regional costs (mio. USD05MER per yr) - oq11_cost_glo(t,type) Objective function (mio. USD05MER per yr) - oq11_cost_reg(t,i,type) Regional cost constraint (mio. USD05MER per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 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 + +variables + vm_cost_glo Total costs of production (mio. USD05MER per yr) + v11_cost_reg(i) Regional costs (mio. USD05MER per yr) +; + +equations + q11_cost_glo Objective function (mio. USD05MER per yr) + q11_cost_reg(i) Regional cost constraint (mio. USD05MER per yr) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_cost_glo(t,type) Total costs of production (mio. USD05MER per yr) + ov11_cost_reg(t,i,type) Regional costs (mio. USD05MER per yr) + oq11_cost_glo(t,type) Objective function (mio. USD05MER per yr) + oq11_cost_reg(t,i,type) Regional cost constraint (mio. USD05MER per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/11_costs/default/equations.gms b/modules/11_costs/default/equations.gms index ff211cdce7..5bd609c171 100644 --- a/modules/11_costs/default/equations.gms +++ b/modules/11_costs/default/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations diff --git a/modules/11_costs/default/postsolve.gms b/modules/11_costs/default/postsolve.gms index ac5fb16cd3..8377b2eaa7 100644 --- a/modules/11_costs/default/postsolve.gms +++ b/modules/11_costs/default/postsolve.gms @@ -1,27 +1,28 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_cost_glo(t,"marginal") = vm_cost_glo.m; - ov11_cost_reg(t,i,"marginal") = v11_cost_reg.m(i); - oq11_cost_glo(t,"marginal") = q11_cost_glo.m; - oq11_cost_reg(t,i,"marginal") = q11_cost_reg.m(i); - ov_cost_glo(t,"level") = vm_cost_glo.l; - ov11_cost_reg(t,i,"level") = v11_cost_reg.l(i); - oq11_cost_glo(t,"level") = q11_cost_glo.l; - oq11_cost_reg(t,i,"level") = q11_cost_reg.l(i); - ov_cost_glo(t,"upper") = vm_cost_glo.up; - ov11_cost_reg(t,i,"upper") = v11_cost_reg.up(i); - oq11_cost_glo(t,"upper") = q11_cost_glo.up; - oq11_cost_reg(t,i,"upper") = q11_cost_reg.up(i); - ov_cost_glo(t,"lower") = vm_cost_glo.lo; - ov11_cost_reg(t,i,"lower") = v11_cost_reg.lo(i); - oq11_cost_glo(t,"lower") = q11_cost_glo.lo; - oq11_cost_reg(t,i,"lower") = q11_cost_reg.lo(i); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - +*** | (C) 2008-2019 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 + + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_cost_glo(t,"marginal") = vm_cost_glo.m; + ov11_cost_reg(t,i,"marginal") = v11_cost_reg.m(i); + oq11_cost_glo(t,"marginal") = q11_cost_glo.m; + oq11_cost_reg(t,i,"marginal") = q11_cost_reg.m(i); + ov_cost_glo(t,"level") = vm_cost_glo.l; + ov11_cost_reg(t,i,"level") = v11_cost_reg.l(i); + oq11_cost_glo(t,"level") = q11_cost_glo.l; + oq11_cost_reg(t,i,"level") = q11_cost_reg.l(i); + ov_cost_glo(t,"upper") = vm_cost_glo.up; + ov11_cost_reg(t,i,"upper") = v11_cost_reg.up(i); + oq11_cost_glo(t,"upper") = q11_cost_glo.up; + oq11_cost_reg(t,i,"upper") = q11_cost_reg.up(i); + ov_cost_glo(t,"lower") = vm_cost_glo.lo; + ov11_cost_reg(t,i,"lower") = v11_cost_reg.lo(i); + oq11_cost_glo(t,"lower") = q11_cost_glo.lo; + oq11_cost_reg(t,i,"lower") = q11_cost_reg.lo(i); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### + diff --git a/modules/11_costs/default.gms b/modules/11_costs/default/realization.gms similarity index 65% rename from modules/11_costs/default.gms rename to modules/11_costs/default/realization.gms index efaa68bc95..0c3fd09f44 100644 --- a/modules/11_costs/default.gms +++ b/modules/11_costs/default/realization.gms @@ -1,16 +1,17 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -*' @description The default realization of the costs module calculates global production -*' costs with a constraint of production always fulfilling the demand. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "declarations" $include "./modules/11_costs/default/declarations.gms" -$Ifi "%phase%" == "equations" $include "./modules/11_costs/default/equations.gms" -$Ifi "%phase%" == "scaling" $include "./modules/11_costs/default/scaling.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/11_costs/default/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + +*' @description The default realization of the costs module calculates global production +*' costs with a constraint of production always fulfilling the demand. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "declarations" $include "./modules/11_costs/default/declarations.gms" +$Ifi "%phase%" == "equations" $include "./modules/11_costs/default/equations.gms" +$Ifi "%phase%" == "scaling" $include "./modules/11_costs/default/scaling.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/11_costs/default/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/11_costs/default/scaling.gms b/modules/11_costs/default/scaling.gms index 6b9c992a08..3fc467d489 100644 --- a/modules/11_costs/default/scaling.gms +++ b/modules/11_costs/default/scaling.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de vm_cost_glo.scale = 10e6; diff --git a/modules/11_costs/11_costs.gms b/modules/11_costs/module.gms similarity index 68% rename from modules/11_costs/11_costs.gms rename to modules/11_costs/module.gms index 4e03f8c91f..be8e4f71f4 100644 --- a/modules/11_costs/11_costs.gms +++ b/modules/11_costs/module.gms @@ -1,20 +1,21 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Costs -*' -*' @description The cost module determines the sum total of global production -*' costs in each time step. MAgPIE's objective is to minimize the global cost of -*' production in a recursive dynamic way. The interface variable `vm_cost_glo` -*' is used for this purpose. The model optimizes the production activities -*' accordingly to ensure that all the demand and supply constraints are met -*' while minimizing the global production costs. - -*' @authors Benjamin Leon Bodirsky, Florian Humpenöder, Jan Philipp Dietrich - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%costs%" == "default" $include "./modules/11_costs/default.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Costs +*' +*' @description The cost module determines the sum total of global production +*' costs in each time step. MAgPIE's objective is to minimize the global cost of +*' production in a recursive dynamic way. The interface variable `vm_cost_glo` +*' is used for this purpose. The model optimizes the production activities +*' accordingly to ensure that all the demand and supply constraints are met +*' while minimizing the global production costs. + +*' @authors Benjamin Leon Bodirsky, Florian Humpenöder, Jan Philipp Dietrich + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%costs%" == "default" $include "./modules/11_costs/default/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/12_interest_rate/glo_jan16/declarations.gms b/modules/12_interest_rate/glo_jan16/declarations.gms index 8a120c5246..ce62e448a5 100644 --- a/modules/12_interest_rate/glo_jan16/declarations.gms +++ b/modules/12_interest_rate/glo_jan16/declarations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de parameters diff --git a/modules/12_interest_rate/glo_jan16/input.gms b/modules/12_interest_rate/glo_jan16/input.gms index 3267f9e098..fa21f01d02 100644 --- a/modules/12_interest_rate/glo_jan16/input.gms +++ b/modules/12_interest_rate/glo_jan16/input.gms @@ -1,21 +1,22 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -$setglobal c12_interest_rate medium - -table f12_interest(t_all,scen12) Interest rate scenarios (% per yr) -$ondelim -$include "./modules/12_interest_rate/input/f12_interest_rate.cs3" -$offdelim -; - -$if "%c12_interest_rate%" == "coupling" parameter f12_interest_coupling(t_all) Interest rate (% per yr) -$if "%c12_interest_rate%" == "coupling" / -$if "%c12_interest_rate%" == "coupling" $ondelim -$if "%c12_interest_rate%" == "coupling" $include "./modules/12_interest_rate/input/f12_interest_rate_coupling.csv" -$if "%c12_interest_rate%" == "coupling" $offdelim -$if "%c12_interest_rate%" == "coupling" / -$if "%c12_interest_rate%" == "coupling" ; +*** | (C) 2008-2019 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 + +$setglobal c12_interest_rate medium + +table f12_interest(t_all,scen12) Interest rate scenarios (% per yr) +$ondelim +$include "./modules/12_interest_rate/input/f12_interest_rate.cs3" +$offdelim +; + +$if "%c12_interest_rate%" == "coupling" parameter f12_interest_coupling(t_all) Interest rate (% per yr) +$if "%c12_interest_rate%" == "coupling" / +$if "%c12_interest_rate%" == "coupling" $ondelim +$if "%c12_interest_rate%" == "coupling" $include "./modules/12_interest_rate/input/f12_interest_rate_coupling.csv" +$if "%c12_interest_rate%" == "coupling" $offdelim +$if "%c12_interest_rate%" == "coupling" / +$if "%c12_interest_rate%" == "coupling" ; diff --git a/modules/12_interest_rate/glo_jan16/not_used.txt b/modules/12_interest_rate/glo_jan16/not_used.txt index 1999d18ae9..8f2d28f1bb 100644 --- a/modules/12_interest_rate/glo_jan16/not_used.txt +++ b/modules/12_interest_rate/glo_jan16/not_used.txt @@ -1,2 +1,8 @@ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). +# | Contact: magpie@pik-potsdam.de name,type,reason im_development_state,input,questionnaire diff --git a/modules/12_interest_rate/glo_jan16/preloop.gms b/modules/12_interest_rate/glo_jan16/preloop.gms index e5d26e9ce0..7bcbcfcfb3 100644 --- a/modules/12_interest_rate/glo_jan16/preloop.gms +++ b/modules/12_interest_rate/glo_jan16/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/12_interest_rate/glo_jan16/presolve.gms b/modules/12_interest_rate/glo_jan16/presolve.gms index 2efebc0b97..c05cc488fb 100644 --- a/modules/12_interest_rate/glo_jan16/presolve.gms +++ b/modules/12_interest_rate/glo_jan16/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 -pm_interest(i) = p12_interest(t,i); \ No newline at end of file +pm_interest(i) = p12_interest(t,i); diff --git a/modules/12_interest_rate/glo_jan16.gms b/modules/12_interest_rate/glo_jan16/realization.gms similarity index 72% rename from modules/12_interest_rate/glo_jan16.gms rename to modules/12_interest_rate/glo_jan16/realization.gms index 6ec0300f21..8f71836fcc 100644 --- a/modules/12_interest_rate/glo_jan16.gms +++ b/modules/12_interest_rate/glo_jan16/realization.gms @@ -1,18 +1,19 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description In the glo_jan16 realization, interest rates are identical in all regions. -*' The initial global interest rate is 7% (in 1995) for all scenarios defined in `scen12`. -*' It undergoes a transition towards 4%, 7% and 10% until 2030 for the low-, medium- -*' and high- interest rate scenarios, respectively. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/12_interest_rate/glo_jan16/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/12_interest_rate/glo_jan16/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/12_interest_rate/glo_jan16/input.gms" -$Ifi "%phase%" == "preloop" $include "./modules/12_interest_rate/glo_jan16/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/12_interest_rate/glo_jan16/presolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description In the glo_jan16 realization, interest rates are identical in all regions. +*' The initial global interest rate is 7% (in 1995) for all scenarios defined in `scen12`. +*' It undergoes a transition towards 4%, 7% and 10% until 2030 for the low-, medium- +*' and high- interest rate scenarios, respectively. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/12_interest_rate/glo_jan16/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/12_interest_rate/glo_jan16/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/12_interest_rate/glo_jan16/input.gms" +$Ifi "%phase%" == "preloop" $include "./modules/12_interest_rate/glo_jan16/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/12_interest_rate/glo_jan16/presolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/12_interest_rate/glo_jan16/sets.gms b/modules/12_interest_rate/glo_jan16/sets.gms index e3e0196f4a..dcf2ed95a9 100644 --- a/modules/12_interest_rate/glo_jan16/sets.gms +++ b/modules/12_interest_rate/glo_jan16/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets diff --git a/modules/12_interest_rate/12_interest_rate.gms b/modules/12_interest_rate/module.gms similarity index 65% rename from modules/12_interest_rate/12_interest_rate.gms rename to modules/12_interest_rate/module.gms index 6a0bad150a..26fa25fce5 100644 --- a/modules/12_interest_rate/12_interest_rate.gms +++ b/modules/12_interest_rate/module.gms @@ -1,21 +1,22 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Interest rate - -*' @description Interest rates are used in MAgPIE as a risk-accounting -*' factor associated with investment activities [@wang_taking_2016]. -*' Interest rates are required for inter-temporal calculations in the model -*' such as shifting investment from one time step to another or distribution of -*' one-time investments over several time steps (e.g. in the modules -*' [13_tc], [39_landconversion] and [41_area_equipped_for_irrigation]). -*' -*' @authors Xiaoxi Wang - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%interest_rate%" == "glo_jan16" $include "./modules/12_interest_rate/glo_jan16.gms" -$Ifi "%interest_rate%" == "reg_feb18" $include "./modules/12_interest_rate/reg_feb18.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Interest rate + +*' @description Interest rates are used in MAgPIE as a risk-accounting +*' factor associated with investment activities [@wang_taking_2016]. +*' Interest rates are required for inter-temporal calculations in the model +*' such as shifting investment from one time step to another or distribution of +*' one-time investments over several time steps (e.g. in the modules +*' [13_tc], [39_landconversion] and [41_area_equipped_for_irrigation]). +*' +*' @authors Xiaoxi Wang + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%interest_rate%" == "glo_jan16" $include "./modules/12_interest_rate/glo_jan16/realization.gms" +$Ifi "%interest_rate%" == "reg_feb18" $include "./modules/12_interest_rate/reg_feb18/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/12_interest_rate/reg_feb18/declarations.gms b/modules/12_interest_rate/reg_feb18/declarations.gms index d16900c52f..aa7db681cd 100644 --- a/modules/12_interest_rate/reg_feb18/declarations.gms +++ b/modules/12_interest_rate/reg_feb18/declarations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de scalars diff --git a/modules/12_interest_rate/reg_feb18/input.gms b/modules/12_interest_rate/reg_feb18/input.gms index 9080959856..f8a1e965be 100644 --- a/modules/12_interest_rate/reg_feb18/input.gms +++ b/modules/12_interest_rate/reg_feb18/input.gms @@ -1,22 +1,23 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -$setglobal c12_interest_rate medium - -table f12_interest_bound(t,bound12) Lower and higher bounds of interest rates (% per yr) -$ondelim -$include "./modules/12_interest_rate/input/f12_interest_rate_bound.cs3" -$offdelim -; - - -$if "%c12_interest_rate%" == "coupling" parameter f12_interest_coupling(t_all) Interest rate (% per yr) -$if "%c12_interest_rate%" == "coupling" / -$if "%c12_interest_rate%" == "coupling" $ondelim -$if "%c12_interest_rate%" == "coupling" $include "./modules/12_interest_rate/input/f12_interest_rate_coupling.csv" -$if "%c12_interest_rate%" == "coupling" $offdelim -$if "%c12_interest_rate%" == "coupling" / -$if "%c12_interest_rate%" == "coupling" ; +*** | (C) 2008-2019 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 + +$setglobal c12_interest_rate medium + +table f12_interest_bound(t,bound12) Lower and higher bounds of interest rates (% per yr) +$ondelim +$include "./modules/12_interest_rate/input/f12_interest_rate_bound.cs3" +$offdelim +; + + +$if "%c12_interest_rate%" == "coupling" parameter f12_interest_coupling(t_all) Interest rate (% per yr) +$if "%c12_interest_rate%" == "coupling" / +$if "%c12_interest_rate%" == "coupling" $ondelim +$if "%c12_interest_rate%" == "coupling" $include "./modules/12_interest_rate/input/f12_interest_rate_coupling.csv" +$if "%c12_interest_rate%" == "coupling" $offdelim +$if "%c12_interest_rate%" == "coupling" / +$if "%c12_interest_rate%" == "coupling" ; diff --git a/modules/12_interest_rate/reg_feb18/not_used.txt b/modules/12_interest_rate/reg_feb18/not_used.txt index 1d69ae7a05..e9c51aa2f6 100644 --- a/modules/12_interest_rate/reg_feb18/not_used.txt +++ b/modules/12_interest_rate/reg_feb18/not_used.txt @@ -1,2 +1,8 @@ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). +# | Contact: magpie@pik-potsdam.de name,type,reason im_gdp_pc_ppp,input,questionnaire diff --git a/modules/12_interest_rate/reg_feb18/preloop.gms b/modules/12_interest_rate/reg_feb18/preloop.gms index f2eed0aeef..4d3dc407f6 100644 --- a/modules/12_interest_rate/reg_feb18/preloop.gms +++ b/modules/12_interest_rate/reg_feb18/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/12_interest_rate/reg_feb18/presolve.gms b/modules/12_interest_rate/reg_feb18/presolve.gms index cb4ffd6863..c05cc488fb 100644 --- a/modules/12_interest_rate/reg_feb18/presolve.gms +++ b/modules/12_interest_rate/reg_feb18/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 pm_interest(i) = p12_interest(t,i); diff --git a/modules/12_interest_rate/reg_feb18.gms b/modules/12_interest_rate/reg_feb18/realization.gms similarity index 71% rename from modules/12_interest_rate/reg_feb18.gms rename to modules/12_interest_rate/reg_feb18/realization.gms index 6430dcf4c3..d95c8dda9f 100644 --- a/modules/12_interest_rate/reg_feb18.gms +++ b/modules/12_interest_rate/reg_feb18/realization.gms @@ -1,18 +1,19 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description The reg_feb18 realization is the default setting, -*' in which the interest rate depends on the development state `im_development_state`, -*' which is calculated based on GDP per capita. -*' Thus, interest rates are regionally specific and dynamic over time. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/12_interest_rate/reg_feb18/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/12_interest_rate/reg_feb18/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/12_interest_rate/reg_feb18/input.gms" -$Ifi "%phase%" == "preloop" $include "./modules/12_interest_rate/reg_feb18/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/12_interest_rate/reg_feb18/presolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description The reg_feb18 realization is the default setting, +*' in which the interest rate depends on the development state `im_development_state`, +*' which is calculated based on GDP per capita. +*' Thus, interest rates are regionally specific and dynamic over time. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/12_interest_rate/reg_feb18/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/12_interest_rate/reg_feb18/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/12_interest_rate/reg_feb18/input.gms" +$Ifi "%phase%" == "preloop" $include "./modules/12_interest_rate/reg_feb18/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/12_interest_rate/reg_feb18/presolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/12_interest_rate/reg_feb18/sets.gms b/modules/12_interest_rate/reg_feb18/sets.gms index 6f4ac2bc74..ab33e8caa6 100644 --- a/modules/12_interest_rate/reg_feb18/sets.gms +++ b/modules/12_interest_rate/reg_feb18/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets diff --git a/modules/13_tc/endo_jun18/declarations.gms b/modules/13_tc/endo_jun18/declarations.gms index 216630cf79..402fbc47e9 100644 --- a/modules/13_tc/endo_jun18/declarations.gms +++ b/modules/13_tc/endo_jun18/declarations.gms @@ -1,40 +1,41 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -positive variable - vm_tau(i) Agricultural land use intensity tau (1) - vm_tech_cost(i) Costs of TC (mio. USD05PPP per yr) - v13_cost_tc(i) Technical change costs per region (mio. USD05PPP) - v13_tech_cost_annuity(i) Annuity costs of TC (mio. USD05PPP per yr) -; - -equations - q13_tech_cost(i) Total costs for TC (mio. USD05PPP) - q13_cost_tc(i) Costs for TC (mio. USD05PPP per yr) - q13_tech_cost_annuity(i) Annuity costs for TC (mio. USD05PPP per yr) -; - -parameters - pc13_land(i) Crop land area per region (mio ha) - pc13_tau(i) Tau factor of the previous time step (1) - p13_tech_cost_past(t,i) Costs for TC from past (mio. USD05PPP per yr) - pc13_tech_cost_past(i) Current costs for TC from past (mio. USD05PPP per yr) - pc13_tcguess(i) Guess for annual tc rates in the next time step (1) - i13_tc_factor(t,i) Regression factor (USD05PPP per ha) - i13_tc_exponent(t,i) Regression exponent (1) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_tau(t,i,type) Agricultural land use intensity tau (1) - ov_tech_cost(t,i,type) Costs of TC (mio. USD05PPP per yr) - ov13_cost_tc(t,i,type) Technical change costs per region (mio. USD05PPP) - ov13_tech_cost_annuity(t,i,type) Annuity costs of TC (mio. USD05PPP per yr) - oq13_tech_cost(t,i,type) Total costs for TC (mio. USD05PPP) - oq13_cost_tc(t,i,type) Costs for TC (mio. USD05PPP per yr) - oq13_tech_cost_annuity(t,i,type) Annuity costs for TC (mio. USD05PPP per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +positive variable + vm_tau(i) Agricultural land use intensity tau (1) + vm_tech_cost(i) Costs of TC (mio. USD05PPP per yr) + v13_cost_tc(i) Technical change costs per region (mio. USD05PPP) + v13_tech_cost_annuity(i) Annuity costs of TC (mio. USD05PPP per yr) +; + +equations + q13_tech_cost(i) Total costs for TC (mio. USD05PPP) + q13_cost_tc(i) Costs for TC (mio. USD05PPP per yr) + q13_tech_cost_annuity(i) Annuity costs for TC (mio. USD05PPP per yr) +; + +parameters + pc13_land(i) Crop land area per region (mio ha) + pc13_tau(i) Tau factor of the previous time step (1) + p13_tech_cost_past(t,i) Costs for TC from past (mio. USD05PPP per yr) + pc13_tech_cost_past(i) Current costs for TC from past (mio. USD05PPP per yr) + pc13_tcguess(i) Guess for annual tc rates in the next time step (1) + i13_tc_factor(t,i) Regression factor (USD05PPP per ha) + i13_tc_exponent(t,i) Regression exponent (1) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_tau(t,i,type) Agricultural land use intensity tau (1) + ov_tech_cost(t,i,type) Costs of TC (mio. USD05PPP per yr) + ov13_cost_tc(t,i,type) Technical change costs per region (mio. USD05PPP) + ov13_tech_cost_annuity(t,i,type) Annuity costs of TC (mio. USD05PPP per yr) + oq13_tech_cost(t,i,type) Total costs for TC (mio. USD05PPP) + oq13_cost_tc(t,i,type) Costs for TC (mio. USD05PPP per yr) + oq13_tech_cost_annuity(t,i,type) Annuity costs for TC (mio. USD05PPP per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/13_tc/endo_jun18/equations.gms b/modules/13_tc/endo_jun18/equations.gms index 1e58e2fa9f..e1033e1c11 100644 --- a/modules/13_tc/endo_jun18/equations.gms +++ b/modules/13_tc/endo_jun18/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations diff --git a/modules/13_tc/endo_jun18/input.gms b/modules/13_tc/endo_jun18/input.gms index 1d0d6c5b1f..50a262a6ea 100644 --- a/modules/13_tc/endo_jun18/input.gms +++ b/modules/13_tc/endo_jun18/input.gms @@ -1,34 +1,35 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -parameter fm_tau1995(i) Agricultural land use intensity tau in 1995 (1) -/ -$ondelim -$include "./modules/13_tc/input/fm_tau1995.cs4" -$offdelim -/; - -parameter f13_tcguess(i) Guess for initial annual TC rates (1) -/ -$ondelim -$include "./modules/13_tc/input/f13_tcguess.cs4" -$offdelim -/; - -$setglobal c13_tccost medium - -table f13_tc_factor(t_all,scen13) Regression factor (USD05PPP per ha) -$ondelim -$include "./modules/13_tc/input/f13_tc_factor.cs3" -$offdelim -; - -table f13_tc_exponent(t_all,scen13) Regression exponent (1) -$ondelim -$include "./modules/13_tc/input/f13_tc_exponent.cs3" -$offdelim -; +*** | (C) 2008-2019 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 + + +parameter fm_tau1995(i) Agricultural land use intensity tau in 1995 (1) +/ +$ondelim +$include "./modules/13_tc/input/fm_tau1995.cs4" +$offdelim +/; + +parameter f13_tcguess(i) Guess for initial annual TC rates (1) +/ +$ondelim +$include "./modules/13_tc/input/f13_tcguess.cs4" +$offdelim +/; + +$setglobal c13_tccost medium + +table f13_tc_factor(t_all,scen13) Regression factor (USD05PPP per ha) +$ondelim +$include "./modules/13_tc/input/f13_tc_factor.cs3" +$offdelim +; + +table f13_tc_exponent(t_all,scen13) Regression exponent (1) +$ondelim +$include "./modules/13_tc/input/f13_tc_exponent.cs3" +$offdelim +; diff --git a/modules/13_tc/endo_jun18/nl_fix.gms b/modules/13_tc/endo_jun18/nl_fix.gms index 3726d65dc3..eb8ded6714 100644 --- a/modules/13_tc/endo_jun18/nl_fix.gms +++ b/modules/13_tc/endo_jun18/nl_fix.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 * ### nl_fix ### diff --git a/modules/13_tc/endo_jun18/nl_relax.gms b/modules/13_tc/endo_jun18/nl_relax.gms index 7657bc50ae..a5d317e668 100644 --- a/modules/13_tc/endo_jun18/nl_relax.gms +++ b/modules/13_tc/endo_jun18/nl_relax.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 * ### nl_relax ### diff --git a/modules/13_tc/endo_jun18/nl_release.gms b/modules/13_tc/endo_jun18/nl_release.gms index 36b5def7ac..8c3cd5e3a0 100644 --- a/modules/13_tc/endo_jun18/nl_release.gms +++ b/modules/13_tc/endo_jun18/nl_release.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 * ### nl_release ### diff --git a/modules/13_tc/endo_jun18/postsolve.gms b/modules/13_tc/endo_jun18/postsolve.gms index 7923e53cc5..7a91ea5d1d 100644 --- a/modules/13_tc/endo_jun18/postsolve.gms +++ b/modules/13_tc/endo_jun18/postsolve.gms @@ -1,45 +1,46 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -p13_tech_cost_past(t2,i) = p13_tech_cost_past(t2,i) + v13_tech_cost_annuity.l(i); - -if((ord(t)>1), - pc13_tcguess(i) = (vm_tau.l(i)/pc13_tau(i))**(1/m_yeardiff(t)) - 1; -); - -pc13_tau(i) = vm_tau.l(i); - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_tau(t,i,"marginal") = vm_tau.m(i); - ov_tech_cost(t,i,"marginal") = vm_tech_cost.m(i); - ov13_cost_tc(t,i,"marginal") = v13_cost_tc.m(i); - ov13_tech_cost_annuity(t,i,"marginal") = v13_tech_cost_annuity.m(i); - oq13_tech_cost(t,i,"marginal") = q13_tech_cost.m(i); - oq13_cost_tc(t,i,"marginal") = q13_cost_tc.m(i); - oq13_tech_cost_annuity(t,i,"marginal") = q13_tech_cost_annuity.m(i); - ov_tau(t,i,"level") = vm_tau.l(i); - ov_tech_cost(t,i,"level") = vm_tech_cost.l(i); - ov13_cost_tc(t,i,"level") = v13_cost_tc.l(i); - ov13_tech_cost_annuity(t,i,"level") = v13_tech_cost_annuity.l(i); - oq13_tech_cost(t,i,"level") = q13_tech_cost.l(i); - oq13_cost_tc(t,i,"level") = q13_cost_tc.l(i); - oq13_tech_cost_annuity(t,i,"level") = q13_tech_cost_annuity.l(i); - ov_tau(t,i,"upper") = vm_tau.up(i); - ov_tech_cost(t,i,"upper") = vm_tech_cost.up(i); - ov13_cost_tc(t,i,"upper") = v13_cost_tc.up(i); - ov13_tech_cost_annuity(t,i,"upper") = v13_tech_cost_annuity.up(i); - oq13_tech_cost(t,i,"upper") = q13_tech_cost.up(i); - oq13_cost_tc(t,i,"upper") = q13_cost_tc.up(i); - oq13_tech_cost_annuity(t,i,"upper") = q13_tech_cost_annuity.up(i); - ov_tau(t,i,"lower") = vm_tau.lo(i); - ov_tech_cost(t,i,"lower") = vm_tech_cost.lo(i); - ov13_cost_tc(t,i,"lower") = v13_cost_tc.lo(i); - ov13_tech_cost_annuity(t,i,"lower") = v13_tech_cost_annuity.lo(i); - oq13_tech_cost(t,i,"lower") = q13_tech_cost.lo(i); - oq13_cost_tc(t,i,"lower") = q13_cost_tc.lo(i); - oq13_tech_cost_annuity(t,i,"lower") = q13_tech_cost_annuity.lo(i); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 + +p13_tech_cost_past(t2,i) = p13_tech_cost_past(t2,i) + v13_tech_cost_annuity.l(i); + +if((ord(t)>1), + pc13_tcguess(i) = (vm_tau.l(i)/pc13_tau(i))**(1/m_yeardiff(t)) - 1; +); + +pc13_tau(i) = vm_tau.l(i); + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_tau(t,i,"marginal") = vm_tau.m(i); + ov_tech_cost(t,i,"marginal") = vm_tech_cost.m(i); + ov13_cost_tc(t,i,"marginal") = v13_cost_tc.m(i); + ov13_tech_cost_annuity(t,i,"marginal") = v13_tech_cost_annuity.m(i); + oq13_tech_cost(t,i,"marginal") = q13_tech_cost.m(i); + oq13_cost_tc(t,i,"marginal") = q13_cost_tc.m(i); + oq13_tech_cost_annuity(t,i,"marginal") = q13_tech_cost_annuity.m(i); + ov_tau(t,i,"level") = vm_tau.l(i); + ov_tech_cost(t,i,"level") = vm_tech_cost.l(i); + ov13_cost_tc(t,i,"level") = v13_cost_tc.l(i); + ov13_tech_cost_annuity(t,i,"level") = v13_tech_cost_annuity.l(i); + oq13_tech_cost(t,i,"level") = q13_tech_cost.l(i); + oq13_cost_tc(t,i,"level") = q13_cost_tc.l(i); + oq13_tech_cost_annuity(t,i,"level") = q13_tech_cost_annuity.l(i); + ov_tau(t,i,"upper") = vm_tau.up(i); + ov_tech_cost(t,i,"upper") = vm_tech_cost.up(i); + ov13_cost_tc(t,i,"upper") = v13_cost_tc.up(i); + ov13_tech_cost_annuity(t,i,"upper") = v13_tech_cost_annuity.up(i); + oq13_tech_cost(t,i,"upper") = q13_tech_cost.up(i); + oq13_cost_tc(t,i,"upper") = q13_cost_tc.up(i); + oq13_tech_cost_annuity(t,i,"upper") = q13_tech_cost_annuity.up(i); + ov_tau(t,i,"lower") = vm_tau.lo(i); + ov_tech_cost(t,i,"lower") = vm_tech_cost.lo(i); + ov13_cost_tc(t,i,"lower") = v13_cost_tc.lo(i); + ov13_tech_cost_annuity(t,i,"lower") = v13_tech_cost_annuity.lo(i); + oq13_tech_cost(t,i,"lower") = q13_tech_cost.lo(i); + oq13_cost_tc(t,i,"lower") = q13_cost_tc.lo(i); + oq13_tech_cost_annuity(t,i,"lower") = q13_tech_cost_annuity.lo(i); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/13_tc/endo_jun18/preloop.gms b/modules/13_tc/endo_jun18/preloop.gms index 4040b09b96..19f8499459 100644 --- a/modules/13_tc/endo_jun18/preloop.gms +++ b/modules/13_tc/endo_jun18/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 $ifthen "%c13_tccost%" == "mixed" diff --git a/modules/13_tc/endo_jun18/presolve.gms b/modules/13_tc/endo_jun18/presolve.gms index 1434c48317..27a8c3469e 100644 --- a/modules/13_tc/endo_jun18/presolve.gms +++ b/modules/13_tc/endo_jun18/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/13_tc/endo_jun18.gms b/modules/13_tc/endo_jun18/realization.gms similarity index 89% rename from modules/13_tc/endo_jun18.gms rename to modules/13_tc/endo_jun18/realization.gms index 8ad61de10a..0ded9b3638 100644 --- a/modules/13_tc/endo_jun18.gms +++ b/modules/13_tc/endo_jun18/realization.gms @@ -1,54 +1,55 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description The endo realization stands for endogenous implementation of -*' technological change and land use intensification. The intensification rates -*' are calculated endogenously based on an interplay between land use intensity -*' $\tau$ and technological change costs (as shown schematically in the figure -*' below). This module realization contains the implementation as described -*' in @dietrich_forecasting_2014 with two minor modifications: -*' -*' * rates of previous investment decisions which still have to be paid are -*' added to the technological change costs -*' * the planning horizon for investments is unified over all investments in -*' the model. -*' -*' ![Implementation of technological change in MAgPIE -*' [@dietrich_forecasting_2014]](tc_schematic.png){ width=60% } -*' -*' Initial land use intensity $\tau$ values for the year 2000 come from -*' @dietrich_measuring_2012 and are shown below. -*' -*' ![$\tau$-factors in world regions & global (GLO) for the year 2000. -*' [@dietrich_measuring_2012]](tau_regional.png){ width=60% } -*' -*' Investments into technological change (TC) trigger land use intensification -*' ($\tau$) which triggers in turn yields increases. How much intensification -*' can be triggered by an investment, depends on the investment-yield ratio, -*' which in turn depends on the current agricultural land use intensity. The -*' higher the current intensity level, the more expensive the additional -*' intensification will become. The interaction between land use intensity and -*' production costs per area as shown in the schematic is not covered by this -*' module and can be found instead in [38_factor_costs]. - -*' @limitations This module significantly reduces the overall computational -*' performance of the model since these endogenous calculations are highly -*' computational intensive. - - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/13_tc/endo_jun18/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/13_tc/endo_jun18/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/13_tc/endo_jun18/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/13_tc/endo_jun18/equations.gms" -$Ifi "%phase%" == "scaling" $include "./modules/13_tc/endo_jun18/scaling.gms" -$Ifi "%phase%" == "preloop" $include "./modules/13_tc/endo_jun18/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/13_tc/endo_jun18/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/13_tc/endo_jun18/postsolve.gms" -$Ifi "%phase%" == "nl_fix" $include "./modules/13_tc/endo_jun18/nl_fix.gms" -$Ifi "%phase%" == "nl_release" $include "./modules/13_tc/endo_jun18/nl_release.gms" -$Ifi "%phase%" == "nl_relax" $include "./modules/13_tc/endo_jun18/nl_relax.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description The endo realization stands for endogenous implementation of +*' technological change and land use intensification. The intensification rates +*' are calculated endogenously based on an interplay between land use intensity +*' $\tau$ and technological change costs (as shown schematically in the figure +*' below). This module realization contains the implementation as described +*' in @dietrich_forecasting_2014 with two minor modifications: +*' +*' * rates of previous investment decisions which still have to be paid are +*' added to the technological change costs +*' * the planning horizon for investments is unified over all investments in +*' the model. +*' +*' ![Implementation of technological change in MAgPIE +*' [@dietrich_forecasting_2014]](tc_schematic.png){ width=60% } +*' +*' Initial land use intensity $\tau$ values for the year 2000 come from +*' @dietrich_measuring_2012 and are shown below. +*' +*' ![$\tau$-factors in world regions & global (GLO) for the year 2000. +*' [@dietrich_measuring_2012]](tau_regional.png){ width=60% } +*' +*' Investments into technological change (TC) trigger land use intensification +*' ($\tau$) which triggers in turn yields increases. How much intensification +*' can be triggered by an investment, depends on the investment-yield ratio, +*' which in turn depends on the current agricultural land use intensity. The +*' higher the current intensity level, the more expensive the additional +*' intensification will become. The interaction between land use intensity and +*' production costs per area as shown in the schematic is not covered by this +*' module and can be found instead in [38_factor_costs]. + +*' @limitations This module significantly reduces the overall computational +*' performance of the model since these endogenous calculations are highly +*' computational intensive. + + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/13_tc/endo_jun18/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/13_tc/endo_jun18/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/13_tc/endo_jun18/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/13_tc/endo_jun18/equations.gms" +$Ifi "%phase%" == "scaling" $include "./modules/13_tc/endo_jun18/scaling.gms" +$Ifi "%phase%" == "preloop" $include "./modules/13_tc/endo_jun18/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/13_tc/endo_jun18/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/13_tc/endo_jun18/postsolve.gms" +$Ifi "%phase%" == "nl_fix" $include "./modules/13_tc/endo_jun18/nl_fix.gms" +$Ifi "%phase%" == "nl_release" $include "./modules/13_tc/endo_jun18/nl_release.gms" +$Ifi "%phase%" == "nl_relax" $include "./modules/13_tc/endo_jun18/nl_relax.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/13_tc/endo_jun18/scaling.gms b/modules/13_tc/endo_jun18/scaling.gms index c28c6da1a5..6c3caad7e8 100644 --- a/modules/13_tc/endo_jun18/scaling.gms +++ b/modules/13_tc/endo_jun18/scaling.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 v13_cost_tc.scale(i) = 10e6; diff --git a/modules/13_tc/endo_jun18/sets.gms b/modules/13_tc/endo_jun18/sets.gms index 2dd7e65655..dee5edb3e5 100644 --- a/modules/13_tc/endo_jun18/sets.gms +++ b/modules/13_tc/endo_jun18/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets diff --git a/modules/13_tc/13_tc.gms b/modules/13_tc/module.gms similarity index 74% rename from modules/13_tc/13_tc.gms rename to modules/13_tc/module.gms index cfd0637246..f02f6d61bc 100644 --- a/modules/13_tc/13_tc.gms +++ b/modules/13_tc/module.gms @@ -1,25 +1,26 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Technological change -*' -*' @description The technological change (TC) module describes the relation -*' between agricultural land use intensity represented by the $\tau$ factor and -*' the costs which have to be paid for further intensification (technological -*' change costs). Besides cropland expansion ([39_landconversion]) and trade -*' ([21_trade]), it describes the third major option of the model to increase -*' regional supply. In order to calculate this relation, the module needs to -*' receive information about the assumed interest rate and assumed investment -*' horizon currently provided by module [12_interest_rate]. -*' -*' Calculated $\tau$ factors are then used for yields calculation by [14_yields] -*' and by [38_factor_costs] for the calculation of factor costs. -*' -*' @authors Jan Philipp Dietrich, Christoph Schmitz, Benjamin Bodirsky - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%tc%" == "endo_jun18" $include "./modules/13_tc/endo_jun18.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Technological change +*' +*' @description The technological change (TC) module describes the relation +*' between agricultural land use intensity represented by the $\tau$ factor and +*' the costs which have to be paid for further intensification (technological +*' change costs). Besides cropland expansion ([39_landconversion]) and trade +*' ([21_trade]), it describes the third major option of the model to increase +*' regional supply. In order to calculate this relation, the module needs to +*' receive information about the assumed interest rate and assumed investment +*' horizon currently provided by module [12_interest_rate]. +*' +*' Calculated $\tau$ factors are then used for yields calculation by [14_yields] +*' and by [38_factor_costs] for the calculation of factor costs. +*' +*' @authors Jan Philipp Dietrich, Christoph Schmitz, Benjamin Bodirsky + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%tc%" == "endo_jun18" $include "./modules/13_tc/endo_jun18/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/14_yields/biocorrect/declarations.gms b/modules/14_yields/biocorrect/declarations.gms index 2acae7e80d..d6f6a9c742 100644 --- a/modules/14_yields/biocorrect/declarations.gms +++ b/modules/14_yields/biocorrect/declarations.gms @@ -1,27 +1,28 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -parameters -****** Yields - i14_yields(t,j,kve,w) Biophysical input yields (excluding technological change) (tDM per ha per yr) -; - -positive variables - vm_yld(j,kve,w) Yields (variable because of technical change) (tDM per ha per yr) -; - -equations - q14_yield_crop(j,kcr,w) Crop yields (tDM per ha per yr) - q14_yield_past(j,w) Pasture yields (tDM per ha per yr) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_yld(t,j,kve,w,type) Yields (variable because of technical change) (tDM per ha per yr) - oq14_yield_crop(t,j,kcr,w,type) Crop yields (tDM per ha per yr) - oq14_yield_past(t,j,w,type) Pasture yields (tDM per ha per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +parameters +****** Yields + i14_yields(t,j,kve,w) Biophysical input yields (excluding technological change) (tDM per ha per yr) +; + +positive variables + vm_yld(j,kve,w) Yields (variable because of technical change) (tDM per ha per yr) +; + +equations + q14_yield_crop(j,kcr,w) Crop yields (tDM per ha per yr) + q14_yield_past(j,w) Pasture yields (tDM per ha per yr) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_yld(t,j,kve,w,type) Yields (variable because of technical change) (tDM per ha per yr) + oq14_yield_crop(t,j,kcr,w,type) Crop yields (tDM per ha per yr) + oq14_yield_past(t,j,w,type) Pasture yields (tDM per ha per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/14_yields/biocorrect/equations.gms b/modules/14_yields/biocorrect/equations.gms index 28ffb36370..1a64395fab 100644 --- a/modules/14_yields/biocorrect/equations.gms +++ b/modules/14_yields/biocorrect/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations diff --git a/modules/14_yields/biocorrect/input.gms b/modules/14_yields/biocorrect/input.gms index 3a9a2ffcfe..ca7f34159e 100644 --- a/modules/14_yields/biocorrect/input.gms +++ b/modules/14_yields/biocorrect/input.gms @@ -1,28 +1,29 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -$setglobal c14_yields_scenario nocc -* options: cc (climate change) -* nocc (no climate change) - -scalars - s14_yld_past_switch Spillover parameter for translating technological change in the crop sector into pasture yield increases (1) / 0.25 / -; - -******* Calibration factor -table f14_yld_calib(i,ltype14) Calibration factor for the LPJ yields (1) -$ondelim -$include "./modules/14_yields/input/f14_yld_calib.csv" -$offdelim; - -table f14_yields(t_all,j,kve,w) LPJ potential yields per cell (rainfed and irrigated) (tDM per ha per yr) -$ondelim -$include "./modules/14_yields/input/lpj_yields.cs3" -$offdelim -; -* set values to 1995 if nocc scenario is used -$if "%c14_yields_scenario%" == "nocc" f14_yields(t_all,j,kve,w) = f14_yields("y1995",j,kve,w); -m_fillmissingyears(f14_yields,"j,kve,w"); +*** | (C) 2008-2019 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 + +$setglobal c14_yields_scenario nocc +* options: cc (climate change) +* nocc (no climate change) + +scalars + s14_yld_past_switch Spillover parameter for translating technological change in the crop sector into pasture yield increases (1) / 0.25 / +; + +******* Calibration factor +table f14_yld_calib(i,ltype14) Calibration factor for the LPJ yields (1) +$ondelim +$include "./modules/14_yields/input/f14_yld_calib.csv" +$offdelim; + +table f14_yields(t_all,j,kve,w) LPJ potential yields per cell (rainfed and irrigated) (tDM per ha per yr) +$ondelim +$include "./modules/14_yields/input/lpj_yields.cs3" +$offdelim +; +* set values to 1995 if nocc scenario is used +$if "%c14_yields_scenario%" == "nocc" f14_yields(t_all,j,kve,w) = f14_yields("y1995",j,kve,w); +m_fillmissingyears(f14_yields,"j,kve,w"); diff --git a/modules/14_yields/biocorrect/nl_fix.gms b/modules/14_yields/biocorrect/nl_fix.gms index 3a2b662f1d..df31303634 100644 --- a/modules/14_yields/biocorrect/nl_fix.gms +++ b/modules/14_yields/biocorrect/nl_fix.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 * ### nl_fix ### diff --git a/modules/14_yields/biocorrect/nl_release.gms b/modules/14_yields/biocorrect/nl_release.gms index 3d401f4a45..07f1b23bfd 100644 --- a/modules/14_yields/biocorrect/nl_release.gms +++ b/modules/14_yields/biocorrect/nl_release.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 * ### nl_release ### diff --git a/modules/14_yields/biocorrect/not_used.txt b/modules/14_yields/biocorrect/not_used.txt index 743a2ba7f7..c6661264f2 100644 --- a/modules/14_yields/biocorrect/not_used.txt +++ b/modules/14_yields/biocorrect/not_used.txt @@ -1,3 +1,9 @@ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). +# | Contact: magpie@pik-potsdam.de name,type,reason pm_land_start,input,questionnaire -pm_past_mngmnt_factor,input,questionnaire \ No newline at end of file +pm_past_mngmnt_factor,input,questionnaire diff --git a/modules/14_yields/biocorrect/postsolve.gms b/modules/14_yields/biocorrect/postsolve.gms index f63022dad1..2602c7a8f0 100644 --- a/modules/14_yields/biocorrect/postsolve.gms +++ b/modules/14_yields/biocorrect/postsolve.gms @@ -1,23 +1,24 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_yld(t,j,kve,w,"marginal") = vm_yld.m(j,kve,w); - oq14_yield_crop(t,j,kcr,w,"marginal") = q14_yield_crop.m(j,kcr,w); - oq14_yield_past(t,j,w,"marginal") = q14_yield_past.m(j,w); - ov_yld(t,j,kve,w,"level") = vm_yld.l(j,kve,w); - oq14_yield_crop(t,j,kcr,w,"level") = q14_yield_crop.l(j,kcr,w); - oq14_yield_past(t,j,w,"level") = q14_yield_past.l(j,w); - ov_yld(t,j,kve,w,"upper") = vm_yld.up(j,kve,w); - oq14_yield_crop(t,j,kcr,w,"upper") = q14_yield_crop.up(j,kcr,w); - oq14_yield_past(t,j,w,"upper") = q14_yield_past.up(j,w); - ov_yld(t,j,kve,w,"lower") = vm_yld.lo(j,kve,w); - oq14_yield_crop(t,j,kcr,w,"lower") = q14_yield_crop.lo(j,kcr,w); - oq14_yield_past(t,j,w,"lower") = q14_yield_past.lo(j,w); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - +*** | (C) 2008-2019 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 + + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_yld(t,j,kve,w,"marginal") = vm_yld.m(j,kve,w); + oq14_yield_crop(t,j,kcr,w,"marginal") = q14_yield_crop.m(j,kcr,w); + oq14_yield_past(t,j,w,"marginal") = q14_yield_past.m(j,w); + ov_yld(t,j,kve,w,"level") = vm_yld.l(j,kve,w); + oq14_yield_crop(t,j,kcr,w,"level") = q14_yield_crop.l(j,kcr,w); + oq14_yield_past(t,j,w,"level") = q14_yield_past.l(j,w); + ov_yld(t,j,kve,w,"upper") = vm_yld.up(j,kve,w); + oq14_yield_crop(t,j,kcr,w,"upper") = q14_yield_crop.up(j,kcr,w); + oq14_yield_past(t,j,w,"upper") = q14_yield_past.up(j,w); + ov_yld(t,j,kve,w,"lower") = vm_yld.lo(j,kve,w); + oq14_yield_crop(t,j,kcr,w,"lower") = q14_yield_crop.lo(j,kcr,w); + oq14_yield_past(t,j,w,"lower") = q14_yield_past.lo(j,w); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### + diff --git a/modules/14_yields/biocorrect/preloop.gms b/modules/14_yields/biocorrect/preloop.gms index d9ace095ae..3c432e1fb0 100644 --- a/modules/14_yields/biocorrect/preloop.gms +++ b/modules/14_yields/biocorrect/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 i14_yields(t,j,kve,w) = f14_yields(t,j,kve,w); @@ -12,4 +13,4 @@ i14_yields(t,j,"betr",w) = i14_yields(t,j,"betr",w)*sum(cell(i,j),fm_tau1995(i)) ***YIELD CALIBRATION************************************************************ i14_yields(t,j,kcr,w) = i14_yields(t,j,kcr,w) *sum(cell(i,j),f14_yld_calib(i,"crop")); -i14_yields(t,j,"pasture",w) = i14_yields(t,j,"pasture",w)*sum(cell(i,j),f14_yld_calib(i,"past")); \ No newline at end of file +i14_yields(t,j,"pasture",w) = i14_yields(t,j,"pasture",w)*sum(cell(i,j),f14_yld_calib(i,"past")); diff --git a/modules/14_yields/biocorrect.gms b/modules/14_yields/biocorrect/realization.gms similarity index 84% rename from modules/14_yields/biocorrect.gms rename to modules/14_yields/biocorrect/realization.gms index 407ba7d595..44151ae3cc 100644 --- a/modules/14_yields/biocorrect.gms +++ b/modules/14_yields/biocorrect/realization.gms @@ -1,33 +1,34 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description The biocorrect realization reads in the LPJmL data and performs -*' several corrections. -*' First, a bioenergy yield correction is performed. As there is currently no -*' robust information on bioenergy yields available in [@FAOSTAT], it is assumed -*' that the LPJmL yields for bioenergy correspond to the yields achieved under -*' the highest currently observed value of the $\tau$ factor representing -*' agricultural land use intensity. Bioenergy yields are downscaled -*' proportionally to the respective $\tau$ factor in the given region. -*' Second, yields for all other crops are corrected on the regional -*' level by applying a calibration factor that does not differentiate between -*' crops. Pasture yields have their own regional calibration factors. Applied -*' calibration factors are derived via comparing cropland and pasture areas in -*' the initial time step with values reported by FAO [@FAOSTAT]. -*' -*' @limitations The magnitude of spillover effects from technological change in -*' the crop sector towards improvements in pasture management is very uncertain. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/14_yields/biocorrect/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/14_yields/biocorrect/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/14_yields/biocorrect/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/14_yields/biocorrect/equations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/14_yields/biocorrect/preloop.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/14_yields/biocorrect/postsolve.gms" -$Ifi "%phase%" == "nl_fix" $include "./modules/14_yields/biocorrect/nl_fix.gms" -$Ifi "%phase%" == "nl_release" $include "./modules/14_yields/biocorrect/nl_release.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description The biocorrect realization reads in the LPJmL data and performs +*' several corrections. +*' First, a bioenergy yield correction is performed. As there is currently no +*' robust information on bioenergy yields available in [@FAOSTAT], it is assumed +*' that the LPJmL yields for bioenergy correspond to the yields achieved under +*' the highest currently observed value of the $\tau$ factor representing +*' agricultural land use intensity. Bioenergy yields are downscaled +*' proportionally to the respective $\tau$ factor in the given region. +*' Second, yields for all other crops are corrected on the regional +*' level by applying a calibration factor that does not differentiate between +*' crops. Pasture yields have their own regional calibration factors. Applied +*' calibration factors are derived via comparing cropland and pasture areas in +*' the initial time step with values reported by FAO [@FAOSTAT]. +*' +*' @limitations The magnitude of spillover effects from technological change in +*' the crop sector towards improvements in pasture management is very uncertain. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/14_yields/biocorrect/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/14_yields/biocorrect/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/14_yields/biocorrect/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/14_yields/biocorrect/equations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/14_yields/biocorrect/preloop.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/14_yields/biocorrect/postsolve.gms" +$Ifi "%phase%" == "nl_fix" $include "./modules/14_yields/biocorrect/nl_fix.gms" +$Ifi "%phase%" == "nl_release" $include "./modules/14_yields/biocorrect/nl_release.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/14_yields/biocorrect/sets.gms b/modules/14_yields/biocorrect/sets.gms index f233b53182..500ac4b7a1 100644 --- a/modules/14_yields/biocorrect/sets.gms +++ b/modules/14_yields/biocorrect/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets diff --git a/modules/14_yields/dynamic_aug18/declarations.gms b/modules/14_yields/dynamic_aug18/declarations.gms index 5efdad4899..9e3a69b8c4 100644 --- a/modules/14_yields/dynamic_aug18/declarations.gms +++ b/modules/14_yields/dynamic_aug18/declarations.gms @@ -1,28 +1,29 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -parameters - i14_yields(t,j,kve,w) Biophysical input yields (excluding technological change) (tDM per ha per yr) - p14_pyield_LPJ_reg(t_all,i) Regional average input yields aggregated from clusters with initial pasture area as weights (tDM per ha per yr) - p14_pyield_corr(t,i) Regional pasture management correction for historical time steps (1) -; - -positive variables - vm_yld(j,kve,w) Yields (variable because of technical change) (tDM per ha per yr) -; - -equations - q14_yield_crop(j,kcr,w) Crop yields (tDM per ha per yr) - q14_yield_past(j,w) Pasture yields (tDM per ha per yr) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_yld(t,j,kve,w,type) Yields (variable because of technical change) (tDM per ha per yr) - oq14_yield_crop(t,j,kcr,w,type) Crop yields (tDM per ha per yr) - oq14_yield_past(t,j,w,type) Pasture yields (tDM per ha per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +parameters + i14_yields(t,j,kve,w) Biophysical input yields (excluding technological change) (tDM per ha per yr) + p14_pyield_LPJ_reg(t_all,i) Regional average input yields aggregated from clusters with initial pasture area as weights (tDM per ha per yr) + p14_pyield_corr(t,i) Regional pasture management correction for historical time steps (1) +; + +positive variables + vm_yld(j,kve,w) Yields (variable because of technical change) (tDM per ha per yr) +; + +equations + q14_yield_crop(j,kcr,w) Crop yields (tDM per ha per yr) + q14_yield_past(j,w) Pasture yields (tDM per ha per yr) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_yld(t,j,kve,w,type) Yields (variable because of technical change) (tDM per ha per yr) + oq14_yield_crop(t,j,kcr,w,type) Crop yields (tDM per ha per yr) + oq14_yield_past(t,j,w,type) Pasture yields (tDM per ha per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/14_yields/dynamic_aug18/equations.gms b/modules/14_yields/dynamic_aug18/equations.gms index 7b416aafc3..2e7f4f07e9 100644 --- a/modules/14_yields/dynamic_aug18/equations.gms +++ b/modules/14_yields/dynamic_aug18/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations diff --git a/modules/14_yields/dynamic_aug18/input.gms b/modules/14_yields/dynamic_aug18/input.gms index b44268ac41..18910786fd 100644 --- a/modules/14_yields/dynamic_aug18/input.gms +++ b/modules/14_yields/dynamic_aug18/input.gms @@ -1,29 +1,30 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -$setglobal c14_yields_scenario nocc -* options: cc (climate change) -* nocc (no climate change) - -******* Calibration factor -table f14_yld_calib(i,ltype14) Calibration factor for the LPJmL yields (1) -$ondelim -$include "./modules/14_yields/input/f14_yld_calib.csv" -$offdelim; - -table f14_yields(t_all,j,kve,w) LPJmL potential yields per cell (rainfed and irrigated) (tDM per ha per yr) -$ondelim -$include "./modules/14_yields/input/lpj_yields.cs3" -$offdelim -; -* set values to 1995 if nocc scenario is used -$if "%c14_yields_scenario%" == "nocc" f14_yields(t_all,j,kve,w) = f14_yields("y1995",j,kve,w); -m_fillmissingyears(f14_yields,"j,kve,w"); - -table f14_pyld_hist(t_all,i) Modelled regional pasture yields in the past (tDM per ha per yr) -$ondelim -$include "./modules/14_yields/input/f14_pasture_yields_hist.csv" -$offdelim; +*** | (C) 2008-2019 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 + +$setglobal c14_yields_scenario nocc +* options: cc (climate change) +* nocc (no climate change) + +******* Calibration factor +table f14_yld_calib(i,ltype14) Calibration factor for the LPJmL yields (1) +$ondelim +$include "./modules/14_yields/input/f14_yld_calib.csv" +$offdelim; + +table f14_yields(t_all,j,kve,w) LPJmL potential yields per cell (rainfed and irrigated) (tDM per ha per yr) +$ondelim +$include "./modules/14_yields/input/lpj_yields.cs3" +$offdelim +; +* set values to 1995 if nocc scenario is used +$if "%c14_yields_scenario%" == "nocc" f14_yields(t_all,j,kve,w) = f14_yields("y1995",j,kve,w); +m_fillmissingyears(f14_yields,"j,kve,w"); + +table f14_pyld_hist(t_all,i) Modelled regional pasture yields in the past (tDM per ha per yr) +$ondelim +$include "./modules/14_yields/input/f14_pasture_yields_hist.csv" +$offdelim; diff --git a/modules/14_yields/dynamic_aug18/nl_fix.gms b/modules/14_yields/dynamic_aug18/nl_fix.gms index d58c4eacfc..01877e5944 100644 --- a/modules/14_yields/dynamic_aug18/nl_fix.gms +++ b/modules/14_yields/dynamic_aug18/nl_fix.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 * ### nl_fix ### diff --git a/modules/14_yields/dynamic_aug18/nl_release.gms b/modules/14_yields/dynamic_aug18/nl_release.gms index 563c6b2691..07f1b23bfd 100644 --- a/modules/14_yields/dynamic_aug18/nl_release.gms +++ b/modules/14_yields/dynamic_aug18/nl_release.gms @@ -1,10 +1,11 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 * ### nl_release ### vm_yld.lo(j,kve,w) = 0; -vm_yld.up(j,kve,w) = Inf; \ No newline at end of file +vm_yld.up(j,kve,w) = Inf; diff --git a/modules/14_yields/dynamic_aug18/not_used.txt b/modules/14_yields/dynamic_aug18/not_used.txt deleted file mode 100644 index 4327f1b371..0000000000 --- a/modules/14_yields/dynamic_aug18/not_used.txt +++ /dev/null @@ -1 +0,0 @@ -name,type,reason diff --git a/modules/14_yields/dynamic_aug18/postsolve.gms b/modules/14_yields/dynamic_aug18/postsolve.gms index c1bfaf33d2..399ea362d0 100644 --- a/modules/14_yields/dynamic_aug18/postsolve.gms +++ b/modules/14_yields/dynamic_aug18/postsolve.gms @@ -1,24 +1,25 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_yld(t,j,kve,w,"marginal") = vm_yld.m(j,kve,w); - oq14_yield_crop(t,j,kcr,w,"marginal") = q14_yield_crop.m(j,kcr,w); - oq14_yield_past(t,j,w,"marginal") = q14_yield_past.m(j,w); - ov_yld(t,j,kve,w,"level") = vm_yld.l(j,kve,w); - oq14_yield_crop(t,j,kcr,w,"level") = q14_yield_crop.l(j,kcr,w); - oq14_yield_past(t,j,w,"level") = q14_yield_past.l(j,w); - ov_yld(t,j,kve,w,"upper") = vm_yld.up(j,kve,w); - oq14_yield_crop(t,j,kcr,w,"upper") = q14_yield_crop.up(j,kcr,w); - oq14_yield_past(t,j,w,"upper") = q14_yield_past.up(j,w); - ov_yld(t,j,kve,w,"lower") = vm_yld.lo(j,kve,w); - oq14_yield_crop(t,j,kcr,w,"lower") = q14_yield_crop.lo(j,kcr,w); - oq14_yield_past(t,j,w,"lower") = q14_yield_past.lo(j,w); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - +*** | (C) 2008-2019 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 + + + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_yld(t,j,kve,w,"marginal") = vm_yld.m(j,kve,w); + oq14_yield_crop(t,j,kcr,w,"marginal") = q14_yield_crop.m(j,kcr,w); + oq14_yield_past(t,j,w,"marginal") = q14_yield_past.m(j,w); + ov_yld(t,j,kve,w,"level") = vm_yld.l(j,kve,w); + oq14_yield_crop(t,j,kcr,w,"level") = q14_yield_crop.l(j,kcr,w); + oq14_yield_past(t,j,w,"level") = q14_yield_past.l(j,w); + ov_yld(t,j,kve,w,"upper") = vm_yld.up(j,kve,w); + oq14_yield_crop(t,j,kcr,w,"upper") = q14_yield_crop.up(j,kcr,w); + oq14_yield_past(t,j,w,"upper") = q14_yield_past.up(j,w); + ov_yld(t,j,kve,w,"lower") = vm_yld.lo(j,kve,w); + oq14_yield_crop(t,j,kcr,w,"lower") = q14_yield_crop.lo(j,kcr,w); + oq14_yield_past(t,j,w,"lower") = q14_yield_past.lo(j,w); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### + diff --git a/modules/14_yields/dynamic_aug18/preloop.gms b/modules/14_yields/dynamic_aug18/preloop.gms index b98712e6a4..c3fc1bd875 100644 --- a/modules/14_yields/dynamic_aug18/preloop.gms +++ b/modules/14_yields/dynamic_aug18/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 i14_yields(t,j,kve,w) = f14_yields(t,j,kve,w); diff --git a/modules/14_yields/dynamic_aug18/presolve.gms b/modules/14_yields/dynamic_aug18/presolve.gms deleted file mode 100644 index 849f9211a2..0000000000 --- a/modules/14_yields/dynamic_aug18/presolve.gms +++ /dev/null @@ -1,8 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - diff --git a/modules/14_yields/dynamic_aug18.gms b/modules/14_yields/dynamic_aug18/realization.gms similarity index 76% rename from modules/14_yields/dynamic_aug18.gms rename to modules/14_yields/dynamic_aug18/realization.gms index 7f099cf6c3..f2d5132a3f 100644 --- a/modules/14_yields/dynamic_aug18.gms +++ b/modules/14_yields/dynamic_aug18/realization.gms @@ -1,25 +1,25 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description In the dynamic_aug18 realization, the crop yield calculations -*' are identical as in the above described realization (biocorrect). -*' -*' @limitations The exogenous implementation of pasture intensification cannot -*' capture feedbacks between land scarcity and efforts to improve pasture -*' management. - - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/14_yields/dynamic_aug18/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/14_yields/dynamic_aug18/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/14_yields/dynamic_aug18/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/14_yields/dynamic_aug18/equations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/14_yields/dynamic_aug18/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/14_yields/dynamic_aug18/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/14_yields/dynamic_aug18/postsolve.gms" -$Ifi "%phase%" == "nl_fix" $include "./modules/14_yields/dynamic_aug18/nl_fix.gms" -$Ifi "%phase%" == "nl_release" $include "./modules/14_yields/dynamic_aug18/nl_release.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description In the dynamic_aug18 realization, the crop yield calculations +*' are identical as in the above described realization (biocorrect). +*' +*' @limitations The exogenous implementation of pasture intensification cannot +*' capture feedbacks between land scarcity and efforts to improve pasture +*' management. + + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/14_yields/dynamic_aug18/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/14_yields/dynamic_aug18/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/14_yields/dynamic_aug18/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/14_yields/dynamic_aug18/equations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/14_yields/dynamic_aug18/preloop.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/14_yields/dynamic_aug18/postsolve.gms" +$Ifi "%phase%" == "nl_fix" $include "./modules/14_yields/dynamic_aug18/nl_fix.gms" +$Ifi "%phase%" == "nl_release" $include "./modules/14_yields/dynamic_aug18/nl_release.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/14_yields/dynamic_aug18/sets.gms b/modules/14_yields/dynamic_aug18/sets.gms index f233b53182..500ac4b7a1 100644 --- a/modules/14_yields/dynamic_aug18/sets.gms +++ b/modules/14_yields/dynamic_aug18/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets diff --git a/modules/14_yields/14_yields.gms b/modules/14_yields/module.gms similarity index 76% rename from modules/14_yields/14_yields.gms rename to modules/14_yields/module.gms index c0fc7f74f8..a94b16407b 100644 --- a/modules/14_yields/14_yields.gms +++ b/modules/14_yields/module.gms @@ -1,30 +1,31 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Yields -*' -*' @description The yields module simulates the temporal development of crop -*' yields and pasture productivity. Spatially explicit information on pasture -*' productivity and crop yields under both rainfed and irrigated conditions is -*' provided by the global gridded crop model LPJmL (Lund-Potsdam-Jena with -*' managed Land) [@bondeau_lpjml_2007]. In the initial year of the simulation -*' period, crop yields and pasture productivity are calibrated at the regional -*' level to meet the observed cropland and pasture area as reported by FAO -*' [@FAOSTAT]. For the simulation of the temporal development of agricultural -*' yields, the module receives information about the agricultural land use -*' intensity represented by the $\tau$ factor coming from the module [13_tc]. -*' -*' The module returns yields for all crops and for pasture, which is then used -*' by the modules [30_crop] and [31_past]. -*' -*' @authors Jan Philipp Dietrich, Isabelle Weindl, Florian Humpenöder, Anne Biewald - - - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%yields%" == "biocorrect" $include "./modules/14_yields/biocorrect.gms" -$Ifi "%yields%" == "dynamic_aug18" $include "./modules/14_yields/dynamic_aug18.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Yields +*' +*' @description The yields module simulates the temporal development of crop +*' yields and pasture productivity. Spatially explicit information on pasture +*' productivity and crop yields under both rainfed and irrigated conditions is +*' provided by the global gridded crop model LPJmL (Lund-Potsdam-Jena with +*' managed Land) [@bondeau_lpjml_2007]. In the initial year of the simulation +*' period, crop yields and pasture productivity are calibrated at the regional +*' level to meet the observed cropland and pasture area as reported by FAO +*' [@FAOSTAT]. For the simulation of the temporal development of agricultural +*' yields, the module receives information about the agricultural land use +*' intensity represented by the $\tau$ factor coming from the module [13_tc]. +*' +*' The module returns yields for all crops and for pasture, which is then used +*' by the modules [30_crop] and [31_past]. +*' +*' @authors Jan Philipp Dietrich, Isabelle Weindl, Florian Humpenöder, Anne Biewald + + + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%yields%" == "biocorrect" $include "./modules/14_yields/biocorrect/realization.gms" +$Ifi "%yields%" == "dynamic_aug18" $include "./modules/14_yields/dynamic_aug18/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/15_food/anthropometrics_jan18/declarations.gms b/modules/15_food/anthropometrics_jan18/declarations.gms index 4da63b68fd..e7b2ef9a1c 100644 --- a/modules/15_food/anthropometrics_jan18/declarations.gms +++ b/modules/15_food/anthropometrics_jan18/declarations.gms @@ -1,215 +1,216 @@ -*** (C) 2008-2017 Potsdam Institute for Climate Impact Research (PIK), -*** authors, and contributors see AUTHORS file -*** This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** Contact: magpie@pik-potsdam.de - - -equations - q15_food_demand(i,kfo) Food demand (mio. kcal) -; - -positive variables - vm_dem_food(i,kall) Food demand (mio. tDM per yr) -; - - -*** #### Food Demand Model - - - -equations - q15_aim Objective function of food demand model (mio. USD05PPP) - q15_budget(iso) Household budget constraint (USD05PPP per cap per day) - - q15_regr_bmi_shr(iso,sex,agegroup15,bmi_tree15) Estimates regression parameters for BMI regression shares (1) - q15_bmi_shr_verylow(iso,sex,agegroup15) Estimates BMI share for population groups with low BMI (1) - q15_bmi_shr_low(iso,sex,agegroup15) Estimates BMI share for population groups with very low BMI (1) - q15_bmi_shr_medium(iso,sex,agegroup15) Estimates BMI share for population groups with medium BMI(1) - q15_bmi_shr_medium_high(iso,sex,agegroup15) Estimates BMI share for population groups with medium to high BMI (1) - q15_bmi_shr_high(iso,sex,agegroup15) Estimates BMI share for population groups with high BMI (1) - q15_bmi_shr_veryhigh(iso,sex,agegroup15) Estimates BMI share for population groups with very high BMI (1) - q15_bmi_shr_agg(iso,sex,age,bmi_group15) Disaggregates age groups from overarching groups (1) - - q15_intake(iso) Estimates average intake for the entire country (kcal per cap per day) - q15_regr_kcal(iso) Per capita total demand (kcal per cap per day) - q15_regr(iso, regr15) Estimates parameters for food demand and dietary composition (1) - q15_foodtree_kcal_animals(iso,kfo_ap) Demand for animal products (kcal per cap per day) - q15_foodtree_kcal_processed(iso,kfo_pf) Demand for processed products (kcal per cap per day) - q15_foodtree_kcal_staples(iso,kfo_st) Demand for staple products (kcal per cap per day) - q15_foodtree_kcal_vegetables(iso) Demand for vegetable and fruit products (kcal per cap per day) - -; - - -positive variables - v15_kcal_regr(iso,kfo) Uncalibrated regression estimates of calorie demand (kcal per cap per day) - v15_kcal_regr_total(iso) Uncalibrated regression estimates of total per cap calories (kcal per cap per day) - v15_demand_regr(iso, regr15) Uncalibrated regression estimates of kcal shares (1) - v15_income_pc_real_ppp_iso(iso) Real income per cap (USD05PPP per cap) - v15_income_balance(iso) Balance variable to balance cases in which reduction in income is larger than the per capita GDP (USD05PPP per cap per yr) - v15_kcal_intake_total_regr(iso) Food intake (kcal per cap per day) - v15_regr_overgroups(iso,sex,agegroup15,bmi_tree15) Hierarchical tree parameter regressions (1) - v15_bmi_shr_regr(iso,sex,age,bmi_group15) Uncalibrated share of population groups belonging to a certain BMI group (1) - v15_bmi_shr_overgroups(iso,sex,agegroup15,bmi_group15) Uncalibrated share of population groups belonging to a certain BMI group (1) -; - -variables - v15_objective Objective term (USD05PPP) -; - -scalar s15_count Loop counter for interpolating body height estimates between longer timesteps (1); - -parameters -* technical - p15_modelstat(t) Model solver status (1) - p15_iteration_counter(t) Number of iterations required for reaching an equilibrium between food demand model and magpie (1) - p15_convergence_measure(t) Convergence measure to decide for continuation or stop of food_demand - magpie iteration (1) - i15_dem_intercept(regr15) Food regression parameters intercept in kcal or as share (X) - i15_dem_saturation(regr15) Food regression parameters saturation in kcal or as share (X) - i15_dem_halfsat(regr15) Food regression parameters halfsaturation (USD05PPP per cap) - i15_dem_nonsat(regr15) Food regression parameters nonsaturation (1) - -*prices - p15_prices_kcal(t,iso,kfo) Prices from MAgPIE after optimization (USD05PPP per kcal) - i15_prices_initial_kcal(iso,kfo) Initial prices that capture the approximate level of prices in 1961-2010 (USD05PPP per kcal) - -* anthropometrics - p15_bmi_shr(t,iso,sex,age,bmi_group15) Calibrated estimates BMI share for population groups (1) - p15_bmi_shr(t,iso,sex,age,bmi_group15) Calibrated estimates BMI share for population groups (1) - p15_bodyheight(t,iso,sex,age,estimates15) Body height (cm per cap) - p15_bodyweight(t,iso,sex,age,bmi_group15) Body weight (kg per cap) - p15_bodyheight_calib(t,iso,sex,age_new_estimated15) Calibration factor for regional height differences (cm) - p15_kcal_growth_food(t_all,iso,underaged15) Average per capita demand for body size growth relevant food items in the last three 5-year steps (kcal per capita per day) - p15_physical_activity_level(t,iso,sex,age) Physical activity levels in PAL relative to basic metabolic rate BMR (kcal per kcal) - - i15_bmi_intercept(sex,agegroup15,bmi_tree15) BMI share regression intercept (1) - i15_bmi_saturation(sex,agegroup15,bmi_tree15) BMI share regression saturation (1) - i15_bmi_halfsat(sex,agegroup15,bmi_tree15) BMI share regression halfsaturation (1) - - i15_bmi_shr_regr_pre(t,iso,sex,agegroup15,bmi_tree15) BMI regression share precalculation based on regression parameters required for calibration (1) - i15_bmi_shr_pre(t,iso,sex,agegroup15,bmi_group15) BMI share precalculation based on regression parameters required for calibration (1) - i15_bmi_shr_calib(t,iso,sex,age,bmi_group15) Calibration parameters to meet historical BMI shares (1) - i15_bmi_shr_calib_lastcalibyear(iso,sex,age,bmi_group15) Calibration parameters of the last year with historical observations (1) - -* diet structure - p15_kcal_intake_total(t,iso) Total food intake in a country (kcal per capita per day) - i15_intake(t,iso,sex,age,bmi_group15) Mean food intake by population group (kcal per capita per day) - i15_kcal_pregnancy(t,iso) Additional calorie requriements for pregnancy and lactation (kcal) - p15_kcal_regr(t, iso, kfo) Uncalibrated regression estimates of calorie demand (kcal per cap per day) - - i15_ruminant_fadeout(t_all) ruminant fadeout share (1) - - i15_staples_kcal_structure_iso(t,iso,kfo_st) Share of a staple products within total staples (1) - i15_livestock_kcal_structure_iso_raw(t,iso,kfo_ap) Share of a livestock products within total staples (uncorrected for future changes in shares) (1) - i15_livestock_kcal_structure_iso(t,iso,kfo_ap) Share of livestock products within total staples (corrected for future changes in shares) (1) - i15_processed_kcal_structure_iso Share of a processed product within total staples (1) - i15_staples_kcal_iso_tmp(t,iso) Intermediate calculation do not use elsewhere (kcal per cap per day) - i15_livestock_kcal_iso_tmp(t,iso) Intermediate calculation do not use elsewhere (kcal per cap per day) - -* diet calibration - p15_kcal_calib(t,iso,kfo) Balance flow to diverge from mean calories of regressions (kcal per cap per day) - p15_kcal_calib_lastcalibyear(iso,kfo) Calibration factor for the last year with observations (kcal per cap per day) - p15_balanceflow_kcal(t,i,kfo) Balance flow for mismatch between FAOSTAT and demand estimates (kcal per capita per day) - p15_balanceflow_kcal_iso(t,iso,kfo) Balance flow for mismatch between FAOSTAT and demand estimates (kcal per capita per day) - p15_balanceflow_kcal_lastcalibyear(iso,kfo) Balance flow of last historic time step for mismatch between FAOSTAT and demand estimates (kcal per capita per day) - -* before shock - - o15_kcal_regr_initial(iso,kfo) Uncalibrated per capita demand before price shock (kcal per capita per day) - p15_kcal_pc_initial(t,i,kfo) Per capita consumption in food demand model before price shock on regional level (kcal per capita per day) - pm_kcal_pc_initial(t,i,kfo) Per capita consumption in food demand model before price shock (kcal per capita per day) - p15_kcal_pc_initial_iso(t,iso,kfo) Per capita consumption in food demand model before price shock on country level (kcal per capita per day) - -* after price shock - p15_kcal_pc_iso(t,iso,kfo) Per capita consumption in food demand model after price shock on country level (kcal per capita per day) - p15_kcal_pc(t,i,kfo) Per capita consumption in food demand model after price shock on regional level (kcal per capita per day) - p15_kcal_pc_calibrated(t,i,kfo) Calibrated per capita consumption in food demand model after price shock (kcal per capita per day) - -* calculate diet iteration breakpoint - - p15_income_pc_real_ppp(t,i) Regional per capita income after price shock on regional level (USD05PPP per capita) - p15_delta_income(t,i) Regional change in per capita income due to price shock on regional level (1) - p15_lastiteration_delta_income(i) Regional change in per capita income due to price shock of last iteration (1) - -; - -scalars - s15_year Current year as integer value (yr) /2000/ -; - -*' @code -*' The food demand model consists of the following equations, which are not -*' part of MAgPIE. - -model m15_food_demand / - q15_aim, - q15_budget, - - q15_regr_bmi_shr, - - q15_bmi_shr_verylow, - q15_bmi_shr_low, - q15_bmi_shr_medium, - q15_bmi_shr_medium_high, - q15_bmi_shr_high, - q15_bmi_shr_veryhigh, - - q15_bmi_shr_agg, - - q15_intake, - q15_regr_kcal, - q15_regr, - - q15_foodtree_kcal_animals, - q15_foodtree_kcal_processed, - q15_foodtree_kcal_staples, - q15_foodtree_kcal_vegetables - /; - - - -*' In contrast, the equation `q15_food_demand` is part of MAgPIE, but -*' not of the food demand model. -*' @stop - -m15_food_demand.optfile = 0 ; -m15_food_demand.scaleopt = 1 ; -m15_food_demand.solprint = 0 ; -m15_food_demand.holdfixed = 1 ; - - - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_dem_food(t,i,kall,type) Food demand (mio. tDM per yr) - ov15_kcal_regr(t,iso,kfo,type) Uncalibrated regression estimates of calorie demand (kcal per cap per day) - ov15_kcal_regr_total(t,iso,type) Uncalibrated regression estimates of total per cap calories (kcal per cap per day) - ov15_demand_regr(t,iso,regr15,type) Uncalibrated regression estimates of kcal shares (1) - ov15_income_pc_real_ppp_iso(t,iso,type) Real income per cap (USD05PPP per cap) - ov15_income_balance(t,iso,type) Balance variable to balance cases in which reduction in income is larger than the per capita GDP (USD05PPP per cap per yr) - ov15_kcal_intake_total_regr(t,iso,type) Food intake (kcal per cap per day) - ov15_regr_overgroups(t,iso,sex,agegroup15,bmi_tree15,type) Hierarchical tree parameter regressions (1) - ov15_bmi_shr_regr(t,iso,sex,age,bmi_group15,type) Uncalibrated share of population groups belonging to a certain BMI group (1) - ov15_bmi_shr_overgroups(t,iso,sex,agegroup15,bmi_group15,type) Uncalibrated share of population groups belonging to a certain BMI group (1) - ov15_objective(t,type) Objective term (USD05PPP) - oq15_food_demand(t,i,kfo,type) Food demand (mio. kcal) - oq15_aim(t,type) Objective function of food demand model (mio. USD05PPP) - oq15_budget(t,iso,type) Household budget constraint (USD05PPP per cap per day) - oq15_regr_bmi_shr(t,iso,sex,agegroup15,bmi_tree15,type) Estimates regression parameters for BMI regression shares (1) - oq15_bmi_shr_verylow(t,iso,sex,agegroup15,type) Estimates BMI share for population groups with low BMI (1) - oq15_bmi_shr_low(t,iso,sex,agegroup15,type) Estimates BMI share for population groups with very low BMI (1) - oq15_bmi_shr_medium(t,iso,sex,agegroup15,type) Estimates BMI share for population groups with medium BMI(1) - oq15_bmi_shr_medium_high(t,iso,sex,agegroup15,type) Estimates BMI share for population groups with medium to high BMI (1) - oq15_bmi_shr_high(t,iso,sex,agegroup15,type) Estimates BMI share for population groups with high BMI (1) - oq15_bmi_shr_veryhigh(t,iso,sex,agegroup15,type) Estimates BMI share for population groups with very high BMI (1) - oq15_bmi_shr_agg(t,iso,sex,age,bmi_group15,type) Disaggregates age groups from overarching groups (1) - oq15_intake(t,iso,type) Estimates average intake for the entire country (kcal per cap per day) - oq15_regr_kcal(t,iso,type) Per capita total demand (kcal per cap per day) - oq15_regr(t,iso,regr15,type) Estimates parameters for food demand and dietary composition (1) - oq15_foodtree_kcal_animals(t,iso,kfo_ap,type) Demand for animal products (kcal per cap per day) - oq15_foodtree_kcal_processed(t,iso,kfo_pf,type) Demand for processed products (kcal per cap per day) - oq15_foodtree_kcal_staples(t,iso,kfo_st,type) Demand for staple products (kcal per cap per day) - oq15_foodtree_kcal_vegetables(t,iso,type) Demand for vegetable and fruit products (kcal per cap per day) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + +equations + q15_food_demand(i,kfo) Food demand (mio. kcal) +; + +positive variables + vm_dem_food(i,kall) Food demand (mio. tDM per yr) +; + + +*** #### Food Demand Model + + + +equations + q15_aim Objective function of food demand model (mio. USD05PPP) + q15_budget(iso) Household budget constraint (USD05PPP per cap per day) + + q15_regr_bmi_shr(iso,sex,agegroup15,bmi_tree15) Estimates regression parameters for BMI regression shares (1) + q15_bmi_shr_verylow(iso,sex,agegroup15) Estimates BMI share for population groups with low BMI (1) + q15_bmi_shr_low(iso,sex,agegroup15) Estimates BMI share for population groups with very low BMI (1) + q15_bmi_shr_medium(iso,sex,agegroup15) Estimates BMI share for population groups with medium BMI(1) + q15_bmi_shr_medium_high(iso,sex,agegroup15) Estimates BMI share for population groups with medium to high BMI (1) + q15_bmi_shr_high(iso,sex,agegroup15) Estimates BMI share for population groups with high BMI (1) + q15_bmi_shr_veryhigh(iso,sex,agegroup15) Estimates BMI share for population groups with very high BMI (1) + q15_bmi_shr_agg(iso,sex,age,bmi_group15) Disaggregates age groups from overarching groups (1) + + q15_intake(iso) Estimates average intake for the entire country (kcal per cap per day) + q15_regr_kcal(iso) Per capita total demand (kcal per cap per day) + q15_regr(iso, regr15) Estimates parameters for food demand and dietary composition (1) + q15_foodtree_kcal_animals(iso,kfo_ap) Demand for animal products (kcal per cap per day) + q15_foodtree_kcal_processed(iso,kfo_pf) Demand for processed products (kcal per cap per day) + q15_foodtree_kcal_staples(iso,kfo_st) Demand for staple products (kcal per cap per day) + q15_foodtree_kcal_vegetables(iso) Demand for vegetable and fruit products (kcal per cap per day) + +; + + +positive variables + v15_kcal_regr(iso,kfo) Uncalibrated regression estimates of calorie demand (kcal per cap per day) + v15_kcal_regr_total(iso) Uncalibrated regression estimates of total per cap calories (kcal per cap per day) + v15_demand_regr(iso, regr15) Uncalibrated regression estimates of kcal shares (1) + v15_income_pc_real_ppp_iso(iso) Real income per cap (USD05PPP per cap) + v15_income_balance(iso) Balance variable to balance cases in which reduction in income is larger than the per capita GDP (USD05PPP per cap per yr) + v15_kcal_intake_total_regr(iso) Food intake (kcal per cap per day) + v15_regr_overgroups(iso,sex,agegroup15,bmi_tree15) Hierarchical tree parameter regressions (1) + v15_bmi_shr_regr(iso,sex,age,bmi_group15) Uncalibrated share of population groups belonging to a certain BMI group (1) + v15_bmi_shr_overgroups(iso,sex,agegroup15,bmi_group15) Uncalibrated share of population groups belonging to a certain BMI group (1) +; + +variables + v15_objective Objective term (USD05PPP) +; + +scalars + s15_yeardiff Number of 5-year time intervalls between time steps (1) + s15_count Loop counter for interpolating body height estimates between longer timesteps (1) + +; + +parameters +* technical + p15_modelstat(t) Model solver status (1) + p15_iteration_counter(t) Number of iterations required for reaching an equilibrium between food demand model and magpie (1) + p15_convergence_measure(t) Convergence measure to decide for continuation or stop of food_demand - magpie iteration (1) + i15_dem_intercept(regr15) Food regression parameters intercept in kcal or as share (X) + i15_dem_saturation(regr15) Food regression parameters saturation in kcal or as share (X) + i15_dem_halfsat(regr15) Food regression parameters halfsaturation (USD05PPP per cap) + i15_dem_nonsat(regr15) Food regression parameters nonsaturation (1) + +*prices + p15_prices_kcal(t,iso,kfo) Prices from MAgPIE after optimization (USD05PPP per kcal) + i15_prices_initial_kcal(iso,kfo) Initial prices that capture the approximate level of prices in 1961-2010 (USD05PPP per kcal) + +* anthropometrics + o15_bmi_shr(t,iso,sex,age,bmi_group15) Calibrated estimates BMI share for population groups (1) + p15_bodyheight(t,iso,sex,age,estimates15) Body height (cm per cap) + p15_bodyweight(t,iso,sex,age,bmi_group15) Body weight (kg per cap) + p15_bodyheight_calib(t,iso,sex,age_new_estimated15) Calibration factor for regional height differences (cm) + p15_kcal_growth_food(t_all,iso,underaged15) Average per capita demand for body size growth relevant food items in the last three 5-year steps (kcal per capita per day) + p15_physical_activity_level(t,iso,sex,age) Physical activity levels in PAL relative to basic metabolic rate BMR (kcal per kcal) + + i15_bmi_intercept(sex,agegroup15,bmi_tree15) BMI share regression intercept (1) + i15_bmi_saturation(sex,agegroup15,bmi_tree15) BMI share regression saturation (1) + i15_bmi_halfsat(sex,agegroup15,bmi_tree15) BMI share regression halfsaturation (1) + + p15_bmi_shr_regr(t,iso,sex,age,bmi_group15) Uncalibrated regression estimates of BMI shares (1) + i15_bmi_shr_calib(t,iso,sex,age,bmi_group15) Calibration parameters to meet historical BMI shares (1) + i15_bmi_shr_calib_lastcalibyear(iso,sex,age,bmi_group15) Calibration parameters of the last year with historical observations (1) + +* diet structure + o15_kcal_intake_total(t,iso) Total food intake in a country (kcal per capita per day) + p15_intake(t,iso,sex,age,bmi_group15) Mean food intake by population group (kcal per capita per day) + i15_kcal_pregnancy(t,iso) Additional calorie requirements for pregnancy and lactation (kcal) + p15_kcal_regr(t, iso, kfo) Uncalibrated regression estimates of calorie demand (kcal per cap per day) + + i15_ruminant_fadeout(t_all) Ruminant fadeout share (1) + + i15_staples_kcal_structure_iso(t,iso,kfo_st) Share of single staple products within total staples (1) + i15_livestock_kcal_structure_iso_raw(t,iso,kfo_ap) Share of single livestock products within total livestock products (uncorrected for future changes in shares) (1) + i15_livestock_kcal_structure_iso(t,iso,kfo_ap) Share of single livestock products within total livestock products (corrected for future changes in shares) (1) + i15_processed_kcal_structure_iso Share of single processed products within total processed food (1) + +* diet calibration + p15_kcal_calib(t,iso,kfo) Balance flow to diverge from mean calories of regressions (kcal per cap per day) + p15_kcal_calib_lastcalibyear(iso,kfo) Calibration factor for the last year with observations (kcal per cap per day) + p15_balanceflow_kcal(t,i,kfo) Balance flow for mismatch between FAOSTAT and demand estimates (kcal per capita per day) + p15_balanceflow_kcal_iso(t,iso,kfo) Balance flow for mismatch between FAOSTAT and demand estimates (kcal per capita per day) + p15_balanceflow_kcal_lastcalibyear(iso,kfo) Balance flow of last historic time step for mismatch between FAOSTAT and demand estimates (kcal per capita per day) + +* before shock + + o15_kcal_regr_initial(iso,kfo) Uncalibrated per capita demand before price shock (kcal per capita per day) + p15_kcal_pc_initial(t,i,kfo) Per capita consumption in food demand model before price shock on regional level (kcal per capita per day) + pm_kcal_pc_initial(t,i,kfo) Per capita consumption in food demand model before price shock (kcal per capita per day) + p15_kcal_pc_initial_iso(t,iso,kfo) Per capita consumption in food demand model before price shock on country level (kcal per capita per day) + +* after price shock + p15_kcal_pc_iso(t,iso,kfo) Per capita consumption in food demand model after price shock on country level (kcal per capita per day) + p15_kcal_pc(t,i,kfo) Per capita consumption in food demand model after price shock on regional level (kcal per capita per day) + p15_kcal_pc_calibrated(t,i,kfo) Calibrated per capita consumption in food demand model after price shock (kcal per capita per day) + +* calculate diet iteration breakpoint + + p15_income_pc_real_ppp(t,i) Regional per capita income after price shock on regional level (USD05PPP per capita) + p15_delta_income(t,i) Regional change in per capita income due to price shock on regional level (1) + p15_lastiteration_delta_income(t,i) Regional change in per capita income due to price shock of last iteration (1) + +; + +scalars + s15_year Current year as integer value (yr) /2000/ +; + +*' @code +*' The food demand model consists of the following equations, which are not +*' part of MAgPIE. + +model m15_food_demand / + q15_aim, + q15_budget, + + q15_regr_bmi_shr, + + q15_bmi_shr_verylow, + q15_bmi_shr_low, + q15_bmi_shr_medium, + q15_bmi_shr_medium_high, + q15_bmi_shr_high, + q15_bmi_shr_veryhigh, + + q15_bmi_shr_agg, + + q15_intake, + q15_regr_kcal, + q15_regr, + + q15_foodtree_kcal_animals, + q15_foodtree_kcal_processed, + q15_foodtree_kcal_staples, + q15_foodtree_kcal_vegetables + /; + + + +*' In contrast, the equation `q15_food_demand` is part of MAgPIE, but +*' not of the food demand model. +*' @stop + +m15_food_demand.optfile = 0 ; +m15_food_demand.scaleopt = 1 ; +m15_food_demand.solprint = 0 ; +m15_food_demand.holdfixed = 1 ; + + + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_dem_food(t,i,kall,type) Food demand (mio. tDM per yr) + ov15_kcal_regr(t,iso,kfo,type) Uncalibrated regression estimates of calorie demand (kcal per cap per day) + ov15_kcal_regr_total(t,iso,type) Uncalibrated regression estimates of total per cap calories (kcal per cap per day) + ov15_demand_regr(t,iso,regr15,type) Uncalibrated regression estimates of kcal shares (1) + ov15_income_pc_real_ppp_iso(t,iso,type) Real income per cap (USD05PPP per cap) + ov15_income_balance(t,iso,type) Balance variable to balance cases in which reduction in income is larger than the per capita GDP (USD05PPP per cap per yr) + ov15_kcal_intake_total_regr(t,iso,type) Food intake (kcal per cap per day) + ov15_regr_overgroups(t,iso,sex,agegroup15,bmi_tree15,type) Hierarchical tree parameter regressions (1) + ov15_bmi_shr_regr(t,iso,sex,age,bmi_group15,type) Uncalibrated share of population groups belonging to a certain BMI group (1) + ov15_bmi_shr_overgroups(t,iso,sex,agegroup15,bmi_group15,type) Uncalibrated share of population groups belonging to a certain BMI group (1) + ov15_objective(t,type) Objective term (USD05PPP) + oq15_food_demand(t,i,kfo,type) Food demand (mio. kcal) + oq15_aim(t,type) Objective function of food demand model (mio. USD05PPP) + oq15_budget(t,iso,type) Household budget constraint (USD05PPP per cap per day) + oq15_regr_bmi_shr(t,iso,sex,agegroup15,bmi_tree15,type) Estimates regression parameters for BMI regression shares (1) + oq15_bmi_shr_verylow(t,iso,sex,agegroup15,type) Estimates BMI share for population groups with low BMI (1) + oq15_bmi_shr_low(t,iso,sex,agegroup15,type) Estimates BMI share for population groups with very low BMI (1) + oq15_bmi_shr_medium(t,iso,sex,agegroup15,type) Estimates BMI share for population groups with medium BMI(1) + oq15_bmi_shr_medium_high(t,iso,sex,agegroup15,type) Estimates BMI share for population groups with medium to high BMI (1) + oq15_bmi_shr_high(t,iso,sex,agegroup15,type) Estimates BMI share for population groups with high BMI (1) + oq15_bmi_shr_veryhigh(t,iso,sex,agegroup15,type) Estimates BMI share for population groups with very high BMI (1) + oq15_bmi_shr_agg(t,iso,sex,age,bmi_group15,type) Disaggregates age groups from overarching groups (1) + oq15_intake(t,iso,type) Estimates average intake for the entire country (kcal per cap per day) + oq15_regr_kcal(t,iso,type) Per capita total demand (kcal per cap per day) + oq15_regr(t,iso,regr15,type) Estimates parameters for food demand and dietary composition (1) + oq15_foodtree_kcal_animals(t,iso,kfo_ap,type) Demand for animal products (kcal per cap per day) + oq15_foodtree_kcal_processed(t,iso,kfo_pf,type) Demand for processed products (kcal per cap per day) + oq15_foodtree_kcal_staples(t,iso,kfo_st,type) Demand for staple products (kcal per cap per day) + oq15_foodtree_kcal_vegetables(t,iso,type) Demand for vegetable and fruit products (kcal per cap per day) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/15_food/anthropometrics_jan18/equations.gms b/modules/15_food/anthropometrics_jan18/equations.gms index 7411dc18c7..0ac59e4753 100644 --- a/modules/15_food/anthropometrics_jan18/equations.gms +++ b/modules/15_food/anthropometrics_jan18/equations.gms @@ -1,8 +1,9 @@ -*** (C) 2008-2017 Potsdam Institute for Climate Impact Research (PIK), -*** authors, and contributors see AUTHORS file -*** This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** Contact: magpie@pik-potsdam.de +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de *' @equations @@ -144,7 +145,7 @@ q15_intake(iso).. sum((ct, sex, age, bmi_group15), v15_bmi_shr_regr(iso,sex,age,bmi_group15)* im_demography(ct,iso,sex,age) * - i15_intake(ct,iso,sex,age,bmi_group15) + p15_intake(ct,iso,sex,age,bmi_group15) ) + sum(ct,i15_kcal_pregnancy(ct,iso)) ; @@ -203,4 +204,4 @@ q15_foodtree_kcal_staples(iso,kfo_st) .. * (1 - v15_demand_regr(iso, "livestockshare")) * (1 - v15_demand_regr(iso, "processedshare")) * (1 - v15_demand_regr(iso, "vegfruitshare")) - * sum(ct,i15_staples_kcal_structure_iso(ct,iso,kfo_st)) ; \ No newline at end of file + * sum(ct,i15_staples_kcal_structure_iso(ct,iso,kfo_st)) ; diff --git a/modules/15_food/anthropometrics_jan18/input.gms b/modules/15_food/anthropometrics_jan18/input.gms index 46eaf6cb88..537fa5db27 100644 --- a/modules/15_food/anthropometrics_jan18/input.gms +++ b/modules/15_food/anthropometrics_jan18/input.gms @@ -1,113 +1,121 @@ -$setglobal c15_food_scenario SSP2 -* options: SSP: "SSP1", "SSP2", "SSP3", "SSP4", "SSP5" -* SRES: "A1", "A2", "B1", "B2" -* OTHER: "SSP1_boundary", "SSP2_boundary", "SSP3_boundary", "SSP4_boundary", "SSP5_boundary" - -$setglobal c15_calibscen constant -* options: constant, fadeout2050 - -$setglobal c15_rumscen mixed -* options: constant, halving2050, mixed - -scalar s15_elastic_demand elastic demand switch (1=elastic 0=exogenous) (1) / 1 /; - -scalar s15_calibrate Calibration switch (1=calibrated 2=pure regresssion outcomes) (1) / 1 /; -* only for per-capita calories, not for e.g. calibration of transformation parameters between per-capita calories in dm - -scalar s15_maxiter Scalar defining maximum number of iterations (1) / 5 /; - -scalar s15_convergence Convergence criterion (1) / 0.005 /; - -table f15_household_balanceflow(t_all,i,kall,dm_ge_nr) Balance flow to take account of heterogeneous products and processes (mio. tDM) -$ondelim -$include "./modules/15_food/input/f15_household_balanceflow.cs3" -$offdelim; - -table f15_nutrition_attributes(t_all,kall,nutrition) Nutrition attributes of food items dedicated for fooduse (mio. kcal per tDM | t Protein per tDM) -$ondelim -$include "./modules/15_food/input/f15_nutrition_attributes.cs3" -$offdelim; - - -*** Food Demand Model - - -* Unit for `f15_demand_regr_paras` is -* kcal/capita/day for saturation and intercept, and -* USD05/capita for halfsaturation - -table f15_demand_paras(regr15,food_scen15,par15) Food regression parameters in USD05PPP or dimensionless (X) -$ondelim -$include "./modules/15_food/input/f15_demand_regression_parameters.cs3" -$offdelim; - -table f15_bmi_shr_paras(sex, agegroup15, bmi_tree15, paras_b15) BMI share regression parameters in USD05PPP or dimensionless (X) -$ondelim -$include "./modules/15_food/input/f15_bmi_shr_regr_paras.cs3" -$offdelim; - -table f15_bmi(sex,age,bmi_group15) Mean body mass index for each BMI group (kg per m2) -$ondelim -$include "./modules/15_food/input/f15_bmi.cs3" -$offdelim; - -table f15_bmi_shr_past(t_all,iso,age,sex,bmi_group15) Mean body mass index for each BMI group (kg per m2) -$ondelim -$include "./modules/15_food/input/f15_bmi_shr_past.cs3" -$offdelim; - - -table f15_kcal_pc_iso(t_all,iso,kfo) Observed per capita calories in the past (kcal per cap per day) -$ondelim -$include "./modules/15_food/input/f15_kcal_pc_iso.csv" -$offdelim; - - -table f15_intake_pc_observed_iso(t_all,iso,sex,age) Observed per capita calorie intake in the past (kcal per captia per day) -$ondelim -$include "./modules/15_food/input/f15_intake_pc_observed_iso.cs3" -$offdelim; - - -parameter f15_prices_initial(kall) Food prices in initialization period (USD05MER per t DM) -/ -$ondelim -$include "./modules/15_food/input/f15_prices_initial.csv" -$offdelim -/; - - -parameter f15_price_index(t_all) Food price index in initialization period (USD05MER per t DM) -/ -$ondelim -$include "./modules/15_food/input/f15_prices_index.csv" -$offdelim -/; - - -table f15_kcal_calib_fadeout(t_all,calibscen15) Calibration fadeout factor (1) -$ondelim -$include "./modules/15_food/input/f15_kcal_balanceflow_fadeout.csv" -$offdelim -; - -table f15_ruminant_fadeout(t_all,ruminantfadeoutscen15) Ruminant fadeout scenario (1) -$ondelim -$include "./modules/15_food/input/f15_ruminant_fadeout.csv" -$offdelim -; - -table f15_bodyheight(t_all,iso,sex,age) Body height (cm per cap) -$ondelim -$include "./modules/15_food/input/f15_bodyheight_historical.cs3" -$offdelim; - -table f15_schofield(sex,age, paras_s15) Schofield equation parameters in kcal per capita per day or kcal per capita per day per weight (X) -$ondelim -$include "./modules/15_food/input/f15_schofield_parameters.cs3" -$offdelim -; - - - -*** EOF input.gms *** +*** | (C) 2008-2019 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 + + +$setglobal c15_food_scenario SSP2 +* options: SSP: "SSP1", "SSP2", "SSP3", "SSP4", "SSP5" +* SRES: "A1", "A2", "B1", "B2" +* OTHER: "SSP1_boundary", "SSP2_boundary", "SSP3_boundary", "SSP4_boundary", "SSP5_boundary" + +$setglobal c15_calibscen constant +* options: constant, fadeout2050 + +$setglobal c15_rumscen mixed +* options: constant, halving2050, mixed + +scalar s15_elastic_demand Elastic demand switch (1=elastic 0=exogenous) (1) / 1 /; + +scalar s15_calibrate Calibration switch (1=calibrated 0=pure regression outcomes) (1) / 1 /; +* only for per-capita calories, not for e.g. calibration of transformation parameters between per-capita calories in dm + +scalar s15_maxiter Scalar defining maximum number of iterations (1) / 5 /; + +scalar s15_convergence Convergence criterion (1) / 0.005 /; + +table f15_household_balanceflow(t_all,i,kall,dm_ge_nr) Balance flow to take account of heterogeneous products and processes (mio. tDM) +$ondelim +$include "./modules/15_food/input/f15_household_balanceflow.cs3" +$offdelim; + +table f15_nutrition_attributes(t_all,kall,nutrition) Nutrition attributes of food items dedicated for fooduse (mio. kcal per tDM | t Protein per tDM) +$ondelim +$include "./modules/15_food/input/f15_nutrition_attributes.cs3" +$offdelim; + + +*** Food Demand Model + + +* Unit for `f15_demand_paras` is +* kcal/capita/day for saturation and intercept, and +* USD05/capita for halfsaturation + +table f15_demand_paras(regr15,food_scen15,par15) Food regression parameters in USD05PPP or dimensionless (X) +$ondelim +$include "./modules/15_food/input/f15_demand_regression_parameters.cs3" +$offdelim; + +table f15_bmi_shr_paras(sex, agegroup15, bmi_tree15, paras_b15) BMI share regression parameters in USD05PPP or dimensionless (X) +$ondelim +$include "./modules/15_food/input/f15_bmi_shr_regr_paras.cs3" +$offdelim; + +table f15_bmi(sex,age,bmi_group15) Mean body mass index for each BMI group (kg per m2) +$ondelim +$include "./modules/15_food/input/f15_bmi.cs3" +$offdelim; + +table f15_bmi_shr_past(t_all,iso,age,sex,bmi_group15) Observed share of population belonging to a BMI group in the past (1) +$ondelim +$include "./modules/15_food/input/f15_bmi_shr_past.cs3" +$offdelim; + + +table f15_kcal_pc_iso(t_all,iso,kfo) Observed per capita food supply in the past (kcal per cap per day) +$ondelim +$include "./modules/15_food/input/f15_kcal_pc_iso.csv" +$offdelim; + + +table f15_intake_pc_observed_iso(t_all,iso,sex,age) Observed per capita food intake in the past (kcal per captia per day) +$ondelim +$include "./modules/15_food/input/f15_intake_pc_observed_iso.cs3" +$offdelim; + + +parameter f15_prices_initial(kall) Food prices in initialization period (USD05MER per t DM) +/ +$ondelim +$include "./modules/15_food/input/f15_prices_initial.csv" +$offdelim +/; + + +parameter f15_price_index(t_all) Food price index in initialization period (1) +/ +$ondelim +$include "./modules/15_food/input/f15_prices_index.csv" +$offdelim +/; + + +table f15_kcal_calib_fadeout(t_all,calibscen15) Calibration fadeout factor (1) +$ondelim +$include "./modules/15_food/input/f15_kcal_balanceflow_fadeout.csv" +$offdelim +; + +table f15_ruminant_fadeout(t_all,ruminantfadeoutscen15) Ruminant fadeout scenario (1) +$ondelim +$include "./modules/15_food/input/f15_ruminant_fadeout.csv" +$offdelim +; + +table f15_bodyheight(t_all,iso,sex,age) Body height (cm per cap) +$ondelim +$include "./modules/15_food/input/f15_bodyheight_historical.cs3" +$offdelim; + +table f15_schofield(sex,age, paras_s15) Schofield equation parameters in kcal per capita per day or kcal per capita per day per weight (X) +$ondelim +$include "./modules/15_food/input/f15_schofield_parameters.cs3" +$offdelim +; + + + +*** EOF input.gms *** diff --git a/modules/15_food/anthropometrics_jan18/intersolve.gms b/modules/15_food/anthropometrics_jan18/intersolve.gms index 1409e22d62..710bf2d886 100644 --- a/modules/15_food/anthropometrics_jan18/intersolve.gms +++ b/modules/15_food/anthropometrics_jan18/intersolve.gms @@ -1,3 +1,10 @@ +*** | (C) 2008-2019 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 + option nlp = conopt4 * retrieving interfaces from MAgPIE @@ -13,7 +20,7 @@ if (magpie.modelstat = NA, q15_food_demand.m(i,kfo)=0; p15_prices_kcal(t,iso,kfo)=i15_prices_initial_kcal(iso,kfo)*f15_price_index(t); else - display "Coupling: Reading out Marginal Costs from MAgPIE as shock to demand model"; + display "Coupling: Reading out marginal costs from MAgPIE as shock to demand model"; p15_prices_kcal(t,iso,kfo)=sum(i_to_iso(i,iso), q15_food_demand.m(i,kfo)); ); @@ -54,19 +61,19 @@ if(( p15_modelstat(t)) > 2 and (p15_modelstat(t) ne 7 ), p15_convergence_measure(t) =smax(i, - abs(p15_delta_income(t,i) / p15_lastiteration_delta_income(i)- 1) + abs(p15_delta_income(t,i) / p15_lastiteration_delta_income(t,i)- 1) ); * keeping current deltas for estimating convergence in next timestep - p15_lastiteration_delta_income(i) = p15_delta_income(t,i); + p15_lastiteration_delta_income(t,i) = p15_delta_income(t,i); *' @code *' If `s15_elastic_demand` is 0, MAgPIE is not executed again for this time step. *' In case that `s15_elastic_demand` is 1, it is checked whether MAgPIE and the *' food demand model have reached sufficient convergence. The criterion for this -*' is whether the real income in the food demand model has changed in any country +*' is whether the real income in the food demand model has changed in any region *' by more than `s15_convergences_measure` relative to the last iteration due to *' changes in food prices from MAgPIE. Moreover, the model aborts when the *' number of iterations reaches `s15_maxiter`. @@ -87,14 +94,13 @@ if (s15_elastic_demand * (1-sum(sameas(t_past,t),1)) =1, sm_intersolve=0; * saving regression outcome for postprocessing - p15_kcal_regr(t, iso, kfo)=v15_kcal_regr.l(iso, kfo); + p15_bmi_shr_regr(t,iso,sex,age,bmi_group15)=v15_bmi_shr_regr.l(iso,sex,age,bmi_group15); -* estimating calibrated values for height regression -* add balanceflow for calibration +* The calibration factor is added to the regression value. p15_kcal_pc_iso(t,iso,kfo) = v15_kcal_regr.l(iso,kfo) + p15_kcal_calib(t,iso,kfo) * s15_calibrate; -* set negative values that can occur due to calibration to zero +* Negative values that can possibly occur due to calibration are set to zero. p15_kcal_pc_iso(t,iso,kfo)$(p15_kcal_pc_iso(t,iso,kfo)<0) = 0; * aggregate to regions @@ -109,9 +115,9 @@ if (s15_elastic_demand * (1-sum(sameas(t_past,t),1)) =1, im_pop_iso(t,iso) ); -* we calibrate countries with zero food demand according to FAOSTAT -* down to zero to match FAO values- -* Values are rounded to avoid path dependencies of MAgPIE solver +* We calibrate countries with zero food demand according to FAOSTAT +* down to zero to match FAO world totals. +* Values are rounded to avoid path dependencies of MAgPIE solver. p15_kcal_pc_calibrated(t,i,kfo)=p15_kcal_pc(t,i,kfo)+p15_balanceflow_kcal(t,i,kfo); p15_kcal_pc_calibrated(t,i,kfo)=round(p15_kcal_pc_calibrated(t,i,kfo),2); p15_kcal_pc_calibrated(t,i,kfo)$(p15_kcal_pc_calibrated(t,i,kfo)<0)=0; @@ -134,109 +140,3 @@ else display "exogenous demand information is used" ; ); - -*' The calibration parameter is added to the regression value - - p15_bmi_shr(t,iso,sex,age,bmi_group15) = - v15_bmi_shr_regr.l(iso,sex,age,bmi_group15)+ - i15_bmi_shr_calib(t,iso,sex,age,bmi_group15); - -*' The BMI shares are not allowed to exceed the bounds 0 and 1. Values are corrected to the bounds. - p15_bmi_shr(t,iso,sex,age,bmi_group15)$(p15_bmi_shr(t,iso,sex,age,bmi_group15)<0) = 0; - p15_bmi_shr(t,iso,sex,age,bmi_group15)$(p15_bmi_shr(t,iso,sex,age,bmi_group15)>1) = 1; -*' The mismatch is balanced by moving the exceeding quantities into the middle BMI group. - p15_bmi_shr(t,iso,sex,age,"medium")= - 1 - (sum(bmi_group15, p15_bmi_shr(t,iso,sex,age,bmi_group15)) - p15_bmi_shr(t,iso,sex,age,"medium")); - -*' We recalculate the intake with the new values - p15_kcal_intake_total(t,iso) = - ( - sum((sex, age, bmi_group15), - p15_bmi_shr(t,iso,sex,age,bmi_group15)* - im_demography(t,iso,sex,age) * - i15_intake(t,iso,sex,age,bmi_group15) - ) + i15_kcal_pregnancy(t,iso) - )/sum((sex,age), im_demography(t,iso,sex,age)); - - - -if(ord(t)>1, -* start from bodyheight structure of last period - p15_bodyheight(t,iso,sex,age,"final") = p15_bodyheight(t-1,iso,sex,age,"final"); - p15_kcal_growth_food(t,iso,underaged15) = p15_kcal_growth_food(t-1,iso,underaged15); -); - -s15_count=m_yeardiff(t); -if(s15_count<5,s15_count=5); - -For (s15_count = 1 to (m_yeardiff(t)/5), - -* circular move of age by 5 years -* to find out about ++1 search for help on Circular Lag and Lead Operators in Assignments - p15_bodyheight(t,iso,sex,age++1,"final") = p15_bodyheight(t,iso,sex,age,"final"); - -* move on consumption agegroups by 5 years - p15_kcal_growth_food(t,iso,underaged15++1)= - p15_kcal_growth_food(t,iso,underaged15); - -* consumption is calculated as linear interpolation between timesteps - p15_kcal_growth_food(t,iso,"0--4") = - sum(growth_food15, - p15_kcal_pc_iso(t,iso,growth_food15) * (s15_count / (m_yeardiff(t)/5)) - + p15_kcal_pc_iso(t-1,iso,growth_food15) * (1 - s15_count / (m_yeardiff(t)/5)) - ); -*' @code -*' After each execution of the food demand model, the body height distribution -*' of the population is estimated. The starting point is the body height -*' distribution of the last timestep. The body height estimates of the old -*' period are moved into the subsequent age class (e.g. the 20-24 year old are -*' now 25-29 years old). The age class of 15-19 year olds is estimated newly -*' using the body height regressions and the food consumption of the last 15 -*' years. - - p15_bodyheight(t,iso,"F","15--19","final") = - 126.4* - (sum(underaged15, - p15_kcal_growth_food(t,iso,underaged15) - )/3)**0.03464 - ; - p15_bodyheight(t,iso,"M","15--19","final") = - 131.8* - (sum(underaged15, - p15_kcal_growth_food(t,iso,underaged15) - )/3)**0.03975 - ; -*' @stop -); - -*' @code -*' The bodyheight of the underaged age class (0-14) is assumed to diverge from 'normal' -*' body height by the same proportion as age class of the 15-19 year olds. -*' This rotation is repeated for the 5-year length of the time step, it is repeated -*' 3 times. - -p15_bodyheight(t,iso,"M","0--4","final")=p15_bodyheight(t,iso,"M","15--19","final")/176*92; -p15_bodyheight(t,iso,"M","5--9","final")=p15_bodyheight(t,iso,"M","15--19","final")/176*125; -p15_bodyheight(t,iso,"M","10--14","final")=p15_bodyheight(t,iso,"M","15--19","final")/176*152; - -p15_bodyheight(t,iso,"F","0--4","final")=p15_bodyheight(t,iso,"M","15--19","final")/163*91; -p15_bodyheight(t,iso,"F","5--9","final")=p15_bodyheight(t,iso,"M","15--19","final")/163*124; -p15_bodyheight(t,iso,"F","10--14","final")=p15_bodyheight(t,iso,"M","15--19","final")/163*154; - -*' @stop - -*' @code -*' Finally, the regression outcome is calibrated by a country-specific additive -*' term, which is the residual of the regression fit and observation of the last -*' historical time step - -if (sum(sameas(t_past,t),1) = 1, -* for historical period only use estimate to calibrate balanceflow but use historical data for values - p15_bodyheight_calib(t,iso,sex,age_new_estimated15) = f15_bodyheight(t,iso,sex,age_new_estimated15) - p15_bodyheight(t,iso,sex,age_new_estimated15,"final"); - p15_bodyheight(t,iso,sex,age_new_estimated15,"final") = f15_bodyheight(t,iso,sex,age_new_estimated15); -else - p15_bodyheight_calib(t,iso,sex,age_new_estimated15)=p15_bodyheight_calib(t-1,iso,sex,age_new_estimated15); - p15_bodyheight(t,iso,sex,age_new_estimated15,"final")=p15_bodyheight(t,iso,sex,age_new_estimated15,"final")+p15_bodyheight_calib(t,iso,sex,age_new_estimated15)*s15_calibrate; -); - -*' @stop \ No newline at end of file diff --git a/modules/15_food/anthropometrics_jan18/nl_fix.gms b/modules/15_food/anthropometrics_jan18/nl_fix.gms deleted file mode 100644 index 8b13789179..0000000000 --- a/modules/15_food/anthropometrics_jan18/nl_fix.gms +++ /dev/null @@ -1 +0,0 @@ - diff --git a/modules/15_food/anthropometrics_jan18/nl_relax.gms b/modules/15_food/anthropometrics_jan18/nl_relax.gms deleted file mode 100644 index 8b13789179..0000000000 --- a/modules/15_food/anthropometrics_jan18/nl_relax.gms +++ /dev/null @@ -1 +0,0 @@ - diff --git a/modules/15_food/anthropometrics_jan18/nl_release.gms b/modules/15_food/anthropometrics_jan18/nl_release.gms deleted file mode 100644 index 8b13789179..0000000000 --- a/modules/15_food/anthropometrics_jan18/nl_release.gms +++ /dev/null @@ -1 +0,0 @@ - diff --git a/modules/15_food/anthropometrics_jan18/postsolve.gms b/modules/15_food/anthropometrics_jan18/postsolve.gms index 7fdd53c09f..6f5d2d0560 100644 --- a/modules/15_food/anthropometrics_jan18/postsolve.gms +++ b/modules/15_food/anthropometrics_jan18/postsolve.gms @@ -1,119 +1,234 @@ - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_dem_food(t,i,kall,"marginal") = vm_dem_food.m(i,kall); - ov15_kcal_regr(t,iso,kfo,"marginal") = v15_kcal_regr.m(iso,kfo); - ov15_kcal_regr_total(t,iso,"marginal") = v15_kcal_regr_total.m(iso); - ov15_demand_regr(t,iso,regr15,"marginal") = v15_demand_regr.m(iso,regr15); - ov15_income_pc_real_ppp_iso(t,iso,"marginal") = v15_income_pc_real_ppp_iso.m(iso); - ov15_income_balance(t,iso,"marginal") = v15_income_balance.m(iso); - ov15_kcal_intake_total_regr(t,iso,"marginal") = v15_kcal_intake_total_regr.m(iso); - ov15_regr_overgroups(t,iso,sex,agegroup15,bmi_tree15,"marginal") = v15_regr_overgroups.m(iso,sex,agegroup15,bmi_tree15); - ov15_bmi_shr_regr(t,iso,sex,age,bmi_group15,"marginal") = v15_bmi_shr_regr.m(iso,sex,age,bmi_group15); - ov15_bmi_shr_overgroups(t,iso,sex,agegroup15,bmi_group15,"marginal") = v15_bmi_shr_overgroups.m(iso,sex,agegroup15,bmi_group15); - ov15_objective(t,"marginal") = v15_objective.m; - oq15_food_demand(t,i,kfo,"marginal") = q15_food_demand.m(i,kfo); - oq15_aim(t,"marginal") = q15_aim.m; - oq15_budget(t,iso,"marginal") = q15_budget.m(iso); - oq15_regr_bmi_shr(t,iso,sex,agegroup15,bmi_tree15,"marginal") = q15_regr_bmi_shr.m(iso,sex,agegroup15,bmi_tree15); - oq15_bmi_shr_verylow(t,iso,sex,agegroup15,"marginal") = q15_bmi_shr_verylow.m(iso,sex,agegroup15); - oq15_bmi_shr_low(t,iso,sex,agegroup15,"marginal") = q15_bmi_shr_low.m(iso,sex,agegroup15); - oq15_bmi_shr_medium(t,iso,sex,agegroup15,"marginal") = q15_bmi_shr_medium.m(iso,sex,agegroup15); - oq15_bmi_shr_medium_high(t,iso,sex,agegroup15,"marginal") = q15_bmi_shr_medium_high.m(iso,sex,agegroup15); - oq15_bmi_shr_high(t,iso,sex,agegroup15,"marginal") = q15_bmi_shr_high.m(iso,sex,agegroup15); - oq15_bmi_shr_veryhigh(t,iso,sex,agegroup15,"marginal") = q15_bmi_shr_veryhigh.m(iso,sex,agegroup15); - oq15_bmi_shr_agg(t,iso,sex,age,bmi_group15,"marginal") = q15_bmi_shr_agg.m(iso,sex,age,bmi_group15); - oq15_intake(t,iso,"marginal") = q15_intake.m(iso); - oq15_regr_kcal(t,iso,"marginal") = q15_regr_kcal.m(iso); - oq15_regr(t,iso,regr15,"marginal") = q15_regr.m(iso,regr15); - oq15_foodtree_kcal_animals(t,iso,kfo_ap,"marginal") = q15_foodtree_kcal_animals.m(iso,kfo_ap); - oq15_foodtree_kcal_processed(t,iso,kfo_pf,"marginal") = q15_foodtree_kcal_processed.m(iso,kfo_pf); - oq15_foodtree_kcal_staples(t,iso,kfo_st,"marginal") = q15_foodtree_kcal_staples.m(iso,kfo_st); - oq15_foodtree_kcal_vegetables(t,iso,"marginal") = q15_foodtree_kcal_vegetables.m(iso); - ov_dem_food(t,i,kall,"level") = vm_dem_food.l(i,kall); - ov15_kcal_regr(t,iso,kfo,"level") = v15_kcal_regr.l(iso,kfo); - ov15_kcal_regr_total(t,iso,"level") = v15_kcal_regr_total.l(iso); - ov15_demand_regr(t,iso,regr15,"level") = v15_demand_regr.l(iso,regr15); - ov15_income_pc_real_ppp_iso(t,iso,"level") = v15_income_pc_real_ppp_iso.l(iso); - ov15_income_balance(t,iso,"level") = v15_income_balance.l(iso); - ov15_kcal_intake_total_regr(t,iso,"level") = v15_kcal_intake_total_regr.l(iso); - ov15_regr_overgroups(t,iso,sex,agegroup15,bmi_tree15,"level") = v15_regr_overgroups.l(iso,sex,agegroup15,bmi_tree15); - ov15_bmi_shr_regr(t,iso,sex,age,bmi_group15,"level") = v15_bmi_shr_regr.l(iso,sex,age,bmi_group15); - ov15_bmi_shr_overgroups(t,iso,sex,agegroup15,bmi_group15,"level") = v15_bmi_shr_overgroups.l(iso,sex,agegroup15,bmi_group15); - ov15_objective(t,"level") = v15_objective.l; - oq15_food_demand(t,i,kfo,"level") = q15_food_demand.l(i,kfo); - oq15_aim(t,"level") = q15_aim.l; - oq15_budget(t,iso,"level") = q15_budget.l(iso); - oq15_regr_bmi_shr(t,iso,sex,agegroup15,bmi_tree15,"level") = q15_regr_bmi_shr.l(iso,sex,agegroup15,bmi_tree15); - oq15_bmi_shr_verylow(t,iso,sex,agegroup15,"level") = q15_bmi_shr_verylow.l(iso,sex,agegroup15); - oq15_bmi_shr_low(t,iso,sex,agegroup15,"level") = q15_bmi_shr_low.l(iso,sex,agegroup15); - oq15_bmi_shr_medium(t,iso,sex,agegroup15,"level") = q15_bmi_shr_medium.l(iso,sex,agegroup15); - oq15_bmi_shr_medium_high(t,iso,sex,agegroup15,"level") = q15_bmi_shr_medium_high.l(iso,sex,agegroup15); - oq15_bmi_shr_high(t,iso,sex,agegroup15,"level") = q15_bmi_shr_high.l(iso,sex,agegroup15); - oq15_bmi_shr_veryhigh(t,iso,sex,agegroup15,"level") = q15_bmi_shr_veryhigh.l(iso,sex,agegroup15); - oq15_bmi_shr_agg(t,iso,sex,age,bmi_group15,"level") = q15_bmi_shr_agg.l(iso,sex,age,bmi_group15); - oq15_intake(t,iso,"level") = q15_intake.l(iso); - oq15_regr_kcal(t,iso,"level") = q15_regr_kcal.l(iso); - oq15_regr(t,iso,regr15,"level") = q15_regr.l(iso,regr15); - oq15_foodtree_kcal_animals(t,iso,kfo_ap,"level") = q15_foodtree_kcal_animals.l(iso,kfo_ap); - oq15_foodtree_kcal_processed(t,iso,kfo_pf,"level") = q15_foodtree_kcal_processed.l(iso,kfo_pf); - oq15_foodtree_kcal_staples(t,iso,kfo_st,"level") = q15_foodtree_kcal_staples.l(iso,kfo_st); - oq15_foodtree_kcal_vegetables(t,iso,"level") = q15_foodtree_kcal_vegetables.l(iso); - ov_dem_food(t,i,kall,"upper") = vm_dem_food.up(i,kall); - ov15_kcal_regr(t,iso,kfo,"upper") = v15_kcal_regr.up(iso,kfo); - ov15_kcal_regr_total(t,iso,"upper") = v15_kcal_regr_total.up(iso); - ov15_demand_regr(t,iso,regr15,"upper") = v15_demand_regr.up(iso,regr15); - ov15_income_pc_real_ppp_iso(t,iso,"upper") = v15_income_pc_real_ppp_iso.up(iso); - ov15_income_balance(t,iso,"upper") = v15_income_balance.up(iso); - ov15_kcal_intake_total_regr(t,iso,"upper") = v15_kcal_intake_total_regr.up(iso); - ov15_regr_overgroups(t,iso,sex,agegroup15,bmi_tree15,"upper") = v15_regr_overgroups.up(iso,sex,agegroup15,bmi_tree15); - ov15_bmi_shr_regr(t,iso,sex,age,bmi_group15,"upper") = v15_bmi_shr_regr.up(iso,sex,age,bmi_group15); - ov15_bmi_shr_overgroups(t,iso,sex,agegroup15,bmi_group15,"upper") = v15_bmi_shr_overgroups.up(iso,sex,agegroup15,bmi_group15); - ov15_objective(t,"upper") = v15_objective.up; - oq15_food_demand(t,i,kfo,"upper") = q15_food_demand.up(i,kfo); - oq15_aim(t,"upper") = q15_aim.up; - oq15_budget(t,iso,"upper") = q15_budget.up(iso); - oq15_regr_bmi_shr(t,iso,sex,agegroup15,bmi_tree15,"upper") = q15_regr_bmi_shr.up(iso,sex,agegroup15,bmi_tree15); - oq15_bmi_shr_verylow(t,iso,sex,agegroup15,"upper") = q15_bmi_shr_verylow.up(iso,sex,agegroup15); - oq15_bmi_shr_low(t,iso,sex,agegroup15,"upper") = q15_bmi_shr_low.up(iso,sex,agegroup15); - oq15_bmi_shr_medium(t,iso,sex,agegroup15,"upper") = q15_bmi_shr_medium.up(iso,sex,agegroup15); - oq15_bmi_shr_medium_high(t,iso,sex,agegroup15,"upper") = q15_bmi_shr_medium_high.up(iso,sex,agegroup15); - oq15_bmi_shr_high(t,iso,sex,agegroup15,"upper") = q15_bmi_shr_high.up(iso,sex,agegroup15); - oq15_bmi_shr_veryhigh(t,iso,sex,agegroup15,"upper") = q15_bmi_shr_veryhigh.up(iso,sex,agegroup15); - oq15_bmi_shr_agg(t,iso,sex,age,bmi_group15,"upper") = q15_bmi_shr_agg.up(iso,sex,age,bmi_group15); - oq15_intake(t,iso,"upper") = q15_intake.up(iso); - oq15_regr_kcal(t,iso,"upper") = q15_regr_kcal.up(iso); - oq15_regr(t,iso,regr15,"upper") = q15_regr.up(iso,regr15); - oq15_foodtree_kcal_animals(t,iso,kfo_ap,"upper") = q15_foodtree_kcal_animals.up(iso,kfo_ap); - oq15_foodtree_kcal_processed(t,iso,kfo_pf,"upper") = q15_foodtree_kcal_processed.up(iso,kfo_pf); - oq15_foodtree_kcal_staples(t,iso,kfo_st,"upper") = q15_foodtree_kcal_staples.up(iso,kfo_st); - oq15_foodtree_kcal_vegetables(t,iso,"upper") = q15_foodtree_kcal_vegetables.up(iso); - ov_dem_food(t,i,kall,"lower") = vm_dem_food.lo(i,kall); - ov15_kcal_regr(t,iso,kfo,"lower") = v15_kcal_regr.lo(iso,kfo); - ov15_kcal_regr_total(t,iso,"lower") = v15_kcal_regr_total.lo(iso); - ov15_demand_regr(t,iso,regr15,"lower") = v15_demand_regr.lo(iso,regr15); - ov15_income_pc_real_ppp_iso(t,iso,"lower") = v15_income_pc_real_ppp_iso.lo(iso); - ov15_income_balance(t,iso,"lower") = v15_income_balance.lo(iso); - ov15_kcal_intake_total_regr(t,iso,"lower") = v15_kcal_intake_total_regr.lo(iso); - ov15_regr_overgroups(t,iso,sex,agegroup15,bmi_tree15,"lower") = v15_regr_overgroups.lo(iso,sex,agegroup15,bmi_tree15); - ov15_bmi_shr_regr(t,iso,sex,age,bmi_group15,"lower") = v15_bmi_shr_regr.lo(iso,sex,age,bmi_group15); - ov15_bmi_shr_overgroups(t,iso,sex,agegroup15,bmi_group15,"lower") = v15_bmi_shr_overgroups.lo(iso,sex,agegroup15,bmi_group15); - ov15_objective(t,"lower") = v15_objective.lo; - oq15_food_demand(t,i,kfo,"lower") = q15_food_demand.lo(i,kfo); - oq15_aim(t,"lower") = q15_aim.lo; - oq15_budget(t,iso,"lower") = q15_budget.lo(iso); - oq15_regr_bmi_shr(t,iso,sex,agegroup15,bmi_tree15,"lower") = q15_regr_bmi_shr.lo(iso,sex,agegroup15,bmi_tree15); - oq15_bmi_shr_verylow(t,iso,sex,agegroup15,"lower") = q15_bmi_shr_verylow.lo(iso,sex,agegroup15); - oq15_bmi_shr_low(t,iso,sex,agegroup15,"lower") = q15_bmi_shr_low.lo(iso,sex,agegroup15); - oq15_bmi_shr_medium(t,iso,sex,agegroup15,"lower") = q15_bmi_shr_medium.lo(iso,sex,agegroup15); - oq15_bmi_shr_medium_high(t,iso,sex,agegroup15,"lower") = q15_bmi_shr_medium_high.lo(iso,sex,agegroup15); - oq15_bmi_shr_high(t,iso,sex,agegroup15,"lower") = q15_bmi_shr_high.lo(iso,sex,agegroup15); - oq15_bmi_shr_veryhigh(t,iso,sex,agegroup15,"lower") = q15_bmi_shr_veryhigh.lo(iso,sex,agegroup15); - oq15_bmi_shr_agg(t,iso,sex,age,bmi_group15,"lower") = q15_bmi_shr_agg.lo(iso,sex,age,bmi_group15); - oq15_intake(t,iso,"lower") = q15_intake.lo(iso); - oq15_regr_kcal(t,iso,"lower") = q15_regr_kcal.lo(iso); - oq15_regr(t,iso,regr15,"lower") = q15_regr.lo(iso,regr15); - oq15_foodtree_kcal_animals(t,iso,kfo_ap,"lower") = q15_foodtree_kcal_animals.lo(iso,kfo_ap); - oq15_foodtree_kcal_processed(t,iso,kfo_pf,"lower") = q15_foodtree_kcal_processed.lo(iso,kfo_pf); - oq15_foodtree_kcal_staples(t,iso,kfo_st,"lower") = q15_foodtree_kcal_staples.lo(iso,kfo_st); - oq15_foodtree_kcal_vegetables(t,iso,"lower") = q15_foodtree_kcal_vegetables.lo(iso); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 + + +*' The calibration parameter is added to the regression value. + + o15_bmi_shr(t,iso,sex,age,bmi_group15) = + p15_bmi_shr_regr(t,iso,sex,age,bmi_group15)+ + i15_bmi_shr_calib(t,iso,sex,age,bmi_group15); + +*' The BMI shares are not allowed to exceed the bounds 0 and 1. Values are corrected to the bounds. + o15_bmi_shr(t,iso,sex,age,bmi_group15)$(o15_bmi_shr(t,iso,sex,age,bmi_group15)<0) = 0; + o15_bmi_shr(t,iso,sex,age,bmi_group15)$(o15_bmi_shr(t,iso,sex,age,bmi_group15)>1) = 1; +*' The mismatch is balanced by moving the exceeding quantities into the middle BMI group. + o15_bmi_shr(t,iso,sex,age,"medium")= + 1 - (sum(bmi_group15, o15_bmi_shr(t,iso,sex,age,bmi_group15)) - o15_bmi_shr(t,iso,sex,age,"medium")); + +*' We recalculate the intake with the new values. + o15_kcal_intake_total(t,iso) = + ( + sum((sex, age, bmi_group15), + o15_bmi_shr(t,iso,sex,age,bmi_group15)* + im_demography(t,iso,sex,age) * + p15_intake(t,iso,sex,age,bmi_group15) + ) + i15_kcal_pregnancy(t,iso) + )/sum((sex,age), im_demography(t,iso,sex,age)); + + + +if(ord(t)>1, +* start from bodyheight structure of last period + p15_bodyheight(t,iso,sex,age,"final") = p15_bodyheight(t-1,iso,sex,age,"final"); + p15_kcal_growth_food(t,iso,underaged15) = p15_kcal_growth_food(t-1,iso,underaged15); +); + +s15_yeardiff = m_yeardiff(t)/5; +if(s15_yeardiff<1,s15_yeardiff=1); + +For (s15_count = 1 to s15_yeardiff, + +* circular move of age by 5 years +* to find out about ++1 search for help on Circular Lag and Lead Operators in Assignments + p15_bodyheight(t,iso,sex,age++1,"final") = p15_bodyheight(t,iso,sex,age,"final"); + +* move on consumption agegroups by 5 years + p15_kcal_growth_food(t,iso,underaged15++1)= + p15_kcal_growth_food(t,iso,underaged15); + +* consumption is calculated as linear interpolation between timesteps + p15_kcal_growth_food(t,iso,"0--4") = + sum(growth_food15, + p15_kcal_pc_iso(t,iso,growth_food15) * (s15_count / (m_yeardiff(t)/5)) + + p15_kcal_pc_iso(t-1,iso,growth_food15) * (1 - s15_count / (m_yeardiff(t)/5)) + ); + +*' @code +*' After each execution of the food demand model, the body height distribution +*' of the population is estimated. The starting point is the body height +*' distribution of the last timestep. The body height estimates of the old +*' period are moved into the subsequent age class (e.g. the 20-24 year old are +*' now 25-29 years old). The age class of 15-19 year old is estimated newly +*' using the body height regressions and the food consumption of the last 15 +*' years. + + p15_bodyheight(t,iso,"F","15--19","final") = + 126.4* + (sum(underaged15, + p15_kcal_growth_food(t,iso,underaged15) + )/3)**0.03467 + ; + p15_bodyheight(t,iso,"M","15--19","final") = + 131.8* + (sum(underaged15, + p15_kcal_growth_food(t,iso,underaged15) + )/3)**0.03978 + ; +*' @stop +); + +*' @code +*' The bodyheight of the underaged age class (0-14) is assumed to diverge from 'normal' +*' body height by the same proportion as the age class of the 15-19 year old. + +p15_bodyheight(t,iso,"M","0--4","final")=p15_bodyheight(t,iso,"M","15--19","final")/176*92; +p15_bodyheight(t,iso,"M","5--9","final")=p15_bodyheight(t,iso,"M","15--19","final")/176*125; +p15_bodyheight(t,iso,"M","10--14","final")=p15_bodyheight(t,iso,"M","15--19","final")/176*152; + +p15_bodyheight(t,iso,"F","0--4","final")=p15_bodyheight(t,iso,"M","15--19","final")/163*91; +p15_bodyheight(t,iso,"F","5--9","final")=p15_bodyheight(t,iso,"M","15--19","final")/163*124; +p15_bodyheight(t,iso,"F","10--14","final")=p15_bodyheight(t,iso,"M","15--19","final")/163*154; + +*' @stop + +*' @code +*' Finally, the regression outcome is calibrated by a country-specific additive +*' term, which is the residual of the regression fit and observation of the last +*' historical time step. + +if (sum(sameas(t_past,t),1) = 1, +* For historical period, the regression results are only used to estimate the calibration parameter. + p15_bodyheight_calib(t,iso,sex,age_new_estimated15) = f15_bodyheight(t,iso,sex,age_new_estimated15) - p15_bodyheight(t,iso,sex,age_new_estimated15,"final"); + p15_bodyheight(t,iso,sex,age_new_estimated15,"final") = f15_bodyheight(t,iso,sex,age_new_estimated15); +else + p15_bodyheight_calib(t,iso,sex,age_new_estimated15)=p15_bodyheight_calib(t-1,iso,sex,age_new_estimated15); + p15_bodyheight(t,iso,sex,age_new_estimated15,"final")=p15_bodyheight(t,iso,sex,age_new_estimated15,"final")+p15_bodyheight_calib(t,iso,sex,age_new_estimated15)*s15_calibrate; +); + +*' @stop + + + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_dem_food(t,i,kall,"marginal") = vm_dem_food.m(i,kall); + ov15_kcal_regr(t,iso,kfo,"marginal") = v15_kcal_regr.m(iso,kfo); + ov15_kcal_regr_total(t,iso,"marginal") = v15_kcal_regr_total.m(iso); + ov15_demand_regr(t,iso,regr15,"marginal") = v15_demand_regr.m(iso,regr15); + ov15_income_pc_real_ppp_iso(t,iso,"marginal") = v15_income_pc_real_ppp_iso.m(iso); + ov15_income_balance(t,iso,"marginal") = v15_income_balance.m(iso); + ov15_kcal_intake_total_regr(t,iso,"marginal") = v15_kcal_intake_total_regr.m(iso); + ov15_regr_overgroups(t,iso,sex,agegroup15,bmi_tree15,"marginal") = v15_regr_overgroups.m(iso,sex,agegroup15,bmi_tree15); + ov15_bmi_shr_regr(t,iso,sex,age,bmi_group15,"marginal") = v15_bmi_shr_regr.m(iso,sex,age,bmi_group15); + ov15_bmi_shr_overgroups(t,iso,sex,agegroup15,bmi_group15,"marginal") = v15_bmi_shr_overgroups.m(iso,sex,agegroup15,bmi_group15); + ov15_objective(t,"marginal") = v15_objective.m; + oq15_food_demand(t,i,kfo,"marginal") = q15_food_demand.m(i,kfo); + oq15_aim(t,"marginal") = q15_aim.m; + oq15_budget(t,iso,"marginal") = q15_budget.m(iso); + oq15_regr_bmi_shr(t,iso,sex,agegroup15,bmi_tree15,"marginal") = q15_regr_bmi_shr.m(iso,sex,agegroup15,bmi_tree15); + oq15_bmi_shr_verylow(t,iso,sex,agegroup15,"marginal") = q15_bmi_shr_verylow.m(iso,sex,agegroup15); + oq15_bmi_shr_low(t,iso,sex,agegroup15,"marginal") = q15_bmi_shr_low.m(iso,sex,agegroup15); + oq15_bmi_shr_medium(t,iso,sex,agegroup15,"marginal") = q15_bmi_shr_medium.m(iso,sex,agegroup15); + oq15_bmi_shr_medium_high(t,iso,sex,agegroup15,"marginal") = q15_bmi_shr_medium_high.m(iso,sex,agegroup15); + oq15_bmi_shr_high(t,iso,sex,agegroup15,"marginal") = q15_bmi_shr_high.m(iso,sex,agegroup15); + oq15_bmi_shr_veryhigh(t,iso,sex,agegroup15,"marginal") = q15_bmi_shr_veryhigh.m(iso,sex,agegroup15); + oq15_bmi_shr_agg(t,iso,sex,age,bmi_group15,"marginal") = q15_bmi_shr_agg.m(iso,sex,age,bmi_group15); + oq15_intake(t,iso,"marginal") = q15_intake.m(iso); + oq15_regr_kcal(t,iso,"marginal") = q15_regr_kcal.m(iso); + oq15_regr(t,iso,regr15,"marginal") = q15_regr.m(iso,regr15); + oq15_foodtree_kcal_animals(t,iso,kfo_ap,"marginal") = q15_foodtree_kcal_animals.m(iso,kfo_ap); + oq15_foodtree_kcal_processed(t,iso,kfo_pf,"marginal") = q15_foodtree_kcal_processed.m(iso,kfo_pf); + oq15_foodtree_kcal_staples(t,iso,kfo_st,"marginal") = q15_foodtree_kcal_staples.m(iso,kfo_st); + oq15_foodtree_kcal_vegetables(t,iso,"marginal") = q15_foodtree_kcal_vegetables.m(iso); + ov_dem_food(t,i,kall,"level") = vm_dem_food.l(i,kall); + ov15_kcal_regr(t,iso,kfo,"level") = v15_kcal_regr.l(iso,kfo); + ov15_kcal_regr_total(t,iso,"level") = v15_kcal_regr_total.l(iso); + ov15_demand_regr(t,iso,regr15,"level") = v15_demand_regr.l(iso,regr15); + ov15_income_pc_real_ppp_iso(t,iso,"level") = v15_income_pc_real_ppp_iso.l(iso); + ov15_income_balance(t,iso,"level") = v15_income_balance.l(iso); + ov15_kcal_intake_total_regr(t,iso,"level") = v15_kcal_intake_total_regr.l(iso); + ov15_regr_overgroups(t,iso,sex,agegroup15,bmi_tree15,"level") = v15_regr_overgroups.l(iso,sex,agegroup15,bmi_tree15); + ov15_bmi_shr_regr(t,iso,sex,age,bmi_group15,"level") = v15_bmi_shr_regr.l(iso,sex,age,bmi_group15); + ov15_bmi_shr_overgroups(t,iso,sex,agegroup15,bmi_group15,"level") = v15_bmi_shr_overgroups.l(iso,sex,agegroup15,bmi_group15); + ov15_objective(t,"level") = v15_objective.l; + oq15_food_demand(t,i,kfo,"level") = q15_food_demand.l(i,kfo); + oq15_aim(t,"level") = q15_aim.l; + oq15_budget(t,iso,"level") = q15_budget.l(iso); + oq15_regr_bmi_shr(t,iso,sex,agegroup15,bmi_tree15,"level") = q15_regr_bmi_shr.l(iso,sex,agegroup15,bmi_tree15); + oq15_bmi_shr_verylow(t,iso,sex,agegroup15,"level") = q15_bmi_shr_verylow.l(iso,sex,agegroup15); + oq15_bmi_shr_low(t,iso,sex,agegroup15,"level") = q15_bmi_shr_low.l(iso,sex,agegroup15); + oq15_bmi_shr_medium(t,iso,sex,agegroup15,"level") = q15_bmi_shr_medium.l(iso,sex,agegroup15); + oq15_bmi_shr_medium_high(t,iso,sex,agegroup15,"level") = q15_bmi_shr_medium_high.l(iso,sex,agegroup15); + oq15_bmi_shr_high(t,iso,sex,agegroup15,"level") = q15_bmi_shr_high.l(iso,sex,agegroup15); + oq15_bmi_shr_veryhigh(t,iso,sex,agegroup15,"level") = q15_bmi_shr_veryhigh.l(iso,sex,agegroup15); + oq15_bmi_shr_agg(t,iso,sex,age,bmi_group15,"level") = q15_bmi_shr_agg.l(iso,sex,age,bmi_group15); + oq15_intake(t,iso,"level") = q15_intake.l(iso); + oq15_regr_kcal(t,iso,"level") = q15_regr_kcal.l(iso); + oq15_regr(t,iso,regr15,"level") = q15_regr.l(iso,regr15); + oq15_foodtree_kcal_animals(t,iso,kfo_ap,"level") = q15_foodtree_kcal_animals.l(iso,kfo_ap); + oq15_foodtree_kcal_processed(t,iso,kfo_pf,"level") = q15_foodtree_kcal_processed.l(iso,kfo_pf); + oq15_foodtree_kcal_staples(t,iso,kfo_st,"level") = q15_foodtree_kcal_staples.l(iso,kfo_st); + oq15_foodtree_kcal_vegetables(t,iso,"level") = q15_foodtree_kcal_vegetables.l(iso); + ov_dem_food(t,i,kall,"upper") = vm_dem_food.up(i,kall); + ov15_kcal_regr(t,iso,kfo,"upper") = v15_kcal_regr.up(iso,kfo); + ov15_kcal_regr_total(t,iso,"upper") = v15_kcal_regr_total.up(iso); + ov15_demand_regr(t,iso,regr15,"upper") = v15_demand_regr.up(iso,regr15); + ov15_income_pc_real_ppp_iso(t,iso,"upper") = v15_income_pc_real_ppp_iso.up(iso); + ov15_income_balance(t,iso,"upper") = v15_income_balance.up(iso); + ov15_kcal_intake_total_regr(t,iso,"upper") = v15_kcal_intake_total_regr.up(iso); + ov15_regr_overgroups(t,iso,sex,agegroup15,bmi_tree15,"upper") = v15_regr_overgroups.up(iso,sex,agegroup15,bmi_tree15); + ov15_bmi_shr_regr(t,iso,sex,age,bmi_group15,"upper") = v15_bmi_shr_regr.up(iso,sex,age,bmi_group15); + ov15_bmi_shr_overgroups(t,iso,sex,agegroup15,bmi_group15,"upper") = v15_bmi_shr_overgroups.up(iso,sex,agegroup15,bmi_group15); + ov15_objective(t,"upper") = v15_objective.up; + oq15_food_demand(t,i,kfo,"upper") = q15_food_demand.up(i,kfo); + oq15_aim(t,"upper") = q15_aim.up; + oq15_budget(t,iso,"upper") = q15_budget.up(iso); + oq15_regr_bmi_shr(t,iso,sex,agegroup15,bmi_tree15,"upper") = q15_regr_bmi_shr.up(iso,sex,agegroup15,bmi_tree15); + oq15_bmi_shr_verylow(t,iso,sex,agegroup15,"upper") = q15_bmi_shr_verylow.up(iso,sex,agegroup15); + oq15_bmi_shr_low(t,iso,sex,agegroup15,"upper") = q15_bmi_shr_low.up(iso,sex,agegroup15); + oq15_bmi_shr_medium(t,iso,sex,agegroup15,"upper") = q15_bmi_shr_medium.up(iso,sex,agegroup15); + oq15_bmi_shr_medium_high(t,iso,sex,agegroup15,"upper") = q15_bmi_shr_medium_high.up(iso,sex,agegroup15); + oq15_bmi_shr_high(t,iso,sex,agegroup15,"upper") = q15_bmi_shr_high.up(iso,sex,agegroup15); + oq15_bmi_shr_veryhigh(t,iso,sex,agegroup15,"upper") = q15_bmi_shr_veryhigh.up(iso,sex,agegroup15); + oq15_bmi_shr_agg(t,iso,sex,age,bmi_group15,"upper") = q15_bmi_shr_agg.up(iso,sex,age,bmi_group15); + oq15_intake(t,iso,"upper") = q15_intake.up(iso); + oq15_regr_kcal(t,iso,"upper") = q15_regr_kcal.up(iso); + oq15_regr(t,iso,regr15,"upper") = q15_regr.up(iso,regr15); + oq15_foodtree_kcal_animals(t,iso,kfo_ap,"upper") = q15_foodtree_kcal_animals.up(iso,kfo_ap); + oq15_foodtree_kcal_processed(t,iso,kfo_pf,"upper") = q15_foodtree_kcal_processed.up(iso,kfo_pf); + oq15_foodtree_kcal_staples(t,iso,kfo_st,"upper") = q15_foodtree_kcal_staples.up(iso,kfo_st); + oq15_foodtree_kcal_vegetables(t,iso,"upper") = q15_foodtree_kcal_vegetables.up(iso); + ov_dem_food(t,i,kall,"lower") = vm_dem_food.lo(i,kall); + ov15_kcal_regr(t,iso,kfo,"lower") = v15_kcal_regr.lo(iso,kfo); + ov15_kcal_regr_total(t,iso,"lower") = v15_kcal_regr_total.lo(iso); + ov15_demand_regr(t,iso,regr15,"lower") = v15_demand_regr.lo(iso,regr15); + ov15_income_pc_real_ppp_iso(t,iso,"lower") = v15_income_pc_real_ppp_iso.lo(iso); + ov15_income_balance(t,iso,"lower") = v15_income_balance.lo(iso); + ov15_kcal_intake_total_regr(t,iso,"lower") = v15_kcal_intake_total_regr.lo(iso); + ov15_regr_overgroups(t,iso,sex,agegroup15,bmi_tree15,"lower") = v15_regr_overgroups.lo(iso,sex,agegroup15,bmi_tree15); + ov15_bmi_shr_regr(t,iso,sex,age,bmi_group15,"lower") = v15_bmi_shr_regr.lo(iso,sex,age,bmi_group15); + ov15_bmi_shr_overgroups(t,iso,sex,agegroup15,bmi_group15,"lower") = v15_bmi_shr_overgroups.lo(iso,sex,agegroup15,bmi_group15); + ov15_objective(t,"lower") = v15_objective.lo; + oq15_food_demand(t,i,kfo,"lower") = q15_food_demand.lo(i,kfo); + oq15_aim(t,"lower") = q15_aim.lo; + oq15_budget(t,iso,"lower") = q15_budget.lo(iso); + oq15_regr_bmi_shr(t,iso,sex,agegroup15,bmi_tree15,"lower") = q15_regr_bmi_shr.lo(iso,sex,agegroup15,bmi_tree15); + oq15_bmi_shr_verylow(t,iso,sex,agegroup15,"lower") = q15_bmi_shr_verylow.lo(iso,sex,agegroup15); + oq15_bmi_shr_low(t,iso,sex,agegroup15,"lower") = q15_bmi_shr_low.lo(iso,sex,agegroup15); + oq15_bmi_shr_medium(t,iso,sex,agegroup15,"lower") = q15_bmi_shr_medium.lo(iso,sex,agegroup15); + oq15_bmi_shr_medium_high(t,iso,sex,agegroup15,"lower") = q15_bmi_shr_medium_high.lo(iso,sex,agegroup15); + oq15_bmi_shr_high(t,iso,sex,agegroup15,"lower") = q15_bmi_shr_high.lo(iso,sex,agegroup15); + oq15_bmi_shr_veryhigh(t,iso,sex,agegroup15,"lower") = q15_bmi_shr_veryhigh.lo(iso,sex,agegroup15); + oq15_bmi_shr_agg(t,iso,sex,age,bmi_group15,"lower") = q15_bmi_shr_agg.lo(iso,sex,age,bmi_group15); + oq15_intake(t,iso,"lower") = q15_intake.lo(iso); + oq15_regr_kcal(t,iso,"lower") = q15_regr_kcal.lo(iso); + oq15_regr(t,iso,regr15,"lower") = q15_regr.lo(iso,regr15); + oq15_foodtree_kcal_animals(t,iso,kfo_ap,"lower") = q15_foodtree_kcal_animals.lo(iso,kfo_ap); + oq15_foodtree_kcal_processed(t,iso,kfo_pf,"lower") = q15_foodtree_kcal_processed.lo(iso,kfo_pf); + oq15_foodtree_kcal_staples(t,iso,kfo_st,"lower") = q15_foodtree_kcal_staples.lo(iso,kfo_st); + oq15_foodtree_kcal_vegetables(t,iso,"lower") = q15_foodtree_kcal_vegetables.lo(iso); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/15_food/anthropometrics_jan18/preloop.gms b/modules/15_food/anthropometrics_jan18/preloop.gms index 40d12049c6..15dad5de06 100644 --- a/modules/15_food/anthropometrics_jan18/preloop.gms +++ b/modules/15_food/anthropometrics_jan18/preloop.gms @@ -1,3 +1,9 @@ +*** | (C) 2008-2019 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 i15_dem_intercept(regr15) = f15_demand_paras(regr15,"%c15_food_scenario%","intercept"); @@ -12,7 +18,6 @@ p15_bodyheight(t,iso,sex,age,estimates15) = f15_bodyheight(t,iso,sex,age); * calculating growth food for historical period -* in case it starts before period use values of first timestep loop(t_past, if (ord(t_past)>3, @@ -39,9 +44,9 @@ i15_prices_initial_kcal(iso,kfo)$(f15_nutrition_attributes("y1995",kfo,"kcal")>0 / (f15_nutrition_attributes("y1995",kfo,"kcal")*10**6); p15_prices_kcal(t,iso,kfo)=i15_prices_initial_kcal(iso,kfo); -p15_lastiteration_delta_income(i) = 1; +p15_lastiteration_delta_income(t,i) = 1; $ifthen "%c15_rumscen%" == "mixed" i15_ruminant_fadeout(t) = (f15_ruminant_fadeout(t,"constant") + f15_ruminant_fadeout(t,"halving2050"))/2; $else i15_ruminant_fadeout(t) = f15_ruminant_fadeout(t,"%c15_rumscen%"); -$endif \ No newline at end of file +$endif diff --git a/modules/15_food/anthropometrics_jan18/presolve.gms b/modules/15_food/anthropometrics_jan18/presolve.gms index 989074061c..9f224c36d7 100644 --- a/modules/15_food/anthropometrics_jan18/presolve.gms +++ b/modules/15_food/anthropometrics_jan18/presolve.gms @@ -1,18 +1,26 @@ +*** | (C) 2008-2019 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 + + option nlp = conopt4 *' @code -*' Within the major foodgroups determined by the regressions +*' Within the major food groups determined by the regressions *' (animal calories, empty calories, fruits, vegetable and nut calories as well as staple calories), -*' the relative share of individual products (e.g. eggss with animal calories) +*' the relative share of individual products (e.g. eggs within animal calories) *' is assumed to be constant. An exception is the demand for ruminant meat, *' which declines in the course of the century at the cost of chicken meat. *' @stop if (sum(sameas(t_past,t),1) = 1, -*** get share of a staple product within total staples and livestock products, and replace zero shares with reginoal avarages -* first set it to equal shares, just in case there is no population +*** Calculate the share of individual food products within major food groups, and replace zero shares with regional averages +* First set it to equal shares, just in case there is no population i15_livestock_kcal_structure_iso_raw(t,iso,kfo_ap) = @@ -61,7 +69,7 @@ if (sum(sameas(t_past,t),1) = 1, else -* keep staples and livestock structure constant for future projections +* Assumptions on future calorie structure within food groups for future projections: i15_staples_kcal_structure_iso(t,iso,kfo_st) =i15_staples_kcal_structure_iso(t-1,iso,kfo_st); i15_processed_kcal_structure_iso(t,iso,kfo_pf) =i15_processed_kcal_structure_iso(t-1,iso,kfo_pf); i15_livestock_kcal_structure_iso_raw(t,iso,kfo_ap) = i15_livestock_kcal_structure_iso_raw(t-1,iso,kfo_ap); @@ -76,26 +84,26 @@ if (sum(sameas(t_past,t),1) = 1, *' @code -*' The calculations are exectued in the following order: +*' The calculations are executed in the following order: *' *' In the beginning of each time step, the body height is estimated based on the diets -*' of the previous 15 years. In case that the time step length exceed 5 years, the consumption -*' is extrapolated using the last two time steps. +*' of the previous 15 years. In case that the time step length exceeds 5 years, +*' the consumption is extrapolated using the last two time steps. *' Body height is estimated using the consumption of proteins and fats, in our case *' the foodgroups animal products, pulses and oils. *' To estimate the body size of underaged (0-14 years), we scale the WHO body height -*' recommendations for underaged with the divergence of the 15-19 year olds. +*' recommendations for underaged with the divergence of the 15-19 year old. *' The body height estimates are repeated again at the end of the time step to improve *' the results of the extrapolation for cases where the time step length exceeds 5 years. *' @stop -* ###### ANTHROPOMETRIC ESIMTATES -* ### Preliminary calculation of bodyweight based on food availability of last 3 timesteps -* ### This may diverge from final calcuation in the case where timesteplength exceeds 5 years -* ### As then the demand depends on the result of MAgPIE -* ### Calculations are therefore repeated after optimization +* ###### ANTHROPOMETRIC ESTIMATES +* ### Preliminary calculation of body height and weight based on food availability of last 3 timesteps. +* ### This may diverge from final calculation in the case where timestep length exceeds 5 years +* ### as then the demand depends on the result of MAgPIE. +* ### Calculations are therefore repeated after optimization. -* calculations are only made after historical period. before, we use historical values +* Calculations are only made after historical period. Before, we use historical values. if (sum(sameas(t_past,t),1) = 1, @@ -107,16 +115,21 @@ else p15_bodyheight(t,iso,sex,age,"preliminary") = p15_bodyheight(t-1,iso,sex,age,"final"); p15_kcal_growth_food(t,iso,underaged15) = p15_kcal_growth_food(t-1,iso,underaged15); - s15_count=m_yeardiff(t); + + + + s15_yeardiff = m_yeardiff(t)/5; * avoid fake 1yr timestep in 1995 - if(s15_count<5,s15_count=5); - For (s15_count = 1 to (m_yeardiff(t)/5), + if(s15_yeardiff<1,s15_yeardiff=1); + + For (s15_count = 1 to s15_yeardiff, + * circular move of age by 5 years * to find out about ++1 search for help on Circular Lag and Lead Operators in Assignments p15_bodyheight(t,iso,sex,age++1,"preliminary") = p15_bodyheight(t,iso,sex,age,"preliminary"); -* replace age groups of 18 year olds +* replace age groups of 18 year old p15_bodyheight(t,iso,"F","15--19","preliminary") = 126.4* (sum(underaged15, @@ -130,7 +143,7 @@ else )/3)**0.03978 ; ); -*adjust body weight of kids proportional to over18 population +*adjust body height of kids proportional to over18 population p15_bodyheight(t,iso,"M","0--4","preliminary")=p15_bodyheight(t,iso,"M","15--19","preliminary")/176*92; p15_bodyheight(t,iso,"M","5--9","preliminary")=p15_bodyheight(t,iso,"M","15--19","preliminary")/176*125; p15_bodyheight(t,iso,"M","10--14","preliminary")=p15_bodyheight(t,iso,"M","15--19","preliminary")/176*152; @@ -146,78 +159,26 @@ else -*### estimate standardized food requirement +*### Estimate standardized food requirements p15_bodyweight(t,iso,sex,age,bmi_group15)= f15_bmi(sex,age,bmi_group15) * (p15_bodyheight(t,iso,sex,age,"preliminary")/100)**2; *' Physical activity levels (PAL) relative to the basic metabolic rate (BMR) are *' estimated based on physical inactivity levels, assuming PALs for sedentary -*' and medium-active populations of 1.53 and 1.76 respectively. +*' and medium-active populations of 1.53 and 1.76 respectively: p15_physical_activity_level(t,iso,sex,age)= im_physical_inactivity(t,iso,sex,age) * 1.53 +(1-im_physical_inactivity(t,iso,sex,age)) * 1.76 ; - -i15_intake(t,iso,sex,age,bmi_group15)= +p15_intake(t,iso,sex,age,bmi_group15)= (f15_schofield(sex,age, "intercept") + f15_schofield(sex,age, "slope")*p15_bodyweight(t,iso,sex,age,bmi_group15)) * p15_physical_activity_level(t,iso,sex,age); -*' Then, the divergence of the BMI from the regression during the historical -*' period is estimated for calibration purposes. - -if (sum(sameas(t_past,t),1) = 1, - i15_bmi_shr_regr_pre(t,iso,sex,agegroup15,bmi_tree15) = - f15_bmi_shr_paras(sex,agegroup15,bmi_tree15,"intercept") - + (f15_bmi_shr_paras(sex,agegroup15,bmi_tree15,"saturation") * im_gdp_pc_ppp_iso(t,iso)) - / (f15_bmi_shr_paras(sex,agegroup15,bmi_tree15,"halfsaturation") + im_gdp_pc_ppp_iso(t,iso)); - - i15_bmi_shr_pre(t,iso,sex,agegroup15,"verylow") = - i15_bmi_shr_regr_pre(t,iso,sex,agegroup15,"low")* - i15_bmi_shr_regr_pre(t,iso,sex,agegroup15,"lowsplit"); - - i15_bmi_shr_pre(t,iso,sex,agegroup15,"low") = - i15_bmi_shr_regr_pre(t,iso,sex,agegroup15,"low")* - (1-i15_bmi_shr_regr_pre(t,iso,sex,agegroup15,"lowsplit")); - - i15_bmi_shr_pre(t,iso,sex,agegroup15,"medium") = - (1-i15_bmi_shr_regr_pre(t,iso,sex,agegroup15,"low") - -i15_bmi_shr_regr_pre(t,iso,sex,agegroup15,"high"))* - (1-i15_bmi_shr_regr_pre(t,iso,sex,agegroup15,"mediumsplit")); - - i15_bmi_shr_pre(t,iso,sex,agegroup15,"mediumhigh") = - (1-i15_bmi_shr_regr_pre(t,iso,sex,agegroup15,"low") - -i15_bmi_shr_regr_pre(t,iso,sex,agegroup15,"high"))* - i15_bmi_shr_regr_pre(t,iso,sex,agegroup15,"mediumsplit"); - - i15_bmi_shr_pre(t,iso,sex,agegroup15,"high") = - i15_bmi_shr_regr_pre(t,iso,sex,agegroup15,"high")* - (1-i15_bmi_shr_regr_pre(t,iso,sex,agegroup15,"highsplit")); - - i15_bmi_shr_pre(t,iso,sex,agegroup15,"veryhigh") = - i15_bmi_shr_regr_pre(t,iso,sex,agegroup15,"high")* - i15_bmi_shr_regr_pre(t,iso,sex,agegroup15,"highsplit"); - - - i15_bmi_shr_calib(t,iso,sex,age,bmi_group15) = - f15_bmi_shr_past(t,iso,age,sex,bmi_group15) - - sum(agegroup2age(agegroup15,age), - i15_bmi_shr_pre(t,iso,sex,agegroup15,bmi_group15) - ); - - i15_bmi_shr_calib_lastcalibyear(iso,sex,age,bmi_group15)=i15_bmi_shr_calib(t,iso,sex,age,bmi_group15); - -else -*' The divergence of the BMI from the historical data is kept constant over time -*' or fades out. - i15_bmi_shr_calib(t,iso,sex,age,bmi_group15) = - i15_bmi_shr_calib_lastcalibyear(iso,sex,age,bmi_group15) - * f15_kcal_calib_fadeout(t,"%c15_calibscen%"); -); -*' Pregnancy and lactation requires additonal food intakes. To account for this, +*' Pregnancy and lactation require additional food intake. To account for this, *' newborns are distributed among reproductive women in a population. This number -*' is then multiplied with the extra energy requirements +*' is then multiplied with the extra energy requirements: i15_kcal_pregnancy(t,iso)=sum(sex,im_demography(t,iso,sex,"0--4")/5) * ((40/66)*845 + (26/66)*675); *' @stop @@ -234,11 +195,11 @@ i15_kcal_pregnancy(t,iso)=sum(sex,im_demography(t,iso,sex,"0--4")/5) * ((40/66)* * demand for non-food products "knf" is set to 0; vm_dem_food.fx(i,knf)=0; -*** Price-demand model is calculated the first time, using standard prices +*** Food demand model is calculated the first time for the current time step, using standard prices p15_iteration_counter(t) =0; -display "starting demand model for intitialisation run...."; +display "starting demand model for initialisation run...."; * helping the solver by starting from reasonable values @@ -257,28 +218,30 @@ if(( p15_modelstat(t)) > 2 and (p15_modelstat(t) ne 7 ), abort "Food Demand Model became infeasible already during initialisation run. Stop run."; ); -* releasing real per capita binding for later runs that include shocks - +* releasing real income per capita binding for later runs that include shocks v15_income_pc_real_ppp_iso.lo(iso)=10; v15_income_pc_real_ppp_iso.up(iso)=Inf; -* saving regression outcome for height regression - +* saving regression outcome for per capita food demand for different foods p15_kcal_regr(t, iso, kfo)=v15_kcal_regr.l(iso, kfo); +* saving regression outcome for BMI shares +p15_bmi_shr_regr(t,iso,sex,age,bmi_group15)=v15_bmi_shr_regr.l(iso,sex,age,bmi_group15); + * deriving calibration values *' @code -*' Food demand and BMIs are calibrated so that historical food demand is met. -*' For this purpose, the residual between the regression fit and the observation -*' is calculated for the historical period. When the historical period ends, the -*' calibarion factor is fixed at the value of the last period. -*' Additionally, a second calibration is requrired to meet the FAOSTAT fooduse -*' demand. While the food demand model estimates the demand for all countries -*' of the world, FAOSTAT only has a subset of countries. To match FAOSTAT totals, -*' the food demand of these countries is calibrated to zero. As this calibration -*' is done ex-post, food demand estimates can still be used for all countries, -*' but MAgPIE only considers demand from FAOSTAT countries. +*' Per capita food demand and BMI shares are calibrated so that historical data +*' are met. For this purpose, the residual between the regression fit and the +*' observation is calculated for the historical period. When the historical period +*' ends, the calibration factor is fixed at the value of the last historical time +*' step. Additionally, a second calibration is required to meet the world totals +*' of FAOSTAT food demand for different foods. While the food demand model estimates +*' the demand for all countries of the world, FAOSTAT only covers a subset of +*' countries. To match FAOSTAT totals, the food demand of countries not included +*' in FAOSTAT is calibrated to zero. As this calibration is done ex-post, food +*' demand estimates can still be used for all countries, but MAgPIE only considers +*' demand from FAOSTAT countries. if (sum(sameas(t_past,t),1) = 1, p15_kcal_calib(t,iso,kfo)$(sum(kfo2,f15_kcal_pc_iso(t,iso,kfo2))=0) = 0; @@ -297,14 +260,14 @@ if (sum(sameas(t_past,t),1) = 1, else *' Depending on the scenario switch c15_calibscen, the divergence of the demand from the -*' historical data is kept constant or eventually faded out +*' historical data is kept constant or faded out. p15_kcal_calib(t,iso,kfo) = p15_kcal_calib_lastcalibyear(iso,kfo) * f15_kcal_calib_fadeout(t,"%c15_calibscen%"); *' The divergence of the kcal of countries with no FAOSTAT data is kept constant *' over time. p15_balanceflow_kcal_iso(t,iso,kfo) = p15_balanceflow_kcal_lastcalibyear(iso,kfo); -*' Depending on the scenario switch c15_calibscen, the divergence of the BMI from the historical -*' data is kept constant over time or fadet out. +*' Depending on the scenario switch c15_calibscen, the divergence of the BMI shares from the +*' historical data is kept constant over time or faded out. i15_bmi_shr_calib(t,iso,sex,age,bmi_group15) = i15_bmi_shr_calib_lastcalibyear(iso,sex,age,bmi_group15) * f15_kcal_calib_fadeout(t,"%c15_calibscen%"); @@ -313,13 +276,13 @@ else *' The calibration factor is added to the regression value. p15_kcal_pc_iso(t,iso,kfo) = v15_kcal_regr.l(iso,kfo) + p15_kcal_calib(t,iso,kfo) * s15_calibrate; -*' Negative values that can possibly occur due to calibration, are set to zero. +*' Negative values that can possibly occur due to calibration are set to zero. p15_kcal_pc_iso(t,iso,kfo)$(p15_kcal_pc_iso(t,iso,kfo)<0) = 0; -*' The country-level parameter p15_kcal_pc_iso is aggregated to -*' regional level into the parameter p15_kcal_pc. This parameter is provided -*' to constraint q15_food_demand in the MAgPIE model, which defines -*' the demand for food. +*' The country-level parameter p15_kcal_pc_iso is aggregated to the +*' regional level. After removing estimates from countries that are not included +*' in FAOSTAT, the resulting parameter p15_kcal_pc_calibrated is provided to +*' constraint q15_food_demand in the MAgPIE model, which defines the demand for food. *' @stop * aggregate to regions @@ -352,12 +315,12 @@ else o15_kcal_regr_initial(iso,kfo)=v15_kcal_regr.l(iso,kfo); * Finally, we calibrate countries with zero food demand according to FAOSTAT -* down to zero to match FAO values- -* Values are rounded to avoid path dependencies of MAgPIE solver +* down to zero to match FAO world totals. +* Values are rounded to avoid path dependencies of MAgPIE solver. p15_kcal_pc_calibrated(t,i,kfo)=p15_kcal_pc(t,i,kfo)+p15_balanceflow_kcal(t,i,kfo); p15_kcal_pc_calibrated(t,i,kfo)=round(p15_kcal_pc_calibrated(t,i,kfo),2); p15_kcal_pc_calibrated(t,i,kfo)$(p15_kcal_pc_calibrated(t,i,kfo)<0)=0; *' @code *' Now, MAgPIE is executed. -*' @stop \ No newline at end of file +*' @stop diff --git a/modules/15_food/anthropometrics_jan18.gms b/modules/15_food/anthropometrics_jan18/realization.gms similarity index 82% rename from modules/15_food/anthropometrics_jan18.gms rename to modules/15_food/anthropometrics_jan18/realization.gms index daf855ff7c..3ff14c30eb 100644 --- a/modules/15_food/anthropometrics_jan18.gms +++ b/modules/15_food/anthropometrics_jan18/realization.gms @@ -1,42 +1,43 @@ - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/15_food/anthropometrics_jan18/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/15_food/anthropometrics_jan18/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/15_food/anthropometrics_jan18/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/15_food/anthropometrics_jan18/equations.gms" -$Ifi "%phase%" == "scaling" $include "./modules/15_food/anthropometrics_jan18/scaling.gms" -$Ifi "%phase%" == "preloop" $include "./modules/15_food/anthropometrics_jan18/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/15_food/anthropometrics_jan18/presolve.gms" -$Ifi "%phase%" == "solve" $include "./modules/15_food/anthropometrics_jan18/solve.gms" -$Ifi "%phase%" == "intersolve" $include "./modules/15_food/anthropometrics_jan18/intersolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/15_food/anthropometrics_jan18/postsolve.gms" -$Ifi "%phase%" == "nl_fix" $include "./modules/15_food/anthropometrics_jan18/nl_fix.gms" -$Ifi "%phase%" == "nl_release" $include "./modules/15_food/anthropometrics_jan18/nl_release.gms" -$Ifi "%phase%" == "nl_relax" $include "./modules/15_food/anthropometrics_jan18/nl_relax.gms" -*######################## R SECTION END (PHASES) ############################### - -*' @description -*' The realization anthropometrics_jan18 -*' uses per capita income and the demography of the -*' world population (including sex and age classes at the country level, -*' which are provided from module [09_drivers]) as drivers. -*' The module estimates food demand on iso-country level taking -*' anthropometric food requirements as well as economic dynamics into account. -*' If flexible demand is activated, the module also uses the shadow prices -*' for agircultural products from the optimization, which are the Lagrange -*' multipliers of the constraint `q15_food_demand`. -*' The module consists of a standalone food demand model, which is executed -*' before MAgPIE starts. In the case of endogenous demand, the module is -*' iterated with MAgPIE. -*' Besides providing the fooduse of agricultural products, the model also -*' provides a number of output indicators, including the BMI distribution, -*' body weight and height of the population by age and sex, food intake by -*' age group and sex, food waste, dietary composition between livestock products, -*' empty calories (sugar, oil and alcohol), fruits vegetables and nuts, as well -*' as staple calories. -*' The food demand model can be run in standalone mode by running the -*' the file `standalone/demand_model.gms`. -*' The model is described in [@bodirsky_starved_nodate] -*' -*' @authors Benjamin Leon Bodirsky, Jan Philipp Dietrich - +*** | (C) 2008-2019 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 + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/15_food/anthropometrics_jan18/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/15_food/anthropometrics_jan18/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/15_food/anthropometrics_jan18/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/15_food/anthropometrics_jan18/equations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/15_food/anthropometrics_jan18/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/15_food/anthropometrics_jan18/presolve.gms" +$Ifi "%phase%" == "intersolve" $include "./modules/15_food/anthropometrics_jan18/intersolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/15_food/anthropometrics_jan18/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### + +*' @description +*' The realization anthropometrics_jan18 +*' uses per capita income and the demography of the +*' world population (including sex and age classes at the country level, +*' which are provided from module [09_drivers]) as drivers. +*' The module estimates food demand on iso-country level taking +*' anthropometric food requirements as well as economic dynamics into account. +*' If flexible demand is activated, the module also uses the shadow prices +*' for agircultural products from the optimization, which are the Lagrange +*' multipliers of the constraint `q15_food_demand`. +*' The module consists of a standalone food demand model, which is executed +*' before MAgPIE starts. In the case of endogenous demand, the module is +*' iterated with MAgPIE. +*' Besides providing the fooduse of agricultural products, the model also +*' provides a number of output indicators, including the BMI distribution, +*' body weight and height of the population by age and sex, food intake by +*' age group and sex, food waste, dietary composition between livestock products, +*' empty calories (sugar, oil and alcohol), fruits vegetables and nuts, as well +*' as staple calories. +*' The food demand model can be run in standalone mode by running the +*' the file `standalone/demand_model.gms`. +*' The model is described in [@bodirsky_starved_nodate] +*' +*' @authors Benjamin Leon Bodirsky, Jan Philipp Dietrich + diff --git a/modules/15_food/anthropometrics_jan18/scaling.gms b/modules/15_food/anthropometrics_jan18/scaling.gms deleted file mode 100644 index 8b13789179..0000000000 --- a/modules/15_food/anthropometrics_jan18/scaling.gms +++ /dev/null @@ -1 +0,0 @@ - diff --git a/modules/15_food/anthropometrics_jan18/sets.gms b/modules/15_food/anthropometrics_jan18/sets.gms index 6601c14cc6..01172e35c8 100644 --- a/modules/15_food/anthropometrics_jan18/sets.gms +++ b/modules/15_food/anthropometrics_jan18/sets.gms @@ -1,8 +1,9 @@ -*** (C) 2008-2017 Potsdam Institute for Climate Impact Research (PIK), -*** authors, and contributors see AUTHORS file -*** This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** Contact: magpie@pik-potsdam.de +*** | (C) 2008-2019 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 sets underaged15(age) Group of underaged age classes @@ -105,7 +106,7 @@ sets wood, woodfuel / - nutrition Nutritition attributes + nutrition Nutrition attributes /kcal, protein/ par15 Parameters for food module @@ -142,4 +143,4 @@ alias(kfo_ap,kfo_ap2); alias(kfo_st,kfo_st2); alias(kfo_pf,kfo_pf2); alias(iso,iso2); -alias(reproductive,reproductive2); \ No newline at end of file +alias(reproductive,reproductive2); diff --git a/modules/15_food/anthropometrics_jan18/solve.gms b/modules/15_food/anthropometrics_jan18/solve.gms deleted file mode 100644 index 8b13789179..0000000000 --- a/modules/15_food/anthropometrics_jan18/solve.gms +++ /dev/null @@ -1 +0,0 @@ - diff --git a/modules/15_food/15_food.gms b/modules/15_food/module.gms similarity index 55% rename from modules/15_food/15_food.gms rename to modules/15_food/module.gms index 3215e38a7f..e913af1e0c 100644 --- a/modules/15_food/15_food.gms +++ b/modules/15_food/module.gms @@ -1,15 +1,16 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Food demand -*' -*' @description The main function of the food demand module is to forecast -*' the food demand from agricultural products, which is used in the module [16_demand]. -*' @authors Benjamin Leon Bodirsky, Jan Philipp Dietrich - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%food%" == "anthropometrics_jan18" $include "./modules/15_food/anthropometrics_jan18.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Food demand +*' +*' @description The main function of the food demand module is to forecast +*' the food demand from agricultural products, which is used in the module [16_demand]. +*' @authors Benjamin Leon Bodirsky, Jan Philipp Dietrich + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%food%" == "anthropometrics_jan18" $include "./modules/15_food/anthropometrics_jan18/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/16_demand/16_demand.gms b/modules/16_demand/module.gms similarity index 65% rename from modules/16_demand/16_demand.gms rename to modules/16_demand/module.gms index 964935c84f..7301287bcb 100644 --- a/modules/16_demand/16_demand.gms +++ b/modules/16_demand/module.gms @@ -1,19 +1,20 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Demand -*' -*' @description The demand module calculates the demand for all commodities that -*' has to be fulfilled by the model. In addition, it returns some other basic -*' information needed for demand calculations but also needed by other modules. -*' A description of food demand scenarios that enter the model can be found -*' in @bodirsky_global_2015-1, @bodirsky_n2o_2012 and @valin_fooddemand_2013. -*' -*' @authors Isabelle Weindl, Benjamin Bodirsky, Jan Philipp Dietrich. - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%demand%" == "sector_may15" $include "./modules/16_demand/sector_may15.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Demand +*' +*' @description The demand module calculates the demand for all commodities that +*' has to be fulfilled by the model. In addition, it returns some other basic +*' information needed for demand calculations but also needed by other modules. +*' A description of food demand scenarios that enter the model can be found +*' in @bodirsky_global_2015-1, @bodirsky_n2o_2012 and @valin_fooddemand_2013. +*' +*' @authors Isabelle Weindl, Benjamin Bodirsky, Jan Philipp Dietrich. + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%demand%" == "sector_may15" $include "./modules/16_demand/sector_may15/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/16_demand/sector_may15/declarations.gms b/modules/16_demand/sector_may15/declarations.gms index 672fdf1bfe..2ffea3dffb 100644 --- a/modules/16_demand/sector_may15/declarations.gms +++ b/modules/16_demand/sector_may15/declarations.gms @@ -1,38 +1,39 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -positive variables -vm_supply(i,kall) Regional demand (mio. tDM per yr) -v16_dem_waste(i,kall) Demand for waste (mio. tDM per yr) -vm_dem_seed(i,kall) Demand for seed (mio. tDM per yr) -; - -equations -q16_supply_crops(i,kcr) Supply balance of crops (mio. tDM per yr) -q16_supply_livestock(i,kap) Supply balance of livestock (mio. tDM per yr) -q16_supply_secondary(i,ksd) Supply balance of secondary products (mio. tDM per yr) -q16_supply_residues(i,kres) Supply balance of crop residues (mio. tDM per yr) -q16_supply_pasture(i) Supply balance of pasture (mio. tDM per yr) -q16_waste_demand(i,kall) Waste generation (mio. tDM per yr) -q16_seed_demand(i,kcr) Seed demand (mio. tDM per yr) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_supply(t,i,kall,type) Regional demand (mio. tDM per yr) - ov16_dem_waste(t,i,kall,type) Demand for waste (mio. tDM per yr) - ov_dem_seed(t,i,kall,type) Demand for seed (mio. tDM per yr) - oq16_supply_crops(t,i,kcr,type) Supply balance of crops (mio. tDM per yr) - oq16_supply_livestock(t,i,kap,type) Supply balance of livestock (mio. tDM per yr) - oq16_supply_secondary(t,i,ksd,type) Supply balance of secondary products (mio. tDM per yr) - oq16_supply_residues(t,i,kres,type) Supply balance of crop residues (mio. tDM per yr) - oq16_supply_pasture(t,i,type) Supply balance of pasture (mio. tDM per yr) - oq16_waste_demand(t,i,kall,type) Waste generation (mio. tDM per yr) - oq16_seed_demand(t,i,kcr,type) Seed demand (mio. tDM per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + + +positive variables +vm_supply(i,kall) Regional demand (mio. tDM per yr) +v16_dem_waste(i,kall) Demand for waste (mio. tDM per yr) +vm_dem_seed(i,kall) Demand for seed (mio. tDM per yr) +; + +equations +q16_supply_crops(i,kcr) Supply balance of crops (mio. tDM per yr) +q16_supply_livestock(i,kap) Supply balance of livestock (mio. tDM per yr) +q16_supply_secondary(i,ksd) Supply balance of secondary products (mio. tDM per yr) +q16_supply_residues(i,kres) Supply balance of crop residues (mio. tDM per yr) +q16_supply_pasture(i) Supply balance of pasture (mio. tDM per yr) +q16_waste_demand(i,kall) Waste generation (mio. tDM per yr) +q16_seed_demand(i,kcr) Seed demand (mio. tDM per yr) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_supply(t,i,kall,type) Regional demand (mio. tDM per yr) + ov16_dem_waste(t,i,kall,type) Demand for waste (mio. tDM per yr) + ov_dem_seed(t,i,kall,type) Demand for seed (mio. tDM per yr) + oq16_supply_crops(t,i,kcr,type) Supply balance of crops (mio. tDM per yr) + oq16_supply_livestock(t,i,kap,type) Supply balance of livestock (mio. tDM per yr) + oq16_supply_secondary(t,i,ksd,type) Supply balance of secondary products (mio. tDM per yr) + oq16_supply_residues(t,i,kres,type) Supply balance of crop residues (mio. tDM per yr) + oq16_supply_pasture(t,i,type) Supply balance of pasture (mio. tDM per yr) + oq16_waste_demand(t,i,kall,type) Waste generation (mio. tDM per yr) + oq16_seed_demand(t,i,kcr,type) Seed demand (mio. tDM per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/16_demand/sector_may15/equations.gms b/modules/16_demand/sector_may15/equations.gms index 7ab8c11324..a009ae43ba 100644 --- a/modules/16_demand/sector_may15/equations.gms +++ b/modules/16_demand/sector_may15/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations diff --git a/modules/16_demand/sector_may15/input.gms b/modules/16_demand/sector_may15/input.gms index cd664816b2..8df554f5a6 100644 --- a/modules/16_demand/sector_may15/input.gms +++ b/modules/16_demand/sector_may15/input.gms @@ -1,27 +1,28 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -table f16_seed_shr(t_all,i,kcr) Seed share relative to production from FAO-FBS (1) -$ondelim -$include "./modules/16_demand/sector_may15/input/f16_seed_shr.csv" -$offdelim; - -table f16_waste_shr(t_all,i,kall) Waste share relative to domestic supply from FAO-FBS (1) -$ondelim -$include "./modules/16_demand/sector_may15/input/f16_waste_shr.csv" -$offdelim; - -table fm_attributes(attributes,kall) Conversion factors - where X is ton N P K C DM WM or PJ GE (X per tDM) -$ondelim -$include "./modules/16_demand/sector_may15/input/fm_attributes.cs3" -$offdelim; - -table f16_domestic_balanceflow(t_all,i,kall) Balance flow for inconsistencies between domestic supply and use in FAO (mio. tDM per yr) -$ondelim -$include "./modules/16_demand/sector_may15/input/f16_domestic_balanceflow.csv" -$offdelim; +*** | (C) 2008-2019 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 + + + +table f16_seed_shr(t_all,i,kcr) Seed share relative to production from FAO-FBS (1) +$ondelim +$include "./modules/16_demand/sector_may15/input/f16_seed_shr.csv" +$offdelim; + +table f16_waste_shr(t_all,i,kall) Waste share relative to domestic supply from FAO-FBS (1) +$ondelim +$include "./modules/16_demand/sector_may15/input/f16_waste_shr.csv" +$offdelim; + +table fm_attributes(attributes,kall) Conversion factors - where X is ton N P K C DM WM or PJ GE (X per tDM) +$ondelim +$include "./modules/16_demand/sector_may15/input/fm_attributes.cs3" +$offdelim; + +table f16_domestic_balanceflow(t_all,i,kall) Balance flow for inconsistencies between domestic supply and use in FAO (mio. tDM per yr) +$ondelim +$include "./modules/16_demand/sector_may15/input/f16_domestic_balanceflow.csv" +$offdelim; diff --git a/modules/16_demand/sector_may15/not_used.txt b/modules/16_demand/sector_may15/not_used.txt index 6ece3f27a1..4b81dfbae2 100644 --- a/modules/16_demand/sector_may15/not_used.txt +++ b/modules/16_demand/sector_may15/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason diff --git a/modules/16_demand/sector_may15/postsolve.gms b/modules/16_demand/sector_may15/postsolve.gms index 608788bdff..2626436760 100644 --- a/modules/16_demand/sector_may15/postsolve.gms +++ b/modules/16_demand/sector_may15/postsolve.gms @@ -1,51 +1,52 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_supply(t,i,kall,"marginal") = vm_supply.m(i,kall); - ov16_dem_waste(t,i,kall,"marginal") = v16_dem_waste.m(i,kall); - ov_dem_seed(t,i,kall,"marginal") = vm_dem_seed.m(i,kall); - oq16_supply_crops(t,i,kcr,"marginal") = q16_supply_crops.m(i,kcr); - oq16_supply_livestock(t,i,kap,"marginal") = q16_supply_livestock.m(i,kap); - oq16_supply_secondary(t,i,ksd,"marginal") = q16_supply_secondary.m(i,ksd); - oq16_supply_residues(t,i,kres,"marginal") = q16_supply_residues.m(i,kres); - oq16_supply_pasture(t,i,"marginal") = q16_supply_pasture.m(i); - oq16_waste_demand(t,i,kall,"marginal") = q16_waste_demand.m(i,kall); - oq16_seed_demand(t,i,kcr,"marginal") = q16_seed_demand.m(i,kcr); - ov_supply(t,i,kall,"level") = vm_supply.l(i,kall); - ov16_dem_waste(t,i,kall,"level") = v16_dem_waste.l(i,kall); - ov_dem_seed(t,i,kall,"level") = vm_dem_seed.l(i,kall); - oq16_supply_crops(t,i,kcr,"level") = q16_supply_crops.l(i,kcr); - oq16_supply_livestock(t,i,kap,"level") = q16_supply_livestock.l(i,kap); - oq16_supply_secondary(t,i,ksd,"level") = q16_supply_secondary.l(i,ksd); - oq16_supply_residues(t,i,kres,"level") = q16_supply_residues.l(i,kres); - oq16_supply_pasture(t,i,"level") = q16_supply_pasture.l(i); - oq16_waste_demand(t,i,kall,"level") = q16_waste_demand.l(i,kall); - oq16_seed_demand(t,i,kcr,"level") = q16_seed_demand.l(i,kcr); - ov_supply(t,i,kall,"upper") = vm_supply.up(i,kall); - ov16_dem_waste(t,i,kall,"upper") = v16_dem_waste.up(i,kall); - ov_dem_seed(t,i,kall,"upper") = vm_dem_seed.up(i,kall); - oq16_supply_crops(t,i,kcr,"upper") = q16_supply_crops.up(i,kcr); - oq16_supply_livestock(t,i,kap,"upper") = q16_supply_livestock.up(i,kap); - oq16_supply_secondary(t,i,ksd,"upper") = q16_supply_secondary.up(i,ksd); - oq16_supply_residues(t,i,kres,"upper") = q16_supply_residues.up(i,kres); - oq16_supply_pasture(t,i,"upper") = q16_supply_pasture.up(i); - oq16_waste_demand(t,i,kall,"upper") = q16_waste_demand.up(i,kall); - oq16_seed_demand(t,i,kcr,"upper") = q16_seed_demand.up(i,kcr); - ov_supply(t,i,kall,"lower") = vm_supply.lo(i,kall); - ov16_dem_waste(t,i,kall,"lower") = v16_dem_waste.lo(i,kall); - ov_dem_seed(t,i,kall,"lower") = vm_dem_seed.lo(i,kall); - oq16_supply_crops(t,i,kcr,"lower") = q16_supply_crops.lo(i,kcr); - oq16_supply_livestock(t,i,kap,"lower") = q16_supply_livestock.lo(i,kap); - oq16_supply_secondary(t,i,ksd,"lower") = q16_supply_secondary.lo(i,ksd); - oq16_supply_residues(t,i,kres,"lower") = q16_supply_residues.lo(i,kres); - oq16_supply_pasture(t,i,"lower") = q16_supply_pasture.lo(i); - oq16_waste_demand(t,i,kall,"lower") = q16_waste_demand.lo(i,kall); - oq16_seed_demand(t,i,kcr,"lower") = q16_seed_demand.lo(i,kcr); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - +*** | (C) 2008-2019 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 + + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_supply(t,i,kall,"marginal") = vm_supply.m(i,kall); + ov16_dem_waste(t,i,kall,"marginal") = v16_dem_waste.m(i,kall); + ov_dem_seed(t,i,kall,"marginal") = vm_dem_seed.m(i,kall); + oq16_supply_crops(t,i,kcr,"marginal") = q16_supply_crops.m(i,kcr); + oq16_supply_livestock(t,i,kap,"marginal") = q16_supply_livestock.m(i,kap); + oq16_supply_secondary(t,i,ksd,"marginal") = q16_supply_secondary.m(i,ksd); + oq16_supply_residues(t,i,kres,"marginal") = q16_supply_residues.m(i,kres); + oq16_supply_pasture(t,i,"marginal") = q16_supply_pasture.m(i); + oq16_waste_demand(t,i,kall,"marginal") = q16_waste_demand.m(i,kall); + oq16_seed_demand(t,i,kcr,"marginal") = q16_seed_demand.m(i,kcr); + ov_supply(t,i,kall,"level") = vm_supply.l(i,kall); + ov16_dem_waste(t,i,kall,"level") = v16_dem_waste.l(i,kall); + ov_dem_seed(t,i,kall,"level") = vm_dem_seed.l(i,kall); + oq16_supply_crops(t,i,kcr,"level") = q16_supply_crops.l(i,kcr); + oq16_supply_livestock(t,i,kap,"level") = q16_supply_livestock.l(i,kap); + oq16_supply_secondary(t,i,ksd,"level") = q16_supply_secondary.l(i,ksd); + oq16_supply_residues(t,i,kres,"level") = q16_supply_residues.l(i,kres); + oq16_supply_pasture(t,i,"level") = q16_supply_pasture.l(i); + oq16_waste_demand(t,i,kall,"level") = q16_waste_demand.l(i,kall); + oq16_seed_demand(t,i,kcr,"level") = q16_seed_demand.l(i,kcr); + ov_supply(t,i,kall,"upper") = vm_supply.up(i,kall); + ov16_dem_waste(t,i,kall,"upper") = v16_dem_waste.up(i,kall); + ov_dem_seed(t,i,kall,"upper") = vm_dem_seed.up(i,kall); + oq16_supply_crops(t,i,kcr,"upper") = q16_supply_crops.up(i,kcr); + oq16_supply_livestock(t,i,kap,"upper") = q16_supply_livestock.up(i,kap); + oq16_supply_secondary(t,i,ksd,"upper") = q16_supply_secondary.up(i,ksd); + oq16_supply_residues(t,i,kres,"upper") = q16_supply_residues.up(i,kres); + oq16_supply_pasture(t,i,"upper") = q16_supply_pasture.up(i); + oq16_waste_demand(t,i,kall,"upper") = q16_waste_demand.up(i,kall); + oq16_seed_demand(t,i,kcr,"upper") = q16_seed_demand.up(i,kcr); + ov_supply(t,i,kall,"lower") = vm_supply.lo(i,kall); + ov16_dem_waste(t,i,kall,"lower") = v16_dem_waste.lo(i,kall); + ov_dem_seed(t,i,kall,"lower") = vm_dem_seed.lo(i,kall); + oq16_supply_crops(t,i,kcr,"lower") = q16_supply_crops.lo(i,kcr); + oq16_supply_livestock(t,i,kap,"lower") = q16_supply_livestock.lo(i,kap); + oq16_supply_secondary(t,i,ksd,"lower") = q16_supply_secondary.lo(i,ksd); + oq16_supply_residues(t,i,kres,"lower") = q16_supply_residues.lo(i,kres); + oq16_supply_pasture(t,i,"lower") = q16_supply_pasture.lo(i); + oq16_waste_demand(t,i,kall,"lower") = q16_waste_demand.lo(i,kall); + oq16_seed_demand(t,i,kcr,"lower") = q16_seed_demand.lo(i,kcr); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### + diff --git a/modules/16_demand/sector_may15.gms b/modules/16_demand/sector_may15/realization.gms similarity index 73% rename from modules/16_demand/sector_may15.gms rename to modules/16_demand/sector_may15/realization.gms index ad649e36a8..6a9a5726be 100644 --- a/modules/16_demand/sector_may15.gms +++ b/modules/16_demand/sector_may15/realization.gms @@ -1,20 +1,21 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description In the sector_may15 realization, demand is calculated as the sum of -*' demand for all products coming from the modules [62_material], -*' [60_bioenergy], [70_livestock], [15_food] and [17_production]. -*' It also delivers data to the modules [60_bioenergy], [21_trade], [20_processing], -*' [18_residues], [55_awms], [50_nr_soil_budget], [32_forestry], and [53_methane]. - - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/16_demand/sector_may15/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/16_demand/sector_may15/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/16_demand/sector_may15/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/16_demand/sector_may15/equations.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/16_demand/sector_may15/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description In the sector_may15 realization, demand is calculated as the sum of +*' demand for all products coming from the modules [62_material], +*' [60_bioenergy], [70_livestock], [15_food] and [17_production]. +*' It also delivers data to the modules [60_bioenergy], [21_trade], [20_processing], +*' [18_residues], [55_awms], [50_nr_soil_budget], [32_forestry], and [53_methane]. + + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/16_demand/sector_may15/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/16_demand/sector_may15/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/16_demand/sector_may15/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/16_demand/sector_may15/equations.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/16_demand/sector_may15/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/16_demand/sector_may15/sets.gms b/modules/16_demand/sector_may15/sets.gms index 68cced3a8c..ff92c9749c 100644 --- a/modules/16_demand/sector_may15/sets.gms +++ b/modules/16_demand/sector_may15/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets diff --git a/modules/17_production/flexreg_apr16/declarations.gms b/modules/17_production/flexreg_apr16/declarations.gms index ac07a87cfd..2e7b4f3e03 100644 --- a/modules/17_production/flexreg_apr16/declarations.gms +++ b/modules/17_production/flexreg_apr16/declarations.gms @@ -1,23 +1,24 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -positive variables - vm_prod(j,k) Production in each cell (mio. tDM per yr) - vm_prod_reg(i,kall) Regional aggregated production (mio. tDM per yr) -; - -equations - q17_prod_reg(i,k) Regional production (mio. tDM per yr) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_prod(t,j,k,type) Production in each cell (mio. tDM per yr) - ov_prod_reg(t,i,kall,type) Regional aggregated production (mio. tDM per yr) - oq17_prod_reg(t,i,k,type) Regional production (mio. tDM per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### - +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +positive variables + vm_prod(j,k) Production in each cell (mio. tDM per yr) + vm_prod_reg(i,kall) Regional aggregated production (mio. tDM per yr) +; + +equations + q17_prod_reg(i,k) Regional production (mio. tDM per yr) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_prod(t,j,k,type) Production in each cell (mio. tDM per yr) + ov_prod_reg(t,i,kall,type) Regional aggregated production (mio. tDM per yr) + oq17_prod_reg(t,i,k,type) Regional production (mio. tDM per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### + diff --git a/modules/17_production/flexreg_apr16/equations.gms b/modules/17_production/flexreg_apr16/equations.gms index e4c574e468..98e8cbad1d 100644 --- a/modules/17_production/flexreg_apr16/equations.gms +++ b/modules/17_production/flexreg_apr16/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations diff --git a/modules/17_production/flexreg_apr16/postsolve.gms b/modules/17_production/flexreg_apr16/postsolve.gms index 9cca71e74c..a0d0bc3b79 100644 --- a/modules/17_production/flexreg_apr16/postsolve.gms +++ b/modules/17_production/flexreg_apr16/postsolve.gms @@ -1,23 +1,24 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_prod(t,j,k,"marginal") = vm_prod.m(j,k); - ov_prod_reg(t,i,kall,"marginal") = vm_prod_reg.m(i,kall); - oq17_prod_reg(t,i,k,"marginal") = q17_prod_reg.m(i,k); - ov_prod(t,j,k,"level") = vm_prod.l(j,k); - ov_prod_reg(t,i,kall,"level") = vm_prod_reg.l(i,kall); - oq17_prod_reg(t,i,k,"level") = q17_prod_reg.l(i,k); - ov_prod(t,j,k,"upper") = vm_prod.up(j,k); - ov_prod_reg(t,i,kall,"upper") = vm_prod_reg.up(i,kall); - oq17_prod_reg(t,i,k,"upper") = q17_prod_reg.up(i,k); - ov_prod(t,j,k,"lower") = vm_prod.lo(j,k); - ov_prod_reg(t,i,kall,"lower") = vm_prod_reg.lo(i,kall); - oq17_prod_reg(t,i,k,"lower") = q17_prod_reg.lo(i,k); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - +*** | (C) 2008-2019 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 + + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_prod(t,j,k,"marginal") = vm_prod.m(j,k); + ov_prod_reg(t,i,kall,"marginal") = vm_prod_reg.m(i,kall); + oq17_prod_reg(t,i,k,"marginal") = q17_prod_reg.m(i,k); + ov_prod(t,j,k,"level") = vm_prod.l(j,k); + ov_prod_reg(t,i,kall,"level") = vm_prod_reg.l(i,kall); + oq17_prod_reg(t,i,k,"level") = q17_prod_reg.l(i,k); + ov_prod(t,j,k,"upper") = vm_prod.up(j,k); + ov_prod_reg(t,i,kall,"upper") = vm_prod_reg.up(i,kall); + oq17_prod_reg(t,i,k,"upper") = q17_prod_reg.up(i,k); + ov_prod(t,j,k,"lower") = vm_prod.lo(j,k); + ov_prod_reg(t,i,kall,"lower") = vm_prod_reg.lo(i,kall); + oq17_prod_reg(t,i,k,"lower") = q17_prod_reg.lo(i,k); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### + diff --git a/modules/17_production/flexreg_apr16.gms b/modules/17_production/flexreg_apr16/realization.gms similarity index 72% rename from modules/17_production/flexreg_apr16.gms rename to modules/17_production/flexreg_apr16/realization.gms index 0123ddf050..11cd1fc160 100644 --- a/modules/17_production/flexreg_apr16.gms +++ b/modules/17_production/flexreg_apr16/realization.gms @@ -1,20 +1,21 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description This realization aggregates agricultural production from -*' cluster level `j` to regional level `i`. Currently, cluster level production -*' is available only for plant commodities, i.e for crops and pastures. -*' Cluster level production of different crops and pasture is calculated in -*' module [30_crop] and [31_past] respectively. - -*' @limitations For the time being, this approach is not applied to livestock -*' products. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "declarations" $include "./modules/17_production/flexreg_apr16/declarations.gms" -$Ifi "%phase%" == "equations" $include "./modules/17_production/flexreg_apr16/equations.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/17_production/flexreg_apr16/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description This realization aggregates agricultural production from +*' cluster level `j` to regional level `i`. Currently, cluster level production +*' is available only for plant commodities, i.e for crops and pastures. +*' Cluster level production of different crops and pasture is calculated in +*' module [30_crop] and [31_past] respectively. + +*' @limitations For the time being, this approach is not applied to livestock +*' products. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "declarations" $include "./modules/17_production/flexreg_apr16/declarations.gms" +$Ifi "%phase%" == "equations" $include "./modules/17_production/flexreg_apr16/equations.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/17_production/flexreg_apr16/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/17_production/17_production.gms b/modules/17_production/module.gms similarity index 53% rename from modules/17_production/17_production.gms rename to modules/17_production/module.gms index f3bbfc565f..8835abf9b9 100644 --- a/modules/17_production/17_production.gms +++ b/modules/17_production/module.gms @@ -1,16 +1,17 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Production - -*' @description The production module calculates regional production of -*' MAgPIE commodities from cluster level production data. - -*' @authors Benjamin Leon Bodirsky - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%production%" == "flexreg_apr16" $include "./modules/17_production/flexreg_apr16.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Production + +*' @description The production module calculates regional production of +*' MAgPIE commodities from cluster level production data. + +*' @authors Benjamin Leon Bodirsky + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%production%" == "flexreg_apr16" $include "./modules/17_production/flexreg_apr16/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/18_residues/flexreg_apr16/declarations.gms b/modules/18_residues/flexreg_apr16/declarations.gms index bd9f77faf0..275fc91cba 100644 --- a/modules/18_residues/flexreg_apr16/declarations.gms +++ b/modules/18_residues/flexreg_apr16/declarations.gms @@ -1,55 +1,56 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -positive variables - vm_res_biomass_ag(i,kcr,attributes) Production of aboveground residues in each region (mio. tDM) - vm_res_biomass_bg(i,kcr,dm_nr) Production of belowground residues in each region (mio. tDM) - v18_res_ag_removal(i,kcr,attributes) Removal of crop residues in respective attribute units DM GJ Nr P K WM C (mio. tX) - v18_res_ag_recycling(i,kcr,attributes) Recylcing of crop residues to soils in respective attribute units DM GJ Nr P K WM C (mio. tX) - v18_res_ag_burn(i,kcr,attributes) Residues burned on fields in respective attribute units DM GJ Nr P K WM C (mio. tX) - vm_res_recycling(i,npk) Residues recycled to croplands in respective nutrients Nr P K units (mio. tX) -; - -equations - - q18_prod_res_ag_reg(i,kcr,attributes) Production constraint of aboveground residues (mio. tDM) - q18_prod_res_bg_reg(i,kcr,dm_nr) Production constraint of belowground residues (mio. tDM) - - q18_res_field_balance(i,kcr,attributes) Calculation of the residues amount recycled to soils (mio. tDM) - q18_res_field_burn(i,kcr,attributes) Fixing of the residues amount burned in a region in respective attribute units DM GJ Nr P K WM C (mio. tX) - q18_translate(i,kres,attributes) Transformation of the multiple crop residues into supply balance crop redisues in respective attribute units DM GJ Nr P K WM C (mio. tX) - - q18_res_recycling_nr(i) Nutrient recycling of reaactive nitrogen (mio. tNr) - q18_res_recycling_pk(i,pk18) Nutrient recycling of phosphorus and potash (mio. tX) - q18_cost_prod_res(i,kres) Production costs of harvesting crop residues (mio. USD05MER) - -; - -parameters - i18_res_use_burn(t_all,dev18,kcr) Share of residues burned on field (1) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_res_biomass_ag(t,i,kcr,attributes,type) Production of aboveground residues in each region (mio. tDM) - ov_res_biomass_bg(t,i,kcr,dm_nr,type) Production of belowground residues in each region (mio. tDM) - ov18_res_ag_removal(t,i,kcr,attributes,type) Removal of crop residues in respective attribute units DM GJ Nr P K WM C (mio. tX) - ov18_res_ag_recycling(t,i,kcr,attributes,type) Recylcing of crop residues to soils in respective attribute units DM GJ Nr P K WM C (mio. tX) - ov18_res_ag_burn(t,i,kcr,attributes,type) Residues burned on fields in respective attribute units DM GJ Nr P K WM C (mio. tX) - ov_res_recycling(t,i,npk,type) Residues recycled to croplands in respective nutrients Nr P K units (mio. tX) - oq18_prod_res_ag_reg(t,i,kcr,attributes,type) Production constraint of aboveground residues (mio. tDM) - oq18_prod_res_bg_reg(t,i,kcr,dm_nr,type) Production constraint of belowground residues (mio. tDM) - oq18_res_field_balance(t,i,kcr,attributes,type) Calculation of the residues amount recycled to soils (mio. tDM) - oq18_res_field_burn(t,i,kcr,attributes,type) Fixing of the residues amount burned in a region in respective attribute units DM GJ Nr P K WM C (mio. tX) - oq18_translate(t,i,kres,attributes,type) Transformation of the multiple crop residues into supply balance crop redisues in respective attribute units DM GJ Nr P K WM C (mio. tX) - oq18_res_recycling_nr(t,i,type) Nutrient recycling of reaactive nitrogen (mio. tNr) - oq18_res_recycling_pk(t,i,pk18,type) Nutrient recycling of phosphorus and potash (mio. tX) - oq18_cost_prod_res(t,i,kres,type) Production costs of harvesting crop residues (mio. USD05MER) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### - -*** EOF declarations.gms *** +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + +positive variables + vm_res_biomass_ag(i,kcr,attributes) Production of aboveground residues in each region (mio. tDM) + vm_res_biomass_bg(i,kcr,dm_nr) Production of belowground residues in each region (mio. tDM) + v18_res_ag_removal(i,kcr,attributes) Removal of crop residues in respective attribute units DM GJ Nr P K WM C (mio. tX) + v18_res_ag_recycling(i,kcr,attributes) Recylcing of crop residues to soils in respective attribute units DM GJ Nr P K WM C (mio. tX) + v18_res_ag_burn(i,kcr,attributes) Residues burned on fields in respective attribute units DM GJ Nr P K WM C (mio. tX) + vm_res_recycling(i,npk) Residues recycled to croplands in respective nutrients Nr P K units (mio. tX) +; + +equations + + q18_prod_res_ag_reg(i,kcr,attributes) Production constraint of aboveground residues (mio. tDM) + q18_prod_res_bg_reg(i,kcr,dm_nr) Production constraint of belowground residues (mio. tDM) + + q18_res_field_balance(i,kcr,attributes) Calculation of the residues amount recycled to soils (mio. tDM) + q18_res_field_burn(i,kcr,attributes) Fixing of the residues amount burned in a region in respective attribute units DM GJ Nr P K WM C (mio. tX) + q18_translate(i,kres,attributes) Transformation of the multiple crop residues into supply balance crop redisues in respective attribute units DM GJ Nr P K WM C (mio. tX) + + q18_res_recycling_nr(i) Nutrient recycling of reaactive nitrogen (mio. tNr) + q18_res_recycling_pk(i,pk18) Nutrient recycling of phosphorus and potash (mio. tX) + q18_cost_prod_res(i,kres) Production costs of harvesting crop residues (mio. USD05MER) + +; + +parameters + i18_res_use_burn(t_all,dev18,kcr) Share of residues burned on field (1) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_res_biomass_ag(t,i,kcr,attributes,type) Production of aboveground residues in each region (mio. tDM) + ov_res_biomass_bg(t,i,kcr,dm_nr,type) Production of belowground residues in each region (mio. tDM) + ov18_res_ag_removal(t,i,kcr,attributes,type) Removal of crop residues in respective attribute units DM GJ Nr P K WM C (mio. tX) + ov18_res_ag_recycling(t,i,kcr,attributes,type) Recylcing of crop residues to soils in respective attribute units DM GJ Nr P K WM C (mio. tX) + ov18_res_ag_burn(t,i,kcr,attributes,type) Residues burned on fields in respective attribute units DM GJ Nr P K WM C (mio. tX) + ov_res_recycling(t,i,npk,type) Residues recycled to croplands in respective nutrients Nr P K units (mio. tX) + oq18_prod_res_ag_reg(t,i,kcr,attributes,type) Production constraint of aboveground residues (mio. tDM) + oq18_prod_res_bg_reg(t,i,kcr,dm_nr,type) Production constraint of belowground residues (mio. tDM) + oq18_res_field_balance(t,i,kcr,attributes,type) Calculation of the residues amount recycled to soils (mio. tDM) + oq18_res_field_burn(t,i,kcr,attributes,type) Fixing of the residues amount burned in a region in respective attribute units DM GJ Nr P K WM C (mio. tX) + oq18_translate(t,i,kres,attributes,type) Transformation of the multiple crop residues into supply balance crop redisues in respective attribute units DM GJ Nr P K WM C (mio. tX) + oq18_res_recycling_nr(t,i,type) Nutrient recycling of reaactive nitrogen (mio. tNr) + oq18_res_recycling_pk(t,i,pk18,type) Nutrient recycling of phosphorus and potash (mio. tX) + oq18_cost_prod_res(t,i,kres,type) Production costs of harvesting crop residues (mio. USD05MER) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### + +*** EOF declarations.gms *** diff --git a/modules/18_residues/flexreg_apr16/equations.gms b/modules/18_residues/flexreg_apr16/equations.gms index 2e8cd327b1..041f621168 100644 --- a/modules/18_residues/flexreg_apr16/equations.gms +++ b/modules/18_residues/flexreg_apr16/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations diff --git a/modules/18_residues/flexreg_apr16/input.gms b/modules/18_residues/flexreg_apr16/input.gms index 3aa7c1ef98..2381bbd576 100644 --- a/modules/18_residues/flexreg_apr16/input.gms +++ b/modules/18_residues/flexreg_apr16/input.gms @@ -1,50 +1,51 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -$setglobal c18_burn_scen phaseout -* options: phaseout,constant - -table f18_multicropping(t_all,i) Multicropping indicator as ratio of area harvested by physical area (1) -$ondelim -$include "./modules/18_residues/input/f18_multicropping.csv" -$offdelim; - -table f18_attributes_residue_ag(attributes,kve) Nutrient content of aboveground crop residues in respective attribute units DM GJ Nr P K WM C (X per DM) -$ondelim -$include "./modules/18_residues/input/f18_attributes_residue_ag.csv" -$offdelim; - - -table f18_attributes_residue_bg(dm_nr,kve) Nutrient content of belowground crop residues in reactive nitorgen and carbon units Nr C (X per DM) -$ondelim -$include "./modules/18_residues/input/f18_attributes_residue_bg.csv" -$offdelim; - -table f18_cgf(cgf,kve) Crop growth functions for all vegetation types containing slope intercept and belowground to aboveground ratio (1) -$ondelim -$include "./modules/18_residues/flexreg_apr16/input/f18_cgf.csv" -$offdelim; - -table f18_res_use_burn(t_all,burn_scen18,dev18,kcr) Minimum and maximum burn share use for residues developing over time (1) -$ondelim -$include "./modules/18_residues/flexreg_apr16/input/f18_res_use_burn.cs3" -$offdelim; - -parameter f18_res_combust_eff(kve) Combustion efficiency of residue burning (1) -/ -$ondelim -$include "./modules/18_residues/input/f18_res_combust_eff.cs4" -$offdelim -/; - -parameter f18_fac_req_kres(kres) Factor requirements (USD05MER per tDM) -/ -$ondelim -$include "./modules/18_residues/flexreg_apr16/input/f18_fac_req_kres.csv" -$offdelim -/; - -*** EOF input.gms *** +*** | (C) 2008-2019 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 + +$setglobal c18_burn_scen phaseout +* options: phaseout,constant + +table f18_multicropping(t_all,i) Multicropping indicator as ratio of area harvested by physical area (1) +$ondelim +$include "./modules/18_residues/input/f18_multicropping.csv" +$offdelim; + +table f18_attributes_residue_ag(attributes,kve) Nutrient content of aboveground crop residues in respective attribute units DM GJ Nr P K WM C (X per DM) +$ondelim +$include "./modules/18_residues/input/f18_attributes_residue_ag.csv" +$offdelim; + + +table f18_attributes_residue_bg(dm_nr,kve) Nutrient content of belowground crop residues in reactive nitorgen and carbon units Nr C (X per DM) +$ondelim +$include "./modules/18_residues/input/f18_attributes_residue_bg.csv" +$offdelim; + +table f18_cgf(cgf,kve) Crop growth functions for all vegetation types containing slope intercept and belowground to aboveground ratio (1) +$ondelim +$include "./modules/18_residues/flexreg_apr16/input/f18_cgf.csv" +$offdelim; + +table f18_res_use_burn(t_all,burn_scen18,dev18,kcr) Minimum and maximum burn share use for residues developing over time (1) +$ondelim +$include "./modules/18_residues/flexreg_apr16/input/f18_res_use_burn.cs3" +$offdelim; + +parameter f18_res_combust_eff(kve) Combustion efficiency of residue burning (1) +/ +$ondelim +$include "./modules/18_residues/input/f18_res_combust_eff.cs4" +$offdelim +/; + +parameter f18_fac_req_kres(kres) Factor requirements (USD05MER per tDM) +/ +$ondelim +$include "./modules/18_residues/flexreg_apr16/input/f18_fac_req_kres.csv" +$offdelim +/; + +*** EOF input.gms *** diff --git a/modules/18_residues/flexreg_apr16/not_used.txt b/modules/18_residues/flexreg_apr16/not_used.txt index 6ece3f27a1..4b81dfbae2 100644 --- a/modules/18_residues/flexreg_apr16/not_used.txt +++ b/modules/18_residues/flexreg_apr16/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason diff --git a/modules/18_residues/flexreg_apr16/postsolve.gms b/modules/18_residues/flexreg_apr16/postsolve.gms index 635d5ee31d..ea6e2d5a42 100644 --- a/modules/18_residues/flexreg_apr16/postsolve.gms +++ b/modules/18_residues/flexreg_apr16/postsolve.gms @@ -1,69 +1,70 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -****** Residues - -*** EOF postsolve.gms *** - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_res_biomass_ag(t,i,kcr,attributes,"marginal") = vm_res_biomass_ag.m(i,kcr,attributes); - ov_res_biomass_bg(t,i,kcr,dm_nr,"marginal") = vm_res_biomass_bg.m(i,kcr,dm_nr); - ov18_res_ag_removal(t,i,kcr,attributes,"marginal") = v18_res_ag_removal.m(i,kcr,attributes); - ov18_res_ag_recycling(t,i,kcr,attributes,"marginal") = v18_res_ag_recycling.m(i,kcr,attributes); - ov18_res_ag_burn(t,i,kcr,attributes,"marginal") = v18_res_ag_burn.m(i,kcr,attributes); - ov_res_recycling(t,i,npk,"marginal") = vm_res_recycling.m(i,npk); - oq18_prod_res_ag_reg(t,i,kcr,attributes,"marginal") = q18_prod_res_ag_reg.m(i,kcr,attributes); - oq18_prod_res_bg_reg(t,i,kcr,dm_nr,"marginal") = q18_prod_res_bg_reg.m(i,kcr,dm_nr); - oq18_res_field_balance(t,i,kcr,attributes,"marginal") = q18_res_field_balance.m(i,kcr,attributes); - oq18_res_field_burn(t,i,kcr,attributes,"marginal") = q18_res_field_burn.m(i,kcr,attributes); - oq18_translate(t,i,kres,attributes,"marginal") = q18_translate.m(i,kres,attributes); - oq18_res_recycling_nr(t,i,"marginal") = q18_res_recycling_nr.m(i); - oq18_res_recycling_pk(t,i,pk18,"marginal") = q18_res_recycling_pk.m(i,pk18); - oq18_cost_prod_res(t,i,kres,"marginal") = q18_cost_prod_res.m(i,kres); - ov_res_biomass_ag(t,i,kcr,attributes,"level") = vm_res_biomass_ag.l(i,kcr,attributes); - ov_res_biomass_bg(t,i,kcr,dm_nr,"level") = vm_res_biomass_bg.l(i,kcr,dm_nr); - ov18_res_ag_removal(t,i,kcr,attributes,"level") = v18_res_ag_removal.l(i,kcr,attributes); - ov18_res_ag_recycling(t,i,kcr,attributes,"level") = v18_res_ag_recycling.l(i,kcr,attributes); - ov18_res_ag_burn(t,i,kcr,attributes,"level") = v18_res_ag_burn.l(i,kcr,attributes); - ov_res_recycling(t,i,npk,"level") = vm_res_recycling.l(i,npk); - oq18_prod_res_ag_reg(t,i,kcr,attributes,"level") = q18_prod_res_ag_reg.l(i,kcr,attributes); - oq18_prod_res_bg_reg(t,i,kcr,dm_nr,"level") = q18_prod_res_bg_reg.l(i,kcr,dm_nr); - oq18_res_field_balance(t,i,kcr,attributes,"level") = q18_res_field_balance.l(i,kcr,attributes); - oq18_res_field_burn(t,i,kcr,attributes,"level") = q18_res_field_burn.l(i,kcr,attributes); - oq18_translate(t,i,kres,attributes,"level") = q18_translate.l(i,kres,attributes); - oq18_res_recycling_nr(t,i,"level") = q18_res_recycling_nr.l(i); - oq18_res_recycling_pk(t,i,pk18,"level") = q18_res_recycling_pk.l(i,pk18); - oq18_cost_prod_res(t,i,kres,"level") = q18_cost_prod_res.l(i,kres); - ov_res_biomass_ag(t,i,kcr,attributes,"upper") = vm_res_biomass_ag.up(i,kcr,attributes); - ov_res_biomass_bg(t,i,kcr,dm_nr,"upper") = vm_res_biomass_bg.up(i,kcr,dm_nr); - ov18_res_ag_removal(t,i,kcr,attributes,"upper") = v18_res_ag_removal.up(i,kcr,attributes); - ov18_res_ag_recycling(t,i,kcr,attributes,"upper") = v18_res_ag_recycling.up(i,kcr,attributes); - ov18_res_ag_burn(t,i,kcr,attributes,"upper") = v18_res_ag_burn.up(i,kcr,attributes); - ov_res_recycling(t,i,npk,"upper") = vm_res_recycling.up(i,npk); - oq18_prod_res_ag_reg(t,i,kcr,attributes,"upper") = q18_prod_res_ag_reg.up(i,kcr,attributes); - oq18_prod_res_bg_reg(t,i,kcr,dm_nr,"upper") = q18_prod_res_bg_reg.up(i,kcr,dm_nr); - oq18_res_field_balance(t,i,kcr,attributes,"upper") = q18_res_field_balance.up(i,kcr,attributes); - oq18_res_field_burn(t,i,kcr,attributes,"upper") = q18_res_field_burn.up(i,kcr,attributes); - oq18_translate(t,i,kres,attributes,"upper") = q18_translate.up(i,kres,attributes); - oq18_res_recycling_nr(t,i,"upper") = q18_res_recycling_nr.up(i); - oq18_res_recycling_pk(t,i,pk18,"upper") = q18_res_recycling_pk.up(i,pk18); - oq18_cost_prod_res(t,i,kres,"upper") = q18_cost_prod_res.up(i,kres); - ov_res_biomass_ag(t,i,kcr,attributes,"lower") = vm_res_biomass_ag.lo(i,kcr,attributes); - ov_res_biomass_bg(t,i,kcr,dm_nr,"lower") = vm_res_biomass_bg.lo(i,kcr,dm_nr); - ov18_res_ag_removal(t,i,kcr,attributes,"lower") = v18_res_ag_removal.lo(i,kcr,attributes); - ov18_res_ag_recycling(t,i,kcr,attributes,"lower") = v18_res_ag_recycling.lo(i,kcr,attributes); - ov18_res_ag_burn(t,i,kcr,attributes,"lower") = v18_res_ag_burn.lo(i,kcr,attributes); - ov_res_recycling(t,i,npk,"lower") = vm_res_recycling.lo(i,npk); - oq18_prod_res_ag_reg(t,i,kcr,attributes,"lower") = q18_prod_res_ag_reg.lo(i,kcr,attributes); - oq18_prod_res_bg_reg(t,i,kcr,dm_nr,"lower") = q18_prod_res_bg_reg.lo(i,kcr,dm_nr); - oq18_res_field_balance(t,i,kcr,attributes,"lower") = q18_res_field_balance.lo(i,kcr,attributes); - oq18_res_field_burn(t,i,kcr,attributes,"lower") = q18_res_field_burn.lo(i,kcr,attributes); - oq18_translate(t,i,kres,attributes,"lower") = q18_translate.lo(i,kres,attributes); - oq18_res_recycling_nr(t,i,"lower") = q18_res_recycling_nr.lo(i); - oq18_res_recycling_pk(t,i,pk18,"lower") = q18_res_recycling_pk.lo(i,pk18); - oq18_cost_prod_res(t,i,kres,"lower") = q18_cost_prod_res.lo(i,kres); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - +*** | (C) 2008-2019 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 + +****** Residues + +*** EOF postsolve.gms *** + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_res_biomass_ag(t,i,kcr,attributes,"marginal") = vm_res_biomass_ag.m(i,kcr,attributes); + ov_res_biomass_bg(t,i,kcr,dm_nr,"marginal") = vm_res_biomass_bg.m(i,kcr,dm_nr); + ov18_res_ag_removal(t,i,kcr,attributes,"marginal") = v18_res_ag_removal.m(i,kcr,attributes); + ov18_res_ag_recycling(t,i,kcr,attributes,"marginal") = v18_res_ag_recycling.m(i,kcr,attributes); + ov18_res_ag_burn(t,i,kcr,attributes,"marginal") = v18_res_ag_burn.m(i,kcr,attributes); + ov_res_recycling(t,i,npk,"marginal") = vm_res_recycling.m(i,npk); + oq18_prod_res_ag_reg(t,i,kcr,attributes,"marginal") = q18_prod_res_ag_reg.m(i,kcr,attributes); + oq18_prod_res_bg_reg(t,i,kcr,dm_nr,"marginal") = q18_prod_res_bg_reg.m(i,kcr,dm_nr); + oq18_res_field_balance(t,i,kcr,attributes,"marginal") = q18_res_field_balance.m(i,kcr,attributes); + oq18_res_field_burn(t,i,kcr,attributes,"marginal") = q18_res_field_burn.m(i,kcr,attributes); + oq18_translate(t,i,kres,attributes,"marginal") = q18_translate.m(i,kres,attributes); + oq18_res_recycling_nr(t,i,"marginal") = q18_res_recycling_nr.m(i); + oq18_res_recycling_pk(t,i,pk18,"marginal") = q18_res_recycling_pk.m(i,pk18); + oq18_cost_prod_res(t,i,kres,"marginal") = q18_cost_prod_res.m(i,kres); + ov_res_biomass_ag(t,i,kcr,attributes,"level") = vm_res_biomass_ag.l(i,kcr,attributes); + ov_res_biomass_bg(t,i,kcr,dm_nr,"level") = vm_res_biomass_bg.l(i,kcr,dm_nr); + ov18_res_ag_removal(t,i,kcr,attributes,"level") = v18_res_ag_removal.l(i,kcr,attributes); + ov18_res_ag_recycling(t,i,kcr,attributes,"level") = v18_res_ag_recycling.l(i,kcr,attributes); + ov18_res_ag_burn(t,i,kcr,attributes,"level") = v18_res_ag_burn.l(i,kcr,attributes); + ov_res_recycling(t,i,npk,"level") = vm_res_recycling.l(i,npk); + oq18_prod_res_ag_reg(t,i,kcr,attributes,"level") = q18_prod_res_ag_reg.l(i,kcr,attributes); + oq18_prod_res_bg_reg(t,i,kcr,dm_nr,"level") = q18_prod_res_bg_reg.l(i,kcr,dm_nr); + oq18_res_field_balance(t,i,kcr,attributes,"level") = q18_res_field_balance.l(i,kcr,attributes); + oq18_res_field_burn(t,i,kcr,attributes,"level") = q18_res_field_burn.l(i,kcr,attributes); + oq18_translate(t,i,kres,attributes,"level") = q18_translate.l(i,kres,attributes); + oq18_res_recycling_nr(t,i,"level") = q18_res_recycling_nr.l(i); + oq18_res_recycling_pk(t,i,pk18,"level") = q18_res_recycling_pk.l(i,pk18); + oq18_cost_prod_res(t,i,kres,"level") = q18_cost_prod_res.l(i,kres); + ov_res_biomass_ag(t,i,kcr,attributes,"upper") = vm_res_biomass_ag.up(i,kcr,attributes); + ov_res_biomass_bg(t,i,kcr,dm_nr,"upper") = vm_res_biomass_bg.up(i,kcr,dm_nr); + ov18_res_ag_removal(t,i,kcr,attributes,"upper") = v18_res_ag_removal.up(i,kcr,attributes); + ov18_res_ag_recycling(t,i,kcr,attributes,"upper") = v18_res_ag_recycling.up(i,kcr,attributes); + ov18_res_ag_burn(t,i,kcr,attributes,"upper") = v18_res_ag_burn.up(i,kcr,attributes); + ov_res_recycling(t,i,npk,"upper") = vm_res_recycling.up(i,npk); + oq18_prod_res_ag_reg(t,i,kcr,attributes,"upper") = q18_prod_res_ag_reg.up(i,kcr,attributes); + oq18_prod_res_bg_reg(t,i,kcr,dm_nr,"upper") = q18_prod_res_bg_reg.up(i,kcr,dm_nr); + oq18_res_field_balance(t,i,kcr,attributes,"upper") = q18_res_field_balance.up(i,kcr,attributes); + oq18_res_field_burn(t,i,kcr,attributes,"upper") = q18_res_field_burn.up(i,kcr,attributes); + oq18_translate(t,i,kres,attributes,"upper") = q18_translate.up(i,kres,attributes); + oq18_res_recycling_nr(t,i,"upper") = q18_res_recycling_nr.up(i); + oq18_res_recycling_pk(t,i,pk18,"upper") = q18_res_recycling_pk.up(i,pk18); + oq18_cost_prod_res(t,i,kres,"upper") = q18_cost_prod_res.up(i,kres); + ov_res_biomass_ag(t,i,kcr,attributes,"lower") = vm_res_biomass_ag.lo(i,kcr,attributes); + ov_res_biomass_bg(t,i,kcr,dm_nr,"lower") = vm_res_biomass_bg.lo(i,kcr,dm_nr); + ov18_res_ag_removal(t,i,kcr,attributes,"lower") = v18_res_ag_removal.lo(i,kcr,attributes); + ov18_res_ag_recycling(t,i,kcr,attributes,"lower") = v18_res_ag_recycling.lo(i,kcr,attributes); + ov18_res_ag_burn(t,i,kcr,attributes,"lower") = v18_res_ag_burn.lo(i,kcr,attributes); + ov_res_recycling(t,i,npk,"lower") = vm_res_recycling.lo(i,npk); + oq18_prod_res_ag_reg(t,i,kcr,attributes,"lower") = q18_prod_res_ag_reg.lo(i,kcr,attributes); + oq18_prod_res_bg_reg(t,i,kcr,dm_nr,"lower") = q18_prod_res_bg_reg.lo(i,kcr,dm_nr); + oq18_res_field_balance(t,i,kcr,attributes,"lower") = q18_res_field_balance.lo(i,kcr,attributes); + oq18_res_field_burn(t,i,kcr,attributes,"lower") = q18_res_field_burn.lo(i,kcr,attributes); + oq18_translate(t,i,kres,attributes,"lower") = q18_translate.lo(i,kres,attributes); + oq18_res_recycling_nr(t,i,"lower") = q18_res_recycling_nr.lo(i); + oq18_res_recycling_pk(t,i,pk18,"lower") = q18_res_recycling_pk.lo(i,pk18); + oq18_cost_prod_res(t,i,kres,"lower") = q18_cost_prod_res.lo(i,kres); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### + diff --git a/modules/18_residues/flexreg_apr16/preloop.gms b/modules/18_residues/flexreg_apr16/preloop.gms index 6c4b3e4b3d..ffaf91aea6 100644 --- a/modules/18_residues/flexreg_apr16/preloop.gms +++ b/modules/18_residues/flexreg_apr16/preloop.gms @@ -1,8 +1,9 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 -i18_res_use_burn(t_all,dev18,kcr) = f18_res_use_burn(t_all,"%c18_burn_scen%",dev18,kcr); \ No newline at end of file +i18_res_use_burn(t_all,dev18,kcr) = f18_res_use_burn(t_all,"%c18_burn_scen%",dev18,kcr); diff --git a/modules/18_residues/flexreg_apr16/presolve.gms b/modules/18_residues/flexreg_apr16/presolve.gms index e18ece85e0..1a47403076 100644 --- a/modules/18_residues/flexreg_apr16/presolve.gms +++ b/modules/18_residues/flexreg_apr16/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 v18_res_ag_removal.fx(i,nonused18,attributes)=0; diff --git a/modules/18_residues/flexreg_apr16.gms b/modules/18_residues/flexreg_apr16/realization.gms similarity index 85% rename from modules/18_residues/flexreg_apr16.gms rename to modules/18_residues/flexreg_apr16/realization.gms index 97422c548a..76bf33b67e 100644 --- a/modules/18_residues/flexreg_apr16.gms +++ b/modules/18_residues/flexreg_apr16/realization.gms @@ -1,35 +1,36 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description As official global statistics exist only for crop production and not for crop -*' residue production, the biomass of residues is obtained in MAgPIE by using -*' crop-type specific plant growth functions based on crop production and area harvested. -*' Plant biomass is divided into three components: the harvested organ as listed -*' in FAO, the aboveground (AG) and the belowground (BG) residues. -*' -*' @ipcc_2006_2006 offers one of the few consistent datasets to estimate -*' both AG and BG residues. Also, by providing crop-growth functions (CGF, `f18_cgf`) -*' instead of fixed harvest indices, it can be used to depict current -*' international differences of harvest indices and their development in the future. -*' The methodology is thus well eligible for global long-term modelling. -*' @ipcc_2006_2006 provides linear CGFs with positive slope and intercept -*' for cereals, leguminous crops, potatoes and grasses. As no values are -*' available for the oilcrops rapeseed, sunflower, oilpalms as well as -*' sugar crops, tropical roots, cotton and others, we use fixed harvest-indices -*' (positive slope without intercept) for these crops based -*' on @wirsenius_human_2000, @lal_world_2005 and @feller_dungung_2007. If different CGFs are available -*' for crops within a crop group, we build a weighted average based on the -*' production in 1995. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/18_residues/flexreg_apr16/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/18_residues/flexreg_apr16/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/18_residues/flexreg_apr16/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/18_residues/flexreg_apr16/equations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/18_residues/flexreg_apr16/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/18_residues/flexreg_apr16/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/18_residues/flexreg_apr16/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description As official global statistics exist only for crop production and not for crop +*' residue production, the biomass of residues is obtained in MAgPIE by using +*' crop-type specific plant growth functions based on crop production and area harvested. +*' Plant biomass is divided into three components: the harvested organ as listed +*' in FAO, the aboveground (AG) and the belowground (BG) residues. +*' +*' @ipcc_2006_2006 offers one of the few consistent datasets to estimate +*' both AG and BG residues. Also, by providing crop-growth functions (CGF, `f18_cgf`) +*' instead of fixed harvest indices, it can be used to depict current +*' international differences of harvest indices and their development in the future. +*' The methodology is thus well eligible for global long-term modelling. +*' @ipcc_2006_2006 provides linear CGFs with positive slope and intercept +*' for cereals, leguminous crops, potatoes and grasses. As no values are +*' available for the oilcrops rapeseed, sunflower, oilpalms as well as +*' sugar crops, tropical roots, cotton and others, we use fixed harvest-indices +*' (positive slope without intercept) for these crops based +*' on @wirsenius_human_2000, @lal_world_2005 and @feller_dungung_2007. If different CGFs are available +*' for crops within a crop group, we build a weighted average based on the +*' production in 1995. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/18_residues/flexreg_apr16/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/18_residues/flexreg_apr16/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/18_residues/flexreg_apr16/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/18_residues/flexreg_apr16/equations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/18_residues/flexreg_apr16/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/18_residues/flexreg_apr16/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/18_residues/flexreg_apr16/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/18_residues/flexreg_apr16/sets.gms b/modules/18_residues/flexreg_apr16/sets.gms index e6c30bb64a..fddae7e9ad 100644 --- a/modules/18_residues/flexreg_apr16/sets.gms +++ b/modules/18_residues/flexreg_apr16/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/18_residues/18_residues.gms b/modules/18_residues/module.gms similarity index 59% rename from modules/18_residues/18_residues.gms rename to modules/18_residues/module.gms index 9148b41a6c..a374b00d12 100644 --- a/modules/18_residues/18_residues.gms +++ b/modules/18_residues/module.gms @@ -1,23 +1,24 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Residues -*' -*' @description The residues module calculates the production of crop residues -*' (straw etc.) and its subsequent use. Residues can be burned, used for feed, -*' recycled to soils or used for other purposes (construction, fuel etc). -*' -*' The module also calculates the costs of crop residue harvest when it is used -*' for feed or material purposes. - -*' @authors Benjamin Leon Bodirsky - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%residues%" == "flexreg_apr16" $include "./modules/18_residues/flexreg_apr16.gms" -$Ifi "%residues%" == "off" $include "./modules/18_residues/off.gms" -*###################### R SECTION END (MODULETYPES) ############################ - -*** EOF residues.gms *** +*** | (C) 2008-2019 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 + +*' @title Residues +*' +*' @description The residues module calculates the production of crop residues +*' (straw etc.) and its subsequent use. Residues can be burned, used for feed, +*' recycled to soils or used for other purposes (construction, fuel etc). +*' +*' The module also calculates the costs of crop residue harvest when it is used +*' for feed or material purposes. + +*' @authors Benjamin Leon Bodirsky + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%residues%" == "flexreg_apr16" $include "./modules/18_residues/flexreg_apr16/realization.gms" +$Ifi "%residues%" == "off" $include "./modules/18_residues/off/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ + +*** EOF residues.gms *** diff --git a/modules/18_residues/off/declarations.gms b/modules/18_residues/off/declarations.gms index ca74e8d460..300df17e9f 100644 --- a/modules/18_residues/off/declarations.gms +++ b/modules/18_residues/off/declarations.gms @@ -1,23 +1,24 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -positive variables - vm_res_biomass_ag(i,kcr,attributes) production of aboveground residues in each region (mio. tDM) - vm_res_biomass_bg(i,kcr,dm_nr) production of belowground residues in each region (mio. tDM) - vm_res_recycling(i,npk) residues recycled to croplands (mio tons nutrients) -; - - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_res_biomass_ag(t,i,kcr,attributes,type) production of aboveground residues in each region (mio. tDM) - ov_res_biomass_bg(t,i,kcr,dm_nr,type) production of belowground residues in each region (mio. tDM) - ov_res_recycling(t,i,npk,type) residues recycled to croplands (mio tons nutrients) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### - -*** EOF declarations.gms *** +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + +positive variables + vm_res_biomass_ag(i,kcr,attributes) production of aboveground residues in each region (mio. tDM) + vm_res_biomass_bg(i,kcr,dm_nr) production of belowground residues in each region (mio. tDM) + vm_res_recycling(i,npk) residues recycled to croplands (mio tons nutrients) +; + + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_res_biomass_ag(t,i,kcr,attributes,type) production of aboveground residues in each region (mio. tDM) + ov_res_biomass_bg(t,i,kcr,dm_nr,type) production of belowground residues in each region (mio. tDM) + ov_res_recycling(t,i,npk,type) residues recycled to croplands (mio tons nutrients) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### + +*** EOF declarations.gms *** diff --git a/modules/18_residues/off/not_used.txt b/modules/18_residues/off/not_used.txt index cdae5d3179..a61cfad5bb 100644 --- a/modules/18_residues/off/not_used.txt +++ b/modules/18_residues/off/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason diff --git a/modules/18_residues/off/postsolve.gms b/modules/18_residues/off/postsolve.gms index b27081bab3..d956294c3c 100644 --- a/modules/18_residues/off/postsolve.gms +++ b/modules/18_residues/off/postsolve.gms @@ -1,20 +1,21 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_res_biomass_ag(t,i,kcr,attributes,"marginal") = vm_res_biomass_ag.m(i,kcr,attributes); - ov_res_biomass_bg(t,i,kcr,dm_nr,"marginal") = vm_res_biomass_bg.m(i,kcr,dm_nr); - ov_res_recycling(t,i,npk,"marginal") = vm_res_recycling.m(i,npk); - ov_res_biomass_ag(t,i,kcr,attributes,"level") = vm_res_biomass_ag.l(i,kcr,attributes); - ov_res_biomass_bg(t,i,kcr,dm_nr,"level") = vm_res_biomass_bg.l(i,kcr,dm_nr); - ov_res_recycling(t,i,npk,"level") = vm_res_recycling.l(i,npk); - ov_res_biomass_ag(t,i,kcr,attributes,"upper") = vm_res_biomass_ag.up(i,kcr,attributes); - ov_res_biomass_bg(t,i,kcr,dm_nr,"upper") = vm_res_biomass_bg.up(i,kcr,dm_nr); - ov_res_recycling(t,i,npk,"upper") = vm_res_recycling.up(i,npk); - ov_res_biomass_ag(t,i,kcr,attributes,"lower") = vm_res_biomass_ag.lo(i,kcr,attributes); - ov_res_biomass_bg(t,i,kcr,dm_nr,"lower") = vm_res_biomass_bg.lo(i,kcr,dm_nr); - ov_res_recycling(t,i,npk,"lower") = vm_res_recycling.lo(i,npk); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_res_biomass_ag(t,i,kcr,attributes,"marginal") = vm_res_biomass_ag.m(i,kcr,attributes); + ov_res_biomass_bg(t,i,kcr,dm_nr,"marginal") = vm_res_biomass_bg.m(i,kcr,dm_nr); + ov_res_recycling(t,i,npk,"marginal") = vm_res_recycling.m(i,npk); + ov_res_biomass_ag(t,i,kcr,attributes,"level") = vm_res_biomass_ag.l(i,kcr,attributes); + ov_res_biomass_bg(t,i,kcr,dm_nr,"level") = vm_res_biomass_bg.l(i,kcr,dm_nr); + ov_res_recycling(t,i,npk,"level") = vm_res_recycling.l(i,npk); + ov_res_biomass_ag(t,i,kcr,attributes,"upper") = vm_res_biomass_ag.up(i,kcr,attributes); + ov_res_biomass_bg(t,i,kcr,dm_nr,"upper") = vm_res_biomass_bg.up(i,kcr,dm_nr); + ov_res_recycling(t,i,npk,"upper") = vm_res_recycling.up(i,npk); + ov_res_biomass_ag(t,i,kcr,attributes,"lower") = vm_res_biomass_ag.lo(i,kcr,attributes); + ov_res_biomass_bg(t,i,kcr,dm_nr,"lower") = vm_res_biomass_bg.lo(i,kcr,dm_nr); + ov_res_recycling(t,i,npk,"lower") = vm_res_recycling.lo(i,npk); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/18_residues/off/preloop.gms b/modules/18_residues/off/preloop.gms index d39a9714ea..79c1206e9b 100644 --- a/modules/18_residues/off/preloop.gms +++ b/modules/18_residues/off/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/18_residues/off.gms b/modules/18_residues/off/realization.gms similarity index 65% rename from modules/18_residues/off.gms rename to modules/18_residues/off/realization.gms index 610c6ff7a7..3e8c1aaa44 100644 --- a/modules/18_residues/off.gms +++ b/modules/18_residues/off/realization.gms @@ -1,17 +1,18 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description No representation of crop residues in the model. - -*' @limitations Should not be used if emission estimates are required or -*' climate policies are activated. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/18_residues/off/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/18_residues/off/declarations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/18_residues/off/preloop.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/18_residues/off/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description No representation of crop residues in the model. + +*' @limitations Should not be used if emission estimates are required or +*' climate policies are activated. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/18_residues/off/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/18_residues/off/declarations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/18_residues/off/preloop.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/18_residues/off/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/18_residues/off/sets.gms b/modules/18_residues/off/sets.gms index 991f6e78a7..2bb86e0305 100644 --- a/modules/18_residues/off/sets.gms +++ b/modules/18_residues/off/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/20_processing/coupleproducts_feb17.gms b/modules/20_processing/coupleproducts_feb17.gms deleted file mode 100644 index f2b8dd44b3..0000000000 --- a/modules/20_processing/coupleproducts_feb17.gms +++ /dev/null @@ -1,26 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description This realization describes the conversion process of primary to secondary agricultural products. -*' Secondary products are produced through some sort of mechanical or chemical processing -*' of primary crops. By secondary products we only refer to those for which information is -*' available in Commodity Balance sheet of @FAOSTAT. -*' Among others, press cakes from oil production, molasses and bagasses -*' from sugar refinement and brans from cereal milling are important ones. -*' The use of these secondary products is given in the [16_demand] module. - -*' @limitations Costs of processing depend on unit costs of processing -*' collected, interpolated, extrapolated, and adjusted from a scant literature. - - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/20_processing/coupleproducts_feb17/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/20_processing/coupleproducts_feb17/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/20_processing/coupleproducts_feb17/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/20_processing/coupleproducts_feb17/equations.gms" -$Ifi "%phase%" == "presolve" $include "./modules/20_processing/coupleproducts_feb17/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/20_processing/coupleproducts_feb17/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### diff --git a/modules/20_processing/coupleproducts_feb17/declarations.gms b/modules/20_processing/coupleproducts_feb17/declarations.gms deleted file mode 100644 index 2deb945111..0000000000 --- a/modules/20_processing/coupleproducts_feb17/declarations.gms +++ /dev/null @@ -1,47 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -positive variables - vm_dem_processing(i,kall) Demand for processing use (mio. tDM per yr) - v20_dem_processing(i,processing_subst20,kpr) Demand for processing use by process (mio. tDM per yr) - v20_secondary_substitutes(i,ksd,kpr) Substitutes for inferior secondary products (mio. tDM per yr) - vm_secondary_overproduction(i,kall,kpr) Overproduction of secondary couple products (mio. tDM per yr) - vm_cost_processing(i) Processing costs (mio. USD05MER per yr) -; - -variables - vm_processing_substitution_cost(i) Costs or benefits of substituting one product by another (mio. USD05MER per yr) -; - -equations - q20_processing(i,kpr,ksd) Processing equation (mio. tDM per yr) - q20_processing_aggregation_nocereals(i,kpr) Connecting processing activity to processing flows (mio. tDM per yr) - q20_processing_aggregation_cereals(i,kcereals20) Connecting processing activity to food use for milling (mio. tDM per yr) - q20_processing_aggregation_cotton(i) Connecting processing activity to production for cotton ginning (mio. tDM per yr) - q20_processing_substitution_oils(i) Substitution of branoils by other oils (mio. tDM per yr) - q20_processing_substitution_brans(i) Substitution of brans by cereals (mio. tDM per yr) - q20_processing_costs(i) Processing costs (mio. USD05MER per yr) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_dem_processing(t,i,kall,type) Demand for processing use (mio. tDM per yr) - ov20_dem_processing(t,i,processing_subst20,kpr,type) Demand for processing use by process (mio. tDM per yr) - ov20_secondary_substitutes(t,i,ksd,kpr,type) Substitutes for inferior secondary products (mio. tDM per yr) - ov_secondary_overproduction(t,i,kall,kpr,type) Overproduction of secondary couple products (mio. tDM per yr) - ov_cost_processing(t,i,type) Processing costs (mio. USD05MER per yr) - ov_processing_substitution_cost(t,i,type) Costs or benefits of substituting one product by another (mio. USD05MER per yr) - oq20_processing(t,i,kpr,ksd,type) Processing equation (mio. tDM per yr) - oq20_processing_aggregation_nocereals(t,i,kpr,type) Connecting processing activity to processing flows (mio. tDM per yr) - oq20_processing_aggregation_cereals(t,i,kcereals20,type) Connecting processing activity to food use for milling (mio. tDM per yr) - oq20_processing_aggregation_cotton(t,i,type) Connecting processing activity to production for cotton ginning (mio. tDM per yr) - oq20_processing_substitution_oils(t,i,type) Substitution of branoils by other oils (mio. tDM per yr) - oq20_processing_substitution_brans(t,i,type) Substitution of brans by cereals (mio. tDM per yr) - oq20_processing_costs(t,i,type) Processing costs (mio. USD05MER per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/20_processing/coupleproducts_feb17/equations.gms b/modules/20_processing/coupleproducts_feb17/equations.gms deleted file mode 100644 index b480ff5fa5..0000000000 --- a/modules/20_processing/coupleproducts_feb17/equations.gms +++ /dev/null @@ -1,94 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @equations -*' The series of equations below show the aggregation of secondary products from -*' from non-cereals (through alcohol fermentation, single cell protein breeding, -*' oil extracting, sugar refining or ethanol distilling processes), -*' cereals (through milling process), and cotton (through ginning process). -*' The need to have such multiple equations (i.e., separate equations for each process) -*' is meant to replicate the structure of Commodity Balance Sheets in @FAOSTAT. -*' -*' In the first equation, the demand for processing use is calculated -*' by aggregating the demand for secondary (processed) products use by process type -*' (other than milling and ginning in this equation case). -*' The equation also calculates secondary products from non-cereals crops -*' such as bio-energy crops and oil crops. - -q20_processing_aggregation_nocereals(i2,kpr) .. - vm_dem_processing(i2,kpr) =e= - sum(no_milling_ginning20,v20_dem_processing(i2,no_milling_ginning20,kpr)); - -*' In the second equation, the demand for processed products by process type of milling -*' of cereal crops is calculated. The equation applies only to secondary products from cereal crops which, among others, -*' include maize, tropical and temperate cereals. -*' Nevertheless, as in Commodity Balance Sheets of @FAOSTAT, cereal milling here is -*' not counted as processing but derived from food use of cereals. - -q20_processing_aggregation_cereals(i2,kcereals20) .. - vm_dem_food(i2,kcereals20) =e= v20_dem_processing(i2,"milling",kcereals20); - -*' In the third equation, the demand for processing by process type `v20_dem_processing` of ginning of cotton is calculated. -*' Likewise, the Commodity Balance Sheets in @FAOSTAT do not account for processing of "seed cotton" -*' into "cotton seed" and "cotton lint". As MAgPIE only includes the product "cotton seed" and not "seed cotton", -*' the "cotton lint" is bound to the production of "cotton seed". - -q20_processing_aggregation_cotton(i2) .. - vm_prod_reg(i2,"cottn_pro") =e= v20_dem_processing(i2,"ginning","cottn_pro"); - - -*' The fourth equation below describes the transformation of primary products into secondary products. -*' The processing conversion factors (`f20_processing_conversion_factors_cf`) indicate how much secondary products -*' can be derived from one unit of a specific primary product. -*' To avoid perfect substitutability between different primary commodities being transformed into the same -*' secondary product (e.g. oil from sunflower or oil palm), we use share factor coefficients, `f20_processing_shares`, -*' which indicate how much of the secondary products comes from which primary products. -*' The parameter `f20_processing_balanceflow` accounts for differences in conversion efficiency among various countries -*' whereas the conversion factors remain global. The `v20_secondary_substitutes` are used to avoid overproduction of couple products: for each couple product, -*' there is one secondary product (usually the cheaper one) which can be substituted by other commodities -*' (see also equations below). The secondary product overproduction `vm_secondary_overproduction` is used to move overproduction -*' of secondary products into the waste category such that the demand balance is maintained (see also [16_demand]). - -q20_processing(i2,kpr,ksd) .. - sum(processing20, v20_dem_processing(i2,processing20,kpr) - * sum(ct,f20_processing_conversion_factors(ct,processing20,ksd,kpr))) =e= - (vm_prod_reg(i2,ksd) - sum(ct,f20_processing_balanceflow(ct,i2,ksd))) - * sum(ct,f20_processing_shares(ct,i2,ksd,kpr)) - - v20_secondary_substitutes(i2,ksd,kpr) - + vm_secondary_overproduction(i2,ksd,kpr); - -*'The fifth equation below replaces the couple products bran oil and germ oil by other oils. - -q20_processing_substitution_oils(i2) .. - -v20_dem_processing(i2,"substitutes","oils") =g= - sum((kcereals20), v20_secondary_substitutes(i2,"oils",kcereals20) ); - -*' -*' The sixth equation below replaces brans by cereals of same protein value. - -q20_processing_substitution_brans(i2) .. - sum(kcereals20, v20_dem_processing(i2,"substitutes",kcereals20) - * fm_attributes("nr",kcereals20)) =g= - sum((kcereals20), v20_secondary_substitutes(i2,"brans",kcereals20) - * fm_attributes("nr","brans")); - -*' The seventh equation in this realization calculates the costs of processing (or converting) -*' primary products to secondary products. -*' As shown in the equation, the costs of processing (converting from primary to secondary products) -*' depend on the type of the primary product (e.g. maize, sugar cane, cotton), -*' the type of the process (e.g. milling, refining, ginning), -*' and the type of secondary product (e.g. brans, sugar, fiber) product. -*' The unit costs of processing, `f20_processing_unitcosts`, -*' are specific for the different conversion routes and are collected, interpolated, -*' and extrapolated from the related literature (e.g. @adanacioglu_profitability_2011, @pikaar_decoupling_2018, @valco_thecost_2016) -*' complemented with best educated guess by the module authors. - -q20_processing_costs(i2) .. - vm_cost_processing(i2)=e= -sum((ksd,processing20,kpr), v20_dem_processing(i2,processing20,kpr) - *sum(ct,f20_processing_conversion_factors(ct,processing20,ksd,kpr)) - *f20_processing_unitcosts(ksd,kpr)); diff --git a/modules/20_processing/coupleproducts_feb17/input.gms b/modules/20_processing/coupleproducts_feb17/input.gms deleted file mode 100644 index 1db3903681..0000000000 --- a/modules/20_processing/coupleproducts_feb17/input.gms +++ /dev/null @@ -1,27 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -table f20_processing_balanceflow(t_all,i,ksd) Processing balance flow (mio. tDM) -$ondelim -$include "./modules/20_processing/input/f20_processing_balanceflow.cs3" -$offdelim ; - -table f20_processing_conversion_factors(t_all,processing20,ksd,kpr) Conversion factors of primary products into secondary products (1) -$ondelim -$include "./modules/20_processing/input/f20_processing_conversion_factors.cs3" -$offdelim ; - -table f20_processing_shares(t_all,i,ksd,kpr) Shares of secondary products coming from a primary product (1) -$ondelim -$include "./modules/20_processing/input/f20_processing_shares.cs3" -$offdelim ; - -table f20_processing_unitcosts(ksd,kpr) Costs of transforming x units kpr into 1 unit ksd (USD05MER per tDM) -$ondelim -$include "./modules/20_processing/input/f20_processing_unitcosts.cs3" -$offdelim ; diff --git a/modules/20_processing/coupleproducts_feb17/not_used.txt b/modules/20_processing/coupleproducts_feb17/not_used.txt deleted file mode 100644 index 6ece3f27a1..0000000000 --- a/modules/20_processing/coupleproducts_feb17/not_used.txt +++ /dev/null @@ -1,7 +0,0 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# | Contact: magpie@pik-potsdam.de - -name,type,reason diff --git a/modules/20_processing/coupleproducts_feb17/postsolve.gms b/modules/20_processing/coupleproducts_feb17/postsolve.gms deleted file mode 100644 index 3f50f109d7..0000000000 --- a/modules/20_processing/coupleproducts_feb17/postsolve.gms +++ /dev/null @@ -1,62 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_dem_processing(t,i,kall,"marginal") = vm_dem_processing.m(i,kall); - ov20_dem_processing(t,i,processing_subst20,kpr,"marginal") = v20_dem_processing.m(i,processing_subst20,kpr); - ov20_secondary_substitutes(t,i,ksd,kpr,"marginal") = v20_secondary_substitutes.m(i,ksd,kpr); - ov_secondary_overproduction(t,i,kall,kpr,"marginal") = vm_secondary_overproduction.m(i,kall,kpr); - ov_cost_processing(t,i,"marginal") = vm_cost_processing.m(i); - ov_processing_substitution_cost(t,i,"marginal") = vm_processing_substitution_cost.m(i); - oq20_processing(t,i,kpr,ksd,"marginal") = q20_processing.m(i,kpr,ksd); - oq20_processing_aggregation_nocereals(t,i,kpr,"marginal") = q20_processing_aggregation_nocereals.m(i,kpr); - oq20_processing_aggregation_cereals(t,i,kcereals20,"marginal") = q20_processing_aggregation_cereals.m(i,kcereals20); - oq20_processing_aggregation_cotton(t,i,"marginal") = q20_processing_aggregation_cotton.m(i); - oq20_processing_substitution_oils(t,i,"marginal") = q20_processing_substitution_oils.m(i); - oq20_processing_substitution_brans(t,i,"marginal") = q20_processing_substitution_brans.m(i); - oq20_processing_costs(t,i,"marginal") = q20_processing_costs.m(i); - ov_dem_processing(t,i,kall,"level") = vm_dem_processing.l(i,kall); - ov20_dem_processing(t,i,processing_subst20,kpr,"level") = v20_dem_processing.l(i,processing_subst20,kpr); - ov20_secondary_substitutes(t,i,ksd,kpr,"level") = v20_secondary_substitutes.l(i,ksd,kpr); - ov_secondary_overproduction(t,i,kall,kpr,"level") = vm_secondary_overproduction.l(i,kall,kpr); - ov_cost_processing(t,i,"level") = vm_cost_processing.l(i); - ov_processing_substitution_cost(t,i,"level") = vm_processing_substitution_cost.l(i); - oq20_processing(t,i,kpr,ksd,"level") = q20_processing.l(i,kpr,ksd); - oq20_processing_aggregation_nocereals(t,i,kpr,"level") = q20_processing_aggregation_nocereals.l(i,kpr); - oq20_processing_aggregation_cereals(t,i,kcereals20,"level") = q20_processing_aggregation_cereals.l(i,kcereals20); - oq20_processing_aggregation_cotton(t,i,"level") = q20_processing_aggregation_cotton.l(i); - oq20_processing_substitution_oils(t,i,"level") = q20_processing_substitution_oils.l(i); - oq20_processing_substitution_brans(t,i,"level") = q20_processing_substitution_brans.l(i); - oq20_processing_costs(t,i,"level") = q20_processing_costs.l(i); - ov_dem_processing(t,i,kall,"upper") = vm_dem_processing.up(i,kall); - ov20_dem_processing(t,i,processing_subst20,kpr,"upper") = v20_dem_processing.up(i,processing_subst20,kpr); - ov20_secondary_substitutes(t,i,ksd,kpr,"upper") = v20_secondary_substitutes.up(i,ksd,kpr); - ov_secondary_overproduction(t,i,kall,kpr,"upper") = vm_secondary_overproduction.up(i,kall,kpr); - ov_cost_processing(t,i,"upper") = vm_cost_processing.up(i); - ov_processing_substitution_cost(t,i,"upper") = vm_processing_substitution_cost.up(i); - oq20_processing(t,i,kpr,ksd,"upper") = q20_processing.up(i,kpr,ksd); - oq20_processing_aggregation_nocereals(t,i,kpr,"upper") = q20_processing_aggregation_nocereals.up(i,kpr); - oq20_processing_aggregation_cereals(t,i,kcereals20,"upper") = q20_processing_aggregation_cereals.up(i,kcereals20); - oq20_processing_aggregation_cotton(t,i,"upper") = q20_processing_aggregation_cotton.up(i); - oq20_processing_substitution_oils(t,i,"upper") = q20_processing_substitution_oils.up(i); - oq20_processing_substitution_brans(t,i,"upper") = q20_processing_substitution_brans.up(i); - oq20_processing_costs(t,i,"upper") = q20_processing_costs.up(i); - ov_dem_processing(t,i,kall,"lower") = vm_dem_processing.lo(i,kall); - ov20_dem_processing(t,i,processing_subst20,kpr,"lower") = v20_dem_processing.lo(i,processing_subst20,kpr); - ov20_secondary_substitutes(t,i,ksd,kpr,"lower") = v20_secondary_substitutes.lo(i,ksd,kpr); - ov_secondary_overproduction(t,i,kall,kpr,"lower") = vm_secondary_overproduction.lo(i,kall,kpr); - ov_cost_processing(t,i,"lower") = vm_cost_processing.lo(i); - ov_processing_substitution_cost(t,i,"lower") = vm_processing_substitution_cost.lo(i); - oq20_processing(t,i,kpr,ksd,"lower") = q20_processing.lo(i,kpr,ksd); - oq20_processing_aggregation_nocereals(t,i,kpr,"lower") = q20_processing_aggregation_nocereals.lo(i,kpr); - oq20_processing_aggregation_cereals(t,i,kcereals20,"lower") = q20_processing_aggregation_cereals.lo(i,kcereals20); - oq20_processing_aggregation_cotton(t,i,"lower") = q20_processing_aggregation_cotton.lo(i); - oq20_processing_substitution_oils(t,i,"lower") = q20_processing_substitution_oils.lo(i); - oq20_processing_substitution_brans(t,i,"lower") = q20_processing_substitution_brans.lo(i); - oq20_processing_costs(t,i,"lower") = q20_processing_costs.lo(i); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/20_processing/coupleproducts_feb17/presolve.gms b/modules/20_processing/coupleproducts_feb17/presolve.gms deleted file mode 100644 index 5e15c4d516..0000000000 --- a/modules/20_processing/coupleproducts_feb17/presolve.gms +++ /dev/null @@ -1,22 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -vm_dem_processing.fx(i,knpr)=0; - -vm_secondary_overproduction.fx(i2,kall,kpr)=0; -vm_secondary_overproduction.up(i2,ksd,kpr)=Inf; - -v20_secondary_substitutes.fx(i,ksd,kpr)=0; -v20_secondary_substitutes.up(i,"brans",kcereals20)=Inf; -v20_secondary_substitutes.up(i,"oils",kcereals20)=Inf; - -* allowing only cereals and oils as substitutes for brans, germoil and branoil -v20_dem_processing.fx(i2,"substitutes",kpr)=0; -v20_dem_processing.up(i2,"substitutes",kcereals20)=Inf; -v20_dem_processing.up(i2,"substitutes","oils")=Inf; - -vm_processing_substitution_cost.fx(i)=0; diff --git a/modules/20_processing/coupleproducts_feb17/sets.gms b/modules/20_processing/coupleproducts_feb17/sets.gms deleted file mode 100644 index c9acad58c8..0000000000 --- a/modules/20_processing/coupleproducts_feb17/sets.gms +++ /dev/null @@ -1,34 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -sets - - -kpr(kall) Products that can be processed - /tece,maiz,trce,rice_pro,soybean,rapeseed,groundnut,sunflower,oilpalm, - potato,cassav_sp,sugr_cane,sugr_beet,others,cottn_pro,brans,begr,betr,foddr, - sugar,molasses,oils/ - -knpr(kall) Products that cannot be processed - /alcohol,distillers_grain,ethanol,fibres,fish,livst_chick,livst_egg,livst_milk, - livst_pig,livst_rum,oilcakes,pasture,puls_pro,res_cereals,res_fibrous, - res_nonfibrous,scp/ - -processing_subst20 Processing activities -/ milling, refining, extracting, distilling, fermentation, breeding, ginning, substitutes / - -processing20(processing_subst20) Processing activities except substitution -/ milling, refining, extracting, distilling, fermentation, breeding, ginning / - -kcereals20(kpr) Cereals used for processing -/tece,maiz,trce,rice_pro/ - -no_milling_ginning20(processing_subst20) Processing activities without milling and ginning -/refining, extracting, distilling, fermentation, breeding, substitutes / - - - -; \ No newline at end of file diff --git a/modules/20_processing/20_processing.gms b/modules/20_processing/module.gms similarity index 60% rename from modules/20_processing/20_processing.gms rename to modules/20_processing/module.gms index eed574c173..b44336a2b4 100644 --- a/modules/20_processing/20_processing.gms +++ b/modules/20_processing/module.gms @@ -1,20 +1,20 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Processing - -*' @description The processing module calculates the quantity of secondary products that -*' are generated through conversion of raw products (especially of primary plant agricultural commodities) -*' in order to meet the demand for those secondary products. - -*' @authors Benjamin Leon Bodirsky, Amsalu Woldie Yalew - - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%processing%" == "coupleproducts_feb17" $include "./modules/20_processing/coupleproducts_feb17.gms" -$Ifi "%processing%" == "off" $include "./modules/20_processing/off.gms" -$Ifi "%processing%" == "substitution_dec18" $include "./modules/20_processing/substitution_dec18.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Processing + +*' @description The processing module calculates the quantity of secondary products that +*' are generated through conversion of raw products (especially of primary plant agricultural commodities) +*' in order to meet the demand for those secondary products. + +*' @authors Benjamin Leon Bodirsky, Amsalu Woldie Yalew + + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%processing%" == "off" $include "./modules/20_processing/off/realization.gms" +$Ifi "%processing%" == "substitution_dec18" $include "./modules/20_processing/substitution_dec18/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/20_processing/off/declarations.gms b/modules/20_processing/off/declarations.gms index 1af98a4263..84c175e8a7 100644 --- a/modules/20_processing/off/declarations.gms +++ b/modules/20_processing/off/declarations.gms @@ -1,27 +1,28 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -equations - q20_processing_costs(i) processing costs (mio.USD05MER) -; - -positive variables - vm_dem_processing(i,kall) demand for processing use (mio.tDM) - vm_secondary_overproduction(i,kall,kpr) overproduction of secondary couple products (mio.tDM) - vm_cost_processing(i) processing costs (mio. USD05MER per yr) -; - - vm_processing_substitution_cost(i) - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_dem_processing(t,i,kall,type) demand for processing use (mio.tDM) - ov_secondary_overproduction(t,i,kall,kpr,type) overproduction of secondary couple products (mio.tDM) - ov_cost_processing(t,i,type) processing costs (mio. USD05MER per yr) - oq20_processing_costs(t,i,type) processing costs (mio.USD05MER) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + +equations + q20_processing_costs(i) processing costs (mio.USD05MER) +; + +positive variables + vm_dem_processing(i,kall) demand for processing use (mio.tDM) + vm_secondary_overproduction(i,kall,kpr) overproduction of secondary couple products (mio.tDM) + vm_cost_processing(i) processing costs (mio. USD05MER per yr) +; + + vm_processing_substitution_cost(i) + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_dem_processing(t,i,kall,type) demand for processing use (mio.tDM) + ov_secondary_overproduction(t,i,kall,kpr,type) overproduction of secondary couple products (mio.tDM) + ov_cost_processing(t,i,type) processing costs (mio. USD05MER per yr) + oq20_processing_costs(t,i,type) processing costs (mio.USD05MER) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/20_processing/off/equations.gms b/modules/20_processing/off/equations.gms index 65c912148b..1d1f3166f7 100644 --- a/modules/20_processing/off/equations.gms +++ b/modules/20_processing/off/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations diff --git a/modules/20_processing/off/not_used.txt b/modules/20_processing/off/not_used.txt index 3855755c2f..8596e57fb0 100644 --- a/modules/20_processing/off/not_used.txt +++ b/modules/20_processing/off/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason diff --git a/modules/20_processing/off/postsolve.gms b/modules/20_processing/off/postsolve.gms index a08d1bb1ee..feaa0df8fd 100644 --- a/modules/20_processing/off/postsolve.gms +++ b/modules/20_processing/off/postsolve.gms @@ -1,26 +1,27 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_dem_processing(t,i,kall,"marginal") = vm_dem_processing.m(i,kall); - ov_secondary_overproduction(t,i,kall,kpr,"marginal") = vm_secondary_overproduction.m(i,kall,kpr); - ov_cost_processing(t,i,"marginal") = vm_cost_processing.m(i); - oq20_processing_costs(t,i,"marginal") = q20_processing_costs.m(i); - ov_dem_processing(t,i,kall,"level") = vm_dem_processing.l(i,kall); - ov_secondary_overproduction(t,i,kall,kpr,"level") = vm_secondary_overproduction.l(i,kall,kpr); - ov_cost_processing(t,i,"level") = vm_cost_processing.l(i); - oq20_processing_costs(t,i,"level") = q20_processing_costs.l(i); - ov_dem_processing(t,i,kall,"upper") = vm_dem_processing.up(i,kall); - ov_secondary_overproduction(t,i,kall,kpr,"upper") = vm_secondary_overproduction.up(i,kall,kpr); - ov_cost_processing(t,i,"upper") = vm_cost_processing.up(i); - oq20_processing_costs(t,i,"upper") = q20_processing_costs.up(i); - ov_dem_processing(t,i,kall,"lower") = vm_dem_processing.lo(i,kall); - ov_secondary_overproduction(t,i,kall,kpr,"lower") = vm_secondary_overproduction.lo(i,kall,kpr); - ov_cost_processing(t,i,"lower") = vm_cost_processing.lo(i); - oq20_processing_costs(t,i,"lower") = q20_processing_costs.lo(i); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 + + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_dem_processing(t,i,kall,"marginal") = vm_dem_processing.m(i,kall); + ov_secondary_overproduction(t,i,kall,kpr,"marginal") = vm_secondary_overproduction.m(i,kall,kpr); + ov_cost_processing(t,i,"marginal") = vm_cost_processing.m(i); + oq20_processing_costs(t,i,"marginal") = q20_processing_costs.m(i); + ov_dem_processing(t,i,kall,"level") = vm_dem_processing.l(i,kall); + ov_secondary_overproduction(t,i,kall,kpr,"level") = vm_secondary_overproduction.l(i,kall,kpr); + ov_cost_processing(t,i,"level") = vm_cost_processing.l(i); + oq20_processing_costs(t,i,"level") = q20_processing_costs.l(i); + ov_dem_processing(t,i,kall,"upper") = vm_dem_processing.up(i,kall); + ov_secondary_overproduction(t,i,kall,kpr,"upper") = vm_secondary_overproduction.up(i,kall,kpr); + ov_cost_processing(t,i,"upper") = vm_cost_processing.up(i); + oq20_processing_costs(t,i,"upper") = q20_processing_costs.up(i); + ov_dem_processing(t,i,kall,"lower") = vm_dem_processing.lo(i,kall); + ov_secondary_overproduction(t,i,kall,kpr,"lower") = vm_secondary_overproduction.lo(i,kall,kpr); + ov_cost_processing(t,i,"lower") = vm_cost_processing.lo(i); + oq20_processing_costs(t,i,"lower") = q20_processing_costs.lo(i); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/20_processing/off/presolve.gms b/modules/20_processing/off/presolve.gms index 9678e8bd2f..1130cbe52a 100644 --- a/modules/20_processing/off/presolve.gms +++ b/modules/20_processing/off/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/20_processing/off.gms b/modules/20_processing/off/realization.gms similarity index 78% rename from modules/20_processing/off.gms rename to modules/20_processing/off/realization.gms index 0ae69a3e73..e211bc4f2a 100644 --- a/modules/20_processing/off.gms +++ b/modules/20_processing/off/realization.gms @@ -1,25 +1,26 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description This realization uses an arbitrary unit cost of processing -*' which is too high for many of the processing types and secondary products. -*' So doing is meant to discourage overproduction of secondary products. -*' Despite these limitations, however, the implementation is very simple -*' as it uses the same unit costs of processing for all second -*' products (e.g. alcohol, ethanol, molasses, brans) and -*' processing types (e.g. fermentation, ginning, milling, breeding). - -*' @limitations There is no empirical ground to use the same unit costs of processing -*' for all processing types and secondary products, -*' and to impose constraint on over production of secondary products. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/20_processing/off/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/20_processing/off/declarations.gms" -$Ifi "%phase%" == "equations" $include "./modules/20_processing/off/equations.gms" -$Ifi "%phase%" == "presolve" $include "./modules/20_processing/off/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/20_processing/off/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description This realization uses an arbitrary unit cost of processing +*' which is too high for many of the processing types and secondary products. +*' So doing is meant to discourage overproduction of secondary products. +*' Despite these limitations, however, the implementation is very simple +*' as it uses the same unit costs of processing for all second +*' products (e.g. alcohol, ethanol, molasses, brans) and +*' processing types (e.g. fermentation, ginning, milling, breeding). + +*' @limitations There is no empirical ground to use the same unit costs of processing +*' for all processing types and secondary products, +*' and to impose constraint on over production of secondary products. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/20_processing/off/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/20_processing/off/declarations.gms" +$Ifi "%phase%" == "equations" $include "./modules/20_processing/off/equations.gms" +$Ifi "%phase%" == "presolve" $include "./modules/20_processing/off/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/20_processing/off/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/20_processing/off/sets.gms b/modules/20_processing/off/sets.gms index 1f608f9fe7..40a7f328f2 100644 --- a/modules/20_processing/off/sets.gms +++ b/modules/20_processing/off/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/20_processing/substitution_dec18/declarations.gms b/modules/20_processing/substitution_dec18/declarations.gms index 359307aafe..73922be5b5 100644 --- a/modules/20_processing/substitution_dec18/declarations.gms +++ b/modules/20_processing/substitution_dec18/declarations.gms @@ -1,53 +1,54 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -positive variables - vm_dem_processing(i,kall) Demand for processing use (mio. tDM per yr) - v20_dem_processing(i,processing_subst20,kpr) Demand for processing use by process (mio. tDM per yr) - v20_secondary_substitutes(i,ksd,kpr) Substitutes for inferior secondary products (mio. tDM per yr) - vm_secondary_overproduction(i,kall,kpr) Overproduction of secondary couple products (mio. tDM per yr) - vm_cost_processing(i) Processing costs (mio. USD05MER per yr) -; - -variables - vm_processing_substitution_cost(i) Costs or benefits of substituting one product by another (mio. USD05MER per yr) -; - -equations - q20_processing(i,kpr,ksd) Processing equation (mio. tDM per yr) - q20_processing_aggregation_nocereals(i,kpr) Connecting processing activity to processing flows (mio. tDM per yr) - q20_processing_aggregation_cereals(i,kcereals20) Connecting processing activity to food use for milling (mio. tDM per yr) - q20_processing_aggregation_cotton(i) Connecting processing activity to production for cotton ginning (mio. tDM per yr) - q20_processing_substitution_oils(i) Substitution of oils by other oils (mio. tDM per yr) - q20_processing_substitution_brans(i) Substitution of brans by cereals (mio. tNr per yr) - q20_processing_substitution_sugar(i) Substitution of molasses by sugar (mio. tDM per yr) - q20_processing_substitution_protein(i) Substitution of protein products by other protein products (mio. tNr per yr) - q20_processing_costs(i) Processing costs (mio. USD05MER per yr) - q20_substitution_utility_loss(i) Utility loss when one product has to be substituted by another (mio. t Nr per year) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_dem_processing(t,i,kall,type) Demand for processing use (mio. tDM per yr) - ov20_dem_processing(t,i,processing_subst20,kpr,type) Demand for processing use by process (mio. tDM per yr) - ov20_secondary_substitutes(t,i,ksd,kpr,type) Substitutes for inferior secondary products (mio. tDM per yr) - ov_secondary_overproduction(t,i,kall,kpr,type) Overproduction of secondary couple products (mio. tDM per yr) - ov_cost_processing(t,i,type) Processing costs (mio. USD05MER per yr) - ov_processing_substitution_cost(t,i,type) Costs or benefits of substituting one product by another (mio. USD05MER per yr) - oq20_processing(t,i,kpr,ksd,type) Processing equation (mio. tDM per yr) - oq20_processing_aggregation_nocereals(t,i,kpr,type) Connecting processing activity to processing flows (mio. tDM per yr) - oq20_processing_aggregation_cereals(t,i,kcereals20,type) Connecting processing activity to food use for milling (mio. tDM per yr) - oq20_processing_aggregation_cotton(t,i,type) Connecting processing activity to production for cotton ginning (mio. tDM per yr) - oq20_processing_substitution_oils(t,i,type) Substitution of oils by other oils (mio. tDM per yr) - oq20_processing_substitution_brans(t,i,type) Substitution of brans by cereals (mio. tNr per yr) - oq20_processing_substitution_sugar(t,i,type) Substitution of molasses by sugar (mio. tDM per yr) - oq20_processing_substitution_protein(t,i,type) Substitution of protein products by other protein products (mio. tNr per yr) - oq20_processing_costs(t,i,type) Processing costs (mio. USD05MER per yr) - oq20_substitution_utility_loss(t,i,type) Utility loss when one product has to be substituted by another (mio. t Nr per year) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + + +positive variables + vm_dem_processing(i,kall) Demand for processing use (mio. tDM per yr) + v20_dem_processing(i,processing_subst20,kpr) Demand for processing use by process (mio. tDM per yr) + v20_secondary_substitutes(i,ksd,kpr) Substitutes for inferior secondary products (mio. tDM per yr) + vm_secondary_overproduction(i,kall,kpr) Overproduction of secondary couple products (mio. tDM per yr) + vm_cost_processing(i) Processing costs (mio. USD05MER per yr) +; + +variables + vm_processing_substitution_cost(i) Costs or benefits of substituting one product by another (mio. USD05MER per yr) +; + +equations + q20_processing(i,kpr,ksd) Processing equation (mio. tDM per yr) + q20_processing_aggregation_nocereals(i,kpr) Connecting processing activity to processing flows (mio. tDM per yr) + q20_processing_aggregation_cereals(i,kcereals20) Connecting processing activity to food use for milling (mio. tDM per yr) + q20_processing_aggregation_cotton(i) Connecting processing activity to production for cotton ginning (mio. tDM per yr) + q20_processing_substitution_oils(i) Substitution of oils by other oils (mio. tDM per yr) + q20_processing_substitution_brans(i) Substitution of brans by cereals (mio. tNr per yr) + q20_processing_substitution_sugar(i) Substitution of molasses by sugar (mio. tDM per yr) + q20_processing_substitution_protein(i) Substitution of protein products by other protein products (mio. tNr per yr) + q20_processing_costs(i) Processing costs (mio. USD05MER per yr) + q20_substitution_utility_loss(i) Utility loss when one product has to be substituted by another (mio. t Nr per year) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_dem_processing(t,i,kall,type) Demand for processing use (mio. tDM per yr) + ov20_dem_processing(t,i,processing_subst20,kpr,type) Demand for processing use by process (mio. tDM per yr) + ov20_secondary_substitutes(t,i,ksd,kpr,type) Substitutes for inferior secondary products (mio. tDM per yr) + ov_secondary_overproduction(t,i,kall,kpr,type) Overproduction of secondary couple products (mio. tDM per yr) + ov_cost_processing(t,i,type) Processing costs (mio. USD05MER per yr) + ov_processing_substitution_cost(t,i,type) Costs or benefits of substituting one product by another (mio. USD05MER per yr) + oq20_processing(t,i,kpr,ksd,type) Processing equation (mio. tDM per yr) + oq20_processing_aggregation_nocereals(t,i,kpr,type) Connecting processing activity to processing flows (mio. tDM per yr) + oq20_processing_aggregation_cereals(t,i,kcereals20,type) Connecting processing activity to food use for milling (mio. tDM per yr) + oq20_processing_aggregation_cotton(t,i,type) Connecting processing activity to production for cotton ginning (mio. tDM per yr) + oq20_processing_substitution_oils(t,i,type) Substitution of oils by other oils (mio. tDM per yr) + oq20_processing_substitution_brans(t,i,type) Substitution of brans by cereals (mio. tNr per yr) + oq20_processing_substitution_sugar(t,i,type) Substitution of molasses by sugar (mio. tDM per yr) + oq20_processing_substitution_protein(t,i,type) Substitution of protein products by other protein products (mio. tNr per yr) + oq20_processing_costs(t,i,type) Processing costs (mio. USD05MER per yr) + oq20_substitution_utility_loss(t,i,type) Utility loss when one product has to be substituted by another (mio. t Nr per year) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/20_processing/substitution_dec18/equations.gms b/modules/20_processing/substitution_dec18/equations.gms index 04c16361ba..db05cf60b4 100644 --- a/modules/20_processing/substitution_dec18/equations.gms +++ b/modules/20_processing/substitution_dec18/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations @@ -135,4 +136,4 @@ q20_substitution_utility_loss(i2) .. ) + sum((ksd,processing20,kpr), v20_dem_processing(i2,processing20,kpr) *sum(ct,f20_processing_conversion_factors(ct,processing20,ksd,kpr)) - * (f20_quality_cost(ksd,kpr)+f20_calibration(ksd,kpr))); \ No newline at end of file + * (f20_quality_cost(ksd,kpr)+f20_calibration(ksd,kpr))); diff --git a/modules/20_processing/substitution_dec18/input.gms b/modules/20_processing/substitution_dec18/input.gms index 328da92980..8979b84d80 100644 --- a/modules/20_processing/substitution_dec18/input.gms +++ b/modules/20_processing/substitution_dec18/input.gms @@ -1,37 +1,38 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -table f20_processing_balanceflow(t_all,i,ksd) Processing balance flow (mio. tDM) -$ondelim -$include "./modules/20_processing/input/f20_processing_balanceflow.cs3" -$offdelim ; - -table f20_processing_conversion_factors(t_all,processing20,ksd,kpr) Conversion factors of primary products into secondary products (1) -$ondelim -$include "./modules/20_processing/input/f20_processing_conversion_factors.cs3" -$offdelim ; - -table f20_processing_shares(t_all,i,ksd,kpr) Shares of secondary products coming from a primary product (1) -$ondelim -$include "./modules/20_processing/input/f20_processing_shares.cs3" -$offdelim ; - -table f20_processing_unitcosts(ksd,kpr) Costs of transforming x units kpr into 1 unit ksd (USD05MER per tDM) -$ondelim -$include "./modules/20_processing/input/f20_processing_unitcosts.cs3" -$offdelim ; - -table f20_quality_cost(ksd,kpr) Costs for difference in quality between secondary products from diverging origins (USD per tDM) -$ondelim -$include "./modules/20_processing/substitution_dec18/input/f20_quality_cost.cs3" -$offdelim ; - -table f20_calibration(ksd,kpr) Additional calibration costs to avoid substitution in historical period (USD05 per tDM) -$ondelim -$include "./modules/20_processing/substitution_dec18/input/f20_calibration.cs3" -$offdelim ; +*** | (C) 2008-2019 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 + + + +table f20_processing_balanceflow(t_all,i,ksd) Processing balance flow (mio. tDM) +$ondelim +$include "./modules/20_processing/input/f20_processing_balanceflow.cs3" +$offdelim ; + +table f20_processing_conversion_factors(t_all,processing20,ksd,kpr) Conversion factors of primary products into secondary products (1) +$ondelim +$include "./modules/20_processing/input/f20_processing_conversion_factors.cs3" +$offdelim ; + +table f20_processing_shares(t_all,i,ksd,kpr) Shares of secondary products coming from a primary product (1) +$ondelim +$include "./modules/20_processing/input/f20_processing_shares.cs3" +$offdelim ; + +table f20_processing_unitcosts(ksd,kpr) Costs of transforming x units kpr into 1 unit ksd (USD05MER per tDM) +$ondelim +$include "./modules/20_processing/input/f20_processing_unitcosts.cs3" +$offdelim ; + +table f20_quality_cost(ksd,kpr) Costs for difference in quality between secondary products from diverging origins (USD per tDM) +$ondelim +$include "./modules/20_processing/substitution_dec18/input/f20_quality_cost.cs3" +$offdelim ; + +table f20_calibration(ksd,kpr) Additional calibration costs to avoid substitution in historical period (USD05 per tDM) +$ondelim +$include "./modules/20_processing/substitution_dec18/input/f20_calibration.cs3" +$offdelim ; diff --git a/modules/20_processing/substitution_dec18/not_used.txt b/modules/20_processing/substitution_dec18/not_used.txt index 6ece3f27a1..4b81dfbae2 100644 --- a/modules/20_processing/substitution_dec18/not_used.txt +++ b/modules/20_processing/substitution_dec18/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason diff --git a/modules/20_processing/substitution_dec18/postsolve.gms b/modules/20_processing/substitution_dec18/postsolve.gms index e1d3364ded..9fcc697515 100644 --- a/modules/20_processing/substitution_dec18/postsolve.gms +++ b/modules/20_processing/substitution_dec18/postsolve.gms @@ -1,74 +1,75 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_dem_processing(t,i,kall,"marginal") = vm_dem_processing.m(i,kall); - ov20_dem_processing(t,i,processing_subst20,kpr,"marginal") = v20_dem_processing.m(i,processing_subst20,kpr); - ov20_secondary_substitutes(t,i,ksd,kpr,"marginal") = v20_secondary_substitutes.m(i,ksd,kpr); - ov_secondary_overproduction(t,i,kall,kpr,"marginal") = vm_secondary_overproduction.m(i,kall,kpr); - ov_cost_processing(t,i,"marginal") = vm_cost_processing.m(i); - ov_processing_substitution_cost(t,i,"marginal") = vm_processing_substitution_cost.m(i); - oq20_processing(t,i,kpr,ksd,"marginal") = q20_processing.m(i,kpr,ksd); - oq20_processing_aggregation_nocereals(t,i,kpr,"marginal") = q20_processing_aggregation_nocereals.m(i,kpr); - oq20_processing_aggregation_cereals(t,i,kcereals20,"marginal") = q20_processing_aggregation_cereals.m(i,kcereals20); - oq20_processing_aggregation_cotton(t,i,"marginal") = q20_processing_aggregation_cotton.m(i); - oq20_processing_substitution_oils(t,i,"marginal") = q20_processing_substitution_oils.m(i); - oq20_processing_substitution_brans(t,i,"marginal") = q20_processing_substitution_brans.m(i); - oq20_processing_substitution_sugar(t,i,"marginal") = q20_processing_substitution_sugar.m(i); - oq20_processing_substitution_protein(t,i,"marginal") = q20_processing_substitution_protein.m(i); - oq20_processing_costs(t,i,"marginal") = q20_processing_costs.m(i); - oq20_substitution_utility_loss(t,i,"marginal") = q20_substitution_utility_loss.m(i); - ov_dem_processing(t,i,kall,"level") = vm_dem_processing.l(i,kall); - ov20_dem_processing(t,i,processing_subst20,kpr,"level") = v20_dem_processing.l(i,processing_subst20,kpr); - ov20_secondary_substitutes(t,i,ksd,kpr,"level") = v20_secondary_substitutes.l(i,ksd,kpr); - ov_secondary_overproduction(t,i,kall,kpr,"level") = vm_secondary_overproduction.l(i,kall,kpr); - ov_cost_processing(t,i,"level") = vm_cost_processing.l(i); - ov_processing_substitution_cost(t,i,"level") = vm_processing_substitution_cost.l(i); - oq20_processing(t,i,kpr,ksd,"level") = q20_processing.l(i,kpr,ksd); - oq20_processing_aggregation_nocereals(t,i,kpr,"level") = q20_processing_aggregation_nocereals.l(i,kpr); - oq20_processing_aggregation_cereals(t,i,kcereals20,"level") = q20_processing_aggregation_cereals.l(i,kcereals20); - oq20_processing_aggregation_cotton(t,i,"level") = q20_processing_aggregation_cotton.l(i); - oq20_processing_substitution_oils(t,i,"level") = q20_processing_substitution_oils.l(i); - oq20_processing_substitution_brans(t,i,"level") = q20_processing_substitution_brans.l(i); - oq20_processing_substitution_sugar(t,i,"level") = q20_processing_substitution_sugar.l(i); - oq20_processing_substitution_protein(t,i,"level") = q20_processing_substitution_protein.l(i); - oq20_processing_costs(t,i,"level") = q20_processing_costs.l(i); - oq20_substitution_utility_loss(t,i,"level") = q20_substitution_utility_loss.l(i); - ov_dem_processing(t,i,kall,"upper") = vm_dem_processing.up(i,kall); - ov20_dem_processing(t,i,processing_subst20,kpr,"upper") = v20_dem_processing.up(i,processing_subst20,kpr); - ov20_secondary_substitutes(t,i,ksd,kpr,"upper") = v20_secondary_substitutes.up(i,ksd,kpr); - ov_secondary_overproduction(t,i,kall,kpr,"upper") = vm_secondary_overproduction.up(i,kall,kpr); - ov_cost_processing(t,i,"upper") = vm_cost_processing.up(i); - ov_processing_substitution_cost(t,i,"upper") = vm_processing_substitution_cost.up(i); - oq20_processing(t,i,kpr,ksd,"upper") = q20_processing.up(i,kpr,ksd); - oq20_processing_aggregation_nocereals(t,i,kpr,"upper") = q20_processing_aggregation_nocereals.up(i,kpr); - oq20_processing_aggregation_cereals(t,i,kcereals20,"upper") = q20_processing_aggregation_cereals.up(i,kcereals20); - oq20_processing_aggregation_cotton(t,i,"upper") = q20_processing_aggregation_cotton.up(i); - oq20_processing_substitution_oils(t,i,"upper") = q20_processing_substitution_oils.up(i); - oq20_processing_substitution_brans(t,i,"upper") = q20_processing_substitution_brans.up(i); - oq20_processing_substitution_sugar(t,i,"upper") = q20_processing_substitution_sugar.up(i); - oq20_processing_substitution_protein(t,i,"upper") = q20_processing_substitution_protein.up(i); - oq20_processing_costs(t,i,"upper") = q20_processing_costs.up(i); - oq20_substitution_utility_loss(t,i,"upper") = q20_substitution_utility_loss.up(i); - ov_dem_processing(t,i,kall,"lower") = vm_dem_processing.lo(i,kall); - ov20_dem_processing(t,i,processing_subst20,kpr,"lower") = v20_dem_processing.lo(i,processing_subst20,kpr); - ov20_secondary_substitutes(t,i,ksd,kpr,"lower") = v20_secondary_substitutes.lo(i,ksd,kpr); - ov_secondary_overproduction(t,i,kall,kpr,"lower") = vm_secondary_overproduction.lo(i,kall,kpr); - ov_cost_processing(t,i,"lower") = vm_cost_processing.lo(i); - ov_processing_substitution_cost(t,i,"lower") = vm_processing_substitution_cost.lo(i); - oq20_processing(t,i,kpr,ksd,"lower") = q20_processing.lo(i,kpr,ksd); - oq20_processing_aggregation_nocereals(t,i,kpr,"lower") = q20_processing_aggregation_nocereals.lo(i,kpr); - oq20_processing_aggregation_cereals(t,i,kcereals20,"lower") = q20_processing_aggregation_cereals.lo(i,kcereals20); - oq20_processing_aggregation_cotton(t,i,"lower") = q20_processing_aggregation_cotton.lo(i); - oq20_processing_substitution_oils(t,i,"lower") = q20_processing_substitution_oils.lo(i); - oq20_processing_substitution_brans(t,i,"lower") = q20_processing_substitution_brans.lo(i); - oq20_processing_substitution_sugar(t,i,"lower") = q20_processing_substitution_sugar.lo(i); - oq20_processing_substitution_protein(t,i,"lower") = q20_processing_substitution_protein.lo(i); - oq20_processing_costs(t,i,"lower") = q20_processing_costs.lo(i); - oq20_substitution_utility_loss(t,i,"lower") = q20_substitution_utility_loss.lo(i); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 + + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_dem_processing(t,i,kall,"marginal") = vm_dem_processing.m(i,kall); + ov20_dem_processing(t,i,processing_subst20,kpr,"marginal") = v20_dem_processing.m(i,processing_subst20,kpr); + ov20_secondary_substitutes(t,i,ksd,kpr,"marginal") = v20_secondary_substitutes.m(i,ksd,kpr); + ov_secondary_overproduction(t,i,kall,kpr,"marginal") = vm_secondary_overproduction.m(i,kall,kpr); + ov_cost_processing(t,i,"marginal") = vm_cost_processing.m(i); + ov_processing_substitution_cost(t,i,"marginal") = vm_processing_substitution_cost.m(i); + oq20_processing(t,i,kpr,ksd,"marginal") = q20_processing.m(i,kpr,ksd); + oq20_processing_aggregation_nocereals(t,i,kpr,"marginal") = q20_processing_aggregation_nocereals.m(i,kpr); + oq20_processing_aggregation_cereals(t,i,kcereals20,"marginal") = q20_processing_aggregation_cereals.m(i,kcereals20); + oq20_processing_aggregation_cotton(t,i,"marginal") = q20_processing_aggregation_cotton.m(i); + oq20_processing_substitution_oils(t,i,"marginal") = q20_processing_substitution_oils.m(i); + oq20_processing_substitution_brans(t,i,"marginal") = q20_processing_substitution_brans.m(i); + oq20_processing_substitution_sugar(t,i,"marginal") = q20_processing_substitution_sugar.m(i); + oq20_processing_substitution_protein(t,i,"marginal") = q20_processing_substitution_protein.m(i); + oq20_processing_costs(t,i,"marginal") = q20_processing_costs.m(i); + oq20_substitution_utility_loss(t,i,"marginal") = q20_substitution_utility_loss.m(i); + ov_dem_processing(t,i,kall,"level") = vm_dem_processing.l(i,kall); + ov20_dem_processing(t,i,processing_subst20,kpr,"level") = v20_dem_processing.l(i,processing_subst20,kpr); + ov20_secondary_substitutes(t,i,ksd,kpr,"level") = v20_secondary_substitutes.l(i,ksd,kpr); + ov_secondary_overproduction(t,i,kall,kpr,"level") = vm_secondary_overproduction.l(i,kall,kpr); + ov_cost_processing(t,i,"level") = vm_cost_processing.l(i); + ov_processing_substitution_cost(t,i,"level") = vm_processing_substitution_cost.l(i); + oq20_processing(t,i,kpr,ksd,"level") = q20_processing.l(i,kpr,ksd); + oq20_processing_aggregation_nocereals(t,i,kpr,"level") = q20_processing_aggregation_nocereals.l(i,kpr); + oq20_processing_aggregation_cereals(t,i,kcereals20,"level") = q20_processing_aggregation_cereals.l(i,kcereals20); + oq20_processing_aggregation_cotton(t,i,"level") = q20_processing_aggregation_cotton.l(i); + oq20_processing_substitution_oils(t,i,"level") = q20_processing_substitution_oils.l(i); + oq20_processing_substitution_brans(t,i,"level") = q20_processing_substitution_brans.l(i); + oq20_processing_substitution_sugar(t,i,"level") = q20_processing_substitution_sugar.l(i); + oq20_processing_substitution_protein(t,i,"level") = q20_processing_substitution_protein.l(i); + oq20_processing_costs(t,i,"level") = q20_processing_costs.l(i); + oq20_substitution_utility_loss(t,i,"level") = q20_substitution_utility_loss.l(i); + ov_dem_processing(t,i,kall,"upper") = vm_dem_processing.up(i,kall); + ov20_dem_processing(t,i,processing_subst20,kpr,"upper") = v20_dem_processing.up(i,processing_subst20,kpr); + ov20_secondary_substitutes(t,i,ksd,kpr,"upper") = v20_secondary_substitutes.up(i,ksd,kpr); + ov_secondary_overproduction(t,i,kall,kpr,"upper") = vm_secondary_overproduction.up(i,kall,kpr); + ov_cost_processing(t,i,"upper") = vm_cost_processing.up(i); + ov_processing_substitution_cost(t,i,"upper") = vm_processing_substitution_cost.up(i); + oq20_processing(t,i,kpr,ksd,"upper") = q20_processing.up(i,kpr,ksd); + oq20_processing_aggregation_nocereals(t,i,kpr,"upper") = q20_processing_aggregation_nocereals.up(i,kpr); + oq20_processing_aggregation_cereals(t,i,kcereals20,"upper") = q20_processing_aggregation_cereals.up(i,kcereals20); + oq20_processing_aggregation_cotton(t,i,"upper") = q20_processing_aggregation_cotton.up(i); + oq20_processing_substitution_oils(t,i,"upper") = q20_processing_substitution_oils.up(i); + oq20_processing_substitution_brans(t,i,"upper") = q20_processing_substitution_brans.up(i); + oq20_processing_substitution_sugar(t,i,"upper") = q20_processing_substitution_sugar.up(i); + oq20_processing_substitution_protein(t,i,"upper") = q20_processing_substitution_protein.up(i); + oq20_processing_costs(t,i,"upper") = q20_processing_costs.up(i); + oq20_substitution_utility_loss(t,i,"upper") = q20_substitution_utility_loss.up(i); + ov_dem_processing(t,i,kall,"lower") = vm_dem_processing.lo(i,kall); + ov20_dem_processing(t,i,processing_subst20,kpr,"lower") = v20_dem_processing.lo(i,processing_subst20,kpr); + ov20_secondary_substitutes(t,i,ksd,kpr,"lower") = v20_secondary_substitutes.lo(i,ksd,kpr); + ov_secondary_overproduction(t,i,kall,kpr,"lower") = vm_secondary_overproduction.lo(i,kall,kpr); + ov_cost_processing(t,i,"lower") = vm_cost_processing.lo(i); + ov_processing_substitution_cost(t,i,"lower") = vm_processing_substitution_cost.lo(i); + oq20_processing(t,i,kpr,ksd,"lower") = q20_processing.lo(i,kpr,ksd); + oq20_processing_aggregation_nocereals(t,i,kpr,"lower") = q20_processing_aggregation_nocereals.lo(i,kpr); + oq20_processing_aggregation_cereals(t,i,kcereals20,"lower") = q20_processing_aggregation_cereals.lo(i,kcereals20); + oq20_processing_aggregation_cotton(t,i,"lower") = q20_processing_aggregation_cotton.lo(i); + oq20_processing_substitution_oils(t,i,"lower") = q20_processing_substitution_oils.lo(i); + oq20_processing_substitution_brans(t,i,"lower") = q20_processing_substitution_brans.lo(i); + oq20_processing_substitution_sugar(t,i,"lower") = q20_processing_substitution_sugar.lo(i); + oq20_processing_substitution_protein(t,i,"lower") = q20_processing_substitution_protein.lo(i); + oq20_processing_costs(t,i,"lower") = q20_processing_costs.lo(i); + oq20_substitution_utility_loss(t,i,"lower") = q20_substitution_utility_loss.lo(i); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/20_processing/substitution_dec18/preloop.gms b/modules/20_processing/substitution_dec18/preloop.gms deleted file mode 100644 index 8b13789179..0000000000 --- a/modules/20_processing/substitution_dec18/preloop.gms +++ /dev/null @@ -1 +0,0 @@ - diff --git a/modules/20_processing/substitution_dec18/presolve.gms b/modules/20_processing/substitution_dec18/presolve.gms index f2123d0bca..4b7ae452b9 100644 --- a/modules/20_processing/substitution_dec18/presolve.gms +++ b/modules/20_processing/substitution_dec18/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 @@ -15,4 +16,4 @@ v20_secondary_substitutes.up(i2,"oils",kpr)=Inf; v20_secondary_substitutes.up(i2,"molasses",kpr)=Inf; v20_secondary_substitutes.up(i2,"distillers_grain",kpr)=Inf; v20_secondary_substitutes.up(i2,"oilcakes",kpr)=Inf; -v20_secondary_substitutes.up(i2,"brans",kcereals20)=Inf; \ No newline at end of file +v20_secondary_substitutes.up(i2,"brans",kcereals20)=Inf; diff --git a/modules/20_processing/substitution_dec18.gms b/modules/20_processing/substitution_dec18/realization.gms similarity index 64% rename from modules/20_processing/substitution_dec18.gms rename to modules/20_processing/substitution_dec18/realization.gms index dea8ccd15c..e4b4b7d6a7 100644 --- a/modules/20_processing/substitution_dec18.gms +++ b/modules/20_processing/substitution_dec18/realization.gms @@ -1,12 +1,15 @@ - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/20_processing/substitution_dec18/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/20_processing/substitution_dec18/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/20_processing/substitution_dec18/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/20_processing/substitution_dec18/equations.gms" -$Ifi "%phase%" == "scaling" $include "./modules/20_processing/substitution_dec18/scaling.gms" -$Ifi "%phase%" == "preloop" $include "./modules/20_processing/substitution_dec18/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/20_processing/substitution_dec18/presolve.gms" -$Ifi "%phase%" == "solve" $include "./modules/20_processing/substitution_dec18/solve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/20_processing/substitution_dec18/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 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 + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/20_processing/substitution_dec18/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/20_processing/substitution_dec18/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/20_processing/substitution_dec18/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/20_processing/substitution_dec18/equations.gms" +$Ifi "%phase%" == "presolve" $include "./modules/20_processing/substitution_dec18/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/20_processing/substitution_dec18/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/20_processing/substitution_dec18/scaling.gms b/modules/20_processing/substitution_dec18/scaling.gms deleted file mode 100644 index 8b13789179..0000000000 --- a/modules/20_processing/substitution_dec18/scaling.gms +++ /dev/null @@ -1 +0,0 @@ - diff --git a/modules/20_processing/substitution_dec18/sets.gms b/modules/20_processing/substitution_dec18/sets.gms index a3c561f938..217e0155cb 100644 --- a/modules/20_processing/substitution_dec18/sets.gms +++ b/modules/20_processing/substitution_dec18/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets @@ -31,4 +32,4 @@ no_milling_ginning20(processing_subst20) Processing activities without milling a oilcake_substitutes20(kpr) products that can be substituted for oilcakes /soybean,rapeseed,groundnut,sunflower,oilpalm,cottn_pro,oilcakes/ -; \ No newline at end of file +; diff --git a/modules/20_processing/substitution_dec18/solve.gms b/modules/20_processing/substitution_dec18/solve.gms deleted file mode 100644 index 8b13789179..0000000000 --- a/modules/20_processing/substitution_dec18/solve.gms +++ /dev/null @@ -1 +0,0 @@ - diff --git a/modules/21_trade/free_apr16/declarations.gms b/modules/21_trade/free_apr16/declarations.gms index 3978dc7250..6f945a5a8f 100644 --- a/modules/21_trade/free_apr16/declarations.gms +++ b/modules/21_trade/free_apr16/declarations.gms @@ -1,23 +1,24 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -positive variables - vm_cost_trade(i) Regional trade costs (mio. USD05MER per yr) -; - -equations - q21_trade_glo(k_trade) Global production constraint (mio. tDM per yr) - q21_notrade(i,k_notrade) Regional production constraint of non-tradable commodities (mio. tDM per yr) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_cost_trade(t,i,type) Regional trade costs (mio. USD05MER per yr) - oq21_trade_glo(t,k_trade,type) Global production constraint (mio. tDM per yr) - oq21_notrade(t,i,k_notrade,type) Regional production constraint of non-tradable commodities (mio. tDM per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + +positive variables + vm_cost_trade(i) Regional trade costs (mio. USD05MER per yr) +; + +equations + q21_trade_glo(k_trade) Global production constraint (mio. tDM per yr) + q21_notrade(i,k_notrade) Regional production constraint of non-tradable commodities (mio. tDM per yr) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_cost_trade(t,i,type) Regional trade costs (mio. USD05MER per yr) + oq21_trade_glo(t,k_trade,type) Global production constraint (mio. tDM per yr) + oq21_notrade(t,i,k_notrade,type) Regional production constraint of non-tradable commodities (mio. tDM per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/21_trade/free_apr16/equations.gms b/modules/21_trade/free_apr16/equations.gms index ec3f4c8dfb..acad8e056b 100644 --- a/modules/21_trade/free_apr16/equations.gms +++ b/modules/21_trade/free_apr16/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 q21_trade_glo(k_trade).. sum(i2 ,vm_prod_reg(i2,k_trade)) =g= sum(i2, vm_supply(i2,k_trade)); diff --git a/modules/21_trade/free_apr16/not_used.txt b/modules/21_trade/free_apr16/not_used.txt index aa2c8d2e19..d78901bb63 100644 --- a/modules/21_trade/free_apr16/not_used.txt +++ b/modules/21_trade/free_apr16/not_used.txt @@ -1,6 +1,7 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason diff --git a/modules/21_trade/free_apr16/postsolve.gms b/modules/21_trade/free_apr16/postsolve.gms index bb7cc9b597..065984e0eb 100644 --- a/modules/21_trade/free_apr16/postsolve.gms +++ b/modules/21_trade/free_apr16/postsolve.gms @@ -1,21 +1,22 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_cost_trade(t,i,"marginal") = vm_cost_trade.m(i); - oq21_trade_glo(t,k_trade,"marginal") = q21_trade_glo.m(k_trade); - oq21_notrade(t,i,k_notrade,"marginal") = q21_notrade.m(i,k_notrade); - ov_cost_trade(t,i,"level") = vm_cost_trade.l(i); - oq21_trade_glo(t,k_trade,"level") = q21_trade_glo.l(k_trade); - oq21_notrade(t,i,k_notrade,"level") = q21_notrade.l(i,k_notrade); - ov_cost_trade(t,i,"upper") = vm_cost_trade.up(i); - oq21_trade_glo(t,k_trade,"upper") = q21_trade_glo.up(k_trade); - oq21_notrade(t,i,k_notrade,"upper") = q21_notrade.up(i,k_notrade); - ov_cost_trade(t,i,"lower") = vm_cost_trade.lo(i); - oq21_trade_glo(t,k_trade,"lower") = q21_trade_glo.lo(k_trade); - oq21_notrade(t,i,k_notrade,"lower") = q21_notrade.lo(i,k_notrade); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_cost_trade(t,i,"marginal") = vm_cost_trade.m(i); + oq21_trade_glo(t,k_trade,"marginal") = q21_trade_glo.m(k_trade); + oq21_notrade(t,i,k_notrade,"marginal") = q21_notrade.m(i,k_notrade); + ov_cost_trade(t,i,"level") = vm_cost_trade.l(i); + oq21_trade_glo(t,k_trade,"level") = q21_trade_glo.l(k_trade); + oq21_notrade(t,i,k_notrade,"level") = q21_notrade.l(i,k_notrade); + ov_cost_trade(t,i,"upper") = vm_cost_trade.up(i); + oq21_trade_glo(t,k_trade,"upper") = q21_trade_glo.up(k_trade); + oq21_notrade(t,i,k_notrade,"upper") = q21_notrade.up(i,k_notrade); + ov_cost_trade(t,i,"lower") = vm_cost_trade.lo(i); + oq21_trade_glo(t,k_trade,"lower") = q21_trade_glo.lo(k_trade); + oq21_notrade(t,i,k_notrade,"lower") = q21_notrade.lo(i,k_notrade); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/21_trade/free_apr16/preloop.gms b/modules/21_trade/free_apr16/preloop.gms index 6862a00ab2..04689a87ff 100644 --- a/modules/21_trade/free_apr16/preloop.gms +++ b/modules/21_trade/free_apr16/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/21_trade/free_apr16.gms b/modules/21_trade/free_apr16/realization.gms similarity index 69% rename from modules/21_trade/free_apr16.gms rename to modules/21_trade/free_apr16/realization.gms index 9b8d5711e1..7f1145f358 100644 --- a/modules/21_trade/free_apr16.gms +++ b/modules/21_trade/free_apr16/realization.gms @@ -1,17 +1,18 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description In this realization, agricultural trade is fully liberalized in all timesteps. - -*' @limitations This realization does not account for current trends in agricultural trade. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/21_trade/free_apr16/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/21_trade/free_apr16/declarations.gms" -$Ifi "%phase%" == "equations" $include "./modules/21_trade/free_apr16/equations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/21_trade/free_apr16/preloop.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/21_trade/free_apr16/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description In this realization, agricultural trade is fully liberalized in all timesteps. + +*' @limitations This realization does not account for current trends in agricultural trade. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/21_trade/free_apr16/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/21_trade/free_apr16/declarations.gms" +$Ifi "%phase%" == "equations" $include "./modules/21_trade/free_apr16/equations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/21_trade/free_apr16/preloop.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/21_trade/free_apr16/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/21_trade/free_apr16/sets.gms b/modules/21_trade/free_apr16/sets.gms index ac5599bcea..80c1071f41 100644 --- a/modules/21_trade/free_apr16/sets.gms +++ b/modules/21_trade/free_apr16/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets diff --git a/modules/21_trade/21_trade.gms b/modules/21_trade/module.gms similarity index 62% rename from modules/21_trade/21_trade.gms rename to modules/21_trade/module.gms index a7da485948..80518d0021 100644 --- a/modules/21_trade/21_trade.gms +++ b/modules/21_trade/module.gms @@ -1,20 +1,21 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Agricultural trade -*' -*' @description This module represents agricutlural trade among world regions. -*' It ensures that the regional demand is met by domestic production and imports from other regions. -*' The global trade balance dictates that global production must be larger than or equal to global demand. -*' For non-traded goods, the regional production must be larger than or equal to regional demand. -*' -*' -*' @authors Xiaoxi Wang, Anne Biewald, Christoph Schmitz, Markus Bonsch -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%trade%" == "free_apr16" $include "./modules/21_trade/free_apr16.gms" -$Ifi "%trade%" == "off" $include "./modules/21_trade/off.gms" -$Ifi "%trade%" == "selfsuff_reduced" $include "./modules/21_trade/selfsuff_reduced.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Agricultural trade +*' +*' @description This module represents agricutlural trade among world regions. +*' It ensures that the regional demand is met by domestic production and imports from other regions. +*' The global trade balance dictates that global production must be larger than or equal to global demand. +*' For non-traded goods, the regional production must be larger than or equal to regional demand. +*' +*' +*' @authors Xiaoxi Wang, Anne Biewald, Christoph Schmitz, Markus Bonsch +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%trade%" == "free_apr16" $include "./modules/21_trade/free_apr16/realization.gms" +$Ifi "%trade%" == "off" $include "./modules/21_trade/off/realization.gms" +$Ifi "%trade%" == "selfsuff_reduced" $include "./modules/21_trade/selfsuff_reduced/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/21_trade/off/declarations.gms b/modules/21_trade/off/declarations.gms index 3e17be214a..5398e1aba1 100644 --- a/modules/21_trade/off/declarations.gms +++ b/modules/21_trade/off/declarations.gms @@ -1,21 +1,22 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -positive variables - vm_cost_trade(i) Regional trade costs (mio. USD05MER per yr) -; - -equations - q21_notrade(i,k) Regional production constraint of non-tradable commodities (mio. tDM per yr) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_cost_trade(t,i,type) Regional trade costs (mio. USD05MER per yr) - oq21_notrade(t,i,k,type) Regional production constraint of non-tradable commodities (mio. tDM per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + +positive variables + vm_cost_trade(i) Regional trade costs (mio. USD05MER per yr) +; + +equations + q21_notrade(i,k) Regional production constraint of non-tradable commodities (mio. tDM per yr) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_cost_trade(t,i,type) Regional trade costs (mio. USD05MER per yr) + oq21_notrade(t,i,k,type) Regional production constraint of non-tradable commodities (mio. tDM per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/21_trade/off/equations.gms b/modules/21_trade/off/equations.gms index 8a920fea4b..8aeedb6448 100644 --- a/modules/21_trade/off/equations.gms +++ b/modules/21_trade/off/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 q21_notrade(i2,k).. vm_prod_reg(i2,k) =g= vm_supply(i2,k); diff --git a/modules/21_trade/off/not_used.txt b/modules/21_trade/off/not_used.txt index aa2c8d2e19..d78901bb63 100644 --- a/modules/21_trade/off/not_used.txt +++ b/modules/21_trade/off/not_used.txt @@ -1,6 +1,7 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason diff --git a/modules/21_trade/off/postsolve.gms b/modules/21_trade/off/postsolve.gms index 028f40ee57..f1229689ca 100644 --- a/modules/21_trade/off/postsolve.gms +++ b/modules/21_trade/off/postsolve.gms @@ -1,17 +1,18 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_cost_trade(t,i,"marginal") = vm_cost_trade.m(i); - oq21_notrade(t,i,k,"marginal") = q21_notrade.m(i,k); - ov_cost_trade(t,i,"level") = vm_cost_trade.l(i); - oq21_notrade(t,i,k,"level") = q21_notrade.l(i,k); - ov_cost_trade(t,i,"upper") = vm_cost_trade.up(i); - oq21_notrade(t,i,k,"upper") = q21_notrade.up(i,k); - ov_cost_trade(t,i,"lower") = vm_cost_trade.lo(i); - oq21_notrade(t,i,k,"lower") = q21_notrade.lo(i,k); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_cost_trade(t,i,"marginal") = vm_cost_trade.m(i); + oq21_notrade(t,i,k,"marginal") = q21_notrade.m(i,k); + ov_cost_trade(t,i,"level") = vm_cost_trade.l(i); + oq21_notrade(t,i,k,"level") = q21_notrade.l(i,k); + ov_cost_trade(t,i,"upper") = vm_cost_trade.up(i); + oq21_notrade(t,i,k,"upper") = q21_notrade.up(i,k); + ov_cost_trade(t,i,"lower") = vm_cost_trade.lo(i); + oq21_notrade(t,i,k,"lower") = q21_notrade.lo(i,k); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/21_trade/off/preloop.gms b/modules/21_trade/off/preloop.gms index 6862a00ab2..04689a87ff 100644 --- a/modules/21_trade/off/preloop.gms +++ b/modules/21_trade/off/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/21_trade/off.gms b/modules/21_trade/off/realization.gms similarity index 67% rename from modules/21_trade/off.gms rename to modules/21_trade/off/realization.gms index b889ee1710..db8a2f062a 100644 --- a/modules/21_trade/off.gms +++ b/modules/21_trade/off/realization.gms @@ -1,17 +1,18 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description In this realization, there is no agricultural trade, i.e. regions -*' are fully self-sufficient and dependent on domestic production. - -*' @limitations This realization does not account for current trends in agricultural trade. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "declarations" $include "./modules/21_trade/off/declarations.gms" -$Ifi "%phase%" == "equations" $include "./modules/21_trade/off/equations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/21_trade/off/preloop.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/21_trade/off/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description In this realization, there is no agricultural trade, i.e. regions +*' are fully self-sufficient and dependent on domestic production. + +*' @limitations This realization does not account for current trends in agricultural trade. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "declarations" $include "./modules/21_trade/off/declarations.gms" +$Ifi "%phase%" == "equations" $include "./modules/21_trade/off/equations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/21_trade/off/preloop.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/21_trade/off/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/21_trade/selfsuff_reduced/declarations.gms b/modules/21_trade/selfsuff_reduced/declarations.gms index d817b54dd6..633cd91ee2 100644 --- a/modules/21_trade/selfsuff_reduced/declarations.gms +++ b/modules/21_trade/selfsuff_reduced/declarations.gms @@ -1,46 +1,47 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -parameters - i21_trade_bal_reduction(t_all,k_trade) Trade balance reduction (1) - i21_trade_margin(i,k_trade) Trade margins (USD05MER per tDM) - i21_trade_tariff(i,k_trade) Trade tariffs (USD05MER per tDM) -; - -positive variables - v21_excess_dem(k_trade) Global excess demand (mio. tDM per yr) - v21_excess_prod(i,k_trade) Regional excess production (mio. tDM per yr) - vm_cost_trade(i) Regional trade costs (mio. USD05MER per yr) - v21_cost_trade_reg(i,k_trade) Regional trade costs for each tradable commodity (mio. USD05MER per yr) -; - -equations - q21_trade_glo(k_trade) Global production constraint (mio. tDM per yr) - q21_notrade(i,k_notrade) Regional production constraint of non-tradable commodities (mio. tDM per yr) - q21_trade_reg(i,k_trade) Regional trade balances i.e. minimum self-sufficiency ratio (1) - q21_trade_reg_up(i,k_trade) Regional trade balances i.e. maximum self-sufficiency ratio (1) - q21_excess_dem(k_trade) Global excess demand (mio. tDM per yr) - q21_excess_supply(i,k_trade) Regional excess production (mio. tDM per yr) - q21_cost_trade(i) Regional trade costs (mio. USD05MER per yr) - q21_cost_trade_reg(i,k_trade) Regional trade costs for each tradable commodity (mio. USD05MER per yr) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov21_excess_dem(t,k_trade,type) Global excess demand (mio. tDM per yr) - ov21_excess_prod(t,i,k_trade,type) Regional excess production (mio. tDM per yr) - ov_cost_trade(t,i,type) Regional trade costs (mio. USD05MER per yr) - ov21_cost_trade_reg(t,i,k_trade,type) Regional trade costs for each tradable commodity (mio. USD05MER per yr) - oq21_trade_glo(t,k_trade,type) Global production constraint (mio. tDM per yr) - oq21_notrade(t,i,k_notrade,type) Regional production constraint of non-tradable commodities (mio. tDM per yr) - oq21_trade_reg(t,i,k_trade,type) Regional trade balances i.e. minimum self-sufficiency ratio (1) - oq21_trade_reg_up(t,i,k_trade,type) Regional trade balances i.e. maximum self-sufficiency ratio (1) - oq21_excess_dem(t,k_trade,type) Global excess demand (mio. tDM per yr) - oq21_excess_supply(t,i,k_trade,type) Regional excess production (mio. tDM per yr) - oq21_cost_trade(t,i,type) Regional trade costs (mio. USD05MER per yr) - oq21_cost_trade_reg(t,i,k_trade,type) Regional trade costs for each tradable commodity (mio. USD05MER per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +parameters + i21_trade_bal_reduction(t_all,k_trade) Trade balance reduction (1) + i21_trade_margin(i,k_trade) Trade margins (USD05MER per tDM) + i21_trade_tariff(i,k_trade) Trade tariffs (USD05MER per tDM) +; + +positive variables + v21_excess_dem(k_trade) Global excess demand (mio. tDM per yr) + v21_excess_prod(i,k_trade) Regional excess production (mio. tDM per yr) + vm_cost_trade(i) Regional trade costs (mio. USD05MER per yr) + v21_cost_trade_reg(i,k_trade) Regional trade costs for each tradable commodity (mio. USD05MER per yr) +; + +equations + q21_trade_glo(k_trade) Global production constraint (mio. tDM per yr) + q21_notrade(i,k_notrade) Regional production constraint of non-tradable commodities (mio. tDM per yr) + q21_trade_reg(i,k_trade) Regional trade balances i.e. minimum self-sufficiency ratio (1) + q21_trade_reg_up(i,k_trade) Regional trade balances i.e. maximum self-sufficiency ratio (1) + q21_excess_dem(k_trade) Global excess demand (mio. tDM per yr) + q21_excess_supply(i,k_trade) Regional excess production (mio. tDM per yr) + q21_cost_trade(i) Regional trade costs (mio. USD05MER per yr) + q21_cost_trade_reg(i,k_trade) Regional trade costs for each tradable commodity (mio. USD05MER per yr) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov21_excess_dem(t,k_trade,type) Global excess demand (mio. tDM per yr) + ov21_excess_prod(t,i,k_trade,type) Regional excess production (mio. tDM per yr) + ov_cost_trade(t,i,type) Regional trade costs (mio. USD05MER per yr) + ov21_cost_trade_reg(t,i,k_trade,type) Regional trade costs for each tradable commodity (mio. USD05MER per yr) + oq21_trade_glo(t,k_trade,type) Global production constraint (mio. tDM per yr) + oq21_notrade(t,i,k_notrade,type) Regional production constraint of non-tradable commodities (mio. tDM per yr) + oq21_trade_reg(t,i,k_trade,type) Regional trade balances i.e. minimum self-sufficiency ratio (1) + oq21_trade_reg_up(t,i,k_trade,type) Regional trade balances i.e. maximum self-sufficiency ratio (1) + oq21_excess_dem(t,k_trade,type) Global excess demand (mio. tDM per yr) + oq21_excess_supply(t,i,k_trade,type) Regional excess production (mio. tDM per yr) + oq21_cost_trade(t,i,type) Regional trade costs (mio. USD05MER per yr) + oq21_cost_trade_reg(t,i,k_trade,type) Regional trade costs for each tradable commodity (mio. USD05MER per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/21_trade/selfsuff_reduced/equations.gms b/modules/21_trade/selfsuff_reduced/equations.gms index 00584514ac..cf08fc9cc5 100644 --- a/modules/21_trade/selfsuff_reduced/equations.gms +++ b/modules/21_trade/selfsuff_reduced/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations diff --git a/modules/21_trade/selfsuff_reduced/input.gms b/modules/21_trade/selfsuff_reduced/input.gms index ce44951a2b..b9c491a893 100644 --- a/modules/21_trade/selfsuff_reduced/input.gms +++ b/modules/21_trade/selfsuff_reduced/input.gms @@ -1,44 +1,45 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -$setglobal c21_trade_liberalization l909090r808080 -* options are "regionalized" and "globalized" and "fragmented" - -scalars - s21_trade_tariff Trade tariff switch (1=on 0=off) (1) / 1 / -; - -table f21_trade_bal_reduction(t_all,trade_groups21,trade_regime21) Share of inelastic trade pool (1) -$ondelim -$include "./modules/21_trade/input/f21_trade_bal_reduction.cs3" -$offdelim; - -table f21_self_suff(t_all,i,kall) Regional self-sufficiency rates (1) -$ondelim -$include "./modules/21_trade/input/f21_trade_self_suff.cs3" -$offdelim; - -table f21_exp_shr(t_all,i,kall) Regional and crop-specific export share (1) -$ondelim -$include "./modules/21_trade/input/f21_trade_export_share.cs3" -$offdelim; - -table f21_trade_balanceflow(t_all,kall) Domestic balance flows (mio. tDM per yr) -$ondelim -$include "./modules/21_trade/input/f21_trade_balanceflow.cs3" -$offdelim; - -table f21_trade_margin(i,kall) Costs of freight and insurance (USD05MER per tDM) -$ondelim -$include "./modules/21_trade/input/f21_trade_margin.cs3" -$offdelim -; - -table f21_trade_tariff(i,kall) Specific duty tariffs (USD05MER per tDM) -$ondelim -$include "./modules/21_trade/input/f21_trade_tariff.cs3" -$offdelim -; +*** | (C) 2008-2019 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 + +$setglobal c21_trade_liberalization l909090r808080 +* options are "regionalized" and "globalized" and "fragmented" + +scalars + s21_trade_tariff Trade tariff switch (1=on 0=off) (1) / 1 / +; + +table f21_trade_bal_reduction(t_all,trade_groups21,trade_regime21) Share of inelastic trade pool (1) +$ondelim +$include "./modules/21_trade/input/f21_trade_bal_reduction.cs3" +$offdelim; + +table f21_self_suff(t_all,i,kall) Regional self-sufficiency rates (1) +$ondelim +$include "./modules/21_trade/input/f21_trade_self_suff.cs3" +$offdelim; + +table f21_exp_shr(t_all,i,kall) Regional and crop-specific export share (1) +$ondelim +$include "./modules/21_trade/input/f21_trade_export_share.cs3" +$offdelim; + +table f21_trade_balanceflow(t_all,kall) Domestic balance flows (mio. tDM per yr) +$ondelim +$include "./modules/21_trade/input/f21_trade_balanceflow.cs3" +$offdelim; + +table f21_trade_margin(i,kall) Costs of freight and insurance (USD05MER per tDM) +$ondelim +$include "./modules/21_trade/input/f21_trade_margin.cs3" +$offdelim +; + +table f21_trade_tariff(i,kall) Specific duty tariffs (USD05MER per tDM) +$ondelim +$include "./modules/21_trade/input/f21_trade_tariff.cs3" +$offdelim +; diff --git a/modules/21_trade/selfsuff_reduced/postsolve.gms b/modules/21_trade/selfsuff_reduced/postsolve.gms index e9cba731a3..4fe441c982 100644 --- a/modules/21_trade/selfsuff_reduced/postsolve.gms +++ b/modules/21_trade/selfsuff_reduced/postsolve.gms @@ -1,56 +1,57 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov21_excess_dem(t,k_trade,"marginal") = v21_excess_dem.m(k_trade); - ov21_excess_prod(t,i,k_trade,"marginal") = v21_excess_prod.m(i,k_trade); - ov_cost_trade(t,i,"marginal") = vm_cost_trade.m(i); - ov21_cost_trade_reg(t,i,k_trade,"marginal") = v21_cost_trade_reg.m(i,k_trade); - oq21_trade_glo(t,k_trade,"marginal") = q21_trade_glo.m(k_trade); - oq21_notrade(t,i,k_notrade,"marginal") = q21_notrade.m(i,k_notrade); - oq21_trade_reg(t,i,k_trade,"marginal") = q21_trade_reg.m(i,k_trade); - oq21_trade_reg_up(t,i,k_trade,"marginal") = q21_trade_reg_up.m(i,k_trade); - oq21_excess_dem(t,k_trade,"marginal") = q21_excess_dem.m(k_trade); - oq21_excess_supply(t,i,k_trade,"marginal") = q21_excess_supply.m(i,k_trade); - oq21_cost_trade(t,i,"marginal") = q21_cost_trade.m(i); - oq21_cost_trade_reg(t,i,k_trade,"marginal") = q21_cost_trade_reg.m(i,k_trade); - ov21_excess_dem(t,k_trade,"level") = v21_excess_dem.l(k_trade); - ov21_excess_prod(t,i,k_trade,"level") = v21_excess_prod.l(i,k_trade); - ov_cost_trade(t,i,"level") = vm_cost_trade.l(i); - ov21_cost_trade_reg(t,i,k_trade,"level") = v21_cost_trade_reg.l(i,k_trade); - oq21_trade_glo(t,k_trade,"level") = q21_trade_glo.l(k_trade); - oq21_notrade(t,i,k_notrade,"level") = q21_notrade.l(i,k_notrade); - oq21_trade_reg(t,i,k_trade,"level") = q21_trade_reg.l(i,k_trade); - oq21_trade_reg_up(t,i,k_trade,"level") = q21_trade_reg_up.l(i,k_trade); - oq21_excess_dem(t,k_trade,"level") = q21_excess_dem.l(k_trade); - oq21_excess_supply(t,i,k_trade,"level") = q21_excess_supply.l(i,k_trade); - oq21_cost_trade(t,i,"level") = q21_cost_trade.l(i); - oq21_cost_trade_reg(t,i,k_trade,"level") = q21_cost_trade_reg.l(i,k_trade); - ov21_excess_dem(t,k_trade,"upper") = v21_excess_dem.up(k_trade); - ov21_excess_prod(t,i,k_trade,"upper") = v21_excess_prod.up(i,k_trade); - ov_cost_trade(t,i,"upper") = vm_cost_trade.up(i); - ov21_cost_trade_reg(t,i,k_trade,"upper") = v21_cost_trade_reg.up(i,k_trade); - oq21_trade_glo(t,k_trade,"upper") = q21_trade_glo.up(k_trade); - oq21_notrade(t,i,k_notrade,"upper") = q21_notrade.up(i,k_notrade); - oq21_trade_reg(t,i,k_trade,"upper") = q21_trade_reg.up(i,k_trade); - oq21_trade_reg_up(t,i,k_trade,"upper") = q21_trade_reg_up.up(i,k_trade); - oq21_excess_dem(t,k_trade,"upper") = q21_excess_dem.up(k_trade); - oq21_excess_supply(t,i,k_trade,"upper") = q21_excess_supply.up(i,k_trade); - oq21_cost_trade(t,i,"upper") = q21_cost_trade.up(i); - oq21_cost_trade_reg(t,i,k_trade,"upper") = q21_cost_trade_reg.up(i,k_trade); - ov21_excess_dem(t,k_trade,"lower") = v21_excess_dem.lo(k_trade); - ov21_excess_prod(t,i,k_trade,"lower") = v21_excess_prod.lo(i,k_trade); - ov_cost_trade(t,i,"lower") = vm_cost_trade.lo(i); - ov21_cost_trade_reg(t,i,k_trade,"lower") = v21_cost_trade_reg.lo(i,k_trade); - oq21_trade_glo(t,k_trade,"lower") = q21_trade_glo.lo(k_trade); - oq21_notrade(t,i,k_notrade,"lower") = q21_notrade.lo(i,k_notrade); - oq21_trade_reg(t,i,k_trade,"lower") = q21_trade_reg.lo(i,k_trade); - oq21_trade_reg_up(t,i,k_trade,"lower") = q21_trade_reg_up.lo(i,k_trade); - oq21_excess_dem(t,k_trade,"lower") = q21_excess_dem.lo(k_trade); - oq21_excess_supply(t,i,k_trade,"lower") = q21_excess_supply.lo(i,k_trade); - oq21_cost_trade(t,i,"lower") = q21_cost_trade.lo(i); - oq21_cost_trade_reg(t,i,k_trade,"lower") = q21_cost_trade_reg.lo(i,k_trade); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov21_excess_dem(t,k_trade,"marginal") = v21_excess_dem.m(k_trade); + ov21_excess_prod(t,i,k_trade,"marginal") = v21_excess_prod.m(i,k_trade); + ov_cost_trade(t,i,"marginal") = vm_cost_trade.m(i); + ov21_cost_trade_reg(t,i,k_trade,"marginal") = v21_cost_trade_reg.m(i,k_trade); + oq21_trade_glo(t,k_trade,"marginal") = q21_trade_glo.m(k_trade); + oq21_notrade(t,i,k_notrade,"marginal") = q21_notrade.m(i,k_notrade); + oq21_trade_reg(t,i,k_trade,"marginal") = q21_trade_reg.m(i,k_trade); + oq21_trade_reg_up(t,i,k_trade,"marginal") = q21_trade_reg_up.m(i,k_trade); + oq21_excess_dem(t,k_trade,"marginal") = q21_excess_dem.m(k_trade); + oq21_excess_supply(t,i,k_trade,"marginal") = q21_excess_supply.m(i,k_trade); + oq21_cost_trade(t,i,"marginal") = q21_cost_trade.m(i); + oq21_cost_trade_reg(t,i,k_trade,"marginal") = q21_cost_trade_reg.m(i,k_trade); + ov21_excess_dem(t,k_trade,"level") = v21_excess_dem.l(k_trade); + ov21_excess_prod(t,i,k_trade,"level") = v21_excess_prod.l(i,k_trade); + ov_cost_trade(t,i,"level") = vm_cost_trade.l(i); + ov21_cost_trade_reg(t,i,k_trade,"level") = v21_cost_trade_reg.l(i,k_trade); + oq21_trade_glo(t,k_trade,"level") = q21_trade_glo.l(k_trade); + oq21_notrade(t,i,k_notrade,"level") = q21_notrade.l(i,k_notrade); + oq21_trade_reg(t,i,k_trade,"level") = q21_trade_reg.l(i,k_trade); + oq21_trade_reg_up(t,i,k_trade,"level") = q21_trade_reg_up.l(i,k_trade); + oq21_excess_dem(t,k_trade,"level") = q21_excess_dem.l(k_trade); + oq21_excess_supply(t,i,k_trade,"level") = q21_excess_supply.l(i,k_trade); + oq21_cost_trade(t,i,"level") = q21_cost_trade.l(i); + oq21_cost_trade_reg(t,i,k_trade,"level") = q21_cost_trade_reg.l(i,k_trade); + ov21_excess_dem(t,k_trade,"upper") = v21_excess_dem.up(k_trade); + ov21_excess_prod(t,i,k_trade,"upper") = v21_excess_prod.up(i,k_trade); + ov_cost_trade(t,i,"upper") = vm_cost_trade.up(i); + ov21_cost_trade_reg(t,i,k_trade,"upper") = v21_cost_trade_reg.up(i,k_trade); + oq21_trade_glo(t,k_trade,"upper") = q21_trade_glo.up(k_trade); + oq21_notrade(t,i,k_notrade,"upper") = q21_notrade.up(i,k_notrade); + oq21_trade_reg(t,i,k_trade,"upper") = q21_trade_reg.up(i,k_trade); + oq21_trade_reg_up(t,i,k_trade,"upper") = q21_trade_reg_up.up(i,k_trade); + oq21_excess_dem(t,k_trade,"upper") = q21_excess_dem.up(k_trade); + oq21_excess_supply(t,i,k_trade,"upper") = q21_excess_supply.up(i,k_trade); + oq21_cost_trade(t,i,"upper") = q21_cost_trade.up(i); + oq21_cost_trade_reg(t,i,k_trade,"upper") = q21_cost_trade_reg.up(i,k_trade); + ov21_excess_dem(t,k_trade,"lower") = v21_excess_dem.lo(k_trade); + ov21_excess_prod(t,i,k_trade,"lower") = v21_excess_prod.lo(i,k_trade); + ov_cost_trade(t,i,"lower") = vm_cost_trade.lo(i); + ov21_cost_trade_reg(t,i,k_trade,"lower") = v21_cost_trade_reg.lo(i,k_trade); + oq21_trade_glo(t,k_trade,"lower") = q21_trade_glo.lo(k_trade); + oq21_notrade(t,i,k_notrade,"lower") = q21_notrade.lo(i,k_notrade); + oq21_trade_reg(t,i,k_trade,"lower") = q21_trade_reg.lo(i,k_trade); + oq21_trade_reg_up(t,i,k_trade,"lower") = q21_trade_reg_up.lo(i,k_trade); + oq21_excess_dem(t,k_trade,"lower") = q21_excess_dem.lo(k_trade); + oq21_excess_supply(t,i,k_trade,"lower") = q21_excess_supply.lo(i,k_trade); + oq21_cost_trade(t,i,"lower") = q21_cost_trade.lo(i); + oq21_cost_trade_reg(t,i,k_trade,"lower") = q21_cost_trade_reg.lo(i,k_trade); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/21_trade/selfsuff_reduced/preloop.gms b/modules/21_trade/selfsuff_reduced/preloop.gms index be8d93bbda..765c906874 100644 --- a/modules/21_trade/selfsuff_reduced/preloop.gms +++ b/modules/21_trade/selfsuff_reduced/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/21_trade/selfsuff_reduced.gms b/modules/21_trade/selfsuff_reduced/realization.gms similarity index 82% rename from modules/21_trade/selfsuff_reduced.gms rename to modules/21_trade/selfsuff_reduced/realization.gms index 1da887b650..fe63c377ae 100644 --- a/modules/21_trade/selfsuff_reduced.gms +++ b/modules/21_trade/selfsuff_reduced/realization.gms @@ -1,30 +1,31 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description Within this realization, there are two ways for a region to fulfill -*' its demand for agricultural products: a self-sufficiency pool based on -*' historical region specific trade patterns, and a comparative advantage pool -*' based on most cost-efficient production. - -*' In the self-sufficiency pool, regional self-sufficiency ratios `f21_self_suff_seedred_1995(i,k)` defines -*' how much of the demand of each region `i` for each traded goods `k_trade` has to be met by domestic production. -*' Self sufficiency ratios smaller than one indicate that the region imports from the world market, -*' while self-sufficiencies greater than one indicate that the region produces for export. Trade costs, -*' inlucding trade margins and tariffs, are considered. -*' -*' ![Implementation of trade.](trade_pools.png){ width=100% } - -*' @limitations This realization depends on predetermined self-sufficiency rates and export shares, -*' which leads to a relative fixed trade pattern. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/21_trade/selfsuff_reduced/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/21_trade/selfsuff_reduced/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/21_trade/selfsuff_reduced/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/21_trade/selfsuff_reduced/equations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/21_trade/selfsuff_reduced/preloop.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/21_trade/selfsuff_reduced/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description Within this realization, there are two ways for a region to fulfill +*' its demand for agricultural products: a self-sufficiency pool based on +*' historical region specific trade patterns, and a comparative advantage pool +*' based on most cost-efficient production. + +*' In the self-sufficiency pool, regional self-sufficiency ratios `f21_self_suff_seedred_1995(i,k)` defines +*' how much of the demand of each region `i` for each traded goods `k_trade` has to be met by domestic production. +*' Self sufficiency ratios smaller than one indicate that the region imports from the world market, +*' while self-sufficiencies greater than one indicate that the region produces for export. Trade costs, +*' inlucding trade margins and tariffs, are considered. +*' +*' ![Implementation of trade.](trade_pools.png){ width=100% } + +*' @limitations This realization depends on predetermined self-sufficiency rates and export shares, +*' which leads to a relative fixed trade pattern. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/21_trade/selfsuff_reduced/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/21_trade/selfsuff_reduced/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/21_trade/selfsuff_reduced/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/21_trade/selfsuff_reduced/equations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/21_trade/selfsuff_reduced/preloop.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/21_trade/selfsuff_reduced/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/21_trade/selfsuff_reduced/sets.gms b/modules/21_trade/selfsuff_reduced/sets.gms index 56f9f3f230..9b36bf46fd 100644 --- a/modules/21_trade/selfsuff_reduced/sets.gms +++ b/modules/21_trade/selfsuff_reduced/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets diff --git a/modules/30_crop/endo_jun13/declarations.gms b/modules/30_crop/endo_jun13/declarations.gms index bbceb5f0d5..d1a819edca 100644 --- a/modules/30_crop/endo_jun13/declarations.gms +++ b/modules/30_crop/endo_jun13/declarations.gms @@ -1,32 +1,33 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -positive variables - vm_area(j,kcr,w) Agricultural production area (mio. ha) -; - -equations - q30_cropland(j) Total cropland calculation (mio. ha) - q30_suitability(j) Suitability constraint (mio. ha) - q30_rotation_max(j,crp30,w) Local maximum rotational constraints (mio. ha) - q30_rotation_min(j,crp30,w) Local minimum rotational constraints (mio. ha) - q30_prod(j,kcr) Production of cropped products (mio. tDM) - q30_carbon(j,c_pools) Cropland carbon content calculation (mio. tC) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_area(t,j,kcr,w,type) Agricultural production area (mio. ha) - oq30_cropland(t,j,type) Total cropland calculation (mio. ha) - oq30_suitability(t,j,type) Suitability constraint (mio. ha) - oq30_rotation_max(t,j,crp30,w,type) Local maximum rotational constraints (mio. ha) - oq30_rotation_min(t,j,crp30,w,type) Local minimum rotational constraints (mio. ha) - oq30_prod(t,j,kcr,type) Production of cropped products (mio. tDM) - oq30_carbon(t,j,c_pools,type) Cropland carbon content calculation (mio. tC) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### - -*** EOF declarations.gms *** +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +positive variables + vm_area(j,kcr,w) Agricultural production area (mio. ha) +; + +equations + q30_cropland(j) Total cropland calculation (mio. ha) + q30_suitability(j) Suitability constraint (mio. ha) + q30_rotation_max(j,crp30,w) Local maximum rotational constraints (mio. ha) + q30_rotation_min(j,crp30,w) Local minimum rotational constraints (mio. ha) + q30_prod(j,kcr) Production of cropped products (mio. tDM) + q30_carbon(j,c_pools) Cropland carbon content calculation (mio. tC) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_area(t,j,kcr,w,type) Agricultural production area (mio. ha) + oq30_cropland(t,j,type) Total cropland calculation (mio. ha) + oq30_suitability(t,j,type) Suitability constraint (mio. ha) + oq30_rotation_max(t,j,crp30,w,type) Local maximum rotational constraints (mio. ha) + oq30_rotation_min(t,j,crp30,w,type) Local minimum rotational constraints (mio. ha) + oq30_prod(t,j,kcr,type) Production of cropped products (mio. tDM) + oq30_carbon(t,j,c_pools,type) Cropland carbon content calculation (mio. tC) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### + +*** EOF declarations.gms *** diff --git a/modules/30_crop/endo_jun13/equations.gms b/modules/30_crop/endo_jun13/equations.gms index d2d589a85b..61c620dc16 100644 --- a/modules/30_crop/endo_jun13/equations.gms +++ b/modules/30_crop/endo_jun13/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations diff --git a/modules/30_crop/endo_jun13/input.gms b/modules/30_crop/endo_jun13/input.gms index 70ef2fa74c..aa60911320 100644 --- a/modules/30_crop/endo_jun13/input.gms +++ b/modules/30_crop/endo_jun13/input.gms @@ -1,30 +1,31 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -********* CROP-ROTATIONAL CONSTRAINT ******************************************* - -parameter f30_rotation_max_shr(crp30) Maximum allowed area shares for each crop type (1) -/ -$ondelim -$include "./modules/30_crop/endo_jun13/input/f30_rotation_max.csv" -$offdelim -/; - -parameter f30_rotation_min_shr(crp30) Minimum allowed area shares for each crop type (1) -/ -$ondelim -$include "./modules/30_crop/endo_jun13/input/f30_rotation_min.csv" -$offdelim -/; - - -********* SUITABILITY CONSTRAINT ******************************************* - -table f30_land_si(j,si) Land area suitable and non-suitable as cropland (mio. ha) -$ondelim -$include "./modules/30_crop/endo_jun13/input/avl_land_si.cs3" -$offdelim -; +*** | (C) 2008-2019 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 + +********* CROP-ROTATIONAL CONSTRAINT ******************************************* + +parameter f30_rotation_max_shr(crp30) Maximum allowed area shares for each crop type (1) +/ +$ondelim +$include "./modules/30_crop/endo_jun13/input/f30_rotation_max.csv" +$offdelim +/; + +parameter f30_rotation_min_shr(crp30) Minimum allowed area shares for each crop type (1) +/ +$ondelim +$include "./modules/30_crop/endo_jun13/input/f30_rotation_min.csv" +$offdelim +/; + + +********* SUITABILITY CONSTRAINT ******************************************* + +table f30_land_si(j,si) Land area suitable and non-suitable as cropland (mio. ha) +$ondelim +$include "./modules/30_crop/endo_jun13/input/avl_land_si.cs3" +$offdelim +; diff --git a/modules/30_crop/endo_jun13/postsolve.gms b/modules/30_crop/endo_jun13/postsolve.gms index 0a790d3467..9f3974eb56 100644 --- a/modules/30_crop/endo_jun13/postsolve.gms +++ b/modules/30_crop/endo_jun13/postsolve.gms @@ -1,37 +1,38 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_area(t,j,kcr,w,"marginal") = vm_area.m(j,kcr,w); - oq30_cropland(t,j,"marginal") = q30_cropland.m(j); - oq30_suitability(t,j,"marginal") = q30_suitability.m(j); - oq30_rotation_max(t,j,crp30,w,"marginal") = q30_rotation_max.m(j,crp30,w); - oq30_rotation_min(t,j,crp30,w,"marginal") = q30_rotation_min.m(j,crp30,w); - oq30_prod(t,j,kcr,"marginal") = q30_prod.m(j,kcr); - oq30_carbon(t,j,c_pools,"marginal") = q30_carbon.m(j,c_pools); - ov_area(t,j,kcr,w,"level") = vm_area.l(j,kcr,w); - oq30_cropland(t,j,"level") = q30_cropland.l(j); - oq30_suitability(t,j,"level") = q30_suitability.l(j); - oq30_rotation_max(t,j,crp30,w,"level") = q30_rotation_max.l(j,crp30,w); - oq30_rotation_min(t,j,crp30,w,"level") = q30_rotation_min.l(j,crp30,w); - oq30_prod(t,j,kcr,"level") = q30_prod.l(j,kcr); - oq30_carbon(t,j,c_pools,"level") = q30_carbon.l(j,c_pools); - ov_area(t,j,kcr,w,"upper") = vm_area.up(j,kcr,w); - oq30_cropland(t,j,"upper") = q30_cropland.up(j); - oq30_suitability(t,j,"upper") = q30_suitability.up(j); - oq30_rotation_max(t,j,crp30,w,"upper") = q30_rotation_max.up(j,crp30,w); - oq30_rotation_min(t,j,crp30,w,"upper") = q30_rotation_min.up(j,crp30,w); - oq30_prod(t,j,kcr,"upper") = q30_prod.up(j,kcr); - oq30_carbon(t,j,c_pools,"upper") = q30_carbon.up(j,c_pools); - ov_area(t,j,kcr,w,"lower") = vm_area.lo(j,kcr,w); - oq30_cropland(t,j,"lower") = q30_cropland.lo(j); - oq30_suitability(t,j,"lower") = q30_suitability.lo(j); - oq30_rotation_max(t,j,crp30,w,"lower") = q30_rotation_max.lo(j,crp30,w); - oq30_rotation_min(t,j,crp30,w,"lower") = q30_rotation_min.lo(j,crp30,w); - oq30_prod(t,j,kcr,"lower") = q30_prod.lo(j,kcr); - oq30_carbon(t,j,c_pools,"lower") = q30_carbon.lo(j,c_pools); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_area(t,j,kcr,w,"marginal") = vm_area.m(j,kcr,w); + oq30_cropland(t,j,"marginal") = q30_cropland.m(j); + oq30_suitability(t,j,"marginal") = q30_suitability.m(j); + oq30_rotation_max(t,j,crp30,w,"marginal") = q30_rotation_max.m(j,crp30,w); + oq30_rotation_min(t,j,crp30,w,"marginal") = q30_rotation_min.m(j,crp30,w); + oq30_prod(t,j,kcr,"marginal") = q30_prod.m(j,kcr); + oq30_carbon(t,j,c_pools,"marginal") = q30_carbon.m(j,c_pools); + ov_area(t,j,kcr,w,"level") = vm_area.l(j,kcr,w); + oq30_cropland(t,j,"level") = q30_cropland.l(j); + oq30_suitability(t,j,"level") = q30_suitability.l(j); + oq30_rotation_max(t,j,crp30,w,"level") = q30_rotation_max.l(j,crp30,w); + oq30_rotation_min(t,j,crp30,w,"level") = q30_rotation_min.l(j,crp30,w); + oq30_prod(t,j,kcr,"level") = q30_prod.l(j,kcr); + oq30_carbon(t,j,c_pools,"level") = q30_carbon.l(j,c_pools); + ov_area(t,j,kcr,w,"upper") = vm_area.up(j,kcr,w); + oq30_cropland(t,j,"upper") = q30_cropland.up(j); + oq30_suitability(t,j,"upper") = q30_suitability.up(j); + oq30_rotation_max(t,j,crp30,w,"upper") = q30_rotation_max.up(j,crp30,w); + oq30_rotation_min(t,j,crp30,w,"upper") = q30_rotation_min.up(j,crp30,w); + oq30_prod(t,j,kcr,"upper") = q30_prod.up(j,kcr); + oq30_carbon(t,j,c_pools,"upper") = q30_carbon.up(j,c_pools); + ov_area(t,j,kcr,w,"lower") = vm_area.lo(j,kcr,w); + oq30_cropland(t,j,"lower") = q30_cropland.lo(j); + oq30_suitability(t,j,"lower") = q30_suitability.lo(j); + oq30_rotation_max(t,j,crp30,w,"lower") = q30_rotation_max.lo(j,crp30,w); + oq30_rotation_min(t,j,crp30,w,"lower") = q30_rotation_min.lo(j,crp30,w); + oq30_prod(t,j,kcr,"lower") = q30_prod.lo(j,kcr); + oq30_carbon(t,j,c_pools,"lower") = q30_carbon.lo(j,c_pools); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/30_crop/endo_jun13/presolve.gms b/modules/30_crop/endo_jun13/presolve.gms index 3fc728061d..49a3b67ae6 100644 --- a/modules/30_crop/endo_jun13/presolve.gms +++ b/modules/30_crop/endo_jun13/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de vm_area.fx(j,"begr","irrigated")=0; diff --git a/modules/30_crop/endo_jun13.gms b/modules/30_crop/endo_jun13/realization.gms similarity index 79% rename from modules/30_crop/endo_jun13.gms rename to modules/30_crop/endo_jun13/realization.gms index 11d0f3b118..888dd8a762 100644 --- a/modules/30_crop/endo_jun13.gms +++ b/modules/30_crop/endo_jun13/realization.gms @@ -1,27 +1,28 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description The endo_jun13 realization calculates the crop specific -*' agricultural land use endogenously based on yield data coming from the -*' module [14_yields] and the rotational as well as suitability constrains -*' stated in the input data of the module. -*' -*' Cropland areas are linked to the crop specific production and the carbon -*' content of the different land carbon pools. The crop specific land use areas -*' are also used in [18_residues], [38_factor_costs], -*' [41_area_equipped_for_irrigation], [42_water_demand], [50_nr_soil_budget], -*' [53_methane] and [59_som]. - -*' @limitations There are currently no known limitations of this realization. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/30_crop/endo_jun13/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/30_crop/endo_jun13/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/30_crop/endo_jun13/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/30_crop/endo_jun13/equations.gms" -$Ifi "%phase%" == "presolve" $include "./modules/30_crop/endo_jun13/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/30_crop/endo_jun13/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description The endo_jun13 realization calculates the crop specific +*' agricultural land use endogenously based on yield data coming from the +*' module [14_yields] and the rotational as well as suitability constrains +*' stated in the input data of the module. +*' +*' Cropland areas are linked to the crop specific production and the carbon +*' content of the different land carbon pools. The crop specific land use areas +*' are also used in [18_residues], [38_factor_costs], +*' [41_area_equipped_for_irrigation], [42_water_demand], [50_nr_soil_budget], +*' [53_methane] and [59_som]. + +*' @limitations There are currently no known limitations of this realization. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/30_crop/endo_jun13/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/30_crop/endo_jun13/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/30_crop/endo_jun13/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/30_crop/endo_jun13/equations.gms" +$Ifi "%phase%" == "presolve" $include "./modules/30_crop/endo_jun13/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/30_crop/endo_jun13/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/30_crop/endo_jun13/sets.gms b/modules/30_crop/endo_jun13/sets.gms index b652847540..bddb6294d7 100644 --- a/modules/30_crop/endo_jun13/sets.gms +++ b/modules/30_crop/endo_jun13/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets diff --git a/modules/30_crop/30_crop.gms b/modules/30_crop/module.gms similarity index 59% rename from modules/30_crop/30_crop.gms rename to modules/30_crop/module.gms index 587ec6c7b0..60d6444a4d 100644 --- a/modules/30_crop/30_crop.gms +++ b/modules/30_crop/module.gms @@ -1,18 +1,19 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -*' @title Cropland - -*' @description The cropland module simulates the dynamics of cropland area and -*' agricultural crop production and calculates corresponding carbon contents of -*' the existing cropland. - -*' @authors Jan Philipp Dietrich, Florian Humpenöder, Benjamin Bodirsky - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%crop%" == "endo_jun13" $include "./modules/30_crop/endo_jun13.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + + +*' @title Cropland + +*' @description The cropland module simulates the dynamics of cropland area and +*' agricultural crop production and calculates corresponding carbon contents of +*' the existing cropland. + +*' @authors Jan Philipp Dietrich, Florian Humpenöder, Benjamin Bodirsky + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%crop%" == "endo_jun13" $include "./modules/30_crop/endo_jun13/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/31_past/endo_jun13/declarations.gms b/modules/31_past/endo_jun13/declarations.gms index 9c4d9a9198..efc8e86820 100644 --- a/modules/31_past/endo_jun13/declarations.gms +++ b/modules/31_past/endo_jun13/declarations.gms @@ -1,23 +1,24 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -equations - q31_prod(j) Cellular pasture production constraint (mio. tDM per yr) - q31_carbon(j,c_pools) Carbon content calculation for pasture (mio tC) - q31_cost_prod_past(i) Costs for putting animals on pastures (mio. USD05MER per yr) -; - - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - oq31_prod(t,j,type) Cellular pasture production constraint (mio. tDM per yr) - oq31_carbon(t,j,c_pools,type) Carbon content calculation for pasture (mio tC) - oq31_cost_prod_past(t,i,type) Costs for putting animals on pastures (mio. USD05MER per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### - -*** EOF declarations.gms *** +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + +equations + q31_prod(j) Cellular pasture production constraint (mio. tDM per yr) + q31_carbon(j,c_pools) Carbon content calculation for pasture (mio tC) + q31_cost_prod_past(i) Costs for putting animals on pastures (mio. USD05MER per yr) +; + + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + oq31_prod(t,j,type) Cellular pasture production constraint (mio. tDM per yr) + oq31_carbon(t,j,c_pools,type) Carbon content calculation for pasture (mio tC) + oq31_cost_prod_past(t,i,type) Costs for putting animals on pastures (mio. USD05MER per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### + +*** EOF declarations.gms *** diff --git a/modules/31_past/endo_jun13/equations.gms b/modules/31_past/endo_jun13/equations.gms index 8673cc7812..ebd9b49ffa 100644 --- a/modules/31_past/endo_jun13/equations.gms +++ b/modules/31_past/endo_jun13/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations diff --git a/modules/31_past/endo_jun13/input.gms b/modules/31_past/endo_jun13/input.gms index 01e63df9d5..fc1a5acddc 100644 --- a/modules/31_past/endo_jun13/input.gms +++ b/modules/31_past/endo_jun13/input.gms @@ -1,10 +1,11 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -scalars - s31_fac_req_past Factor requirements (USD05MER per tDM) / 1 / -; +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + +scalars + s31_fac_req_past Factor requirements (USD05MER per tDM) / 1 / +; diff --git a/modules/31_past/endo_jun13/not_used.txt b/modules/31_past/endo_jun13/not_used.txt index 1c5f4b3420..ac1fbd03e2 100644 --- a/modules/31_past/endo_jun13/not_used.txt +++ b/modules/31_past/endo_jun13/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason diff --git a/modules/31_past/endo_jun13/postsolve.gms b/modules/31_past/endo_jun13/postsolve.gms index a80d1fa46e..cb178a1cb0 100644 --- a/modules/31_past/endo_jun13/postsolve.gms +++ b/modules/31_past/endo_jun13/postsolve.gms @@ -1,24 +1,25 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -s31_fac_req_past = 0; - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - oq31_prod(t,j,"marginal") = q31_prod.m(j); - oq31_carbon(t,j,c_pools,"marginal") = q31_carbon.m(j,c_pools); - oq31_cost_prod_past(t,i,"marginal") = q31_cost_prod_past.m(i); - oq31_prod(t,j,"level") = q31_prod.l(j); - oq31_carbon(t,j,c_pools,"level") = q31_carbon.l(j,c_pools); - oq31_cost_prod_past(t,i,"level") = q31_cost_prod_past.l(i); - oq31_prod(t,j,"upper") = q31_prod.up(j); - oq31_carbon(t,j,c_pools,"upper") = q31_carbon.up(j,c_pools); - oq31_cost_prod_past(t,i,"upper") = q31_cost_prod_past.up(i); - oq31_prod(t,j,"lower") = q31_prod.lo(j); - oq31_carbon(t,j,c_pools,"lower") = q31_carbon.lo(j,c_pools); - oq31_cost_prod_past(t,i,"lower") = q31_cost_prod_past.lo(i); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - -*** EOF postsolve.gms *** +*** | (C) 2008-2019 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 + +s31_fac_req_past = 0; + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + oq31_prod(t,j,"marginal") = q31_prod.m(j); + oq31_carbon(t,j,c_pools,"marginal") = q31_carbon.m(j,c_pools); + oq31_cost_prod_past(t,i,"marginal") = q31_cost_prod_past.m(i); + oq31_prod(t,j,"level") = q31_prod.l(j); + oq31_carbon(t,j,c_pools,"level") = q31_carbon.l(j,c_pools); + oq31_cost_prod_past(t,i,"level") = q31_cost_prod_past.l(i); + oq31_prod(t,j,"upper") = q31_prod.up(j); + oq31_carbon(t,j,c_pools,"upper") = q31_carbon.up(j,c_pools); + oq31_cost_prod_past(t,i,"upper") = q31_cost_prod_past.up(i); + oq31_prod(t,j,"lower") = q31_prod.lo(j); + oq31_carbon(t,j,c_pools,"lower") = q31_carbon.lo(j,c_pools); + oq31_cost_prod_past(t,i,"lower") = q31_cost_prod_past.lo(i); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### + +*** EOF postsolve.gms *** diff --git a/modules/31_past/endo_jun13.gms b/modules/31_past/endo_jun13/realization.gms similarity index 77% rename from modules/31_past/endo_jun13.gms rename to modules/31_past/endo_jun13/realization.gms index 5596bdeffb..19757d12ec 100644 --- a/modules/31_past/endo_jun13.gms +++ b/modules/31_past/endo_jun13/realization.gms @@ -1,24 +1,25 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description In the endo_jun13 realization, pasture area and related carbon -*' stocks are modelled endogenously. The initial spatially explicit patterns of -*' pasture are defined in the module [10_land] by the land use input data set. -*' For future time steps, pasture area depends on the demand for biomass from -*' pastures to feed livestock as calculated in the module [70_livestock] and -*' from the intensity of pasture utilization ("pasture yield") as determined in -*' the module [14_yields]. - -*' @limitations No consideration of generic differences between extensive and -*' intensive grazing systems, of explicit pasture management options and of -*' related degradation of pastures. - -*####################### R SECTION START (PHASES) ############################## -$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%" == "postsolve" $include "./modules/31_past/endo_jun13/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description In the endo_jun13 realization, pasture area and related carbon +*' stocks are modelled endogenously. The initial spatially explicit patterns of +*' pasture are defined in the module [10_land] by the land use input data set. +*' For future time steps, pasture area depends on the demand for biomass from +*' pastures to feed livestock as calculated in the module [70_livestock] and +*' from the intensity of pasture utilization ("pasture yield") as determined in +*' the module [14_yields]. + +*' @limitations No consideration of generic differences between extensive and +*' intensive grazing systems, of explicit pasture management options and of +*' related degradation of pastures. + +*####################### R SECTION START (PHASES) ############################## +$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%" == "postsolve" $include "./modules/31_past/endo_jun13/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/31_past/31_past.gms b/modules/31_past/module.gms similarity index 62% rename from modules/31_past/31_past.gms rename to modules/31_past/module.gms index ace25decb7..291f04ef81 100644 --- a/modules/31_past/31_past.gms +++ b/modules/31_past/module.gms @@ -1,21 +1,22 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Pasture -*' -*' @description The pasture module determines land used as pasture for livestock -*' rearing. At the same time, it calculates geographically explicit production -*' of pasture biomass and the carbon content of pasture land. Therefore, the -*' module requires cellular information about the carbon density related to the -*' different pasture carbon pools. Furthermore, it delivers regional production -*' costs associated with pastures. -*' -*' @authors Isabelle Weindl, Jan Philipp Dietrich - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%past%" == "endo_jun13" $include "./modules/31_past/endo_jun13.gms" -$Ifi "%past%" == "static" $include "./modules/31_past/static.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Pasture +*' +*' @description The pasture module determines land used as pasture for livestock +*' rearing. At the same time, it calculates geographically explicit production +*' of pasture biomass and the carbon content of pasture land. Therefore, the +*' module requires cellular information about the carbon density related to the +*' different pasture carbon pools. Furthermore, it delivers regional production +*' costs associated with pastures. +*' +*' @authors Isabelle Weindl, Jan Philipp Dietrich + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%past%" == "endo_jun13" $include "./modules/31_past/endo_jun13/realization.gms" +$Ifi "%past%" == "static" $include "./modules/31_past/static/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/31_past/static/not_used.txt b/modules/31_past/static/not_used.txt index 5ed9055b3b..5c79c1e3a8 100644 --- a/modules/31_past/static/not_used.txt +++ b/modules/31_past/static/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason diff --git a/modules/31_past/static/presolve.gms b/modules/31_past/static/presolve.gms index 98e105c337..8ce7afba73 100644 --- a/modules/31_past/static/presolve.gms +++ b/modules/31_past/static/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 *' @code Pasture areas are fixed to the initial spatially explicit patterns diff --git a/modules/31_past/static.gms b/modules/31_past/static/realization.gms similarity index 70% rename from modules/31_past/static.gms rename to modules/31_past/static/realization.gms index a670d16d9b..19b0307048 100644 --- a/modules/31_past/static.gms +++ b/modules/31_past/static/realization.gms @@ -1,19 +1,20 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description In the static realization, pasture areas are constant over time, -*' independent from developments in the livestock sector and land competition. - -*' @limitations There are no computational limitations to this realization. -*' Since pasture areas are static, they do not respond to demand trajectories -*' and trends in the land use and agricultural sectors like intensification -*' pathways, increasing production of animal products, bioenergy production or -*' afforestation policies. This may lead to an inconsistent overall picture of -*' future land use dynamics. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "presolve" $include "./modules/31_past/static/presolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description In the static realization, pasture areas are constant over time, +*' independent from developments in the livestock sector and land competition. + +*' @limitations There are no computational limitations to this realization. +*' Since pasture areas are static, they do not respond to demand trajectories +*' and trends in the land use and agricultural sectors like intensification +*' pathways, increasing production of animal products, bioenergy production or +*' afforestation policies. This may lead to an inconsistent overall picture of +*' future land use dynamics. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "presolve" $include "./modules/31_past/static/presolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/32_forestry/affore_vegc_dec16/declarations.gms b/modules/32_forestry/affore_vegc_dec16/declarations.gms index 1db47c72ff..caabbacc19 100644 --- a/modules/32_forestry/affore_vegc_dec16/declarations.gms +++ b/modules/32_forestry/affore_vegc_dec16/declarations.gms @@ -1,61 +1,62 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -scalars - s32_shift Number of 5-year age-classes corresponding to current time step length (1) -; - -parameters - p32_carbon_density(t,j,land32,c_pools) Carbon density for land32 and c_pools (tC per ha) - p32_land(t,j,ac,when) Forestry land for each cell wood type and age class before and after optimization (mio. ha) - pc32_land(j,land32) Forestry land per forestry land type initialization of the optimization (mio. ha) - p32_aff_pot(t,j) Potential afforestation area on cropland and pasture land (mio. ha) - p32_aff_pol(t,j) Exogenous afforestation target as stock (mio. ha) - p32_aff_pol_timestep(t,j) Exogenous afforestation target as flow per time step (mio. ha per timestep) - p32_aff_togo(t) Remaining exogenous afforestation wrt to the maximum exogenous target over time (mio. ha) -; - -positive variables - vm_cost_fore(i) Afforestation costs (mio. USD04MER per yr) - v32_land(j,land32) Forestry land pools (mio. ha) - vm_landdiff_forestry Aggregated difference in forestry land compared to previous timestep (mio. ha) - v32_land_expansion(j,land32) Forestry land expansion compared to previous timestep (mio. ha) - v32_land_reduction(j,land32) Forestry land reduction compared to previous timestep (mio. ha) - vm_cdr_aff(j) Total CDR from afforestation (new and existing areas) between t+1 and t=s32_planing_horizon CO2-C (mio. tC) -; - -equations - q32_cost_fore_ac(i) Total forestry costs constraint (mio. USD04MER) - q32_land(j) Land constraint (mio. ha) - q32_cdr_aff(j) Calculation of CDR from afforestation in terms of CO2-C (mio. tC) - q32_carbon(j,c_pools) Forestry carbon stock calculation C (mio. tC) - q32_land_diff Aggregated difference in forestry land compared to previous timestep (mio. ha) - q32_land_expansion(j,land32) Forestry land expansion (mio. ha) - q32_land_reduction(j,land32) Forestry land reduction (mio. ha) - q32_max_aff Maximum total global afforestation (mio. ha) - q32_aff_pol(j) Afforestation policy constraint (mio. ha) -; - - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_cost_fore(t,i,type) Afforestation costs (mio. USD04MER per yr) - ov32_land(t,j,land32,type) Forestry land pools (mio. ha) - ov_landdiff_forestry(t,type) Aggregated difference in forestry land compared to previous timestep (mio. ha) - ov32_land_expansion(t,j,land32,type) Forestry land expansion compared to previous timestep (mio. ha) - ov32_land_reduction(t,j,land32,type) Forestry land reduction compared to previous timestep (mio. ha) - ov_cdr_aff(t,j,type) Total CDR from afforestation (new and existing areas) between t+1 and t=s32_planing_horizon CO2-C (mio. tC) - oq32_cost_fore_ac(t,i,type) Total forestry costs constraint (mio. USD04MER) - oq32_land(t,j,type) Land constraint (mio. ha) - oq32_cdr_aff(t,j,type) Calculation of CDR from afforestation in terms of CO2-C (mio. tC) - oq32_carbon(t,j,c_pools,type) Forestry carbon stock calculation C (mio. tC) - oq32_land_diff(t,type) Aggregated difference in forestry land compared to previous timestep (mio. ha) - oq32_land_expansion(t,j,land32,type) Forestry land expansion (mio. ha) - oq32_land_reduction(t,j,land32,type) Forestry land reduction (mio. ha) - oq32_max_aff(t,type) Maximum total global afforestation (mio. ha) - oq32_aff_pol(t,j,type) Afforestation policy constraint (mio. ha) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +scalars + s32_shift Number of 5-year age-classes corresponding to current time step length (1) +; + +parameters + p32_carbon_density(t,j,land32,c_pools) Carbon density for land32 and c_pools (tC per ha) + p32_land(t,j,ac,when) Forestry land for each cell wood type and age class before and after optimization (mio. ha) + pc32_land(j,land32) Forestry land per forestry land type initialization of the optimization (mio. ha) + p32_aff_pot(t,j) Potential afforestation area on cropland and pasture land (mio. ha) + p32_aff_pol(t,j) Exogenous afforestation target as stock (mio. ha) + p32_aff_pol_timestep(t,j) Exogenous afforestation target as flow per time step (mio. ha per timestep) + p32_aff_togo(t) Remaining exogenous afforestation wrt to the maximum exogenous target over time (mio. ha) +; + +positive variables + vm_cost_fore(i) Afforestation costs (mio. USD04MER per yr) + v32_land(j,land32) Forestry land pools (mio. ha) + vm_landdiff_forestry Aggregated difference in forestry land compared to previous timestep (mio. ha) + v32_land_expansion(j,land32) Forestry land expansion compared to previous timestep (mio. ha) + v32_land_reduction(j,land32) Forestry land reduction compared to previous timestep (mio. ha) + vm_cdr_aff(j) Total CDR from afforestation (new and existing areas) between t+1 and t=s32_planing_horizon CO2-C (mio. tC) +; + +equations + q32_cost_fore_ac(i) Total forestry costs constraint (mio. USD04MER) + q32_land(j) Land constraint (mio. ha) + q32_cdr_aff(j) Calculation of CDR from afforestation in terms of CO2-C (mio. tC) + q32_carbon(j,c_pools) Forestry carbon stock calculation C (mio. tC) + q32_land_diff Aggregated difference in forestry land compared to previous timestep (mio. ha) + q32_land_expansion(j,land32) Forestry land expansion (mio. ha) + q32_land_reduction(j,land32) Forestry land reduction (mio. ha) + q32_max_aff Maximum total global afforestation (mio. ha) + q32_aff_pol(j) Afforestation policy constraint (mio. ha) +; + + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_cost_fore(t,i,type) Afforestation costs (mio. USD04MER per yr) + ov32_land(t,j,land32,type) Forestry land pools (mio. ha) + ov_landdiff_forestry(t,type) Aggregated difference in forestry land compared to previous timestep (mio. ha) + ov32_land_expansion(t,j,land32,type) Forestry land expansion compared to previous timestep (mio. ha) + ov32_land_reduction(t,j,land32,type) Forestry land reduction compared to previous timestep (mio. ha) + ov_cdr_aff(t,j,type) Total CDR from afforestation (new and existing areas) between t+1 and t=s32_planing_horizon CO2-C (mio. tC) + oq32_cost_fore_ac(t,i,type) Total forestry costs constraint (mio. USD04MER) + oq32_land(t,j,type) Land constraint (mio. ha) + oq32_cdr_aff(t,j,type) Calculation of CDR from afforestation in terms of CO2-C (mio. tC) + oq32_carbon(t,j,c_pools,type) Forestry carbon stock calculation C (mio. tC) + oq32_land_diff(t,type) Aggregated difference in forestry land compared to previous timestep (mio. ha) + oq32_land_expansion(t,j,land32,type) Forestry land expansion (mio. ha) + oq32_land_reduction(t,j,land32,type) Forestry land reduction (mio. ha) + oq32_max_aff(t,type) Maximum total global afforestation (mio. ha) + oq32_aff_pol(t,j,type) Afforestation policy constraint (mio. ha) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/32_forestry/affore_vegc_dec16/equations.gms b/modules/32_forestry/affore_vegc_dec16/equations.gms index edf1008470..cf221e28f6 100644 --- a/modules/32_forestry/affore_vegc_dec16/equations.gms +++ b/modules/32_forestry/affore_vegc_dec16/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations diff --git a/modules/32_forestry/affore_vegc_dec16/input.gms b/modules/32_forestry/affore_vegc_dec16/input.gms index 8f078897eb..96c085dd73 100644 --- a/modules/32_forestry/affore_vegc_dec16/input.gms +++ b/modules/32_forestry/affore_vegc_dec16/input.gms @@ -1,35 +1,36 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de -$setglobal c32_aff_mask noboreal -* options: unrestricted, noboreal, onlytropical -$setglobal c32_aff_policy npi -* options: none, npi, ndc - -scalars - s32_max_aff_area Maximum global endogenous afforestation (mio. ha) / Inf / - s32_planing_horizon Afforestation planing horizon (years) / 80 / -; - -parameter f32_aff_mask(j) Afforestation mask (1) -/ -$ondelim -$Ifi "%c32_aff_mask%" == "unrestricted" $include "./modules/32_forestry/input/aff_unrestricted.cs2" -$Ifi "%c32_aff_mask%" == "noboreal" $include "./modules/32_forestry/input/aff_noboreal.cs2" -$Ifi "%c32_aff_mask%" == "onlytropical" $include "./modules/32_forestry/input/aff_onlytropical.cs2" -$offdelim -/; - -table f32_fac_req_ha(i,fcosts32) Afforestation factor requirement costs per ha (USD04MER per ha) -$ondelim -$include "./modules/32_forestry/input/f32_fac_req_ha.csv" -$offdelim -; - -table f32_aff_pol(t_all,j,pol32) Exogenous afforestation scenario (mio. ha) -$ondelim -$include "./modules/32_forestry/input/npi_ndc_aff_pol.cs3" -$offdelim -; +*** | (C) 2008-2019 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 +$setglobal c32_aff_mask noboreal +* options: unrestricted, noboreal, onlytropical +$setglobal c32_aff_policy npi +* options: none, npi, ndc + +scalars + s32_max_aff_area Maximum global endogenous afforestation (mio. ha) / Inf / + s32_planing_horizon Afforestation planing horizon (years) / 80 / +; + +parameter f32_aff_mask(j) Afforestation mask (1) +/ +$ondelim +$Ifi "%c32_aff_mask%" == "unrestricted" $include "./modules/32_forestry/input/aff_unrestricted.cs2" +$Ifi "%c32_aff_mask%" == "noboreal" $include "./modules/32_forestry/input/aff_noboreal.cs2" +$Ifi "%c32_aff_mask%" == "onlytropical" $include "./modules/32_forestry/input/aff_onlytropical.cs2" +$offdelim +/; + +table f32_fac_req_ha(i,fcosts32) Afforestation factor requirement costs per ha (USD04MER per ha) +$ondelim +$include "./modules/32_forestry/input/f32_fac_req_ha.csv" +$offdelim +; + +table f32_aff_pol(t_all,j,pol32) Exogenous afforestation scenario (mio. ha) +$ondelim +$include "./modules/32_forestry/input/npi_ndc_aff_pol.cs3" +$offdelim +; diff --git a/modules/32_forestry/affore_vegc_dec16/postsolve.gms b/modules/32_forestry/affore_vegc_dec16/postsolve.gms index e529e03cfe..541572d681 100644 --- a/modules/32_forestry/affore_vegc_dec16/postsolve.gms +++ b/modules/32_forestry/affore_vegc_dec16/postsolve.gms @@ -1,77 +1,78 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -* Disaggregation of forestry land after optimization from `land32`to `ac`. -* after(ac) = growth_rate(flt)*before(ac) -p32_land(t,j,ac,"after") = - (v32_land.l(j,"new")+v32_land.l(j,"new_ndc"))$(ord(ac) = 1) - + sum(ac_land32(ac,land32)$(not sameas(land32,"new") - AND not sameas(land32,"new_ndc") - AND pc32_land(j,land32) > 0), - (v32_land.l(j,land32)/pc32_land(j,land32))*p32_land(t,j,ac,"before"))$(ord(ac) > 1); - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_cost_fore(t,i,"marginal") = vm_cost_fore.m(i); - ov32_land(t,j,land32,"marginal") = v32_land.m(j,land32); - ov_landdiff_forestry(t,"marginal") = vm_landdiff_forestry.m; - ov32_land_expansion(t,j,land32,"marginal") = v32_land_expansion.m(j,land32); - ov32_land_reduction(t,j,land32,"marginal") = v32_land_reduction.m(j,land32); - ov_cdr_aff(t,j,"marginal") = vm_cdr_aff.m(j); - oq32_cost_fore_ac(t,i,"marginal") = q32_cost_fore_ac.m(i); - oq32_land(t,j,"marginal") = q32_land.m(j); - oq32_cdr_aff(t,j,"marginal") = q32_cdr_aff.m(j); - oq32_carbon(t,j,c_pools,"marginal") = q32_carbon.m(j,c_pools); - oq32_land_diff(t,"marginal") = q32_land_diff.m; - oq32_land_expansion(t,j,land32,"marginal") = q32_land_expansion.m(j,land32); - oq32_land_reduction(t,j,land32,"marginal") = q32_land_reduction.m(j,land32); - oq32_max_aff(t,"marginal") = q32_max_aff.m; - oq32_aff_pol(t,j,"marginal") = q32_aff_pol.m(j); - ov_cost_fore(t,i,"level") = vm_cost_fore.l(i); - ov32_land(t,j,land32,"level") = v32_land.l(j,land32); - ov_landdiff_forestry(t,"level") = vm_landdiff_forestry.l; - ov32_land_expansion(t,j,land32,"level") = v32_land_expansion.l(j,land32); - ov32_land_reduction(t,j,land32,"level") = v32_land_reduction.l(j,land32); - ov_cdr_aff(t,j,"level") = vm_cdr_aff.l(j); - oq32_cost_fore_ac(t,i,"level") = q32_cost_fore_ac.l(i); - oq32_land(t,j,"level") = q32_land.l(j); - oq32_cdr_aff(t,j,"level") = q32_cdr_aff.l(j); - oq32_carbon(t,j,c_pools,"level") = q32_carbon.l(j,c_pools); - oq32_land_diff(t,"level") = q32_land_diff.l; - oq32_land_expansion(t,j,land32,"level") = q32_land_expansion.l(j,land32); - oq32_land_reduction(t,j,land32,"level") = q32_land_reduction.l(j,land32); - oq32_max_aff(t,"level") = q32_max_aff.l; - oq32_aff_pol(t,j,"level") = q32_aff_pol.l(j); - ov_cost_fore(t,i,"upper") = vm_cost_fore.up(i); - ov32_land(t,j,land32,"upper") = v32_land.up(j,land32); - ov_landdiff_forestry(t,"upper") = vm_landdiff_forestry.up; - ov32_land_expansion(t,j,land32,"upper") = v32_land_expansion.up(j,land32); - ov32_land_reduction(t,j,land32,"upper") = v32_land_reduction.up(j,land32); - ov_cdr_aff(t,j,"upper") = vm_cdr_aff.up(j); - oq32_cost_fore_ac(t,i,"upper") = q32_cost_fore_ac.up(i); - oq32_land(t,j,"upper") = q32_land.up(j); - oq32_cdr_aff(t,j,"upper") = q32_cdr_aff.up(j); - oq32_carbon(t,j,c_pools,"upper") = q32_carbon.up(j,c_pools); - oq32_land_diff(t,"upper") = q32_land_diff.up; - oq32_land_expansion(t,j,land32,"upper") = q32_land_expansion.up(j,land32); - oq32_land_reduction(t,j,land32,"upper") = q32_land_reduction.up(j,land32); - oq32_max_aff(t,"upper") = q32_max_aff.up; - oq32_aff_pol(t,j,"upper") = q32_aff_pol.up(j); - ov_cost_fore(t,i,"lower") = vm_cost_fore.lo(i); - ov32_land(t,j,land32,"lower") = v32_land.lo(j,land32); - ov_landdiff_forestry(t,"lower") = vm_landdiff_forestry.lo; - ov32_land_expansion(t,j,land32,"lower") = v32_land_expansion.lo(j,land32); - ov32_land_reduction(t,j,land32,"lower") = v32_land_reduction.lo(j,land32); - ov_cdr_aff(t,j,"lower") = vm_cdr_aff.lo(j); - oq32_cost_fore_ac(t,i,"lower") = q32_cost_fore_ac.lo(i); - oq32_land(t,j,"lower") = q32_land.lo(j); - oq32_cdr_aff(t,j,"lower") = q32_cdr_aff.lo(j); - oq32_carbon(t,j,c_pools,"lower") = q32_carbon.lo(j,c_pools); - oq32_land_diff(t,"lower") = q32_land_diff.lo; - oq32_land_expansion(t,j,land32,"lower") = q32_land_expansion.lo(j,land32); - oq32_land_reduction(t,j,land32,"lower") = q32_land_reduction.lo(j,land32); - oq32_max_aff(t,"lower") = q32_max_aff.lo; - oq32_aff_pol(t,j,"lower") = q32_aff_pol.lo(j); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 + +* Disaggregation of forestry land after optimization from `land32`to `ac`. +* after(ac) = growth_rate(flt)*before(ac) +p32_land(t,j,ac,"after") = + (v32_land.l(j,"new")+v32_land.l(j,"new_ndc"))$(ord(ac) = 1) + + sum(ac_land32(ac,land32)$(not sameas(land32,"new") + AND not sameas(land32,"new_ndc") + AND pc32_land(j,land32) > 0), + (v32_land.l(j,land32)/pc32_land(j,land32))*p32_land(t,j,ac,"before"))$(ord(ac) > 1); + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_cost_fore(t,i,"marginal") = vm_cost_fore.m(i); + ov32_land(t,j,land32,"marginal") = v32_land.m(j,land32); + ov_landdiff_forestry(t,"marginal") = vm_landdiff_forestry.m; + ov32_land_expansion(t,j,land32,"marginal") = v32_land_expansion.m(j,land32); + ov32_land_reduction(t,j,land32,"marginal") = v32_land_reduction.m(j,land32); + ov_cdr_aff(t,j,"marginal") = vm_cdr_aff.m(j); + oq32_cost_fore_ac(t,i,"marginal") = q32_cost_fore_ac.m(i); + oq32_land(t,j,"marginal") = q32_land.m(j); + oq32_cdr_aff(t,j,"marginal") = q32_cdr_aff.m(j); + oq32_carbon(t,j,c_pools,"marginal") = q32_carbon.m(j,c_pools); + oq32_land_diff(t,"marginal") = q32_land_diff.m; + oq32_land_expansion(t,j,land32,"marginal") = q32_land_expansion.m(j,land32); + oq32_land_reduction(t,j,land32,"marginal") = q32_land_reduction.m(j,land32); + oq32_max_aff(t,"marginal") = q32_max_aff.m; + oq32_aff_pol(t,j,"marginal") = q32_aff_pol.m(j); + ov_cost_fore(t,i,"level") = vm_cost_fore.l(i); + ov32_land(t,j,land32,"level") = v32_land.l(j,land32); + ov_landdiff_forestry(t,"level") = vm_landdiff_forestry.l; + ov32_land_expansion(t,j,land32,"level") = v32_land_expansion.l(j,land32); + ov32_land_reduction(t,j,land32,"level") = v32_land_reduction.l(j,land32); + ov_cdr_aff(t,j,"level") = vm_cdr_aff.l(j); + oq32_cost_fore_ac(t,i,"level") = q32_cost_fore_ac.l(i); + oq32_land(t,j,"level") = q32_land.l(j); + oq32_cdr_aff(t,j,"level") = q32_cdr_aff.l(j); + oq32_carbon(t,j,c_pools,"level") = q32_carbon.l(j,c_pools); + oq32_land_diff(t,"level") = q32_land_diff.l; + oq32_land_expansion(t,j,land32,"level") = q32_land_expansion.l(j,land32); + oq32_land_reduction(t,j,land32,"level") = q32_land_reduction.l(j,land32); + oq32_max_aff(t,"level") = q32_max_aff.l; + oq32_aff_pol(t,j,"level") = q32_aff_pol.l(j); + ov_cost_fore(t,i,"upper") = vm_cost_fore.up(i); + ov32_land(t,j,land32,"upper") = v32_land.up(j,land32); + ov_landdiff_forestry(t,"upper") = vm_landdiff_forestry.up; + ov32_land_expansion(t,j,land32,"upper") = v32_land_expansion.up(j,land32); + ov32_land_reduction(t,j,land32,"upper") = v32_land_reduction.up(j,land32); + ov_cdr_aff(t,j,"upper") = vm_cdr_aff.up(j); + oq32_cost_fore_ac(t,i,"upper") = q32_cost_fore_ac.up(i); + oq32_land(t,j,"upper") = q32_land.up(j); + oq32_cdr_aff(t,j,"upper") = q32_cdr_aff.up(j); + oq32_carbon(t,j,c_pools,"upper") = q32_carbon.up(j,c_pools); + oq32_land_diff(t,"upper") = q32_land_diff.up; + oq32_land_expansion(t,j,land32,"upper") = q32_land_expansion.up(j,land32); + oq32_land_reduction(t,j,land32,"upper") = q32_land_reduction.up(j,land32); + oq32_max_aff(t,"upper") = q32_max_aff.up; + oq32_aff_pol(t,j,"upper") = q32_aff_pol.up(j); + ov_cost_fore(t,i,"lower") = vm_cost_fore.lo(i); + ov32_land(t,j,land32,"lower") = v32_land.lo(j,land32); + ov_landdiff_forestry(t,"lower") = vm_landdiff_forestry.lo; + ov32_land_expansion(t,j,land32,"lower") = v32_land_expansion.lo(j,land32); + ov32_land_reduction(t,j,land32,"lower") = v32_land_reduction.lo(j,land32); + ov_cdr_aff(t,j,"lower") = vm_cdr_aff.lo(j); + oq32_cost_fore_ac(t,i,"lower") = q32_cost_fore_ac.lo(i); + oq32_land(t,j,"lower") = q32_land.lo(j); + oq32_cdr_aff(t,j,"lower") = q32_cdr_aff.lo(j); + oq32_carbon(t,j,c_pools,"lower") = q32_carbon.lo(j,c_pools); + oq32_land_diff(t,"lower") = q32_land_diff.lo; + oq32_land_expansion(t,j,land32,"lower") = q32_land_expansion.lo(j,land32); + oq32_land_reduction(t,j,land32,"lower") = q32_land_reduction.lo(j,land32); + oq32_max_aff(t,"lower") = q32_max_aff.lo; + oq32_aff_pol(t,j,"lower") = q32_aff_pol.lo(j); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/32_forestry/affore_vegc_dec16/preloop.gms b/modules/32_forestry/affore_vegc_dec16/preloop.gms index 0d155f1ec6..0e7f46e2ed 100644 --- a/modules/32_forestry/affore_vegc_dec16/preloop.gms +++ b/modules/32_forestry/affore_vegc_dec16/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 * Select afforestation policy depending on `c32_aff_policy`. diff --git a/modules/32_forestry/affore_vegc_dec16/presolve.gms b/modules/32_forestry/affore_vegc_dec16/presolve.gms index 8bdfe6b1b4..781a2fad76 100644 --- a/modules/32_forestry/affore_vegc_dec16/presolve.gms +++ b/modules/32_forestry/affore_vegc_dec16/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 * Limit demand for prescribed NPI/NDC afforestation in `p32_aff_pol` if not enough suitable area (`p32_aff_pot`) for afforestation is available. diff --git a/modules/32_forestry/affore_vegc_dec16.gms b/modules/32_forestry/affore_vegc_dec16/realization.gms similarity index 85% rename from modules/32_forestry/affore_vegc_dec16.gms rename to modules/32_forestry/affore_vegc_dec16/realization.gms index 80597199d2..b4cc90c95d 100644 --- a/modules/32_forestry/affore_vegc_dec16.gms +++ b/modules/32_forestry/affore_vegc_dec16/realization.gms @@ -1,34 +1,35 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description The main feature of the affore_vegc_dec16 realization is afforestation -*' for CDR. Afforestation can be modelled -*' exogenously (prescribed by NPI/NDC policies) and/or endogenously -*' (incentivized by a reward for CDR). National policies implemented (NPI) and -*' nationally determined contributions to the Paris agreement (NDC) for afforestation -*' are based on country reports. The reward for CDR from afforestation `vm_cdr_aff` -*' consists of the projected CDR within a planing horizon of 30 years -*' `s32_planing_horizon` multiplied -*' with the carbon price and annuity factor in the [56_ghg_policy] module. -*' Technically, the reward for CDR from afforestation is a negative cash flow -*' lowering the costs in the objective function of the model. -*' In this realization, afforestation is modeled as managed/assisted regrowth -*' of natural vegetation (@humpenoder_investigating_2014). The regrowth of natural -*' vegetation follows S-shaped growth curves. -*' Note that existing forestry plantations in 1995 dedicated to wood production are assumed constant throughout time. - -*' @limitations Forestry activities such as establishment or -*' harvest of plantations for wood production are not modeled. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/32_forestry/affore_vegc_dec16/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/32_forestry/affore_vegc_dec16/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/32_forestry/affore_vegc_dec16/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/32_forestry/affore_vegc_dec16/equations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/32_forestry/affore_vegc_dec16/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/32_forestry/affore_vegc_dec16/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/32_forestry/affore_vegc_dec16/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description The main feature of the affore_vegc_dec16 realization is afforestation +*' for CDR. Afforestation can be modelled +*' exogenously (prescribed by NPI/NDC policies) and/or endogenously +*' (incentivized by a reward for CDR). National policies implemented (NPI) and +*' nationally determined contributions to the Paris agreement (NDC) for afforestation +*' are based on country reports. The reward for CDR from afforestation `vm_cdr_aff` +*' consists of the projected CDR within a planing horizon of 30 years +*' `s32_planing_horizon` multiplied +*' with the carbon price and annuity factor in the [56_ghg_policy] module. +*' Technically, the reward for CDR from afforestation is a negative cash flow +*' lowering the costs in the objective function of the model. +*' In this realization, afforestation is modeled as managed/assisted regrowth +*' of natural vegetation (@humpenoder_investigating_2014). The regrowth of natural +*' vegetation follows S-shaped growth curves. +*' Note that existing forestry plantations in 1995 dedicated to wood production are assumed constant throughout time. + +*' @limitations Forestry activities such as establishment or +*' harvest of plantations for wood production are not modeled. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/32_forestry/affore_vegc_dec16/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/32_forestry/affore_vegc_dec16/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/32_forestry/affore_vegc_dec16/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/32_forestry/affore_vegc_dec16/equations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/32_forestry/affore_vegc_dec16/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/32_forestry/affore_vegc_dec16/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/32_forestry/affore_vegc_dec16/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/32_forestry/affore_vegc_dec16/sets.gms b/modules/32_forestry/affore_vegc_dec16/sets.gms index daee995b8f..9ab4a91c01 100644 --- a/modules/32_forestry/affore_vegc_dec16/sets.gms +++ b/modules/32_forestry/affore_vegc_dec16/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets ***FORESTRY COST TYPES*** diff --git a/modules/32_forestry/32_forestry.gms b/modules/32_forestry/module.gms similarity index 63% rename from modules/32_forestry/32_forestry.gms rename to modules/32_forestry/module.gms index 8669cc97bf..6b34dfd9ee 100644 --- a/modules/32_forestry/32_forestry.gms +++ b/modules/32_forestry/module.gms @@ -1,20 +1,21 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Forestry -*' -*' @description The forestry module describes the constraints under which managed -*' forest (age-class forest) exists. At the same time it calculates the corresponding -*' carbon stocks. The module provides carbon dioxide removal (CDR) from afforestation -*' to the GHG policy module ([56_ghg_policy]) as well as afforestation related costs -*' to the costs module ([11_costs]). -*' -*' @authors Florian Humpenöder - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%forestry%" == "affore_vegc_dec16" $include "./modules/32_forestry/affore_vegc_dec16.gms" -$Ifi "%forestry%" == "static_sep16" $include "./modules/32_forestry/static_sep16.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Forestry +*' +*' @description The forestry module describes the constraints under which managed +*' forest (age-class forest) exists. At the same time it calculates the corresponding +*' carbon stocks. The module provides carbon dioxide removal (CDR) from afforestation +*' to the GHG policy module ([56_ghg_policy]) as well as afforestation related costs +*' to the costs module ([11_costs]). +*' +*' @authors Florian Humpenöder + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%forestry%" == "affore_vegc_dec16" $include "./modules/32_forestry/affore_vegc_dec16/realization.gms" +$Ifi "%forestry%" == "static_sep16" $include "./modules/32_forestry/static_sep16/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/32_forestry/static_sep16/declarations.gms b/modules/32_forestry/static_sep16/declarations.gms index a86221d402..05cd8389f8 100644 --- a/modules/32_forestry/static_sep16/declarations.gms +++ b/modules/32_forestry/static_sep16/declarations.gms @@ -1,25 +1,26 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -positive variables - vm_cost_fore(i) Afforestation costs (mio. USD04MER per yr) - vm_landdiff_forestry Aggregated difference in forestry land compared to previous timestep (mio. ha) - v32_land(j,land32) Forestry land pools (mio. ha) - vm_cdr_aff(j) Total CDR from afforestation (new and existing areas) between t+1 and t=s32_planing_horizon (mio. tC) -; - -parameters - pc32_carbon_density(j,c_pools) Carbon density in optimization (tC per ha) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_cost_fore(t,i,type) Afforestation costs (mio. USD04MER per yr) - ov_landdiff_forestry(t,type) Aggregated difference in forestry land compared to previous timestep (mio. ha) - ov32_land(t,j,land32,type) Forestry land pools (mio. ha) - ov_cdr_aff(t,j,type) Total CDR from afforestation (new and existing areas) between t+1 and t=s32_planing_horizon (mio. tC) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +positive variables + vm_cost_fore(i) Afforestation costs (mio. USD04MER per yr) + vm_landdiff_forestry Aggregated difference in forestry land compared to previous timestep (mio. ha) + v32_land(j,land32) Forestry land pools (mio. ha) + vm_cdr_aff(j) Total CDR from afforestation (new and existing areas) between t+1 and t=s32_planing_horizon (mio. tC) +; + +parameters + pc32_carbon_density(j,c_pools) Carbon density in optimization (tC per ha) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_cost_fore(t,i,type) Afforestation costs (mio. USD04MER per yr) + ov_landdiff_forestry(t,type) Aggregated difference in forestry land compared to previous timestep (mio. ha) + ov32_land(t,j,land32,type) Forestry land pools (mio. ha) + ov_cdr_aff(t,j,type) Total CDR from afforestation (new and existing areas) between t+1 and t=s32_planing_horizon (mio. tC) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/32_forestry/static_sep16/not_used.txt b/modules/32_forestry/static_sep16/not_used.txt index 263cd86fff..92ce6161a2 100644 --- a/modules/32_forestry/static_sep16/not_used.txt +++ b/modules/32_forestry/static_sep16/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason pm_carbon_density_ac, input,not used diff --git a/modules/32_forestry/static_sep16/postsolve.gms b/modules/32_forestry/static_sep16/postsolve.gms index a8337a09dd..eb622f1040 100644 --- a/modules/32_forestry/static_sep16/postsolve.gms +++ b/modules/32_forestry/static_sep16/postsolve.gms @@ -1,24 +1,25 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_cost_fore(t,i,"marginal") = vm_cost_fore.m(i); - ov_landdiff_forestry(t,"marginal") = vm_landdiff_forestry.m; - ov32_land(t,j,land32,"marginal") = v32_land.m(j,land32); - ov_cdr_aff(t,j,"marginal") = vm_cdr_aff.m(j); - ov_cost_fore(t,i,"level") = vm_cost_fore.l(i); - ov_landdiff_forestry(t,"level") = vm_landdiff_forestry.l; - ov32_land(t,j,land32,"level") = v32_land.l(j,land32); - ov_cdr_aff(t,j,"level") = vm_cdr_aff.l(j); - ov_cost_fore(t,i,"upper") = vm_cost_fore.up(i); - ov_landdiff_forestry(t,"upper") = vm_landdiff_forestry.up; - ov32_land(t,j,land32,"upper") = v32_land.up(j,land32); - ov_cdr_aff(t,j,"upper") = vm_cdr_aff.up(j); - ov_cost_fore(t,i,"lower") = vm_cost_fore.lo(i); - ov_landdiff_forestry(t,"lower") = vm_landdiff_forestry.lo; - ov32_land(t,j,land32,"lower") = v32_land.lo(j,land32); - ov_cdr_aff(t,j,"lower") = vm_cdr_aff.lo(j); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_cost_fore(t,i,"marginal") = vm_cost_fore.m(i); + ov_landdiff_forestry(t,"marginal") = vm_landdiff_forestry.m; + ov32_land(t,j,land32,"marginal") = v32_land.m(j,land32); + ov_cdr_aff(t,j,"marginal") = vm_cdr_aff.m(j); + ov_cost_fore(t,i,"level") = vm_cost_fore.l(i); + ov_landdiff_forestry(t,"level") = vm_landdiff_forestry.l; + ov32_land(t,j,land32,"level") = v32_land.l(j,land32); + ov_cdr_aff(t,j,"level") = vm_cdr_aff.l(j); + ov_cost_fore(t,i,"upper") = vm_cost_fore.up(i); + ov_landdiff_forestry(t,"upper") = vm_landdiff_forestry.up; + ov32_land(t,j,land32,"upper") = v32_land.up(j,land32); + ov_cdr_aff(t,j,"upper") = vm_cdr_aff.up(j); + ov_cost_fore(t,i,"lower") = vm_cost_fore.lo(i); + ov_landdiff_forestry(t,"lower") = vm_landdiff_forestry.lo; + ov32_land(t,j,land32,"lower") = v32_land.lo(j,land32); + ov_cdr_aff(t,j,"lower") = vm_cdr_aff.lo(j); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/32_forestry/static_sep16/preloop.gms b/modules/32_forestry/static_sep16/preloop.gms index 2f007948b5..f042dda687 100644 --- a/modules/32_forestry/static_sep16/preloop.gms +++ b/modules/32_forestry/static_sep16/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 *' @code diff --git a/modules/32_forestry/static_sep16/presolve.gms b/modules/32_forestry/static_sep16/presolve.gms index e8ccbd0f90..08c97f6b0d 100644 --- a/modules/32_forestry/static_sep16/presolve.gms +++ b/modules/32_forestry/static_sep16/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 *' @code diff --git a/modules/32_forestry/static_sep16.gms b/modules/32_forestry/static_sep16/realization.gms similarity index 73% rename from modules/32_forestry/static_sep16.gms rename to modules/32_forestry/static_sep16/realization.gms index 3c32295304..a8f3cd177f 100644 --- a/modules/32_forestry/static_sep16.gms +++ b/modules/32_forestry/static_sep16/realization.gms @@ -1,20 +1,21 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description The static realisation is very simple and does not include any equation -*' because forestry land is assumed constant at the observed 1995 level throughout time. - -*' @limitations Forestry activities such as establishment or -*' harvest of plantations for wood production are not modeled. -*' Also afforestation for CDR is not included. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/32_forestry/static_sep16/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/32_forestry/static_sep16/declarations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/32_forestry/static_sep16/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/32_forestry/static_sep16/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/32_forestry/static_sep16/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description The static realisation is very simple and does not include any equation +*' because forestry land is assumed constant at the observed 1995 level throughout time. + +*' @limitations Forestry activities such as establishment or +*' harvest of plantations for wood production are not modeled. +*' Also afforestation for CDR is not included. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/32_forestry/static_sep16/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/32_forestry/static_sep16/declarations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/32_forestry/static_sep16/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/32_forestry/static_sep16/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/32_forestry/static_sep16/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/32_forestry/static_sep16/sets.gms b/modules/32_forestry/static_sep16/sets.gms index a7d9eeab53..1dde3fa6fb 100644 --- a/modules/32_forestry/static_sep16/sets.gms +++ b/modules/32_forestry/static_sep16/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets diff --git a/modules/34_urban/34_urban.gms b/modules/34_urban/module.gms similarity index 55% rename from modules/34_urban/34_urban.gms rename to modules/34_urban/module.gms index 583bae582d..a4c032ceb8 100644 --- a/modules/34_urban/34_urban.gms +++ b/modules/34_urban/module.gms @@ -1,17 +1,18 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Urban Land -*' -*' @description The urban land module is one of the land modules in MAgPIE -*' (see also the other land modules: [30_crop], [31_past], [32_forestry], [35_natveg]). -*' It describes urban settlement areas and estimates their corresponding carbon content. -*' -*' @authors Jan Philipp Dietrich, Florian Humpenöder - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%urban%" == "static" $include "./modules/34_urban/static.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Urban Land +*' +*' @description The urban land module is one of the land modules in MAgPIE +*' (see also the other land modules: [30_crop], [31_past], [32_forestry], [35_natveg]). +*' It describes urban settlement areas and estimates their corresponding carbon content. +*' +*' @authors Jan Philipp Dietrich, Florian Humpenöder + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%urban%" == "static" $include "./modules/34_urban/static/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/34_urban/static/presolve.gms b/modules/34_urban/static/presolve.gms index f30a28273c..84ae991160 100644 --- a/modules/34_urban/static/presolve.gms +++ b/modules/34_urban/static/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/34_urban/static.gms b/modules/34_urban/static/realization.gms similarity index 64% rename from modules/34_urban/static.gms rename to modules/34_urban/static/realization.gms index 4cf4d4324f..3b25cc7f54 100644 --- a/modules/34_urban/static.gms +++ b/modules/34_urban/static/realization.gms @@ -1,17 +1,18 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description In the static realization, urban land remains static over time -*' with the spatial distribution of 1995 from the LUH2 data -*' set [@hurtt_harmonization_inprep]. Carbon stocks are fixed to zero because -*' information on urban land carbon density is missing. - -*' @limitations Urban land is static over time and -*' corresponding carbon stocks are assumed zero - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "presolve" $include "./modules/34_urban/static/presolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description In the static realization, urban land remains static over time +*' with the spatial distribution of 1995 from the LUH2 data +*' set [@hurtt_harmonization_inprep]. Carbon stocks are fixed to zero because +*' information on urban land carbon density is missing. + +*' @limitations Urban land is static over time and +*' corresponding carbon stocks are assumed zero + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "presolve" $include "./modules/34_urban/static/presolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/35_natveg/dynamic_may18/declarations.gms b/modules/35_natveg/dynamic_may18/declarations.gms index 6f808d57eb..337f756a29 100644 --- a/modules/35_natveg/dynamic_may18/declarations.gms +++ b/modules/35_natveg/dynamic_may18/declarations.gms @@ -1,76 +1,77 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -scalars - s35_shift number of 5-year age-classes corresponding to current time step length (1) -; - -parameters - p35_carbon_density_secdforest(t,j,land35,c_pools) Carbon density secdforest (tC per ha) - p35_carbon_density_other(t,j,land35,c_pools) Carbon density other land (tC per ha) - i35_secdforest(j,ac) Inital secdforest (mio. ha) - i35_other(j,ac) Inital other land (mio. ha) - p35_secdforest(t,j,ac,when) Secdforest per age class before and after optimization (mio. ha) - p35_other(t,j,ac,when) Other land per age class before and after optimization (mio. ha) - pc35_secdforest(j,land35) Secdforest per aggregated age class (mio. ha) - pc35_other(j,land35) Other land per aggregated age class (mio. ha) - p35_protect_shr(t,j,prot_type) Protection share for primforest secdforest and other land (1) - p35_save_primforest(t,j) Primforest protection (mio. ha) - p35_save_secdforest(t,j) Secdforest protection (mio. ha) - p35_save_other(t,j) Other land protection (mio. ha) - p35_recovered_forest(t,j,ac) Recovered forest (mio. ha) - p35_min_forest(t,j) Minimum forest stock [land protection policies] (Mha) - p35_min_other(t,j) Minimum other land stock [land protection policies] (Mha) -; - -equations - q35_land_secdforest(j) Secdforest land pool calculation (mio. ha) - q35_land_other(j) Other land pool calculation (mio. ha) - q35_carbon_primforest(j,c_pools) Primforest carbon stock calculation (mio tC) - q35_carbon_secdforest(j,c_pools) Secdforest carbon stock calculation (mio tC) - q35_carbon_other(j,c_pools) Other land carbon stock calculation (mio tC) - q35_landdiff Difference in natveg land (mio. ha) - q35_other_expansion(j,land35) Other land expansion (mio. ha) - q35_other_reduction(j,land35) Other land reduction (mio. ha) - q35_secdforest_reduction(j,land35) Secdforest reduction (mio. ha) - q35_primforest_reduction(j) Primforest reduction (mio. ha) - q35_min_forest(j) Minimum forest land constraint (mio. ha) - q35_min_other(j) Minimum other land constraint (mio. ha) -; - -positive variables - v35_secdforest(j,land35) Detailed stock of secdforest (mio. ha) - v35_other(j,land35) Detailed stock of other land (mio. ha) - vm_landdiff_natveg Aggregated difference in natveg land compared to previous timestep (mio. ha) - v35_other_expansion(j,land35) Other land expansion compared to previous timestep (mio. ha) - v35_other_reduction(j,land35) Other land reduction compared to previous timestep (mio. ha) - v35_secdforest_reduction(j,land35) Secdforest reduction compared to previous timestep (mio. ha) - v35_primforest_reduction(j) Primforest reduction compared to previous timestep (mio. ha) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov35_secdforest(t,j,land35,type) Detailed stock of secdforest (mio. ha) - ov35_other(t,j,land35,type) Detailed stock of other land (mio. ha) - ov_landdiff_natveg(t,type) Aggregated difference in natveg land compared to previous timestep (mio. ha) - ov35_other_expansion(t,j,land35,type) Other land expansion compared to previous timestep (mio. ha) - ov35_other_reduction(t,j,land35,type) Other land reduction compared to previous timestep (mio. ha) - ov35_secdforest_reduction(t,j,land35,type) Secdforest reduction compared to previous timestep (mio. ha) - ov35_primforest_reduction(t,j,type) Primforest reduction compared to previous timestep (mio. ha) - oq35_land_secdforest(t,j,type) Secdforest land pool calculation (mio. ha) - oq35_land_other(t,j,type) Other land pool calculation (mio. ha) - oq35_carbon_primforest(t,j,c_pools,type) Primforest carbon stock calculation (mio tC) - oq35_carbon_secdforest(t,j,c_pools,type) Secdforest carbon stock calculation (mio tC) - oq35_carbon_other(t,j,c_pools,type) Other land carbon stock calculation (mio tC) - oq35_landdiff(t,type) Difference in natveg land (mio. ha) - oq35_other_expansion(t,j,land35,type) Other land expansion (mio. ha) - oq35_other_reduction(t,j,land35,type) Other land reduction (mio. ha) - oq35_secdforest_reduction(t,j,land35,type) Secdforest reduction (mio. ha) - oq35_primforest_reduction(t,j,type) Primforest reduction (mio. ha) - oq35_min_forest(t,j,type) Minimum forest land constraint (mio. ha) - oq35_min_other(t,j,type) Minimum other land constraint (mio. ha) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +scalars + s35_shift number of 5-year age-classes corresponding to current time step length (1) +; + +parameters + p35_carbon_density_secdforest(t,j,land35,c_pools) Carbon density secdforest (tC per ha) + p35_carbon_density_other(t,j,land35,c_pools) Carbon density other land (tC per ha) + i35_secdforest(j,ac) Inital secdforest (mio. ha) + i35_other(j,ac) Inital other land (mio. ha) + p35_secdforest(t,j,ac,when) Secdforest per age class before and after optimization (mio. ha) + p35_other(t,j,ac,when) Other land per age class before and after optimization (mio. ha) + pc35_secdforest(j,land35) Secdforest per aggregated age class (mio. ha) + pc35_other(j,land35) Other land per aggregated age class (mio. ha) + p35_protect_shr(t,j,prot_type) Protection share for primforest secdforest and other land (1) + p35_save_primforest(t,j) Primforest protection (mio. ha) + p35_save_secdforest(t,j) Secdforest protection (mio. ha) + p35_save_other(t,j) Other land protection (mio. ha) + p35_recovered_forest(t,j,ac) Recovered forest (mio. ha) + p35_min_forest(t,j) Minimum forest stock [land protection policies] (Mha) + p35_min_other(t,j) Minimum other land stock [land protection policies] (Mha) +; + +equations + q35_land_secdforest(j) Secdforest land pool calculation (mio. ha) + q35_land_other(j) Other land pool calculation (mio. ha) + q35_carbon_primforest(j,c_pools) Primforest carbon stock calculation (mio tC) + q35_carbon_secdforest(j,c_pools) Secdforest carbon stock calculation (mio tC) + q35_carbon_other(j,c_pools) Other land carbon stock calculation (mio tC) + q35_landdiff Difference in natveg land (mio. ha) + q35_other_expansion(j,land35) Other land expansion (mio. ha) + q35_other_reduction(j,land35) Other land reduction (mio. ha) + q35_secdforest_reduction(j,land35) Secdforest reduction (mio. ha) + q35_primforest_reduction(j) Primforest reduction (mio. ha) + q35_min_forest(j) Minimum forest land constraint (mio. ha) + q35_min_other(j) Minimum other land constraint (mio. ha) +; + +positive variables + v35_secdforest(j,land35) Detailed stock of secdforest (mio. ha) + v35_other(j,land35) Detailed stock of other land (mio. ha) + vm_landdiff_natveg Aggregated difference in natveg land compared to previous timestep (mio. ha) + v35_other_expansion(j,land35) Other land expansion compared to previous timestep (mio. ha) + v35_other_reduction(j,land35) Other land reduction compared to previous timestep (mio. ha) + v35_secdforest_reduction(j,land35) Secdforest reduction compared to previous timestep (mio. ha) + v35_primforest_reduction(j) Primforest reduction compared to previous timestep (mio. ha) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov35_secdforest(t,j,land35,type) Detailed stock of secdforest (mio. ha) + ov35_other(t,j,land35,type) Detailed stock of other land (mio. ha) + ov_landdiff_natveg(t,type) Aggregated difference in natveg land compared to previous timestep (mio. ha) + ov35_other_expansion(t,j,land35,type) Other land expansion compared to previous timestep (mio. ha) + ov35_other_reduction(t,j,land35,type) Other land reduction compared to previous timestep (mio. ha) + ov35_secdforest_reduction(t,j,land35,type) Secdforest reduction compared to previous timestep (mio. ha) + ov35_primforest_reduction(t,j,type) Primforest reduction compared to previous timestep (mio. ha) + oq35_land_secdforest(t,j,type) Secdforest land pool calculation (mio. ha) + oq35_land_other(t,j,type) Other land pool calculation (mio. ha) + oq35_carbon_primforest(t,j,c_pools,type) Primforest carbon stock calculation (mio tC) + oq35_carbon_secdforest(t,j,c_pools,type) Secdforest carbon stock calculation (mio tC) + oq35_carbon_other(t,j,c_pools,type) Other land carbon stock calculation (mio tC) + oq35_landdiff(t,type) Difference in natveg land (mio. ha) + oq35_other_expansion(t,j,land35,type) Other land expansion (mio. ha) + oq35_other_reduction(t,j,land35,type) Other land reduction (mio. ha) + oq35_secdforest_reduction(t,j,land35,type) Secdforest reduction (mio. ha) + oq35_primforest_reduction(t,j,type) Primforest reduction (mio. ha) + oq35_min_forest(t,j,type) Minimum forest land constraint (mio. ha) + oq35_min_other(t,j,type) Minimum other land constraint (mio. ha) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/35_natveg/dynamic_may18/equations.gms b/modules/35_natveg/dynamic_may18/equations.gms index b6a200a752..94c2426ba9 100644 --- a/modules/35_natveg/dynamic_may18/equations.gms +++ b/modules/35_natveg/dynamic_may18/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations diff --git a/modules/35_natveg/dynamic_may18/input.gms b/modules/35_natveg/dynamic_may18/input.gms index 651e22b482..0ae44642c8 100644 --- a/modules/35_natveg/dynamic_may18/input.gms +++ b/modules/35_natveg/dynamic_may18/input.gms @@ -1,21 +1,22 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -$setglobal c35_protect_scenario WDPA -$setglobal c35_ad_policy npi -$setglobal c35_aolc_policy npi - -table f35_protect_area(j,prot_type) Conservation priority areas (mio. ha) -$ondelim -$include "./modules/35_natveg/input/protect_area.cs3" -$offdelim -; - -table f35_min_land_stock(t_all,j,pol35,pol_stock35) Land protection policies [minimum land stock] (Mha) -$ondelim -$include "./modules/35_natveg/input/npi_ndc_ad_aolc_pol.cs3" -$offdelim -; +*** | (C) 2008-2019 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 + +$setglobal c35_protect_scenario WDPA +$setglobal c35_ad_policy npi +$setglobal c35_aolc_policy npi + +table f35_protect_area(j,prot_type) Conservation priority areas (mio. ha) +$ondelim +$include "./modules/35_natveg/input/protect_area.cs3" +$offdelim +; + +table f35_min_land_stock(t_all,j,pol35,pol_stock35) Land protection policies [minimum land stock] (Mha) +$ondelim +$include "./modules/35_natveg/input/npi_ndc_ad_aolc_pol.cs3" +$offdelim +; diff --git a/modules/35_natveg/dynamic_may18/not_used.txt b/modules/35_natveg/dynamic_may18/not_used.txt index aa2c8d2e19..d78901bb63 100644 --- a/modules/35_natveg/dynamic_may18/not_used.txt +++ b/modules/35_natveg/dynamic_may18/not_used.txt @@ -1,6 +1,7 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason diff --git a/modules/35_natveg/dynamic_may18/postsolve.gms b/modules/35_natveg/dynamic_may18/postsolve.gms index 0e7927eae8..254d06dcfc 100644 --- a/modules/35_natveg/dynamic_may18/postsolve.gms +++ b/modules/35_natveg/dynamic_may18/postsolve.gms @@ -1,104 +1,105 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -if((ord(t) = 1), -* Reshuffling of agricultural land in the 1st timestep results in an artificial increase of v35_other(j,"new"). -* This would result in carbon uptake (negative emissions) due to regrowth of vegetation. -* To avoid this artificial effect on CO2 emissions we reset age-classes after the optimization of the 1st time step. - v35_other.l(j,land35) = 0; - v35_other.l(j,"old") = vm_land.l(j,"other"); - p35_other(t,j,ac,"after") = 0; - p35_other(t,j,"acx","after") = vm_land.l(j,"other"); -else -*other land age class calculation - p35_other(t,j,ac,"after") = - v35_other.l(j,"new")$(ord(ac) = 1) - + sum(ac_land35(ac,land35)$(not sameas(land35,"new") AND pc35_other(j,land35) > 0),(v35_other.l(j,land35)/pc35_other(j,land35))*p35_other(t,j,ac,"before"))$(ord(ac) > 1); -); - -*secdforest age class calculation -p35_secdforest(t,j,ac,"after") = - v35_secdforest.l(j,"new")$(ord(ac) = 1) - + sum(ac_land35(ac,land35)$(not sameas(land35,"new") AND pc35_secdforest(j,land35) > 0),(v35_secdforest.l(j,land35)/pc35_secdforest(j,land35))*p35_secdforest(t,j,ac,"before"))$(ord(ac) > 1); - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov35_secdforest(t,j,land35,"marginal") = v35_secdforest.m(j,land35); - ov35_other(t,j,land35,"marginal") = v35_other.m(j,land35); - ov_landdiff_natveg(t,"marginal") = vm_landdiff_natveg.m; - ov35_other_expansion(t,j,land35,"marginal") = v35_other_expansion.m(j,land35); - ov35_other_reduction(t,j,land35,"marginal") = v35_other_reduction.m(j,land35); - ov35_secdforest_reduction(t,j,land35,"marginal") = v35_secdforest_reduction.m(j,land35); - ov35_primforest_reduction(t,j,"marginal") = v35_primforest_reduction.m(j); - oq35_land_secdforest(t,j,"marginal") = q35_land_secdforest.m(j); - oq35_land_other(t,j,"marginal") = q35_land_other.m(j); - oq35_carbon_primforest(t,j,c_pools,"marginal") = q35_carbon_primforest.m(j,c_pools); - oq35_carbon_secdforest(t,j,c_pools,"marginal") = q35_carbon_secdforest.m(j,c_pools); - oq35_carbon_other(t,j,c_pools,"marginal") = q35_carbon_other.m(j,c_pools); - oq35_landdiff(t,"marginal") = q35_landdiff.m; - oq35_other_expansion(t,j,land35,"marginal") = q35_other_expansion.m(j,land35); - oq35_other_reduction(t,j,land35,"marginal") = q35_other_reduction.m(j,land35); - oq35_secdforest_reduction(t,j,land35,"marginal") = q35_secdforest_reduction.m(j,land35); - oq35_primforest_reduction(t,j,"marginal") = q35_primforest_reduction.m(j); - oq35_min_forest(t,j,"marginal") = q35_min_forest.m(j); - oq35_min_other(t,j,"marginal") = q35_min_other.m(j); - ov35_secdforest(t,j,land35,"level") = v35_secdforest.l(j,land35); - ov35_other(t,j,land35,"level") = v35_other.l(j,land35); - ov_landdiff_natveg(t,"level") = vm_landdiff_natveg.l; - ov35_other_expansion(t,j,land35,"level") = v35_other_expansion.l(j,land35); - ov35_other_reduction(t,j,land35,"level") = v35_other_reduction.l(j,land35); - ov35_secdforest_reduction(t,j,land35,"level") = v35_secdforest_reduction.l(j,land35); - ov35_primforest_reduction(t,j,"level") = v35_primforest_reduction.l(j); - oq35_land_secdforest(t,j,"level") = q35_land_secdforest.l(j); - oq35_land_other(t,j,"level") = q35_land_other.l(j); - oq35_carbon_primforest(t,j,c_pools,"level") = q35_carbon_primforest.l(j,c_pools); - oq35_carbon_secdforest(t,j,c_pools,"level") = q35_carbon_secdforest.l(j,c_pools); - oq35_carbon_other(t,j,c_pools,"level") = q35_carbon_other.l(j,c_pools); - oq35_landdiff(t,"level") = q35_landdiff.l; - oq35_other_expansion(t,j,land35,"level") = q35_other_expansion.l(j,land35); - oq35_other_reduction(t,j,land35,"level") = q35_other_reduction.l(j,land35); - oq35_secdforest_reduction(t,j,land35,"level") = q35_secdforest_reduction.l(j,land35); - oq35_primforest_reduction(t,j,"level") = q35_primforest_reduction.l(j); - oq35_min_forest(t,j,"level") = q35_min_forest.l(j); - oq35_min_other(t,j,"level") = q35_min_other.l(j); - ov35_secdforest(t,j,land35,"upper") = v35_secdforest.up(j,land35); - ov35_other(t,j,land35,"upper") = v35_other.up(j,land35); - ov_landdiff_natveg(t,"upper") = vm_landdiff_natveg.up; - ov35_other_expansion(t,j,land35,"upper") = v35_other_expansion.up(j,land35); - ov35_other_reduction(t,j,land35,"upper") = v35_other_reduction.up(j,land35); - ov35_secdforest_reduction(t,j,land35,"upper") = v35_secdforest_reduction.up(j,land35); - ov35_primforest_reduction(t,j,"upper") = v35_primforest_reduction.up(j); - oq35_land_secdforest(t,j,"upper") = q35_land_secdforest.up(j); - oq35_land_other(t,j,"upper") = q35_land_other.up(j); - oq35_carbon_primforest(t,j,c_pools,"upper") = q35_carbon_primforest.up(j,c_pools); - oq35_carbon_secdforest(t,j,c_pools,"upper") = q35_carbon_secdforest.up(j,c_pools); - oq35_carbon_other(t,j,c_pools,"upper") = q35_carbon_other.up(j,c_pools); - oq35_landdiff(t,"upper") = q35_landdiff.up; - oq35_other_expansion(t,j,land35,"upper") = q35_other_expansion.up(j,land35); - oq35_other_reduction(t,j,land35,"upper") = q35_other_reduction.up(j,land35); - oq35_secdforest_reduction(t,j,land35,"upper") = q35_secdforest_reduction.up(j,land35); - oq35_primforest_reduction(t,j,"upper") = q35_primforest_reduction.up(j); - oq35_min_forest(t,j,"upper") = q35_min_forest.up(j); - oq35_min_other(t,j,"upper") = q35_min_other.up(j); - ov35_secdforest(t,j,land35,"lower") = v35_secdforest.lo(j,land35); - ov35_other(t,j,land35,"lower") = v35_other.lo(j,land35); - ov_landdiff_natveg(t,"lower") = vm_landdiff_natveg.lo; - ov35_other_expansion(t,j,land35,"lower") = v35_other_expansion.lo(j,land35); - ov35_other_reduction(t,j,land35,"lower") = v35_other_reduction.lo(j,land35); - ov35_secdforest_reduction(t,j,land35,"lower") = v35_secdforest_reduction.lo(j,land35); - ov35_primforest_reduction(t,j,"lower") = v35_primforest_reduction.lo(j); - oq35_land_secdforest(t,j,"lower") = q35_land_secdforest.lo(j); - oq35_land_other(t,j,"lower") = q35_land_other.lo(j); - oq35_carbon_primforest(t,j,c_pools,"lower") = q35_carbon_primforest.lo(j,c_pools); - oq35_carbon_secdforest(t,j,c_pools,"lower") = q35_carbon_secdforest.lo(j,c_pools); - oq35_carbon_other(t,j,c_pools,"lower") = q35_carbon_other.lo(j,c_pools); - oq35_landdiff(t,"lower") = q35_landdiff.lo; - oq35_other_expansion(t,j,land35,"lower") = q35_other_expansion.lo(j,land35); - oq35_other_reduction(t,j,land35,"lower") = q35_other_reduction.lo(j,land35); - oq35_secdforest_reduction(t,j,land35,"lower") = q35_secdforest_reduction.lo(j,land35); - oq35_primforest_reduction(t,j,"lower") = q35_primforest_reduction.lo(j); - oq35_min_forest(t,j,"lower") = q35_min_forest.lo(j); - oq35_min_other(t,j,"lower") = q35_min_other.lo(j); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 + +if((ord(t) = 1), +* Reshuffling of agricultural land in the 1st timestep results in an artificial increase of v35_other(j,"new"). +* This would result in carbon uptake (negative emissions) due to regrowth of vegetation. +* To avoid this artificial effect on CO2 emissions we reset age-classes after the optimization of the 1st time step. + v35_other.l(j,land35) = 0; + v35_other.l(j,"old") = vm_land.l(j,"other"); + p35_other(t,j,ac,"after") = 0; + p35_other(t,j,"acx","after") = vm_land.l(j,"other"); +else +*other land age class calculation + p35_other(t,j,ac,"after") = + v35_other.l(j,"new")$(ord(ac) = 1) + + sum(ac_land35(ac,land35)$(not sameas(land35,"new") AND pc35_other(j,land35) > 0),(v35_other.l(j,land35)/pc35_other(j,land35))*p35_other(t,j,ac,"before"))$(ord(ac) > 1); +); + +*secdforest age class calculation +p35_secdforest(t,j,ac,"after") = + v35_secdforest.l(j,"new")$(ord(ac) = 1) + + sum(ac_land35(ac,land35)$(not sameas(land35,"new") AND pc35_secdforest(j,land35) > 0),(v35_secdforest.l(j,land35)/pc35_secdforest(j,land35))*p35_secdforest(t,j,ac,"before"))$(ord(ac) > 1); + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov35_secdforest(t,j,land35,"marginal") = v35_secdforest.m(j,land35); + ov35_other(t,j,land35,"marginal") = v35_other.m(j,land35); + ov_landdiff_natveg(t,"marginal") = vm_landdiff_natveg.m; + ov35_other_expansion(t,j,land35,"marginal") = v35_other_expansion.m(j,land35); + ov35_other_reduction(t,j,land35,"marginal") = v35_other_reduction.m(j,land35); + ov35_secdforest_reduction(t,j,land35,"marginal") = v35_secdforest_reduction.m(j,land35); + ov35_primforest_reduction(t,j,"marginal") = v35_primforest_reduction.m(j); + oq35_land_secdforest(t,j,"marginal") = q35_land_secdforest.m(j); + oq35_land_other(t,j,"marginal") = q35_land_other.m(j); + oq35_carbon_primforest(t,j,c_pools,"marginal") = q35_carbon_primforest.m(j,c_pools); + oq35_carbon_secdforest(t,j,c_pools,"marginal") = q35_carbon_secdforest.m(j,c_pools); + oq35_carbon_other(t,j,c_pools,"marginal") = q35_carbon_other.m(j,c_pools); + oq35_landdiff(t,"marginal") = q35_landdiff.m; + oq35_other_expansion(t,j,land35,"marginal") = q35_other_expansion.m(j,land35); + oq35_other_reduction(t,j,land35,"marginal") = q35_other_reduction.m(j,land35); + oq35_secdforest_reduction(t,j,land35,"marginal") = q35_secdforest_reduction.m(j,land35); + oq35_primforest_reduction(t,j,"marginal") = q35_primforest_reduction.m(j); + oq35_min_forest(t,j,"marginal") = q35_min_forest.m(j); + oq35_min_other(t,j,"marginal") = q35_min_other.m(j); + ov35_secdforest(t,j,land35,"level") = v35_secdforest.l(j,land35); + ov35_other(t,j,land35,"level") = v35_other.l(j,land35); + ov_landdiff_natveg(t,"level") = vm_landdiff_natveg.l; + ov35_other_expansion(t,j,land35,"level") = v35_other_expansion.l(j,land35); + ov35_other_reduction(t,j,land35,"level") = v35_other_reduction.l(j,land35); + ov35_secdforest_reduction(t,j,land35,"level") = v35_secdforest_reduction.l(j,land35); + ov35_primforest_reduction(t,j,"level") = v35_primforest_reduction.l(j); + oq35_land_secdforest(t,j,"level") = q35_land_secdforest.l(j); + oq35_land_other(t,j,"level") = q35_land_other.l(j); + oq35_carbon_primforest(t,j,c_pools,"level") = q35_carbon_primforest.l(j,c_pools); + oq35_carbon_secdforest(t,j,c_pools,"level") = q35_carbon_secdforest.l(j,c_pools); + oq35_carbon_other(t,j,c_pools,"level") = q35_carbon_other.l(j,c_pools); + oq35_landdiff(t,"level") = q35_landdiff.l; + oq35_other_expansion(t,j,land35,"level") = q35_other_expansion.l(j,land35); + oq35_other_reduction(t,j,land35,"level") = q35_other_reduction.l(j,land35); + oq35_secdforest_reduction(t,j,land35,"level") = q35_secdforest_reduction.l(j,land35); + oq35_primforest_reduction(t,j,"level") = q35_primforest_reduction.l(j); + oq35_min_forest(t,j,"level") = q35_min_forest.l(j); + oq35_min_other(t,j,"level") = q35_min_other.l(j); + ov35_secdforest(t,j,land35,"upper") = v35_secdforest.up(j,land35); + ov35_other(t,j,land35,"upper") = v35_other.up(j,land35); + ov_landdiff_natveg(t,"upper") = vm_landdiff_natveg.up; + ov35_other_expansion(t,j,land35,"upper") = v35_other_expansion.up(j,land35); + ov35_other_reduction(t,j,land35,"upper") = v35_other_reduction.up(j,land35); + ov35_secdforest_reduction(t,j,land35,"upper") = v35_secdforest_reduction.up(j,land35); + ov35_primforest_reduction(t,j,"upper") = v35_primforest_reduction.up(j); + oq35_land_secdforest(t,j,"upper") = q35_land_secdforest.up(j); + oq35_land_other(t,j,"upper") = q35_land_other.up(j); + oq35_carbon_primforest(t,j,c_pools,"upper") = q35_carbon_primforest.up(j,c_pools); + oq35_carbon_secdforest(t,j,c_pools,"upper") = q35_carbon_secdforest.up(j,c_pools); + oq35_carbon_other(t,j,c_pools,"upper") = q35_carbon_other.up(j,c_pools); + oq35_landdiff(t,"upper") = q35_landdiff.up; + oq35_other_expansion(t,j,land35,"upper") = q35_other_expansion.up(j,land35); + oq35_other_reduction(t,j,land35,"upper") = q35_other_reduction.up(j,land35); + oq35_secdforest_reduction(t,j,land35,"upper") = q35_secdforest_reduction.up(j,land35); + oq35_primforest_reduction(t,j,"upper") = q35_primforest_reduction.up(j); + oq35_min_forest(t,j,"upper") = q35_min_forest.up(j); + oq35_min_other(t,j,"upper") = q35_min_other.up(j); + ov35_secdforest(t,j,land35,"lower") = v35_secdforest.lo(j,land35); + ov35_other(t,j,land35,"lower") = v35_other.lo(j,land35); + ov_landdiff_natveg(t,"lower") = vm_landdiff_natveg.lo; + ov35_other_expansion(t,j,land35,"lower") = v35_other_expansion.lo(j,land35); + ov35_other_reduction(t,j,land35,"lower") = v35_other_reduction.lo(j,land35); + ov35_secdforest_reduction(t,j,land35,"lower") = v35_secdforest_reduction.lo(j,land35); + ov35_primforest_reduction(t,j,"lower") = v35_primforest_reduction.lo(j); + oq35_land_secdforest(t,j,"lower") = q35_land_secdforest.lo(j); + oq35_land_other(t,j,"lower") = q35_land_other.lo(j); + oq35_carbon_primforest(t,j,c_pools,"lower") = q35_carbon_primforest.lo(j,c_pools); + oq35_carbon_secdforest(t,j,c_pools,"lower") = q35_carbon_secdforest.lo(j,c_pools); + oq35_carbon_other(t,j,c_pools,"lower") = q35_carbon_other.lo(j,c_pools); + oq35_landdiff(t,"lower") = q35_landdiff.lo; + oq35_other_expansion(t,j,land35,"lower") = q35_other_expansion.lo(j,land35); + oq35_other_reduction(t,j,land35,"lower") = q35_other_reduction.lo(j,land35); + oq35_secdforest_reduction(t,j,land35,"lower") = q35_secdforest_reduction.lo(j,land35); + oq35_primforest_reduction(t,j,"lower") = q35_primforest_reduction.lo(j); + oq35_min_forest(t,j,"lower") = q35_min_forest.lo(j); + oq35_min_other(t,j,"lower") = q35_min_other.lo(j); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/35_natveg/dynamic_may18/preloop.gms b/modules/35_natveg/dynamic_may18/preloop.gms index b6cc1e206e..402cb00515 100644 --- a/modules/35_natveg/dynamic_may18/preloop.gms +++ b/modules/35_natveg/dynamic_may18/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 *define mapping between ac and land35 diff --git a/modules/35_natveg/dynamic_may18/presolve.gms b/modules/35_natveg/dynamic_may18/presolve.gms index d32e121ff7..785cce3c5e 100644 --- a/modules/35_natveg/dynamic_may18/presolve.gms +++ b/modules/35_natveg/dynamic_may18/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 * Regrowth of natural vegetation (natural succession) is modelled by shifting age-classes according to time step length. @@ -58,8 +59,12 @@ $ifthen "%c35_protect_scenario%" == "none" p35_save_other(t,j) = 0; $elseif "%c35_protect_scenario%" == "full" p35_save_primforest(t,j) = vm_land.l(j,"primforest"); - p35_save_secdforest(t,j) = vm_land.l(j,"secdforest"); - p35_save_other(t,j) = vm_land.l(j,"other"); + p35_save_secdforest(t,j) = pc35_secdforest(j,"old"); + p35_save_other(t,j) = pc35_other(j,"old"); +$elseif "%c35_protect_scenario%" == "forest" + p35_save_primforest(t,j) = vm_land.l(j,"primforest"); + p35_save_secdforest(t,j) = pc35_secdforest(j,"old"); + p35_save_other(t,j) = 0; $elseif "%c35_protect_scenario%" == "WDPA" p35_save_primforest(t,j) = p35_protect_shr(t,j,"WDPA")*pm_land_start(j,"primforest"); p35_save_secdforest(t,j) = p35_protect_shr(t,j,"WDPA")*pm_land_start(j,"secdforest"); diff --git a/modules/35_natveg/dynamic_may18.gms b/modules/35_natveg/dynamic_may18/realization.gms similarity index 86% rename from modules/35_natveg/dynamic_may18.gms rename to modules/35_natveg/dynamic_may18/realization.gms index f3d0dc60ce..69a792fa1c 100644 --- a/modules/35_natveg/dynamic_may18.gms +++ b/modules/35_natveg/dynamic_may18/realization.gms @@ -1,39 +1,40 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description In the dynamic_may18 realization, land and carbon stock dynamics of -*' natural vegetation are modeled endogenously. -*' The initial spatial distribution of the sub-land-types primary forest, -*' secondary forest and other natural land is based on the -*' LUH2 data set [@hurtt_harmonization_inprep]. -*' The realization includes 2 different kinds of land protection. a) Land protection based on -*' the World Database on Protected Areas (WDPA) maintained by the International -*' Union for Conservation of Nature (IUCN) and b) land protection based on national -*' policies implemented (NPI) and nationally determined contributions to the Paris agreement (NDC) -*' taken from individual country reports. -*' Land protection based on WDPA is static over time, -*' while the NPI/NDC polices ramp up until 2030 and are assumed constant thereafter. -*' For WDPA the level of land protection is based on IUCN catI+II, which reflect areas currently -*' under protection (e.g. strict nature reserves and national parks), -*' and distributed equally across all sub-land-types (primary forest, secondary forest and other natural land). -*' On top of the IUCN catI+II land protection, there are options to protect different conservation priority areas -*' such as biodiversity hotspots (BH), centers of plant diversity (CBD), frontier forests (FF) and last of the wild (LW). -*' NPI/NDC land protection polices are be applied on forest and other land, depending on individual country reports. -*' @stop - - -*' -*' @limitations Wood harvest in natural forests is not accounted for. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/35_natveg/dynamic_may18/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/35_natveg/dynamic_may18/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/35_natveg/dynamic_may18/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/35_natveg/dynamic_may18/equations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/35_natveg/dynamic_may18/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/35_natveg/dynamic_may18/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/35_natveg/dynamic_may18/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description In the dynamic_may18 realization, land and carbon stock dynamics of +*' natural vegetation are modeled endogenously. +*' The initial spatial distribution of the sub-land-types primary forest, +*' secondary forest and other natural land is based on the +*' LUH2 data set [@hurtt_harmonization_inprep]. +*' The realization includes 2 different kinds of land protection. a) Land protection based on +*' the World Database on Protected Areas (WDPA) maintained by the International +*' Union for Conservation of Nature (IUCN) and b) land protection based on national +*' policies implemented (NPI) and nationally determined contributions to the Paris agreement (NDC) +*' taken from individual country reports. +*' Land protection based on WDPA is static over time, +*' while the NPI/NDC polices ramp up until 2030 and are assumed constant thereafter. +*' For WDPA the level of land protection is based on IUCN catI+II, which reflect areas currently +*' under protection (e.g. strict nature reserves and national parks), +*' and distributed equally across all sub-land-types (primary forest, secondary forest and other natural land). +*' On top of the IUCN catI+II land protection, there are options to protect different conservation priority areas +*' such as biodiversity hotspots (BH), centers of plant diversity (CBD), frontier forests (FF) and last of the wild (LW). +*' NPI/NDC land protection polices are be applied on forest and other land, depending on individual country reports. +*' @stop + + +*' +*' @limitations Wood harvest in natural forests is not accounted for. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/35_natveg/dynamic_may18/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/35_natveg/dynamic_may18/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/35_natveg/dynamic_may18/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/35_natveg/dynamic_may18/equations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/35_natveg/dynamic_may18/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/35_natveg/dynamic_may18/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/35_natveg/dynamic_may18/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/35_natveg/dynamic_may18/sets.gms b/modules/35_natveg/dynamic_may18/sets.gms index 48e9db68c7..f2fcc98543 100644 --- a/modules/35_natveg/dynamic_may18/sets.gms +++ b/modules/35_natveg/dynamic_may18/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets diff --git a/modules/35_natveg/35_natveg.gms b/modules/35_natveg/module.gms similarity index 66% rename from modules/35_natveg/35_natveg.gms rename to modules/35_natveg/module.gms index 042c19a594..efd7c06789 100644 --- a/modules/35_natveg/35_natveg.gms +++ b/modules/35_natveg/module.gms @@ -1,20 +1,21 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Natural Vegetation -*' -*' @description The natural vegetation (natveg) land module is one of the land modules in MAgPIE -*' (see also the other land modules: [30_crop], [31_past], [32_forestry], [34_urban]). -*' It calculates land and carbon stocks of natural vegetation, which consists of -*' primary forest, secondary forest and other natural land. -*' The module determines the availability of natural vegetation for land conversion. -*' -*' @authors Florian Humpenöder - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%natveg%" == "dynamic_may18" $include "./modules/35_natveg/dynamic_may18.gms" -$Ifi "%natveg%" == "static" $include "./modules/35_natveg/static.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Natural Vegetation +*' +*' @description The natural vegetation (natveg) land module is one of the land modules in MAgPIE +*' (see also the other land modules: [30_crop], [31_past], [32_forestry], [34_urban]). +*' It calculates land and carbon stocks of natural vegetation, which consists of +*' primary forest, secondary forest and other natural land. +*' The module determines the availability of natural vegetation for land conversion. +*' +*' @authors Florian Humpenöder + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%natveg%" == "dynamic_may18" $include "./modules/35_natveg/dynamic_may18/realization.gms" +$Ifi "%natveg%" == "static" $include "./modules/35_natveg/static/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/35_natveg/static/declarations.gms b/modules/35_natveg/static/declarations.gms index 66fe596e74..cd4b48bbf8 100644 --- a/modules/35_natveg/static/declarations.gms +++ b/modules/35_natveg/static/declarations.gms @@ -1,21 +1,22 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -positive variables - v35_secdforest(j,land35) Secdforest (mio. ha) - v35_other(j,land35) Other land (mio. ha) - vm_landdiff_natveg Aggregated difference in other land compared to previous timestep (mio. ha) -; - - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov35_secdforest(t,j,land35,type) Secdforest (mio. ha) - ov35_other(t,j,land35,type) Other land (mio. ha) - ov_landdiff_natveg(t,type) Aggregated difference in other land compared to previous timestep (mio. ha) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### - +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +positive variables + v35_secdforest(j,land35) Secdforest (mio. ha) + v35_other(j,land35) Other land (mio. ha) + vm_landdiff_natveg Aggregated difference in other land compared to previous timestep (mio. ha) +; + + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov35_secdforest(t,j,land35,type) Secdforest (mio. ha) + ov35_other(t,j,land35,type) Other land (mio. ha) + ov_landdiff_natveg(t,type) Aggregated difference in other land compared to previous timestep (mio. ha) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### + diff --git a/modules/35_natveg/static/not_used.txt b/modules/35_natveg/static/not_used.txt index 9a29fca57c..f9d405434d 100644 --- a/modules/35_natveg/static/not_used.txt +++ b/modules/35_natveg/static/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason pcm_carbon_stock, input,not used diff --git a/modules/35_natveg/static/postsolve.gms b/modules/35_natveg/static/postsolve.gms index c9a734b457..5827ed48dd 100644 --- a/modules/35_natveg/static/postsolve.gms +++ b/modules/35_natveg/static/postsolve.gms @@ -1,21 +1,22 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov35_secdforest(t,j,land35,"marginal") = v35_secdforest.m(j,land35); - ov35_other(t,j,land35,"marginal") = v35_other.m(j,land35); - ov_landdiff_natveg(t,"marginal") = vm_landdiff_natveg.m; - ov35_secdforest(t,j,land35,"level") = v35_secdforest.l(j,land35); - ov35_other(t,j,land35,"level") = v35_other.l(j,land35); - ov_landdiff_natveg(t,"level") = vm_landdiff_natveg.l; - ov35_secdforest(t,j,land35,"upper") = v35_secdforest.up(j,land35); - ov35_other(t,j,land35,"upper") = v35_other.up(j,land35); - ov_landdiff_natveg(t,"upper") = vm_landdiff_natveg.up; - ov35_secdforest(t,j,land35,"lower") = v35_secdforest.lo(j,land35); - ov35_other(t,j,land35,"lower") = v35_other.lo(j,land35); - ov_landdiff_natveg(t,"lower") = vm_landdiff_natveg.lo; -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - +*** | (C) 2008-2019 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 + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov35_secdforest(t,j,land35,"marginal") = v35_secdforest.m(j,land35); + ov35_other(t,j,land35,"marginal") = v35_other.m(j,land35); + ov_landdiff_natveg(t,"marginal") = vm_landdiff_natveg.m; + ov35_secdforest(t,j,land35,"level") = v35_secdforest.l(j,land35); + ov35_other(t,j,land35,"level") = v35_other.l(j,land35); + ov_landdiff_natveg(t,"level") = vm_landdiff_natveg.l; + ov35_secdforest(t,j,land35,"upper") = v35_secdforest.up(j,land35); + ov35_other(t,j,land35,"upper") = v35_other.up(j,land35); + ov_landdiff_natveg(t,"upper") = vm_landdiff_natveg.up; + ov35_secdforest(t,j,land35,"lower") = v35_secdforest.lo(j,land35); + ov35_other(t,j,land35,"lower") = v35_other.lo(j,land35); + ov_landdiff_natveg(t,"lower") = vm_landdiff_natveg.lo; +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### + diff --git a/modules/35_natveg/static/preloop.gms b/modules/35_natveg/static/preloop.gms index df61a3409e..bc5eba3b70 100644 --- a/modules/35_natveg/static/preloop.gms +++ b/modules/35_natveg/static/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 *fix primforest diff --git a/modules/35_natveg/static/presolve.gms b/modules/35_natveg/static/presolve.gms index 5eaeb626fe..77ebb45766 100644 --- a/modules/35_natveg/static/presolve.gms +++ b/modules/35_natveg/static/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 *' @code @@ -16,4 +17,4 @@ vm_carbon_stock.fx(j,"secdforest",c_pools) = *' vm_carbon_stock.fx(j,"other",c_pools) = vm_land.l(j,"other")*fm_carbon_density(t,j,"other",c_pools); -*' @stop \ No newline at end of file +*' @stop diff --git a/modules/35_natveg/static.gms b/modules/35_natveg/static/realization.gms similarity index 72% rename from modules/35_natveg/static.gms rename to modules/35_natveg/static/realization.gms index f902925c5a..c085bbe55c 100644 --- a/modules/35_natveg/static.gms +++ b/modules/35_natveg/static/realization.gms @@ -1,19 +1,20 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description In the static realization natural vegetation is constant over time -*' with the spatial distribution of 1995 from the LUH2 data set [@hurtt_harmonization_inprep]. -*' Due to static land patterns also carbon stocks are static over time. - -*' @limitations Land and carbon stocks of natural vegetation are static over time. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/35_natveg/static/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/35_natveg/static/declarations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/35_natveg/static/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/35_natveg/static/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/35_natveg/static/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description In the static realization natural vegetation is constant over time +*' with the spatial distribution of 1995 from the LUH2 data set [@hurtt_harmonization_inprep]. +*' Due to static land patterns also carbon stocks are static over time. + +*' @limitations Land and carbon stocks of natural vegetation are static over time. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/35_natveg/static/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/35_natveg/static/declarations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/35_natveg/static/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/35_natveg/static/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/35_natveg/static/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/35_natveg/static/sets.gms b/modules/35_natveg/static/sets.gms index 92967412fe..9460369c94 100644 --- a/modules/35_natveg/static/sets.gms +++ b/modules/35_natveg/static/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets diff --git a/modules/38_factor_costs/fixed_per_ton_mar18/declarations.gms b/modules/38_factor_costs/fixed_per_ton_mar18/declarations.gms index 85d26ca10f..9244a819a2 100644 --- a/modules/38_factor_costs/fixed_per_ton_mar18/declarations.gms +++ b/modules/38_factor_costs/fixed_per_ton_mar18/declarations.gms @@ -1,20 +1,21 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -equations - q38_cost_prod_crop(i,kcr) Regional factor input costs for plant production (mio. USD05MER per yr) -; - -positive variables - vm_cost_prod(i,kall) Factor costs (mio. USD05MER per yr) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_cost_prod(t,i,kall,type) Factor costs (mio. USD05MER per yr) - oq38_cost_prod_crop(t,i,kcr,type) Regional factor input costs for plant production (mio. USD05MER per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +equations + q38_cost_prod_crop(i,kcr) Regional factor input costs for plant production (mio. USD05MER per yr) +; + +positive variables + vm_cost_prod(i,kall) Factor costs (mio. USD05MER per yr) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_cost_prod(t,i,kall,type) Factor costs (mio. USD05MER per yr) + oq38_cost_prod_crop(t,i,kcr,type) Regional factor input costs for plant production (mio. USD05MER per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/38_factor_costs/fixed_per_ton_mar18/equations.gms b/modules/38_factor_costs/fixed_per_ton_mar18/equations.gms index 58462bbf24..cabf6a6706 100644 --- a/modules/38_factor_costs/fixed_per_ton_mar18/equations.gms +++ b/modules/38_factor_costs/fixed_per_ton_mar18/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations diff --git a/modules/38_factor_costs/fixed_per_ton_mar18/input.gms b/modules/38_factor_costs/fixed_per_ton_mar18/input.gms index 755f61312c..ace6af205a 100644 --- a/modules/38_factor_costs/fixed_per_ton_mar18/input.gms +++ b/modules/38_factor_costs/fixed_per_ton_mar18/input.gms @@ -1,14 +1,15 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -parameter f38_fac_req_per_ton(kcr) Factor requirement costs (USD05MER per tDM) -/ -$ondelim -$include "./modules/38_factor_costs/input/f38_fac_req_per_ton.csv" -$offdelim -/; +*** | (C) 2008-2019 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 + + + +parameter f38_fac_req_per_ton(kcr) Factor requirement costs (USD05MER per tDM) +/ +$ondelim +$include "./modules/38_factor_costs/input/f38_fac_req_per_ton.csv" +$offdelim +/; diff --git a/modules/38_factor_costs/fixed_per_ton_mar18/not_used.txt b/modules/38_factor_costs/fixed_per_ton_mar18/not_used.txt index 84bca817c5..a931fa68ba 100644 --- a/modules/38_factor_costs/fixed_per_ton_mar18/not_used.txt +++ b/modules/38_factor_costs/fixed_per_ton_mar18/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason diff --git a/modules/38_factor_costs/fixed_per_ton_mar18/postsolve.gms b/modules/38_factor_costs/fixed_per_ton_mar18/postsolve.gms index 89867a7879..f371f89553 100644 --- a/modules/38_factor_costs/fixed_per_ton_mar18/postsolve.gms +++ b/modules/38_factor_costs/fixed_per_ton_mar18/postsolve.gms @@ -1,18 +1,19 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_cost_prod(t,i,kall,"marginal") = vm_cost_prod.m(i,kall); - oq38_cost_prod_crop(t,i,kcr,"marginal") = q38_cost_prod_crop.m(i,kcr); - ov_cost_prod(t,i,kall,"level") = vm_cost_prod.l(i,kall); - oq38_cost_prod_crop(t,i,kcr,"level") = q38_cost_prod_crop.l(i,kcr); - ov_cost_prod(t,i,kall,"upper") = vm_cost_prod.up(i,kall); - oq38_cost_prod_crop(t,i,kcr,"upper") = q38_cost_prod_crop.up(i,kcr); - ov_cost_prod(t,i,kall,"lower") = vm_cost_prod.lo(i,kall); - oq38_cost_prod_crop(t,i,kcr,"lower") = q38_cost_prod_crop.lo(i,kcr); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - +*** | (C) 2008-2019 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 + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_cost_prod(t,i,kall,"marginal") = vm_cost_prod.m(i,kall); + oq38_cost_prod_crop(t,i,kcr,"marginal") = q38_cost_prod_crop.m(i,kcr); + ov_cost_prod(t,i,kall,"level") = vm_cost_prod.l(i,kall); + oq38_cost_prod_crop(t,i,kcr,"level") = q38_cost_prod_crop.l(i,kcr); + ov_cost_prod(t,i,kall,"upper") = vm_cost_prod.up(i,kall); + oq38_cost_prod_crop(t,i,kcr,"upper") = q38_cost_prod_crop.up(i,kcr); + ov_cost_prod(t,i,kall,"lower") = vm_cost_prod.lo(i,kall); + oq38_cost_prod_crop(t,i,kcr,"lower") = q38_cost_prod_crop.lo(i,kcr); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### + diff --git a/modules/38_factor_costs/fixed_per_ton_mar18/preloop.gms b/modules/38_factor_costs/fixed_per_ton_mar18/preloop.gms deleted file mode 100644 index 8b13789179..0000000000 --- a/modules/38_factor_costs/fixed_per_ton_mar18/preloop.gms +++ /dev/null @@ -1 +0,0 @@ - diff --git a/modules/38_factor_costs/fixed_per_ton_mar18/presolve.gms b/modules/38_factor_costs/fixed_per_ton_mar18/presolve.gms deleted file mode 100644 index 8b13789179..0000000000 --- a/modules/38_factor_costs/fixed_per_ton_mar18/presolve.gms +++ /dev/null @@ -1 +0,0 @@ - diff --git a/modules/38_factor_costs/fixed_per_ton_mar18.gms b/modules/38_factor_costs/fixed_per_ton_mar18/realization.gms similarity index 69% rename from modules/38_factor_costs/fixed_per_ton_mar18.gms rename to modules/38_factor_costs/fixed_per_ton_mar18/realization.gms index 31c94e1066..e8ca629b32 100644 --- a/modules/38_factor_costs/fixed_per_ton_mar18.gms +++ b/modules/38_factor_costs/fixed_per_ton_mar18/realization.gms @@ -1,28 +1,26 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description This realization relates factor costs to volume of production of -*' a given crop. The latter [17_production] depends on area harvested -*' from [30_crop] and yields from [14_yields]. In other words, in this -*' implementation, factor costs entirely depend on the volume of production. -*' As such, there are no incentives to allocate and concentrate production -*' into more productive cells. - -*' @limitations This realization assumes that factor costs, within a region, -*' purely depend on the production and are independent of the area under cultivation. -*' By implication, cases in which the harvested area could significantly influence -*' factors costs are hardly accounted in this realization. - - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/38_factor_costs/fixed_per_ton_mar18/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/38_factor_costs/fixed_per_ton_mar18/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/38_factor_costs/fixed_per_ton_mar18/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/38_factor_costs/fixed_per_ton_mar18/equations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/38_factor_costs/fixed_per_ton_mar18/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/38_factor_costs/fixed_per_ton_mar18/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/38_factor_costs/fixed_per_ton_mar18/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description This realization relates factor costs to volume of production of +*' a given crop. The latter [17_production] depends on area harvested +*' from [30_crop] and yields from [14_yields]. In other words, in this +*' implementation, factor costs entirely depend on the volume of production. +*' As such, there are no incentives to allocate and concentrate production +*' into more productive cells. + +*' @limitations This realization assumes that factor costs, within a region, +*' purely depend on the production and are independent of the area under cultivation. +*' By implication, cases in which the harvested area could significantly influence +*' factors costs are hardly accounted in this realization. + + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "declarations" $include "./modules/38_factor_costs/fixed_per_ton_mar18/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/38_factor_costs/fixed_per_ton_mar18/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/38_factor_costs/fixed_per_ton_mar18/equations.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/38_factor_costs/fixed_per_ton_mar18/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/38_factor_costs/fixed_per_ton_mar18/sets.gms b/modules/38_factor_costs/fixed_per_ton_mar18/sets.gms deleted file mode 100644 index 8b13789179..0000000000 --- a/modules/38_factor_costs/fixed_per_ton_mar18/sets.gms +++ /dev/null @@ -1 +0,0 @@ - diff --git a/modules/38_factor_costs/mixed_feb17/declarations.gms b/modules/38_factor_costs/mixed_feb17/declarations.gms index 8aaf9940a8..6486eae930 100644 --- a/modules/38_factor_costs/mixed_feb17/declarations.gms +++ b/modules/38_factor_costs/mixed_feb17/declarations.gms @@ -1,20 +1,21 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -equations - q38_cost_prod_crop(i,kcr) Regional factor input costs for plant production (mio. USD05MER per yr) -; - -positive variables - vm_cost_prod(i,kall) Factor costs (mio. USD05MER per yr) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_cost_prod(t,i,kall,type) Factor costs (mio. USD05MER per yr) - oq38_cost_prod_crop(t,i,kcr,type) Regional factor input costs for plant production (mio. USD05MER per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +equations + q38_cost_prod_crop(i,kcr) Regional factor input costs for plant production (mio. USD05MER per yr) +; + +positive variables + vm_cost_prod(i,kall) Factor costs (mio. USD05MER per yr) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_cost_prod(t,i,kall,type) Factor costs (mio. USD05MER per yr) + oq38_cost_prod_crop(t,i,kcr,type) Regional factor input costs for plant production (mio. USD05MER per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/38_factor_costs/mixed_feb17/equations.gms b/modules/38_factor_costs/mixed_feb17/equations.gms index 59e9cc9c93..c0dd806a77 100644 --- a/modules/38_factor_costs/mixed_feb17/equations.gms +++ b/modules/38_factor_costs/mixed_feb17/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/38_factor_costs/mixed_feb17/input.gms b/modules/38_factor_costs/mixed_feb17/input.gms index c83902a120..d25db9cf06 100644 --- a/modules/38_factor_costs/mixed_feb17/input.gms +++ b/modules/38_factor_costs/mixed_feb17/input.gms @@ -1,17 +1,18 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -table f38_fac_req(kcr,w) Factor requirement costs (USD05MER per tDM) -$ondelim -$include "./modules/38_factor_costs/input/f38_fac_req.csv" -$offdelim; - -table f38_region_yield(i,kcr) Regional crop yields (tDM per ha) -$ondelim -$include "./modules/38_factor_costs/mixed_feb17/input/f38_region_yield.csv" -$offdelim; +*** | (C) 2008-2019 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 + + + +table f38_fac_req(kcr,w) Factor requirement costs (USD05MER per tDM) +$ondelim +$include "./modules/38_factor_costs/input/f38_fac_req.csv" +$offdelim; + +table f38_region_yield(i,kcr) Regional crop yields (tDM per ha) +$ondelim +$include "./modules/38_factor_costs/mixed_feb17/input/f38_region_yield.csv" +$offdelim; diff --git a/modules/38_factor_costs/mixed_feb17/not_used.txt b/modules/38_factor_costs/mixed_feb17/not_used.txt index 8146352732..b65a784550 100644 --- a/modules/38_factor_costs/mixed_feb17/not_used.txt +++ b/modules/38_factor_costs/mixed_feb17/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason diff --git a/modules/38_factor_costs/mixed_feb17/postsolve.gms b/modules/38_factor_costs/mixed_feb17/postsolve.gms index 89867a7879..f371f89553 100644 --- a/modules/38_factor_costs/mixed_feb17/postsolve.gms +++ b/modules/38_factor_costs/mixed_feb17/postsolve.gms @@ -1,18 +1,19 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_cost_prod(t,i,kall,"marginal") = vm_cost_prod.m(i,kall); - oq38_cost_prod_crop(t,i,kcr,"marginal") = q38_cost_prod_crop.m(i,kcr); - ov_cost_prod(t,i,kall,"level") = vm_cost_prod.l(i,kall); - oq38_cost_prod_crop(t,i,kcr,"level") = q38_cost_prod_crop.l(i,kcr); - ov_cost_prod(t,i,kall,"upper") = vm_cost_prod.up(i,kall); - oq38_cost_prod_crop(t,i,kcr,"upper") = q38_cost_prod_crop.up(i,kcr); - ov_cost_prod(t,i,kall,"lower") = vm_cost_prod.lo(i,kall); - oq38_cost_prod_crop(t,i,kcr,"lower") = q38_cost_prod_crop.lo(i,kcr); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - +*** | (C) 2008-2019 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 + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_cost_prod(t,i,kall,"marginal") = vm_cost_prod.m(i,kall); + oq38_cost_prod_crop(t,i,kcr,"marginal") = q38_cost_prod_crop.m(i,kcr); + ov_cost_prod(t,i,kall,"level") = vm_cost_prod.l(i,kall); + oq38_cost_prod_crop(t,i,kcr,"level") = q38_cost_prod_crop.l(i,kcr); + ov_cost_prod(t,i,kall,"upper") = vm_cost_prod.up(i,kall); + oq38_cost_prod_crop(t,i,kcr,"upper") = q38_cost_prod_crop.up(i,kcr); + ov_cost_prod(t,i,kall,"lower") = vm_cost_prod.lo(i,kall); + oq38_cost_prod_crop(t,i,kcr,"lower") = q38_cost_prod_crop.lo(i,kcr); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### + diff --git a/modules/38_factor_costs/mixed_feb17.gms b/modules/38_factor_costs/mixed_feb17/realization.gms similarity index 79% rename from modules/38_factor_costs/mixed_feb17.gms rename to modules/38_factor_costs/mixed_feb17/realization.gms index 9bf37c2cf6..3d23055181 100644 --- a/modules/38_factor_costs/mixed_feb17.gms +++ b/modules/38_factor_costs/mixed_feb17/realization.gms @@ -1,27 +1,28 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description This 'mixed' realization specifies factors costs to depend on -*' area harvested and agricultural land use intensity and corresponding average -*' production volumes. -*' Consequently, factor costs in this realization react on both: area under -*' production and average productivity of a region as captured by the $\tau$ -*' factor. A detailed description of the approach can be found -*' in @dietrich_forecasting_2014 with background information about the used -*' intensity measure in @dietrich_measuring_2012. -*' -*' @limitations This realization assumes that factor costs only depend on area -*' and average productivity of a region. Productivity differences within a -*' region are ignored. Therefore, cases in which the cellular productivity -*' levels affect factors costs are only partially accounted for. - - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "declarations" $include "./modules/38_factor_costs/mixed_feb17/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/38_factor_costs/mixed_feb17/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/38_factor_costs/mixed_feb17/equations.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/38_factor_costs/mixed_feb17/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description This 'mixed' realization specifies factors costs to depend on +*' area harvested and agricultural land use intensity and corresponding average +*' production volumes. +*' Consequently, factor costs in this realization react on both: area under +*' production and average productivity of a region as captured by the $\tau$ +*' factor. A detailed description of the approach can be found +*' in @dietrich_forecasting_2014 with background information about the used +*' intensity measure in @dietrich_measuring_2012. +*' +*' @limitations This realization assumes that factor costs only depend on area +*' and average productivity of a region. Productivity differences within a +*' region are ignored. Therefore, cases in which the cellular productivity +*' levels affect factors costs are only partially accounted for. + + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "declarations" $include "./modules/38_factor_costs/mixed_feb17/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/38_factor_costs/mixed_feb17/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/38_factor_costs/mixed_feb17/equations.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/38_factor_costs/mixed_feb17/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/38_factor_costs/38_factor_costs.gms b/modules/38_factor_costs/module.gms similarity index 64% rename from modules/38_factor_costs/38_factor_costs.gms rename to modules/38_factor_costs/module.gms index d8de31cbd3..a559dc979c 100644 --- a/modules/38_factor_costs/38_factor_costs.gms +++ b/modules/38_factor_costs/module.gms @@ -1,23 +1,24 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -*' @title Factor Costs - -*' @description This module is used to calculate factor costs of production in -*' crop activities. The costs of factors of production included in this module -*' are specifically of labor, capital, and energy and related costs. The costs -*' are crop-specific, and pass to the the cost function in [11_costs]. -*' Thus, factor costs will contribute to and influence the choice of production -*' pattern in the model. - -*' @authors Jan Philipp Dietrich, Benjamin Bodirsky, Kristine Karstens - - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%factor_costs%" == "fixed_per_ton_mar18" $include "./modules/38_factor_costs/fixed_per_ton_mar18.gms" -$Ifi "%factor_costs%" == "mixed_feb17" $include "./modules/38_factor_costs/mixed_feb17.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + + +*' @title Factor Costs + +*' @description This module is used to calculate factor costs of production in +*' crop activities. The costs of factors of production included in this module +*' are specifically of labor, capital, and energy and related costs. The costs +*' are crop-specific, and pass to the the cost function in [11_costs]. +*' Thus, factor costs will contribute to and influence the choice of production +*' pattern in the model. + +*' @authors Jan Philipp Dietrich, Benjamin Bodirsky, Kristine Karstens + + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%factor_costs%" == "fixed_per_ton_mar18" $include "./modules/38_factor_costs/fixed_per_ton_mar18/realization.gms" +$Ifi "%factor_costs%" == "mixed_feb17" $include "./modules/38_factor_costs/mixed_feb17/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/39_landconversion/global_static_aug18/declarations.gms b/modules/39_landconversion/global_static_aug18/declarations.gms index 72e51b79e3..ef5d6e45a9 100644 --- a/modules/39_landconversion/global_static_aug18/declarations.gms +++ b/modules/39_landconversion/global_static_aug18/declarations.gms @@ -1,40 +1,41 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -equations - q39_cost_landcon_annuity(j,land) Calculation of cellular annuity costs of landconversion (mio. USD05MER per yr) - q39_cost_landcon(j,land) Calculation of cellular landconversion costs (mio. USD05MER per yr) -; - -variables - vm_cost_landcon(j,land) Land conversion costs (mio. USD05MER per yr) -; - -positive variable - v39_cost_landcon_annuity(j,land) Annuity costs of landconversion in the current timestep (mio. USD05MER per yr) -; - -scalar - s39_cost_establish Global land establishment costs (USD05MER per hectare) - s39_cost_clearing Global land clearing costs (USD05MER per ton C) -; - -parameters - i39_cost_establish(land) Global land establishment costs (USD05MER per hectare) - i39_cost_clearing(land) Global land clearing costs (USD05MER per ton C) - p39_cost_landcon_past(t,j,land) Costs for landconversion from the past (mio. USD05MER per yr) - pc39_cost_landcon_past(j,land) Costs for landconversion from the past in the current time step (mio. USD05MER per yr) -; - - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_cost_landcon(t,j,land,type) Land conversion costs (mio. USD05MER per yr) - ov39_cost_landcon_annuity(t,j,land,type) Annuity costs of landconversion in the current timestep (mio. USD05MER per yr) - oq39_cost_landcon_annuity(t,j,land,type) Calculation of cellular annuity costs of landconversion (mio. USD05MER per yr) - oq39_cost_landcon(t,j,land,type) Calculation of cellular landconversion costs (mio. USD05MER per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +equations + q39_cost_landcon_annuity(j,land) Calculation of cellular annuity costs of landconversion (mio. USD05MER per yr) + q39_cost_landcon(j,land) Calculation of cellular landconversion costs (mio. USD05MER per yr) +; + +variables + vm_cost_landcon(j,land) Land conversion costs (mio. USD05MER per yr) +; + +positive variable + v39_cost_landcon_annuity(j,land) Annuity costs of landconversion in the current timestep (mio. USD05MER per yr) +; + +scalar + s39_cost_establish Global land establishment costs (USD05MER per hectare) + s39_cost_clearing Global land clearing costs (USD05MER per ton C) +; + +parameters + i39_cost_establish(land) Global land establishment costs (USD05MER per hectare) + i39_cost_clearing(land) Global land clearing costs (USD05MER per ton C) + p39_cost_landcon_past(t,j,land) Costs for landconversion from the past (mio. USD05MER per yr) + pc39_cost_landcon_past(j,land) Costs for landconversion from the past in the current time step (mio. USD05MER per yr) +; + + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_cost_landcon(t,j,land,type) Land conversion costs (mio. USD05MER per yr) + ov39_cost_landcon_annuity(t,j,land,type) Annuity costs of landconversion in the current timestep (mio. USD05MER per yr) + oq39_cost_landcon_annuity(t,j,land,type) Calculation of cellular annuity costs of landconversion (mio. USD05MER per yr) + oq39_cost_landcon(t,j,land,type) Calculation of cellular landconversion costs (mio. USD05MER per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/39_landconversion/global_static_aug18/equations.gms b/modules/39_landconversion/global_static_aug18/equations.gms index c75fdc1b93..e7758b34de 100644 --- a/modules/39_landconversion/global_static_aug18/equations.gms +++ b/modules/39_landconversion/global_static_aug18/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations diff --git a/modules/39_landconversion/global_static_aug18/not_used.txt b/modules/39_landconversion/global_static_aug18/not_used.txt deleted file mode 100644 index f6f364f706..0000000000 --- a/modules/39_landconversion/global_static_aug18/not_used.txt +++ /dev/null @@ -1 +0,0 @@ -name,type,reason \ No newline at end of file diff --git a/modules/39_landconversion/global_static_aug18/postsolve.gms b/modules/39_landconversion/global_static_aug18/postsolve.gms index 72f788441d..97f22814c2 100644 --- a/modules/39_landconversion/global_static_aug18/postsolve.gms +++ b/modules/39_landconversion/global_static_aug18/postsolve.gms @@ -1,26 +1,27 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -p39_cost_landcon_past(t2,j,land) = p39_cost_landcon_past(t2,j,land) + v39_cost_landcon_annuity.l(j,land); - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_cost_landcon(t,j,land,"marginal") = vm_cost_landcon.m(j,land); - ov39_cost_landcon_annuity(t,j,land,"marginal") = v39_cost_landcon_annuity.m(j,land); - oq39_cost_landcon_annuity(t,j,land,"marginal") = q39_cost_landcon_annuity.m(j,land); - oq39_cost_landcon(t,j,land,"marginal") = q39_cost_landcon.m(j,land); - ov_cost_landcon(t,j,land,"level") = vm_cost_landcon.l(j,land); - ov39_cost_landcon_annuity(t,j,land,"level") = v39_cost_landcon_annuity.l(j,land); - oq39_cost_landcon_annuity(t,j,land,"level") = q39_cost_landcon_annuity.l(j,land); - oq39_cost_landcon(t,j,land,"level") = q39_cost_landcon.l(j,land); - ov_cost_landcon(t,j,land,"upper") = vm_cost_landcon.up(j,land); - ov39_cost_landcon_annuity(t,j,land,"upper") = v39_cost_landcon_annuity.up(j,land); - oq39_cost_landcon_annuity(t,j,land,"upper") = q39_cost_landcon_annuity.up(j,land); - oq39_cost_landcon(t,j,land,"upper") = q39_cost_landcon.up(j,land); - ov_cost_landcon(t,j,land,"lower") = vm_cost_landcon.lo(j,land); - ov39_cost_landcon_annuity(t,j,land,"lower") = v39_cost_landcon_annuity.lo(j,land); - oq39_cost_landcon_annuity(t,j,land,"lower") = q39_cost_landcon_annuity.lo(j,land); - oq39_cost_landcon(t,j,land,"lower") = q39_cost_landcon.lo(j,land); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 + +p39_cost_landcon_past(t2,j,land) = p39_cost_landcon_past(t2,j,land) + v39_cost_landcon_annuity.l(j,land); + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_cost_landcon(t,j,land,"marginal") = vm_cost_landcon.m(j,land); + ov39_cost_landcon_annuity(t,j,land,"marginal") = v39_cost_landcon_annuity.m(j,land); + oq39_cost_landcon_annuity(t,j,land,"marginal") = q39_cost_landcon_annuity.m(j,land); + oq39_cost_landcon(t,j,land,"marginal") = q39_cost_landcon.m(j,land); + ov_cost_landcon(t,j,land,"level") = vm_cost_landcon.l(j,land); + ov39_cost_landcon_annuity(t,j,land,"level") = v39_cost_landcon_annuity.l(j,land); + oq39_cost_landcon_annuity(t,j,land,"level") = q39_cost_landcon_annuity.l(j,land); + oq39_cost_landcon(t,j,land,"level") = q39_cost_landcon.l(j,land); + ov_cost_landcon(t,j,land,"upper") = vm_cost_landcon.up(j,land); + ov39_cost_landcon_annuity(t,j,land,"upper") = v39_cost_landcon_annuity.up(j,land); + oq39_cost_landcon_annuity(t,j,land,"upper") = q39_cost_landcon_annuity.up(j,land); + oq39_cost_landcon(t,j,land,"upper") = q39_cost_landcon.up(j,land); + ov_cost_landcon(t,j,land,"lower") = vm_cost_landcon.lo(j,land); + ov39_cost_landcon_annuity(t,j,land,"lower") = v39_cost_landcon_annuity.lo(j,land); + oq39_cost_landcon_annuity(t,j,land,"lower") = q39_cost_landcon_annuity.lo(j,land); + oq39_cost_landcon(t,j,land,"lower") = q39_cost_landcon.lo(j,land); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/39_landconversion/global_static_aug18/preloop.gms b/modules/39_landconversion/global_static_aug18/preloop.gms index a3a1a9dc0b..d50f8cfaa8 100644 --- a/modules/39_landconversion/global_static_aug18/preloop.gms +++ b/modules/39_landconversion/global_static_aug18/preloop.gms @@ -1,16 +1,17 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -s39_cost_establish = 8000; -s39_cost_clearing = 5; - -i39_cost_establish(land) = 0; -i39_cost_establish(land_establish39) = s39_cost_establish; - -i39_cost_clearing(land) = 0; -i39_cost_clearing(land_clearing39) = s39_cost_clearing; - -p39_cost_landcon_past(t,j,land) = 0; +*** | (C) 2008-2019 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 + +s39_cost_establish = 8000; +s39_cost_clearing = 5; + +i39_cost_establish(land) = 0; +i39_cost_establish(land_establish39) = s39_cost_establish; + +i39_cost_clearing(land) = 0; +i39_cost_clearing(land_clearing39) = s39_cost_clearing; + +p39_cost_landcon_past(t,j,land) = 0; diff --git a/modules/39_landconversion/global_static_aug18/presolve.gms b/modules/39_landconversion/global_static_aug18/presolve.gms index 6b54e06a02..a9ace52ec4 100644 --- a/modules/39_landconversion/global_static_aug18/presolve.gms +++ b/modules/39_landconversion/global_static_aug18/presolve.gms @@ -1,8 +1,9 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -pc39_cost_landcon_past(j,land) = p39_cost_landcon_past(t,j,land); - \ No newline at end of file +*** | (C) 2008-2019 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 + +pc39_cost_landcon_past(j,land) = p39_cost_landcon_past(t,j,land); + diff --git a/modules/39_landconversion/global_static_aug18.gms b/modules/39_landconversion/global_static_aug18/realization.gms similarity index 79% rename from modules/39_landconversion/global_static_aug18.gms rename to modules/39_landconversion/global_static_aug18/realization.gms index 5031fe6fd0..975598cd34 100644 --- a/modules/39_landconversion/global_static_aug18.gms +++ b/modules/39_landconversion/global_static_aug18/realization.gms @@ -1,23 +1,24 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description -*' In the global_static_aug18 realization, per hectare land conversion costs are separated into -*' costs for expansion of cropland, pasture and forestry (establishment costs) and -*' costs for clearing of primary forest, secondary forest and other natural land (clearing costs). -*' We assume a global cost factor of 8000 USD/ha (static over time) for establishment of managed land. -*' For clearing of natural vegetation we assume a global static cost factor of 5 USD/tC (based on @kreidenweis_pasture_2018). -*' -*' @limitations Data availability for land conversion costs is very limited. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/39_landconversion/global_static_aug18/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/39_landconversion/global_static_aug18/declarations.gms" -$Ifi "%phase%" == "equations" $include "./modules/39_landconversion/global_static_aug18/equations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/39_landconversion/global_static_aug18/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/39_landconversion/global_static_aug18/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/39_landconversion/global_static_aug18/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description +*' In the global_static_aug18 realization, per hectare land conversion costs are separated into +*' costs for expansion of cropland, pasture and forestry (establishment costs) and +*' costs for clearing of primary forest, secondary forest and other natural land (clearing costs). +*' We assume a global cost factor of 8000 USD/ha (static over time) for establishment of managed land. +*' For clearing of natural vegetation we assume a global static cost factor of 5 USD/tC (based on @kreidenweis_pasture_2018). +*' +*' @limitations Data availability for land conversion costs is very limited. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/39_landconversion/global_static_aug18/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/39_landconversion/global_static_aug18/declarations.gms" +$Ifi "%phase%" == "equations" $include "./modules/39_landconversion/global_static_aug18/equations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/39_landconversion/global_static_aug18/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/39_landconversion/global_static_aug18/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/39_landconversion/global_static_aug18/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/39_landconversion/global_static_aug18/sets.gms b/modules/39_landconversion/global_static_aug18/sets.gms index 59e378666c..6e31109cf4 100644 --- a/modules/39_landconversion/global_static_aug18/sets.gms +++ b/modules/39_landconversion/global_static_aug18/sets.gms @@ -1,13 +1,14 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -sets - land_establish39(land) Managed land pools - / crop, past, forestry / - - land_clearing39(land) Natural vegetation land pools - / primforest, secdforest, other / -; +*** | (C) 2008-2019 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 + +sets + land_establish39(land) Managed land pools + / crop, past, forestry / + + land_clearing39(land) Natural vegetation land pools + / primforest, secdforest, other / +; diff --git a/modules/39_landconversion/39_landconversion.gms b/modules/39_landconversion/module.gms similarity index 67% rename from modules/39_landconversion/39_landconversion.gms rename to modules/39_landconversion/module.gms index 4716f99dc9..f84cc20601 100644 --- a/modules/39_landconversion/39_landconversion.gms +++ b/modules/39_landconversion/module.gms @@ -1,21 +1,22 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Land Conversion Costs - -*' @description The land conversion cost module calculates costs for the conversion -*' from one land type to another (e.g. conversion from forest to cropland). -*' Land conversion plays an important role for the overall model dynamics, -*' in particular in terms of CO2 emissions from land-use change. -*' Expansion of agricultural land is one of the major options in the model to increase -*' agricultural production, besides yield increases ([13_tc], [14_yields]) and trade ([21_trade]). -*' -*' -*' @authors Florian Humpenöder, Jan Philipp Dietrich, Ulrich Kreidenweis - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%landconversion%" == "global_static_aug18" $include "./modules/39_landconversion/global_static_aug18.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Land Conversion Costs + +*' @description The land conversion cost module calculates costs for the conversion +*' from one land type to another (e.g. conversion from forest to cropland). +*' Land conversion plays an important role for the overall model dynamics, +*' in particular in terms of CO2 emissions from land-use change. +*' Expansion of agricultural land is one of the major options in the model to increase +*' agricultural production, besides yield increases ([13_tc], [14_yields]) and trade ([21_trade]). +*' +*' +*' @authors Florian Humpenöder, Jan Philipp Dietrich, Ulrich Kreidenweis + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%landconversion%" == "global_static_aug18" $include "./modules/39_landconversion/global_static_aug18/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/40_transport/gtap_nov12/declarations.gms b/modules/40_transport/gtap_nov12/declarations.gms index 6150625720..1e4bafcdeb 100644 --- a/modules/40_transport/gtap_nov12/declarations.gms +++ b/modules/40_transport/gtap_nov12/declarations.gms @@ -1,20 +1,21 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -equation -q40_cost_transport(j,k) Cellular transport costs for k (mio. USD05MER per yr) -; - -variables - vm_cost_transp(j,k) Transportation costs (mio. USD05MER per yr) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_cost_transp(t,j,k,type) Transportation costs (mio. USD05MER per yr) - oq40_cost_transport(t,j,k,type) Cellular transport costs for k (mio. USD05MER per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 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 + +equation +q40_cost_transport(j,k) Cellular transport costs for k (mio. USD05MER per yr) +; + +variables + vm_cost_transp(j,k) Transportation costs (mio. USD05MER per yr) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_cost_transp(t,j,k,type) Transportation costs (mio. USD05MER per yr) + oq40_cost_transport(t,j,k,type) Cellular transport costs for k (mio. USD05MER per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/40_transport/gtap_nov12/equations.gms b/modules/40_transport/gtap_nov12/equations.gms index ab1e9ae427..be2bda073f 100644 --- a/modules/40_transport/gtap_nov12/equations.gms +++ b/modules/40_transport/gtap_nov12/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations diff --git a/modules/40_transport/gtap_nov12/input.gms b/modules/40_transport/gtap_nov12/input.gms index b95984505e..8172502d79 100644 --- a/modules/40_transport/gtap_nov12/input.gms +++ b/modules/40_transport/gtap_nov12/input.gms @@ -1,29 +1,30 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -scalars - s40_pasture_transport_costs Transport costs for pasture (USD05MER per tDM per min) / 0 / -; - - -parameters -f40_distance(j) Transport distance to urban center (min) -/ -$ondelim -$include "./modules/40_transport/input/transport_distance.cs2" -$offdelim -/ -; - -parameter f40_transport_costs(k) Relative transport costs (USD05MER per tDM per min) -/ -$ondelim -$include "./modules/40_transport/gtap_nov12/input/f40_transport_costs.csv" -$offdelim -/; - -f40_transport_costs("pasture") = s40_pasture_transport_costs; +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + +scalars + s40_pasture_transport_costs Transport costs for pasture (USD05MER per tDM per min) / 0 / +; + + +parameters +f40_distance(j) Transport distance to urban center (min) +/ +$ondelim +$include "./modules/40_transport/input/transport_distance.cs2" +$offdelim +/ +; + +parameter f40_transport_costs(k) Relative transport costs (USD05MER per tDM per min) +/ +$ondelim +$include "./modules/40_transport/gtap_nov12/input/f40_transport_costs.csv" +$offdelim +/; + +f40_transport_costs("pasture") = s40_pasture_transport_costs; diff --git a/modules/40_transport/gtap_nov12/postsolve.gms b/modules/40_transport/gtap_nov12/postsolve.gms index 9f203b7ad7..543f1614d0 100644 --- a/modules/40_transport/gtap_nov12/postsolve.gms +++ b/modules/40_transport/gtap_nov12/postsolve.gms @@ -1,18 +1,19 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_cost_transp(t,j,k,"marginal") = vm_cost_transp.m(j,k); - oq40_cost_transport(t,j,k,"marginal") = q40_cost_transport.m(j,k); - ov_cost_transp(t,j,k,"level") = vm_cost_transp.l(j,k); - oq40_cost_transport(t,j,k,"level") = q40_cost_transport.l(j,k); - ov_cost_transp(t,j,k,"upper") = vm_cost_transp.up(j,k); - oq40_cost_transport(t,j,k,"upper") = q40_cost_transport.up(j,k); - ov_cost_transp(t,j,k,"lower") = vm_cost_transp.lo(j,k); - oq40_cost_transport(t,j,k,"lower") = q40_cost_transport.lo(j,k); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 + + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_cost_transp(t,j,k,"marginal") = vm_cost_transp.m(j,k); + oq40_cost_transport(t,j,k,"marginal") = q40_cost_transport.m(j,k); + ov_cost_transp(t,j,k,"level") = vm_cost_transp.l(j,k); + oq40_cost_transport(t,j,k,"level") = q40_cost_transport.l(j,k); + ov_cost_transp(t,j,k,"upper") = vm_cost_transp.up(j,k); + oq40_cost_transport(t,j,k,"upper") = q40_cost_transport.up(j,k); + ov_cost_transp(t,j,k,"lower") = vm_cost_transp.lo(j,k); + oq40_cost_transport(t,j,k,"lower") = q40_cost_transport.lo(j,k); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/40_transport/gtap_nov12.gms b/modules/40_transport/gtap_nov12/realization.gms similarity index 72% rename from modules/40_transport/gtap_nov12.gms rename to modules/40_transport/gtap_nov12/realization.gms index e5a84966b6..f740f2d062 100644 --- a/modules/40_transport/gtap_nov12.gms +++ b/modules/40_transport/gtap_nov12/realization.gms @@ -1,22 +1,23 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description In this realization transportation costs -*' are calculated based on the assumption that transport -*' costs are proportional to the mass which has to be -*' transported and the time which is required for the transport. -*' -*' @limitations The information in distances between -*' production sites and markets is static over time, -*' meaning that infrastructure is assumed to be static -*' over time. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "declarations" $include "./modules/40_transport/gtap_nov12/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/40_transport/gtap_nov12/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/40_transport/gtap_nov12/equations.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/40_transport/gtap_nov12/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description In this realization transportation costs +*' are calculated based on the assumption that transport +*' costs are proportional to the mass which has to be +*' transported and the time which is required for the transport. +*' +*' @limitations The information in distances between +*' production sites and markets is static over time, +*' meaning that infrastructure is assumed to be static +*' over time. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "declarations" $include "./modules/40_transport/gtap_nov12/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/40_transport/gtap_nov12/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/40_transport/gtap_nov12/equations.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/40_transport/gtap_nov12/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/40_transport/40_transport.gms b/modules/40_transport/module.gms similarity index 69% rename from modules/40_transport/40_transport.gms rename to modules/40_transport/module.gms index e15a0e4962..3810fb7936 100644 --- a/modules/40_transport/40_transport.gms +++ b/modules/40_transport/module.gms @@ -1,22 +1,23 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Transport -*' -*' @description The [40_transport] module simulates the intraregional -*' transportation of agricultural products between producer site -*' and the next city centre (market). It covers the transport of -*' inputs such as fertilizers to the production site as well as -*' the transport of products to the market. Calculations are based -*' on cellular and global parameters and returns the corresponding -*' cellular transport costs which are then used by the [11_costs] module. -*' -*' @authors Jan Philipp Dietrich, Florian Humpenöder, Benjamin Bodirsky, Isabelle Weindl, Michael Krause. - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%transport%" == "gtap_nov12" $include "./modules/40_transport/gtap_nov12.gms" -$Ifi "%transport%" == "off" $include "./modules/40_transport/off.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Transport +*' +*' @description The [40_transport] module simulates the intraregional +*' transportation of agricultural products between producer site +*' and the next city centre (market). It covers the transport of +*' inputs such as fertilizers to the production site as well as +*' the transport of products to the market. Calculations are based +*' on cellular and global parameters and returns the corresponding +*' cellular transport costs which are then used by the [11_costs] module. +*' +*' @authors Jan Philipp Dietrich, Florian Humpenöder, Benjamin Bodirsky, Isabelle Weindl, Michael Krause. + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%transport%" == "gtap_nov12" $include "./modules/40_transport/gtap_nov12/realization.gms" +$Ifi "%transport%" == "off" $include "./modules/40_transport/off/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/40_transport/off/declarations.gms b/modules/40_transport/off/declarations.gms index fd2d72eeea..acf7f8d41b 100644 --- a/modules/40_transport/off/declarations.gms +++ b/modules/40_transport/off/declarations.gms @@ -1,16 +1,17 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -variables - vm_cost_transp(j,k) Transportation costs (mio. USD05MER) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_cost_transp(t,j,k,type) Transportation costs (mio. USD05MER) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 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 + + +variables + vm_cost_transp(j,k) Transportation costs (mio. USD05MER) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_cost_transp(t,j,k,type) Transportation costs (mio. USD05MER) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/40_transport/off/not_used.txt b/modules/40_transport/off/not_used.txt index 288d84c249..a7b7909721 100644 --- a/modules/40_transport/off/not_used.txt +++ b/modules/40_transport/off/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason diff --git a/modules/40_transport/off/postsolve.gms b/modules/40_transport/off/postsolve.gms index 2357cbf491..ac82179215 100644 --- a/modules/40_transport/off/postsolve.gms +++ b/modules/40_transport/off/postsolve.gms @@ -1,14 +1,15 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_cost_transp(t,j,k,"marginal") = vm_cost_transp.m(j,k); - ov_cost_transp(t,j,k,"level") = vm_cost_transp.l(j,k); - ov_cost_transp(t,j,k,"upper") = vm_cost_transp.up(j,k); - ov_cost_transp(t,j,k,"lower") = vm_cost_transp.lo(j,k); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - +*** | (C) 2008-2019 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 + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_cost_transp(t,j,k,"marginal") = vm_cost_transp.m(j,k); + ov_cost_transp(t,j,k,"level") = vm_cost_transp.l(j,k); + ov_cost_transp(t,j,k,"upper") = vm_cost_transp.up(j,k); + ov_cost_transp(t,j,k,"lower") = vm_cost_transp.lo(j,k); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### + diff --git a/modules/40_transport/off/presolve.gms b/modules/40_transport/off/presolve.gms index a28d5c27d4..6a100018f5 100644 --- a/modules/40_transport/off/presolve.gms +++ b/modules/40_transport/off/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/40_transport/off.gms b/modules/40_transport/off/realization.gms similarity index 65% rename from modules/40_transport/off.gms rename to modules/40_transport/off/realization.gms index 346908b91b..9420d8f330 100644 --- a/modules/40_transport/off.gms +++ b/modules/40_transport/off/realization.gms @@ -1,17 +1,18 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description In this realization the transport -*' of goods is assumed to be free of charge. -*' Correspondingly transportation costs are fixed to 0. -*' -*' @limitations No simulation of transportation (transportation free of charge). - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "declarations" $include "./modules/40_transport/off/declarations.gms" -$Ifi "%phase%" == "presolve" $include "./modules/40_transport/off/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/40_transport/off/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description In this realization the transport +*' of goods is assumed to be free of charge. +*' Correspondingly transportation costs are fixed to 0. +*' +*' @limitations No simulation of transportation (transportation free of charge). + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "declarations" $include "./modules/40_transport/off/declarations.gms" +$Ifi "%phase%" == "presolve" $include "./modules/40_transport/off/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/40_transport/off/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/41_area_equipped_for_irrigation/endo_apr13/declarations.gms b/modules/41_area_equipped_for_irrigation/endo_apr13/declarations.gms index 265281a3e3..2c0963728f 100644 --- a/modules/41_area_equipped_for_irrigation/endo_apr13/declarations.gms +++ b/modules/41_area_equipped_for_irrigation/endo_apr13/declarations.gms @@ -1,39 +1,40 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -parameters - p41_cost_AEI_past(t,i) Costs for AEI expansion from the past (mio. USD04MER) - pc41_cost_AEI_past(i) Current costs for AEI expansion from the past (mio. USD04MER) - p41_AEI_start(t,j) Area equipped for irrigation at the beginning of each time step (mio. ha) - pc41_AEI_start(j) Area equipped for irrigation at the beginning of current time step (mio. ha) - pc41_unitcost_AEI(i) Unit cost of AEI expansion (USD04MER per ha) -; - -variables - vm_cost_AEI(i) Irrigation expansion costs (mio. USD04MER per yr) - v41_cost_AEI_annuity(i) Annuity costs of AEI expansion in the current time step (mio. USD04MER per yr) -; - -positive variables - v41_AEI(j) Area equipped for irrigation in each grid cell (mio. ha) -; - -equations - q41_area_irrig(j) Irrigation area constraint (mio. ha) - q41_cost_AEI_annuity(i) Calculation of annuity costs of AEI expansion (mio. USD04MER) - q41_cost_AEI(i) Calculation of costs of irrigation area expansion (mio. USD04MER) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_cost_AEI(t,i,type) Irrigation expansion costs (mio. USD04MER per yr) - ov41_cost_AEI_annuity(t,i,type) Annuity costs of AEI expansion in the current time step (mio. USD04MER per yr) - ov41_AEI(t,j,type) Area equipped for irrigation in each grid cell (mio. ha) - oq41_area_irrig(t,j,type) Irrigation area constraint (mio. ha) - oq41_cost_AEI_annuity(t,i,type) Calculation of annuity costs of AEI expansion (mio. USD04MER) - oq41_cost_AEI(t,i,type) Calculation of costs of irrigation area expansion (mio. USD04MER) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +parameters + p41_cost_AEI_past(t,i) Costs for AEI expansion from the past (mio. USD04MER) + pc41_cost_AEI_past(i) Current costs for AEI expansion from the past (mio. USD04MER) + p41_AEI_start(t,j) Area equipped for irrigation at the beginning of each time step (mio. ha) + pc41_AEI_start(j) Area equipped for irrigation at the beginning of current time step (mio. ha) + pc41_unitcost_AEI(i) Unit cost of AEI expansion (USD04MER per ha) +; + +variables + vm_cost_AEI(i) Irrigation expansion costs (mio. USD04MER per yr) + v41_cost_AEI_annuity(i) Annuity costs of AEI expansion in the current time step (mio. USD04MER per yr) +; + +positive variables + v41_AEI(j) Area equipped for irrigation in each grid cell (mio. ha) +; + +equations + q41_area_irrig(j) Irrigation area constraint (mio. ha) + q41_cost_AEI_annuity(i) Calculation of annuity costs of AEI expansion (mio. USD04MER) + q41_cost_AEI(i) Calculation of costs of irrigation area expansion (mio. USD04MER) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_cost_AEI(t,i,type) Irrigation expansion costs (mio. USD04MER per yr) + ov41_cost_AEI_annuity(t,i,type) Annuity costs of AEI expansion in the current time step (mio. USD04MER per yr) + ov41_AEI(t,j,type) Area equipped for irrigation in each grid cell (mio. ha) + oq41_area_irrig(t,j,type) Irrigation area constraint (mio. ha) + oq41_cost_AEI_annuity(t,i,type) Calculation of annuity costs of AEI expansion (mio. USD04MER) + oq41_cost_AEI(t,i,type) Calculation of costs of irrigation area expansion (mio. USD04MER) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/41_area_equipped_for_irrigation/endo_apr13/equations.gms b/modules/41_area_equipped_for_irrigation/endo_apr13/equations.gms index e30aacb53d..bad1054c28 100644 --- a/modules/41_area_equipped_for_irrigation/endo_apr13/equations.gms +++ b/modules/41_area_equipped_for_irrigation/endo_apr13/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations diff --git a/modules/41_area_equipped_for_irrigation/endo_apr13/input.gms b/modules/41_area_equipped_for_irrigation/endo_apr13/input.gms index d4a1177cfd..a75d16d322 100644 --- a/modules/41_area_equipped_for_irrigation/endo_apr13/input.gms +++ b/modules/41_area_equipped_for_irrigation/endo_apr13/input.gms @@ -1,20 +1,21 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -table f41_c_irrig(t_all,i) Irrigation investment costs (USD04MER per ha) -$ondelim -$include "./modules/41_area_equipped_for_irrigation/endo_apr13/input/f41_c_irrig.csv" -$offdelim -; - -parameters -f41_irrig(j) Available area equipped for irrigation [AVL] (mio. ha) -/ -$ondelim -$include "./modules/41_area_equipped_for_irrigation/input/avl_irrig.cs2" -$offdelim -/ -; +*** | (C) 2008-2019 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 + +table f41_c_irrig(t_all,i) Irrigation investment costs (USD04MER per ha) +$ondelim +$include "./modules/41_area_equipped_for_irrigation/endo_apr13/input/f41_c_irrig.csv" +$offdelim +; + +parameters +f41_irrig(j) Available area equipped for irrigation [AVL] (mio. ha) +/ +$ondelim +$include "./modules/41_area_equipped_for_irrigation/input/avl_irrig.cs2" +$offdelim +/ +; diff --git a/modules/41_area_equipped_for_irrigation/endo_apr13/postsolve.gms b/modules/41_area_equipped_for_irrigation/endo_apr13/postsolve.gms index ec921d8163..eb1f1385bf 100644 --- a/modules/41_area_equipped_for_irrigation/endo_apr13/postsolve.gms +++ b/modules/41_area_equipped_for_irrigation/endo_apr13/postsolve.gms @@ -1,36 +1,37 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -pc41_AEI_start(j)=v41_AEI.l(j); - -p41_cost_AEI_past(t2,i) = p41_cost_AEI_past(t2,i) + v41_cost_AEI_annuity.l(i); - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_cost_AEI(t,i,"marginal") = vm_cost_AEI.m(i); - ov41_cost_AEI_annuity(t,i,"marginal") = v41_cost_AEI_annuity.m(i); - ov41_AEI(t,j,"marginal") = v41_AEI.m(j); - oq41_area_irrig(t,j,"marginal") = q41_area_irrig.m(j); - oq41_cost_AEI_annuity(t,i,"marginal") = q41_cost_AEI_annuity.m(i); - oq41_cost_AEI(t,i,"marginal") = q41_cost_AEI.m(i); - ov_cost_AEI(t,i,"level") = vm_cost_AEI.l(i); - ov41_cost_AEI_annuity(t,i,"level") = v41_cost_AEI_annuity.l(i); - ov41_AEI(t,j,"level") = v41_AEI.l(j); - oq41_area_irrig(t,j,"level") = q41_area_irrig.l(j); - oq41_cost_AEI_annuity(t,i,"level") = q41_cost_AEI_annuity.l(i); - oq41_cost_AEI(t,i,"level") = q41_cost_AEI.l(i); - ov_cost_AEI(t,i,"upper") = vm_cost_AEI.up(i); - ov41_cost_AEI_annuity(t,i,"upper") = v41_cost_AEI_annuity.up(i); - ov41_AEI(t,j,"upper") = v41_AEI.up(j); - oq41_area_irrig(t,j,"upper") = q41_area_irrig.up(j); - oq41_cost_AEI_annuity(t,i,"upper") = q41_cost_AEI_annuity.up(i); - oq41_cost_AEI(t,i,"upper") = q41_cost_AEI.up(i); - ov_cost_AEI(t,i,"lower") = vm_cost_AEI.lo(i); - ov41_cost_AEI_annuity(t,i,"lower") = v41_cost_AEI_annuity.lo(i); - ov41_AEI(t,j,"lower") = v41_AEI.lo(j); - oq41_area_irrig(t,j,"lower") = q41_area_irrig.lo(j); - oq41_cost_AEI_annuity(t,i,"lower") = q41_cost_AEI_annuity.lo(i); - oq41_cost_AEI(t,i,"lower") = q41_cost_AEI.lo(i); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 + +pc41_AEI_start(j)=v41_AEI.l(j); + +p41_cost_AEI_past(t2,i) = p41_cost_AEI_past(t2,i) + v41_cost_AEI_annuity.l(i); + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_cost_AEI(t,i,"marginal") = vm_cost_AEI.m(i); + ov41_cost_AEI_annuity(t,i,"marginal") = v41_cost_AEI_annuity.m(i); + ov41_AEI(t,j,"marginal") = v41_AEI.m(j); + oq41_area_irrig(t,j,"marginal") = q41_area_irrig.m(j); + oq41_cost_AEI_annuity(t,i,"marginal") = q41_cost_AEI_annuity.m(i); + oq41_cost_AEI(t,i,"marginal") = q41_cost_AEI.m(i); + ov_cost_AEI(t,i,"level") = vm_cost_AEI.l(i); + ov41_cost_AEI_annuity(t,i,"level") = v41_cost_AEI_annuity.l(i); + ov41_AEI(t,j,"level") = v41_AEI.l(j); + oq41_area_irrig(t,j,"level") = q41_area_irrig.l(j); + oq41_cost_AEI_annuity(t,i,"level") = q41_cost_AEI_annuity.l(i); + oq41_cost_AEI(t,i,"level") = q41_cost_AEI.l(i); + ov_cost_AEI(t,i,"upper") = vm_cost_AEI.up(i); + ov41_cost_AEI_annuity(t,i,"upper") = v41_cost_AEI_annuity.up(i); + ov41_AEI(t,j,"upper") = v41_AEI.up(j); + oq41_area_irrig(t,j,"upper") = q41_area_irrig.up(j); + oq41_cost_AEI_annuity(t,i,"upper") = q41_cost_AEI_annuity.up(i); + oq41_cost_AEI(t,i,"upper") = q41_cost_AEI.up(i); + ov_cost_AEI(t,i,"lower") = vm_cost_AEI.lo(i); + ov41_cost_AEI_annuity(t,i,"lower") = v41_cost_AEI_annuity.lo(i); + ov41_AEI(t,j,"lower") = v41_AEI.lo(j); + oq41_area_irrig(t,j,"lower") = q41_area_irrig.lo(j); + oq41_cost_AEI_annuity(t,i,"lower") = q41_cost_AEI_annuity.lo(i); + oq41_cost_AEI(t,i,"lower") = q41_cost_AEI.lo(i); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/41_area_equipped_for_irrigation/endo_apr13/preloop.gms b/modules/41_area_equipped_for_irrigation/endo_apr13/preloop.gms index d6329d05df..b3d5cfd224 100644 --- a/modules/41_area_equipped_for_irrigation/endo_apr13/preloop.gms +++ b/modules/41_area_equipped_for_irrigation/endo_apr13/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 pc41_AEI_start(j)=f41_irrig(j); diff --git a/modules/41_area_equipped_for_irrigation/endo_apr13/presolve.gms b/modules/41_area_equipped_for_irrigation/endo_apr13/presolve.gms index 6b0fb16630..6b58922cf9 100644 --- a/modules/41_area_equipped_for_irrigation/endo_apr13/presolve.gms +++ b/modules/41_area_equipped_for_irrigation/endo_apr13/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 p41_AEI_start(t,j) = pc41_AEI_start(j); diff --git a/modules/41_area_equipped_for_irrigation/endo_apr13.gms b/modules/41_area_equipped_for_irrigation/endo_apr13/realization.gms similarity index 84% rename from modules/41_area_equipped_for_irrigation/endo_apr13.gms rename to modules/41_area_equipped_for_irrigation/endo_apr13/realization.gms index 7ea408964b..31191a8e1c 100644 --- a/modules/41_area_equipped_for_irrigation/endo_apr13.gms +++ b/modules/41_area_equipped_for_irrigation/endo_apr13/realization.gms @@ -1,36 +1,37 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -*' @description This realization allows the model to endogenously decide on investments to deploy additional -*' irrigation infrastructure, i.e. to increase the area equipped for irrigation (AEI). Initial values for AEI -*' in 1995 are taken from @siebert_FAO_2007. Contraction of AEI is not possible. -*' Irrigated crop production can only take place where irrigation infrastructure is present. -*' -*' Unit costs per hectare for AEI expansion are derived from a World Bank study (@worldbank_irrigation_1995) -*' and adjusted for the regions used in MAgPIE. The region mapping is as follows: -*' -*' ![Mapping between MAgPIE regions and the regions in -*' [@worldbank_irrigation_1995]](regions.png){ width=60% } -*' -*' The regional unit costs converge linearly towards the European level until 2050. -*' -*' ![Unit costs for AEI expansion in MAgPIE -*' ](unitcosts.png){ width=60% } -*' -*' @limitations This realization increases model complexity. - - - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "declarations" $include "./modules/41_area_equipped_for_irrigation/endo_apr13/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/41_area_equipped_for_irrigation/endo_apr13/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/41_area_equipped_for_irrigation/endo_apr13/equations.gms" -$Ifi "%phase%" == "scaling" $include "./modules/41_area_equipped_for_irrigation/endo_apr13/scaling.gms" -$Ifi "%phase%" == "preloop" $include "./modules/41_area_equipped_for_irrigation/endo_apr13/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/41_area_equipped_for_irrigation/endo_apr13/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/41_area_equipped_for_irrigation/endo_apr13/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + +*' @description This realization allows the model to endogenously decide on investments to deploy additional +*' irrigation infrastructure, i.e. to increase the area equipped for irrigation (AEI). Initial values for AEI +*' in 1995 are taken from @siebert_FAO_2007. Contraction of AEI is not possible. +*' Irrigated crop production can only take place where irrigation infrastructure is present. +*' +*' Unit costs per hectare for AEI expansion are derived from a World Bank study (@worldbank_irrigation_1995) +*' and adjusted for the regions used in MAgPIE. The region mapping is as follows: +*' +*' ![Mapping between MAgPIE regions and the regions in +*' [@worldbank_irrigation_1995]](regions.png){ width=60% } +*' +*' The regional unit costs converge linearly towards the European level until 2050. +*' +*' ![Unit costs for AEI expansion in MAgPIE +*' ](unitcosts.png){ width=60% } +*' +*' @limitations This realization increases model complexity. + + + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "declarations" $include "./modules/41_area_equipped_for_irrigation/endo_apr13/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/41_area_equipped_for_irrigation/endo_apr13/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/41_area_equipped_for_irrigation/endo_apr13/equations.gms" +$Ifi "%phase%" == "scaling" $include "./modules/41_area_equipped_for_irrigation/endo_apr13/scaling.gms" +$Ifi "%phase%" == "preloop" $include "./modules/41_area_equipped_for_irrigation/endo_apr13/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/41_area_equipped_for_irrigation/endo_apr13/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/41_area_equipped_for_irrigation/endo_apr13/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/41_area_equipped_for_irrigation/endo_apr13/scaling.gms b/modules/41_area_equipped_for_irrigation/endo_apr13/scaling.gms index 2655bf1438..97152ee588 100644 --- a/modules/41_area_equipped_for_irrigation/endo_apr13/scaling.gms +++ b/modules/41_area_equipped_for_irrigation/endo_apr13/scaling.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de vm_cost_AEI.scale(i) = 10e4; diff --git a/modules/41_area_equipped_for_irrigation/41_area_equipped_for_irrigation.gms b/modules/41_area_equipped_for_irrigation/module.gms similarity index 60% rename from modules/41_area_equipped_for_irrigation/41_area_equipped_for_irrigation.gms rename to modules/41_area_equipped_for_irrigation/module.gms index e11e8104a5..51d9b1ebbb 100644 --- a/modules/41_area_equipped_for_irrigation/41_area_equipped_for_irrigation.gms +++ b/modules/41_area_equipped_for_irrigation/module.gms @@ -1,19 +1,20 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Area equipped for irrigation -*' -*' @description The area equipped for irrigation module constrains irrigated crop -*' production to those areas that are equipped with irrigation infrastructure and simulates -*' the evolution of areas equipped for irrigation. The module receives information about -*' the area actually irrigated from the [30_crop] module. -*' -*' @authors Anne Biewald, Markus Bonsch, Christoph Schmitz - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%area_equipped_for_irrigation%" == "endo_apr13" $include "./modules/41_area_equipped_for_irrigation/endo_apr13.gms" -$Ifi "%area_equipped_for_irrigation%" == "static" $include "./modules/41_area_equipped_for_irrigation/static.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Area equipped for irrigation +*' +*' @description The area equipped for irrigation module constrains irrigated crop +*' production to those areas that are equipped with irrigation infrastructure and simulates +*' the evolution of areas equipped for irrigation. The module receives information about +*' the area actually irrigated from the [30_crop] module. +*' +*' @authors Anne Biewald, Markus Bonsch, Christoph Schmitz + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%area_equipped_for_irrigation%" == "endo_apr13" $include "./modules/41_area_equipped_for_irrigation/endo_apr13/realization.gms" +$Ifi "%area_equipped_for_irrigation%" == "static" $include "./modules/41_area_equipped_for_irrigation/static/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/41_area_equipped_for_irrigation/static/declarations.gms b/modules/41_area_equipped_for_irrigation/static/declarations.gms index 6fd17240f0..89a7ed574d 100644 --- a/modules/41_area_equipped_for_irrigation/static/declarations.gms +++ b/modules/41_area_equipped_for_irrigation/static/declarations.gms @@ -1,25 +1,26 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -variables - vm_cost_AEI(i) Irrigation expansion costs (mio. USD04MER) -; - -positive variables - v41_AEI(j) Area equipped for irrigation in each grid cell (mio. ha) -; - -equations - q41_area_irrig(j) Irrigation area constraint (mio. ha) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_cost_AEI(t,i,type) Irrigation expansion costs (mio. USD04MER) - ov41_AEI(t,j,type) Area equipped for irrigation in each grid cell (mio. ha) - oq41_area_irrig(t,j,type) Irrigation area constraint (mio. ha) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 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 + +variables + vm_cost_AEI(i) Irrigation expansion costs (mio. USD04MER) +; + +positive variables + v41_AEI(j) Area equipped for irrigation in each grid cell (mio. ha) +; + +equations + q41_area_irrig(j) Irrigation area constraint (mio. ha) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_cost_AEI(t,i,type) Irrigation expansion costs (mio. USD04MER) + ov41_AEI(t,j,type) Area equipped for irrigation in each grid cell (mio. ha) + oq41_area_irrig(t,j,type) Irrigation area constraint (mio. ha) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/41_area_equipped_for_irrigation/static/equations.gms b/modules/41_area_equipped_for_irrigation/static/equations.gms index be53d03aae..dd18dd8390 100644 --- a/modules/41_area_equipped_for_irrigation/static/equations.gms +++ b/modules/41_area_equipped_for_irrigation/static/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations @@ -12,4 +13,4 @@ *' This realization assures that irrigated crop production can only take place where *' irrigation infrastructure is present, i.e. the sum of irrigated cropland `vm_area(j,kcr,"irrigated")` *' over all crops in each grid cell has to be less than or equal to the area in this grid cell that is -*' equipped with irrigation infrastructure (`v41_AEI(j)`). \ No newline at end of file +*' equipped with irrigation infrastructure (`v41_AEI(j)`). diff --git a/modules/41_area_equipped_for_irrigation/static/input.gms b/modules/41_area_equipped_for_irrigation/static/input.gms index 21cdb5b7a4..a3d28658c9 100644 --- a/modules/41_area_equipped_for_irrigation/static/input.gms +++ b/modules/41_area_equipped_for_irrigation/static/input.gms @@ -1,14 +1,15 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -parameters -f41_irrig(j) Available area equipped for irrigation [AVL] (mio. ha) -/ -$ondelim -$include "./modules/41_area_equipped_for_irrigation/input/avl_irrig.cs2" -$offdelim -/ -; +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +parameters +f41_irrig(j) Available area equipped for irrigation [AVL] (mio. ha) +/ +$ondelim +$include "./modules/41_area_equipped_for_irrigation/input/avl_irrig.cs2" +$offdelim +/ +; diff --git a/modules/41_area_equipped_for_irrigation/static/not_used.txt b/modules/41_area_equipped_for_irrigation/static/not_used.txt index d7fc68b10a..6e0f6d3344 100644 --- a/modules/41_area_equipped_for_irrigation/static/not_used.txt +++ b/modules/41_area_equipped_for_irrigation/static/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason pm_interest, input, not needed diff --git a/modules/41_area_equipped_for_irrigation/static/postsolve.gms b/modules/41_area_equipped_for_irrigation/static/postsolve.gms index 2e420c73c2..95d4ecb02d 100644 --- a/modules/41_area_equipped_for_irrigation/static/postsolve.gms +++ b/modules/41_area_equipped_for_irrigation/static/postsolve.gms @@ -1,22 +1,23 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_cost_AEI(t,i,"marginal") = vm_cost_AEI.m(i); - ov41_AEI(t,j,"marginal") = v41_AEI.m(j); - oq41_area_irrig(t,j,"marginal") = q41_area_irrig.m(j); - ov_cost_AEI(t,i,"level") = vm_cost_AEI.l(i); - ov41_AEI(t,j,"level") = v41_AEI.l(j); - oq41_area_irrig(t,j,"level") = q41_area_irrig.l(j); - ov_cost_AEI(t,i,"upper") = vm_cost_AEI.up(i); - ov41_AEI(t,j,"upper") = v41_AEI.up(j); - oq41_area_irrig(t,j,"upper") = q41_area_irrig.up(j); - ov_cost_AEI(t,i,"lower") = vm_cost_AEI.lo(i); - ov41_AEI(t,j,"lower") = v41_AEI.lo(j); - oq41_area_irrig(t,j,"lower") = q41_area_irrig.lo(j); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - +*** | (C) 2008-2019 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 + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_cost_AEI(t,i,"marginal") = vm_cost_AEI.m(i); + ov41_AEI(t,j,"marginal") = v41_AEI.m(j); + oq41_area_irrig(t,j,"marginal") = q41_area_irrig.m(j); + ov_cost_AEI(t,i,"level") = vm_cost_AEI.l(i); + ov41_AEI(t,j,"level") = v41_AEI.l(j); + oq41_area_irrig(t,j,"level") = q41_area_irrig.l(j); + ov_cost_AEI(t,i,"upper") = vm_cost_AEI.up(i); + ov41_AEI(t,j,"upper") = v41_AEI.up(j); + oq41_area_irrig(t,j,"upper") = q41_area_irrig.up(j); + ov_cost_AEI(t,i,"lower") = vm_cost_AEI.lo(i); + ov41_AEI(t,j,"lower") = v41_AEI.lo(j); + oq41_area_irrig(t,j,"lower") = q41_area_irrig.lo(j); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### + diff --git a/modules/41_area_equipped_for_irrigation/static/presolve.gms b/modules/41_area_equipped_for_irrigation/static/presolve.gms index 80f5465473..8be74d7184 100644 --- a/modules/41_area_equipped_for_irrigation/static/presolve.gms +++ b/modules/41_area_equipped_for_irrigation/static/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 v41_AEI.fx(j) = f41_irrig(j); diff --git a/modules/41_area_equipped_for_irrigation/static.gms b/modules/41_area_equipped_for_irrigation/static/realization.gms similarity index 73% rename from modules/41_area_equipped_for_irrigation/static.gms rename to modules/41_area_equipped_for_irrigation/static/realization.gms index 869e3be2b8..357b35119e 100644 --- a/modules/41_area_equipped_for_irrigation/static.gms +++ b/modules/41_area_equipped_for_irrigation/static/realization.gms @@ -1,20 +1,21 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -*' In this realization, area equipped for irrigation is fixed to input data (around the year 2000) -*' for all time steps. The source of the input data is @siebert_FAO_2007. -*' -*' @limitations No irrigation is possible on areas that have not been equipped for irrigation in the past. -*' - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "declarations" $include "./modules/41_area_equipped_for_irrigation/static/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/41_area_equipped_for_irrigation/static/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/41_area_equipped_for_irrigation/static/equations.gms" -$Ifi "%phase%" == "presolve" $include "./modules/41_area_equipped_for_irrigation/static/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/41_area_equipped_for_irrigation/static/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 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 + + +*' In this realization, area equipped for irrigation is fixed to input data (around the year 2000) +*' for all time steps. The source of the input data is @siebert_FAO_2007. +*' +*' @limitations No irrigation is possible on areas that have not been equipped for irrigation in the past. +*' + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "declarations" $include "./modules/41_area_equipped_for_irrigation/static/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/41_area_equipped_for_irrigation/static/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/41_area_equipped_for_irrigation/static/equations.gms" +$Ifi "%phase%" == "presolve" $include "./modules/41_area_equipped_for_irrigation/static/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/41_area_equipped_for_irrigation/static/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/42_water_demand/agr_sector_aug13/declarations.gms b/modules/42_water_demand/agr_sector_aug13/declarations.gms index 0d5e665a02..a9bf2cab21 100644 --- a/modules/42_water_demand/agr_sector_aug13/declarations.gms +++ b/modules/42_water_demand/agr_sector_aug13/declarations.gms @@ -1,31 +1,32 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -parameters - i42_wat_req_k(t,j,k) LPJmL annual water demand for irrigation per ha per year (m^3) + Livestock demand per ton (m^3) - ic42_wat_req_k(j,k) LPJmL annual water demand for irrigation per ha per year (m^3) + Livestock demand per ton (m^3) - i42_env_flows(t,j) Environmental flow requirements if a protection policy is in place (mio. m^3) - i42_env_flows_base(t,j) Environmental flow requirements if no protection policy is in place (mio. m^3) - ic42_env_flow_policy(i) Determines whether environmental flow protection is enforced in the current time step (1) - i42_env_flow_policy(t,i) Determines whether environmental flow protection is enforced (1) -; - -equations - q42_water_demand(wat_dem,j) Water consumption in different sectors (mio. m^3 per yr) -; - -positive variables - vm_watdem(wat_dem,j) Water demand from different sectors (mio. m^3 per yr) - v42_irrig_eff(j) Irrigation efficiency (1) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_watdem(t,wat_dem,j,type) Water demand from different sectors (mio. m^3 per yr) - ov42_irrig_eff(t,j,type) Irrigation efficiency (1) - oq42_water_demand(t,wat_dem,j,type) Water consumption in different sectors (mio. m^3 per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +parameters + i42_wat_req_k(t,j,k) LPJmL annual water demand for irrigation per ha per year (m^3) + Livestock demand per ton (m^3) + ic42_wat_req_k(j,k) LPJmL annual water demand for irrigation per ha per year (m^3) + Livestock demand per ton (m^3) + i42_env_flows(t,j) Environmental flow requirements if a protection policy is in place (mio. m^3) + i42_env_flows_base(t,j) Environmental flow requirements if no protection policy is in place (mio. m^3) + ic42_env_flow_policy(i) Determines whether environmental flow protection is enforced in the current time step (1) + i42_env_flow_policy(t,i) Determines whether environmental flow protection is enforced (1) +; + +equations + q42_water_demand(wat_dem,j) Water consumption in different sectors (mio. m^3 per yr) +; + +positive variables + vm_watdem(wat_dem,j) Water demand from different sectors (mio. m^3 per yr) + v42_irrig_eff(j) Irrigation efficiency (1) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_watdem(t,wat_dem,j,type) Water demand from different sectors (mio. m^3 per yr) + ov42_irrig_eff(t,j,type) Irrigation efficiency (1) + oq42_water_demand(t,wat_dem,j,type) Water consumption in different sectors (mio. m^3 per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/42_water_demand/agr_sector_aug13/equations.gms b/modules/42_water_demand/agr_sector_aug13/equations.gms index 228c1255e4..77dacea753 100644 --- a/modules/42_water_demand/agr_sector_aug13/equations.gms +++ b/modules/42_water_demand/agr_sector_aug13/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations @@ -15,4 +16,4 @@ q42_water_demand("agriculture",j2).. *' `vm_watdem` is composed by irrigation and livestock demand uses. *' The factor `v42_irrig_eff` corresponds to the amount of water that is used *' inefficiently in the irrigation process. - \ No newline at end of file + diff --git a/modules/42_water_demand/agr_sector_aug13/input.gms b/modules/42_water_demand/agr_sector_aug13/input.gms index 5390e9ce1b..fd6d51864d 100644 --- a/modules/42_water_demand/agr_sector_aug13/input.gms +++ b/modules/42_water_demand/agr_sector_aug13/input.gms @@ -1,73 +1,74 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -scalars - -s42_reserved_fraction Fraction of available water that is reserved for industry electricity and domestic use (1) / 0.5 / - -s42_irrig_eff_scenario Scenario for irrigation efficiency (1) / 1 / -* 1: global static value -* 2: regional static values from CS -* 3: gdp driven increase - -s42_irrigation_efficiency Value of irrigation efficiency (1) / 0.66 / -* Only if global static value is requested - -s42_env_flow_scenario EFP scenario. (1) / 2 / -* 0: don't consider environmental flows. -* s42_env_flow_base_fraction and -* s42_env_flow_fraction have no effect. -* 1: Reserve a certain fraction of available water -* specified by s42_env_flow_fraction for -* environmental flows. -* 2: Each grid cell receives its own value for -* environmental flow protection based on LPJ -* results and a calculation algorithm by Smakhtin 2004. -* s42_env_flow_fraction has no effect. - -s42_env_flow_base_fraction Fraction of available water that is reserved for the environment where no EFP policy is implemented (1) / 0.05 / -* (determined in the file EFR_protection_policy.csv) -s42_env_flow_fraction Fraction of available water that is reserved for under protection policies (1) / 0.2 / -; - -$setglobal c42_watdem_scenario nocc -* options: cc (climate change) -* nocc (no climate change) - - -table f42_wat_req_kve(t_all,j,kve) LPJmL annual water demand for irrigation per ha (m^3 per yr) -$ondelim -$include "./modules/42_water_demand/input/lpj_airrig.cs2" -$offdelim -; -$if "%c42_watdem_scenario%" == "nocc" f42_wat_req_kve(t_all,j,kve) = f42_wat_req_kve("y1995",j,kve); -m_fillmissingyears(f42_wat_req_kve,"j,kve"); - - -parameter f42_wat_req_kli(kli) Average water requirements of livestock commodities per region per tDM per year (m^3) -/ -$ondelim -$include "./modules/42_water_demand/input/f42_wat_req_fao.csv" -$offdelim -/; - - -parameter f42_env_flows(t_all,j) Environmental flow requirements from LPJ and Smakhtin algorithm (mio. m^3) -/ -$ondelim -$include "./modules/42_water_demand/input/lpj_envflow_grper.cs2" -$offdelim -/; -$if "%c42_watdem_scenario%" == "nocc" f42_env_flows(t_all,j) = f42_env_flows("y1995",j); -m_fillmissingyears(f42_env_flows,"j"); - -$setglobal c42_env_flow_policy off - -table f42_env_flow_policy(t_all,scen42) EFP policies (1) -$ondelim -$include "./modules/42_water_demand/input/f42_env_flow_policy.cs3" -$offdelim -; +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +scalars + +s42_reserved_fraction Fraction of available water that is reserved for industry electricity and domestic use (1) / 0.5 / + +s42_irrig_eff_scenario Scenario for irrigation efficiency (1) / 1 / +* 1: global static value +* 2: regional static values from CS +* 3: gdp driven increase + +s42_irrigation_efficiency Value of irrigation efficiency (1) / 0.66 / +* Only if global static value is requested + +s42_env_flow_scenario EFP scenario. (1) / 2 / +* 0: don't consider environmental flows. +* s42_env_flow_base_fraction and +* s42_env_flow_fraction have no effect. +* 1: Reserve a certain fraction of available water +* specified by s42_env_flow_fraction for +* environmental flows. +* 2: Each grid cell receives its own value for +* environmental flow protection based on LPJ +* results and a calculation algorithm by Smakhtin 2004. +* s42_env_flow_fraction has no effect. + +s42_env_flow_base_fraction Fraction of available water that is reserved for the environment where no EFP policy is implemented (1) / 0.05 / +* (determined in the file EFR_protection_policy.csv) +s42_env_flow_fraction Fraction of available water that is reserved for under protection policies (1) / 0.2 / +; + +$setglobal c42_watdem_scenario nocc +* options: cc (climate change) +* nocc (no climate change) + + +table f42_wat_req_kve(t_all,j,kve) LPJmL annual water demand for irrigation per ha (m^3 per yr) +$ondelim +$include "./modules/42_water_demand/input/lpj_airrig.cs2" +$offdelim +; +$if "%c42_watdem_scenario%" == "nocc" f42_wat_req_kve(t_all,j,kve) = f42_wat_req_kve("y1995",j,kve); +m_fillmissingyears(f42_wat_req_kve,"j,kve"); + + +parameter f42_wat_req_kli(kli) Average water requirements of livestock commodities per region per tDM per year (m^3) +/ +$ondelim +$include "./modules/42_water_demand/input/f42_wat_req_fao.csv" +$offdelim +/; + + +parameter f42_env_flows(t_all,j) Environmental flow requirements from LPJ and Smakhtin algorithm (mio. m^3) +/ +$ondelim +$include "./modules/42_water_demand/input/lpj_envflow_grper.cs2" +$offdelim +/; +$if "%c42_watdem_scenario%" == "nocc" f42_env_flows(t_all,j) = f42_env_flows("y1995",j); +m_fillmissingyears(f42_env_flows,"j"); + +$setglobal c42_env_flow_policy off + +table f42_env_flow_policy(t_all,scen42) EFP policies (1) +$ondelim +$include "./modules/42_water_demand/input/f42_env_flow_policy.cs3" +$offdelim +; diff --git a/modules/42_water_demand/agr_sector_aug13/postsolve.gms b/modules/42_water_demand/agr_sector_aug13/postsolve.gms index 30192de8f2..020e1402c7 100644 --- a/modules/42_water_demand/agr_sector_aug13/postsolve.gms +++ b/modules/42_water_demand/agr_sector_aug13/postsolve.gms @@ -1,20 +1,21 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_watdem(t,wat_dem,j,"marginal") = vm_watdem.m(wat_dem,j); - ov42_irrig_eff(t,j,"marginal") = v42_irrig_eff.m(j); - oq42_water_demand(t,wat_dem,j,"marginal") = q42_water_demand.m(wat_dem,j); - ov_watdem(t,wat_dem,j,"level") = vm_watdem.l(wat_dem,j); - ov42_irrig_eff(t,j,"level") = v42_irrig_eff.l(j); - oq42_water_demand(t,wat_dem,j,"level") = q42_water_demand.l(wat_dem,j); - ov_watdem(t,wat_dem,j,"upper") = vm_watdem.up(wat_dem,j); - ov42_irrig_eff(t,j,"upper") = v42_irrig_eff.up(j); - oq42_water_demand(t,wat_dem,j,"upper") = q42_water_demand.up(wat_dem,j); - ov_watdem(t,wat_dem,j,"lower") = vm_watdem.lo(wat_dem,j); - ov42_irrig_eff(t,j,"lower") = v42_irrig_eff.lo(j); - oq42_water_demand(t,wat_dem,j,"lower") = q42_water_demand.lo(wat_dem,j); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_watdem(t,wat_dem,j,"marginal") = vm_watdem.m(wat_dem,j); + ov42_irrig_eff(t,j,"marginal") = v42_irrig_eff.m(j); + oq42_water_demand(t,wat_dem,j,"marginal") = q42_water_demand.m(wat_dem,j); + ov_watdem(t,wat_dem,j,"level") = vm_watdem.l(wat_dem,j); + ov42_irrig_eff(t,j,"level") = v42_irrig_eff.l(j); + oq42_water_demand(t,wat_dem,j,"level") = q42_water_demand.l(wat_dem,j); + ov_watdem(t,wat_dem,j,"upper") = vm_watdem.up(wat_dem,j); + ov42_irrig_eff(t,j,"upper") = v42_irrig_eff.up(j); + oq42_water_demand(t,wat_dem,j,"upper") = q42_water_demand.up(wat_dem,j); + ov_watdem(t,wat_dem,j,"lower") = vm_watdem.lo(wat_dem,j); + ov42_irrig_eff(t,j,"lower") = v42_irrig_eff.lo(j); + oq42_water_demand(t,wat_dem,j,"lower") = q42_water_demand.lo(wat_dem,j); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/42_water_demand/agr_sector_aug13/preloop.gms b/modules/42_water_demand/agr_sector_aug13/preloop.gms index ccee7b359e..84709e7c32 100644 --- a/modules/42_water_demand/agr_sector_aug13/preloop.gms +++ b/modules/42_water_demand/agr_sector_aug13/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 i42_wat_req_k(t,j,kve) = f42_wat_req_kve(t,j,kve); diff --git a/modules/42_water_demand/agr_sector_aug13/presolve.gms b/modules/42_water_demand/agr_sector_aug13/presolve.gms index 5ce42284b4..26a57d58a6 100644 --- a/modules/42_water_demand/agr_sector_aug13/presolve.gms +++ b/modules/42_water_demand/agr_sector_aug13/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 if (sum(sameas(t_past,t),1) = 1, diff --git a/modules/42_water_demand/agr_sector_aug13.gms b/modules/42_water_demand/agr_sector_aug13/realization.gms similarity index 92% rename from modules/42_water_demand/agr_sector_aug13.gms rename to modules/42_water_demand/agr_sector_aug13/realization.gms index ad11391912..a7b1f6bafc 100644 --- a/modules/42_water_demand/agr_sector_aug13.gms +++ b/modules/42_water_demand/agr_sector_aug13/realization.gms @@ -1,88 +1,89 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description -*' -*' This realization models agricultural sector water demand endogenously, while other sectors are kept exogenous; -*' Various settings for environmental water demand described below. -*' -*' *Agricultural water demand*: -*' -*' Water demand for agriculture is endogenously calculated based -*' on irrigated cropland `vm_area(j,kcr,"irrigated")` and livestock production -*' `vm_prod(j2,kli)`. -*' -*' Irrigation water demand per area for each crop category and cluster -*' is provided by the LPJmL model. This parameter refers to the water that -*' has to be applied to the field, i.e. it includes losses due to evaporation on -*' the field, but does not include losses during the water transport from source -*' to field. Livestock water demand `ic42_wat_req_k(j,kli)` is derived from FAO -*' data. -*' -*' -*' *Irrigation efficiency*: -*' -*' Switches for different scenarios for irrigation efficiency can be chosen: -*' -*' * A global static value of irrigation efficiency that is defined as the -*' global weighted average of water losses from source to field ("conveyance -*' efficiency times management factor") from @PIK_report104_2007. -*' Here, irrigated area from @siebert_FAO_2007 has been used as aggregation -*' weight. -*' -*' * A regression of country values of the "conveyance efficiency times -*' management factor" from @PIK_report104_2007 on GDP. -*' -*' ![Irrigation efficiency evolution with GDP for the SSP2 scenario. -*' ](irrigation_efficiency.png){ width=80% } -*' -*' *Non agricultural human water demand*: -*' -*' Water demand from all other sectors is treated exogenously. The scalar -*' `s42_reserved_fraction` determines how much water is reserved for non -*' agricultural purposes. Technically, it is assigned to industrial use, while -*' demand for other non-agricultural sectors is set to 0. The default value is -*' 0.5. -*' -*' *Environmental water demand* -*' -*' Environmental water requirements can be specified separately using the switch -*' `s42_env_flow_scenario`. The following settings are available: -*' -*' * No additional environmental flows are considered. -*' * A certain fraction of available water `s42_env_flow_fraction` is reserved -*' for environmental purposes and consequently not available for agricultural -*' activities (in addition to `s42_reserved_fraction`). -*' * Environmental flow requirements (EFR) are calculated from LPJmL inputs -*' according to an algorithm by @smakhtin_water_2004 on cluster level. Due to -*' the fact that MAgPIE only considers available blue water during the growing -*' period of the plants ([43_water_availability]), EFR are also only -*' calculated during this growing period. They are reserved in addition to -*' `s42_protected_fraction`. In the case of the absence of an environmental -*' flow protection (EFP) policy, a base protection can be specified: -*' `s42_env_flow_base_fraction`. Its default value is 5 % of available water. -*' -*' Whether a potential EFP policy takes effect is determined by the parameter -*' `f42_env_flow_policy`. -*' -*' @limitations The module uses the "conveyance efficiency times management -*' factor" for irrigation efficiency. Therefore, the management factor is -*' accounted twice, since it is already considered in LPJmL water quantity used -*' for irrigation (`airrig`: annual irrigation). Furthermore, the module -*' realization does not consider annual water balances but only water balances -*' during the growing period of crops. This period differs between cells. -*' - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/42_water_demand/agr_sector_aug13/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/42_water_demand/agr_sector_aug13/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/42_water_demand/agr_sector_aug13/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/42_water_demand/agr_sector_aug13/equations.gms" -$Ifi "%phase%" == "scaling" $include "./modules/42_water_demand/agr_sector_aug13/scaling.gms" -$Ifi "%phase%" == "preloop" $include "./modules/42_water_demand/agr_sector_aug13/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/42_water_demand/agr_sector_aug13/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/42_water_demand/agr_sector_aug13/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description +*' +*' This realization models agricultural sector water demand endogenously, while other sectors are kept exogenous; +*' Various settings for environmental water demand described below. +*' +*' *Agricultural water demand*: +*' +*' Water demand for agriculture is endogenously calculated based +*' on irrigated cropland `vm_area(j,kcr,"irrigated")` and livestock production +*' `vm_prod(j2,kli)`. +*' +*' Irrigation water demand per area for each crop category and cluster +*' is provided by the LPJmL model. This parameter refers to the water that +*' has to be applied to the field, i.e. it includes losses due to evaporation on +*' the field, but does not include losses during the water transport from source +*' to field. Livestock water demand `ic42_wat_req_k(j,kli)` is derived from FAO +*' data. +*' +*' +*' *Irrigation efficiency*: +*' +*' Switches for different scenarios for irrigation efficiency can be chosen: +*' +*' * A global static value of irrigation efficiency that is defined as the +*' global weighted average of water losses from source to field ("conveyance +*' efficiency times management factor") from @PIK_report104_2007. +*' Here, irrigated area from @siebert_FAO_2007 has been used as aggregation +*' weight. +*' +*' * A regression of country values of the "conveyance efficiency times +*' management factor" from @PIK_report104_2007 on GDP. +*' +*' ![Irrigation efficiency evolution with GDP for the SSP2 scenario. +*' ](irrigation_efficiency.png){ width=80% } +*' +*' *Non agricultural human water demand*: +*' +*' Water demand from all other sectors is treated exogenously. The scalar +*' `s42_reserved_fraction` determines how much water is reserved for non +*' agricultural purposes. Technically, it is assigned to industrial use, while +*' demand for other non-agricultural sectors is set to 0. The default value is +*' 0.5. +*' +*' *Environmental water demand* +*' +*' Environmental water requirements can be specified separately using the switch +*' `s42_env_flow_scenario`. The following settings are available: +*' +*' * No additional environmental flows are considered. +*' * A certain fraction of available water `s42_env_flow_fraction` is reserved +*' for environmental purposes and consequently not available for agricultural +*' activities (in addition to `s42_reserved_fraction`). +*' * Environmental flow requirements (EFR) are calculated from LPJmL inputs +*' according to an algorithm by @smakhtin_water_2004 on cluster level. Due to +*' the fact that MAgPIE only considers available blue water during the growing +*' period of the plants ([43_water_availability]), EFR are also only +*' calculated during this growing period. They are reserved in addition to +*' `s42_protected_fraction`. In the case of the absence of an environmental +*' flow protection (EFP) policy, a base protection can be specified: +*' `s42_env_flow_base_fraction`. Its default value is 5 % of available water. +*' +*' Whether a potential EFP policy takes effect is determined by the parameter +*' `f42_env_flow_policy`. +*' +*' @limitations The module uses the "conveyance efficiency times management +*' factor" for irrigation efficiency. Therefore, the management factor is +*' accounted twice, since it is already considered in LPJmL water quantity used +*' for irrigation (`airrig`: annual irrigation). Furthermore, the module +*' realization does not consider annual water balances but only water balances +*' during the growing period of crops. This period differs between cells. +*' + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/42_water_demand/agr_sector_aug13/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/42_water_demand/agr_sector_aug13/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/42_water_demand/agr_sector_aug13/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/42_water_demand/agr_sector_aug13/equations.gms" +$Ifi "%phase%" == "scaling" $include "./modules/42_water_demand/agr_sector_aug13/scaling.gms" +$Ifi "%phase%" == "preloop" $include "./modules/42_water_demand/agr_sector_aug13/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/42_water_demand/agr_sector_aug13/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/42_water_demand/agr_sector_aug13/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/42_water_demand/agr_sector_aug13/scaling.gms b/modules/42_water_demand/agr_sector_aug13/scaling.gms index 68696845ac..265c36dc60 100644 --- a/modules/42_water_demand/agr_sector_aug13/scaling.gms +++ b/modules/42_water_demand/agr_sector_aug13/scaling.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de vm_watdem.scale(wat_dem,j) = 10e4; diff --git a/modules/42_water_demand/agr_sector_aug13/sets.gms b/modules/42_water_demand/agr_sector_aug13/sets.gms index be4a2e50b3..c0f52c07e8 100644 --- a/modules/42_water_demand/agr_sector_aug13/sets.gms +++ b/modules/42_water_demand/agr_sector_aug13/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets diff --git a/modules/42_water_demand/all_sectors_aug13/declarations.gms b/modules/42_water_demand/all_sectors_aug13/declarations.gms index 553dc04f0e..4d251c43e6 100644 --- a/modules/42_water_demand/all_sectors_aug13/declarations.gms +++ b/modules/42_water_demand/all_sectors_aug13/declarations.gms @@ -1,31 +1,32 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -parameters - i42_wat_req_k(t,j,k) LPJmL annual water demand for irrigation per ha per yr and livestock demand per ton per yr (m^3) - ic42_wat_req_k(j,k) LPJmL annual water demand for irrigation per ha per yr and livestock demand per ton per yr (m^3) - i42_env_flows(t,j) Environmental flow requirements in case of policy (mio m^3) - i42_env_flows_base(t,j) Environmental flow requirements in case of no policy (mio m^3) - ic42_env_flow_policy(i) Determines whether environmental flow protection is enforced in the current time step (1) - i42_env_flow_policy(t,i) Determines whether environmental flow protection is enforced (1) -; - -equations - q42_water_demand(wat_dem,j) Water consumption in different sectors (mio. m^3 per yr) -; - -positive variables - vm_watdem(wat_dem,j) Amount of water needed in different sectors (mio. m^3 per yr) - v42_irrig_eff(j) Irrigation efficiency (1) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_watdem(t,wat_dem,j,type) Amount of water needed in different sectors (mio. m^3 per yr) - ov42_irrig_eff(t,j,type) Irrigation efficiency (1) - oq42_water_demand(t,wat_dem,j,type) Water consumption in different sectors (mio. m^3 per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +parameters + i42_wat_req_k(t,j,k) LPJmL annual water demand for irrigation per ha per yr and livestock demand per ton per yr (m^3) + ic42_wat_req_k(j,k) LPJmL annual water demand for irrigation per ha per yr and livestock demand per ton per yr (m^3) + i42_env_flows(t,j) Environmental flow requirements in case of policy (mio m^3) + i42_env_flows_base(t,j) Environmental flow requirements in case of no policy (mio m^3) + ic42_env_flow_policy(i) Determines whether environmental flow protection is enforced in the current time step (1) + i42_env_flow_policy(t,i) Determines whether environmental flow protection is enforced (1) +; + +equations + q42_water_demand(wat_dem,j) Water consumption in different sectors (mio. m^3 per yr) +; + +positive variables + vm_watdem(wat_dem,j) Amount of water needed in different sectors (mio. m^3 per yr) + v42_irrig_eff(j) Irrigation efficiency (1) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_watdem(t,wat_dem,j,type) Amount of water needed in different sectors (mio. m^3 per yr) + ov42_irrig_eff(t,j,type) Irrigation efficiency (1) + oq42_water_demand(t,wat_dem,j,type) Water consumption in different sectors (mio. m^3 per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/42_water_demand/all_sectors_aug13/equations.gms b/modules/42_water_demand/all_sectors_aug13/equations.gms index ce44187e96..a318ea83a0 100644 --- a/modules/42_water_demand/all_sectors_aug13/equations.gms +++ b/modules/42_water_demand/all_sectors_aug13/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations @@ -15,4 +16,4 @@ q42_water_demand("agriculture",j2).. *' `vm_watdem` is composed by irrigation and livestock demand uses. *' The factor `v42_irrig_eff` corresponds to the amount of water that is used -*' inefficiently in the irrigation process. \ No newline at end of file +*' inefficiently in the irrigation process. diff --git a/modules/42_water_demand/all_sectors_aug13/input.gms b/modules/42_water_demand/all_sectors_aug13/input.gms index 99d498840d..7b31fe7fa9 100644 --- a/modules/42_water_demand/all_sectors_aug13/input.gms +++ b/modules/42_water_demand/all_sectors_aug13/input.gms @@ -1,83 +1,84 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -scalars - -s42_watdem_nonagr_scenario Scenario for non agricultural water demand from WATERGAP (1) / 1 / -* 1: SSP 2 -* 2: A2 -* 3: B1 - -s42_irrig_eff_scenario Scenario for irrigation efficiency (1) / 1 / -* 1: global static value -* 2: regional static values from CS -* 3: gdp driven increase - -s42_irrigation_efficiency Value of irrigation efficiency. (1) / 0.66 / -* Only if global static value is requested - -s42_env_flow_scenario Environmental flow protection scenario. (1) / 2 / -* 0: don't consider environmental flows. -* s42_env_flow_base_fraction and -* s42_env_flow_fraction have no effect. -* 1: Reserve a certain fraction of available water -* specified by s42_env_flow_fraction for -* environmental flows. -* 2: Each grid cell receives its own value for -* environmental flow protection based on LPJ -* results and a calculation algorithm by Smakhtin 2004. -* s42_env_flow_fraction has no effect. - -s42_env_flow_base_fraction Fraction of available water that is reserved for the environment if no EFR protection policy is implemented (1) / 0.05 / -* (determined in the file -* EFR_protection_policy.csv) -s42_env_flow_fraction Fraction of available water that is reserved for under protection policies (1) / 0.2 / -; - -$setglobal c42_watdem_scenario nocc -* options: cc (climate change) -* nocc (no climate change) - -table f42_wat_req_kve(t_all,j,kve) LPJ annual water demand for irrigation per ha (m^3 per yr) -$ondelim -$include "./modules/42_water_demand/input/lpj_airrig.cs2" -$offdelim -; -$if "%c42_watdem_scenario%" == "nocc" f42_wat_req_kve(t_all,j,kve) = f42_wat_req_kve("y1995",j,kve); -m_fillmissingyears(f42_wat_req_kve,"j,kve"); - -parameter f42_wat_req_kli(kli) Average water requirements of livestock commodities per region per tDM per year (m^3 per yr) -/ -$ondelim -$include "./modules/42_water_demand/input/f42_wat_req_fao.csv" -$offdelim -/; - -table f42_watdem_ineldo(t_all,j,scen_watdem_nonagr,watdem_ineldo) Industry electricity and domestic water demand under our socioeconomic scenarios (mio. m^3) -$ondelim -$include "./modules/42_water_demand/input/watdem_nonagr_grper.cs3" -$offdelim -; -m_fillmissingyears(f42_watdem_ineldo,"j,scen_watdem_nonagr,watdem_ineldo"); - -parameter -f42_env_flows(t_all,j) Environmental flow requirements from LPJ and Smakhtin algorithm (mio. m^3) -/ -$ondelim -$include "./modules/42_water_demand/input/lpj_envflow_grper.cs2" -$offdelim -/ -; -$if "%c42_watdem_scenario%" == "nocc" f42_env_flows(t_all,j) = f42_env_flows("y1995",j); -m_fillmissingyears(f42_env_flows,"j"); - -$setglobal c42_env_flow_policy off - -table f42_env_flow_policy(t_all,scen42) EFP policies (1) -$ondelim -$include "./modules/42_water_demand/input/f42_env_flow_policy.cs3" -$offdelim -; +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +scalars + +s42_watdem_nonagr_scenario Scenario for non agricultural water demand from WATERGAP (1) / 1 / +* 1: SSP 2 +* 2: A2 +* 3: B1 + +s42_irrig_eff_scenario Scenario for irrigation efficiency (1) / 1 / +* 1: global static value +* 2: regional static values from CS +* 3: gdp driven increase + +s42_irrigation_efficiency Value of irrigation efficiency. (1) / 0.66 / +* Only if global static value is requested + +s42_env_flow_scenario Environmental flow protection scenario. (1) / 2 / +* 0: don't consider environmental flows. +* s42_env_flow_base_fraction and +* s42_env_flow_fraction have no effect. +* 1: Reserve a certain fraction of available water +* specified by s42_env_flow_fraction for +* environmental flows. +* 2: Each grid cell receives its own value for +* environmental flow protection based on LPJ +* results and a calculation algorithm by Smakhtin 2004. +* s42_env_flow_fraction has no effect. + +s42_env_flow_base_fraction Fraction of available water that is reserved for the environment if no EFR protection policy is implemented (1) / 0.05 / +* (determined in the file +* EFR_protection_policy.csv) +s42_env_flow_fraction Fraction of available water that is reserved for under protection policies (1) / 0.2 / +; + +$setglobal c42_watdem_scenario nocc +* options: cc (climate change) +* nocc (no climate change) + +table f42_wat_req_kve(t_all,j,kve) LPJ annual water demand for irrigation per ha (m^3 per yr) +$ondelim +$include "./modules/42_water_demand/input/lpj_airrig.cs2" +$offdelim +; +$if "%c42_watdem_scenario%" == "nocc" f42_wat_req_kve(t_all,j,kve) = f42_wat_req_kve("y1995",j,kve); +m_fillmissingyears(f42_wat_req_kve,"j,kve"); + +parameter f42_wat_req_kli(kli) Average water requirements of livestock commodities per region per tDM per year (m^3 per yr) +/ +$ondelim +$include "./modules/42_water_demand/input/f42_wat_req_fao.csv" +$offdelim +/; + +table f42_watdem_ineldo(t_all,j,scen_watdem_nonagr,watdem_ineldo) Industry electricity and domestic water demand under our socioeconomic scenarios (mio. m^3) +$ondelim +$include "./modules/42_water_demand/input/watdem_nonagr_grper.cs3" +$offdelim +; +m_fillmissingyears(f42_watdem_ineldo,"j,scen_watdem_nonagr,watdem_ineldo"); + +parameter +f42_env_flows(t_all,j) Environmental flow requirements from LPJ and Smakhtin algorithm (mio. m^3) +/ +$ondelim +$include "./modules/42_water_demand/input/lpj_envflow_grper.cs2" +$offdelim +/ +; +$if "%c42_watdem_scenario%" == "nocc" f42_env_flows(t_all,j) = f42_env_flows("y1995",j); +m_fillmissingyears(f42_env_flows,"j"); + +$setglobal c42_env_flow_policy off + +table f42_env_flow_policy(t_all,scen42) EFP policies (1) +$ondelim +$include "./modules/42_water_demand/input/f42_env_flow_policy.cs3" +$offdelim +; diff --git a/modules/42_water_demand/all_sectors_aug13/postsolve.gms b/modules/42_water_demand/all_sectors_aug13/postsolve.gms index 30192de8f2..020e1402c7 100644 --- a/modules/42_water_demand/all_sectors_aug13/postsolve.gms +++ b/modules/42_water_demand/all_sectors_aug13/postsolve.gms @@ -1,20 +1,21 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_watdem(t,wat_dem,j,"marginal") = vm_watdem.m(wat_dem,j); - ov42_irrig_eff(t,j,"marginal") = v42_irrig_eff.m(j); - oq42_water_demand(t,wat_dem,j,"marginal") = q42_water_demand.m(wat_dem,j); - ov_watdem(t,wat_dem,j,"level") = vm_watdem.l(wat_dem,j); - ov42_irrig_eff(t,j,"level") = v42_irrig_eff.l(j); - oq42_water_demand(t,wat_dem,j,"level") = q42_water_demand.l(wat_dem,j); - ov_watdem(t,wat_dem,j,"upper") = vm_watdem.up(wat_dem,j); - ov42_irrig_eff(t,j,"upper") = v42_irrig_eff.up(j); - oq42_water_demand(t,wat_dem,j,"upper") = q42_water_demand.up(wat_dem,j); - ov_watdem(t,wat_dem,j,"lower") = vm_watdem.lo(wat_dem,j); - ov42_irrig_eff(t,j,"lower") = v42_irrig_eff.lo(j); - oq42_water_demand(t,wat_dem,j,"lower") = q42_water_demand.lo(wat_dem,j); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_watdem(t,wat_dem,j,"marginal") = vm_watdem.m(wat_dem,j); + ov42_irrig_eff(t,j,"marginal") = v42_irrig_eff.m(j); + oq42_water_demand(t,wat_dem,j,"marginal") = q42_water_demand.m(wat_dem,j); + ov_watdem(t,wat_dem,j,"level") = vm_watdem.l(wat_dem,j); + ov42_irrig_eff(t,j,"level") = v42_irrig_eff.l(j); + oq42_water_demand(t,wat_dem,j,"level") = q42_water_demand.l(wat_dem,j); + ov_watdem(t,wat_dem,j,"upper") = vm_watdem.up(wat_dem,j); + ov42_irrig_eff(t,j,"upper") = v42_irrig_eff.up(j); + oq42_water_demand(t,wat_dem,j,"upper") = q42_water_demand.up(wat_dem,j); + ov_watdem(t,wat_dem,j,"lower") = vm_watdem.lo(wat_dem,j); + ov42_irrig_eff(t,j,"lower") = v42_irrig_eff.lo(j); + oq42_water_demand(t,wat_dem,j,"lower") = q42_water_demand.lo(wat_dem,j); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/42_water_demand/all_sectors_aug13/preloop.gms b/modules/42_water_demand/all_sectors_aug13/preloop.gms index ccee7b359e..84709e7c32 100644 --- a/modules/42_water_demand/all_sectors_aug13/preloop.gms +++ b/modules/42_water_demand/all_sectors_aug13/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 i42_wat_req_k(t,j,kve) = f42_wat_req_kve(t,j,kve); diff --git a/modules/42_water_demand/all_sectors_aug13/presolve.gms b/modules/42_water_demand/all_sectors_aug13/presolve.gms index f80430efc6..3d7c8d4195 100644 --- a/modules/42_water_demand/all_sectors_aug13/presolve.gms +++ b/modules/42_water_demand/all_sectors_aug13/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 if (sum(sameas(t_past,t),1) = 1, diff --git a/modules/42_water_demand/all_sectors_aug13.gms b/modules/42_water_demand/all_sectors_aug13/realization.gms similarity index 91% rename from modules/42_water_demand/all_sectors_aug13.gms rename to modules/42_water_demand/all_sectors_aug13/realization.gms index a8dffbefb1..878583155a 100644 --- a/modules/42_water_demand/all_sectors_aug13.gms +++ b/modules/42_water_demand/all_sectors_aug13/realization.gms @@ -1,69 +1,70 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description -*' -*' This realization models agricultural sector water demand endogenously, as described in the first realization, -*' Industry, electricity and domestic demand are also modelled endogenously with various scenarios; -*' Various settings (same ias in previous realization) for environmental water demand described below. -*' -*' *Agricultural water demand*: -*' -*' Water demand for agriculture is endogenously calculated based on irrigated -*' cropland `vm_area(j,kcr,"irrigated")` and livestock production -*' `vm_prod(j,kli)`. -*' -*' *Non agricultural human water demand*: -*' -*' For industry, electricity and domestic demand, three scenarios are available -*' on cluster level from the model by @watergap_water_2003: -*' -*' * SRES A2 (WATCH Project) -*' * SRES B1 (WATCH Project) -*' * SSP2 (ISI-MIP Project) -*' -*' Due to the fact that MAgPIE only considers available blue water during the -*' growing period of the plants ([43_water_availability]), the fraction of this -*' demand in the growing period is determined in the preprocessing assuming -*' constant demand over the whole year. The matching of the WATERGAP scenarios -*' to the MAgPIE scenarios can be found in the file `scenario_config.csv` in the -*' config folder of model. -*' -*' *Environmental water demand*: -*' -*' Environmental water requirements can be specified separately using the switch -*' `s42_env_flow_scenario`. The following settings are available: -*' -*' * No additional environmental flows are considered. -*' * A certain fraction of available water `s42_env_flow_fraction` is reserved -*' for environmental purposes and consequently not available for agricultural -*' activities (in addition to `s42_reserved_fraction`). -*' * Environmental flow requirements (EFR) are calculated from LPJmL inputs -*' according to an algorithm by @smakhtin_water_2004 on cluster level. Due to -*' the fact that MAgPIE only considers available blue water during the growing -*' period of the plants [43_water_availability], EFR are also only calculated -*' during this growing period. These are reserved in addition to -*' `s42_protected_fraction`. In the case of the absence of an environmental -*' flow protection policy, a base protection can be specified: -*' `s42_env_flow_base_fraction`. It defaults to 5 % of available water. -*' -*' @limitations The module uses the "conveyance efficiency times management -*' factor" for irrigation efficiency. Therefore, the management factor is -*' accounted twice, since it is already considered in LPJmL water quantity used -*' for irrigation (`airrig`: annual irrigation). Furthermore, the module -*' realization does not consider annual water balances but only water balances -*' during the growing period of crops. This period differs between cells. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/42_water_demand/all_sectors_aug13/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/42_water_demand/all_sectors_aug13/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/42_water_demand/all_sectors_aug13/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/42_water_demand/all_sectors_aug13/equations.gms" -$Ifi "%phase%" == "scaling" $include "./modules/42_water_demand/all_sectors_aug13/scaling.gms" -$Ifi "%phase%" == "preloop" $include "./modules/42_water_demand/all_sectors_aug13/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/42_water_demand/all_sectors_aug13/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/42_water_demand/all_sectors_aug13/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description +*' +*' This realization models agricultural sector water demand endogenously, as described in the first realization, +*' Industry, electricity and domestic demand are also modelled endogenously with various scenarios; +*' Various settings (same ias in previous realization) for environmental water demand described below. +*' +*' *Agricultural water demand*: +*' +*' Water demand for agriculture is endogenously calculated based on irrigated +*' cropland `vm_area(j,kcr,"irrigated")` and livestock production +*' `vm_prod(j,kli)`. +*' +*' *Non agricultural human water demand*: +*' +*' For industry, electricity and domestic demand, three scenarios are available +*' on cluster level from the model by @watergap_water_2003: +*' +*' * SRES A2 (WATCH Project) +*' * SRES B1 (WATCH Project) +*' * SSP2 (ISI-MIP Project) +*' +*' Due to the fact that MAgPIE only considers available blue water during the +*' growing period of the plants ([43_water_availability]), the fraction of this +*' demand in the growing period is determined in the preprocessing assuming +*' constant demand over the whole year. The matching of the WATERGAP scenarios +*' to the MAgPIE scenarios can be found in the file `scenario_config.csv` in the +*' config folder of model. +*' +*' *Environmental water demand*: +*' +*' Environmental water requirements can be specified separately using the switch +*' `s42_env_flow_scenario`. The following settings are available: +*' +*' * No additional environmental flows are considered. +*' * A certain fraction of available water `s42_env_flow_fraction` is reserved +*' for environmental purposes and consequently not available for agricultural +*' activities (in addition to `s42_reserved_fraction`). +*' * Environmental flow requirements (EFR) are calculated from LPJmL inputs +*' according to an algorithm by @smakhtin_water_2004 on cluster level. Due to +*' the fact that MAgPIE only considers available blue water during the growing +*' period of the plants [43_water_availability], EFR are also only calculated +*' during this growing period. These are reserved in addition to +*' `s42_protected_fraction`. In the case of the absence of an environmental +*' flow protection policy, a base protection can be specified: +*' `s42_env_flow_base_fraction`. It defaults to 5 % of available water. +*' +*' @limitations The module uses the "conveyance efficiency times management +*' factor" for irrigation efficiency. Therefore, the management factor is +*' accounted twice, since it is already considered in LPJmL water quantity used +*' for irrigation (`airrig`: annual irrigation). Furthermore, the module +*' realization does not consider annual water balances but only water balances +*' during the growing period of crops. This period differs between cells. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/42_water_demand/all_sectors_aug13/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/42_water_demand/all_sectors_aug13/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/42_water_demand/all_sectors_aug13/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/42_water_demand/all_sectors_aug13/equations.gms" +$Ifi "%phase%" == "scaling" $include "./modules/42_water_demand/all_sectors_aug13/scaling.gms" +$Ifi "%phase%" == "preloop" $include "./modules/42_water_demand/all_sectors_aug13/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/42_water_demand/all_sectors_aug13/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/42_water_demand/all_sectors_aug13/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/42_water_demand/all_sectors_aug13/scaling.gms b/modules/42_water_demand/all_sectors_aug13/scaling.gms index 68696845ac..265c36dc60 100644 --- a/modules/42_water_demand/all_sectors_aug13/scaling.gms +++ b/modules/42_water_demand/all_sectors_aug13/scaling.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de vm_watdem.scale(wat_dem,j) = 10e4; diff --git a/modules/42_water_demand/all_sectors_aug13/sets.gms b/modules/42_water_demand/all_sectors_aug13/sets.gms index 549df98842..0681b20aa0 100644 --- a/modules/42_water_demand/all_sectors_aug13/sets.gms +++ b/modules/42_water_demand/all_sectors_aug13/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets diff --git a/modules/42_water_demand/42_water_demand.gms b/modules/42_water_demand/module.gms similarity index 65% rename from modules/42_water_demand/42_water_demand.gms rename to modules/42_water_demand/module.gms index ca10c5adb7..1f1516aebb 100644 --- a/modules/42_water_demand/42_water_demand.gms +++ b/modules/42_water_demand/module.gms @@ -1,23 +1,24 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Water demand -*' -*' @description The water demand module determines the water demand in the following -*' sectors: agriculture, industry, electricity, domestic and ecosystem. -*' Different scenarios for different water demand and environmental flow protection are -*' possible. The module receives information from the [17_production], [30_crop], [09_drivers] -*' and [43_water_availability] modules. It passes information to the module [43_water_availability] -*' and [11_costs]. -*' -*' -*' -*' @authors Anne Biewald, Markus Bonsch - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%water_demand%" == "agr_sector_aug13" $include "./modules/42_water_demand/agr_sector_aug13.gms" -$Ifi "%water_demand%" == "all_sectors_aug13" $include "./modules/42_water_demand/all_sectors_aug13.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Water demand +*' +*' @description The water demand module determines the water demand in the following +*' sectors: agriculture, industry, electricity, domestic and ecosystem. +*' Different scenarios for different water demand and environmental flow protection are +*' possible. The module receives information from the [17_production], [30_crop], [09_drivers] +*' and [43_water_availability] modules. It passes information to the module [43_water_availability] +*' and [11_costs]. +*' +*' +*' +*' @authors Anne Biewald, Markus Bonsch + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%water_demand%" == "agr_sector_aug13" $include "./modules/42_water_demand/agr_sector_aug13/realization.gms" +$Ifi "%water_demand%" == "all_sectors_aug13" $include "./modules/42_water_demand/all_sectors_aug13/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/43_water_availability/43_water_availability.gms b/modules/43_water_availability/module.gms similarity index 65% rename from modules/43_water_availability/43_water_availability.gms rename to modules/43_water_availability/module.gms index 018a85effa..c859f307ae 100644 --- a/modules/43_water_availability/43_water_availability.gms +++ b/modules/43_water_availability/module.gms @@ -1,20 +1,21 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Water availability -*' -*' @description The water availability module determines the water that is available -*' in MAgPIE. The following water sources are currently implemented: surface water, -*' groundwater, technical (like desalination etc.). Additionally, -*' this module includes the main water constraint that requires water withdrawals -*' to be smaller or equal to available water. Information is passed to and received -*' from the [42_water_demand] module. -*' -*' @authors Anne Biewald, Markus Bonsch - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%water_availability%" == "total_water_aug13" $include "./modules/43_water_availability/total_water_aug13.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Water availability +*' +*' @description The water availability module determines the water that is available +*' in MAgPIE. The following water sources are currently implemented: surface water, +*' groundwater, technical (like desalination etc.). Additionally, +*' this module includes the main water constraint that requires water withdrawals +*' to be smaller or equal to available water. Information is passed to and received +*' from the [42_water_demand] module. +*' +*' @authors Anne Biewald, Markus Bonsch + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%water_availability%" == "total_water_aug13" $include "./modules/43_water_availability/total_water_aug13/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/43_water_availability/total_water_aug13/declarations.gms b/modules/43_water_availability/total_water_aug13/declarations.gms index a5cd00c30e..86c6a0bcbf 100644 --- a/modules/43_water_availability/total_water_aug13/declarations.gms +++ b/modules/43_water_availability/total_water_aug13/declarations.gms @@ -1,25 +1,26 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -parameters - im_wat_avail(t,wat_src,j) Water availability (mio. m^3 per yr) -; - -variables - v43_watavail(wat_src,j) Water available from different sources (mio. m^3 per yr) -; - -equations - q43_water(j) Local seasonal water constraints (mio. m^3 per yr) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov43_watavail(t,wat_src,j,type) Water available from different sources (mio. m^3 per yr) - oq43_water(t,j,type) Local seasonal water constraints (mio. m^3 per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### - +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +parameters + im_wat_avail(t,wat_src,j) Water availability (mio. m^3 per yr) +; + +variables + v43_watavail(wat_src,j) Water available from different sources (mio. m^3 per yr) +; + +equations + q43_water(j) Local seasonal water constraints (mio. m^3 per yr) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov43_watavail(t,wat_src,j,type) Water available from different sources (mio. m^3 per yr) + oq43_water(t,j,type) Local seasonal water constraints (mio. m^3 per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### + diff --git a/modules/43_water_availability/total_water_aug13/equations.gms b/modules/43_water_availability/total_water_aug13/equations.gms index b205e4b767..1b8555ce88 100644 --- a/modules/43_water_availability/total_water_aug13/equations.gms +++ b/modules/43_water_availability/total_water_aug13/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations diff --git a/modules/43_water_availability/total_water_aug13/input.gms b/modules/43_water_availability/total_water_aug13/input.gms index 5eabb10233..1b5110e29e 100644 --- a/modules/43_water_availability/total_water_aug13/input.gms +++ b/modules/43_water_availability/total_water_aug13/input.gms @@ -1,20 +1,21 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -$setglobal c43_watavail_scenario nocc -* options: cc (climate change) -* nocc (no climate change) - -parameters -f43_wat_avail(t_all,j) Surface water available for irrigation per cell from LPJmL (mio. m^3 per yr) -/ -$ondelim -$include "./modules/43_water_availability/input/lpj_watavail_grper.cs2" -$offdelim -/ -; -$if "%c43_watavail_scenario%" == "nocc" f43_wat_avail(t_all,j) = f43_wat_avail("y1995",j); -m_fillmissingyears(f43_wat_avail,"j"); +*** | (C) 2008-2019 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 + +$setglobal c43_watavail_scenario nocc +* options: cc (climate change) +* nocc (no climate change) + +parameters +f43_wat_avail(t_all,j) Surface water available for irrigation per cell from LPJmL (mio. m^3 per yr) +/ +$ondelim +$include "./modules/43_water_availability/input/lpj_watavail_grper.cs2" +$offdelim +/ +; +$if "%c43_watavail_scenario%" == "nocc" f43_wat_avail(t_all,j) = f43_wat_avail("y1995",j); +m_fillmissingyears(f43_wat_avail,"j"); diff --git a/modules/43_water_availability/total_water_aug13/postsolve.gms b/modules/43_water_availability/total_water_aug13/postsolve.gms index cc0ca37a04..f53ce1562d 100644 --- a/modules/43_water_availability/total_water_aug13/postsolve.gms +++ b/modules/43_water_availability/total_water_aug13/postsolve.gms @@ -1,18 +1,19 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov43_watavail(t,wat_src,j,"marginal") = v43_watavail.m(wat_src,j); - oq43_water(t,j,"marginal") = q43_water.m(j); - ov43_watavail(t,wat_src,j,"level") = v43_watavail.l(wat_src,j); - oq43_water(t,j,"level") = q43_water.l(j); - ov43_watavail(t,wat_src,j,"upper") = v43_watavail.up(wat_src,j); - oq43_water(t,j,"upper") = q43_water.up(j); - ov43_watavail(t,wat_src,j,"lower") = v43_watavail.lo(wat_src,j); - oq43_water(t,j,"lower") = q43_water.lo(j); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - +*** | (C) 2008-2019 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 + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov43_watavail(t,wat_src,j,"marginal") = v43_watavail.m(wat_src,j); + oq43_water(t,j,"marginal") = q43_water.m(j); + ov43_watavail(t,wat_src,j,"level") = v43_watavail.l(wat_src,j); + oq43_water(t,j,"level") = q43_water.l(j); + ov43_watavail(t,wat_src,j,"upper") = v43_watavail.up(wat_src,j); + oq43_water(t,j,"upper") = q43_water.up(j); + ov43_watavail(t,wat_src,j,"lower") = v43_watavail.lo(wat_src,j); + oq43_water(t,j,"lower") = q43_water.lo(j); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### + diff --git a/modules/43_water_availability/total_water_aug13/preloop.gms b/modules/43_water_availability/total_water_aug13/preloop.gms index e7aa92692e..273f81ee29 100644 --- a/modules/43_water_availability/total_water_aug13/preloop.gms +++ b/modules/43_water_availability/total_water_aug13/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 im_wat_avail(t,"surface",j) = f43_wat_avail(t,j); diff --git a/modules/43_water_availability/total_water_aug13/presolve.gms b/modules/43_water_availability/total_water_aug13/presolve.gms index 23178edb7c..20ee54d3a1 100644 --- a/modules/43_water_availability/total_water_aug13/presolve.gms +++ b/modules/43_water_availability/total_water_aug13/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 v43_watavail.fx("surface",j) = im_wat_avail(t,"surface",j); diff --git a/modules/43_water_availability/total_water_aug13.gms b/modules/43_water_availability/total_water_aug13/realization.gms similarity index 89% rename from modules/43_water_availability/total_water_aug13.gms rename to modules/43_water_availability/total_water_aug13/realization.gms index 002c964aba..53079e77f7 100644 --- a/modules/43_water_availability/total_water_aug13.gms +++ b/modules/43_water_availability/total_water_aug13/realization.gms @@ -1,51 +1,52 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -*' The calculation of available water as described below happens -*' in the MAgPIE preprocessing. -*' This realization only considers renewable water resources, i.e. -*' runoff generated from precipitation. All runoff is assumed to -*' enter rivers, neglecting groundwater recharge. Other water resources -*' such as fossil groundwater, discharge from melting glaciers or -*' desalination are also not considered. The calculation of available -*' water per grid cell is based on LPJmL (@bondeau_lpjml_2007) simulations. For -*' each river basin, total annual runoff in the basin constitutes the -*' amount of water available in one year. In order to account for the fact that -*' water can only be supplied to the plants during the growing period, the mean -*' growing period over all crops based on LPJmL sowing and harvesting dates (@bondeau_lpjml_2007) -*' is calculated in MAgPIE. Some data has been excluded from the calculation: -*' -*' * Winter crops in the northern hemisphere (sowing date later than June -*' 29th and harvest date later than December 31st) because we assume -*' that irrigation does not take place during winter time. -*' -*' * Data points with crop yields below 10% of the world average yield. -*' Such a low yield indicates that the site is not appropriate for this -*' specific crop and the LPJmL (@bondeau_lpjml_2007) growing period simulation -*' is likely to be distorted. -*' -*' Therefore, water available for irrigation in each basin only consists of the -*' total runoff occurring in the mean growing period in all basin cells -*' except for cells where water storage in terms of dams is present (taken -*' from @biemans_water_2011). In this case, total annual runoff is available. -*' -*' The distribution of basin runoff in the growing period to the individual -*' grid cells is done using LPJmL (@bondeau_lpjml_2007) discharge as a weight. -*' -*' There is an interface to the [42_water_demand] module. If exogenous -*' non-agricultural water demand exceeds available water the missing amount is available -*' from groundwater to avoid infeasibility. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "declarations" $include "./modules/43_water_availability/total_water_aug13/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/43_water_availability/total_water_aug13/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/43_water_availability/total_water_aug13/equations.gms" -$Ifi "%phase%" == "scaling" $include "./modules/43_water_availability/total_water_aug13/scaling.gms" -$Ifi "%phase%" == "preloop" $include "./modules/43_water_availability/total_water_aug13/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/43_water_availability/total_water_aug13/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/43_water_availability/total_water_aug13/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 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 + + +*' The calculation of available water as described below happens +*' in the MAgPIE preprocessing. +*' This realization only considers renewable water resources, i.e. +*' runoff generated from precipitation. All runoff is assumed to +*' enter rivers, neglecting groundwater recharge. Other water resources +*' such as fossil groundwater, discharge from melting glaciers or +*' desalination are also not considered. The calculation of available +*' water per grid cell is based on LPJmL (@bondeau_lpjml_2007) simulations. For +*' each river basin, total annual runoff in the basin constitutes the +*' amount of water available in one year. In order to account for the fact that +*' water can only be supplied to the plants during the growing period, the mean +*' growing period over all crops based on LPJmL sowing and harvesting dates (@bondeau_lpjml_2007) +*' is calculated in MAgPIE. Some data has been excluded from the calculation: +*' +*' * Winter crops in the northern hemisphere (sowing date later than June +*' 29th and harvest date later than December 31st) because we assume +*' that irrigation does not take place during winter time. +*' +*' * Data points with crop yields below 10% of the world average yield. +*' Such a low yield indicates that the site is not appropriate for this +*' specific crop and the LPJmL (@bondeau_lpjml_2007) growing period simulation +*' is likely to be distorted. +*' +*' Therefore, water available for irrigation in each basin only consists of the +*' total runoff occurring in the mean growing period in all basin cells +*' except for cells where water storage in terms of dams is present (taken +*' from @biemans_water_2011). In this case, total annual runoff is available. +*' +*' The distribution of basin runoff in the growing period to the individual +*' grid cells is done using LPJmL (@bondeau_lpjml_2007) discharge as a weight. +*' +*' There is an interface to the [42_water_demand] module. If exogenous +*' non-agricultural water demand exceeds available water the missing amount is available +*' from groundwater to avoid infeasibility. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "declarations" $include "./modules/43_water_availability/total_water_aug13/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/43_water_availability/total_water_aug13/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/43_water_availability/total_water_aug13/equations.gms" +$Ifi "%phase%" == "scaling" $include "./modules/43_water_availability/total_water_aug13/scaling.gms" +$Ifi "%phase%" == "preloop" $include "./modules/43_water_availability/total_water_aug13/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/43_water_availability/total_water_aug13/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/43_water_availability/total_water_aug13/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/43_water_availability/total_water_aug13/scaling.gms b/modules/43_water_availability/total_water_aug13/scaling.gms index 885f8cc0bd..ea24646d6e 100644 --- a/modules/43_water_availability/total_water_aug13/scaling.gms +++ b/modules/43_water_availability/total_water_aug13/scaling.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 v43_watavail.scale(wat_src,j) = 10e5; diff --git a/modules/45_climate/45_climate.gms b/modules/45_climate/module.gms similarity index 62% rename from modules/45_climate/45_climate.gms rename to modules/45_climate/module.gms index 230efc56d4..8046d47b68 100644 --- a/modules/45_climate/45_climate.gms +++ b/modules/45_climate/module.gms @@ -1,18 +1,19 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Climate -*' -*' @description The climate module provides information about the present -*' climate classes in the different cells (as shares of the total cell). -*' This information is used by other modules to choose climate class dependent -*' factors such as growth parameters correctly (e.g. used in [35_natveg]). -*' -*' @authors Jan Philipp Dietrich - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%climate%" == "static" $include "./modules/45_climate/static.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Climate +*' +*' @description The climate module provides information about the present +*' climate classes in the different cells (as shares of the total cell). +*' This information is used by other modules to choose climate class dependent +*' factors such as growth parameters correctly (e.g. used in [35_natveg]). +*' +*' @authors Jan Philipp Dietrich + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%climate%" == "static" $include "./modules/45_climate/static/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/45_climate/static/declarations.gms b/modules/45_climate/static/declarations.gms index 283bcff6b7..a292bfa35c 100644 --- a/modules/45_climate/static/declarations.gms +++ b/modules/45_climate/static/declarations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/45_climate/static/input.gms b/modules/45_climate/static/input.gms index cf7884850c..339a2ce866 100644 --- a/modules/45_climate/static/input.gms +++ b/modules/45_climate/static/input.gms @@ -1,12 +1,13 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -table f45_koeppengeiger(j,clcl) Koeppen-Geiger climate classification on the simulation cluster level (1) -$ondelim -$include "./modules/45_climate/static/input/koeppen_geiger.cs3" -$offdelim; +*** | (C) 2008-2019 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 + + + +table f45_koeppengeiger(j,clcl) Koeppen-Geiger climate classification on the simulation cluster level (1) +$ondelim +$include "./modules/45_climate/static/input/koeppen_geiger.cs3" +$offdelim; diff --git a/modules/45_climate/static/preloop.gms b/modules/45_climate/static/preloop.gms index 8bbcb241a7..fa30b028bb 100644 --- a/modules/45_climate/static/preloop.gms +++ b/modules/45_climate/static/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 *' @code diff --git a/modules/45_climate/static.gms b/modules/45_climate/static/realization.gms similarity index 69% rename from modules/45_climate/static.gms rename to modules/45_climate/static/realization.gms index 8ebb94a744..1eecb57f88 100644 --- a/modules/45_climate/static.gms +++ b/modules/45_climate/static/realization.gms @@ -1,19 +1,20 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description In this realization climate classification information remains -*' static over the whole simulation based on data for 1976-2000 taken from -*' (@rubel_observed_2010). -*' -*' @limitations Temporal variations in climate classification are not considered. - - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/45_climate/static/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/45_climate/static/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/45_climate/static/input.gms" -$Ifi "%phase%" == "preloop" $include "./modules/45_climate/static/preloop.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description In this realization climate classification information remains +*' static over the whole simulation based on data for 1976-2000 taken from +*' (@rubel_observed_2010). +*' +*' @limitations Temporal variations in climate classification are not considered. + + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/45_climate/static/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/45_climate/static/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/45_climate/static/input.gms" +$Ifi "%phase%" == "preloop" $include "./modules/45_climate/static/preloop.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/45_climate/static/sets.gms b/modules/45_climate/static/sets.gms index 55c6ae91f4..2cbab5d1d6 100644 --- a/modules/45_climate/static/sets.gms +++ b/modules/45_climate/static/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 *' @code diff --git a/modules/50_nr_soil_budget/exoeff_aug16/declarations.gms b/modules/50_nr_soil_budget/exoeff_aug16/declarations.gms index ca988a0cbf..5d20f6bca1 100644 --- a/modules/50_nr_soil_budget/exoeff_aug16/declarations.gms +++ b/modules/50_nr_soil_budget/exoeff_aug16/declarations.gms @@ -1,43 +1,44 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -positive variables - vm_nr_inorg_fert_reg(i,land_ag) inorganic fertilizer application (Tg N per yr) - vm_nr_inorg_fert_costs(i) cost of inorganic fertilizers (mio. USD05MER per yr) - v50_nr_eff(i) cropland nutrient uptake efficiency (Tg N per yr) - v50_nr_eff_pasture(i) pasture nutrient uptake efficiency (Tg N per yr) - v50_nr_withdrawals(i,kcr) withdrawals of Nr from soils (Tg N per yr) - v50_nr_deposition(i,land) atmospheric deposition (Tg N per yr) -; - -equations - q50_nr_cost_fert(i) fertilizer costs (mio. USD05MER per yr) - q50_nr_bal_crp(i) cropland nutrient inputs have to equal withdrawals and losses (Tg N per yr) - q50_nr_withdrawals(i,kcr) calculating nr withdrawals (Tg N per yr) - q50_nr_bal_pasture(i) nitrogen balance pasture lands (Tg N per yr) - q50_nr_deposition(i,land) atmospheric deposition (Tg N per yr) -; - -parameters - ic50_atmospheric_deposition_rates(i,land) atmospheric deposition rate (t N per ha) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_nr_inorg_fert_reg(t,i,land_ag,type) inorganic fertilizer application (Tg N per yr) - ov_nr_inorg_fert_costs(t,i,type) cost of inorganic fertilizers (mio. USD05MER per yr) - ov50_nr_eff(t,i,type) cropland nutrient uptake efficiency (Tg N per yr) - ov50_nr_eff_pasture(t,i,type) pasture nutrient uptake efficiency (Tg N per yr) - ov50_nr_withdrawals(t,i,kcr,type) withdrawals of Nr from soils (Tg N per yr) - ov50_nr_deposition(t,i,land,type) atmospheric deposition (Tg N per yr) - oq50_nr_cost_fert(t,i,type) fertilizer costs (mio. USD05MER per yr) - oq50_nr_bal_crp(t,i,type) cropland nutrient inputs have to equal withdrawals and losses (Tg N per yr) - oq50_nr_withdrawals(t,i,kcr,type) calculating nr withdrawals (Tg N per yr) - oq50_nr_bal_pasture(t,i,type) nitrogen balance pasture lands (Tg N per yr) - oq50_nr_deposition(t,i,land,type) atmospheric deposition (Tg N per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + +positive variables + vm_nr_inorg_fert_reg(i,land_ag) inorganic fertilizer application (Tg N per yr) + vm_nr_inorg_fert_costs(i) cost of inorganic fertilizers (mio. USD05MER per yr) + v50_nr_eff(i) cropland nutrient uptake efficiency (Tg N per yr) + v50_nr_eff_pasture(i) pasture nutrient uptake efficiency (Tg N per yr) + v50_nr_withdrawals(i,kcr) withdrawals of Nr from soils (Tg N per yr) + v50_nr_deposition(i,land) atmospheric deposition (Tg N per yr) +; + +equations + q50_nr_cost_fert(i) fertilizer costs (mio. USD05MER per yr) + q50_nr_bal_crp(i) cropland nutrient inputs have to equal withdrawals and losses (Tg N per yr) + q50_nr_withdrawals(i,kcr) calculating nr withdrawals (Tg N per yr) + q50_nr_bal_pasture(i) nitrogen balance pasture lands (Tg N per yr) + q50_nr_deposition(i,land) atmospheric deposition (Tg N per yr) +; + +parameters + ic50_atmospheric_deposition_rates(i,land) atmospheric deposition rate (t N per ha) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_nr_inorg_fert_reg(t,i,land_ag,type) inorganic fertilizer application (Tg N per yr) + ov_nr_inorg_fert_costs(t,i,type) cost of inorganic fertilizers (mio. USD05MER per yr) + ov50_nr_eff(t,i,type) cropland nutrient uptake efficiency (Tg N per yr) + ov50_nr_eff_pasture(t,i,type) pasture nutrient uptake efficiency (Tg N per yr) + ov50_nr_withdrawals(t,i,kcr,type) withdrawals of Nr from soils (Tg N per yr) + ov50_nr_deposition(t,i,land,type) atmospheric deposition (Tg N per yr) + oq50_nr_cost_fert(t,i,type) fertilizer costs (mio. USD05MER per yr) + oq50_nr_bal_crp(t,i,type) cropland nutrient inputs have to equal withdrawals and losses (Tg N per yr) + oq50_nr_withdrawals(t,i,kcr,type) calculating nr withdrawals (Tg N per yr) + oq50_nr_bal_pasture(t,i,type) nitrogen balance pasture lands (Tg N per yr) + oq50_nr_deposition(t,i,land,type) atmospheric deposition (Tg N per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/50_nr_soil_budget/exoeff_aug16/equations.gms b/modules/50_nr_soil_budget/exoeff_aug16/equations.gms index 9442175a71..f5b6e1ad97 100644 --- a/modules/50_nr_soil_budget/exoeff_aug16/equations.gms +++ b/modules/50_nr_soil_budget/exoeff_aug16/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations @@ -59,4 +60,4 @@ q50_nr_cost_fert(i2) .. vm_nr_inorg_fert_costs(i2) =e= sum(land_ag,vm_nr_inorg_fert_reg(i2,land_ag)) * s50_fertilizer_costs - ; \ No newline at end of file + ; diff --git a/modules/50_nr_soil_budget/exoeff_aug16/input.gms b/modules/50_nr_soil_budget/exoeff_aug16/input.gms index 5336b2f1ba..23c1efd4ef 100644 --- a/modules/50_nr_soil_budget/exoeff_aug16/input.gms +++ b/modules/50_nr_soil_budget/exoeff_aug16/input.gms @@ -1,77 +1,78 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -$setglobal c50_scen_neff neff60_60_starty2010 -* options: neff55_55_starty1990,neff60_60_starty1990,neff65_70_starty1990, -* neff65_70_starty2010,neff60_60_starty2010,neff55_60_starty2010, -* neff70_75_starty2010,neff75_80_starty2010,neff80_85_starty2010 -* neff75_85_starty2010 - -$setglobal c50_dep_scen history -* options: history - -scalar - s50_fertilizer_costs Costs of fertilizer (USD05MER per tN) / 600 / -; - - -parameter f50_snupe(t_all,i,scen_neff50) selected scenario values for soil nitrogen uptake efficiency (1) -/ -$ondelim -$include "./modules/50_nr_soil_budget/input/f50_snupe.cs4" -$offdelim -/; - -parameter f50_nue_pasture(t_all,i,scen_neff50) selected scenario values for soil nitrogen uptake efficiency (1) -/ -$ondelim -$include "./modules/50_nr_soil_budget/input/f50_nue_pasture.cs4" -$offdelim -/; - - -parameter f50_nr_fix_ndfa(t_all,i,kcr) Nr fixation rates per Nr in plant biomass (tNr per tNr) -/ -$ondelim -$include "./modules/50_nr_soil_budget/input/f50_ndfa.cs4" -$offdelim -/; - -parameter f50_nitrogen_balanceflow(t_all,i) Balancelfow to account for unrealistically high SNUpEs on croplands (mio. tNr per yr) -/ -$ondelim -$include "./modules/50_nr_soil_budget/input/f50_nitrogen_balanceflow.cs4" -$offdelim -/; - -parameter f50_nitrogen_balanceflow_pasture(t_all,i) Balancelfow to account for unrealistically high NUE on pastures (mio. tNr per yr) -/ -$ondelim -$include "./modules/50_nr_soil_budget/input/f50_nitrogen_balanceflow_pasture.cs4" -$offdelim -/; - - -parameter f50_nr_fix_area(kcr) Nr fixation rates per area (tNr per ha) -/ -$ondelim -$include "./modules/50_nr_soil_budget/input/f50_fixation_freeliving.cs4" -$offdelim -/; - -parameter f50_nr_fixation_rates_pasture(t_all,i) Nr fixation rates per pasture area (tNr per ha) -/ -$ondelim -$include "./modules/50_nr_soil_budget/input/f50_nitrogen_fixation_rates_pasture.cs4" -$offdelim -/; - -parameter f50_atmospheric_deposition_rates(t_all,i,land,dep_scen50) Nr deposition rates per area (tNr per ha) -/ -$ondelim -$include "./modules/50_nr_soil_budget/input/f50_atmospheric_deposition_rates.cs4" -$offdelim -/; +*** | (C) 2008-2019 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 + +$setglobal c50_scen_neff neff60_60_starty2010 +* options: neff55_55_starty1990,neff60_60_starty1990,neff65_70_starty1990, +* neff65_70_starty2010,neff60_60_starty2010,neff55_60_starty2010, +* neff70_75_starty2010,neff75_80_starty2010,neff80_85_starty2010 +* neff75_85_starty2010 + +$setglobal c50_dep_scen history +* options: history + +scalar + s50_fertilizer_costs Costs of fertilizer (USD05MER per tN) / 600 / +; + + +parameter f50_snupe(t_all,i,scen_neff50) selected scenario values for soil nitrogen uptake efficiency (1) +/ +$ondelim +$include "./modules/50_nr_soil_budget/input/f50_snupe.cs4" +$offdelim +/; + +parameter f50_nue_pasture(t_all,i,scen_neff50) selected scenario values for soil nitrogen uptake efficiency (1) +/ +$ondelim +$include "./modules/50_nr_soil_budget/input/f50_nue_pasture.cs4" +$offdelim +/; + + +parameter f50_nr_fix_ndfa(t_all,i,kcr) Nr fixation rates per Nr in plant biomass (tNr per tNr) +/ +$ondelim +$include "./modules/50_nr_soil_budget/input/f50_ndfa.cs4" +$offdelim +/; + +parameter f50_nitrogen_balanceflow(t_all,i) Balancelfow to account for unrealistically high SNUpEs on croplands (mio. tNr per yr) +/ +$ondelim +$include "./modules/50_nr_soil_budget/input/f50_nitrogen_balanceflow.cs4" +$offdelim +/; + +parameter f50_nitrogen_balanceflow_pasture(t_all,i) Balancelfow to account for unrealistically high NUE on pastures (mio. tNr per yr) +/ +$ondelim +$include "./modules/50_nr_soil_budget/input/f50_nitrogen_balanceflow_pasture.cs4" +$offdelim +/; + + +parameter f50_nr_fix_area(kcr) Nr fixation rates per area (tNr per ha) +/ +$ondelim +$include "./modules/50_nr_soil_budget/input/f50_fixation_freeliving.cs4" +$offdelim +/; + +parameter f50_nr_fixation_rates_pasture(t_all,i) Nr fixation rates per pasture area (tNr per ha) +/ +$ondelim +$include "./modules/50_nr_soil_budget/input/f50_nitrogen_fixation_rates_pasture.cs4" +$offdelim +/; + +parameter f50_atmospheric_deposition_rates(t_all,i,land,dep_scen50) Nr deposition rates per area (tNr per ha) +/ +$ondelim +$include "./modules/50_nr_soil_budget/input/f50_atmospheric_deposition_rates.cs4" +$offdelim +/; diff --git a/modules/50_nr_soil_budget/exoeff_aug16/postsolve.gms b/modules/50_nr_soil_budget/exoeff_aug16/postsolve.gms index 820d0428cb..3c96c5fb56 100644 --- a/modules/50_nr_soil_budget/exoeff_aug16/postsolve.gms +++ b/modules/50_nr_soil_budget/exoeff_aug16/postsolve.gms @@ -1,55 +1,56 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_nr_inorg_fert_reg(t,i,land_ag,"marginal") = vm_nr_inorg_fert_reg.m(i,land_ag); - ov_nr_inorg_fert_costs(t,i,"marginal") = vm_nr_inorg_fert_costs.m(i); - ov50_nr_eff(t,i,"marginal") = v50_nr_eff.m(i); - ov50_nr_eff_pasture(t,i,"marginal") = v50_nr_eff_pasture.m(i); - ov50_nr_withdrawals(t,i,kcr,"marginal") = v50_nr_withdrawals.m(i,kcr); - ov50_nr_deposition(t,i,land,"marginal") = v50_nr_deposition.m(i,land); - oq50_nr_cost_fert(t,i,"marginal") = q50_nr_cost_fert.m(i); - oq50_nr_bal_crp(t,i,"marginal") = q50_nr_bal_crp.m(i); - oq50_nr_withdrawals(t,i,kcr,"marginal") = q50_nr_withdrawals.m(i,kcr); - oq50_nr_bal_pasture(t,i,"marginal") = q50_nr_bal_pasture.m(i); - oq50_nr_deposition(t,i,land,"marginal") = q50_nr_deposition.m(i,land); - ov_nr_inorg_fert_reg(t,i,land_ag,"level") = vm_nr_inorg_fert_reg.l(i,land_ag); - ov_nr_inorg_fert_costs(t,i,"level") = vm_nr_inorg_fert_costs.l(i); - ov50_nr_eff(t,i,"level") = v50_nr_eff.l(i); - ov50_nr_eff_pasture(t,i,"level") = v50_nr_eff_pasture.l(i); - ov50_nr_withdrawals(t,i,kcr,"level") = v50_nr_withdrawals.l(i,kcr); - ov50_nr_deposition(t,i,land,"level") = v50_nr_deposition.l(i,land); - oq50_nr_cost_fert(t,i,"level") = q50_nr_cost_fert.l(i); - oq50_nr_bal_crp(t,i,"level") = q50_nr_bal_crp.l(i); - oq50_nr_withdrawals(t,i,kcr,"level") = q50_nr_withdrawals.l(i,kcr); - oq50_nr_bal_pasture(t,i,"level") = q50_nr_bal_pasture.l(i); - oq50_nr_deposition(t,i,land,"level") = q50_nr_deposition.l(i,land); - ov_nr_inorg_fert_reg(t,i,land_ag,"upper") = vm_nr_inorg_fert_reg.up(i,land_ag); - ov_nr_inorg_fert_costs(t,i,"upper") = vm_nr_inorg_fert_costs.up(i); - ov50_nr_eff(t,i,"upper") = v50_nr_eff.up(i); - ov50_nr_eff_pasture(t,i,"upper") = v50_nr_eff_pasture.up(i); - ov50_nr_withdrawals(t,i,kcr,"upper") = v50_nr_withdrawals.up(i,kcr); - ov50_nr_deposition(t,i,land,"upper") = v50_nr_deposition.up(i,land); - oq50_nr_cost_fert(t,i,"upper") = q50_nr_cost_fert.up(i); - oq50_nr_bal_crp(t,i,"upper") = q50_nr_bal_crp.up(i); - oq50_nr_withdrawals(t,i,kcr,"upper") = q50_nr_withdrawals.up(i,kcr); - oq50_nr_bal_pasture(t,i,"upper") = q50_nr_bal_pasture.up(i); - oq50_nr_deposition(t,i,land,"upper") = q50_nr_deposition.up(i,land); - ov_nr_inorg_fert_reg(t,i,land_ag,"lower") = vm_nr_inorg_fert_reg.lo(i,land_ag); - ov_nr_inorg_fert_costs(t,i,"lower") = vm_nr_inorg_fert_costs.lo(i); - ov50_nr_eff(t,i,"lower") = v50_nr_eff.lo(i); - ov50_nr_eff_pasture(t,i,"lower") = v50_nr_eff_pasture.lo(i); - ov50_nr_withdrawals(t,i,kcr,"lower") = v50_nr_withdrawals.lo(i,kcr); - ov50_nr_deposition(t,i,land,"lower") = v50_nr_deposition.lo(i,land); - oq50_nr_cost_fert(t,i,"lower") = q50_nr_cost_fert.lo(i); - oq50_nr_bal_crp(t,i,"lower") = q50_nr_bal_crp.lo(i); - oq50_nr_withdrawals(t,i,kcr,"lower") = q50_nr_withdrawals.lo(i,kcr); - oq50_nr_bal_pasture(t,i,"lower") = q50_nr_bal_pasture.lo(i); - oq50_nr_deposition(t,i,land,"lower") = q50_nr_deposition.lo(i,land); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - +*** | (C) 2008-2019 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 + + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_nr_inorg_fert_reg(t,i,land_ag,"marginal") = vm_nr_inorg_fert_reg.m(i,land_ag); + ov_nr_inorg_fert_costs(t,i,"marginal") = vm_nr_inorg_fert_costs.m(i); + ov50_nr_eff(t,i,"marginal") = v50_nr_eff.m(i); + ov50_nr_eff_pasture(t,i,"marginal") = v50_nr_eff_pasture.m(i); + ov50_nr_withdrawals(t,i,kcr,"marginal") = v50_nr_withdrawals.m(i,kcr); + ov50_nr_deposition(t,i,land,"marginal") = v50_nr_deposition.m(i,land); + oq50_nr_cost_fert(t,i,"marginal") = q50_nr_cost_fert.m(i); + oq50_nr_bal_crp(t,i,"marginal") = q50_nr_bal_crp.m(i); + oq50_nr_withdrawals(t,i,kcr,"marginal") = q50_nr_withdrawals.m(i,kcr); + oq50_nr_bal_pasture(t,i,"marginal") = q50_nr_bal_pasture.m(i); + oq50_nr_deposition(t,i,land,"marginal") = q50_nr_deposition.m(i,land); + ov_nr_inorg_fert_reg(t,i,land_ag,"level") = vm_nr_inorg_fert_reg.l(i,land_ag); + ov_nr_inorg_fert_costs(t,i,"level") = vm_nr_inorg_fert_costs.l(i); + ov50_nr_eff(t,i,"level") = v50_nr_eff.l(i); + ov50_nr_eff_pasture(t,i,"level") = v50_nr_eff_pasture.l(i); + ov50_nr_withdrawals(t,i,kcr,"level") = v50_nr_withdrawals.l(i,kcr); + ov50_nr_deposition(t,i,land,"level") = v50_nr_deposition.l(i,land); + oq50_nr_cost_fert(t,i,"level") = q50_nr_cost_fert.l(i); + oq50_nr_bal_crp(t,i,"level") = q50_nr_bal_crp.l(i); + oq50_nr_withdrawals(t,i,kcr,"level") = q50_nr_withdrawals.l(i,kcr); + oq50_nr_bal_pasture(t,i,"level") = q50_nr_bal_pasture.l(i); + oq50_nr_deposition(t,i,land,"level") = q50_nr_deposition.l(i,land); + ov_nr_inorg_fert_reg(t,i,land_ag,"upper") = vm_nr_inorg_fert_reg.up(i,land_ag); + ov_nr_inorg_fert_costs(t,i,"upper") = vm_nr_inorg_fert_costs.up(i); + ov50_nr_eff(t,i,"upper") = v50_nr_eff.up(i); + ov50_nr_eff_pasture(t,i,"upper") = v50_nr_eff_pasture.up(i); + ov50_nr_withdrawals(t,i,kcr,"upper") = v50_nr_withdrawals.up(i,kcr); + ov50_nr_deposition(t,i,land,"upper") = v50_nr_deposition.up(i,land); + oq50_nr_cost_fert(t,i,"upper") = q50_nr_cost_fert.up(i); + oq50_nr_bal_crp(t,i,"upper") = q50_nr_bal_crp.up(i); + oq50_nr_withdrawals(t,i,kcr,"upper") = q50_nr_withdrawals.up(i,kcr); + oq50_nr_bal_pasture(t,i,"upper") = q50_nr_bal_pasture.up(i); + oq50_nr_deposition(t,i,land,"upper") = q50_nr_deposition.up(i,land); + ov_nr_inorg_fert_reg(t,i,land_ag,"lower") = vm_nr_inorg_fert_reg.lo(i,land_ag); + ov_nr_inorg_fert_costs(t,i,"lower") = vm_nr_inorg_fert_costs.lo(i); + ov50_nr_eff(t,i,"lower") = v50_nr_eff.lo(i); + ov50_nr_eff_pasture(t,i,"lower") = v50_nr_eff_pasture.lo(i); + ov50_nr_withdrawals(t,i,kcr,"lower") = v50_nr_withdrawals.lo(i,kcr); + ov50_nr_deposition(t,i,land,"lower") = v50_nr_deposition.lo(i,land); + oq50_nr_cost_fert(t,i,"lower") = q50_nr_cost_fert.lo(i); + oq50_nr_bal_crp(t,i,"lower") = q50_nr_bal_crp.lo(i); + oq50_nr_withdrawals(t,i,kcr,"lower") = q50_nr_withdrawals.lo(i,kcr); + oq50_nr_bal_pasture(t,i,"lower") = q50_nr_bal_pasture.lo(i); + oq50_nr_deposition(t,i,land,"lower") = q50_nr_deposition.lo(i,land); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### + diff --git a/modules/50_nr_soil_budget/exoeff_aug16/presolve.gms b/modules/50_nr_soil_budget/exoeff_aug16/presolve.gms index 7adf852056..3de3af993e 100644 --- a/modules/50_nr_soil_budget/exoeff_aug16/presolve.gms +++ b/modules/50_nr_soil_budget/exoeff_aug16/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/50_nr_soil_budget/exoeff_aug16.gms b/modules/50_nr_soil_budget/exoeff_aug16/realization.gms similarity index 72% rename from modules/50_nr_soil_budget/exoeff_aug16.gms rename to modules/50_nr_soil_budget/exoeff_aug16/realization.gms index 1343ea9d99..93057e8411 100644 --- a/modules/50_nr_soil_budget/exoeff_aug16.gms +++ b/modules/50_nr_soil_budget/exoeff_aug16/realization.gms @@ -1,17 +1,18 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description This realization calculates the nitrogen balance for crop land and pasture land -*' using exogenous uptake efficiencies. Several scenarios are available for the efficiency. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/50_nr_soil_budget/exoeff_aug16/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/50_nr_soil_budget/exoeff_aug16/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/50_nr_soil_budget/exoeff_aug16/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/50_nr_soil_budget/exoeff_aug16/equations.gms" -$Ifi "%phase%" == "presolve" $include "./modules/50_nr_soil_budget/exoeff_aug16/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/50_nr_soil_budget/exoeff_aug16/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description This realization calculates the nitrogen balance for crop land and pasture land +*' using exogenous uptake efficiencies. Several scenarios are available for the efficiency. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/50_nr_soil_budget/exoeff_aug16/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/50_nr_soil_budget/exoeff_aug16/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/50_nr_soil_budget/exoeff_aug16/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/50_nr_soil_budget/exoeff_aug16/equations.gms" +$Ifi "%phase%" == "presolve" $include "./modules/50_nr_soil_budget/exoeff_aug16/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/50_nr_soil_budget/exoeff_aug16/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/50_nr_soil_budget/exoeff_aug16/sets.gms b/modules/50_nr_soil_budget/exoeff_aug16/sets.gms index a19d60f0c4..8550a0fd0e 100644 --- a/modules/50_nr_soil_budget/exoeff_aug16/sets.gms +++ b/modules/50_nr_soil_budget/exoeff_aug16/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets @@ -19,4 +20,4 @@ neff75_85_starty2010 / dep_scen50 Scenario for atmospheric deposition /history/ -; \ No newline at end of file +; diff --git a/modules/50_nr_soil_budget/50_nr_soil_budget.gms b/modules/50_nr_soil_budget/module.gms similarity index 57% rename from modules/50_nr_soil_budget/50_nr_soil_budget.gms rename to modules/50_nr_soil_budget/module.gms index 5e177197c5..de1a390571 100644 --- a/modules/50_nr_soil_budget/50_nr_soil_budget.gms +++ b/modules/50_nr_soil_budget/module.gms @@ -1,17 +1,18 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Nitrogen soil budget - -*' @description The module 50_nr_soil_budget balances the nitrogen flows for crop land soils and pasture soils -*' and calculates the resulting demand for inorganic fertilizer and associated costs. - -*' @authors Benjamin Bodirsky - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%nr_soil_budget%" == "exoeff_aug16" $include "./modules/50_nr_soil_budget/exoeff_aug16.gms" -$Ifi "%nr_soil_budget%" == "off" $include "./modules/50_nr_soil_budget/off.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Nitrogen soil budget + +*' @description The module 50_nr_soil_budget balances the nitrogen flows for crop land soils and pasture soils +*' and calculates the resulting demand for inorganic fertilizer and associated costs. + +*' @authors Benjamin Bodirsky + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%nr_soil_budget%" == "exoeff_aug16" $include "./modules/50_nr_soil_budget/exoeff_aug16/realization.gms" +$Ifi "%nr_soil_budget%" == "off" $include "./modules/50_nr_soil_budget/off/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/50_nr_soil_budget/off/declarations.gms b/modules/50_nr_soil_budget/off/declarations.gms index 95fa3d09b0..601711a496 100644 --- a/modules/50_nr_soil_budget/off/declarations.gms +++ b/modules/50_nr_soil_budget/off/declarations.gms @@ -1,19 +1,20 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -positive variables - - vm_nr_inorg_fert_reg(i,land_ag) inorganic fertilizer application (Tg N per yr) - vm_nr_inorg_fert_costs(i) cost of inorganic fertiliuers (mio. USD05MER per yr) - -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_nr_inorg_fert_reg(t,i,land_ag,type) inorganic fertilizer application (Tg N per yr) - ov_nr_inorg_fert_costs(t,i,type) cost of inorganic fertiliuers (mio. USD05MER per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +positive variables + + vm_nr_inorg_fert_reg(i,land_ag) inorganic fertilizer application (Tg N per yr) + vm_nr_inorg_fert_costs(i) cost of inorganic fertiliuers (mio. USD05MER per yr) + +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_nr_inorg_fert_reg(t,i,land_ag,type) inorganic fertilizer application (Tg N per yr) + ov_nr_inorg_fert_costs(t,i,type) cost of inorganic fertiliuers (mio. USD05MER per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/50_nr_soil_budget/off/not_used.txt b/modules/50_nr_soil_budget/off/not_used.txt index 88e38b4094..3c321a35e4 100644 --- a/modules/50_nr_soil_budget/off/not_used.txt +++ b/modules/50_nr_soil_budget/off/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason diff --git a/modules/50_nr_soil_budget/off/postsolve.gms b/modules/50_nr_soil_budget/off/postsolve.gms index 4b11663378..b403fd214f 100644 --- a/modules/50_nr_soil_budget/off/postsolve.gms +++ b/modules/50_nr_soil_budget/off/postsolve.gms @@ -1,19 +1,20 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_nr_inorg_fert_reg(t,i,land_ag,"marginal") = vm_nr_inorg_fert_reg.m(i,land_ag); - ov_nr_inorg_fert_costs(t,i,"marginal") = vm_nr_inorg_fert_costs.m(i); - ov_nr_inorg_fert_reg(t,i,land_ag,"level") = vm_nr_inorg_fert_reg.l(i,land_ag); - ov_nr_inorg_fert_costs(t,i,"level") = vm_nr_inorg_fert_costs.l(i); - ov_nr_inorg_fert_reg(t,i,land_ag,"upper") = vm_nr_inorg_fert_reg.up(i,land_ag); - ov_nr_inorg_fert_costs(t,i,"upper") = vm_nr_inorg_fert_costs.up(i); - ov_nr_inorg_fert_reg(t,i,land_ag,"lower") = vm_nr_inorg_fert_reg.lo(i,land_ag); - ov_nr_inorg_fert_costs(t,i,"lower") = vm_nr_inorg_fert_costs.lo(i); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - +*** | (C) 2008-2019 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 + + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_nr_inorg_fert_reg(t,i,land_ag,"marginal") = vm_nr_inorg_fert_reg.m(i,land_ag); + ov_nr_inorg_fert_costs(t,i,"marginal") = vm_nr_inorg_fert_costs.m(i); + ov_nr_inorg_fert_reg(t,i,land_ag,"level") = vm_nr_inorg_fert_reg.l(i,land_ag); + ov_nr_inorg_fert_costs(t,i,"level") = vm_nr_inorg_fert_costs.l(i); + ov_nr_inorg_fert_reg(t,i,land_ag,"upper") = vm_nr_inorg_fert_reg.up(i,land_ag); + ov_nr_inorg_fert_costs(t,i,"upper") = vm_nr_inorg_fert_costs.up(i); + ov_nr_inorg_fert_reg(t,i,land_ag,"lower") = vm_nr_inorg_fert_reg.lo(i,land_ag); + ov_nr_inorg_fert_costs(t,i,"lower") = vm_nr_inorg_fert_costs.lo(i); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### + diff --git a/modules/50_nr_soil_budget/off/preloop.gms b/modules/50_nr_soil_budget/off/preloop.gms index 44844c3214..d6c1688407 100644 --- a/modules/50_nr_soil_budget/off/preloop.gms +++ b/modules/50_nr_soil_budget/off/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de vm_nr_inorg_fert_reg.fx(i,land_ag) = 0; diff --git a/modules/50_nr_soil_budget/off.gms b/modules/50_nr_soil_budget/off/realization.gms similarity index 61% rename from modules/50_nr_soil_budget/off.gms rename to modules/50_nr_soil_budget/off/realization.gms index b97a27a357..ce949b4d8c 100644 --- a/modules/50_nr_soil_budget/off.gms +++ b/modules/50_nr_soil_budget/off/realization.gms @@ -1,13 +1,14 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description This realization sets the demand for inorganic fertilizer and associated costs to zero. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "declarations" $include "./modules/50_nr_soil_budget/off/declarations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/50_nr_soil_budget/off/preloop.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/50_nr_soil_budget/off/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description This realization sets the demand for inorganic fertilizer and associated costs to zero. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "declarations" $include "./modules/50_nr_soil_budget/off/declarations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/50_nr_soil_budget/off/preloop.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/50_nr_soil_budget/off/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/51_nitrogen/51_nitrogen.gms b/modules/51_nitrogen/51_nitrogen.gms deleted file mode 100644 index 5216765f6a..0000000000 --- a/modules/51_nitrogen/51_nitrogen.gms +++ /dev/null @@ -1,16 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Nitrogen -*' @description -*' The nitrogen module calculates nitrogeneous emissions before technical -*' mitigation, including N2O, NOx, NH3, NO3- and N2. -*' @authors Benjamin Leon Bodirsky - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%nitrogen%" == "ipcc2006_sep16" $include "./modules/51_nitrogen/ipcc2006_sep16.gms" -$Ifi "%nitrogen%" == "off" $include "./modules/51_nitrogen/off.gms" -*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/51_nitrogen/ipcc2006_sep16/declarations.gms b/modules/51_nitrogen/ipcc2006_sep16/declarations.gms index eff9869d15..e0b30bd60c 100644 --- a/modules/51_nitrogen/ipcc2006_sep16/declarations.gms +++ b/modules/51_nitrogen/ipcc2006_sep16/declarations.gms @@ -1,27 +1,28 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -equations - q51_emissions_inorg_fert(i,n_pollutants_direct) estimates various emission types X from inorganic fertilizer before technical mitigation (Mt X-N) - q51_emissions_man_crop(i,n_pollutants_direct) estimates various emission types X from manure on cropland before technical mitigation (Mt X-N) - q51_emissions_resid(i,n_pollutants_direct) estimates various emission types X from residues before technical mitigation (Mt X-N) - q51_emissions_som(i,n_pollutants_direct) estimates various emission types X from soil organic matter loss before technical mitigation (Mt X-N) - q51_emissionbal_man_past(i,n_pollutants_direct) estimates various emission types X from manure on pasture land before technical mitigation (Mt X-N) - q51_emissionbal_awms(i,n_pollutants_direct) estimates various emission types X from animal waste management systems before technical mitigation (Mt X-N) - q51_emissions_indirect_n2o(i,emis_source_n51) estimates various emission types X from volatilisation and leaching (Mt X-N) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - oq51_emissions_inorg_fert(t,i,n_pollutants_direct,type) estimates various emission types X from inorganic fertilizer before technical mitigation (Mt X-N) - oq51_emissions_man_crop(t,i,n_pollutants_direct,type) estimates various emission types X from manure on cropland before technical mitigation (Mt X-N) - oq51_emissions_resid(t,i,n_pollutants_direct,type) estimates various emission types X from residues before technical mitigation (Mt X-N) - oq51_emissions_som(t,i,n_pollutants_direct,type) estimates various emission types X from soil organic matter loss before technical mitigation (Mt X-N) - oq51_emissionbal_man_past(t,i,n_pollutants_direct,type) estimates various emission types X from manure on pasture land before technical mitigation (Mt X-N) - oq51_emissionbal_awms(t,i,n_pollutants_direct,type) estimates various emission types X from animal waste management systems before technical mitigation (Mt X-N) - oq51_emissions_indirect_n2o(t,i,emis_source_n51,type) estimates various emission types X from volatilisation and leaching (Mt X-N) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +equations + q51_emissions_inorg_fert(i,n_pollutants_direct) estimates various emission types X from inorganic fertilizer before technical mitigation (Mt X-N) + q51_emissions_man_crop(i,n_pollutants_direct) estimates various emission types X from manure on cropland before technical mitigation (Mt X-N) + q51_emissions_resid(i,n_pollutants_direct) estimates various emission types X from residues before technical mitigation (Mt X-N) + q51_emissions_som(i,n_pollutants_direct) estimates various emission types X from soil organic matter loss before technical mitigation (Mt X-N) + q51_emissionbal_man_past(i,n_pollutants_direct) estimates various emission types X from manure on pasture land before technical mitigation (Mt X-N) + q51_emissionbal_awms(i,n_pollutants_direct) estimates various emission types X from animal waste management systems before technical mitigation (Mt X-N) + q51_emissions_indirect_n2o(i,emis_source_n51) estimates various emission types X from volatilisation and leaching (Mt X-N) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + oq51_emissions_inorg_fert(t,i,n_pollutants_direct,type) estimates various emission types X from inorganic fertilizer before technical mitigation (Mt X-N) + oq51_emissions_man_crop(t,i,n_pollutants_direct,type) estimates various emission types X from manure on cropland before technical mitigation (Mt X-N) + oq51_emissions_resid(t,i,n_pollutants_direct,type) estimates various emission types X from residues before technical mitigation (Mt X-N) + oq51_emissions_som(t,i,n_pollutants_direct,type) estimates various emission types X from soil organic matter loss before technical mitigation (Mt X-N) + oq51_emissionbal_man_past(t,i,n_pollutants_direct,type) estimates various emission types X from manure on pasture land before technical mitigation (Mt X-N) + oq51_emissionbal_awms(t,i,n_pollutants_direct,type) estimates various emission types X from animal waste management systems before technical mitigation (Mt X-N) + oq51_emissions_indirect_n2o(t,i,emis_source_n51,type) estimates various emission types X from volatilisation and leaching (Mt X-N) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/51_nitrogen/ipcc2006_sep16/equations.gms b/modules/51_nitrogen/ipcc2006_sep16/equations.gms index 691ba78bde..96ed8618a5 100644 --- a/modules/51_nitrogen/ipcc2006_sep16/equations.gms +++ b/modules/51_nitrogen/ipcc2006_sep16/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations @@ -63,4 +64,4 @@ + vm_emissions_reg(i2,emis_source_n51,"no3_n") * f51_ipcc_ef("ef_5","best"); -*** EOF constraints.gms *** \ No newline at end of file +*** EOF constraints.gms *** diff --git a/modules/51_nitrogen/ipcc2006_sep16/input.gms b/modules/51_nitrogen/ipcc2006_sep16/input.gms index 00c9ecbf00..8cee12e235 100644 --- a/modules/51_nitrogen/ipcc2006_sep16/input.gms +++ b/modules/51_nitrogen/ipcc2006_sep16/input.gms @@ -1,34 +1,35 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -table f51_ipcc_ef(ipcc_ef51,emis_uncertainty51) ipcc emission factors for various emission types X (tX-N per tN) -$ondelim -$include "./modules/51_nitrogen/input/f51_ipcc_ef.csv" -$offdelim -; - -table f51_ef_n_soil(n_pollutants_direct,emis_source_n_cropsoils51) ipcc emission factors for various emission types X (tX-N per tN) -$ondelim -$include "./modules/51_nitrogen/ipcc2006_sep16/input/f51_ef_n_soil.cs3" -$offdelim -; - -parameter f51_ef3_confinement(i,kli,awms_conf,n_pollutants_direct) emissions from manure managed in confinement for various emission types X (tX-N per tN) -/ -$ondelim -$include "./modules/51_nitrogen/ipcc2006_sep16/input/f51_ef3_confinement.cs4" -$offdelim -/ -; - -parameter f51_ef3_prp(i,n_pollutants_direct,kli) emissions from manure on pasture range and paddocks for various emission types X (tX-N per tN) -/ -$ondelim -$include "./modules/51_nitrogen/ipcc2006_sep16/input/f51_ef3_prp.cs4" -$offdelim -/; +*** | (C) 2008-2019 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 + + + +table f51_ipcc_ef(ipcc_ef51,emis_uncertainty51) ipcc emission factors for various emission types X (tX-N per tN) +$ondelim +$include "./modules/51_nitrogen/input/f51_ipcc_ef.csv" +$offdelim +; + +table f51_ef_n_soil(n_pollutants_direct,emis_source_n_cropsoils51) ipcc emission factors for various emission types X (tX-N per tN) +$ondelim +$include "./modules/51_nitrogen/ipcc2006_sep16/input/f51_ef_n_soil.cs3" +$offdelim +; + +parameter f51_ef3_confinement(i,kli,awms_conf,n_pollutants_direct) emissions from manure managed in confinement for various emission types X (tX-N per tN) +/ +$ondelim +$include "./modules/51_nitrogen/ipcc2006_sep16/input/f51_ef3_confinement.cs4" +$offdelim +/ +; + +parameter f51_ef3_prp(i,n_pollutants_direct,kli) emissions from manure on pasture range and paddocks for various emission types X (tX-N per tN) +/ +$ondelim +$include "./modules/51_nitrogen/ipcc2006_sep16/input/f51_ef3_prp.cs4" +$offdelim +/; diff --git a/modules/51_nitrogen/ipcc2006_sep16/not_used.txt b/modules/51_nitrogen/ipcc2006_sep16/not_used.txt index aa2c8d2e19..d78901bb63 100644 --- a/modules/51_nitrogen/ipcc2006_sep16/not_used.txt +++ b/modules/51_nitrogen/ipcc2006_sep16/not_used.txt @@ -1,6 +1,7 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason diff --git a/modules/51_nitrogen/ipcc2006_sep16/postsolve.gms b/modules/51_nitrogen/ipcc2006_sep16/postsolve.gms index c462f67d05..284d46cd7b 100644 --- a/modules/51_nitrogen/ipcc2006_sep16/postsolve.gms +++ b/modules/51_nitrogen/ipcc2006_sep16/postsolve.gms @@ -1,38 +1,39 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - oq51_emissions_inorg_fert(t,i,n_pollutants_direct,"marginal") = q51_emissions_inorg_fert.m(i,n_pollutants_direct); - oq51_emissions_man_crop(t,i,n_pollutants_direct,"marginal") = q51_emissions_man_crop.m(i,n_pollutants_direct); - oq51_emissions_resid(t,i,n_pollutants_direct,"marginal") = q51_emissions_resid.m(i,n_pollutants_direct); - oq51_emissions_som(t,i,n_pollutants_direct,"marginal") = q51_emissions_som.m(i,n_pollutants_direct); - oq51_emissionbal_man_past(t,i,n_pollutants_direct,"marginal") = q51_emissionbal_man_past.m(i,n_pollutants_direct); - oq51_emissionbal_awms(t,i,n_pollutants_direct,"marginal") = q51_emissionbal_awms.m(i,n_pollutants_direct); - oq51_emissions_indirect_n2o(t,i,emis_source_n51,"marginal") = q51_emissions_indirect_n2o.m(i,emis_source_n51); - oq51_emissions_inorg_fert(t,i,n_pollutants_direct,"level") = q51_emissions_inorg_fert.l(i,n_pollutants_direct); - oq51_emissions_man_crop(t,i,n_pollutants_direct,"level") = q51_emissions_man_crop.l(i,n_pollutants_direct); - oq51_emissions_resid(t,i,n_pollutants_direct,"level") = q51_emissions_resid.l(i,n_pollutants_direct); - oq51_emissions_som(t,i,n_pollutants_direct,"level") = q51_emissions_som.l(i,n_pollutants_direct); - oq51_emissionbal_man_past(t,i,n_pollutants_direct,"level") = q51_emissionbal_man_past.l(i,n_pollutants_direct); - oq51_emissionbal_awms(t,i,n_pollutants_direct,"level") = q51_emissionbal_awms.l(i,n_pollutants_direct); - oq51_emissions_indirect_n2o(t,i,emis_source_n51,"level") = q51_emissions_indirect_n2o.l(i,emis_source_n51); - oq51_emissions_inorg_fert(t,i,n_pollutants_direct,"upper") = q51_emissions_inorg_fert.up(i,n_pollutants_direct); - oq51_emissions_man_crop(t,i,n_pollutants_direct,"upper") = q51_emissions_man_crop.up(i,n_pollutants_direct); - oq51_emissions_resid(t,i,n_pollutants_direct,"upper") = q51_emissions_resid.up(i,n_pollutants_direct); - oq51_emissions_som(t,i,n_pollutants_direct,"upper") = q51_emissions_som.up(i,n_pollutants_direct); - oq51_emissionbal_man_past(t,i,n_pollutants_direct,"upper") = q51_emissionbal_man_past.up(i,n_pollutants_direct); - oq51_emissionbal_awms(t,i,n_pollutants_direct,"upper") = q51_emissionbal_awms.up(i,n_pollutants_direct); - oq51_emissions_indirect_n2o(t,i,emis_source_n51,"upper") = q51_emissions_indirect_n2o.up(i,emis_source_n51); - oq51_emissions_inorg_fert(t,i,n_pollutants_direct,"lower") = q51_emissions_inorg_fert.lo(i,n_pollutants_direct); - oq51_emissions_man_crop(t,i,n_pollutants_direct,"lower") = q51_emissions_man_crop.lo(i,n_pollutants_direct); - oq51_emissions_resid(t,i,n_pollutants_direct,"lower") = q51_emissions_resid.lo(i,n_pollutants_direct); - oq51_emissions_som(t,i,n_pollutants_direct,"lower") = q51_emissions_som.lo(i,n_pollutants_direct); - oq51_emissionbal_man_past(t,i,n_pollutants_direct,"lower") = q51_emissionbal_man_past.lo(i,n_pollutants_direct); - oq51_emissionbal_awms(t,i,n_pollutants_direct,"lower") = q51_emissionbal_awms.lo(i,n_pollutants_direct); - oq51_emissions_indirect_n2o(t,i,emis_source_n51,"lower") = q51_emissions_indirect_n2o.lo(i,emis_source_n51); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 + + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + oq51_emissions_inorg_fert(t,i,n_pollutants_direct,"marginal") = q51_emissions_inorg_fert.m(i,n_pollutants_direct); + oq51_emissions_man_crop(t,i,n_pollutants_direct,"marginal") = q51_emissions_man_crop.m(i,n_pollutants_direct); + oq51_emissions_resid(t,i,n_pollutants_direct,"marginal") = q51_emissions_resid.m(i,n_pollutants_direct); + oq51_emissions_som(t,i,n_pollutants_direct,"marginal") = q51_emissions_som.m(i,n_pollutants_direct); + oq51_emissionbal_man_past(t,i,n_pollutants_direct,"marginal") = q51_emissionbal_man_past.m(i,n_pollutants_direct); + oq51_emissionbal_awms(t,i,n_pollutants_direct,"marginal") = q51_emissionbal_awms.m(i,n_pollutants_direct); + oq51_emissions_indirect_n2o(t,i,emis_source_n51,"marginal") = q51_emissions_indirect_n2o.m(i,emis_source_n51); + oq51_emissions_inorg_fert(t,i,n_pollutants_direct,"level") = q51_emissions_inorg_fert.l(i,n_pollutants_direct); + oq51_emissions_man_crop(t,i,n_pollutants_direct,"level") = q51_emissions_man_crop.l(i,n_pollutants_direct); + oq51_emissions_resid(t,i,n_pollutants_direct,"level") = q51_emissions_resid.l(i,n_pollutants_direct); + oq51_emissions_som(t,i,n_pollutants_direct,"level") = q51_emissions_som.l(i,n_pollutants_direct); + oq51_emissionbal_man_past(t,i,n_pollutants_direct,"level") = q51_emissionbal_man_past.l(i,n_pollutants_direct); + oq51_emissionbal_awms(t,i,n_pollutants_direct,"level") = q51_emissionbal_awms.l(i,n_pollutants_direct); + oq51_emissions_indirect_n2o(t,i,emis_source_n51,"level") = q51_emissions_indirect_n2o.l(i,emis_source_n51); + oq51_emissions_inorg_fert(t,i,n_pollutants_direct,"upper") = q51_emissions_inorg_fert.up(i,n_pollutants_direct); + oq51_emissions_man_crop(t,i,n_pollutants_direct,"upper") = q51_emissions_man_crop.up(i,n_pollutants_direct); + oq51_emissions_resid(t,i,n_pollutants_direct,"upper") = q51_emissions_resid.up(i,n_pollutants_direct); + oq51_emissions_som(t,i,n_pollutants_direct,"upper") = q51_emissions_som.up(i,n_pollutants_direct); + oq51_emissionbal_man_past(t,i,n_pollutants_direct,"upper") = q51_emissionbal_man_past.up(i,n_pollutants_direct); + oq51_emissionbal_awms(t,i,n_pollutants_direct,"upper") = q51_emissionbal_awms.up(i,n_pollutants_direct); + oq51_emissions_indirect_n2o(t,i,emis_source_n51,"upper") = q51_emissions_indirect_n2o.up(i,emis_source_n51); + oq51_emissions_inorg_fert(t,i,n_pollutants_direct,"lower") = q51_emissions_inorg_fert.lo(i,n_pollutants_direct); + oq51_emissions_man_crop(t,i,n_pollutants_direct,"lower") = q51_emissions_man_crop.lo(i,n_pollutants_direct); + oq51_emissions_resid(t,i,n_pollutants_direct,"lower") = q51_emissions_resid.lo(i,n_pollutants_direct); + oq51_emissions_som(t,i,n_pollutants_direct,"lower") = q51_emissions_som.lo(i,n_pollutants_direct); + oq51_emissionbal_man_past(t,i,n_pollutants_direct,"lower") = q51_emissionbal_man_past.lo(i,n_pollutants_direct); + oq51_emissionbal_awms(t,i,n_pollutants_direct,"lower") = q51_emissionbal_awms.lo(i,n_pollutants_direct); + oq51_emissions_indirect_n2o(t,i,emis_source_n51,"lower") = q51_emissions_indirect_n2o.lo(i,emis_source_n51); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/51_nitrogen/ipcc2006_sep16/preloop.gms b/modules/51_nitrogen/ipcc2006_sep16/preloop.gms index 7b2a346422..b361ded127 100644 --- a/modules/51_nitrogen/ipcc2006_sep16/preloop.gms +++ b/modules/51_nitrogen/ipcc2006_sep16/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/51_nitrogen/ipcc2006_sep16/presolve.gms b/modules/51_nitrogen/ipcc2006_sep16/presolve.gms index 957027f710..39cacee2f1 100644 --- a/modules/51_nitrogen/ipcc2006_sep16/presolve.gms +++ b/modules/51_nitrogen/ipcc2006_sep16/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/51_nitrogen/ipcc2006_sep16.gms b/modules/51_nitrogen/ipcc2006_sep16/realization.gms similarity index 80% rename from modules/51_nitrogen/ipcc2006_sep16.gms rename to modules/51_nitrogen/ipcc2006_sep16/realization.gms index ba576c1748..33e204f4fb 100644 --- a/modules/51_nitrogen/ipcc2006_sep16.gms +++ b/modules/51_nitrogen/ipcc2006_sep16/realization.gms @@ -1,28 +1,29 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description -*' The nitrogen module calculates nitrogeneous emissions before technical -*' mitigation, including N2O, NOx, NH3, NO3- and N2. -*' The model receives information on nitrogen flows from [50_nr_soil_budget], -*' [55_awms], [18_residues], [59_som], and it provides the emissions to the -*' module [56_ghg_policy]. -*' Emissions factors estimates are largely based on the IPCC 2006 Guidelines for -*' National Greenhouse Gas Inventories (@ipcc_2006_2006.), -*' as described in (@bodirsky_current_2012.). -*' -*' @authors Benjamin Leon Bodirsky - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/51_nitrogen/ipcc2006_sep16/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/51_nitrogen/ipcc2006_sep16/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/51_nitrogen/ipcc2006_sep16/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/51_nitrogen/ipcc2006_sep16/equations.gms" -$Ifi "%phase%" == "scaling" $include "./modules/51_nitrogen/ipcc2006_sep16/scaling.gms" -$Ifi "%phase%" == "preloop" $include "./modules/51_nitrogen/ipcc2006_sep16/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/51_nitrogen/ipcc2006_sep16/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/51_nitrogen/ipcc2006_sep16/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description +*' The nitrogen module calculates nitrogeneous emissions before technical +*' mitigation, including N2O, NOx, NH3, NO3- and N2. +*' The model receives information on nitrogen flows from [50_nr_soil_budget], +*' [55_awms], [18_residues], [59_som], and it provides the emissions to the +*' module [56_ghg_policy]. +*' Emissions factors estimates are largely based on the IPCC 2006 Guidelines for +*' National Greenhouse Gas Inventories (@ipcc_2006_2006.), +*' as described in (@bodirsky_current_2012.). +*' +*' @authors Benjamin Leon Bodirsky + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/51_nitrogen/ipcc2006_sep16/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/51_nitrogen/ipcc2006_sep16/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/51_nitrogen/ipcc2006_sep16/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/51_nitrogen/ipcc2006_sep16/equations.gms" +$Ifi "%phase%" == "scaling" $include "./modules/51_nitrogen/ipcc2006_sep16/scaling.gms" +$Ifi "%phase%" == "preloop" $include "./modules/51_nitrogen/ipcc2006_sep16/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/51_nitrogen/ipcc2006_sep16/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/51_nitrogen/ipcc2006_sep16/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/51_nitrogen/ipcc2006_sep16/scaling.gms b/modules/51_nitrogen/ipcc2006_sep16/scaling.gms index e69bd5a186..5963ccda1d 100644 --- a/modules/51_nitrogen/ipcc2006_sep16/scaling.gms +++ b/modules/51_nitrogen/ipcc2006_sep16/scaling.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/51_nitrogen/ipcc2006_sep16/sets.gms b/modules/51_nitrogen/ipcc2006_sep16/sets.gms index 2db83f0f87..153cb9ac5a 100644 --- a/modules/51_nitrogen/ipcc2006_sep16/sets.gms +++ b/modules/51_nitrogen/ipcc2006_sep16/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets diff --git a/modules/51_nitrogen/module.gms b/modules/51_nitrogen/module.gms new file mode 100644 index 0000000000..c3fef2d5fb --- /dev/null +++ b/modules/51_nitrogen/module.gms @@ -0,0 +1,17 @@ +*** | (C) 2008-2019 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 + +*' @title Nitrogen +*' @description +*' The nitrogen module calculates nitrogeneous emissions before technical +*' mitigation, including N2O, NOx, NH3, NO3- and N2. +*' @authors Benjamin Leon Bodirsky + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%nitrogen%" == "ipcc2006_sep16" $include "./modules/51_nitrogen/ipcc2006_sep16/realization.gms" +$Ifi "%nitrogen%" == "off" $include "./modules/51_nitrogen/off/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/51_nitrogen/off/declarations.gms b/modules/51_nitrogen/off/declarations.gms index af05be6d7d..e74568bcea 100644 --- a/modules/51_nitrogen/off/declarations.gms +++ b/modules/51_nitrogen/off/declarations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/51_nitrogen/off/not_used.txt b/modules/51_nitrogen/off/not_used.txt index 831aa6686b..ebd23a7554 100644 --- a/modules/51_nitrogen/off/not_used.txt +++ b/modules/51_nitrogen/off/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason vm_emissions_reg, input, no emission feedback on deposition diff --git a/modules/51_nitrogen/off/postsolve.gms b/modules/51_nitrogen/off/postsolve.gms index 7f2ff772c8..b16634c060 100644 --- a/modules/51_nitrogen/off/postsolve.gms +++ b/modules/51_nitrogen/off/postsolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/51_nitrogen/off/presolve.gms b/modules/51_nitrogen/off/presolve.gms index 101dbbc58c..67e4307fad 100644 --- a/modules/51_nitrogen/off/presolve.gms +++ b/modules/51_nitrogen/off/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de vm_btm_reg.fx(i,emis_source,n_pollutants) = 0; diff --git a/modules/51_nitrogen/off.gms b/modules/51_nitrogen/off/realization.gms similarity index 59% rename from modules/51_nitrogen/off.gms rename to modules/51_nitrogen/off/realization.gms index e235917368..2708bc3b3c 100644 --- a/modules/51_nitrogen/off.gms +++ b/modules/51_nitrogen/off/realization.gms @@ -1,16 +1,17 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description -*' Emissions are set to zero. -*' -*' @authors Benjamin Leon Bodirsky - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "declarations" $include "./modules/51_nitrogen/off/declarations.gms" -$Ifi "%phase%" == "presolve" $include "./modules/51_nitrogen/off/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/51_nitrogen/off/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description +*' Emissions are set to zero. +*' +*' @authors Benjamin Leon Bodirsky + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "declarations" $include "./modules/51_nitrogen/off/declarations.gms" +$Ifi "%phase%" == "presolve" $include "./modules/51_nitrogen/off/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/51_nitrogen/off/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/52_carbon/52_carbon.gms b/modules/52_carbon/module.gms similarity index 64% rename from modules/52_carbon/52_carbon.gms rename to modules/52_carbon/module.gms index 1754e88e49..bad3ab8d47 100644 --- a/modules/52_carbon/52_carbon.gms +++ b/modules/52_carbon/module.gms @@ -1,22 +1,23 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Carbon -*' -*' @description The carbon module provides annual land-related CO2 emissions for the -*' [56_ghg_policy] module. The carbon module provides carbon density information -*' on cellular level to all land modules ([30_crop], [31_past], [32_forestry], -*' [34_urban] and [35_natveg]), and in return it gets the current carbon stock -*' levels from respective land pools. The module also accounts for changes in -*' terrestrial carbon stocks cause by climate change effects on biosphere [45_climate]. -*' -*' -*' @authors Benjamin Leon Bodirsky, Florian Humpenoeder - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%carbon%" == "normal_dec17" $include "./modules/52_carbon/normal_dec17.gms" -$Ifi "%carbon%" == "off" $include "./modules/52_carbon/off.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Carbon +*' +*' @description The carbon module provides annual land-related CO2 emissions for the +*' [56_ghg_policy] module. The carbon module provides carbon density information +*' on cellular level to all land modules ([30_crop], [31_past], [32_forestry], +*' [34_urban] and [35_natveg]), and in return it gets the current carbon stock +*' levels from respective land pools. The module also accounts for changes in +*' terrestrial carbon stocks cause by climate change effects on biosphere [45_climate]. +*' +*' +*' @authors Benjamin Leon Bodirsky, Florian Humpenoeder + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%carbon%" == "normal_dec17" $include "./modules/52_carbon/normal_dec17/realization.gms" +$Ifi "%carbon%" == "off" $include "./modules/52_carbon/off/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/52_carbon/normal_dec17/declarations.gms b/modules/52_carbon/normal_dec17/declarations.gms index 791016e331..be9a85cfc0 100644 --- a/modules/52_carbon/normal_dec17/declarations.gms +++ b/modules/52_carbon/normal_dec17/declarations.gms @@ -1,37 +1,38 @@ -*** (C) 2008-2017 Potsdam Institute for Climate Impact Research (PIK), -*** authors, and contributors see AUTHORS file -*** This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** Contact: magpie@pik-potsdam.de - -variables - v52_carbon_stock_diff(j,land,c_pools) Change in carbon stocks compared to previous time step (mio. tC per time step) -; - -positive variables - vm_carbon_stock(j,land,c_pools) Carbon stock in vegetation soil and litter for different land types (mio. tC) - vm_carbon_stock_reduction(j,land,c_pools) Reduction in carbon stocks compared to previous time step (mio. tC per time step) -; - -parameters - pm_carbon_density_ac(t,j,ac,c_pools) Carbon density for age classes and carbon pools (tC per ha) - pcm_carbon_stock(j,land,c_pools) Current carbon in vegetation soil and litter for different land types (mio. tC) - pc52_carbon_density_start(t,j,c_pools) Carbon density for new land in other land pool (tC per ha) -; - -equations - q52_carbon_stock_diff(j,land,c_pools) Calculation net carbon stock change (mio. tC per time step) - q52_carbon_stock_reduction(j,land,c_pools) Calculation carbon stock reduction (mio. tC per time step) - q52_co2c_emis(j,emis_co2) Calculation of annual CO2 emissions (mio. tC per yr) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov52_carbon_stock_diff(t,j,land,c_pools,type) Change in carbon stocks compared to previous time step (mio. tC per time step) - ov_carbon_stock(t,j,land,c_pools,type) Carbon stock in vegetation soil and litter for different land types (mio. tC) - ov_carbon_stock_reduction(t,j,land,c_pools,type) Reduction in carbon stocks compared to previous time step (mio. tC per time step) - oq52_carbon_stock_diff(t,j,land,c_pools,type) Calculation net carbon stock change (mio. tC per time step) - oq52_carbon_stock_reduction(t,j,land,c_pools,type) Calculation carbon stock reduction (mio. tC per time step) - oq52_co2c_emis(t,j,emis_co2,type) Calculation of annual CO2 emissions (mio. tC per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 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 + +variables + v52_carbon_stock_diff(j,land,c_pools) Change in carbon stocks compared to previous time step (mio. tC per time step) +; + +positive variables + vm_carbon_stock(j,land,c_pools) Carbon stock in vegetation soil and litter for different land types (mio. tC) + vm_carbon_stock_reduction(j,land,c_pools) Reduction in carbon stocks compared to previous time step (mio. tC per time step) +; + +parameters + pm_carbon_density_ac(t,j,ac,c_pools) Carbon density for age classes and carbon pools (tC per ha) + pcm_carbon_stock(j,land,c_pools) Current carbon in vegetation soil and litter for different land types (mio. tC) + pc52_carbon_density_start(t,j,c_pools) Carbon density for new land in other land pool (tC per ha) +; + +equations + q52_carbon_stock_diff(j,land,c_pools) Calculation net carbon stock change (mio. tC per time step) + q52_carbon_stock_reduction(j,land,c_pools) Calculation carbon stock reduction (mio. tC per time step) + q52_co2c_emis(j,emis_co2) Calculation of annual CO2 emissions (mio. tC per yr) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov52_carbon_stock_diff(t,j,land,c_pools,type) Change in carbon stocks compared to previous time step (mio. tC per time step) + ov_carbon_stock(t,j,land,c_pools,type) Carbon stock in vegetation soil and litter for different land types (mio. tC) + ov_carbon_stock_reduction(t,j,land,c_pools,type) Reduction in carbon stocks compared to previous time step (mio. tC per time step) + oq52_carbon_stock_diff(t,j,land,c_pools,type) Calculation net carbon stock change (mio. tC per time step) + oq52_carbon_stock_reduction(t,j,land,c_pools,type) Calculation carbon stock reduction (mio. tC per time step) + oq52_co2c_emis(t,j,emis_co2,type) Calculation of annual CO2 emissions (mio. tC per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/52_carbon/normal_dec17/equations.gms b/modules/52_carbon/normal_dec17/equations.gms index c80d94b562..48379f5a8e 100644 --- a/modules/52_carbon/normal_dec17/equations.gms +++ b/modules/52_carbon/normal_dec17/equations.gms @@ -1,8 +1,9 @@ -*** (C) 2008-2017 Potsdam Institute for Climate Impact Research (PIK), -*** authors, and contributors see AUTHORS file -*** This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** Contact: magpie@pik-potsdam.de +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de *' @equations @@ -17,7 +18,7 @@ vm_carbon_stock_reduction(j2,land,c_pools) =g= pcm_carbon_stock(j2,land,c_pools) - vm_carbon_stock(j2,land,c_pools); -*' Annual CO2 emissions are obtained by dividing `v52_carbon_stock_diff` by +*' Annual CO2 emissions are obtained by dividing `v52_carbon_stock_diff` by *' time step length (e.g. 5 or 10 years). q52_co2c_emis(j2,emis_co2) .. diff --git a/modules/52_carbon/normal_dec17/input.gms b/modules/52_carbon/normal_dec17/input.gms index a240cc00d7..1b9a250020 100644 --- a/modules/52_carbon/normal_dec17/input.gms +++ b/modules/52_carbon/normal_dec17/input.gms @@ -1,23 +1,24 @@ -*** (C) 2008-2017 Potsdam Institute for Climate Impact Research (PIK), -*** authors, and contributors see AUTHORS file -*** This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** Contact: magpie@pik-potsdam.de - -$setglobal c52_carbon_scenario nocc -* options: cc (climate change) -* nocc (no climate change) - -table fm_carbon_density(t_all,j,land,c_pools) LPJmL carbon density for land and carbon pools (tC per ha) -$ondelim -$include "./modules/52_carbon/input/lpj_carbon_stocks.cs3" -$offdelim -; -$if "%c52_carbon_scenario%" == "nocc" fm_carbon_density(t_all,j,land,c_pools) = fm_carbon_density("y1995",j,land,c_pools); -m_fillmissingyears(fm_carbon_density,"j,land,c_pools"); - -table f52_growth_par(clcl,chap_par) Parameters for chapman-richards equation (1) -$ondelim -$include "./modules/52_carbon/input/f52_growth_par.csv" -$offdelim -; +*** | (C) 2008-2019 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 + +$setglobal c52_carbon_scenario nocc +* options: cc (climate change) +* nocc (no climate change) + +table fm_carbon_density(t_all,j,land,c_pools) LPJmL carbon density for land and carbon pools (tC per ha) +$ondelim +$include "./modules/52_carbon/input/lpj_carbon_stocks.cs3" +$offdelim +; +$if "%c52_carbon_scenario%" == "nocc" fm_carbon_density(t_all,j,land,c_pools) = fm_carbon_density("y1995",j,land,c_pools); +m_fillmissingyears(fm_carbon_density,"j,land,c_pools"); + +table f52_growth_par(clcl,chap_par) Parameters for chapman-richards equation (1) +$ondelim +$include "./modules/52_carbon/input/f52_growth_par.csv" +$offdelim +; diff --git a/modules/52_carbon/normal_dec17/postsolve.gms b/modules/52_carbon/normal_dec17/postsolve.gms index 5d2df3865c..e91ec95b78 100644 --- a/modules/52_carbon/normal_dec17/postsolve.gms +++ b/modules/52_carbon/normal_dec17/postsolve.gms @@ -1,34 +1,35 @@ -*** (C) 2008-2017 Potsdam Institute for Climate Impact Research (PIK), -*** authors, and contributors see AUTHORS file -*** This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** Contact: magpie@pik-potsdam.de - -pcm_carbon_stock(j,land,c_pools) = vm_carbon_stock.l(j,land,c_pools); - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov52_carbon_stock_diff(t,j,land,c_pools,"marginal") = v52_carbon_stock_diff.m(j,land,c_pools); - ov_carbon_stock(t,j,land,c_pools,"marginal") = vm_carbon_stock.m(j,land,c_pools); - ov_carbon_stock_reduction(t,j,land,c_pools,"marginal") = vm_carbon_stock_reduction.m(j,land,c_pools); - oq52_carbon_stock_diff(t,j,land,c_pools,"marginal") = q52_carbon_stock_diff.m(j,land,c_pools); - oq52_carbon_stock_reduction(t,j,land,c_pools,"marginal") = q52_carbon_stock_reduction.m(j,land,c_pools); - oq52_co2c_emis(t,j,emis_co2,"marginal") = q52_co2c_emis.m(j,emis_co2); - ov52_carbon_stock_diff(t,j,land,c_pools,"level") = v52_carbon_stock_diff.l(j,land,c_pools); - ov_carbon_stock(t,j,land,c_pools,"level") = vm_carbon_stock.l(j,land,c_pools); - ov_carbon_stock_reduction(t,j,land,c_pools,"level") = vm_carbon_stock_reduction.l(j,land,c_pools); - oq52_carbon_stock_diff(t,j,land,c_pools,"level") = q52_carbon_stock_diff.l(j,land,c_pools); - oq52_carbon_stock_reduction(t,j,land,c_pools,"level") = q52_carbon_stock_reduction.l(j,land,c_pools); - oq52_co2c_emis(t,j,emis_co2,"level") = q52_co2c_emis.l(j,emis_co2); - ov52_carbon_stock_diff(t,j,land,c_pools,"upper") = v52_carbon_stock_diff.up(j,land,c_pools); - ov_carbon_stock(t,j,land,c_pools,"upper") = vm_carbon_stock.up(j,land,c_pools); - ov_carbon_stock_reduction(t,j,land,c_pools,"upper") = vm_carbon_stock_reduction.up(j,land,c_pools); - oq52_carbon_stock_diff(t,j,land,c_pools,"upper") = q52_carbon_stock_diff.up(j,land,c_pools); - oq52_carbon_stock_reduction(t,j,land,c_pools,"upper") = q52_carbon_stock_reduction.up(j,land,c_pools); - oq52_co2c_emis(t,j,emis_co2,"upper") = q52_co2c_emis.up(j,emis_co2); - ov52_carbon_stock_diff(t,j,land,c_pools,"lower") = v52_carbon_stock_diff.lo(j,land,c_pools); - ov_carbon_stock(t,j,land,c_pools,"lower") = vm_carbon_stock.lo(j,land,c_pools); - ov_carbon_stock_reduction(t,j,land,c_pools,"lower") = vm_carbon_stock_reduction.lo(j,land,c_pools); - oq52_carbon_stock_diff(t,j,land,c_pools,"lower") = q52_carbon_stock_diff.lo(j,land,c_pools); - oq52_carbon_stock_reduction(t,j,land,c_pools,"lower") = q52_carbon_stock_reduction.lo(j,land,c_pools); - oq52_co2c_emis(t,j,emis_co2,"lower") = q52_co2c_emis.lo(j,emis_co2); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 + +pcm_carbon_stock(j,land,c_pools) = vm_carbon_stock.l(j,land,c_pools); + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov52_carbon_stock_diff(t,j,land,c_pools,"marginal") = v52_carbon_stock_diff.m(j,land,c_pools); + ov_carbon_stock(t,j,land,c_pools,"marginal") = vm_carbon_stock.m(j,land,c_pools); + ov_carbon_stock_reduction(t,j,land,c_pools,"marginal") = vm_carbon_stock_reduction.m(j,land,c_pools); + oq52_carbon_stock_diff(t,j,land,c_pools,"marginal") = q52_carbon_stock_diff.m(j,land,c_pools); + oq52_carbon_stock_reduction(t,j,land,c_pools,"marginal") = q52_carbon_stock_reduction.m(j,land,c_pools); + oq52_co2c_emis(t,j,emis_co2,"marginal") = q52_co2c_emis.m(j,emis_co2); + ov52_carbon_stock_diff(t,j,land,c_pools,"level") = v52_carbon_stock_diff.l(j,land,c_pools); + ov_carbon_stock(t,j,land,c_pools,"level") = vm_carbon_stock.l(j,land,c_pools); + ov_carbon_stock_reduction(t,j,land,c_pools,"level") = vm_carbon_stock_reduction.l(j,land,c_pools); + oq52_carbon_stock_diff(t,j,land,c_pools,"level") = q52_carbon_stock_diff.l(j,land,c_pools); + oq52_carbon_stock_reduction(t,j,land,c_pools,"level") = q52_carbon_stock_reduction.l(j,land,c_pools); + oq52_co2c_emis(t,j,emis_co2,"level") = q52_co2c_emis.l(j,emis_co2); + ov52_carbon_stock_diff(t,j,land,c_pools,"upper") = v52_carbon_stock_diff.up(j,land,c_pools); + ov_carbon_stock(t,j,land,c_pools,"upper") = vm_carbon_stock.up(j,land,c_pools); + ov_carbon_stock_reduction(t,j,land,c_pools,"upper") = vm_carbon_stock_reduction.up(j,land,c_pools); + oq52_carbon_stock_diff(t,j,land,c_pools,"upper") = q52_carbon_stock_diff.up(j,land,c_pools); + oq52_carbon_stock_reduction(t,j,land,c_pools,"upper") = q52_carbon_stock_reduction.up(j,land,c_pools); + oq52_co2c_emis(t,j,emis_co2,"upper") = q52_co2c_emis.up(j,emis_co2); + ov52_carbon_stock_diff(t,j,land,c_pools,"lower") = v52_carbon_stock_diff.lo(j,land,c_pools); + ov_carbon_stock(t,j,land,c_pools,"lower") = vm_carbon_stock.lo(j,land,c_pools); + ov_carbon_stock_reduction(t,j,land,c_pools,"lower") = vm_carbon_stock_reduction.lo(j,land,c_pools); + oq52_carbon_stock_diff(t,j,land,c_pools,"lower") = q52_carbon_stock_diff.lo(j,land,c_pools); + oq52_carbon_stock_reduction(t,j,land,c_pools,"lower") = q52_carbon_stock_reduction.lo(j,land,c_pools); + oq52_co2c_emis(t,j,emis_co2,"lower") = q52_co2c_emis.lo(j,emis_co2); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/52_carbon/normal_dec17/preloop.gms b/modules/52_carbon/normal_dec17/preloop.gms index 4c8aa655b0..b782b07c8e 100644 --- a/modules/52_carbon/normal_dec17/preloop.gms +++ b/modules/52_carbon/normal_dec17/preloop.gms @@ -1,8 +1,9 @@ -*** (C) 2008-2017 Potsdam Institute for Climate Impact Research (PIK), -*** authors, and contributors see AUTHORS file -*** This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** Contact: magpie@pik-potsdam.de +*** | (C) 2008-2019 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 * starting value of carbon stocks 1995 is only an estimate. diff --git a/modules/52_carbon/normal_dec17.gms b/modules/52_carbon/normal_dec17/realization.gms similarity index 80% rename from modules/52_carbon/normal_dec17.gms rename to modules/52_carbon/normal_dec17/realization.gms index 905ebe8b20..f092040919 100644 --- a/modules/52_carbon/normal_dec17.gms +++ b/modules/52_carbon/normal_dec17/realization.gms @@ -1,30 +1,31 @@ -*** (C) 2008-2017 Potsdam Institute for Climate Impact Research (PIK), -*** authors, and contributors see AUTHORS file -*** This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** Contact: magpie@pik-potsdam.de - -*' @description This realization -*' calculates annual land-related CO2 emissions as -*' difference of carbon stocks between the current and the previous time step. -*' Land-related CO2 emissions include CO2 emissions from land-use change as well as -*' changes in carbon stocks in the terrestrial biosphere due to climate change -*' (the later is only included if `c52_carbon_scenario = "cc"`). -*' The realization provides carbon density information on cellular level to all -*' land modules ([30_crop], [31_past], [32_forestry], [34_urban] and [35_natveg]), -*' which return land type specific carbon stocks to the carbon module. The realization -*' also provides carbon density for different age-classes, based on a -*' chapman-richards volume growth model, to the land modules [32_forestry] and [35_natveg] -*' [@humpenoder_investigating_2014]. - -*' @limitations CO2 emissions in the 1st time step (1995) are not meaningful because -*' carbon stock information prior to 1995 is not available - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "declarations" $include "./modules/52_carbon/normal_dec17/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/52_carbon/normal_dec17/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/52_carbon/normal_dec17/equations.gms" -$Ifi "%phase%" == "scaling" $include "./modules/52_carbon/normal_dec17/scaling.gms" -$Ifi "%phase%" == "preloop" $include "./modules/52_carbon/normal_dec17/preloop.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/52_carbon/normal_dec17/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description This realization +*' calculates annual land-related CO2 emissions as +*' difference of carbon stocks between the current and the previous time step. +*' Land-related CO2 emissions include CO2 emissions from land-use change as well as +*' changes in carbon stocks in the terrestrial biosphere due to climate change +*' (the later is only included if `c52_carbon_scenario = "cc"`). +*' The realization provides carbon density information on cellular level to all +*' land modules ([30_crop], [31_past], [32_forestry], [34_urban] and [35_natveg]), +*' which return land type specific carbon stocks to the carbon module. The realization +*' also provides carbon density for different age-classes, based on a +*' chapman-richards volume growth model, to the land modules [32_forestry] and [35_natveg] +*' [@humpenoder_investigating_2014]. + +*' @limitations CO2 emissions in the 1st time step (1995) are not meaningful because +*' carbon stock information prior to 1995 is not available + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "declarations" $include "./modules/52_carbon/normal_dec17/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/52_carbon/normal_dec17/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/52_carbon/normal_dec17/equations.gms" +$Ifi "%phase%" == "scaling" $include "./modules/52_carbon/normal_dec17/scaling.gms" +$Ifi "%phase%" == "preloop" $include "./modules/52_carbon/normal_dec17/preloop.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/52_carbon/normal_dec17/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/52_carbon/normal_dec17/scaling.gms b/modules/52_carbon/normal_dec17/scaling.gms index fc80e71dce..3168a7d3ce 100644 --- a/modules/52_carbon/normal_dec17/scaling.gms +++ b/modules/52_carbon/normal_dec17/scaling.gms @@ -1,7 +1,8 @@ -*** (C) 2008-2017 Potsdam Institute for Climate Impact Research (PIK), -*** authors, and contributors see AUTHORS file -*** This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** Contact: magpie@pik-potsdam.de +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de vm_carbon_stock.scale(j,land,c_pools) = 10e3; diff --git a/modules/52_carbon/off/declarations.gms b/modules/52_carbon/off/declarations.gms index 8dde8bb6ce..1c4279b693 100644 --- a/modules/52_carbon/off/declarations.gms +++ b/modules/52_carbon/off/declarations.gms @@ -1,23 +1,24 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -* Here you can put your additional declarations -parameters - pm_carbon_density_ac(t,j,ac,c_pools) Carbon density for ac and c_pools (tC per ha) - pcm_carbon_stock(j,land,c_pools) Current carbon in vegetation soil and litter for different land types (mio tC) -; - -positive variables - vm_carbon_stock(j,land,c_pools) Carbon in vegetation soil and litter for different land types (mio tC) - vm_carbon_stock_reduction(j,land,c_pools) Reduction in carbon stocks compared to previous time step (mio tC per time step) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_carbon_stock(t,j,land,c_pools,type) Carbon in vegetation soil and litter for different land types (mio tC) - ov_carbon_stock_reduction(t,j,land,c_pools,type) Reduction in carbon stocks compared to previous time step (mio tC per time step) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 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 + +* Here you can put your additional declarations +parameters + pm_carbon_density_ac(t,j,ac,c_pools) Carbon density for ac and c_pools (tC per ha) + pcm_carbon_stock(j,land,c_pools) Current carbon in vegetation soil and litter for different land types (mio tC) +; + +positive variables + vm_carbon_stock(j,land,c_pools) Carbon in vegetation soil and litter for different land types (mio tC) + vm_carbon_stock_reduction(j,land,c_pools) Reduction in carbon stocks compared to previous time step (mio tC per time step) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_carbon_stock(t,j,land,c_pools,type) Carbon in vegetation soil and litter for different land types (mio tC) + ov_carbon_stock_reduction(t,j,land,c_pools,type) Reduction in carbon stocks compared to previous time step (mio tC per time step) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/52_carbon/off/input.gms b/modules/52_carbon/off/input.gms index ce06b40ed9..375f6a7225 100644 --- a/modules/52_carbon/off/input.gms +++ b/modules/52_carbon/off/input.gms @@ -1,17 +1,18 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -$setglobal c52_carbon_scenario nocc -* options: cc (climate change) -* nocc (no climate change) - -table fm_carbon_density(t_all,j,land,c_pools) LPJmL carbon density for land and carbon pools (tC per ha) -$ondelim -$include "./modules/52_carbon/input/lpj_carbon_stocks.cs3" -$offdelim -; -$if "%c52_carbon_scenario%" == "nocc" fm_carbon_density(t_all,j,land,c_pools) = fm_carbon_density("y1995",j,land,c_pools); -m_fillmissingyears(fm_carbon_density,"j,land,c_pools"); +*** | (C) 2008-2019 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 + +$setglobal c52_carbon_scenario nocc +* options: cc (climate change) +* nocc (no climate change) + +table fm_carbon_density(t_all,j,land,c_pools) LPJmL carbon density for land and carbon pools (tC per ha) +$ondelim +$include "./modules/52_carbon/input/lpj_carbon_stocks.cs3" +$offdelim +; +$if "%c52_carbon_scenario%" == "nocc" fm_carbon_density(t_all,j,land,c_pools) = fm_carbon_density("y1995",j,land,c_pools); +m_fillmissingyears(fm_carbon_density,"j,land,c_pools"); diff --git a/modules/52_carbon/off/not_used.txt b/modules/52_carbon/off/not_used.txt index bb312801d2..4cb56f7ef2 100644 --- a/modules/52_carbon/off/not_used.txt +++ b/modules/52_carbon/off/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason pm_climate_class,input,not needed diff --git a/modules/52_carbon/off/postsolve.gms b/modules/52_carbon/off/postsolve.gms index ffb662be9b..2d4d366cdc 100644 --- a/modules/52_carbon/off/postsolve.gms +++ b/modules/52_carbon/off/postsolve.gms @@ -1,18 +1,19 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_carbon_stock(t,j,land,c_pools,"marginal") = vm_carbon_stock.m(j,land,c_pools); - ov_carbon_stock_reduction(t,j,land,c_pools,"marginal") = vm_carbon_stock_reduction.m(j,land,c_pools); - ov_carbon_stock(t,j,land,c_pools,"level") = vm_carbon_stock.l(j,land,c_pools); - ov_carbon_stock_reduction(t,j,land,c_pools,"level") = vm_carbon_stock_reduction.l(j,land,c_pools); - ov_carbon_stock(t,j,land,c_pools,"upper") = vm_carbon_stock.up(j,land,c_pools); - ov_carbon_stock_reduction(t,j,land,c_pools,"upper") = vm_carbon_stock_reduction.up(j,land,c_pools); - ov_carbon_stock(t,j,land,c_pools,"lower") = vm_carbon_stock.lo(j,land,c_pools); - ov_carbon_stock_reduction(t,j,land,c_pools,"lower") = vm_carbon_stock_reduction.lo(j,land,c_pools); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - +*** | (C) 2008-2019 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 + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_carbon_stock(t,j,land,c_pools,"marginal") = vm_carbon_stock.m(j,land,c_pools); + ov_carbon_stock_reduction(t,j,land,c_pools,"marginal") = vm_carbon_stock_reduction.m(j,land,c_pools); + ov_carbon_stock(t,j,land,c_pools,"level") = vm_carbon_stock.l(j,land,c_pools); + ov_carbon_stock_reduction(t,j,land,c_pools,"level") = vm_carbon_stock_reduction.l(j,land,c_pools); + ov_carbon_stock(t,j,land,c_pools,"upper") = vm_carbon_stock.up(j,land,c_pools); + ov_carbon_stock_reduction(t,j,land,c_pools,"upper") = vm_carbon_stock_reduction.up(j,land,c_pools); + ov_carbon_stock(t,j,land,c_pools,"lower") = vm_carbon_stock.lo(j,land,c_pools); + ov_carbon_stock_reduction(t,j,land,c_pools,"lower") = vm_carbon_stock_reduction.lo(j,land,c_pools); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### + diff --git a/modules/52_carbon/off/preloop.gms b/modules/52_carbon/off/preloop.gms index 8686f357fc..aad4eaba4d 100644 --- a/modules/52_carbon/off/preloop.gms +++ b/modules/52_carbon/off/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 pm_carbon_density_ac(t,j,ac,c_pools) = 0; diff --git a/modules/52_carbon/off/presolve.gms b/modules/52_carbon/off/presolve.gms index 30ae33fa26..26a18738e9 100644 --- a/modules/52_carbon/off/presolve.gms +++ b/modules/52_carbon/off/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de vm_carbon_stock.fx(j,land,c_pools) = 0; diff --git a/modules/52_carbon/off.gms b/modules/52_carbon/off/realization.gms similarity index 66% rename from modules/52_carbon/off.gms rename to modules/52_carbon/off/realization.gms index 6af845655b..5305a25756 100644 --- a/modules/52_carbon/off.gms +++ b/modules/52_carbon/off/realization.gms @@ -1,18 +1,19 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description In this realization -*' annual land-related CO2 emissions are assumed zero. - -*' @limitations CO2 emissions are assumed zero - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "declarations" $include "./modules/52_carbon/off/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/52_carbon/off/input.gms" -$Ifi "%phase%" == "preloop" $include "./modules/52_carbon/off/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/52_carbon/off/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/52_carbon/off/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description In this realization +*' annual land-related CO2 emissions are assumed zero. + +*' @limitations CO2 emissions are assumed zero + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "declarations" $include "./modules/52_carbon/off/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/52_carbon/off/input.gms" +$Ifi "%phase%" == "preloop" $include "./modules/52_carbon/off/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/52_carbon/off/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/52_carbon/off/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/53_methane/53_methane.gms b/modules/53_methane/53_methane.gms deleted file mode 100644 index a10e21eb49..0000000000 --- a/modules/53_methane/53_methane.gms +++ /dev/null @@ -1,18 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Methane - -*' @description This module calculates methane emissions according -*' to 2006 IPCC Guidelines of National Greenhouse Gas Inventories. -*' See also @ipcc_2006_2006. - -*' @authors Benjamin Leon Bodirsky - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%methane%" == "ipcc2006_flexreg_apr16" $include "./modules/53_methane/ipcc2006_flexreg_apr16.gms" -$Ifi "%methane%" == "off" $include "./modules/53_methane/off.gms" -*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/53_methane/ipcc2006_flexreg_apr16/declarations.gms b/modules/53_methane/ipcc2006_flexreg_apr16/declarations.gms index 4418302a1d..a35dcf0305 100644 --- a/modules/53_methane/ipcc2006_flexreg_apr16/declarations.gms +++ b/modules/53_methane/ipcc2006_flexreg_apr16/declarations.gms @@ -1,20 +1,21 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -equations - q53_emissionbal_ch4_ent_ferm(i) Detailed ch4 constraint for enteric fermentation before technical mitigation (tCH4) - q53_emissionbal_ch4_awms(i) Detailed ch4 constraint for animal waste management systems before technical mitigation (tCH4) - q53_emissionbal_ch4_rice(i) Detailed ch4 constraint for rice before technical mitigation (tCH4) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - oq53_emissionbal_ch4_ent_ferm(t,i,type) Detailed ch4 constraint for enteric fermentation before technical mitigation (tCH4) - oq53_emissionbal_ch4_awms(t,i,type) Detailed ch4 constraint for animal waste management systems before technical mitigation (tCH4) - oq53_emissionbal_ch4_rice(t,i,type) Detailed ch4 constraint for rice before technical mitigation (tCH4) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + +equations + q53_emissionbal_ch4_ent_ferm(i) Detailed ch4 constraint for enteric fermentation before technical mitigation (tCH4) + q53_emissionbal_ch4_awms(i) Detailed ch4 constraint for animal waste management systems before technical mitigation (tCH4) + q53_emissionbal_ch4_rice(i) Detailed ch4 constraint for rice before technical mitigation (tCH4) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + oq53_emissionbal_ch4_ent_ferm(t,i,type) Detailed ch4 constraint for enteric fermentation before technical mitigation (tCH4) + oq53_emissionbal_ch4_awms(t,i,type) Detailed ch4 constraint for animal waste management systems before technical mitigation (tCH4) + oq53_emissionbal_ch4_rice(t,i,type) Detailed ch4 constraint for rice before technical mitigation (tCH4) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/53_methane/ipcc2006_flexreg_apr16/equations.gms b/modules/53_methane/ipcc2006_flexreg_apr16/equations.gms index bc8706dbb4..08e67c8fa1 100644 --- a/modules/53_methane/ipcc2006_flexreg_apr16/equations.gms +++ b/modules/53_methane/ipcc2006_flexreg_apr16/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations diff --git a/modules/53_methane/ipcc2006_flexreg_apr16/input.gms b/modules/53_methane/ipcc2006_flexreg_apr16/input.gms index bdf1b997c4..429491a3d4 100644 --- a/modules/53_methane/ipcc2006_flexreg_apr16/input.gms +++ b/modules/53_methane/ipcc2006_flexreg_apr16/input.gms @@ -1,21 +1,22 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -parameter f53_ef_ch4_awms(t_all,i,kli) CH4 emission per livestock products (CH4 per tDM) -/ -$ondelim -$include "./modules/53_methane/input/f53_EFch4AWMS.cs4" -$offdelim -/ -; - -parameter f53_ef_ch4_rice(t_all,i) CH4 emission per ha rice (CH4 per ha) - / -$ondelim -$include "./modules/53_methane/input/f53_EFch4Rice.cs4" -$offdelim - / -; +*** | (C) 2008-2019 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 + +parameter f53_ef_ch4_awms(t_all,i,kli) CH4 emission per livestock products (CH4 per tDM) +/ +$ondelim +$include "./modules/53_methane/input/f53_EFch4AWMS.cs4" +$offdelim +/ +; + +parameter f53_ef_ch4_rice(t_all,i) CH4 emission per ha rice (CH4 per ha) + / +$ondelim +$include "./modules/53_methane/input/f53_EFch4Rice.cs4" +$offdelim + / +; diff --git a/modules/53_methane/ipcc2006_flexreg_apr16/postsolve.gms b/modules/53_methane/ipcc2006_flexreg_apr16/postsolve.gms index 18a1273438..80e713c647 100644 --- a/modules/53_methane/ipcc2006_flexreg_apr16/postsolve.gms +++ b/modules/53_methane/ipcc2006_flexreg_apr16/postsolve.gms @@ -1,23 +1,24 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - oq53_emissionbal_ch4_ent_ferm(t,i,"marginal") = q53_emissionbal_ch4_ent_ferm.m(i); - oq53_emissionbal_ch4_awms(t,i,"marginal") = q53_emissionbal_ch4_awms.m(i); - oq53_emissionbal_ch4_rice(t,i,"marginal") = q53_emissionbal_ch4_rice.m(i); - oq53_emissionbal_ch4_ent_ferm(t,i,"level") = q53_emissionbal_ch4_ent_ferm.l(i); - oq53_emissionbal_ch4_awms(t,i,"level") = q53_emissionbal_ch4_awms.l(i); - oq53_emissionbal_ch4_rice(t,i,"level") = q53_emissionbal_ch4_rice.l(i); - oq53_emissionbal_ch4_ent_ferm(t,i,"upper") = q53_emissionbal_ch4_ent_ferm.up(i); - oq53_emissionbal_ch4_awms(t,i,"upper") = q53_emissionbal_ch4_awms.up(i); - oq53_emissionbal_ch4_rice(t,i,"upper") = q53_emissionbal_ch4_rice.up(i); - oq53_emissionbal_ch4_ent_ferm(t,i,"lower") = q53_emissionbal_ch4_ent_ferm.lo(i); - oq53_emissionbal_ch4_awms(t,i,"lower") = q53_emissionbal_ch4_awms.lo(i); - oq53_emissionbal_ch4_rice(t,i,"lower") = q53_emissionbal_ch4_rice.lo(i); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - +*** | (C) 2008-2019 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 + + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + oq53_emissionbal_ch4_ent_ferm(t,i,"marginal") = q53_emissionbal_ch4_ent_ferm.m(i); + oq53_emissionbal_ch4_awms(t,i,"marginal") = q53_emissionbal_ch4_awms.m(i); + oq53_emissionbal_ch4_rice(t,i,"marginal") = q53_emissionbal_ch4_rice.m(i); + oq53_emissionbal_ch4_ent_ferm(t,i,"level") = q53_emissionbal_ch4_ent_ferm.l(i); + oq53_emissionbal_ch4_awms(t,i,"level") = q53_emissionbal_ch4_awms.l(i); + oq53_emissionbal_ch4_rice(t,i,"level") = q53_emissionbal_ch4_rice.l(i); + oq53_emissionbal_ch4_ent_ferm(t,i,"upper") = q53_emissionbal_ch4_ent_ferm.up(i); + oq53_emissionbal_ch4_awms(t,i,"upper") = q53_emissionbal_ch4_awms.up(i); + oq53_emissionbal_ch4_rice(t,i,"upper") = q53_emissionbal_ch4_rice.up(i); + oq53_emissionbal_ch4_ent_ferm(t,i,"lower") = q53_emissionbal_ch4_ent_ferm.lo(i); + oq53_emissionbal_ch4_awms(t,i,"lower") = q53_emissionbal_ch4_awms.lo(i); + oq53_emissionbal_ch4_rice(t,i,"lower") = q53_emissionbal_ch4_rice.lo(i); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### + diff --git a/modules/53_methane/ipcc2006_flexreg_apr16/preloop.gms b/modules/53_methane/ipcc2006_flexreg_apr16/preloop.gms index 7b2a346422..b361ded127 100644 --- a/modules/53_methane/ipcc2006_flexreg_apr16/preloop.gms +++ b/modules/53_methane/ipcc2006_flexreg_apr16/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/53_methane/ipcc2006_flexreg_apr16/presolve.gms b/modules/53_methane/ipcc2006_flexreg_apr16/presolve.gms index cd784d6afa..08cdf7de43 100644 --- a/modules/53_methane/ipcc2006_flexreg_apr16/presolve.gms +++ b/modules/53_methane/ipcc2006_flexreg_apr16/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de vm_btm_reg.fx(i,emis_source_nomethane53,"ch4") = 0; diff --git a/modules/53_methane/ipcc2006_flexreg_apr16.gms b/modules/53_methane/ipcc2006_flexreg_apr16/realization.gms similarity index 77% rename from modules/53_methane/ipcc2006_flexreg_apr16.gms rename to modules/53_methane/ipcc2006_flexreg_apr16/realization.gms index 02d9af06fa..579056b4e6 100644 --- a/modules/53_methane/ipcc2006_flexreg_apr16.gms +++ b/modules/53_methane/ipcc2006_flexreg_apr16/realization.gms @@ -1,23 +1,24 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description This module realization calculates methane from different -*' agricultural sources based on the @ipcc_2006_2006. -*' Methane emission sources considered in the module are enteric fermentation, -*' animal waste management, and rice. - -*' @limitations CH4 emissions from animal waste management may be -*' inconsistent with CH4 emissions from enteric fermentation. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/53_methane/ipcc2006_flexreg_apr16/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/53_methane/ipcc2006_flexreg_apr16/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/53_methane/ipcc2006_flexreg_apr16/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/53_methane/ipcc2006_flexreg_apr16/equations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/53_methane/ipcc2006_flexreg_apr16/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/53_methane/ipcc2006_flexreg_apr16/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/53_methane/ipcc2006_flexreg_apr16/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description This module realization calculates methane from different +*' agricultural sources based on the @ipcc_2006_2006. +*' Methane emission sources considered in the module are enteric fermentation, +*' animal waste management, and rice. + +*' @limitations CH4 emissions from animal waste management may be +*' inconsistent with CH4 emissions from enteric fermentation. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/53_methane/ipcc2006_flexreg_apr16/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/53_methane/ipcc2006_flexreg_apr16/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/53_methane/ipcc2006_flexreg_apr16/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/53_methane/ipcc2006_flexreg_apr16/equations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/53_methane/ipcc2006_flexreg_apr16/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/53_methane/ipcc2006_flexreg_apr16/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/53_methane/ipcc2006_flexreg_apr16/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/53_methane/ipcc2006_flexreg_apr16/sets.gms b/modules/53_methane/ipcc2006_flexreg_apr16/sets.gms index 94237a9131..caf213575f 100644 --- a/modules/53_methane/ipcc2006_flexreg_apr16/sets.gms +++ b/modules/53_methane/ipcc2006_flexreg_apr16/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets diff --git a/modules/53_methane/module.gms b/modules/53_methane/module.gms new file mode 100644 index 0000000000..1cc9948c96 --- /dev/null +++ b/modules/53_methane/module.gms @@ -0,0 +1,19 @@ +*** | (C) 2008-2019 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 + +*' @title Methane + +*' @description This module calculates methane emissions according +*' to 2006 IPCC Guidelines of National Greenhouse Gas Inventories. +*' See also @ipcc_2006_2006. + +*' @authors Benjamin Leon Bodirsky + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%methane%" == "ipcc2006_flexreg_apr16" $include "./modules/53_methane/ipcc2006_flexreg_apr16/realization.gms" +$Ifi "%methane%" == "off" $include "./modules/53_methane/off/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/53_methane/off/not_used.txt b/modules/53_methane/off/not_used.txt index dd5edad418..41907e68e8 100644 --- a/modules/53_methane/off/not_used.txt +++ b/modules/53_methane/off/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason diff --git a/modules/53_methane/off/presolve.gms b/modules/53_methane/off/presolve.gms index e69f24d36f..145fb01de6 100644 --- a/modules/53_methane/off/presolve.gms +++ b/modules/53_methane/off/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 *' @code diff --git a/modules/53_methane/off.gms b/modules/53_methane/off/realization.gms similarity index 66% rename from modules/53_methane/off.gms rename to modules/53_methane/off/realization.gms index 5795049b56..4eec2e4018 100644 --- a/modules/53_methane/off.gms +++ b/modules/53_methane/off/realization.gms @@ -1,16 +1,17 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description This realization is simple and accounts no methane emissions. -*' We acknowledge this is unrealistic. It is presented here for mere comparison and completeness. -*' -*' @limitations It is unrealistic to consider zero methane emissions and to ignore it from a model -*' such as MAgPIE which is meant to assess impacts of agricultural production on environment. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/53_methane/off/sets.gms" -$Ifi "%phase%" == "presolve" $include "./modules/53_methane/off/presolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description This realization is simple and accounts no methane emissions. +*' We acknowledge this is unrealistic. It is presented here for mere comparison and completeness. +*' +*' @limitations It is unrealistic to consider zero methane emissions and to ignore it from a model +*' such as MAgPIE which is meant to assess impacts of agricultural production on environment. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/53_methane/off/sets.gms" +$Ifi "%phase%" == "presolve" $include "./modules/53_methane/off/presolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/53_methane/off/sets.gms b/modules/53_methane/off/sets.gms index 27934723c4..e9b4d1b843 100644 --- a/modules/53_methane/off/sets.gms +++ b/modules/53_methane/off/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets diff --git a/modules/54_phosphorus/54_phosphorus.gms b/modules/54_phosphorus/module.gms similarity index 79% rename from modules/54_phosphorus/54_phosphorus.gms rename to modules/54_phosphorus/module.gms index fa3a8fad2e..06176e67cc 100644 --- a/modules/54_phosphorus/54_phosphorus.gms +++ b/modules/54_phosphorus/module.gms @@ -1,33 +1,34 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Phosphorus -*' -*' @description The phosphorus module is introduced to estimate the major -*' P-flows in the agricultural sector and to determine the dynamics of P-Pools in the soil. -*' Different P-flows can be accounted in MAgPIE, among others: -*' -*' * P withdrawals by harvest: estimated as P content of crop harvest -*' * P withdrawals by harvest of above ground residues: estimated as P content of residues -*' * P inputs by decaying recycled residues: estimated as P content of recycled residues -*' * P inputs by burned residues: estimated as P content of burned residues but no combustion losses assumed -*' * P inputs by manure recycled to croplands -*' * P inputs by fertilizers -*' * P inputs by release of plant-available P from the permanent P-Pool. -*' * P inputs by seed -*' * P inputs by weathering -*' * P losses by erosion -*' * P losses by leaching -*' -*' However, for the time being, this module is not activated in MAgPIE. -*' It is a topic we seek to include in future developments of the model as enriches -*' the biophysical aspects of the model as well as adds to the fertilizer costs (and hence total costs of production). -*' -*' @authors Benjamin Leon Bodirsky - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%phosphorus%" == "off" $include "./modules/54_phosphorus/off.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Phosphorus +*' +*' @description The phosphorus module is introduced to estimate the major +*' P-flows in the agricultural sector and to determine the dynamics of P-Pools in the soil. +*' Different P-flows can be accounted in MAgPIE, among others: +*' +*' * P withdrawals by harvest: estimated as P content of crop harvest +*' * P withdrawals by harvest of above ground residues: estimated as P content of residues +*' * P inputs by decaying recycled residues: estimated as P content of recycled residues +*' * P inputs by burned residues: estimated as P content of burned residues but no combustion losses assumed +*' * P inputs by manure recycled to croplands +*' * P inputs by fertilizers +*' * P inputs by release of plant-available P from the permanent P-Pool. +*' * P inputs by seed +*' * P inputs by weathering +*' * P losses by erosion +*' * P losses by leaching +*' +*' However, for the time being, this module is not activated in MAgPIE. +*' It is a topic we seek to include in future developments of the model as enriches +*' the biophysical aspects of the model as well as adds to the fertilizer costs (and hence total costs of production). +*' +*' @authors Benjamin Leon Bodirsky + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%phosphorus%" == "off" $include "./modules/54_phosphorus/off/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/54_phosphorus/off/declarations.gms b/modules/54_phosphorus/off/declarations.gms index 97bce9c917..704bb9aeb8 100644 --- a/modules/54_phosphorus/off/declarations.gms +++ b/modules/54_phosphorus/off/declarations.gms @@ -1,16 +1,17 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -variables - vm_p_fert_costs(i) costs for mineral fertilizers (mio. USD05MER per yr) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_p_fert_costs(t,i,type) costs for mineral fertilizers (mio. USD05MER per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 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 + + +variables + vm_p_fert_costs(i) costs for mineral fertilizers (mio. USD05MER per yr) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_p_fert_costs(t,i,type) costs for mineral fertilizers (mio. USD05MER per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/54_phosphorus/off/not_used.txt b/modules/54_phosphorus/off/not_used.txt index 6ece3f27a1..4b81dfbae2 100644 --- a/modules/54_phosphorus/off/not_used.txt +++ b/modules/54_phosphorus/off/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason diff --git a/modules/54_phosphorus/off/postsolve.gms b/modules/54_phosphorus/off/postsolve.gms index cef13d6fd7..fd12d3b13f 100644 --- a/modules/54_phosphorus/off/postsolve.gms +++ b/modules/54_phosphorus/off/postsolve.gms @@ -1,14 +1,15 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_p_fert_costs(t,i,"marginal") = vm_p_fert_costs.m(i); - ov_p_fert_costs(t,i,"level") = vm_p_fert_costs.l(i); - ov_p_fert_costs(t,i,"upper") = vm_p_fert_costs.up(i); - ov_p_fert_costs(t,i,"lower") = vm_p_fert_costs.lo(i); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - +*** | (C) 2008-2019 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 + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_p_fert_costs(t,i,"marginal") = vm_p_fert_costs.m(i); + ov_p_fert_costs(t,i,"level") = vm_p_fert_costs.l(i); + ov_p_fert_costs(t,i,"upper") = vm_p_fert_costs.up(i); + ov_p_fert_costs(t,i,"lower") = vm_p_fert_costs.lo(i); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### + diff --git a/modules/54_phosphorus/off/preloop.gms b/modules/54_phosphorus/off/preloop.gms index 6d29890acf..75f31dff3f 100644 --- a/modules/54_phosphorus/off/preloop.gms +++ b/modules/54_phosphorus/off/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 *' @code diff --git a/modules/54_phosphorus/off.gms b/modules/54_phosphorus/off/realization.gms similarity index 64% rename from modules/54_phosphorus/off.gms rename to modules/54_phosphorus/off/realization.gms index 2bc5b1943f..edcce13e58 100644 --- a/modules/54_phosphorus/off.gms +++ b/modules/54_phosphorus/off/realization.gms @@ -1,16 +1,17 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description This is the current default implementation of the module. -*' It deactivates calculations related to the phosphorus module. - -*' @limitations The realization is still under development. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "declarations" $include "./modules/54_phosphorus/off/declarations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/54_phosphorus/off/preloop.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/54_phosphorus/off/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description This is the current default implementation of the module. +*' It deactivates calculations related to the phosphorus module. + +*' @limitations The realization is still under development. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "declarations" $include "./modules/54_phosphorus/off/declarations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/54_phosphorus/off/preloop.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/54_phosphorus/off/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/55_awms/ipcc2006_aug16/declarations.gms b/modules/55_awms/ipcc2006_aug16/declarations.gms index be59b7116d..fd4eecfaa9 100644 --- a/modules/55_awms/ipcc2006_aug16/declarations.gms +++ b/modules/55_awms/ipcc2006_aug16/declarations.gms @@ -1,49 +1,50 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -parameters - i55_manure_recycling_share(i,kli,awms_conf,npk) Share of manure recycled (tNr per tNr) - ic55_manure_fuel_shr(i,kli) Share of manure excreted on pastures used for fuel (tNr per tNr) - ic55_awms_shr(i,kli,awms_conf) Share of manure Nr managed in each animal waste management systems (tNr per tNr) -; - -positive variables - vm_manure(i, kli, awms, npk) Calculation of manure excreted in confinements (mio t X) - v55_feed_intake(i, kli, awms, npk) Calculation of manure excreted in confinements (mio t X) - vm_manure_recycling(i, npk) Manure being recycled to croplands (mio t X) - vm_manure_confinement(i,kli,awms_conf,npk) Manure excreted in confinements managed in different awms (mio t X) -; - - -equations - q55_bal_intake_grazing_pasture(i,kli, npk) Nutrient balance for intake of grazing animals on pastures (mio t X) - q55_bal_intake_confinement(i,kli, npk) Nutrient balance for intake in confinement (mio t X) - q55_bal_intake_grazing_cropland(i,kli, npk) Nutrient balance for intake of grazing animals on cropland (mio t X) - q55_bal_intake_fuel(i,kli, npk) Nutrient balance for intake of grazing animals on pasture whose excreate are collected for household fuel (mio t X) - - q55_bal_manure(i,kli,awms,npk) Calculation of manure (mio t X) - q55_manure_confinement(i,kli,awms_conf,npk) Manure from animals in confinement managed in different awms (mio t X) - q55_manure_recycling(i, npk) Manure from animals in confinement recycling to cropland (mio t X) -; - - - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_manure(t,i,kli,awms,npk,type) Calculation of manure excreted in confinements (mio t X) - ov55_feed_intake(t,i,kli,awms,npk,type) Calculation of manure excreted in confinements (mio t X) - ov_manure_recycling(t,i,npk,type) Manure being recycled to croplands (mio t X) - ov_manure_confinement(t,i,kli,awms_conf,npk,type) Manure excreted in confinements managed in different awms (mio t X) - oq55_bal_intake_grazing_pasture(t,i,kli,npk,type) Nutrient balance for intake of grazing animals on pastures (mio t X) - oq55_bal_intake_confinement(t,i,kli,npk,type) Nutrient balance for intake in confinement (mio t X) - oq55_bal_intake_grazing_cropland(t,i,kli,npk,type) Nutrient balance for intake of grazing animals on cropland (mio t X) - oq55_bal_intake_fuel(t,i,kli,npk,type) Nutrient balance for intake of grazing animals on pasture whose excreate are collected for household fuel (mio t X) - oq55_bal_manure(t,i,kli,awms,npk,type) Calculation of manure (mio t X) - oq55_manure_confinement(t,i,kli,awms_conf,npk,type) Manure from animals in confinement managed in different awms (mio t X) - oq55_manure_recycling(t,i,npk,type) Manure from animals in confinement recycling to cropland (mio t X) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + +parameters + i55_manure_recycling_share(i,kli,awms_conf,npk) Share of manure recycled (tNr per tNr) + ic55_manure_fuel_shr(i,kli) Share of manure excreted on pastures used for fuel (tNr per tNr) + ic55_awms_shr(i,kli,awms_conf) Share of manure Nr managed in each animal waste management systems (tNr per tNr) +; + +positive variables + vm_manure(i, kli, awms, npk) Calculation of manure excreted in confinements (mio t X) + v55_feed_intake(i, kli, awms, npk) Calculation of manure excreted in confinements (mio t X) + vm_manure_recycling(i, npk) Manure being recycled to croplands (mio t X) + vm_manure_confinement(i,kli,awms_conf,npk) Manure excreted in confinements managed in different awms (mio t X) +; + + +equations + q55_bal_intake_grazing_pasture(i,kli, npk) Nutrient balance for intake of grazing animals on pastures (mio t X) + q55_bal_intake_confinement(i,kli, npk) Nutrient balance for intake in confinement (mio t X) + q55_bal_intake_grazing_cropland(i,kli, npk) Nutrient balance for intake of grazing animals on cropland (mio t X) + q55_bal_intake_fuel(i,kli, npk) Nutrient balance for intake of grazing animals on pasture whose excreate are collected for household fuel (mio t X) + + q55_bal_manure(i,kli,awms,npk) Calculation of manure (mio t X) + q55_manure_confinement(i,kli,awms_conf,npk) Manure from animals in confinement managed in different awms (mio t X) + q55_manure_recycling(i, npk) Manure from animals in confinement recycling to cropland (mio t X) +; + + + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_manure(t,i,kli,awms,npk,type) Calculation of manure excreted in confinements (mio t X) + ov55_feed_intake(t,i,kli,awms,npk,type) Calculation of manure excreted in confinements (mio t X) + ov_manure_recycling(t,i,npk,type) Manure being recycled to croplands (mio t X) + ov_manure_confinement(t,i,kli,awms_conf,npk,type) Manure excreted in confinements managed in different awms (mio t X) + oq55_bal_intake_grazing_pasture(t,i,kli,npk,type) Nutrient balance for intake of grazing animals on pastures (mio t X) + oq55_bal_intake_confinement(t,i,kli,npk,type) Nutrient balance for intake in confinement (mio t X) + oq55_bal_intake_grazing_cropland(t,i,kli,npk,type) Nutrient balance for intake of grazing animals on cropland (mio t X) + oq55_bal_intake_fuel(t,i,kli,npk,type) Nutrient balance for intake of grazing animals on pasture whose excreate are collected for household fuel (mio t X) + oq55_bal_manure(t,i,kli,awms,npk,type) Calculation of manure (mio t X) + oq55_manure_confinement(t,i,kli,awms_conf,npk,type) Manure from animals in confinement managed in different awms (mio t X) + oq55_manure_recycling(t,i,npk,type) Manure from animals in confinement recycling to cropland (mio t X) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/55_awms/ipcc2006_aug16/equations.gms b/modules/55_awms/ipcc2006_aug16/equations.gms index 3ebf47ed11..ac002ec1a2 100644 --- a/modules/55_awms/ipcc2006_aug16/equations.gms +++ b/modules/55_awms/ipcc2006_aug16/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 @@ -83,4 +84,4 @@ vm_manure_recycling(i2,npk) =e= sum((awms_conf,kli), vm_manure_confinement(i2,kli,awms_conf, npk) - * i55_manure_recycling_share(i2,kli,awms_conf,npk)); \ No newline at end of file + * i55_manure_recycling_share(i2,kli,awms_conf,npk)); diff --git a/modules/55_awms/ipcc2006_aug16/input.gms b/modules/55_awms/ipcc2006_aug16/input.gms index c9737076bb..fc50a41633 100644 --- a/modules/55_awms/ipcc2006_aug16/input.gms +++ b/modules/55_awms/ipcc2006_aug16/input.gms @@ -1,34 +1,35 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -$setglobal c55_scen_conf SSP2 -* options: SSP: "SSP1", "SSP2", "SSP3", "SSP4", "SSP5" -* SRES: "A1", "A2", "B1", "B2" - -parameter f55_awms_recycling_share(i,kli,awms_conf) share of Nr in confinement recycled (tNr per tNr) -/ -$ondelim -$include "./modules/55_awms/ipcc2006_aug16/input/f55_awms_recycling_share.cs4" -$offdelim -/ -; - -parameter f55_awms_shr(t_all,i,scen_conf55,kli,awms_conf) share of Nr in confinement recycled (tNr per tNr) -/ -$ondelim -$include "./modules/55_awms/ipcc2006_aug16/input/f55_awms_shr.cs4" -$offdelim -/ -; - -parameter f55_manure_fuel_shr(t_all,i,kli,gdp_scen09) share of Nr in confinement recycled (tNr per tNr) -/ -$ondelim -$include "./modules/55_awms/ipcc2006_aug16/input/f55_manure_fuel_shr.cs4" -$offdelim -/ -; +*** | (C) 2008-2019 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 + + +$setglobal c55_scen_conf SSP2 +* options: SSP: "SSP1", "SSP2", "SSP3", "SSP4", "SSP5" +* SRES: "A1", "A2", "B1", "B2" + +parameter f55_awms_recycling_share(i,kli,awms_conf) share of Nr in confinement recycled (tNr per tNr) +/ +$ondelim +$include "./modules/55_awms/ipcc2006_aug16/input/f55_awms_recycling_share.cs4" +$offdelim +/ +; + +parameter f55_awms_shr(t_all,i,scen_conf55,kli,awms_conf) share of Nr in confinement recycled (tNr per tNr) +/ +$ondelim +$include "./modules/55_awms/ipcc2006_aug16/input/f55_awms_shr.cs4" +$offdelim +/ +; + +parameter f55_manure_fuel_shr(t_all,i,kli,gdp_scen09) share of Nr in confinement recycled (tNr per tNr) +/ +$ondelim +$include "./modules/55_awms/ipcc2006_aug16/input/f55_manure_fuel_shr.cs4" +$offdelim +/ +; diff --git a/modules/55_awms/ipcc2006_aug16/nl_fix.gms b/modules/55_awms/ipcc2006_aug16/nl_fix.gms index e69bd5a186..5963ccda1d 100644 --- a/modules/55_awms/ipcc2006_aug16/nl_fix.gms +++ b/modules/55_awms/ipcc2006_aug16/nl_fix.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/55_awms/ipcc2006_aug16/nl_relax.gms b/modules/55_awms/ipcc2006_aug16/nl_relax.gms index e69bd5a186..5963ccda1d 100644 --- a/modules/55_awms/ipcc2006_aug16/nl_relax.gms +++ b/modules/55_awms/ipcc2006_aug16/nl_relax.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/55_awms/ipcc2006_aug16/nl_release.gms b/modules/55_awms/ipcc2006_aug16/nl_release.gms index e69bd5a186..5963ccda1d 100644 --- a/modules/55_awms/ipcc2006_aug16/nl_release.gms +++ b/modules/55_awms/ipcc2006_aug16/nl_release.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/55_awms/ipcc2006_aug16/postsolve.gms b/modules/55_awms/ipcc2006_aug16/postsolve.gms index bd58fd4f6f..5808c22b79 100644 --- a/modules/55_awms/ipcc2006_aug16/postsolve.gms +++ b/modules/55_awms/ipcc2006_aug16/postsolve.gms @@ -1,55 +1,56 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_manure(t,i,kli,awms,npk,"marginal") = vm_manure.m(i,kli,awms,npk); - ov55_feed_intake(t,i,kli,awms,npk,"marginal") = v55_feed_intake.m(i,kli,awms,npk); - ov_manure_recycling(t,i,npk,"marginal") = vm_manure_recycling.m(i,npk); - ov_manure_confinement(t,i,kli,awms_conf,npk,"marginal") = vm_manure_confinement.m(i,kli,awms_conf,npk); - oq55_bal_intake_grazing_pasture(t,i,kli,npk,"marginal") = q55_bal_intake_grazing_pasture.m(i,kli,npk); - oq55_bal_intake_confinement(t,i,kli,npk,"marginal") = q55_bal_intake_confinement.m(i,kli,npk); - oq55_bal_intake_grazing_cropland(t,i,kli,npk,"marginal") = q55_bal_intake_grazing_cropland.m(i,kli,npk); - oq55_bal_intake_fuel(t,i,kli,npk,"marginal") = q55_bal_intake_fuel.m(i,kli,npk); - oq55_bal_manure(t,i,kli,awms,npk,"marginal") = q55_bal_manure.m(i,kli,awms,npk); - oq55_manure_confinement(t,i,kli,awms_conf,npk,"marginal") = q55_manure_confinement.m(i,kli,awms_conf,npk); - oq55_manure_recycling(t,i,npk,"marginal") = q55_manure_recycling.m(i,npk); - ov_manure(t,i,kli,awms,npk,"level") = vm_manure.l(i,kli,awms,npk); - ov55_feed_intake(t,i,kli,awms,npk,"level") = v55_feed_intake.l(i,kli,awms,npk); - ov_manure_recycling(t,i,npk,"level") = vm_manure_recycling.l(i,npk); - ov_manure_confinement(t,i,kli,awms_conf,npk,"level") = vm_manure_confinement.l(i,kli,awms_conf,npk); - oq55_bal_intake_grazing_pasture(t,i,kli,npk,"level") = q55_bal_intake_grazing_pasture.l(i,kli,npk); - oq55_bal_intake_confinement(t,i,kli,npk,"level") = q55_bal_intake_confinement.l(i,kli,npk); - oq55_bal_intake_grazing_cropland(t,i,kli,npk,"level") = q55_bal_intake_grazing_cropland.l(i,kli,npk); - oq55_bal_intake_fuel(t,i,kli,npk,"level") = q55_bal_intake_fuel.l(i,kli,npk); - oq55_bal_manure(t,i,kli,awms,npk,"level") = q55_bal_manure.l(i,kli,awms,npk); - oq55_manure_confinement(t,i,kli,awms_conf,npk,"level") = q55_manure_confinement.l(i,kli,awms_conf,npk); - oq55_manure_recycling(t,i,npk,"level") = q55_manure_recycling.l(i,npk); - ov_manure(t,i,kli,awms,npk,"upper") = vm_manure.up(i,kli,awms,npk); - ov55_feed_intake(t,i,kli,awms,npk,"upper") = v55_feed_intake.up(i,kli,awms,npk); - ov_manure_recycling(t,i,npk,"upper") = vm_manure_recycling.up(i,npk); - ov_manure_confinement(t,i,kli,awms_conf,npk,"upper") = vm_manure_confinement.up(i,kli,awms_conf,npk); - oq55_bal_intake_grazing_pasture(t,i,kli,npk,"upper") = q55_bal_intake_grazing_pasture.up(i,kli,npk); - oq55_bal_intake_confinement(t,i,kli,npk,"upper") = q55_bal_intake_confinement.up(i,kli,npk); - oq55_bal_intake_grazing_cropland(t,i,kli,npk,"upper") = q55_bal_intake_grazing_cropland.up(i,kli,npk); - oq55_bal_intake_fuel(t,i,kli,npk,"upper") = q55_bal_intake_fuel.up(i,kli,npk); - oq55_bal_manure(t,i,kli,awms,npk,"upper") = q55_bal_manure.up(i,kli,awms,npk); - oq55_manure_confinement(t,i,kli,awms_conf,npk,"upper") = q55_manure_confinement.up(i,kli,awms_conf,npk); - oq55_manure_recycling(t,i,npk,"upper") = q55_manure_recycling.up(i,npk); - ov_manure(t,i,kli,awms,npk,"lower") = vm_manure.lo(i,kli,awms,npk); - ov55_feed_intake(t,i,kli,awms,npk,"lower") = v55_feed_intake.lo(i,kli,awms,npk); - ov_manure_recycling(t,i,npk,"lower") = vm_manure_recycling.lo(i,npk); - ov_manure_confinement(t,i,kli,awms_conf,npk,"lower") = vm_manure_confinement.lo(i,kli,awms_conf,npk); - oq55_bal_intake_grazing_pasture(t,i,kli,npk,"lower") = q55_bal_intake_grazing_pasture.lo(i,kli,npk); - oq55_bal_intake_confinement(t,i,kli,npk,"lower") = q55_bal_intake_confinement.lo(i,kli,npk); - oq55_bal_intake_grazing_cropland(t,i,kli,npk,"lower") = q55_bal_intake_grazing_cropland.lo(i,kli,npk); - oq55_bal_intake_fuel(t,i,kli,npk,"lower") = q55_bal_intake_fuel.lo(i,kli,npk); - oq55_bal_manure(t,i,kli,awms,npk,"lower") = q55_bal_manure.lo(i,kli,awms,npk); - oq55_manure_confinement(t,i,kli,awms_conf,npk,"lower") = q55_manure_confinement.lo(i,kli,awms_conf,npk); - oq55_manure_recycling(t,i,npk,"lower") = q55_manure_recycling.lo(i,npk); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - +*** | (C) 2008-2019 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 + + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_manure(t,i,kli,awms,npk,"marginal") = vm_manure.m(i,kli,awms,npk); + ov55_feed_intake(t,i,kli,awms,npk,"marginal") = v55_feed_intake.m(i,kli,awms,npk); + ov_manure_recycling(t,i,npk,"marginal") = vm_manure_recycling.m(i,npk); + ov_manure_confinement(t,i,kli,awms_conf,npk,"marginal") = vm_manure_confinement.m(i,kli,awms_conf,npk); + oq55_bal_intake_grazing_pasture(t,i,kli,npk,"marginal") = q55_bal_intake_grazing_pasture.m(i,kli,npk); + oq55_bal_intake_confinement(t,i,kli,npk,"marginal") = q55_bal_intake_confinement.m(i,kli,npk); + oq55_bal_intake_grazing_cropland(t,i,kli,npk,"marginal") = q55_bal_intake_grazing_cropland.m(i,kli,npk); + oq55_bal_intake_fuel(t,i,kli,npk,"marginal") = q55_bal_intake_fuel.m(i,kli,npk); + oq55_bal_manure(t,i,kli,awms,npk,"marginal") = q55_bal_manure.m(i,kli,awms,npk); + oq55_manure_confinement(t,i,kli,awms_conf,npk,"marginal") = q55_manure_confinement.m(i,kli,awms_conf,npk); + oq55_manure_recycling(t,i,npk,"marginal") = q55_manure_recycling.m(i,npk); + ov_manure(t,i,kli,awms,npk,"level") = vm_manure.l(i,kli,awms,npk); + ov55_feed_intake(t,i,kli,awms,npk,"level") = v55_feed_intake.l(i,kli,awms,npk); + ov_manure_recycling(t,i,npk,"level") = vm_manure_recycling.l(i,npk); + ov_manure_confinement(t,i,kli,awms_conf,npk,"level") = vm_manure_confinement.l(i,kli,awms_conf,npk); + oq55_bal_intake_grazing_pasture(t,i,kli,npk,"level") = q55_bal_intake_grazing_pasture.l(i,kli,npk); + oq55_bal_intake_confinement(t,i,kli,npk,"level") = q55_bal_intake_confinement.l(i,kli,npk); + oq55_bal_intake_grazing_cropland(t,i,kli,npk,"level") = q55_bal_intake_grazing_cropland.l(i,kli,npk); + oq55_bal_intake_fuel(t,i,kli,npk,"level") = q55_bal_intake_fuel.l(i,kli,npk); + oq55_bal_manure(t,i,kli,awms,npk,"level") = q55_bal_manure.l(i,kli,awms,npk); + oq55_manure_confinement(t,i,kli,awms_conf,npk,"level") = q55_manure_confinement.l(i,kli,awms_conf,npk); + oq55_manure_recycling(t,i,npk,"level") = q55_manure_recycling.l(i,npk); + ov_manure(t,i,kli,awms,npk,"upper") = vm_manure.up(i,kli,awms,npk); + ov55_feed_intake(t,i,kli,awms,npk,"upper") = v55_feed_intake.up(i,kli,awms,npk); + ov_manure_recycling(t,i,npk,"upper") = vm_manure_recycling.up(i,npk); + ov_manure_confinement(t,i,kli,awms_conf,npk,"upper") = vm_manure_confinement.up(i,kli,awms_conf,npk); + oq55_bal_intake_grazing_pasture(t,i,kli,npk,"upper") = q55_bal_intake_grazing_pasture.up(i,kli,npk); + oq55_bal_intake_confinement(t,i,kli,npk,"upper") = q55_bal_intake_confinement.up(i,kli,npk); + oq55_bal_intake_grazing_cropland(t,i,kli,npk,"upper") = q55_bal_intake_grazing_cropland.up(i,kli,npk); + oq55_bal_intake_fuel(t,i,kli,npk,"upper") = q55_bal_intake_fuel.up(i,kli,npk); + oq55_bal_manure(t,i,kli,awms,npk,"upper") = q55_bal_manure.up(i,kli,awms,npk); + oq55_manure_confinement(t,i,kli,awms_conf,npk,"upper") = q55_manure_confinement.up(i,kli,awms_conf,npk); + oq55_manure_recycling(t,i,npk,"upper") = q55_manure_recycling.up(i,npk); + ov_manure(t,i,kli,awms,npk,"lower") = vm_manure.lo(i,kli,awms,npk); + ov55_feed_intake(t,i,kli,awms,npk,"lower") = v55_feed_intake.lo(i,kli,awms,npk); + ov_manure_recycling(t,i,npk,"lower") = vm_manure_recycling.lo(i,npk); + ov_manure_confinement(t,i,kli,awms_conf,npk,"lower") = vm_manure_confinement.lo(i,kli,awms_conf,npk); + oq55_bal_intake_grazing_pasture(t,i,kli,npk,"lower") = q55_bal_intake_grazing_pasture.lo(i,kli,npk); + oq55_bal_intake_confinement(t,i,kli,npk,"lower") = q55_bal_intake_confinement.lo(i,kli,npk); + oq55_bal_intake_grazing_cropland(t,i,kli,npk,"lower") = q55_bal_intake_grazing_cropland.lo(i,kli,npk); + oq55_bal_intake_fuel(t,i,kli,npk,"lower") = q55_bal_intake_fuel.lo(i,kli,npk); + oq55_bal_manure(t,i,kli,awms,npk,"lower") = q55_bal_manure.lo(i,kli,awms,npk); + oq55_manure_confinement(t,i,kli,awms_conf,npk,"lower") = q55_manure_confinement.lo(i,kli,awms_conf,npk); + oq55_manure_recycling(t,i,npk,"lower") = q55_manure_recycling.lo(i,npk); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### + diff --git a/modules/55_awms/ipcc2006_aug16/preloop.gms b/modules/55_awms/ipcc2006_aug16/preloop.gms index 3428919f34..25ec35da12 100644 --- a/modules/55_awms/ipcc2006_aug16/preloop.gms +++ b/modules/55_awms/ipcc2006_aug16/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/55_awms/ipcc2006_aug16/presolve.gms b/modules/55_awms/ipcc2006_aug16/presolve.gms index 39c25323ce..4271374794 100644 --- a/modules/55_awms/ipcc2006_aug16/presolve.gms +++ b/modules/55_awms/ipcc2006_aug16/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 ic55_manure_fuel_shr(i,kli)=f55_manure_fuel_shr(t,i,kli,"%c09_gdp_scenario%"); diff --git a/modules/55_awms/ipcc2006_aug16.gms b/modules/55_awms/ipcc2006_aug16/realization.gms similarity index 79% rename from modules/55_awms/ipcc2006_aug16.gms rename to modules/55_awms/ipcc2006_aug16/realization.gms index 56a29dc1d9..7dfda90d0d 100644 --- a/modules/55_awms/ipcc2006_aug16.gms +++ b/modules/55_awms/ipcc2006_aug16/realization.gms @@ -1,24 +1,25 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description -*' Manure excretion is estimated using a mass balance approach and -*' based on NPK in feed and N in slaughtered animals (@bodirsky_current_2012.). -*' Animal waste management is largely based on the IPCC 2006 Guidelines for -*' National Greenhouse Gas Inventories (@ipcc_2006_2006.). - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/55_awms/ipcc2006_aug16/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/55_awms/ipcc2006_aug16/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/55_awms/ipcc2006_aug16/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/55_awms/ipcc2006_aug16/equations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/55_awms/ipcc2006_aug16/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/55_awms/ipcc2006_aug16/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/55_awms/ipcc2006_aug16/postsolve.gms" -$Ifi "%phase%" == "nl_fix" $include "./modules/55_awms/ipcc2006_aug16/nl_fix.gms" -$Ifi "%phase%" == "nl_release" $include "./modules/55_awms/ipcc2006_aug16/nl_release.gms" -$Ifi "%phase%" == "nl_relax" $include "./modules/55_awms/ipcc2006_aug16/nl_relax.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description +*' Manure excretion is estimated using a mass balance approach and +*' based on NPK in feed and N in slaughtered animals (@bodirsky_current_2012.). +*' Animal waste management is largely based on the IPCC 2006 Guidelines for +*' National Greenhouse Gas Inventories (@ipcc_2006_2006.). + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/55_awms/ipcc2006_aug16/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/55_awms/ipcc2006_aug16/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/55_awms/ipcc2006_aug16/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/55_awms/ipcc2006_aug16/equations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/55_awms/ipcc2006_aug16/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/55_awms/ipcc2006_aug16/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/55_awms/ipcc2006_aug16/postsolve.gms" +$Ifi "%phase%" == "nl_fix" $include "./modules/55_awms/ipcc2006_aug16/nl_fix.gms" +$Ifi "%phase%" == "nl_release" $include "./modules/55_awms/ipcc2006_aug16/nl_release.gms" +$Ifi "%phase%" == "nl_relax" $include "./modules/55_awms/ipcc2006_aug16/nl_relax.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/55_awms/ipcc2006_aug16/sets.gms b/modules/55_awms/ipcc2006_aug16/sets.gms index bd978aafd6..18e6beac9a 100644 --- a/modules/55_awms/ipcc2006_aug16/sets.gms +++ b/modules/55_awms/ipcc2006_aug16/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets diff --git a/modules/55_awms/55_awms.gms b/modules/55_awms/module.gms similarity index 59% rename from modules/55_awms/55_awms.gms rename to modules/55_awms/module.gms index a1af9b7ff3..e442535dc7 100644 --- a/modules/55_awms/55_awms.gms +++ b/modules/55_awms/module.gms @@ -1,18 +1,19 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Animal waste management systems -*' @description -*' This module calculates the nutrient (NPK) flows within animal waste management. -*' It receives information on feed from the module [70_livestock], and provides -*' information on recycled manure to [50_nr_soil_budget] and information on -*' greenhouse gas emissions to modules [51_nitrogen] and [53_methane]. -*' @authors Benjamin Leon Bodirsky - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%awms%" == "ipcc2006_aug16" $include "./modules/55_awms/ipcc2006_aug16.gms" -$Ifi "%awms%" == "off" $include "./modules/55_awms/off.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Animal waste management systems +*' @description +*' This module calculates the nutrient (NPK) flows within animal waste management. +*' It receives information on feed from the module [70_livestock], and provides +*' information on recycled manure to [50_nr_soil_budget] and information on +*' greenhouse gas emissions to modules [51_nitrogen] and [53_methane]. +*' @authors Benjamin Leon Bodirsky + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%awms%" == "ipcc2006_aug16" $include "./modules/55_awms/ipcc2006_aug16/realization.gms" +$Ifi "%awms%" == "off" $include "./modules/55_awms/off/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/55_awms/off/declarations.gms b/modules/55_awms/off/declarations.gms index ba75b5a82f..40a0303a54 100644 --- a/modules/55_awms/off/declarations.gms +++ b/modules/55_awms/off/declarations.gms @@ -1,21 +1,22 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -positive variables - vm_manure(i, kli, awms, npk) calculation of manure excreted in confinements (Tg nutrient) - vm_manure_recycling(i, npk) Manure being recycled to croplands (Tg nutrient) - vm_manure_confinement(i,kli,awms_conf,npk) Manure excreted in confinements managed in different awms (Tg nutrient) -; -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_manure(t,i,kli,awms,npk,type) calculation of manure excreted in confinements (Tg nutrient) - ov_manure_recycling(t,i,npk,type) Manure being recycled to croplands (Tg nutrient) - ov_manure_confinement(t,i,kli,awms_conf,npk,type) Manure excreted in confinements managed in different awms (Tg nutrient) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + +positive variables + vm_manure(i, kli, awms, npk) calculation of manure excreted in confinements (Tg nutrient) + vm_manure_recycling(i, npk) Manure being recycled to croplands (Tg nutrient) + vm_manure_confinement(i,kli,awms_conf,npk) Manure excreted in confinements managed in different awms (Tg nutrient) +; +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_manure(t,i,kli,awms,npk,type) calculation of manure excreted in confinements (Tg nutrient) + ov_manure_recycling(t,i,npk,type) Manure being recycled to croplands (Tg nutrient) + ov_manure_confinement(t,i,kli,awms_conf,npk,type) Manure excreted in confinements managed in different awms (Tg nutrient) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/55_awms/off/not_used.txt b/modules/55_awms/off/not_used.txt index be6834bf03..04cb67f6a3 100644 --- a/modules/55_awms/off/not_used.txt +++ b/modules/55_awms/off/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason diff --git a/modules/55_awms/off/postsolve.gms b/modules/55_awms/off/postsolve.gms index c06afb6989..802e6f92cf 100644 --- a/modules/55_awms/off/postsolve.gms +++ b/modules/55_awms/off/postsolve.gms @@ -1,24 +1,25 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_manure(t,i,kli,awms,npk,"marginal") = vm_manure.m(i,kli,awms,npk); - ov_manure_recycling(t,i,npk,"marginal") = vm_manure_recycling.m(i,npk); - ov_manure_confinement(t,i,kli,awms_conf,npk,"marginal") = vm_manure_confinement.m(i,kli,awms_conf,npk); - ov_manure(t,i,kli,awms,npk,"level") = vm_manure.l(i,kli,awms,npk); - ov_manure_recycling(t,i,npk,"level") = vm_manure_recycling.l(i,npk); - ov_manure_confinement(t,i,kli,awms_conf,npk,"level") = vm_manure_confinement.l(i,kli,awms_conf,npk); - ov_manure(t,i,kli,awms,npk,"upper") = vm_manure.up(i,kli,awms,npk); - ov_manure_recycling(t,i,npk,"upper") = vm_manure_recycling.up(i,npk); - ov_manure_confinement(t,i,kli,awms_conf,npk,"upper") = vm_manure_confinement.up(i,kli,awms_conf,npk); - ov_manure(t,i,kli,awms,npk,"lower") = vm_manure.lo(i,kli,awms,npk); - ov_manure_recycling(t,i,npk,"lower") = vm_manure_recycling.lo(i,npk); - ov_manure_confinement(t,i,kli,awms_conf,npk,"lower") = vm_manure_confinement.lo(i,kli,awms_conf,npk); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - +*** | (C) 2008-2019 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 + + + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_manure(t,i,kli,awms,npk,"marginal") = vm_manure.m(i,kli,awms,npk); + ov_manure_recycling(t,i,npk,"marginal") = vm_manure_recycling.m(i,npk); + ov_manure_confinement(t,i,kli,awms_conf,npk,"marginal") = vm_manure_confinement.m(i,kli,awms_conf,npk); + ov_manure(t,i,kli,awms,npk,"level") = vm_manure.l(i,kli,awms,npk); + ov_manure_recycling(t,i,npk,"level") = vm_manure_recycling.l(i,npk); + ov_manure_confinement(t,i,kli,awms_conf,npk,"level") = vm_manure_confinement.l(i,kli,awms_conf,npk); + ov_manure(t,i,kli,awms,npk,"upper") = vm_manure.up(i,kli,awms,npk); + ov_manure_recycling(t,i,npk,"upper") = vm_manure_recycling.up(i,npk); + ov_manure_confinement(t,i,kli,awms_conf,npk,"upper") = vm_manure_confinement.up(i,kli,awms_conf,npk); + ov_manure(t,i,kli,awms,npk,"lower") = vm_manure.lo(i,kli,awms,npk); + ov_manure_recycling(t,i,npk,"lower") = vm_manure_recycling.lo(i,npk); + ov_manure_confinement(t,i,kli,awms_conf,npk,"lower") = vm_manure_confinement.lo(i,kli,awms_conf,npk); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### + diff --git a/modules/55_awms/off/preloop.gms b/modules/55_awms/off/preloop.gms index 3820fd555c..7c234759bf 100644 --- a/modules/55_awms/off/preloop.gms +++ b/modules/55_awms/off/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de vm_manure.fx(i, kli, awms, npk)=0; diff --git a/modules/55_awms/off.gms b/modules/55_awms/off/realization.gms similarity index 58% rename from modules/55_awms/off.gms rename to modules/55_awms/off/realization.gms index 71af224d33..4cb3defc12 100644 --- a/modules/55_awms/off.gms +++ b/modules/55_awms/off/realization.gms @@ -1,13 +1,14 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/55_awms/off/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/55_awms/off/declarations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/55_awms/off/preloop.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/55_awms/off/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 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 + + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/55_awms/off/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/55_awms/off/declarations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/55_awms/off/preloop.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/55_awms/off/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/55_awms/off/sets.gms b/modules/55_awms/off/sets.gms index c365ed21ad..b18e6ccd79 100644 --- a/modules/55_awms/off/sets.gms +++ b/modules/55_awms/off/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets diff --git a/modules/56_ghg_policy/56_ghg_policy.gms b/modules/56_ghg_policy/module.gms similarity index 74% rename from modules/56_ghg_policy/56_ghg_policy.gms rename to modules/56_ghg_policy/module.gms index f3da23524f..0a9d1d39c1 100644 --- a/modules/56_ghg_policy/56_ghg_policy.gms +++ b/modules/56_ghg_policy/module.gms @@ -1,27 +1,27 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Greenhouse gas policy -*' -*' @description The module 56_ghg_policy connects emissions to costs which then enter -*' the objective function of MAgPIE. Connecting emissions with costs in a cost -*' minimization model like MAgPIE creates an incentive to reduce emissions. -*' This can be interpreted as an internalization of the external costs by pollution, -*' e.g. by policies that deincentivize polluting activity. -*' Technically, every ton of emission is multiplied with an emission price to -*' determine emission costs. Emission sources can be excluded from pricing by switches -*' defined in config/default.cfg. -*' -*' Please note that emissions that occur only once (e.g. CO2 emissions from deforestation) -*' are handled differently than emissions that occur in every timestep -*' (e.g. CH4 and N2O emissions from agricultural production). -*' -*' @authors Benjamin Bodirsky, Florian Humpenoeder - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%ghg_policy%" == "price_jan19" $include "./modules/56_ghg_policy/price_jan19.gms" -$Ifi "%ghg_policy%" == "price_sep16" $include "./modules/56_ghg_policy/price_sep16.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Greenhouse gas policy +*' +*' @description The module 56_ghg_policy connects emissions to costs which then enter +*' the objective function of MAgPIE. Connecting emissions with costs in a cost +*' minimization model like MAgPIE creates an incentive to reduce emissions. +*' This can be interpreted as an internalization of the external costs by pollution, +*' e.g. by policies that deincentivize polluting activity. +*' Technically, every ton of emission is multiplied with an emission price to +*' determine emission costs. Emission sources can be excluded from pricing by switches +*' defined in config/default.cfg. +*' +*' Please note that emissions that occur only once (e.g. CO2 emissions from deforestation) +*' are handled differently than emissions that occur in every timestep +*' (e.g. CH4 and N2O emissions from agricultural production). +*' +*' @authors Benjamin Bodirsky, Florian Humpenoeder + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%ghg_policy%" == "price_jan19" $include "./modules/56_ghg_policy/price_jan19/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/56_ghg_policy/price_jan19/declarations.gms b/modules/56_ghg_policy/price_jan19/declarations.gms index 6c29a30d81..26ffaff38e 100644 --- a/modules/56_ghg_policy/price_jan19/declarations.gms +++ b/modules/56_ghg_policy/price_jan19/declarations.gms @@ -1,69 +1,70 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -parameters - im_pollutant_prices(t,i,pollutants) Certificate prices for N2O-N CH4 CO2-C used in the model (USD05MER per Mg) - p56_pollutant_prices_input(t,i,pollutants) Certificate prices for N2O-N CH4 CO2-C from input files (USD05MER per Mg) - p56_ghg_price_growth_rate(t,i,pollutants) Growth rate of certificate price (% per yr) - p56_ghg_price_growth_rate_avg(i,pollutants) Average over time of growth rate of certificate price (% per yr) - p56_emis_policy(t,i,pollutants,emis_source) GHG emission policy scenarios (binary) -; - -equations - q56_technical_mitigation_reg(i,pollutants,emis_source) Application of maccs on emissions (Tg per yr) - q56_technical_mitigation_cell(j,pollutants,emis_source) Application of maccs on emissions (Tg per yr) - q56_cell_to_reg(i,pollutants,emis_source) Aggregation to regional emissions (Tg per yr) - q56_emission_costs(i) Calculation of total emission costs (mio. USD05MER per yr) - q56_emission_costs_reg_yearly(i,emis_reg_yr56) Calculation of regional costs for annual emissions (mio. USD05MER per yr) - q56_emission_costs_reg_oneoff(i,emis_reg_one56) Calculation of regional costs for emissions occuring only once in time (mio. USD05MER per yr) - q56_emission_costs_cell_yearly(j,emis_cell_yr56) Calculation of cellular costs for annual emissions (mio. USD05MER per yr) - q56_emission_costs_cell_oneoff(j,emis_cell_one56) Calculation of cellular costs for emissions occuring only once in time (mio. USD05MER per yr) - q56_reward_cdr_aff_reg(i) Regional revenues for carbon captured by afforestation (mio. USD05MER per yr) - q56_reward_cdr_aff(j) Cellular revenues for carbon captured by afforestation (mio. USD05MER per yr) -; - -positive variables - v56_reward_cdr_aff(j) Cellular revenues for carbon captured by afforestation (mio. USD05MER per yr) - vm_reward_cdr_aff(i) Regional revenues for carbon captured by afforestation (mio. USD05MER per yr) -; - -variables - vm_btm_reg(i,emis_source,pollutants) Regional emissions before technical mitigation (Tg per yr) - vm_btm_cell(j,emis_source,pollutants) Cellular emissions before technical mitigation (Tg per yr) - vm_emission_costs(i) Costs for emission rights for pollutants and greenhouse gases (mio. USD05MER per yr) - vm_emissions_reg(i,emis_source,pollutants) Regional emissions by source and gas after technical mitigation N CH4 C (Tg per yr) - v56_emis_cell(j,emis_source,pollutants) Cellular emissions by source and gas after technical mitigation N CH4 C (Tg per yr) - v56_emission_costs_reg_yearly(i,emis_reg_yr56) Costs for emissions occuring yearly (mio. USD05MER per yr) - v56_emission_costs_reg_oneoff(i,emis_reg_one56) Costs for emissions occuring only once in time (mio. USD05MER per yr) - v56_emission_costs_cell_yearly(j,emis_cell_yr56) Costs for emissions occuring yearly (mio. USD05MER per yr) - v56_emission_costs_cell_oneoff(j,emis_cell_one56) Costs for emissions occuring only once in time (mio. USD05MER per yr) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov56_reward_cdr_aff(t,j,type) Cellular revenues for carbon captured by afforestation (mio. USD05MER per yr) - ov_reward_cdr_aff(t,i,type) Regional revenues for carbon captured by afforestation (mio. USD05MER per yr) - ov_btm_reg(t,i,emis_source,pollutants,type) Regional emissions before technical mitigation (Tg per yr) - ov_btm_cell(t,j,emis_source,pollutants,type) Cellular emissions before technical mitigation (Tg per yr) - ov_emission_costs(t,i,type) Costs for emission rights for pollutants and greenhouse gases (mio. USD05MER per yr) - ov_emissions_reg(t,i,emis_source,pollutants,type) Regional emissions by source and gas after technical mitigation N CH4 C (Tg per yr) - ov56_emis_cell(t,j,emis_source,pollutants,type) Cellular emissions by source and gas after technical mitigation N CH4 C (Tg per yr) - ov56_emission_costs_reg_yearly(t,i,emis_reg_yr56,type) Costs for emissions occuring yearly (mio. USD05MER per yr) - ov56_emission_costs_reg_oneoff(t,i,emis_reg_one56,type) Costs for emissions occuring only once in time (mio. USD05MER per yr) - ov56_emission_costs_cell_yearly(t,j,emis_cell_yr56,type) Costs for emissions occuring yearly (mio. USD05MER per yr) - ov56_emission_costs_cell_oneoff(t,j,emis_cell_one56,type) Costs for emissions occuring only once in time (mio. USD05MER per yr) - oq56_technical_mitigation_reg(t,i,pollutants,emis_source,type) Application of maccs on emissions (Tg per yr) - oq56_technical_mitigation_cell(t,j,pollutants,emis_source,type) Application of maccs on emissions (Tg per yr) - oq56_cell_to_reg(t,i,pollutants,emis_source,type) Aggregation to regional emissions (Tg per yr) - oq56_emission_costs(t,i,type) Calculation of total emission costs (mio. USD05MER per yr) - oq56_emission_costs_reg_yearly(t,i,emis_reg_yr56,type) Calculation of regional costs for annual emissions (mio. USD05MER per yr) - oq56_emission_costs_reg_oneoff(t,i,emis_reg_one56,type) Calculation of regional costs for emissions occuring only once in time (mio. USD05MER per yr) - oq56_emission_costs_cell_yearly(t,j,emis_cell_yr56,type) Calculation of cellular costs for annual emissions (mio. USD05MER per yr) - oq56_emission_costs_cell_oneoff(t,j,emis_cell_one56,type) Calculation of cellular costs for emissions occuring only once in time (mio. USD05MER per yr) - oq56_reward_cdr_aff_reg(t,i,type) Regional revenues for carbon captured by afforestation (mio. USD05MER per yr) - oq56_reward_cdr_aff(t,j,type) Cellular revenues for carbon captured by afforestation (mio. USD05MER per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +parameters + im_pollutant_prices(t,i,pollutants) Certificate prices for N2O-N CH4 CO2-C used in the model (USD05MER per Mg) + p56_pollutant_prices_input(t,i,pollutants) Certificate prices for N2O-N CH4 CO2-C from input files (USD05MER per Mg) + p56_ghg_price_growth_rate(t,i,pollutants) Growth rate of certificate price (% per yr) + p56_ghg_price_growth_rate_avg(i,pollutants) Average over time of growth rate of certificate price (% per yr) + p56_emis_policy(t,i,pollutants,emis_source) GHG emission policy scenarios (binary) +; + +equations + q56_technical_mitigation_reg(i,pollutants,emis_source) Application of maccs on emissions (Tg per yr) + q56_technical_mitigation_cell(j,pollutants,emis_source) Application of maccs on emissions (Tg per yr) + q56_cell_to_reg(i,pollutants,emis_source) Aggregation to regional emissions (Tg per yr) + q56_emission_costs(i) Calculation of total emission costs (mio. USD05MER per yr) + q56_emission_costs_reg_yearly(i,emis_reg_yr56) Calculation of regional costs for annual emissions (mio. USD05MER per yr) + q56_emission_costs_reg_oneoff(i,emis_reg_one56) Calculation of regional costs for emissions occuring only once in time (mio. USD05MER per yr) + q56_emission_costs_cell_yearly(j,emis_cell_yr56) Calculation of cellular costs for annual emissions (mio. USD05MER per yr) + q56_emission_costs_cell_oneoff(j,emis_cell_one56) Calculation of cellular costs for emissions occuring only once in time (mio. USD05MER per yr) + q56_reward_cdr_aff_reg(i) Regional revenues for carbon captured by afforestation (mio. USD05MER per yr) + q56_reward_cdr_aff(j) Cellular revenues for carbon captured by afforestation (mio. USD05MER per yr) +; + +positive variables + v56_reward_cdr_aff(j) Cellular revenues for carbon captured by afforestation (mio. USD05MER per yr) + vm_reward_cdr_aff(i) Regional revenues for carbon captured by afforestation (mio. USD05MER per yr) +; + +variables + vm_btm_reg(i,emis_source,pollutants) Regional emissions before technical mitigation (Tg per yr) + vm_btm_cell(j,emis_source,pollutants) Cellular emissions before technical mitigation (Tg per yr) + vm_emission_costs(i) Costs for emission rights for pollutants and greenhouse gases (mio. USD05MER per yr) + vm_emissions_reg(i,emis_source,pollutants) Regional emissions by source and gas after technical mitigation N CH4 C (Tg per yr) + v56_emis_cell(j,emis_source,pollutants) Cellular emissions by source and gas after technical mitigation N CH4 C (Tg per yr) + v56_emission_costs_reg_yearly(i,emis_reg_yr56) Costs for emissions occuring yearly (mio. USD05MER per yr) + v56_emission_costs_reg_oneoff(i,emis_reg_one56) Costs for emissions occuring only once in time (mio. USD05MER per yr) + v56_emission_costs_cell_yearly(j,emis_cell_yr56) Costs for emissions occuring yearly (mio. USD05MER per yr) + v56_emission_costs_cell_oneoff(j,emis_cell_one56) Costs for emissions occuring only once in time (mio. USD05MER per yr) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov56_reward_cdr_aff(t,j,type) Cellular revenues for carbon captured by afforestation (mio. USD05MER per yr) + ov_reward_cdr_aff(t,i,type) Regional revenues for carbon captured by afforestation (mio. USD05MER per yr) + ov_btm_reg(t,i,emis_source,pollutants,type) Regional emissions before technical mitigation (Tg per yr) + ov_btm_cell(t,j,emis_source,pollutants,type) Cellular emissions before technical mitigation (Tg per yr) + ov_emission_costs(t,i,type) Costs for emission rights for pollutants and greenhouse gases (mio. USD05MER per yr) + ov_emissions_reg(t,i,emis_source,pollutants,type) Regional emissions by source and gas after technical mitigation N CH4 C (Tg per yr) + ov56_emis_cell(t,j,emis_source,pollutants,type) Cellular emissions by source and gas after technical mitigation N CH4 C (Tg per yr) + ov56_emission_costs_reg_yearly(t,i,emis_reg_yr56,type) Costs for emissions occuring yearly (mio. USD05MER per yr) + ov56_emission_costs_reg_oneoff(t,i,emis_reg_one56,type) Costs for emissions occuring only once in time (mio. USD05MER per yr) + ov56_emission_costs_cell_yearly(t,j,emis_cell_yr56,type) Costs for emissions occuring yearly (mio. USD05MER per yr) + ov56_emission_costs_cell_oneoff(t,j,emis_cell_one56,type) Costs for emissions occuring only once in time (mio. USD05MER per yr) + oq56_technical_mitigation_reg(t,i,pollutants,emis_source,type) Application of maccs on emissions (Tg per yr) + oq56_technical_mitigation_cell(t,j,pollutants,emis_source,type) Application of maccs on emissions (Tg per yr) + oq56_cell_to_reg(t,i,pollutants,emis_source,type) Aggregation to regional emissions (Tg per yr) + oq56_emission_costs(t,i,type) Calculation of total emission costs (mio. USD05MER per yr) + oq56_emission_costs_reg_yearly(t,i,emis_reg_yr56,type) Calculation of regional costs for annual emissions (mio. USD05MER per yr) + oq56_emission_costs_reg_oneoff(t,i,emis_reg_one56,type) Calculation of regional costs for emissions occuring only once in time (mio. USD05MER per yr) + oq56_emission_costs_cell_yearly(t,j,emis_cell_yr56,type) Calculation of cellular costs for annual emissions (mio. USD05MER per yr) + oq56_emission_costs_cell_oneoff(t,j,emis_cell_one56,type) Calculation of cellular costs for emissions occuring only once in time (mio. USD05MER per yr) + oq56_reward_cdr_aff_reg(t,i,type) Regional revenues for carbon captured by afforestation (mio. USD05MER per yr) + oq56_reward_cdr_aff(t,j,type) Cellular revenues for carbon captured by afforestation (mio. USD05MER per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/56_ghg_policy/price_jan19/equations.gms b/modules/56_ghg_policy/price_jan19/equations.gms index 971fa0ba58..c2d26e08e0 100644 --- a/modules/56_ghg_policy/price_jan19/equations.gms +++ b/modules/56_ghg_policy/price_jan19/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 @@ -109,4 +110,4 @@ q56_cell_to_reg(i2,pollutants,emis_source) .. sum((ct,cell(i2,j2)), im_pollutant_prices(ct,i2,"co2_c") * p56_ghg_price_growth_rate(ct,i2,"co2_c")/(1+p56_ghg_price_growth_rate(ct,i2,"co2_c")) - ); \ No newline at end of file + ); diff --git a/modules/56_ghg_policy/price_jan19/input.gms b/modules/56_ghg_policy/price_jan19/input.gms index 534404b1c8..293abbe2d1 100644 --- a/modules/56_ghg_policy/price_jan19/input.gms +++ b/modules/56_ghg_policy/price_jan19/input.gms @@ -1,42 +1,42 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -scalars - s56_reward_neg_emis reward CDR from all sources (-Inf) or only from afforestation (0) (1) / 0 / - s56_limit_ch4_n2o_price upper limit for CH4 and N2O GHG prices (USD05MER per tC) / 1000 / - s56_cprice_red_factor reduction factor for CO2 price (-) / 0.5 / - s56_ghgprice_start start year for ghg price phase in / 2025 / -; - -$setglobal c56_pollutant_prices SSP2-Ref-SPA0-V15-REMIND-MAGPIE -$setglobal c56_emis_policy ssp -$setglobal c56_aff_policy vegc50 - -table f56_pollutant_prices(t_all,i,pollutants,ghgscen56) GHG certificate prices for N2O-N CH4 CO2-C (USD05MER per t) -$ondelim -$include "./modules/56_ghg_policy/input/f56_pollutant_prices.cs3" -$offdelim -; - -$if "%c56_pollutant_prices%" == "coupling" table f56_pollutant_prices_coupling(t_all,i,pollutants) Regional ghg certificate prices for N2O-N CH4 CO2-C (USD05MER per t) -$if "%c56_pollutant_prices%" == "coupling" $ondelim -$if "%c56_pollutant_prices%" == "coupling" $include "./modules/56_ghg_policy/input/f56_pollutant_prices_coupling.cs3" -$if "%c56_pollutant_prices%" == "coupling" $offdelim -$if "%c56_pollutant_prices%" == "coupling" ; - -$if "%c56_pollutant_prices%" == "emulator" table f56_pollutant_prices_emulator(t_all,pollutants) Global ghg certificate prices for N2O-N CH4 CO2-C (USD05MER per t) -$if "%c56_pollutant_prices%" == "emulator" $ondelim -$if "%c56_pollutant_prices%" == "emulator" $include "./modules/56_ghg_policy/input/f56_pollutant_prices_emulator.cs3" -$if "%c56_pollutant_prices%" == "emulator" $offdelim -$if "%c56_pollutant_prices%" == "emulator" ; - -*' `f56_emis_policy` contains scenarios determining for each gas and source whether it is priced or not. - -table f56_emis_policy(scen56,pollutants_all,emis_source) GHG emission policy scenarios (1) -$ondelim -$include "./modules/56_ghg_policy/input/f56_emis_policy.csv" -$offdelim -; +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +scalars + s56_reward_neg_emis reward CDR from all sources (-Inf) or only from afforestation (0) (1) / 0 / + s56_limit_ch4_n2o_price upper limit for CH4 and N2O GHG prices (USD05MER per tC) / 1000 / + s56_cprice_red_factor reduction factor for CO2 price (-) / 0.5 / + s56_ghgprice_start start year for ghg price phase in / 2025 / +; + +$setglobal c56_pollutant_prices R2M41-SSP2-NPi +$setglobal c56_emis_policy ssp + +table f56_pollutant_prices(t_all,i,pollutants,ghgscen56) GHG certificate prices for N2O-N CH4 CO2-C (USD05MER per t) +$ondelim +$include "./modules/56_ghg_policy/input/f56_pollutant_prices.cs3" +$offdelim +; + +$if "%c56_pollutant_prices%" == "coupling" table f56_pollutant_prices_coupling(t_all,i,pollutants) Regional ghg certificate prices for N2O-N CH4 CO2-C (USD05MER per t) +$if "%c56_pollutant_prices%" == "coupling" $ondelim +$if "%c56_pollutant_prices%" == "coupling" $include "./modules/56_ghg_policy/input/f56_pollutant_prices_coupling.cs3" +$if "%c56_pollutant_prices%" == "coupling" $offdelim +$if "%c56_pollutant_prices%" == "coupling" ; + +$if "%c56_pollutant_prices%" == "emulator" table f56_pollutant_prices_emulator(t_all,pollutants) Global ghg certificate prices for N2O-N CH4 CO2-C (USD05MER per t) +$if "%c56_pollutant_prices%" == "emulator" $ondelim +$if "%c56_pollutant_prices%" == "emulator" $include "./modules/56_ghg_policy/input/f56_pollutant_prices_emulator.cs3" +$if "%c56_pollutant_prices%" == "emulator" $offdelim +$if "%c56_pollutant_prices%" == "emulator" ; + +*' `f56_emis_policy` contains scenarios determining for each gas and source whether it is priced or not. + +table f56_emis_policy(scen56,pollutants_all,emis_source) GHG emission policy scenarios (1) +$ondelim +$include "./modules/56_ghg_policy/input/f56_emis_policy.csv" +$offdelim +; diff --git a/modules/56_ghg_policy/price_jan19/not_used.txt b/modules/56_ghg_policy/price_jan19/not_used.txt index 6ece3f27a1..4b81dfbae2 100644 --- a/modules/56_ghg_policy/price_jan19/not_used.txt +++ b/modules/56_ghg_policy/price_jan19/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason diff --git a/modules/56_ghg_policy/price_jan19/postsolve.gms b/modules/56_ghg_policy/price_jan19/postsolve.gms index d3c65a259c..2d9ecebeef 100644 --- a/modules/56_ghg_policy/price_jan19/postsolve.gms +++ b/modules/56_ghg_policy/price_jan19/postsolve.gms @@ -1,94 +1,95 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov56_reward_cdr_aff(t,j,"marginal") = v56_reward_cdr_aff.m(j); - ov_reward_cdr_aff(t,i,"marginal") = vm_reward_cdr_aff.m(i); - ov_btm_reg(t,i,emis_source,pollutants,"marginal") = vm_btm_reg.m(i,emis_source,pollutants); - ov_btm_cell(t,j,emis_source,pollutants,"marginal") = vm_btm_cell.m(j,emis_source,pollutants); - ov_emission_costs(t,i,"marginal") = vm_emission_costs.m(i); - ov_emissions_reg(t,i,emis_source,pollutants,"marginal") = vm_emissions_reg.m(i,emis_source,pollutants); - ov56_emis_cell(t,j,emis_source,pollutants,"marginal") = v56_emis_cell.m(j,emis_source,pollutants); - ov56_emission_costs_reg_yearly(t,i,emis_reg_yr56,"marginal") = v56_emission_costs_reg_yearly.m(i,emis_reg_yr56); - ov56_emission_costs_reg_oneoff(t,i,emis_reg_one56,"marginal") = v56_emission_costs_reg_oneoff.m(i,emis_reg_one56); - ov56_emission_costs_cell_yearly(t,j,emis_cell_yr56,"marginal") = v56_emission_costs_cell_yearly.m(j,emis_cell_yr56); - ov56_emission_costs_cell_oneoff(t,j,emis_cell_one56,"marginal") = v56_emission_costs_cell_oneoff.m(j,emis_cell_one56); - oq56_technical_mitigation_reg(t,i,pollutants,emis_source,"marginal") = q56_technical_mitigation_reg.m(i,pollutants,emis_source); - oq56_technical_mitigation_cell(t,j,pollutants,emis_source,"marginal") = q56_technical_mitigation_cell.m(j,pollutants,emis_source); - oq56_cell_to_reg(t,i,pollutants,emis_source,"marginal") = q56_cell_to_reg.m(i,pollutants,emis_source); - oq56_emission_costs(t,i,"marginal") = q56_emission_costs.m(i); - oq56_emission_costs_reg_yearly(t,i,emis_reg_yr56,"marginal") = q56_emission_costs_reg_yearly.m(i,emis_reg_yr56); - oq56_emission_costs_reg_oneoff(t,i,emis_reg_one56,"marginal") = q56_emission_costs_reg_oneoff.m(i,emis_reg_one56); - oq56_emission_costs_cell_yearly(t,j,emis_cell_yr56,"marginal") = q56_emission_costs_cell_yearly.m(j,emis_cell_yr56); - oq56_emission_costs_cell_oneoff(t,j,emis_cell_one56,"marginal") = q56_emission_costs_cell_oneoff.m(j,emis_cell_one56); - oq56_reward_cdr_aff_reg(t,i,"marginal") = q56_reward_cdr_aff_reg.m(i); - oq56_reward_cdr_aff(t,j,"marginal") = q56_reward_cdr_aff.m(j); - ov56_reward_cdr_aff(t,j,"level") = v56_reward_cdr_aff.l(j); - ov_reward_cdr_aff(t,i,"level") = vm_reward_cdr_aff.l(i); - ov_btm_reg(t,i,emis_source,pollutants,"level") = vm_btm_reg.l(i,emis_source,pollutants); - ov_btm_cell(t,j,emis_source,pollutants,"level") = vm_btm_cell.l(j,emis_source,pollutants); - ov_emission_costs(t,i,"level") = vm_emission_costs.l(i); - ov_emissions_reg(t,i,emis_source,pollutants,"level") = vm_emissions_reg.l(i,emis_source,pollutants); - ov56_emis_cell(t,j,emis_source,pollutants,"level") = v56_emis_cell.l(j,emis_source,pollutants); - ov56_emission_costs_reg_yearly(t,i,emis_reg_yr56,"level") = v56_emission_costs_reg_yearly.l(i,emis_reg_yr56); - ov56_emission_costs_reg_oneoff(t,i,emis_reg_one56,"level") = v56_emission_costs_reg_oneoff.l(i,emis_reg_one56); - ov56_emission_costs_cell_yearly(t,j,emis_cell_yr56,"level") = v56_emission_costs_cell_yearly.l(j,emis_cell_yr56); - ov56_emission_costs_cell_oneoff(t,j,emis_cell_one56,"level") = v56_emission_costs_cell_oneoff.l(j,emis_cell_one56); - oq56_technical_mitigation_reg(t,i,pollutants,emis_source,"level") = q56_technical_mitigation_reg.l(i,pollutants,emis_source); - oq56_technical_mitigation_cell(t,j,pollutants,emis_source,"level") = q56_technical_mitigation_cell.l(j,pollutants,emis_source); - oq56_cell_to_reg(t,i,pollutants,emis_source,"level") = q56_cell_to_reg.l(i,pollutants,emis_source); - oq56_emission_costs(t,i,"level") = q56_emission_costs.l(i); - oq56_emission_costs_reg_yearly(t,i,emis_reg_yr56,"level") = q56_emission_costs_reg_yearly.l(i,emis_reg_yr56); - oq56_emission_costs_reg_oneoff(t,i,emis_reg_one56,"level") = q56_emission_costs_reg_oneoff.l(i,emis_reg_one56); - oq56_emission_costs_cell_yearly(t,j,emis_cell_yr56,"level") = q56_emission_costs_cell_yearly.l(j,emis_cell_yr56); - oq56_emission_costs_cell_oneoff(t,j,emis_cell_one56,"level") = q56_emission_costs_cell_oneoff.l(j,emis_cell_one56); - oq56_reward_cdr_aff_reg(t,i,"level") = q56_reward_cdr_aff_reg.l(i); - oq56_reward_cdr_aff(t,j,"level") = q56_reward_cdr_aff.l(j); - ov56_reward_cdr_aff(t,j,"upper") = v56_reward_cdr_aff.up(j); - ov_reward_cdr_aff(t,i,"upper") = vm_reward_cdr_aff.up(i); - ov_btm_reg(t,i,emis_source,pollutants,"upper") = vm_btm_reg.up(i,emis_source,pollutants); - ov_btm_cell(t,j,emis_source,pollutants,"upper") = vm_btm_cell.up(j,emis_source,pollutants); - ov_emission_costs(t,i,"upper") = vm_emission_costs.up(i); - ov_emissions_reg(t,i,emis_source,pollutants,"upper") = vm_emissions_reg.up(i,emis_source,pollutants); - ov56_emis_cell(t,j,emis_source,pollutants,"upper") = v56_emis_cell.up(j,emis_source,pollutants); - ov56_emission_costs_reg_yearly(t,i,emis_reg_yr56,"upper") = v56_emission_costs_reg_yearly.up(i,emis_reg_yr56); - ov56_emission_costs_reg_oneoff(t,i,emis_reg_one56,"upper") = v56_emission_costs_reg_oneoff.up(i,emis_reg_one56); - ov56_emission_costs_cell_yearly(t,j,emis_cell_yr56,"upper") = v56_emission_costs_cell_yearly.up(j,emis_cell_yr56); - ov56_emission_costs_cell_oneoff(t,j,emis_cell_one56,"upper") = v56_emission_costs_cell_oneoff.up(j,emis_cell_one56); - oq56_technical_mitigation_reg(t,i,pollutants,emis_source,"upper") = q56_technical_mitigation_reg.up(i,pollutants,emis_source); - oq56_technical_mitigation_cell(t,j,pollutants,emis_source,"upper") = q56_technical_mitigation_cell.up(j,pollutants,emis_source); - oq56_cell_to_reg(t,i,pollutants,emis_source,"upper") = q56_cell_to_reg.up(i,pollutants,emis_source); - oq56_emission_costs(t,i,"upper") = q56_emission_costs.up(i); - oq56_emission_costs_reg_yearly(t,i,emis_reg_yr56,"upper") = q56_emission_costs_reg_yearly.up(i,emis_reg_yr56); - oq56_emission_costs_reg_oneoff(t,i,emis_reg_one56,"upper") = q56_emission_costs_reg_oneoff.up(i,emis_reg_one56); - oq56_emission_costs_cell_yearly(t,j,emis_cell_yr56,"upper") = q56_emission_costs_cell_yearly.up(j,emis_cell_yr56); - oq56_emission_costs_cell_oneoff(t,j,emis_cell_one56,"upper") = q56_emission_costs_cell_oneoff.up(j,emis_cell_one56); - oq56_reward_cdr_aff_reg(t,i,"upper") = q56_reward_cdr_aff_reg.up(i); - oq56_reward_cdr_aff(t,j,"upper") = q56_reward_cdr_aff.up(j); - ov56_reward_cdr_aff(t,j,"lower") = v56_reward_cdr_aff.lo(j); - ov_reward_cdr_aff(t,i,"lower") = vm_reward_cdr_aff.lo(i); - ov_btm_reg(t,i,emis_source,pollutants,"lower") = vm_btm_reg.lo(i,emis_source,pollutants); - ov_btm_cell(t,j,emis_source,pollutants,"lower") = vm_btm_cell.lo(j,emis_source,pollutants); - ov_emission_costs(t,i,"lower") = vm_emission_costs.lo(i); - ov_emissions_reg(t,i,emis_source,pollutants,"lower") = vm_emissions_reg.lo(i,emis_source,pollutants); - ov56_emis_cell(t,j,emis_source,pollutants,"lower") = v56_emis_cell.lo(j,emis_source,pollutants); - ov56_emission_costs_reg_yearly(t,i,emis_reg_yr56,"lower") = v56_emission_costs_reg_yearly.lo(i,emis_reg_yr56); - ov56_emission_costs_reg_oneoff(t,i,emis_reg_one56,"lower") = v56_emission_costs_reg_oneoff.lo(i,emis_reg_one56); - ov56_emission_costs_cell_yearly(t,j,emis_cell_yr56,"lower") = v56_emission_costs_cell_yearly.lo(j,emis_cell_yr56); - ov56_emission_costs_cell_oneoff(t,j,emis_cell_one56,"lower") = v56_emission_costs_cell_oneoff.lo(j,emis_cell_one56); - oq56_technical_mitigation_reg(t,i,pollutants,emis_source,"lower") = q56_technical_mitigation_reg.lo(i,pollutants,emis_source); - oq56_technical_mitigation_cell(t,j,pollutants,emis_source,"lower") = q56_technical_mitigation_cell.lo(j,pollutants,emis_source); - oq56_cell_to_reg(t,i,pollutants,emis_source,"lower") = q56_cell_to_reg.lo(i,pollutants,emis_source); - oq56_emission_costs(t,i,"lower") = q56_emission_costs.lo(i); - oq56_emission_costs_reg_yearly(t,i,emis_reg_yr56,"lower") = q56_emission_costs_reg_yearly.lo(i,emis_reg_yr56); - oq56_emission_costs_reg_oneoff(t,i,emis_reg_one56,"lower") = q56_emission_costs_reg_oneoff.lo(i,emis_reg_one56); - oq56_emission_costs_cell_yearly(t,j,emis_cell_yr56,"lower") = q56_emission_costs_cell_yearly.lo(j,emis_cell_yr56); - oq56_emission_costs_cell_oneoff(t,j,emis_cell_one56,"lower") = q56_emission_costs_cell_oneoff.lo(j,emis_cell_one56); - oq56_reward_cdr_aff_reg(t,i,"lower") = q56_reward_cdr_aff_reg.lo(i); - oq56_reward_cdr_aff(t,j,"lower") = q56_reward_cdr_aff.lo(j); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 + + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov56_reward_cdr_aff(t,j,"marginal") = v56_reward_cdr_aff.m(j); + ov_reward_cdr_aff(t,i,"marginal") = vm_reward_cdr_aff.m(i); + ov_btm_reg(t,i,emis_source,pollutants,"marginal") = vm_btm_reg.m(i,emis_source,pollutants); + ov_btm_cell(t,j,emis_source,pollutants,"marginal") = vm_btm_cell.m(j,emis_source,pollutants); + ov_emission_costs(t,i,"marginal") = vm_emission_costs.m(i); + ov_emissions_reg(t,i,emis_source,pollutants,"marginal") = vm_emissions_reg.m(i,emis_source,pollutants); + ov56_emis_cell(t,j,emis_source,pollutants,"marginal") = v56_emis_cell.m(j,emis_source,pollutants); + ov56_emission_costs_reg_yearly(t,i,emis_reg_yr56,"marginal") = v56_emission_costs_reg_yearly.m(i,emis_reg_yr56); + ov56_emission_costs_reg_oneoff(t,i,emis_reg_one56,"marginal") = v56_emission_costs_reg_oneoff.m(i,emis_reg_one56); + ov56_emission_costs_cell_yearly(t,j,emis_cell_yr56,"marginal") = v56_emission_costs_cell_yearly.m(j,emis_cell_yr56); + ov56_emission_costs_cell_oneoff(t,j,emis_cell_one56,"marginal") = v56_emission_costs_cell_oneoff.m(j,emis_cell_one56); + oq56_technical_mitigation_reg(t,i,pollutants,emis_source,"marginal") = q56_technical_mitigation_reg.m(i,pollutants,emis_source); + oq56_technical_mitigation_cell(t,j,pollutants,emis_source,"marginal") = q56_technical_mitigation_cell.m(j,pollutants,emis_source); + oq56_cell_to_reg(t,i,pollutants,emis_source,"marginal") = q56_cell_to_reg.m(i,pollutants,emis_source); + oq56_emission_costs(t,i,"marginal") = q56_emission_costs.m(i); + oq56_emission_costs_reg_yearly(t,i,emis_reg_yr56,"marginal") = q56_emission_costs_reg_yearly.m(i,emis_reg_yr56); + oq56_emission_costs_reg_oneoff(t,i,emis_reg_one56,"marginal") = q56_emission_costs_reg_oneoff.m(i,emis_reg_one56); + oq56_emission_costs_cell_yearly(t,j,emis_cell_yr56,"marginal") = q56_emission_costs_cell_yearly.m(j,emis_cell_yr56); + oq56_emission_costs_cell_oneoff(t,j,emis_cell_one56,"marginal") = q56_emission_costs_cell_oneoff.m(j,emis_cell_one56); + oq56_reward_cdr_aff_reg(t,i,"marginal") = q56_reward_cdr_aff_reg.m(i); + oq56_reward_cdr_aff(t,j,"marginal") = q56_reward_cdr_aff.m(j); + ov56_reward_cdr_aff(t,j,"level") = v56_reward_cdr_aff.l(j); + ov_reward_cdr_aff(t,i,"level") = vm_reward_cdr_aff.l(i); + ov_btm_reg(t,i,emis_source,pollutants,"level") = vm_btm_reg.l(i,emis_source,pollutants); + ov_btm_cell(t,j,emis_source,pollutants,"level") = vm_btm_cell.l(j,emis_source,pollutants); + ov_emission_costs(t,i,"level") = vm_emission_costs.l(i); + ov_emissions_reg(t,i,emis_source,pollutants,"level") = vm_emissions_reg.l(i,emis_source,pollutants); + ov56_emis_cell(t,j,emis_source,pollutants,"level") = v56_emis_cell.l(j,emis_source,pollutants); + ov56_emission_costs_reg_yearly(t,i,emis_reg_yr56,"level") = v56_emission_costs_reg_yearly.l(i,emis_reg_yr56); + ov56_emission_costs_reg_oneoff(t,i,emis_reg_one56,"level") = v56_emission_costs_reg_oneoff.l(i,emis_reg_one56); + ov56_emission_costs_cell_yearly(t,j,emis_cell_yr56,"level") = v56_emission_costs_cell_yearly.l(j,emis_cell_yr56); + ov56_emission_costs_cell_oneoff(t,j,emis_cell_one56,"level") = v56_emission_costs_cell_oneoff.l(j,emis_cell_one56); + oq56_technical_mitigation_reg(t,i,pollutants,emis_source,"level") = q56_technical_mitigation_reg.l(i,pollutants,emis_source); + oq56_technical_mitigation_cell(t,j,pollutants,emis_source,"level") = q56_technical_mitigation_cell.l(j,pollutants,emis_source); + oq56_cell_to_reg(t,i,pollutants,emis_source,"level") = q56_cell_to_reg.l(i,pollutants,emis_source); + oq56_emission_costs(t,i,"level") = q56_emission_costs.l(i); + oq56_emission_costs_reg_yearly(t,i,emis_reg_yr56,"level") = q56_emission_costs_reg_yearly.l(i,emis_reg_yr56); + oq56_emission_costs_reg_oneoff(t,i,emis_reg_one56,"level") = q56_emission_costs_reg_oneoff.l(i,emis_reg_one56); + oq56_emission_costs_cell_yearly(t,j,emis_cell_yr56,"level") = q56_emission_costs_cell_yearly.l(j,emis_cell_yr56); + oq56_emission_costs_cell_oneoff(t,j,emis_cell_one56,"level") = q56_emission_costs_cell_oneoff.l(j,emis_cell_one56); + oq56_reward_cdr_aff_reg(t,i,"level") = q56_reward_cdr_aff_reg.l(i); + oq56_reward_cdr_aff(t,j,"level") = q56_reward_cdr_aff.l(j); + ov56_reward_cdr_aff(t,j,"upper") = v56_reward_cdr_aff.up(j); + ov_reward_cdr_aff(t,i,"upper") = vm_reward_cdr_aff.up(i); + ov_btm_reg(t,i,emis_source,pollutants,"upper") = vm_btm_reg.up(i,emis_source,pollutants); + ov_btm_cell(t,j,emis_source,pollutants,"upper") = vm_btm_cell.up(j,emis_source,pollutants); + ov_emission_costs(t,i,"upper") = vm_emission_costs.up(i); + ov_emissions_reg(t,i,emis_source,pollutants,"upper") = vm_emissions_reg.up(i,emis_source,pollutants); + ov56_emis_cell(t,j,emis_source,pollutants,"upper") = v56_emis_cell.up(j,emis_source,pollutants); + ov56_emission_costs_reg_yearly(t,i,emis_reg_yr56,"upper") = v56_emission_costs_reg_yearly.up(i,emis_reg_yr56); + ov56_emission_costs_reg_oneoff(t,i,emis_reg_one56,"upper") = v56_emission_costs_reg_oneoff.up(i,emis_reg_one56); + ov56_emission_costs_cell_yearly(t,j,emis_cell_yr56,"upper") = v56_emission_costs_cell_yearly.up(j,emis_cell_yr56); + ov56_emission_costs_cell_oneoff(t,j,emis_cell_one56,"upper") = v56_emission_costs_cell_oneoff.up(j,emis_cell_one56); + oq56_technical_mitigation_reg(t,i,pollutants,emis_source,"upper") = q56_technical_mitigation_reg.up(i,pollutants,emis_source); + oq56_technical_mitigation_cell(t,j,pollutants,emis_source,"upper") = q56_technical_mitigation_cell.up(j,pollutants,emis_source); + oq56_cell_to_reg(t,i,pollutants,emis_source,"upper") = q56_cell_to_reg.up(i,pollutants,emis_source); + oq56_emission_costs(t,i,"upper") = q56_emission_costs.up(i); + oq56_emission_costs_reg_yearly(t,i,emis_reg_yr56,"upper") = q56_emission_costs_reg_yearly.up(i,emis_reg_yr56); + oq56_emission_costs_reg_oneoff(t,i,emis_reg_one56,"upper") = q56_emission_costs_reg_oneoff.up(i,emis_reg_one56); + oq56_emission_costs_cell_yearly(t,j,emis_cell_yr56,"upper") = q56_emission_costs_cell_yearly.up(j,emis_cell_yr56); + oq56_emission_costs_cell_oneoff(t,j,emis_cell_one56,"upper") = q56_emission_costs_cell_oneoff.up(j,emis_cell_one56); + oq56_reward_cdr_aff_reg(t,i,"upper") = q56_reward_cdr_aff_reg.up(i); + oq56_reward_cdr_aff(t,j,"upper") = q56_reward_cdr_aff.up(j); + ov56_reward_cdr_aff(t,j,"lower") = v56_reward_cdr_aff.lo(j); + ov_reward_cdr_aff(t,i,"lower") = vm_reward_cdr_aff.lo(i); + ov_btm_reg(t,i,emis_source,pollutants,"lower") = vm_btm_reg.lo(i,emis_source,pollutants); + ov_btm_cell(t,j,emis_source,pollutants,"lower") = vm_btm_cell.lo(j,emis_source,pollutants); + ov_emission_costs(t,i,"lower") = vm_emission_costs.lo(i); + ov_emissions_reg(t,i,emis_source,pollutants,"lower") = vm_emissions_reg.lo(i,emis_source,pollutants); + ov56_emis_cell(t,j,emis_source,pollutants,"lower") = v56_emis_cell.lo(j,emis_source,pollutants); + ov56_emission_costs_reg_yearly(t,i,emis_reg_yr56,"lower") = v56_emission_costs_reg_yearly.lo(i,emis_reg_yr56); + ov56_emission_costs_reg_oneoff(t,i,emis_reg_one56,"lower") = v56_emission_costs_reg_oneoff.lo(i,emis_reg_one56); + ov56_emission_costs_cell_yearly(t,j,emis_cell_yr56,"lower") = v56_emission_costs_cell_yearly.lo(j,emis_cell_yr56); + ov56_emission_costs_cell_oneoff(t,j,emis_cell_one56,"lower") = v56_emission_costs_cell_oneoff.lo(j,emis_cell_one56); + oq56_technical_mitigation_reg(t,i,pollutants,emis_source,"lower") = q56_technical_mitigation_reg.lo(i,pollutants,emis_source); + oq56_technical_mitigation_cell(t,j,pollutants,emis_source,"lower") = q56_technical_mitigation_cell.lo(j,pollutants,emis_source); + oq56_cell_to_reg(t,i,pollutants,emis_source,"lower") = q56_cell_to_reg.lo(i,pollutants,emis_source); + oq56_emission_costs(t,i,"lower") = q56_emission_costs.lo(i); + oq56_emission_costs_reg_yearly(t,i,emis_reg_yr56,"lower") = q56_emission_costs_reg_yearly.lo(i,emis_reg_yr56); + oq56_emission_costs_reg_oneoff(t,i,emis_reg_one56,"lower") = q56_emission_costs_reg_oneoff.lo(i,emis_reg_one56); + oq56_emission_costs_cell_yearly(t,j,emis_cell_yr56,"lower") = q56_emission_costs_cell_yearly.lo(j,emis_cell_yr56); + oq56_emission_costs_cell_oneoff(t,j,emis_cell_one56,"lower") = q56_emission_costs_cell_oneoff.lo(j,emis_cell_one56); + oq56_reward_cdr_aff_reg(t,i,"lower") = q56_reward_cdr_aff_reg.lo(i); + oq56_reward_cdr_aff(t,j,"lower") = q56_reward_cdr_aff.lo(j); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/56_ghg_policy/price_jan19/preloop.gms b/modules/56_ghg_policy/price_jan19/preloop.gms index 1223cd9ac9..724f65556b 100644 --- a/modules/56_ghg_policy/price_jan19/preloop.gms +++ b/modules/56_ghg_policy/price_jan19/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/56_ghg_policy/price_jan19.gms b/modules/56_ghg_policy/price_jan19/realization.gms similarity index 80% rename from modules/56_ghg_policy/price_jan19.gms rename to modules/56_ghg_policy/price_jan19/realization.gms index 850176417d..2565ef9cff 100644 --- a/modules/56_ghg_policy/price_jan19.gms +++ b/modules/56_ghg_policy/price_jan19/realization.gms @@ -1,25 +1,26 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description The price_sep16 realization applies pollutant prices to different -*' emission types depending on the emission pricing policy defined in `f56_emis_policy`. -*' In addition, carbon dioxide removal (CDR) from afforestation [32_forestry] is -*' rewarded depending on the afforestation incentive policy defined in `f56_aff_policy`. -*' For CO2 emissions from land-use change and CDR from afforestation, the growth rate -*' of the CO2 price is used to annuitize associated emission costs. -*' If pollutant prices are zero, which is the default for reference scenarios without -*' mitigation, total emission costs entering the objective function are zero. - - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/56_ghg_policy/price_jan19/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/56_ghg_policy/price_jan19/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/56_ghg_policy/price_jan19/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/56_ghg_policy/price_jan19/equations.gms" -$Ifi "%phase%" == "scaling" $include "./modules/56_ghg_policy/price_jan19/scaling.gms" -$Ifi "%phase%" == "preloop" $include "./modules/56_ghg_policy/price_jan19/preloop.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/56_ghg_policy/price_jan19/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description The price_sep16 realization applies pollutant prices to different +*' emission types depending on the emission pricing policy defined in `f56_emis_policy`. +*' In addition, carbon dioxide removal (CDR) from afforestation [32_forestry] is +*' rewarded depending on the afforestation incentive policy defined in `f56_aff_policy`. +*' For CO2 emissions from land-use change and CDR from afforestation, the growth rate +*' of the CO2 price is used to annuitize associated emission costs. +*' If pollutant prices are zero, which is the default for reference scenarios without +*' mitigation, total emission costs entering the objective function are zero. + + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/56_ghg_policy/price_jan19/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/56_ghg_policy/price_jan19/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/56_ghg_policy/price_jan19/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/56_ghg_policy/price_jan19/equations.gms" +$Ifi "%phase%" == "scaling" $include "./modules/56_ghg_policy/price_jan19/scaling.gms" +$Ifi "%phase%" == "preloop" $include "./modules/56_ghg_policy/price_jan19/preloop.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/56_ghg_policy/price_jan19/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/56_ghg_policy/price_jan19/scaling.gms b/modules/56_ghg_policy/price_jan19/scaling.gms index bbabe78e5a..493ddd7142 100644 --- a/modules/56_ghg_policy/price_jan19/scaling.gms +++ b/modules/56_ghg_policy/price_jan19/scaling.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 v56_emission_costs_reg_yearly.scale(i,emis_reg_yr56) = 10e5; diff --git a/modules/56_ghg_policy/price_jan19/sets.gms b/modules/56_ghg_policy/price_jan19/sets.gms index 2844bc4efc..6052edfe09 100644 --- a/modules/56_ghg_policy/price_jan19/sets.gms +++ b/modules/56_ghg_policy/price_jan19/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets @@ -46,42 +47,34 @@ sets / inorg_fert, man_crop, resid, som, rice / ghgscen56 ghg price scenarios - /SSP1-20-SPA1-V15-IMAGE,SSP1-26-SPA1-V15-IMAGE, - SSP1-34-SPA1-V15-IMAGE,SSP1-45-SPA1-V15-IMAGE, - SSP1-Ref-SPA0-V15-IMAGE, - - SSP1-20-SPA1-V15-REMIND-MAGPIE,SSP1-26-SPA1-V15-REMIND-MAGPIE, - SSP1-34-SPA1-V15-REMIND-MAGPIE,SSP1-37-SPA1-V15-REMIND-MAGPIE, - SSP1-45-SPA1-V15-REMIND-MAGPIE,SSP1-Ref-SPA0-V15-REMIND-MAGPIE, - - SSP2-18-SPA2-V15-MESSAGE-GLOBIOM,SSP2-19-SPA2-V15-MESSAGE-GLOBIOM, - SSP2-20-SPA2-V15-MESSAGE-GLOBIOM,SSP2-26-SPA2-V15-MESSAGE-GLOBIOM, - SSP2-34-SPA2-V15-MESSAGE-GLOBIOM,SSP2-45-SPA2-V15-MESSAGE-GLOBIOM, - SSP2-60-SPA2-V15-MESSAGE-GLOBIOM,SSP2-Ref-SPA0-V15-MESSAGE-GLOBIOM, - - SSP2-20-SPA2-V15-REMIND-MAGPIE,SSP2-26-SPA2-V15-REMIND-MAGPIE, - SSP2-34-SPA2-V15-REMIND-MAGPIE,SSP2-37-SPA2-V15-REMIND-MAGPIE, - SSP2-45-SPA2-V15-REMIND-MAGPIE,SSP2-60-SPA2-V15-REMIND-MAGPIE, - SSP2-Ref-SPA0-V15-REMIND-MAGPIE, - - SSP3-34-SPA3-V15-AIM-CGE,SSP3-45-SPA3-V15-AIM-CGE, - SSP3-60-SPA3-V15-AIM-CGE, - - SSP4-26-SPA4-V15-GCAM4, - SSP4-34-SPA4-V15-GCAM4,SSP4-45-SPA4-V15-GCAM4, - SSP4-60-SPA4-V15-GCAM4,SSP4-Ref-SPA0-V15-GCAM4, - - SSP5-20-SPA5-V15-REMIND-MAGPIE,SSP5-26-SPA5-V15-REMIND-MAGPIE, - SSP5-34-SPA5-V15-REMIND-MAGPIE,SSP5-37-SPA5-V15-REMIND-MAGPIE, - SSP5-45-SPA5-V15-REMIND-MAGPIE,SSP5-60-SPA5-V15-REMIND-MAGPIE, - SSP5-Ref-SPA0-V15-REMIND-MAGPIE / + /R2M41-SSP2-Budg1300,R2M41-SSP2-Budg600, + R2M41-SSP2-Budg950,R2M41-SSP2-NDC,R2M41-SSP2-NPi, + SSPDB-SSP1-20-IMAGE,SSPDB-SSP1-20-REMIND-MAGPIE, + SSPDB-SSP1-26-IMAGE,SSPDB-SSP1-26-REMIND-MAGPIE, + SSPDB-SSP1-34-IMAGE,SSPDB-SSP1-34-REMIND-MAGPIE, + SSPDB-SSP1-37-REMIND-MAGPIE, + SSPDB-SSP1-45-IMAGE,SSPDB-SSP1-45-REMIND-MAGPIE, + SSPDB-SSP1-Ref-IMAGE,SSPDB-SSP1-Ref-REMIND-MAGPIE, + SSPDB-SSP2-18-MESSAGE-GLOBIOM,SSPDB-SSP2-19-MESSAGE-GLOBIOM, + SSPDB-SSP2-20-MESSAGE-GLOBIOM,SSPDB-SSP2-20-REMIND-MAGPIE, + SSPDB-SSP2-26-MESSAGE-GLOBIOM,SSPDB-SSP2-26-REMIND-MAGPIE, + SSPDB-SSP2-34-MESSAGE-GLOBIOM,SSPDB-SSP2-34-REMIND-MAGPIE, + SSPDB-SSP2-37-REMIND-MAGPIE, + SSPDB-SSP2-45-MESSAGE-GLOBIOM,SSPDB-SSP2-45-REMIND-MAGPIE, + SSPDB-SSP2-60-MESSAGE-GLOBIOM,SSPDB-SSP2-60-REMIND-MAGPIE, + SSPDB-SSP2-Ref-MESSAGE-GLOBIOM,SSPDB-SSP2-Ref-REMIND-MAGPIE, + SSPDB-SSP3-34-AIM-CGE,SSPDB-SSP3-45-AIM-CGE, + SSPDB-SSP3-60-AIM-CGE,SSPDB-SSP4-26-GCAM4, + SSPDB-SSP4-34-GCAM4,SSPDB-SSP4-45-GCAM4, + SSPDB-SSP4-60-GCAM4,SSPDB-SSP4-Ref-GCAM4, + SSPDB-SSP5-20-REMIND-MAGPIE,SSPDB-SSP5-26-REMIND-MAGPIE, + SSPDB-SSP5-34-REMIND-MAGPIE,SSPDB-SSP5-37-REMIND-MAGPIE, + SSPDB-SSP5-45-REMIND-MAGPIE,SSPDB-SSP5-60-REMIND-MAGPIE, + SSPDB-SSP5-Ref-REMIND-MAGPIE/ scen56 emission policy scenarios / none, all, ssp / - aff56 afforestation policy scenarios - / none, all, all50, vegc100, vegc75, vegc50, vegc33, vegc25 / - emis_cell_one56(emis_source_cell) cellular oneoff emission sources /crop_vegc, crop_litc, crop_soilc, past_vegc, past_litc, past_soilc, forestry_vegc, forestry_litc, forestry_soilc, primforest_vegc, primforest_litc, primforest_soilc, @@ -101,4 +94,4 @@ sets emis_reg_one56(emis_source_reg) regional oneoff emission sources / / ; -$offempty \ No newline at end of file +$offempty diff --git a/modules/56_ghg_policy/price_sep16.gms b/modules/56_ghg_policy/price_sep16.gms deleted file mode 100644 index fea373c885..0000000000 --- a/modules/56_ghg_policy/price_sep16.gms +++ /dev/null @@ -1,25 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description The price_sep16 realization applies pollutant prices to different -*' emission types depending on the emission pricing policy defined in `f56_emis_policy`. -*' In addition, carbon dioxide removal (CDR) from afforestation [32_forestry] is -*' rewarded depending on the afforestation incentive policy defined in `f56_aff_policy`. -*' For CO2 emissions from land-use change and CDR from afforestation, the growth rate -*' of the CO2 price is used to annuitize associated emission costs. -*' If pollutant prices are zero, which is the default for reference scenarios without -*' mitigation, total emission costs entering the objective function are zero. - - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/56_ghg_policy/price_sep16/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/56_ghg_policy/price_sep16/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/56_ghg_policy/price_sep16/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/56_ghg_policy/price_sep16/equations.gms" -$Ifi "%phase%" == "scaling" $include "./modules/56_ghg_policy/price_sep16/scaling.gms" -$Ifi "%phase%" == "preloop" $include "./modules/56_ghg_policy/price_sep16/preloop.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/56_ghg_policy/price_sep16/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### diff --git a/modules/56_ghg_policy/price_sep16/declarations.gms b/modules/56_ghg_policy/price_sep16/declarations.gms deleted file mode 100644 index ec21095552..0000000000 --- a/modules/56_ghg_policy/price_sep16/declarations.gms +++ /dev/null @@ -1,68 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -parameters - im_pollutant_prices(t,i,pollutants) Certificate prices for N2O-N CH4 CO2-C used in the model (USD05MER per Mg) - p56_pollutant_prices_input(t,i,pollutants) Certificate prices for N2O-N CH4 CO2-C from input files (USD05MER per Mg) - p56_ghg_price_growth_rate(t,i,pollutants) Growth rate of certificate price (% per yr) - p56_ghg_price_growth_rate_avg(i,pollutants) Average over time of growth rate of certificate price (% per yr) -; - -equations - q56_technical_mitigation_reg(i,pollutants,emis_source) Application of maccs on emissions (Tg per yr) - q56_technical_mitigation_cell(j,pollutants,emis_source) Application of maccs on emissions (Tg per yr) - q56_cell_to_reg(i,pollutants,emis_source) Aggregation to regional emissions (Tg per yr) - q56_emission_costs(i) Calculation of total emission costs (mio. USD05MER per yr) - q56_emission_costs_reg_yearly(i,emis_reg_yr56) Calculation of regional costs for annual emissions (mio. USD05MER per yr) - q56_emission_costs_reg_oneoff(i,emis_reg_one56) Calculation of regional costs for emissions occuring only once in time (mio. USD05MER per yr) - q56_emission_costs_cell_yearly(j,emis_cell_yr56) Calculation of cellular costs for annual emissions (mio. USD05MER per yr) - q56_emission_costs_cell_oneoff(j,emis_cell_one56) Calculation of cellular costs for emissions occuring only once in time (mio. USD05MER per yr) - q56_reward_cdr_aff_reg(i) Regional revenues for carbon captured by afforestation (mio. USD05MER per yr) - q56_reward_cdr_aff(j) Cellular revenues for carbon captured by afforestation (mio. USD05MER per yr) -; - -positive variables - v56_reward_cdr_aff(j) Cellular revenues for carbon captured by afforestation (mio. USD05MER per yr) - vm_reward_cdr_aff(i) Regional revenues for carbon captured by afforestation (mio. USD05MER per yr) -; - -variables - vm_btm_reg(i,emis_source,pollutants) Regional emissions before technical mitigation (Tg per yr) - vm_btm_cell(j,emis_source,pollutants) Cellular emissions before technical mitigation (Tg per yr) - vm_emission_costs(i) Costs for emission rights for pollutants and greenhouse gases (mio. USD05MER per yr) - vm_emissions_reg(i,emis_source,pollutants) Regional emissions by source and gas after technical mitigation N CH4 C (Tg per yr) - v56_emis_cell(j,emis_source,pollutants) Cellular emissions by source and gas after technical mitigation N CH4 C (Tg per yr) - v56_emission_costs_reg_yearly(i,emis_reg_yr56) Costs for emissions occuring yearly (mio. USD05MER per yr) - v56_emission_costs_reg_oneoff(i,emis_reg_one56) Costs for emissions occuring only once in time (mio. USD05MER per yr) - v56_emission_costs_cell_yearly(j,emis_cell_yr56) Costs for emissions occuring yearly (mio. USD05MER per yr) - v56_emission_costs_cell_oneoff(j,emis_cell_one56) Costs for emissions occuring only once in time (mio. USD05MER per yr) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov56_reward_cdr_aff(t,j,type) Cellular revenues for carbon captured by afforestation (mio. USD05MER per yr) - ov_reward_cdr_aff(t,i,type) Regional revenues for carbon captured by afforestation (mio. USD05MER per yr) - ov_btm_reg(t,i,emis_source,pollutants,type) Regional emissions before technical mitigation (Tg per yr) - ov_btm_cell(t,j,emis_source,pollutants,type) Cellular emissions before technical mitigation (Tg per yr) - ov_emission_costs(t,i,type) Costs for emission rights for pollutants and greenhouse gases (mio. USD05MER per yr) - ov_emissions_reg(t,i,emis_source,pollutants,type) Regional emissions by source and gas after technical mitigation N CH4 C (Tg per yr) - ov56_emis_cell(t,j,emis_source,pollutants,type) Cellular emissions by source and gas after technical mitigation N CH4 C (Tg per yr) - ov56_emission_costs_reg_yearly(t,i,emis_reg_yr56,type) Costs for emissions occuring yearly (mio. USD05MER per yr) - ov56_emission_costs_reg_oneoff(t,i,emis_reg_one56,type) Costs for emissions occuring only once in time (mio. USD05MER per yr) - ov56_emission_costs_cell_yearly(t,j,emis_cell_yr56,type) Costs for emissions occuring yearly (mio. USD05MER per yr) - ov56_emission_costs_cell_oneoff(t,j,emis_cell_one56,type) Costs for emissions occuring only once in time (mio. USD05MER per yr) - oq56_technical_mitigation_reg(t,i,pollutants,emis_source,type) Application of maccs on emissions (Tg per yr) - oq56_technical_mitigation_cell(t,j,pollutants,emis_source,type) Application of maccs on emissions (Tg per yr) - oq56_cell_to_reg(t,i,pollutants,emis_source,type) Aggregation to regional emissions (Tg per yr) - oq56_emission_costs(t,i,type) Calculation of total emission costs (mio. USD05MER per yr) - oq56_emission_costs_reg_yearly(t,i,emis_reg_yr56,type) Calculation of regional costs for annual emissions (mio. USD05MER per yr) - oq56_emission_costs_reg_oneoff(t,i,emis_reg_one56,type) Calculation of regional costs for emissions occuring only once in time (mio. USD05MER per yr) - oq56_emission_costs_cell_yearly(t,j,emis_cell_yr56,type) Calculation of cellular costs for annual emissions (mio. USD05MER per yr) - oq56_emission_costs_cell_oneoff(t,j,emis_cell_one56,type) Calculation of cellular costs for emissions occuring only once in time (mio. USD05MER per yr) - oq56_reward_cdr_aff_reg(t,i,type) Regional revenues for carbon captured by afforestation (mio. USD05MER per yr) - oq56_reward_cdr_aff(t,j,type) Cellular revenues for carbon captured by afforestation (mio. USD05MER per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/56_ghg_policy/price_sep16/equations.gms b/modules/56_ghg_policy/price_sep16/equations.gms deleted file mode 100644 index c925ac0ceb..0000000000 --- a/modules/56_ghg_policy/price_sep16/equations.gms +++ /dev/null @@ -1,113 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -*' @equations - -*** Calculate emissions for the core - -*** Emissions - -*' Total **regional GHG emissions** `vm_emissions_reg` are the sum of emissions from different regional and cellular sources less -*' the fraction `im_maccs_mitigation` that can be abated by technicial mitigation measures (see module [57_maccs]). The emisssions before technical mitigation -*' are calculated in the respective modules ([51_nitrogen], [52_carbon], [53_methane]) and delivered to this module through the -*' interface variables `vm_btm_reg` and `vm_btm_cell`. - -q56_technical_mitigation_reg(i2,pollutants,emis_source) .. - vm_emissions_reg(i2,emis_source,pollutants) =e= - vm_btm_reg(i2,emis_source,pollutants) - * (1 - sum(ct, im_maccs_mitigation(ct,i2,emis_source,pollutants))) - ; - -q56_technical_mitigation_cell(j2,pollutants,emis_source) .. - v56_emis_cell(j2,emis_source,pollutants) =e= - sum(cell(i2,j2), - vm_btm_cell(j2,emis_source,pollutants) - * (1 - sum(ct, im_maccs_mitigation(ct,i2,emis_source,pollutants)))); - -q56_cell_to_reg(i2,pollutants,emis_source) .. - vm_emissions_reg(i2,emis_source,pollutants) =e= - sum(cell(i2,j2),v56_emis_cell(j2,emis_source,pollutants)); - - -*** Emission costs - -*' **Emission costs** are calculated by multiplying regional and cellular emissions by the emission price `im_pollutant_prices` -*' taking into account the price policy that was defined above in `f56_emis_policy`. - - q56_emission_costs_reg_yearly(i2,emis_reg_yr56) .. - v56_emission_costs_reg_yearly(i2,emis_reg_yr56) =e= - sum(pollutants, - vm_emissions_reg(i2,emis_reg_yr56,pollutants) * - f56_emis_policy("%c56_emis_policy%",pollutants,emis_reg_yr56) * - sum(ct, im_pollutant_prices(ct,i2,pollutants))); - - - q56_emission_costs_cell_yearly(j2,emis_cell_yr56) .. - v56_emission_costs_cell_yearly(j2,emis_cell_yr56) =e= - sum(pollutants, - v56_emis_cell(j2,emis_cell_yr56,pollutants) * - f56_emis_policy("%c56_emis_policy%",pollutants,emis_cell_yr56) * - sum((ct,cell(i2,j2)),im_pollutant_prices(ct,i2,pollutants))); - -*' As MAgPIE is a recursive dynamic model, within the optimization of the current time step it does not account for benefits or costs in future time steps. -*' This can be problematic for the treatment of emissions that occur only once under continuous management (such as deforestation, -*' where the forest has been cut down the cropland can be continuously cultivated without further deforestation emissions) versus -*' emissions that occur continously (such as fertilization emissions, that will re-occur every year for continuously management). -*' We therefore distinguish one-off and yearly emissions, and discount one-off emissions assuming an infinite time-horizon to -*' level them with yearly emissions. Since one-off emissions are delivered by the [52_carbon] module as annual emissions they are -*' multiplied here by the timestep length `m_timestep_length` to obtain emissions for the entire timestep and are then -*' transformed back into annual costs by multiplying by the emission price and a discount factor `p56_ghg_price_growth_rate` -*' that is equal to the growth rate of the emissions price. - - q56_emission_costs_reg_oneoff(i2,emis_reg_one56) .. - v56_emission_costs_reg_oneoff(i2,emis_reg_one56) =g= - sum(pollutants, - vm_emissions_reg(i2,emis_reg_one56,pollutants) - * m_timestep_length - * f56_emis_policy("%c56_emis_policy%",pollutants,emis_reg_one56) - * sum(ct, - im_pollutant_prices(ct,i2,pollutants) - * p56_ghg_price_growth_rate(ct,i2,pollutants)/(1+p56_ghg_price_growth_rate(ct,i2,pollutants))) - ); - - q56_emission_costs_cell_oneoff(j2,emis_cell_one56) .. - v56_emission_costs_cell_oneoff(j2,emis_cell_one56) =g= - sum(pollutants, - v56_emis_cell(j2,emis_cell_one56,pollutants) - * m_timestep_length - * f56_emis_policy("%c56_emis_policy%",pollutants,emis_cell_one56) - * sum((ct,cell(i2,j2)), - im_pollutant_prices(ct,i2,pollutants) - * p56_ghg_price_growth_rate(ct,i2,pollutants)/(1+p56_ghg_price_growth_rate(ct,i2,pollutants))) - ); - -*' **Total regional emission costs** consist of costs from yearly and one-off emissions occuring in this region and its cells. - q56_emission_costs(i2) .. - vm_emission_costs(i2) =e= - sum(emis_reg_yr56, v56_emission_costs_reg_yearly(i2,emis_reg_yr56)) - + sum(emis_reg_one56, v56_emission_costs_reg_oneoff(i2,emis_reg_one56)) - + sum((emis_cell_yr56, cell(i2,j2)), v56_emission_costs_cell_yearly(j2,emis_cell_yr56)) - + sum((emis_cell_one56, cell(i2,j2)), v56_emission_costs_cell_oneoff(j2,emis_cell_one56)) - ; - -*' **Benefits** from carbon removal (from afforestation) are also calculated in this module taking into account the policy that was -*' defined above in `f56_aff_policy`. Cost and benefits are however not summed here but in [11_costs]. - - q56_reward_cdr_aff_reg(i2) .. - vm_reward_cdr_aff(i2) =e= - sum(cell(i2,j2), - v56_reward_cdr_aff(j2) - ); - - q56_reward_cdr_aff(j2) .. - v56_reward_cdr_aff(j2) =e= - vm_cdr_aff(j2) * - f56_aff_policy("forestry_vegc","%c56_aff_policy%") * - sum((ct,cell(i2,j2)), - im_pollutant_prices(ct,i2,"co2_c") - * p56_ghg_price_growth_rate(ct,i2,"co2_c")/(1+p56_ghg_price_growth_rate(ct,i2,"co2_c")) - ); diff --git a/modules/56_ghg_policy/price_sep16/input.gms b/modules/56_ghg_policy/price_sep16/input.gms deleted file mode 100644 index 7b04025563..0000000000 --- a/modules/56_ghg_policy/price_sep16/input.gms +++ /dev/null @@ -1,48 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -scalars - s56_reward_neg_emis reward CDR from all sources (-Inf) or only from afforestation (0) (1) / 0 / - s56_limit_ch4_n2o_price upper limit for CH4 and N2O GHG prices (USD05MER per tC) / 1000 / -; - -$setglobal c56_pollutant_prices SSP2-Ref-SPA0-V15-REMIND-MAGPIE -$setglobal c56_emis_policy ssp -$setglobal c56_aff_policy vegc50 - -table f56_pollutant_prices(t_all,i,pollutants,ghgscen56) ghg certificate prices for N2O-N CH4 CO2-C (USD05MER per t) -$ondelim -$include "./modules/56_ghg_policy/input/f56_pollutant_prices.cs3" -$offdelim -; - -$if "%c56_pollutant_prices%" == "coupling" table f56_pollutant_prices_coupling(t_all,i,pollutants) regional ghg certificate prices for N2O-N CH4 CO2-C (USD05MER per t) -$if "%c56_pollutant_prices%" == "coupling" $ondelim -$if "%c56_pollutant_prices%" == "coupling" $include "./modules/56_ghg_policy/input/f56_pollutant_prices_coupling.cs3" -$if "%c56_pollutant_prices%" == "coupling" $offdelim -$if "%c56_pollutant_prices%" == "coupling" ; - -$if "%c56_pollutant_prices%" == "emulator" table f56_pollutant_prices_emulator(t_all,pollutants) global ghg certificate prices for N2O-N CH4 CO2-C (USD05MER per t) -$if "%c56_pollutant_prices%" == "emulator" $ondelim -$if "%c56_pollutant_prices%" == "emulator" $include "./modules/56_ghg_policy/input/f56_pollutant_prices_emulator.cs3" -$if "%c56_pollutant_prices%" == "emulator" $offdelim -$if "%c56_pollutant_prices%" == "emulator" ; - -*' `f56_emis_policy` contains scenarios determining for each gas and source whether it is priced or not. - -table f56_emis_policy(scen56,pollutants_all,emis_source) emission policy scenarios (1) -$ondelim -$include "./modules/56_ghg_policy/input/f56_emis_policy.csv" -$offdelim -; - -*' `f56_aff_policy` contains scenarios determining the incentive structure for afforestation. - -table f56_aff_policy(co2_forestry,aff56) afforestation policy scenarios (1) -$ondelim -$include "./modules/56_ghg_policy/input/f56_aff_policy.csv" -$offdelim -; diff --git a/modules/56_ghg_policy/price_sep16/not_used.txt b/modules/56_ghg_policy/price_sep16/not_used.txt deleted file mode 100644 index 90a42b4805..0000000000 --- a/modules/56_ghg_policy/price_sep16/not_used.txt +++ /dev/null @@ -1,8 +0,0 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# | Contact: magpie@pik-potsdam.de - -name,type,reason -im_development_state, input, not needed \ No newline at end of file diff --git a/modules/56_ghg_policy/price_sep16/postsolve.gms b/modules/56_ghg_policy/price_sep16/postsolve.gms deleted file mode 100644 index d3c65a259c..0000000000 --- a/modules/56_ghg_policy/price_sep16/postsolve.gms +++ /dev/null @@ -1,94 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov56_reward_cdr_aff(t,j,"marginal") = v56_reward_cdr_aff.m(j); - ov_reward_cdr_aff(t,i,"marginal") = vm_reward_cdr_aff.m(i); - ov_btm_reg(t,i,emis_source,pollutants,"marginal") = vm_btm_reg.m(i,emis_source,pollutants); - ov_btm_cell(t,j,emis_source,pollutants,"marginal") = vm_btm_cell.m(j,emis_source,pollutants); - ov_emission_costs(t,i,"marginal") = vm_emission_costs.m(i); - ov_emissions_reg(t,i,emis_source,pollutants,"marginal") = vm_emissions_reg.m(i,emis_source,pollutants); - ov56_emis_cell(t,j,emis_source,pollutants,"marginal") = v56_emis_cell.m(j,emis_source,pollutants); - ov56_emission_costs_reg_yearly(t,i,emis_reg_yr56,"marginal") = v56_emission_costs_reg_yearly.m(i,emis_reg_yr56); - ov56_emission_costs_reg_oneoff(t,i,emis_reg_one56,"marginal") = v56_emission_costs_reg_oneoff.m(i,emis_reg_one56); - ov56_emission_costs_cell_yearly(t,j,emis_cell_yr56,"marginal") = v56_emission_costs_cell_yearly.m(j,emis_cell_yr56); - ov56_emission_costs_cell_oneoff(t,j,emis_cell_one56,"marginal") = v56_emission_costs_cell_oneoff.m(j,emis_cell_one56); - oq56_technical_mitigation_reg(t,i,pollutants,emis_source,"marginal") = q56_technical_mitigation_reg.m(i,pollutants,emis_source); - oq56_technical_mitigation_cell(t,j,pollutants,emis_source,"marginal") = q56_technical_mitigation_cell.m(j,pollutants,emis_source); - oq56_cell_to_reg(t,i,pollutants,emis_source,"marginal") = q56_cell_to_reg.m(i,pollutants,emis_source); - oq56_emission_costs(t,i,"marginal") = q56_emission_costs.m(i); - oq56_emission_costs_reg_yearly(t,i,emis_reg_yr56,"marginal") = q56_emission_costs_reg_yearly.m(i,emis_reg_yr56); - oq56_emission_costs_reg_oneoff(t,i,emis_reg_one56,"marginal") = q56_emission_costs_reg_oneoff.m(i,emis_reg_one56); - oq56_emission_costs_cell_yearly(t,j,emis_cell_yr56,"marginal") = q56_emission_costs_cell_yearly.m(j,emis_cell_yr56); - oq56_emission_costs_cell_oneoff(t,j,emis_cell_one56,"marginal") = q56_emission_costs_cell_oneoff.m(j,emis_cell_one56); - oq56_reward_cdr_aff_reg(t,i,"marginal") = q56_reward_cdr_aff_reg.m(i); - oq56_reward_cdr_aff(t,j,"marginal") = q56_reward_cdr_aff.m(j); - ov56_reward_cdr_aff(t,j,"level") = v56_reward_cdr_aff.l(j); - ov_reward_cdr_aff(t,i,"level") = vm_reward_cdr_aff.l(i); - ov_btm_reg(t,i,emis_source,pollutants,"level") = vm_btm_reg.l(i,emis_source,pollutants); - ov_btm_cell(t,j,emis_source,pollutants,"level") = vm_btm_cell.l(j,emis_source,pollutants); - ov_emission_costs(t,i,"level") = vm_emission_costs.l(i); - ov_emissions_reg(t,i,emis_source,pollutants,"level") = vm_emissions_reg.l(i,emis_source,pollutants); - ov56_emis_cell(t,j,emis_source,pollutants,"level") = v56_emis_cell.l(j,emis_source,pollutants); - ov56_emission_costs_reg_yearly(t,i,emis_reg_yr56,"level") = v56_emission_costs_reg_yearly.l(i,emis_reg_yr56); - ov56_emission_costs_reg_oneoff(t,i,emis_reg_one56,"level") = v56_emission_costs_reg_oneoff.l(i,emis_reg_one56); - ov56_emission_costs_cell_yearly(t,j,emis_cell_yr56,"level") = v56_emission_costs_cell_yearly.l(j,emis_cell_yr56); - ov56_emission_costs_cell_oneoff(t,j,emis_cell_one56,"level") = v56_emission_costs_cell_oneoff.l(j,emis_cell_one56); - oq56_technical_mitigation_reg(t,i,pollutants,emis_source,"level") = q56_technical_mitigation_reg.l(i,pollutants,emis_source); - oq56_technical_mitigation_cell(t,j,pollutants,emis_source,"level") = q56_technical_mitigation_cell.l(j,pollutants,emis_source); - oq56_cell_to_reg(t,i,pollutants,emis_source,"level") = q56_cell_to_reg.l(i,pollutants,emis_source); - oq56_emission_costs(t,i,"level") = q56_emission_costs.l(i); - oq56_emission_costs_reg_yearly(t,i,emis_reg_yr56,"level") = q56_emission_costs_reg_yearly.l(i,emis_reg_yr56); - oq56_emission_costs_reg_oneoff(t,i,emis_reg_one56,"level") = q56_emission_costs_reg_oneoff.l(i,emis_reg_one56); - oq56_emission_costs_cell_yearly(t,j,emis_cell_yr56,"level") = q56_emission_costs_cell_yearly.l(j,emis_cell_yr56); - oq56_emission_costs_cell_oneoff(t,j,emis_cell_one56,"level") = q56_emission_costs_cell_oneoff.l(j,emis_cell_one56); - oq56_reward_cdr_aff_reg(t,i,"level") = q56_reward_cdr_aff_reg.l(i); - oq56_reward_cdr_aff(t,j,"level") = q56_reward_cdr_aff.l(j); - ov56_reward_cdr_aff(t,j,"upper") = v56_reward_cdr_aff.up(j); - ov_reward_cdr_aff(t,i,"upper") = vm_reward_cdr_aff.up(i); - ov_btm_reg(t,i,emis_source,pollutants,"upper") = vm_btm_reg.up(i,emis_source,pollutants); - ov_btm_cell(t,j,emis_source,pollutants,"upper") = vm_btm_cell.up(j,emis_source,pollutants); - ov_emission_costs(t,i,"upper") = vm_emission_costs.up(i); - ov_emissions_reg(t,i,emis_source,pollutants,"upper") = vm_emissions_reg.up(i,emis_source,pollutants); - ov56_emis_cell(t,j,emis_source,pollutants,"upper") = v56_emis_cell.up(j,emis_source,pollutants); - ov56_emission_costs_reg_yearly(t,i,emis_reg_yr56,"upper") = v56_emission_costs_reg_yearly.up(i,emis_reg_yr56); - ov56_emission_costs_reg_oneoff(t,i,emis_reg_one56,"upper") = v56_emission_costs_reg_oneoff.up(i,emis_reg_one56); - ov56_emission_costs_cell_yearly(t,j,emis_cell_yr56,"upper") = v56_emission_costs_cell_yearly.up(j,emis_cell_yr56); - ov56_emission_costs_cell_oneoff(t,j,emis_cell_one56,"upper") = v56_emission_costs_cell_oneoff.up(j,emis_cell_one56); - oq56_technical_mitigation_reg(t,i,pollutants,emis_source,"upper") = q56_technical_mitigation_reg.up(i,pollutants,emis_source); - oq56_technical_mitigation_cell(t,j,pollutants,emis_source,"upper") = q56_technical_mitigation_cell.up(j,pollutants,emis_source); - oq56_cell_to_reg(t,i,pollutants,emis_source,"upper") = q56_cell_to_reg.up(i,pollutants,emis_source); - oq56_emission_costs(t,i,"upper") = q56_emission_costs.up(i); - oq56_emission_costs_reg_yearly(t,i,emis_reg_yr56,"upper") = q56_emission_costs_reg_yearly.up(i,emis_reg_yr56); - oq56_emission_costs_reg_oneoff(t,i,emis_reg_one56,"upper") = q56_emission_costs_reg_oneoff.up(i,emis_reg_one56); - oq56_emission_costs_cell_yearly(t,j,emis_cell_yr56,"upper") = q56_emission_costs_cell_yearly.up(j,emis_cell_yr56); - oq56_emission_costs_cell_oneoff(t,j,emis_cell_one56,"upper") = q56_emission_costs_cell_oneoff.up(j,emis_cell_one56); - oq56_reward_cdr_aff_reg(t,i,"upper") = q56_reward_cdr_aff_reg.up(i); - oq56_reward_cdr_aff(t,j,"upper") = q56_reward_cdr_aff.up(j); - ov56_reward_cdr_aff(t,j,"lower") = v56_reward_cdr_aff.lo(j); - ov_reward_cdr_aff(t,i,"lower") = vm_reward_cdr_aff.lo(i); - ov_btm_reg(t,i,emis_source,pollutants,"lower") = vm_btm_reg.lo(i,emis_source,pollutants); - ov_btm_cell(t,j,emis_source,pollutants,"lower") = vm_btm_cell.lo(j,emis_source,pollutants); - ov_emission_costs(t,i,"lower") = vm_emission_costs.lo(i); - ov_emissions_reg(t,i,emis_source,pollutants,"lower") = vm_emissions_reg.lo(i,emis_source,pollutants); - ov56_emis_cell(t,j,emis_source,pollutants,"lower") = v56_emis_cell.lo(j,emis_source,pollutants); - ov56_emission_costs_reg_yearly(t,i,emis_reg_yr56,"lower") = v56_emission_costs_reg_yearly.lo(i,emis_reg_yr56); - ov56_emission_costs_reg_oneoff(t,i,emis_reg_one56,"lower") = v56_emission_costs_reg_oneoff.lo(i,emis_reg_one56); - ov56_emission_costs_cell_yearly(t,j,emis_cell_yr56,"lower") = v56_emission_costs_cell_yearly.lo(j,emis_cell_yr56); - ov56_emission_costs_cell_oneoff(t,j,emis_cell_one56,"lower") = v56_emission_costs_cell_oneoff.lo(j,emis_cell_one56); - oq56_technical_mitigation_reg(t,i,pollutants,emis_source,"lower") = q56_technical_mitigation_reg.lo(i,pollutants,emis_source); - oq56_technical_mitigation_cell(t,j,pollutants,emis_source,"lower") = q56_technical_mitigation_cell.lo(j,pollutants,emis_source); - oq56_cell_to_reg(t,i,pollutants,emis_source,"lower") = q56_cell_to_reg.lo(i,pollutants,emis_source); - oq56_emission_costs(t,i,"lower") = q56_emission_costs.lo(i); - oq56_emission_costs_reg_yearly(t,i,emis_reg_yr56,"lower") = q56_emission_costs_reg_yearly.lo(i,emis_reg_yr56); - oq56_emission_costs_reg_oneoff(t,i,emis_reg_one56,"lower") = q56_emission_costs_reg_oneoff.lo(i,emis_reg_one56); - oq56_emission_costs_cell_yearly(t,j,emis_cell_yr56,"lower") = q56_emission_costs_cell_yearly.lo(j,emis_cell_yr56); - oq56_emission_costs_cell_oneoff(t,j,emis_cell_one56,"lower") = q56_emission_costs_cell_oneoff.lo(j,emis_cell_one56); - oq56_reward_cdr_aff_reg(t,i,"lower") = q56_reward_cdr_aff_reg.lo(i); - oq56_reward_cdr_aff(t,j,"lower") = q56_reward_cdr_aff.lo(j); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/56_ghg_policy/price_sep16/preloop.gms b/modules/56_ghg_policy/price_sep16/preloop.gms deleted file mode 100644 index 8c2bec2c9a..0000000000 --- a/modules/56_ghg_policy/price_sep16/preloop.gms +++ /dev/null @@ -1,44 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -****select ghg prices -$ifthen "%c56_pollutant_prices%" == "coupling" im_pollutant_prices(t_all,i,pollutants) = f56_pollutant_prices_coupling(t_all,i,pollutants); -$elseif "%c56_pollutant_prices%" == "emulator" im_pollutant_prices(t_all,i,pollutants) = f56_pollutant_prices_emulator(t_all,pollutants); -$else im_pollutant_prices(t_all,i,pollutants) = f56_pollutant_prices(t_all,i,pollutants,"%c56_pollutant_prices%"); -$endif - -***save im_pollutant_prices to parameter -p56_pollutant_prices_input(t,i,pollutants) = im_pollutant_prices(t,i,pollutants); - -***limit CH4 and N2O GHG prices based on s56_limit_ch4_n2o_price -*12/44 conversion from USD per tC to USD per tCO2 -*28 and 265 Global Warming Potentials from AR5 WG1 CH08 Table 8.7, conversion from USD per tCO2 to USD per tCH4 and USD per tN2O -*44/28 conversion from USD per tN2O to USD per tN -im_pollutant_prices(t_all,i,"ch4")$(im_pollutant_prices(t_all,i,"ch4") > s56_limit_ch4_n2o_price*12/44*28) = s56_limit_ch4_n2o_price*12/44*28; -im_pollutant_prices(t_all,i,"n2o_n_direct")$(im_pollutant_prices(t_all,i,"n2o_n_direct") > s56_limit_ch4_n2o_price*12/44*265*44/28) = s56_limit_ch4_n2o_price*12/44*265*44/28; -im_pollutant_prices(t_all,i,"n2o_n_indirect")$(im_pollutant_prices(t_all,i,"n2o_n_indirect") > s56_limit_ch4_n2o_price*12/44*265*44/28) = s56_limit_ch4_n2o_price*12/44*265*44/28; - -*reward neg emissions depending on s56_reward_neg_emis -v56_emission_costs_cell_oneoff.lo(j2,emis_cell_one56) = s56_reward_neg_emis; - -*calculate ghg price growth rate -*http://de.wikihow.com/Berechnung-einer-Wachstumsrate#/Bild:Calculate-Growth-Rate-Step-6.jpg -p56_ghg_price_growth_rate(t,i,pollutants) = 0; -p56_ghg_price_growth_rate(t,i,pollutants)$(ord(t)>1 AND im_pollutant_prices(t-1,i,pollutants) > 0) = (im_pollutant_prices(t,i,pollutants)/im_pollutant_prices(t-1,i,pollutants))**(1/m_yeardiff(t))-1; -*remove negative values -p56_ghg_price_growth_rate(t,i,pollutants)$(p56_ghg_price_growth_rate(t,i,pollutants) <= 0) = 0; -*remove values exceeding 10% -p56_ghg_price_growth_rate(t,i,pollutants)$(p56_ghg_price_growth_rate(t,i,pollutants) > 0.1) = 0.1; -*calculate average growth rate over time -p56_ghg_price_growth_rate_avg(i,pollutants) = sum(t, p56_ghg_price_growth_rate(t,i,pollutants))/card(t); -*limit deviation from average growth rate over time to 1% -p56_ghg_price_growth_rate(t,i,pollutants)$(p56_ghg_price_growth_rate(t,i,pollutants) > p56_ghg_price_growth_rate_avg(i,pollutants)+0.01) = p56_ghg_price_growth_rate_avg(i,pollutants)+0.01; -p56_ghg_price_growth_rate(t,i,pollutants)$(p56_ghg_price_growth_rate(t,i,pollutants) < p56_ghg_price_growth_rate_avg(i,pollutants)-0.01) = p56_ghg_price_growth_rate_avg(i,pollutants)-0.01; -*account for special case if average growth rate is very low (<= 1%) -p56_ghg_price_growth_rate(t,i,pollutants)$(p56_ghg_price_growth_rate(t,i,pollutants) = 0) = p56_ghg_price_growth_rate_avg(i,pollutants); -*if average growth rate is zero use 5% as default -p56_ghg_price_growth_rate(t,i,pollutants)$(p56_ghg_price_growth_rate(t,i,pollutants) = 0) = 0.05; diff --git a/modules/56_ghg_policy/price_sep16/scaling.gms b/modules/56_ghg_policy/price_sep16/scaling.gms deleted file mode 100644 index bbabe78e5a..0000000000 --- a/modules/56_ghg_policy/price_sep16/scaling.gms +++ /dev/null @@ -1,7 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -v56_emission_costs_reg_yearly.scale(i,emis_reg_yr56) = 10e5; diff --git a/modules/56_ghg_policy/price_sep16/sets.gms b/modules/56_ghg_policy/price_sep16/sets.gms deleted file mode 100644 index 2844bc4efc..0000000000 --- a/modules/56_ghg_policy/price_sep16/sets.gms +++ /dev/null @@ -1,104 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -sets - - pollutants_all all pollutants - / co2_c, - ch4, - n2o_n_direct, nh3_n, no2_n, - no3_n, - n2o_n_indirect, - co, - nmhc, - h2, - pm2_5, - tpm, - tc, - oc, - bc, - so2 / - - pollutants(pollutants_all) subset of pollutants_all that can be taxed - / co2_c, - ch4, - n2o_n_direct, n2o_n_indirect, - nh3_n, no2_n, - no3_n / - - n_pollutants(pollutants) subset of n pollutants - / n2o_n_direct,n2o_n_indirect, - nh3_n, no2_n, - no3_n / - - n_pollutants_direct(n_pollutants) subset of n pollutants - / n2o_n_direct, - nh3_n, no2_n, - no3_n / - - pollutant_nh3no2_51(n_pollutants_direct) nitrogen emissions relevant for deposition - / nh3_n, no2_n / - - emis_source_n_cropsoils51(emis_source) activities that lead to emissions - / inorg_fert, man_crop, resid, som, rice / - - ghgscen56 ghg price scenarios - /SSP1-20-SPA1-V15-IMAGE,SSP1-26-SPA1-V15-IMAGE, - SSP1-34-SPA1-V15-IMAGE,SSP1-45-SPA1-V15-IMAGE, - SSP1-Ref-SPA0-V15-IMAGE, - - SSP1-20-SPA1-V15-REMIND-MAGPIE,SSP1-26-SPA1-V15-REMIND-MAGPIE, - SSP1-34-SPA1-V15-REMIND-MAGPIE,SSP1-37-SPA1-V15-REMIND-MAGPIE, - SSP1-45-SPA1-V15-REMIND-MAGPIE,SSP1-Ref-SPA0-V15-REMIND-MAGPIE, - - SSP2-18-SPA2-V15-MESSAGE-GLOBIOM,SSP2-19-SPA2-V15-MESSAGE-GLOBIOM, - SSP2-20-SPA2-V15-MESSAGE-GLOBIOM,SSP2-26-SPA2-V15-MESSAGE-GLOBIOM, - SSP2-34-SPA2-V15-MESSAGE-GLOBIOM,SSP2-45-SPA2-V15-MESSAGE-GLOBIOM, - SSP2-60-SPA2-V15-MESSAGE-GLOBIOM,SSP2-Ref-SPA0-V15-MESSAGE-GLOBIOM, - - SSP2-20-SPA2-V15-REMIND-MAGPIE,SSP2-26-SPA2-V15-REMIND-MAGPIE, - SSP2-34-SPA2-V15-REMIND-MAGPIE,SSP2-37-SPA2-V15-REMIND-MAGPIE, - SSP2-45-SPA2-V15-REMIND-MAGPIE,SSP2-60-SPA2-V15-REMIND-MAGPIE, - SSP2-Ref-SPA0-V15-REMIND-MAGPIE, - - SSP3-34-SPA3-V15-AIM-CGE,SSP3-45-SPA3-V15-AIM-CGE, - SSP3-60-SPA3-V15-AIM-CGE, - - SSP4-26-SPA4-V15-GCAM4, - SSP4-34-SPA4-V15-GCAM4,SSP4-45-SPA4-V15-GCAM4, - SSP4-60-SPA4-V15-GCAM4,SSP4-Ref-SPA0-V15-GCAM4, - - SSP5-20-SPA5-V15-REMIND-MAGPIE,SSP5-26-SPA5-V15-REMIND-MAGPIE, - SSP5-34-SPA5-V15-REMIND-MAGPIE,SSP5-37-SPA5-V15-REMIND-MAGPIE, - SSP5-45-SPA5-V15-REMIND-MAGPIE,SSP5-60-SPA5-V15-REMIND-MAGPIE, - SSP5-Ref-SPA0-V15-REMIND-MAGPIE / - - scen56 emission policy scenarios - / none, all, ssp / - - aff56 afforestation policy scenarios - / none, all, all50, vegc100, vegc75, vegc50, vegc33, vegc25 / - - emis_cell_one56(emis_source_cell) cellular oneoff emission sources - /crop_vegc, crop_litc, crop_soilc, past_vegc, past_litc, past_soilc, forestry_vegc, - forestry_litc, forestry_soilc, primforest_vegc, primforest_litc, primforest_soilc, - secdforest_vegc, secdforest_litc, secdforest_soilc, - urban_vegc, urban_litc, urban_soilc, other_vegc, other_litc, other_soilc/ - - emis_reg_yr56(emis_source_reg) regional yearly emission sources - /inorg_fert, man_crop, awms, resid, man_past, som, - rice, ent_ferm, beccs/ -; - -$onempty -sets - emis_cell_yr56(emis_source_cell) cellular yearly emission sources - / / - - emis_reg_one56(emis_source_reg) regional oneoff emission sources - / / - ; -$offempty \ No newline at end of file diff --git a/modules/57_maccs/57_maccs.gms b/modules/57_maccs/module.gms similarity index 77% rename from modules/57_maccs/57_maccs.gms rename to modules/57_maccs/module.gms index 6bc2f7f653..a6d7662c6a 100644 --- a/modules/57_maccs/57_maccs.gms +++ b/modules/57_maccs/module.gms @@ -1,28 +1,29 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Marginal Abatement Cost Curves -*' -*' @description This module describes technical mitigation of GHG emissions. -*' It allows to reduce GHG emissions by undertaking mitigation -*' measures in exchange for additional mitigation costs. -*' The technical mitigation measures include, for example, better spreader maintenance, -*' feed additives or investments in animal waste management facilities. -*' Please note that technical mitigation is possible only in the "on" module realization below. -*' For simplicity, we considered only the effects of mitigation measure costs and emissions. -*' Their direct consequences on biophysical values like yields or water requirements is ignored at the moment. -*' -*' Mitigation costs are estimated using marginal abatement cost curves (MACCs). -*' The curves are applied on the original emissions before technical mitigation (btm), -*' and reduce them by a certain percentage in exchange for additional costs. -*' The MACCs used in this module are based on the data from @LUCAS200785. -*' -*' @authors Benjamin Leon Bodirsky, Florian Humpenoeder - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%maccs%" == "off_jul16" $include "./modules/57_maccs/off_jul16.gms" -$Ifi "%maccs%" == "on_sep16" $include "./modules/57_maccs/on_sep16.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Marginal Abatement Cost Curves +*' +*' @description This module describes technical mitigation of GHG emissions. +*' It allows to reduce GHG emissions by undertaking mitigation +*' measures in exchange for additional mitigation costs. +*' The technical mitigation measures include, for example, better spreader maintenance, +*' feed additives or investments in animal waste management facilities. +*' Please note that technical mitigation is possible only in the "on" module realization below. +*' For simplicity, we considered only the effects of mitigation measure costs and emissions. +*' Their direct consequences on biophysical values like yields or water requirements is ignored at the moment. +*' +*' Mitigation costs are estimated using marginal abatement cost curves (MACCs). +*' The curves are applied on the original emissions before technical mitigation (btm), +*' and reduce them by a certain percentage in exchange for additional costs. +*' The MACCs used in this module are based on the data from @LUCAS200785. +*' +*' @authors Benjamin Leon Bodirsky, Florian Humpenoeder + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%maccs%" == "off_jul16" $include "./modules/57_maccs/off_jul16/realization.gms" +$Ifi "%maccs%" == "on_sep16" $include "./modules/57_maccs/on_sep16/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/57_maccs/off_jul16/declarations.gms b/modules/57_maccs/off_jul16/declarations.gms index e6507af075..a1c90f6590 100644 --- a/modules/57_maccs/off_jul16/declarations.gms +++ b/modules/57_maccs/off_jul16/declarations.gms @@ -1,20 +1,21 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -parameters - im_maccs_mitigation(t,i,emis_source,pollutants) Technical mitigation of GHG emissions (percent) -; - -positive variables - vm_maccs_costs(i) Costs of technical mitigation of GHG emissions (mio. USD95MER per yr) -; - - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_maccs_costs(t,i,type) Costs of technical mitigation of GHG emissions (mio. USD95MER per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +parameters + im_maccs_mitigation(t,i,emis_source,pollutants) Technical mitigation of GHG emissions (percent) +; + +positive variables + vm_maccs_costs(i) Costs of technical mitigation of GHG emissions (mio. USD95MER per yr) +; + + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_maccs_costs(t,i,type) Costs of technical mitigation of GHG emissions (mio. USD95MER per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/57_maccs/off_jul16/not_used.txt b/modules/57_maccs/off_jul16/not_used.txt index 3d514deda3..5bfd774649 100644 --- a/modules/57_maccs/off_jul16/not_used.txt +++ b/modules/57_maccs/off_jul16/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason diff --git a/modules/57_maccs/off_jul16/postsolve.gms b/modules/57_maccs/off_jul16/postsolve.gms index 1aea7b7658..e60d8026fa 100644 --- a/modules/57_maccs/off_jul16/postsolve.gms +++ b/modules/57_maccs/off_jul16/postsolve.gms @@ -1,14 +1,15 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_maccs_costs(t,i,"marginal") = vm_maccs_costs.m(i); - ov_maccs_costs(t,i,"level") = vm_maccs_costs.l(i); - ov_maccs_costs(t,i,"upper") = vm_maccs_costs.up(i); - ov_maccs_costs(t,i,"lower") = vm_maccs_costs.lo(i); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 + + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_maccs_costs(t,i,"marginal") = vm_maccs_costs.m(i); + ov_maccs_costs(t,i,"level") = vm_maccs_costs.l(i); + ov_maccs_costs(t,i,"upper") = vm_maccs_costs.up(i); + ov_maccs_costs(t,i,"lower") = vm_maccs_costs.lo(i); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/57_maccs/off_jul16/presolve.gms b/modules/57_maccs/off_jul16/presolve.gms index 398fbda484..4a54de80fa 100644 --- a/modules/57_maccs/off_jul16/presolve.gms +++ b/modules/57_maccs/off_jul16/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 *' @code diff --git a/modules/57_maccs/off_jul16.gms b/modules/57_maccs/off_jul16/realization.gms similarity index 65% rename from modules/57_maccs/off_jul16.gms rename to modules/57_maccs/off_jul16/realization.gms index 866e0e1d74..e175007439 100644 --- a/modules/57_maccs/off_jul16.gms +++ b/modules/57_maccs/off_jul16/realization.gms @@ -1,16 +1,17 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description Technical mitigation is not considered in this realization. - -*' @limitations It is unrealistic to assume no technical mitigation attempts. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/57_maccs/off_jul16/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/57_maccs/off_jul16/declarations.gms" -$Ifi "%phase%" == "presolve" $include "./modules/57_maccs/off_jul16/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/57_maccs/off_jul16/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description Technical mitigation is not considered in this realization. + +*' @limitations It is unrealistic to assume no technical mitigation attempts. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/57_maccs/off_jul16/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/57_maccs/off_jul16/declarations.gms" +$Ifi "%phase%" == "presolve" $include "./modules/57_maccs/off_jul16/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/57_maccs/off_jul16/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/57_maccs/off_jul16/sets.gms b/modules/57_maccs/off_jul16/sets.gms index e69bd5a186..5963ccda1d 100644 --- a/modules/57_maccs/off_jul16/sets.gms +++ b/modules/57_maccs/off_jul16/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/57_maccs/on_sep16/declarations.gms b/modules/57_maccs/on_sep16/declarations.gms index d956b8d91d..2eed64ed35 100644 --- a/modules/57_maccs/on_sep16/declarations.gms +++ b/modules/57_maccs/on_sep16/declarations.gms @@ -1,27 +1,28 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -parameters - im_maccs_mitigation(t,i,emis_source,pollutants) Technical mitigation of GHG emissions (percent) - i57_mac_step_n2o(t,i) Helper to map N2O prices and maccs_steps (1) - i57_mac_step_ch4(t,i) Helper to map CH4 prices and maccs_steps (1) - p57_maccs_costs_integral(t,i,emis_source,pollutants) Costs of technical mitigation (USD95MER per Tg N CH4 C) -; - -equations - q57_total_costs(i) Calculation of total costs of technical mitigation (mio. USD95MER per yr) -; - -positive variables - vm_maccs_costs(i) Costs of technical mitigation of GHG emissions (mio. USD95MER per yr) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_maccs_costs(t,i,type) Costs of technical mitigation of GHG emissions (mio. USD95MER per yr) - oq57_total_costs(t,i,type) Calculation of total costs of technical mitigation (mio. USD95MER per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +parameters + im_maccs_mitigation(t,i,emis_source,pollutants) Technical mitigation of GHG emissions (percent) + i57_mac_step_n2o(t,i) Helper to map N2O prices and maccs_steps (1) + i57_mac_step_ch4(t,i) Helper to map CH4 prices and maccs_steps (1) + p57_maccs_costs_integral(t,i,emis_source,pollutants) Costs of technical mitigation (USD95MER per Tg N CH4 C) +; + +equations + q57_total_costs(i) Calculation of total costs of technical mitigation (mio. USD95MER per yr) +; + +positive variables + vm_maccs_costs(i) Costs of technical mitigation of GHG emissions (mio. USD95MER per yr) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_maccs_costs(t,i,type) Costs of technical mitigation of GHG emissions (mio. USD95MER per yr) + oq57_total_costs(t,i,type) Calculation of total costs of technical mitigation (mio. USD95MER per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/57_maccs/on_sep16/equations.gms b/modules/57_maccs/on_sep16/equations.gms index d217514531..6260ebf50d 100644 --- a/modules/57_maccs/on_sep16/equations.gms +++ b/modules/57_maccs/on_sep16/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations diff --git a/modules/57_maccs/on_sep16/input.gms b/modules/57_maccs/on_sep16/input.gms index eece9d665b..735da7a751 100644 --- a/modules/57_maccs/on_sep16/input.gms +++ b/modules/57_maccs/on_sep16/input.gms @@ -1,17 +1,18 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -table f57_maccs_n2o(t_all,i,maccs_n2o,maccs_steps) N2O MACC from Image model (percent) -$ondelim -$include "./modules/57_maccs/input/f57_maccs_n2o.cs3" -$offdelim -; - -table f57_maccs_ch4(t_all,i,maccs_ch4,maccs_steps) CH4 MACC from Image model (percent) -$ondelim -$include "./modules/57_maccs/input/f57_maccs_ch4.cs3" -$offdelim -; +*** | (C) 2008-2019 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 + +table f57_maccs_n2o(t_all,i,maccs_n2o,maccs_steps) N2O MACC from Image model (percent) +$ondelim +$include "./modules/57_maccs/input/f57_maccs_n2o.cs3" +$offdelim +; + +table f57_maccs_ch4(t_all,i,maccs_ch4,maccs_steps) CH4 MACC from Image model (percent) +$ondelim +$include "./modules/57_maccs/input/f57_maccs_ch4.cs3" +$offdelim +; diff --git a/modules/57_maccs/on_sep16/not_used.txt b/modules/57_maccs/on_sep16/not_used.txt index 6ece3f27a1..4b81dfbae2 100644 --- a/modules/57_maccs/on_sep16/not_used.txt +++ b/modules/57_maccs/on_sep16/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason diff --git a/modules/57_maccs/on_sep16/postsolve.gms b/modules/57_maccs/on_sep16/postsolve.gms index e742013370..e79a63c1ec 100644 --- a/modules/57_maccs/on_sep16/postsolve.gms +++ b/modules/57_maccs/on_sep16/postsolve.gms @@ -1,18 +1,19 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_maccs_costs(t,i,"marginal") = vm_maccs_costs.m(i); - oq57_total_costs(t,i,"marginal") = q57_total_costs.m(i); - ov_maccs_costs(t,i,"level") = vm_maccs_costs.l(i); - oq57_total_costs(t,i,"level") = q57_total_costs.l(i); - ov_maccs_costs(t,i,"upper") = vm_maccs_costs.up(i); - oq57_total_costs(t,i,"upper") = q57_total_costs.up(i); - ov_maccs_costs(t,i,"lower") = vm_maccs_costs.lo(i); - oq57_total_costs(t,i,"lower") = q57_total_costs.lo(i); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 + + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_maccs_costs(t,i,"marginal") = vm_maccs_costs.m(i); + oq57_total_costs(t,i,"marginal") = q57_total_costs.m(i); + ov_maccs_costs(t,i,"level") = vm_maccs_costs.l(i); + oq57_total_costs(t,i,"level") = q57_total_costs.l(i); + ov_maccs_costs(t,i,"upper") = vm_maccs_costs.up(i); + oq57_total_costs(t,i,"upper") = q57_total_costs.up(i); + ov_maccs_costs(t,i,"lower") = vm_maccs_costs.lo(i); + oq57_total_costs(t,i,"lower") = q57_total_costs.lo(i); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/57_maccs/on_sep16/preloop.gms b/modules/57_maccs/on_sep16/preloop.gms index 19158718f8..9a5060a7ad 100644 --- a/modules/57_maccs/on_sep16/preloop.gms +++ b/modules/57_maccs/on_sep16/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 $ontext diff --git a/modules/57_maccs/on_sep16.gms b/modules/57_maccs/on_sep16/realization.gms similarity index 72% rename from modules/57_maccs/on_sep16.gms rename to modules/57_maccs/on_sep16/realization.gms index 79da503429..1879dd0083 100644 --- a/modules/57_maccs/on_sep16.gms +++ b/modules/57_maccs/on_sep16/realization.gms @@ -1,19 +1,20 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description Unlike the previous realization, this implementation allows for the possibility -*' that non-CO2 emissions can be reduced by technical mitigation at additional costs. -*' -*' @limitations There are still issues related to data quality used by our source. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/57_maccs/on_sep16/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/57_maccs/on_sep16/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/57_maccs/on_sep16/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/57_maccs/on_sep16/equations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/57_maccs/on_sep16/preloop.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/57_maccs/on_sep16/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description Unlike the previous realization, this implementation allows for the possibility +*' that non-CO2 emissions can be reduced by technical mitigation at additional costs. +*' +*' @limitations There are still issues related to data quality used by our source. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/57_maccs/on_sep16/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/57_maccs/on_sep16/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/57_maccs/on_sep16/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/57_maccs/on_sep16/equations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/57_maccs/on_sep16/preloop.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/57_maccs/on_sep16/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/57_maccs/on_sep16/sets.gms b/modules/57_maccs/on_sep16/sets.gms index 177c8af274..4ef7b21114 100644 --- a/modules/57_maccs/on_sep16/sets.gms +++ b/modules/57_maccs/on_sep16/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets diff --git a/modules/59_som/cellpool_aug16/declarations.gms b/modules/59_som/cellpool_aug16/declarations.gms index 7fbbac249d..fec6f3a6e7 100644 --- a/modules/59_som/cellpool_aug16/declarations.gms +++ b/modules/59_som/cellpool_aug16/declarations.gms @@ -1,58 +1,59 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -parameters - i59_lossrate(t) Rate of loss or recovery of SOM pool per timestep (1) - p59_carbon_density(t_all,j,pools59) Carbon density of a hectare of land (tC per ha) - i59_tillage_share(i,tillage59) Share of land under tillage class (1) - i59_input_share(i,inputs59) Share of land under input class (1) - i59_cratio(j,kcr) Ratio of carbon density of land relative to natural vegetaion (1) - p59_som_pool(j,pools59) Actual C pool (mio. tC) -; - -equations - q59_som_target_cropland(j) Estimates the long-term target state of cropland (mio. tC) - q59_som_target_noncropland(j) Estimates the long-term target state of noncropland (mio. tC) - q59_som_transfer_to_cropland(j) Estimates the transfer of carbon pools due to land conversion (mio. tC) - q59_som_pool_cropland(j) Actual C pool in croplands (mio. tC) - q59_som_pool_noncropland(j) Actual C pool in non-croplands (mio. tC) - q59_nr_som(j) Soil organic matter loss (Tg N per yr) - q59_crop_diff(j) Cropland difference (mio. ha) - q59_crop_diff_constraint(i) Cropland difference constraint (mio. USD05MER per yr) -; - -positive variables - v59_som_target(j,pools59) Long-term target state of C pool (mio. tC) - v59_som_pool(j,pools59) Soil organic matter pool (mio. tC) - v59_crop_expansion(j) Crop land expansion (mio. ha) - v59_crop_reduction(j) Land reduction (mio. ha) -; - -variables - v59_som_transfer_to_cropland(j) Transfer of SOM from other land to cropland (mio. tC) - vm_nr_som(j) Release of soil organic matter (Tg N per yr) - vm_costs_overrate_cropdiff(i) Punishment costs for overrated cropland difference (mio. USD05MER per yr) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov59_som_target(t,j,pools59,type) Long-term target state of C pool (mio. tC) - ov59_som_pool(t,j,pools59,type) Soil organic matter pool (mio. tC) - ov59_crop_expansion(t,j,type) Crop land expansion (mio. ha) - ov59_crop_reduction(t,j,type) Land reduction (mio. ha) - ov59_som_transfer_to_cropland(t,j,type) Transfer of SOM from other land to cropland (mio. tC) - ov_nr_som(t,j,type) Release of soil organic matter (Tg N per yr) - ov_costs_overrate_cropdiff(t,i,type) Punishment costs for overrated cropland difference (mio. USD05MER per yr) - oq59_som_target_cropland(t,j,type) Estimates the long-term target state of cropland (mio. tC) - oq59_som_target_noncropland(t,j,type) Estimates the long-term target state of noncropland (mio. tC) - oq59_som_transfer_to_cropland(t,j,type) Estimates the transfer of carbon pools due to land conversion (mio. tC) - oq59_som_pool_cropland(t,j,type) Actual C pool in croplands (mio. tC) - oq59_som_pool_noncropland(t,j,type) Actual C pool in non-croplands (mio. tC) - oq59_nr_som(t,j,type) Soil organic matter loss (Tg N per yr) - oq59_crop_diff(t,j,type) Cropland difference (mio. ha) - oq59_crop_diff_constraint(t,i,type) Cropland difference constraint (mio. USD05MER per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +parameters + i59_lossrate(t) Rate of loss or recovery of SOM pool per timestep (1) + p59_carbon_density(t_all,j,pools59) Carbon density of a hectare of land (tC per ha) + i59_tillage_share(i,tillage59) Share of land under tillage class (1) + i59_input_share(i,inputs59) Share of land under input class (1) + i59_cratio(j,kcr) Ratio of carbon density of land relative to natural vegetaion (1) + p59_som_pool(j,pools59) Actual C pool (mio. tC) +; + +equations + q59_som_target_cropland(j) Estimates the long-term target state of cropland (mio. tC) + q59_som_target_noncropland(j) Estimates the long-term target state of noncropland (mio. tC) + q59_som_transfer_to_cropland(j) Estimates the transfer of carbon pools due to land conversion (mio. tC) + q59_som_pool_cropland(j) Actual C pool in croplands (mio. tC) + q59_som_pool_noncropland(j) Actual C pool in non-croplands (mio. tC) + q59_nr_som(j) Soil organic matter loss (Tg N per yr) + q59_crop_diff(j) Cropland difference (mio. ha) + q59_crop_diff_constraint(i) Cropland difference constraint (mio. USD05MER per yr) +; + +positive variables + v59_som_target(j,pools59) Long-term target state of C pool (mio. tC) + v59_som_pool(j,pools59) Soil organic matter pool (mio. tC) + v59_crop_expansion(j) Crop land expansion (mio. ha) + v59_crop_reduction(j) Land reduction (mio. ha) +; + +variables + v59_som_transfer_to_cropland(j) Transfer of SOM from other land to cropland (mio. tC) + vm_nr_som(j) Release of soil organic matter (Tg N per yr) + vm_costs_overrate_cropdiff(i) Punishment costs for overrated cropland difference (mio. USD05MER per yr) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov59_som_target(t,j,pools59,type) Long-term target state of C pool (mio. tC) + ov59_som_pool(t,j,pools59,type) Soil organic matter pool (mio. tC) + ov59_crop_expansion(t,j,type) Crop land expansion (mio. ha) + ov59_crop_reduction(t,j,type) Land reduction (mio. ha) + ov59_som_transfer_to_cropland(t,j,type) Transfer of SOM from other land to cropland (mio. tC) + ov_nr_som(t,j,type) Release of soil organic matter (Tg N per yr) + ov_costs_overrate_cropdiff(t,i,type) Punishment costs for overrated cropland difference (mio. USD05MER per yr) + oq59_som_target_cropland(t,j,type) Estimates the long-term target state of cropland (mio. tC) + oq59_som_target_noncropland(t,j,type) Estimates the long-term target state of noncropland (mio. tC) + oq59_som_transfer_to_cropland(t,j,type) Estimates the transfer of carbon pools due to land conversion (mio. tC) + oq59_som_pool_cropland(t,j,type) Actual C pool in croplands (mio. tC) + oq59_som_pool_noncropland(t,j,type) Actual C pool in non-croplands (mio. tC) + oq59_nr_som(t,j,type) Soil organic matter loss (Tg N per yr) + oq59_crop_diff(t,j,type) Cropland difference (mio. ha) + oq59_crop_diff_constraint(t,i,type) Cropland difference constraint (mio. USD05MER per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/59_som/cellpool_aug16/equations.gms b/modules/59_som/cellpool_aug16/equations.gms index ec9c9780ae..d8ae7d1cbf 100644 --- a/modules/59_som/cellpool_aug16/equations.gms +++ b/modules/59_som/cellpool_aug16/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 @@ -83,4 +84,4 @@ q59_nr_som(j2) .. + v59_som_transfer_to_cropland(j2) - v59_som_target(j2,"cropland")) ; -*' with the carbon to nitrogen ratio of soils assumed to be 15:1. \ No newline at end of file +*' with the carbon to nitrogen ratio of soils assumed to be 15:1. diff --git a/modules/59_som/cellpool_aug16/input.gms b/modules/59_som/cellpool_aug16/input.gms index 40ae11c18d..4348da3570 100644 --- a/modules/59_som/cellpool_aug16/input.gms +++ b/modules/59_som/cellpool_aug16/input.gms @@ -1,50 +1,51 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -scalars - s59_punish_cropdiff Punishment costs per croparea squared (USD05MER per mio. per ha^2) / 10000 / -; - -table f59_cratio_landuse(climate59,kcr) Ratio of soil carbon relative to potential natural vegetation soil carbon for different landuse (1) -$ondelim -$include "./modules/59_som/cellpool_aug16/input/f59_ch5_F_LU.csv" -$offdelim -; - -table f59_cratio_tillage(climate59,tillage59) Ratio of soil carbon relative to potential natural vegetation soil carbon for different soil management (1) -$ondelim -$include "./modules/59_som/cellpool_aug16/input/f59_ch5_F_MG.csv" -$offdelim -; - -table f59_cratio_inputs(climate59,inputs59) Ratio of soil carbon relative to potential natural vegetation soil carbon for different input intensity (1) -$ondelim -$include "./modules/59_som/cellpool_aug16/input/f59_ch5_F_I.csv" -$offdelim -; - -table f59_som_initialisation_pools(t_all,j, pools59) Initialisation pools for soil organic carbon (mio. tC) -$ondelim -$include "./modules/59_som/cellpool_aug16/input/f59_som_initialisation_pools.cs3" -$offdelim -; - -$setglobal c59_som_scenario nocc -* options: cc (climate change) -* nocc (no climate change) - -parameters f59_topsoilc_density(t_all,j) LPJ topsoil carbon density for natural vegetation (tC per ha) -/ -$ondelim -$include "./modules/59_som/cellpool_aug16/input/lpj_carbon_topsoil.cs2" -$offdelim -/ -; -$if "%c59_som_scenario%" == "nocc" f59_topsoilc_density(t_all,j) = f59_topsoilc_density("y1995",j); -m_fillmissingyears(f59_topsoilc_density,"j"); - - - +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +scalars + s59_punish_cropdiff Punishment costs per croparea squared (USD05MER per mio. per ha^2) / 10000 / +; + +table f59_cratio_landuse(climate59,kcr) Ratio of soil carbon relative to potential natural vegetation soil carbon for different landuse (1) +$ondelim +$include "./modules/59_som/cellpool_aug16/input/f59_ch5_F_LU.csv" +$offdelim +; + +table f59_cratio_tillage(climate59,tillage59) Ratio of soil carbon relative to potential natural vegetation soil carbon for different soil management (1) +$ondelim +$include "./modules/59_som/cellpool_aug16/input/f59_ch5_F_MG.csv" +$offdelim +; + +table f59_cratio_inputs(climate59,inputs59) Ratio of soil carbon relative to potential natural vegetation soil carbon for different input intensity (1) +$ondelim +$include "./modules/59_som/cellpool_aug16/input/f59_ch5_F_I.csv" +$offdelim +; + +table f59_som_initialisation_pools(t_all,j, pools59) Initialisation pools for soil organic carbon (mio. tC) +$ondelim +$include "./modules/59_som/cellpool_aug16/input/f59_som_initialisation_pools.cs3" +$offdelim +; + +$setglobal c59_som_scenario nocc +* options: cc (climate change) +* nocc (no climate change) + +parameters f59_topsoilc_density(t_all,j) LPJ topsoil carbon density for natural vegetation (tC per ha) +/ +$ondelim +$include "./modules/59_som/cellpool_aug16/input/lpj_carbon_topsoil.cs2" +$offdelim +/ +; +$if "%c59_som_scenario%" == "nocc" f59_topsoilc_density(t_all,j) = f59_topsoilc_density("y1995",j); +m_fillmissingyears(f59_topsoilc_density,"j"); + + + diff --git a/modules/59_som/cellpool_aug16/postsolve.gms b/modules/59_som/cellpool_aug16/postsolve.gms index e1fb01746b..ec2c167f37 100644 --- a/modules/59_som/cellpool_aug16/postsolve.gms +++ b/modules/59_som/cellpool_aug16/postsolve.gms @@ -1,72 +1,73 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -p59_som_pool(j,pools59) = v59_som_pool.l(j,pools59); - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov59_som_target(t,j,pools59,"marginal") = v59_som_target.m(j,pools59); - ov59_som_pool(t,j,pools59,"marginal") = v59_som_pool.m(j,pools59); - ov59_crop_expansion(t,j,"marginal") = v59_crop_expansion.m(j); - ov59_crop_reduction(t,j,"marginal") = v59_crop_reduction.m(j); - ov59_som_transfer_to_cropland(t,j,"marginal") = v59_som_transfer_to_cropland.m(j); - ov_nr_som(t,j,"marginal") = vm_nr_som.m(j); - ov_costs_overrate_cropdiff(t,i,"marginal") = vm_costs_overrate_cropdiff.m(i); - oq59_som_target_cropland(t,j,"marginal") = q59_som_target_cropland.m(j); - oq59_som_target_noncropland(t,j,"marginal") = q59_som_target_noncropland.m(j); - oq59_som_transfer_to_cropland(t,j,"marginal") = q59_som_transfer_to_cropland.m(j); - oq59_som_pool_cropland(t,j,"marginal") = q59_som_pool_cropland.m(j); - oq59_som_pool_noncropland(t,j,"marginal") = q59_som_pool_noncropland.m(j); - oq59_nr_som(t,j,"marginal") = q59_nr_som.m(j); - oq59_crop_diff(t,j,"marginal") = q59_crop_diff.m(j); - oq59_crop_diff_constraint(t,i,"marginal") = q59_crop_diff_constraint.m(i); - ov59_som_target(t,j,pools59,"level") = v59_som_target.l(j,pools59); - ov59_som_pool(t,j,pools59,"level") = v59_som_pool.l(j,pools59); - ov59_crop_expansion(t,j,"level") = v59_crop_expansion.l(j); - ov59_crop_reduction(t,j,"level") = v59_crop_reduction.l(j); - ov59_som_transfer_to_cropland(t,j,"level") = v59_som_transfer_to_cropland.l(j); - ov_nr_som(t,j,"level") = vm_nr_som.l(j); - ov_costs_overrate_cropdiff(t,i,"level") = vm_costs_overrate_cropdiff.l(i); - oq59_som_target_cropland(t,j,"level") = q59_som_target_cropland.l(j); - oq59_som_target_noncropland(t,j,"level") = q59_som_target_noncropland.l(j); - oq59_som_transfer_to_cropland(t,j,"level") = q59_som_transfer_to_cropland.l(j); - oq59_som_pool_cropland(t,j,"level") = q59_som_pool_cropland.l(j); - oq59_som_pool_noncropland(t,j,"level") = q59_som_pool_noncropland.l(j); - oq59_nr_som(t,j,"level") = q59_nr_som.l(j); - oq59_crop_diff(t,j,"level") = q59_crop_diff.l(j); - oq59_crop_diff_constraint(t,i,"level") = q59_crop_diff_constraint.l(i); - ov59_som_target(t,j,pools59,"upper") = v59_som_target.up(j,pools59); - ov59_som_pool(t,j,pools59,"upper") = v59_som_pool.up(j,pools59); - ov59_crop_expansion(t,j,"upper") = v59_crop_expansion.up(j); - ov59_crop_reduction(t,j,"upper") = v59_crop_reduction.up(j); - ov59_som_transfer_to_cropland(t,j,"upper") = v59_som_transfer_to_cropland.up(j); - ov_nr_som(t,j,"upper") = vm_nr_som.up(j); - ov_costs_overrate_cropdiff(t,i,"upper") = vm_costs_overrate_cropdiff.up(i); - oq59_som_target_cropland(t,j,"upper") = q59_som_target_cropland.up(j); - oq59_som_target_noncropland(t,j,"upper") = q59_som_target_noncropland.up(j); - oq59_som_transfer_to_cropland(t,j,"upper") = q59_som_transfer_to_cropland.up(j); - oq59_som_pool_cropland(t,j,"upper") = q59_som_pool_cropland.up(j); - oq59_som_pool_noncropland(t,j,"upper") = q59_som_pool_noncropland.up(j); - oq59_nr_som(t,j,"upper") = q59_nr_som.up(j); - oq59_crop_diff(t,j,"upper") = q59_crop_diff.up(j); - oq59_crop_diff_constraint(t,i,"upper") = q59_crop_diff_constraint.up(i); - ov59_som_target(t,j,pools59,"lower") = v59_som_target.lo(j,pools59); - ov59_som_pool(t,j,pools59,"lower") = v59_som_pool.lo(j,pools59); - ov59_crop_expansion(t,j,"lower") = v59_crop_expansion.lo(j); - ov59_crop_reduction(t,j,"lower") = v59_crop_reduction.lo(j); - ov59_som_transfer_to_cropland(t,j,"lower") = v59_som_transfer_to_cropland.lo(j); - ov_nr_som(t,j,"lower") = vm_nr_som.lo(j); - ov_costs_overrate_cropdiff(t,i,"lower") = vm_costs_overrate_cropdiff.lo(i); - oq59_som_target_cropland(t,j,"lower") = q59_som_target_cropland.lo(j); - oq59_som_target_noncropland(t,j,"lower") = q59_som_target_noncropland.lo(j); - oq59_som_transfer_to_cropland(t,j,"lower") = q59_som_transfer_to_cropland.lo(j); - oq59_som_pool_cropland(t,j,"lower") = q59_som_pool_cropland.lo(j); - oq59_som_pool_noncropland(t,j,"lower") = q59_som_pool_noncropland.lo(j); - oq59_nr_som(t,j,"lower") = q59_nr_som.lo(j); - oq59_crop_diff(t,j,"lower") = q59_crop_diff.lo(j); - oq59_crop_diff_constraint(t,i,"lower") = q59_crop_diff_constraint.lo(i); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - +*** | (C) 2008-2019 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 + +p59_som_pool(j,pools59) = v59_som_pool.l(j,pools59); + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov59_som_target(t,j,pools59,"marginal") = v59_som_target.m(j,pools59); + ov59_som_pool(t,j,pools59,"marginal") = v59_som_pool.m(j,pools59); + ov59_crop_expansion(t,j,"marginal") = v59_crop_expansion.m(j); + ov59_crop_reduction(t,j,"marginal") = v59_crop_reduction.m(j); + ov59_som_transfer_to_cropland(t,j,"marginal") = v59_som_transfer_to_cropland.m(j); + ov_nr_som(t,j,"marginal") = vm_nr_som.m(j); + ov_costs_overrate_cropdiff(t,i,"marginal") = vm_costs_overrate_cropdiff.m(i); + oq59_som_target_cropland(t,j,"marginal") = q59_som_target_cropland.m(j); + oq59_som_target_noncropland(t,j,"marginal") = q59_som_target_noncropland.m(j); + oq59_som_transfer_to_cropland(t,j,"marginal") = q59_som_transfer_to_cropland.m(j); + oq59_som_pool_cropland(t,j,"marginal") = q59_som_pool_cropland.m(j); + oq59_som_pool_noncropland(t,j,"marginal") = q59_som_pool_noncropland.m(j); + oq59_nr_som(t,j,"marginal") = q59_nr_som.m(j); + oq59_crop_diff(t,j,"marginal") = q59_crop_diff.m(j); + oq59_crop_diff_constraint(t,i,"marginal") = q59_crop_diff_constraint.m(i); + ov59_som_target(t,j,pools59,"level") = v59_som_target.l(j,pools59); + ov59_som_pool(t,j,pools59,"level") = v59_som_pool.l(j,pools59); + ov59_crop_expansion(t,j,"level") = v59_crop_expansion.l(j); + ov59_crop_reduction(t,j,"level") = v59_crop_reduction.l(j); + ov59_som_transfer_to_cropland(t,j,"level") = v59_som_transfer_to_cropland.l(j); + ov_nr_som(t,j,"level") = vm_nr_som.l(j); + ov_costs_overrate_cropdiff(t,i,"level") = vm_costs_overrate_cropdiff.l(i); + oq59_som_target_cropland(t,j,"level") = q59_som_target_cropland.l(j); + oq59_som_target_noncropland(t,j,"level") = q59_som_target_noncropland.l(j); + oq59_som_transfer_to_cropland(t,j,"level") = q59_som_transfer_to_cropland.l(j); + oq59_som_pool_cropland(t,j,"level") = q59_som_pool_cropland.l(j); + oq59_som_pool_noncropland(t,j,"level") = q59_som_pool_noncropland.l(j); + oq59_nr_som(t,j,"level") = q59_nr_som.l(j); + oq59_crop_diff(t,j,"level") = q59_crop_diff.l(j); + oq59_crop_diff_constraint(t,i,"level") = q59_crop_diff_constraint.l(i); + ov59_som_target(t,j,pools59,"upper") = v59_som_target.up(j,pools59); + ov59_som_pool(t,j,pools59,"upper") = v59_som_pool.up(j,pools59); + ov59_crop_expansion(t,j,"upper") = v59_crop_expansion.up(j); + ov59_crop_reduction(t,j,"upper") = v59_crop_reduction.up(j); + ov59_som_transfer_to_cropland(t,j,"upper") = v59_som_transfer_to_cropland.up(j); + ov_nr_som(t,j,"upper") = vm_nr_som.up(j); + ov_costs_overrate_cropdiff(t,i,"upper") = vm_costs_overrate_cropdiff.up(i); + oq59_som_target_cropland(t,j,"upper") = q59_som_target_cropland.up(j); + oq59_som_target_noncropland(t,j,"upper") = q59_som_target_noncropland.up(j); + oq59_som_transfer_to_cropland(t,j,"upper") = q59_som_transfer_to_cropland.up(j); + oq59_som_pool_cropland(t,j,"upper") = q59_som_pool_cropland.up(j); + oq59_som_pool_noncropland(t,j,"upper") = q59_som_pool_noncropland.up(j); + oq59_nr_som(t,j,"upper") = q59_nr_som.up(j); + oq59_crop_diff(t,j,"upper") = q59_crop_diff.up(j); + oq59_crop_diff_constraint(t,i,"upper") = q59_crop_diff_constraint.up(i); + ov59_som_target(t,j,pools59,"lower") = v59_som_target.lo(j,pools59); + ov59_som_pool(t,j,pools59,"lower") = v59_som_pool.lo(j,pools59); + ov59_crop_expansion(t,j,"lower") = v59_crop_expansion.lo(j); + ov59_crop_reduction(t,j,"lower") = v59_crop_reduction.lo(j); + ov59_som_transfer_to_cropland(t,j,"lower") = v59_som_transfer_to_cropland.lo(j); + ov_nr_som(t,j,"lower") = vm_nr_som.lo(j); + ov_costs_overrate_cropdiff(t,i,"lower") = vm_costs_overrate_cropdiff.lo(i); + oq59_som_target_cropland(t,j,"lower") = q59_som_target_cropland.lo(j); + oq59_som_target_noncropland(t,j,"lower") = q59_som_target_noncropland.lo(j); + oq59_som_transfer_to_cropland(t,j,"lower") = q59_som_transfer_to_cropland.lo(j); + oq59_som_pool_cropland(t,j,"lower") = q59_som_pool_cropland.lo(j); + oq59_som_pool_noncropland(t,j,"lower") = q59_som_pool_noncropland.lo(j); + oq59_nr_som(t,j,"lower") = q59_nr_som.lo(j); + oq59_crop_diff(t,j,"lower") = q59_crop_diff.lo(j); + oq59_crop_diff_constraint(t,i,"lower") = q59_crop_diff_constraint.lo(i); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### + diff --git a/modules/59_som/cellpool_aug16/preloop.gms b/modules/59_som/cellpool_aug16/preloop.gms index da7a92154c..d9bc2cd169 100644 --- a/modules/59_som/cellpool_aug16/preloop.gms +++ b/modules/59_som/cellpool_aug16/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 *' @code The cellpool_aug16 calculates the carbon loss with the assumption diff --git a/modules/59_som/cellpool_aug16/presolve.gms b/modules/59_som/cellpool_aug16/presolve.gms index ba13bf4ecf..69d548462d 100644 --- a/modules/59_som/cellpool_aug16/presolve.gms +++ b/modules/59_som/cellpool_aug16/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 p59_carbon_density(t,j,"noncropland")$(sum(noncropland59,pcm_land(j,noncropland59))>0) = p59_som_pool(j,"noncropland")/sum(noncropland59,pcm_land(j,noncropland59)); diff --git a/modules/59_som/cellpool_aug16.gms b/modules/59_som/cellpool_aug16/realization.gms similarity index 79% rename from modules/59_som/cellpool_aug16.gms rename to modules/59_som/cellpool_aug16/realization.gms index 5fcdef0009..cded1bae39 100644 --- a/modules/59_som/cellpool_aug16.gms +++ b/modules/59_som/cellpool_aug16/realization.gms @@ -1,28 +1,29 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description -*' The cellpool_aug16 realization is built on the IPCC 2006 Guidelines for -*' National Greenhouse Gas Inventories (@ipcc_2006_2006.). It calculates based -*' on the idea of stock change factors regarding the potential natural vegetation -*' the loss of soil carbon due to cropping activities and management. -*' This approach also accounts for the temporal dimension of soil organic carbon change, -*' since it assumes a gradual step of 15% in the direction of the new equilibrium soil -*' organic carbon pool each year. - -*' @authors Benjamin Leon Bodirsky, Kristine Karstens - - - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/59_som/cellpool_aug16/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/59_som/cellpool_aug16/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/59_som/cellpool_aug16/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/59_som/cellpool_aug16/equations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/59_som/cellpool_aug16/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/59_som/cellpool_aug16/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/59_som/cellpool_aug16/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description +*' The cellpool_aug16 realization is built on the IPCC 2006 Guidelines for +*' National Greenhouse Gas Inventories (@ipcc_2006_2006.). It calculates based +*' on the idea of stock change factors regarding the potential natural vegetation +*' the loss of soil carbon due to cropping activities and management. +*' This approach also accounts for the temporal dimension of soil organic carbon change, +*' since it assumes a gradual step of 15% in the direction of the new equilibrium soil +*' organic carbon pool each year. + +*' @authors Benjamin Leon Bodirsky, Kristine Karstens + + + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/59_som/cellpool_aug16/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/59_som/cellpool_aug16/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/59_som/cellpool_aug16/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/59_som/cellpool_aug16/equations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/59_som/cellpool_aug16/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/59_som/cellpool_aug16/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/59_som/cellpool_aug16/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/59_som/cellpool_aug16/sets.gms b/modules/59_som/cellpool_aug16/sets.gms index 8aa24af712..ff71be6ec0 100644 --- a/modules/59_som/cellpool_aug16/sets.gms +++ b/modules/59_som/cellpool_aug16/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets diff --git a/modules/59_som/59_som.gms b/modules/59_som/module.gms similarity index 54% rename from modules/59_som/59_som.gms rename to modules/59_som/module.gms index 1cefca24c2..ca2d3e8f79 100644 --- a/modules/59_som/59_som.gms +++ b/modules/59_som/module.gms @@ -1,21 +1,22 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Soil organic matter - -*' @description -*' The soil organic matter module calculates the soil organic carbon loss due to landuse activities. -*' It also estimates the nitrogen release due to the soil organic carbon turnover. - -*' @authors Benjamin Leon Bodirsky, Kristine Karstens - - - - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%som%" == "cellpool_aug16" $include "./modules/59_som/cellpool_aug16.gms" -$Ifi "%som%" == "off" $include "./modules/59_som/off.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Soil organic matter + +*' @description +*' The soil organic matter module calculates the soil organic carbon loss due to landuse activities. +*' It also estimates the nitrogen release due to the soil organic carbon turnover. + +*' @authors Benjamin Leon Bodirsky, Kristine Karstens + + + + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%som%" == "cellpool_aug16" $include "./modules/59_som/cellpool_aug16/realization.gms" +$Ifi "%som%" == "off" $include "./modules/59_som/off/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/59_som/off/declarations.gms b/modules/59_som/off/declarations.gms index cbe07ce0f4..9a604cc9a5 100644 --- a/modules/59_som/off/declarations.gms +++ b/modules/59_som/off/declarations.gms @@ -1,17 +1,18 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -variables - vm_nr_som(j) Release of soil organic matter (Tg N per yr) - vm_costs_overrate_cropdiff(i) Punishment costs for overrated cropland difference (mio. USD05 per yr) -; -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_nr_som(t,j,type) Release of soil organic matter (Tg N per yr) - ov_costs_overrate_cropdiff(t,i,type) Punishment costs for overrated cropland difference (mio. USD05 per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### - +*** | (C) 2008-2019 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 + +variables + vm_nr_som(j) Release of soil organic matter (Tg N per yr) + vm_costs_overrate_cropdiff(i) Punishment costs for overrated cropland difference (mio. USD05 per yr) +; +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_nr_som(t,j,type) Release of soil organic matter (Tg N per yr) + ov_costs_overrate_cropdiff(t,i,type) Punishment costs for overrated cropland difference (mio. USD05 per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### + diff --git a/modules/59_som/off/not_used.txt b/modules/59_som/off/not_used.txt index f55d753535..33881c0f88 100644 --- a/modules/59_som/off/not_used.txt +++ b/modules/59_som/off/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason vm_land,input,questionnaire diff --git a/modules/59_som/off/postsolve.gms b/modules/59_som/off/postsolve.gms index 74b67e836f..a30e94ab32 100644 --- a/modules/59_som/off/postsolve.gms +++ b/modules/59_som/off/postsolve.gms @@ -1,19 +1,20 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_nr_som(t,j,"marginal") = vm_nr_som.m(j); - ov_costs_overrate_cropdiff(t,i,"marginal") = vm_costs_overrate_cropdiff.m(i); - ov_nr_som(t,j,"level") = vm_nr_som.l(j); - ov_costs_overrate_cropdiff(t,i,"level") = vm_costs_overrate_cropdiff.l(i); - ov_nr_som(t,j,"upper") = vm_nr_som.up(j); - ov_costs_overrate_cropdiff(t,i,"upper") = vm_costs_overrate_cropdiff.up(i); - ov_nr_som(t,j,"lower") = vm_nr_som.lo(j); - ov_costs_overrate_cropdiff(t,i,"lower") = vm_costs_overrate_cropdiff.lo(i); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - +*** | (C) 2008-2019 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 + + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_nr_som(t,j,"marginal") = vm_nr_som.m(j); + ov_costs_overrate_cropdiff(t,i,"marginal") = vm_costs_overrate_cropdiff.m(i); + ov_nr_som(t,j,"level") = vm_nr_som.l(j); + ov_costs_overrate_cropdiff(t,i,"level") = vm_costs_overrate_cropdiff.l(i); + ov_nr_som(t,j,"upper") = vm_nr_som.up(j); + ov_costs_overrate_cropdiff(t,i,"upper") = vm_costs_overrate_cropdiff.up(i); + ov_nr_som(t,j,"lower") = vm_nr_som.lo(j); + ov_costs_overrate_cropdiff(t,i,"lower") = vm_costs_overrate_cropdiff.lo(i); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### + diff --git a/modules/59_som/off/presolve.gms b/modules/59_som/off/presolve.gms index 9bd646f995..05bda92cfd 100644 --- a/modules/59_som/off/presolve.gms +++ b/modules/59_som/off/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de vm_nr_som.fx(j)=0; diff --git a/modules/59_som/off.gms b/modules/59_som/off/realization.gms similarity index 62% rename from modules/59_som/off.gms rename to modules/59_som/off/realization.gms index c2aad42c94..8957d97181 100644 --- a/modules/59_som/off.gms +++ b/modules/59_som/off/realization.gms @@ -1,15 +1,16 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description This realization does not track soil organic matter turnover. - -*' @limitations The release of nitrogen due to soil organic matter loss is not calculated. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "declarations" $include "./modules/59_som/off/declarations.gms" -$Ifi "%phase%" == "presolve" $include "./modules/59_som/off/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/59_som/off/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description This realization does not track soil organic matter turnover. + +*' @limitations The release of nitrogen due to soil organic matter loss is not calculated. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "declarations" $include "./modules/59_som/off/declarations.gms" +$Ifi "%phase%" == "presolve" $include "./modules/59_som/off/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/59_som/off/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/60_bioenergy/1stgen_priced_dec18/declarations.gms b/modules/60_bioenergy/1stgen_priced_dec18/declarations.gms index d5a20e1a14..e067d6a72e 100644 --- a/modules/60_bioenergy/1stgen_priced_dec18/declarations.gms +++ b/modules/60_bioenergy/1stgen_priced_dec18/declarations.gms @@ -1,44 +1,45 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -parameters - i60_bioenergy_dem(t,i) Regional bioenergy demand per year (mio. GJ per yr) - i60_res_2ndgenBE_dem(t,i) Regional residue demand for 2nd generation bioenergy per year (mio. GJ per yr) - i60_1stgen_bioenergy_dem(t,i,kall) Regional 1st generation bioenergy demand (mio. GJ per yr) -; - -positive variables - vm_dem_bioen(i,kall) Regional bioenergy demand (mio. tDM per yr) - v60_2ndgen_bioenergy_dem_dedicated(i,kall) bioenergy demand which can come from different regions (mio. GJ per yr) - v60_2ndgen_bioenergy_dem_residues(i,kall) bioenergy demand which can come from different product types (mio. GJ per yr) -; - -variables - vm_bioenergy_utility(i) Utility as negative costs for producing bioenergy (USD05MER per yr) -; - -equations - q60_bioenergy(i,kall) Global total bioenergy demand (mio. GJ per yr) - q60_bioenergy_glo Global 2nd generation dedicated bioenergy demand (mio. GJ per yr) - q60_bioenergy_reg(i) Regional 2nd generation dedicated bioenergy demand (mio. GJ per yr) - q60_res_2ndgenBE(i) Regional residue demand for 2nd generation bioenergy (mio. GJ per yr) - q60_bioenergy_incentive(i) Incentive to produce bioenergy (mio. USD05MER per yr) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_dem_bioen(t,i,kall,type) Regional bioenergy demand (mio. tDM per yr) - ov60_2ndgen_bioenergy_dem_dedicated(t,i,kall,type) bioenergy demand which can come from different regions (mio. GJ per yr) - ov60_2ndgen_bioenergy_dem_residues(t,i,kall,type) bioenergy demand which can come from different product types (mio. GJ per yr) - ov_bioenergy_utility(t,i,type) Utility as negative costs for producing bioenergy (USD05MER per yr) - oq60_bioenergy(t,i,kall,type) Global total bioenergy demand (mio. GJ per yr) - oq60_bioenergy_glo(t,type) Global 2nd generation dedicated bioenergy demand (mio. GJ per yr) - oq60_bioenergy_reg(t,i,type) Regional 2nd generation dedicated bioenergy demand (mio. GJ per yr) - oq60_res_2ndgenBE(t,i,type) Regional residue demand for 2nd generation bioenergy (mio. GJ per yr) - oq60_bioenergy_incentive(t,i,type) Incentive to produce bioenergy (mio. USD05MER per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + +parameters + i60_bioenergy_dem(t,i) Regional bioenergy demand per year (mio. GJ per yr) + i60_res_2ndgenBE_dem(t,i) Regional residue demand for 2nd generation bioenergy per year (mio. GJ per yr) + i60_1stgen_bioenergy_dem(t,i,kall) Regional 1st generation bioenergy demand (mio. GJ per yr) +; + +positive variables + vm_dem_bioen(i,kall) Regional bioenergy demand (mio. tDM per yr) + v60_2ndgen_bioenergy_dem_dedicated(i,kall) bioenergy demand which can come from different regions (mio. GJ per yr) + v60_2ndgen_bioenergy_dem_residues(i,kall) bioenergy demand which can come from different product types (mio. GJ per yr) +; + +variables + vm_bioenergy_utility(i) Utility as negative costs for producing bioenergy (USD05MER per yr) +; + +equations + q60_bioenergy(i,kall) Global total bioenergy demand (mio. GJ per yr) + q60_bioenergy_glo Global 2nd generation dedicated bioenergy demand (mio. GJ per yr) + q60_bioenergy_reg(i) Regional 2nd generation dedicated bioenergy demand (mio. GJ per yr) + q60_res_2ndgenBE(i) Regional residue demand for 2nd generation bioenergy (mio. GJ per yr) + q60_bioenergy_incentive(i) Incentive to produce bioenergy (mio. USD05MER per yr) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_dem_bioen(t,i,kall,type) Regional bioenergy demand (mio. tDM per yr) + ov60_2ndgen_bioenergy_dem_dedicated(t,i,kall,type) bioenergy demand which can come from different regions (mio. GJ per yr) + ov60_2ndgen_bioenergy_dem_residues(t,i,kall,type) bioenergy demand which can come from different product types (mio. GJ per yr) + ov_bioenergy_utility(t,i,type) Utility as negative costs for producing bioenergy (USD05MER per yr) + oq60_bioenergy(t,i,kall,type) Global total bioenergy demand (mio. GJ per yr) + oq60_bioenergy_glo(t,type) Global 2nd generation dedicated bioenergy demand (mio. GJ per yr) + oq60_bioenergy_reg(t,i,type) Regional 2nd generation dedicated bioenergy demand (mio. GJ per yr) + oq60_res_2ndgenBE(t,i,type) Regional residue demand for 2nd generation bioenergy (mio. GJ per yr) + oq60_bioenergy_incentive(t,i,type) Incentive to produce bioenergy (mio. USD05MER per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/60_bioenergy/1stgen_priced_dec18/equations.gms b/modules/60_bioenergy/1stgen_priced_dec18/equations.gms index 8668577753..1df8c1213b 100644 --- a/modules/60_bioenergy/1stgen_priced_dec18/equations.gms +++ b/modules/60_bioenergy/1stgen_priced_dec18/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations diff --git a/modules/60_bioenergy/1stgen_priced_dec18/input.gms b/modules/60_bioenergy/1stgen_priced_dec18/input.gms index 3eaa4a60d3..e514be6ffe 100644 --- a/modules/60_bioenergy/1stgen_priced_dec18/input.gms +++ b/modules/60_bioenergy/1stgen_priced_dec18/input.gms @@ -1,59 +1,52 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -scalars - c60_biodem_level bioenergy demand level indicator 1 for regional and 0 for global demand (1) / 1 / -; - -$setglobal c60_2ndgen_biodem SSP2-Ref-SPA0 -* options: SSP1-Ref-SPA0, SSP2-Ref-SPA0, SSP5-Ref-SPA0, -* SSP1-26-SPA0, SSP1-37-SPA0, SSP1-45-SPA0, -* SSP2-26-SPA0, SSP2-37-SPA0, SSP2-45-SPA0, SSP2-60-SPA0, -* SSP5-26-SPA0, SSP5-37-SPA0, SSP5-45-SPA0, SSP5-60-SPA0, -* SSP1-26-SPA1, SSP1-37-SPA1, SSP1-45-SPA1, -* SSP2-26-SPA2, SSP2-37-SPA2, SSP2-45-SPA2, SSP2-60-SPA2, -* SSP5-26-SPA5, SSP5-37-SPA5, SSP5-45-SPA5, SSP5-60-SPA5, -* coupling - -$if "%c60_2ndgen_biodem%" == "coupling" table f60_bioenergy_dem_coupling(t_all,i) Bioenergy demand (regional) (mio. GJ per yr) -$if "%c60_2ndgen_biodem%" == "coupling" $ondelim -$if "%c60_2ndgen_biodem%" == "coupling" $include "./modules/60_bioenergy/input/reg.2ndgen_bioenergy_demand.csv" -$if "%c60_2ndgen_biodem%" == "coupling" $offdelim -$if "%c60_2ndgen_biodem%" == "coupling" ; - -$if "%c60_2ndgen_biodem%" == "emulator" parameter f60_bioenergy_dem_emulator(t_all) Bioenergy demand (global) (mio. GJ per yr) -$if "%c60_2ndgen_biodem%" == "emulator" / -$if "%c60_2ndgen_biodem%" == "emulator" $ondelim -$if "%c60_2ndgen_biodem%" == "emulator" $include "./modules/60_bioenergy/input/glo.2ndgen_bioenergy_demand.csv" -$if "%c60_2ndgen_biodem%" == "emulator" $offdelim -$if "%c60_2ndgen_biodem%" == "emulator" / -$if "%c60_2ndgen_biodem%" == "emulator" ; - -table f60_bioenergy_dem(t_all,i,scen2nd60) annual bioenergy demand (regional) (mio. GJ per yr) -$ondelim -$include "./modules/60_bioenergy/input/f60_bioenergy_dem.cs3" -$offdelim -; - -$setglobal c60_res_2ndgenBE_dem ssp2 -* options: ssp1,ssp2,ssp3,ssp4,ssp5,off - -table f60_res_2ndgenBE_dem(t_all,i,scen2ndres60) annual residue demand for 2nd generation bioenergy(regional) (mio. GJ per yr) -$ondelim -$include "./modules/60_bioenergy/input/f60_2ndgenBE_residue_dem.cs3" -$offdelim -; - - -$setglobal c60_1stgen_biodem const2020 -* options: "const2020", "const2030", "phaseout2020" - -table f60_1stgen_bioenergy_dem(t_all,i,scen1st60,kall) annual 1st generation bioenergy demand (mio. GJ per yr) -$ondelim -$include "./modules/60_bioenergy/input/f60_1stgen_bioenergy_dem.cs3" -$offdelim -; +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + +scalars + c60_biodem_level bioenergy demand level indicator 1 for regional and 0 for global demand (1) / 1 / +; + +$setglobal c60_2ndgen_biodem R2M41-SSP2-NPi + +$if "%c60_2ndgen_biodem%" == "coupling" table f60_bioenergy_dem_coupling(t_all,i) Bioenergy demand (regional) (mio. GJ per yr) +$if "%c60_2ndgen_biodem%" == "coupling" $ondelim +$if "%c60_2ndgen_biodem%" == "coupling" $include "./modules/60_bioenergy/input/reg.2ndgen_bioenergy_demand.csv" +$if "%c60_2ndgen_biodem%" == "coupling" $offdelim +$if "%c60_2ndgen_biodem%" == "coupling" ; + +$if "%c60_2ndgen_biodem%" == "emulator" parameter f60_bioenergy_dem_emulator(t_all) Bioenergy demand (global) (mio. GJ per yr) +$if "%c60_2ndgen_biodem%" == "emulator" / +$if "%c60_2ndgen_biodem%" == "emulator" $ondelim +$if "%c60_2ndgen_biodem%" == "emulator" $include "./modules/60_bioenergy/input/glo.2ndgen_bioenergy_demand.csv" +$if "%c60_2ndgen_biodem%" == "emulator" $offdelim +$if "%c60_2ndgen_biodem%" == "emulator" / +$if "%c60_2ndgen_biodem%" == "emulator" ; + +table f60_bioenergy_dem(t_all,i,scen2nd60) annual bioenergy demand (regional) (mio. GJ per yr) +$ondelim +$include "./modules/60_bioenergy/input/f60_bioenergy_dem.cs3" +$offdelim +; + +$setglobal c60_res_2ndgenBE_dem ssp2 +* options: ssp1,ssp2,ssp3,ssp4,ssp5,off + +table f60_res_2ndgenBE_dem(t_all,i,scen2ndres60) annual residue demand for 2nd generation bioenergy(regional) (mio. GJ per yr) +$ondelim +$include "./modules/60_bioenergy/input/f60_2ndgenBE_residue_dem.cs3" +$offdelim +; + + +$setglobal c60_1stgen_biodem const2020 +* options: "const2020", "const2030", "phaseout2020" + +table f60_1stgen_bioenergy_dem(t_all,i,scen1st60,kall) annual 1st generation bioenergy demand (mio. GJ per yr) +$ondelim +$include "./modules/60_bioenergy/input/f60_1stgen_bioenergy_dem.cs3" +$offdelim +; diff --git a/modules/60_bioenergy/1stgen_priced_dec18/not_used.txt b/modules/60_bioenergy/1stgen_priced_dec18/not_used.txt index 6ece3f27a1..4b81dfbae2 100644 --- a/modules/60_bioenergy/1stgen_priced_dec18/not_used.txt +++ b/modules/60_bioenergy/1stgen_priced_dec18/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason diff --git a/modules/60_bioenergy/1stgen_priced_dec18/postsolve.gms b/modules/60_bioenergy/1stgen_priced_dec18/postsolve.gms index ea70ec4b45..bd0be2de15 100644 --- a/modules/60_bioenergy/1stgen_priced_dec18/postsolve.gms +++ b/modules/60_bioenergy/1stgen_priced_dec18/postsolve.gms @@ -1,47 +1,48 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_dem_bioen(t,i,kall,"marginal") = vm_dem_bioen.m(i,kall); - ov60_2ndgen_bioenergy_dem_dedicated(t,i,kall,"marginal") = v60_2ndgen_bioenergy_dem_dedicated.m(i,kall); - ov60_2ndgen_bioenergy_dem_residues(t,i,kall,"marginal") = v60_2ndgen_bioenergy_dem_residues.m(i,kall); - ov_bioenergy_utility(t,i,"marginal") = vm_bioenergy_utility.m(i); - oq60_bioenergy(t,i,kall,"marginal") = q60_bioenergy.m(i,kall); - oq60_bioenergy_glo(t,"marginal") = q60_bioenergy_glo.m; - oq60_bioenergy_reg(t,i,"marginal") = q60_bioenergy_reg.m(i); - oq60_res_2ndgenBE(t,i,"marginal") = q60_res_2ndgenBE.m(i); - oq60_bioenergy_incentive(t,i,"marginal") = q60_bioenergy_incentive.m(i); - ov_dem_bioen(t,i,kall,"level") = vm_dem_bioen.l(i,kall); - ov60_2ndgen_bioenergy_dem_dedicated(t,i,kall,"level") = v60_2ndgen_bioenergy_dem_dedicated.l(i,kall); - ov60_2ndgen_bioenergy_dem_residues(t,i,kall,"level") = v60_2ndgen_bioenergy_dem_residues.l(i,kall); - ov_bioenergy_utility(t,i,"level") = vm_bioenergy_utility.l(i); - oq60_bioenergy(t,i,kall,"level") = q60_bioenergy.l(i,kall); - oq60_bioenergy_glo(t,"level") = q60_bioenergy_glo.l; - oq60_bioenergy_reg(t,i,"level") = q60_bioenergy_reg.l(i); - oq60_res_2ndgenBE(t,i,"level") = q60_res_2ndgenBE.l(i); - oq60_bioenergy_incentive(t,i,"level") = q60_bioenergy_incentive.l(i); - ov_dem_bioen(t,i,kall,"upper") = vm_dem_bioen.up(i,kall); - ov60_2ndgen_bioenergy_dem_dedicated(t,i,kall,"upper") = v60_2ndgen_bioenergy_dem_dedicated.up(i,kall); - ov60_2ndgen_bioenergy_dem_residues(t,i,kall,"upper") = v60_2ndgen_bioenergy_dem_residues.up(i,kall); - ov_bioenergy_utility(t,i,"upper") = vm_bioenergy_utility.up(i); - oq60_bioenergy(t,i,kall,"upper") = q60_bioenergy.up(i,kall); - oq60_bioenergy_glo(t,"upper") = q60_bioenergy_glo.up; - oq60_bioenergy_reg(t,i,"upper") = q60_bioenergy_reg.up(i); - oq60_res_2ndgenBE(t,i,"upper") = q60_res_2ndgenBE.up(i); - oq60_bioenergy_incentive(t,i,"upper") = q60_bioenergy_incentive.up(i); - ov_dem_bioen(t,i,kall,"lower") = vm_dem_bioen.lo(i,kall); - ov60_2ndgen_bioenergy_dem_dedicated(t,i,kall,"lower") = v60_2ndgen_bioenergy_dem_dedicated.lo(i,kall); - ov60_2ndgen_bioenergy_dem_residues(t,i,kall,"lower") = v60_2ndgen_bioenergy_dem_residues.lo(i,kall); - ov_bioenergy_utility(t,i,"lower") = vm_bioenergy_utility.lo(i); - oq60_bioenergy(t,i,kall,"lower") = q60_bioenergy.lo(i,kall); - oq60_bioenergy_glo(t,"lower") = q60_bioenergy_glo.lo; - oq60_bioenergy_reg(t,i,"lower") = q60_bioenergy_reg.lo(i); - oq60_res_2ndgenBE(t,i,"lower") = q60_res_2ndgenBE.lo(i); - oq60_bioenergy_incentive(t,i,"lower") = q60_bioenergy_incentive.lo(i); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - +*** | (C) 2008-2019 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 + + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_dem_bioen(t,i,kall,"marginal") = vm_dem_bioen.m(i,kall); + ov60_2ndgen_bioenergy_dem_dedicated(t,i,kall,"marginal") = v60_2ndgen_bioenergy_dem_dedicated.m(i,kall); + ov60_2ndgen_bioenergy_dem_residues(t,i,kall,"marginal") = v60_2ndgen_bioenergy_dem_residues.m(i,kall); + ov_bioenergy_utility(t,i,"marginal") = vm_bioenergy_utility.m(i); + oq60_bioenergy(t,i,kall,"marginal") = q60_bioenergy.m(i,kall); + oq60_bioenergy_glo(t,"marginal") = q60_bioenergy_glo.m; + oq60_bioenergy_reg(t,i,"marginal") = q60_bioenergy_reg.m(i); + oq60_res_2ndgenBE(t,i,"marginal") = q60_res_2ndgenBE.m(i); + oq60_bioenergy_incentive(t,i,"marginal") = q60_bioenergy_incentive.m(i); + ov_dem_bioen(t,i,kall,"level") = vm_dem_bioen.l(i,kall); + ov60_2ndgen_bioenergy_dem_dedicated(t,i,kall,"level") = v60_2ndgen_bioenergy_dem_dedicated.l(i,kall); + ov60_2ndgen_bioenergy_dem_residues(t,i,kall,"level") = v60_2ndgen_bioenergy_dem_residues.l(i,kall); + ov_bioenergy_utility(t,i,"level") = vm_bioenergy_utility.l(i); + oq60_bioenergy(t,i,kall,"level") = q60_bioenergy.l(i,kall); + oq60_bioenergy_glo(t,"level") = q60_bioenergy_glo.l; + oq60_bioenergy_reg(t,i,"level") = q60_bioenergy_reg.l(i); + oq60_res_2ndgenBE(t,i,"level") = q60_res_2ndgenBE.l(i); + oq60_bioenergy_incentive(t,i,"level") = q60_bioenergy_incentive.l(i); + ov_dem_bioen(t,i,kall,"upper") = vm_dem_bioen.up(i,kall); + ov60_2ndgen_bioenergy_dem_dedicated(t,i,kall,"upper") = v60_2ndgen_bioenergy_dem_dedicated.up(i,kall); + ov60_2ndgen_bioenergy_dem_residues(t,i,kall,"upper") = v60_2ndgen_bioenergy_dem_residues.up(i,kall); + ov_bioenergy_utility(t,i,"upper") = vm_bioenergy_utility.up(i); + oq60_bioenergy(t,i,kall,"upper") = q60_bioenergy.up(i,kall); + oq60_bioenergy_glo(t,"upper") = q60_bioenergy_glo.up; + oq60_bioenergy_reg(t,i,"upper") = q60_bioenergy_reg.up(i); + oq60_res_2ndgenBE(t,i,"upper") = q60_res_2ndgenBE.up(i); + oq60_bioenergy_incentive(t,i,"upper") = q60_bioenergy_incentive.up(i); + ov_dem_bioen(t,i,kall,"lower") = vm_dem_bioen.lo(i,kall); + ov60_2ndgen_bioenergy_dem_dedicated(t,i,kall,"lower") = v60_2ndgen_bioenergy_dem_dedicated.lo(i,kall); + ov60_2ndgen_bioenergy_dem_residues(t,i,kall,"lower") = v60_2ndgen_bioenergy_dem_residues.lo(i,kall); + ov_bioenergy_utility(t,i,"lower") = vm_bioenergy_utility.lo(i); + oq60_bioenergy(t,i,kall,"lower") = q60_bioenergy.lo(i,kall); + oq60_bioenergy_glo(t,"lower") = q60_bioenergy_glo.lo; + oq60_bioenergy_reg(t,i,"lower") = q60_bioenergy_reg.lo(i); + oq60_res_2ndgenBE(t,i,"lower") = q60_res_2ndgenBE.lo(i); + oq60_bioenergy_incentive(t,i,"lower") = q60_bioenergy_incentive.lo(i); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### + diff --git a/modules/60_bioenergy/1stgen_priced_dec18/preloop.gms b/modules/60_bioenergy/1stgen_priced_dec18/preloop.gms index 901e8ca2e5..e0cf540850 100644 --- a/modules/60_bioenergy/1stgen_priced_dec18/preloop.gms +++ b/modules/60_bioenergy/1stgen_priced_dec18/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 $ifthen "%c60_2ndgen_biodem%" == "coupling" i60_bioenergy_dem(t,i) = f60_bioenergy_dem_coupling(t,i); diff --git a/modules/60_bioenergy/1stgen_priced_dec18/presolve.gms b/modules/60_bioenergy/1stgen_priced_dec18/presolve.gms index d65bb6f176..22fc241776 100644 --- a/modules/60_bioenergy/1stgen_priced_dec18/presolve.gms +++ b/modules/60_bioenergy/1stgen_priced_dec18/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de vm_dem_bioen.fx(i2,kap)=0; diff --git a/modules/60_bioenergy/1stgen_priced_dec18.gms b/modules/60_bioenergy/1stgen_priced_dec18/realization.gms similarity index 67% rename from modules/60_bioenergy/1stgen_priced_dec18.gms rename to modules/60_bioenergy/1stgen_priced_dec18/realization.gms index e68f0117aa..3cea85cd8d 100644 --- a/modules/60_bioenergy/1stgen_priced_dec18.gms +++ b/modules/60_bioenergy/1stgen_priced_dec18/realization.gms @@ -1,10 +1,16 @@ - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/60_bioenergy/1stgen_priced_dec18/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/60_bioenergy/1stgen_priced_dec18/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/60_bioenergy/1stgen_priced_dec18/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/60_bioenergy/1stgen_priced_dec18/equations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/60_bioenergy/1stgen_priced_dec18/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/60_bioenergy/1stgen_priced_dec18/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/60_bioenergy/1stgen_priced_dec18/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 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 + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/60_bioenergy/1stgen_priced_dec18/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/60_bioenergy/1stgen_priced_dec18/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/60_bioenergy/1stgen_priced_dec18/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/60_bioenergy/1stgen_priced_dec18/equations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/60_bioenergy/1stgen_priced_dec18/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/60_bioenergy/1stgen_priced_dec18/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/60_bioenergy/1stgen_priced_dec18/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/60_bioenergy/1stgen_priced_dec18/sets.gms b/modules/60_bioenergy/1stgen_priced_dec18/sets.gms index b644485d0e..dce6a52c85 100644 --- a/modules/60_bioenergy/1stgen_priced_dec18/sets.gms +++ b/modules/60_bioenergy/1stgen_priced_dec18/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets @@ -16,15 +17,32 @@ sets / const2020, const2030, phaseout2020 / scen2nd60 second generation bioenergy scenarios - / SSP1-Ref-SPA0, SSP2-Ref-SPA0, SSP5-Ref-SPA0, - SSP1-20-SPA0, SSP1-26-SPA0, SSP1-37-SPA0, SSP1-45-SPA0, - SSP2-20-SPA0, SSP2-26-SPA0, SSP2-37-SPA0, SSP2-45-SPA0, SSP2-60-SPA0, SSP2-OS-SPA2, - SSP5-20-SPA0, SSP5-26-SPA0, SSP5-37-SPA0, SSP5-45-SPA0, SSP5-60-SPA0, - SSP1-20-SPA1, SSP1-26-SPA1, SSP1-37-SPA1, SSP1-45-SPA1, - SSP2-20-SPA2, SSP2-26-SPA2, SSP2-37-SPA2, SSP2-45-SPA2, SSP2-60-SPA2, - SSP5-20-SPA5, SSP5-26-SPA5, SSP5-37-SPA5, SSP5-45-SPA5, SSP5-60-SPA5, SSP5-OS-SPA5 / + /R2M41-SSP2-Budg1300,R2M41-SSP2-Budg600, + R2M41-SSP2-Budg950,R2M41-SSP2-NDC,R2M41-SSP2-NPi, + SSPDB-SSP1-20-IMAGE,SSPDB-SSP1-20-REMIND-MAGPIE, + SSPDB-SSP1-26-IMAGE,SSPDB-SSP1-26-REMIND-MAGPIE, + SSPDB-SSP1-34-IMAGE,SSPDB-SSP1-34-REMIND-MAGPIE, + SSPDB-SSP1-37-REMIND-MAGPIE, + SSPDB-SSP1-45-IMAGE,SSPDB-SSP1-45-REMIND-MAGPIE, + SSPDB-SSP1-Ref-IMAGE,SSPDB-SSP1-Ref-REMIND-MAGPIE, + SSPDB-SSP2-18-MESSAGE-GLOBIOM,SSPDB-SSP2-19-MESSAGE-GLOBIOM, + SSPDB-SSP2-20-MESSAGE-GLOBIOM,SSPDB-SSP2-20-REMIND-MAGPIE, + SSPDB-SSP2-26-MESSAGE-GLOBIOM,SSPDB-SSP2-26-REMIND-MAGPIE, + SSPDB-SSP2-34-MESSAGE-GLOBIOM,SSPDB-SSP2-34-REMIND-MAGPIE, + SSPDB-SSP2-37-REMIND-MAGPIE, + SSPDB-SSP2-45-MESSAGE-GLOBIOM,SSPDB-SSP2-45-REMIND-MAGPIE, + SSPDB-SSP2-60-MESSAGE-GLOBIOM,SSPDB-SSP2-60-REMIND-MAGPIE, + SSPDB-SSP2-Ref-MESSAGE-GLOBIOM,SSPDB-SSP2-Ref-REMIND-MAGPIE, + SSPDB-SSP3-34-AIM-CGE,SSPDB-SSP3-45-AIM-CGE, + SSPDB-SSP3-60-AIM-CGE,SSPDB-SSP4-26-GCAM4, + SSPDB-SSP4-34-GCAM4,SSPDB-SSP4-45-GCAM4, + SSPDB-SSP4-60-GCAM4,SSPDB-SSP4-Ref-GCAM4, + SSPDB-SSP5-20-REMIND-MAGPIE,SSPDB-SSP5-26-REMIND-MAGPIE, + SSPDB-SSP5-34-REMIND-MAGPIE,SSPDB-SSP5-37-REMIND-MAGPIE, + SSPDB-SSP5-45-REMIND-MAGPIE,SSPDB-SSP5-60-REMIND-MAGPIE, + SSPDB-SSP5-Ref-REMIND-MAGPIE/ scen2ndres60 residues for second generation bioenergy scenarios / ssp1, ssp2, ssp3, ssp4, ssp5, off / -; \ No newline at end of file +; diff --git a/modules/60_bioenergy/60_bioenergy.gms b/modules/60_bioenergy/module.gms similarity index 63% rename from modules/60_bioenergy/60_bioenergy.gms rename to modules/60_bioenergy/module.gms index 958eaaa91c..a7838c67f8 100644 --- a/modules/60_bioenergy/60_bioenergy.gms +++ b/modules/60_bioenergy/module.gms @@ -1,23 +1,23 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Bioenergy -*' -*' @description The bioenergy module provides a regional and crop-specific -*' bioenergy demand $vm\_dem\_bioen$ to the model (to the [16_demand] module). -*' For this calculation it requires -*' information on gross energy content (provided by [16_demand] module). -*' -*' In addition to calculation of bioenergy quantities, the costs associated with -*' the production are provided to the objective function in the [11_costs] module. -*' -*' @authors Jan Philipp Dietrich - - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%bioenergy%" == "1stgen_priced_dec18" $include "./modules/60_bioenergy/1stgen_priced_dec18.gms" -$Ifi "%bioenergy%" == "standard_flexreg_may17" $include "./modules/60_bioenergy/standard_flexreg_may17.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Bioenergy +*' +*' @description The bioenergy module provides a regional and crop-specific +*' bioenergy demand $vm\_dem\_bioen$ to the model (to the [16_demand] module). +*' For this calculation it requires +*' information on gross energy content (provided by [16_demand] module). +*' +*' In addition to calculation of bioenergy quantities, the costs associated with +*' the production are provided to the objective function in the [11_costs] module. +*' +*' @authors Jan Philipp Dietrich + + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%bioenergy%" == "1stgen_priced_dec18" $include "./modules/60_bioenergy/1stgen_priced_dec18/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/60_bioenergy/standard_flexreg_may17.gms b/modules/60_bioenergy/standard_flexreg_may17.gms deleted file mode 100644 index a0507352e1..0000000000 --- a/modules/60_bioenergy/standard_flexreg_may17.gms +++ /dev/null @@ -1,20 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description -*' Calculation of first and second generation bioenergy demand on the regional -*' level. -*' - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/60_bioenergy/standard_flexreg_may17/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/60_bioenergy/standard_flexreg_may17/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/60_bioenergy/standard_flexreg_may17/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/60_bioenergy/standard_flexreg_may17/equations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/60_bioenergy/standard_flexreg_may17/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/60_bioenergy/standard_flexreg_may17/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/60_bioenergy/standard_flexreg_may17/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### diff --git a/modules/60_bioenergy/standard_flexreg_may17/declarations.gms b/modules/60_bioenergy/standard_flexreg_may17/declarations.gms deleted file mode 100644 index 6d37c45a8a..0000000000 --- a/modules/60_bioenergy/standard_flexreg_may17/declarations.gms +++ /dev/null @@ -1,35 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -parameters - i60_bioenergy_dem(t,i) Regional bioenergy demand per year (mio. GJ per yr) - i60_res_2ndgenBE_dem(t,i) Regional residue demand for 2nd generation bioenergy per year (mio. GJ per yr) -; - -positive variables - vm_dem_bioen(i,kall) Regional bioenergy demand (mio. tDM per yr) -; - -variables - vm_bioenergy_utility(i) Utility as negative costs for producing bioenergy (USD05MER per yr) -; - -equations - q60_bioenergy_glo Global bioenergy demand (mio. GJ per yr) - q60_bioenergy_reg(i) Regional bioenergy demand (mio. GJ per yr) - q60_res_2ndgenBE(i) Regional residue demand for 2nd generation bioenergy (mio. GJ per yr) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_dem_bioen(t,i,kall,type) Regional bioenergy demand (mio. tDM per yr) - ov_bioenergy_utility(t,i,type) Utility as negative costs for producing bioenergy (USD05MER per yr) - oq60_bioenergy_glo(t,type) Global bioenergy demand (mio. GJ per yr) - oq60_bioenergy_reg(t,i,type) Regional bioenergy demand (mio. GJ per yr) - oq60_res_2ndgenBE(t,i,type) Regional residue demand for 2nd generation bioenergy (mio. GJ per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/60_bioenergy/standard_flexreg_may17/equations.gms b/modules/60_bioenergy/standard_flexreg_may17/equations.gms deleted file mode 100644 index a091304d16..0000000000 --- a/modules/60_bioenergy/standard_flexreg_may17/equations.gms +++ /dev/null @@ -1,37 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @equations -*' -*' The bioenergy demand calculation for second generation bioenergy is based on -*' the following two equations from which always only one is active: -*' If $c60\_biodem\_level$ is 1 (regional) the right hand side of the first equation -*' is set to 0, if it is 0 (global) the right hand side of the second equation -*' is set to 0. - -q60_bioenergy_glo.. sum((kbe60,i2), vm_dem_bioen(i2,kbe60)*fm_attributes("ge",kbe60)) - =g= sum((ct,i2),i60_bioenergy_dem(ct,i2))*(1-c60_biodem_level); - -q60_bioenergy_reg(i2).. sum(kbe60, vm_dem_bioen(i2,kbe60)*fm_attributes("ge",kbe60)) - =g= sum(ct,i60_bioenergy_dem(ct,i2))*c60_biodem_level; - -*' Except the implementation of the switches and the fact that in the first -*' equation the bioenergy demand is summed up to a global demand both equations -*' act the same way: In both cases the equation just makes sure that the sum -*' over all second generation energy crop of the bioenergy demand is greater or -*' equal to the demand actually given by the input file $i60\_bioenergy\_dem$. - -q60_res_2ndgenBE(i2) .. - sum(kres, vm_dem_bioen(i2,kres) * fm_attributes("ge",kres) - - sum(ct,f60_1stgen_bioenergy_dem(ct,i2,"%c60_1stgen_biodem%",kres))) =g= - sum(ct,i60_res_2ndgenBE_dem(ct,i2)); - -*' There is additionally some demand of residues for second generation bioenergy -*' $i60\_res\_2ndgenBE\_dem$, which is exogenously provided by the estimation that -*' roughly 33% of available residues for recycling on cropland can be used for 2nd -*' generation bioenergy depending on the SSP scenario, since residue stock and use -*' is mainly driven by population and GDP. - \ No newline at end of file diff --git a/modules/60_bioenergy/standard_flexreg_may17/input.gms b/modules/60_bioenergy/standard_flexreg_may17/input.gms deleted file mode 100644 index 3eaa4a60d3..0000000000 --- a/modules/60_bioenergy/standard_flexreg_may17/input.gms +++ /dev/null @@ -1,59 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -scalars - c60_biodem_level bioenergy demand level indicator 1 for regional and 0 for global demand (1) / 1 / -; - -$setglobal c60_2ndgen_biodem SSP2-Ref-SPA0 -* options: SSP1-Ref-SPA0, SSP2-Ref-SPA0, SSP5-Ref-SPA0, -* SSP1-26-SPA0, SSP1-37-SPA0, SSP1-45-SPA0, -* SSP2-26-SPA0, SSP2-37-SPA0, SSP2-45-SPA0, SSP2-60-SPA0, -* SSP5-26-SPA0, SSP5-37-SPA0, SSP5-45-SPA0, SSP5-60-SPA0, -* SSP1-26-SPA1, SSP1-37-SPA1, SSP1-45-SPA1, -* SSP2-26-SPA2, SSP2-37-SPA2, SSP2-45-SPA2, SSP2-60-SPA2, -* SSP5-26-SPA5, SSP5-37-SPA5, SSP5-45-SPA5, SSP5-60-SPA5, -* coupling - -$if "%c60_2ndgen_biodem%" == "coupling" table f60_bioenergy_dem_coupling(t_all,i) Bioenergy demand (regional) (mio. GJ per yr) -$if "%c60_2ndgen_biodem%" == "coupling" $ondelim -$if "%c60_2ndgen_biodem%" == "coupling" $include "./modules/60_bioenergy/input/reg.2ndgen_bioenergy_demand.csv" -$if "%c60_2ndgen_biodem%" == "coupling" $offdelim -$if "%c60_2ndgen_biodem%" == "coupling" ; - -$if "%c60_2ndgen_biodem%" == "emulator" parameter f60_bioenergy_dem_emulator(t_all) Bioenergy demand (global) (mio. GJ per yr) -$if "%c60_2ndgen_biodem%" == "emulator" / -$if "%c60_2ndgen_biodem%" == "emulator" $ondelim -$if "%c60_2ndgen_biodem%" == "emulator" $include "./modules/60_bioenergy/input/glo.2ndgen_bioenergy_demand.csv" -$if "%c60_2ndgen_biodem%" == "emulator" $offdelim -$if "%c60_2ndgen_biodem%" == "emulator" / -$if "%c60_2ndgen_biodem%" == "emulator" ; - -table f60_bioenergy_dem(t_all,i,scen2nd60) annual bioenergy demand (regional) (mio. GJ per yr) -$ondelim -$include "./modules/60_bioenergy/input/f60_bioenergy_dem.cs3" -$offdelim -; - -$setglobal c60_res_2ndgenBE_dem ssp2 -* options: ssp1,ssp2,ssp3,ssp4,ssp5,off - -table f60_res_2ndgenBE_dem(t_all,i,scen2ndres60) annual residue demand for 2nd generation bioenergy(regional) (mio. GJ per yr) -$ondelim -$include "./modules/60_bioenergy/input/f60_2ndgenBE_residue_dem.cs3" -$offdelim -; - - -$setglobal c60_1stgen_biodem const2020 -* options: "const2020", "const2030", "phaseout2020" - -table f60_1stgen_bioenergy_dem(t_all,i,scen1st60,kall) annual 1st generation bioenergy demand (mio. GJ per yr) -$ondelim -$include "./modules/60_bioenergy/input/f60_1stgen_bioenergy_dem.cs3" -$offdelim -; diff --git a/modules/60_bioenergy/standard_flexreg_may17/not_used.txt b/modules/60_bioenergy/standard_flexreg_may17/not_used.txt deleted file mode 100644 index 6ece3f27a1..0000000000 --- a/modules/60_bioenergy/standard_flexreg_may17/not_used.txt +++ /dev/null @@ -1,7 +0,0 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# | Contact: magpie@pik-potsdam.de - -name,type,reason diff --git a/modules/60_bioenergy/standard_flexreg_may17/postsolve.gms b/modules/60_bioenergy/standard_flexreg_may17/postsolve.gms deleted file mode 100644 index 88c510357f..0000000000 --- a/modules/60_bioenergy/standard_flexreg_may17/postsolve.gms +++ /dev/null @@ -1,31 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_dem_bioen(t,i,kall,"marginal") = vm_dem_bioen.m(i,kall); - ov_bioenergy_utility(t,i,"marginal") = vm_bioenergy_utility.m(i); - oq60_bioenergy_glo(t,"marginal") = q60_bioenergy_glo.m; - oq60_bioenergy_reg(t,i,"marginal") = q60_bioenergy_reg.m(i); - oq60_res_2ndgenBE(t,i,"marginal") = q60_res_2ndgenBE.m(i); - ov_dem_bioen(t,i,kall,"level") = vm_dem_bioen.l(i,kall); - ov_bioenergy_utility(t,i,"level") = vm_bioenergy_utility.l(i); - oq60_bioenergy_glo(t,"level") = q60_bioenergy_glo.l; - oq60_bioenergy_reg(t,i,"level") = q60_bioenergy_reg.l(i); - oq60_res_2ndgenBE(t,i,"level") = q60_res_2ndgenBE.l(i); - ov_dem_bioen(t,i,kall,"upper") = vm_dem_bioen.up(i,kall); - ov_bioenergy_utility(t,i,"upper") = vm_bioenergy_utility.up(i); - oq60_bioenergy_glo(t,"upper") = q60_bioenergy_glo.up; - oq60_bioenergy_reg(t,i,"upper") = q60_bioenergy_reg.up(i); - oq60_res_2ndgenBE(t,i,"upper") = q60_res_2ndgenBE.up(i); - ov_dem_bioen(t,i,kall,"lower") = vm_dem_bioen.lo(i,kall); - ov_bioenergy_utility(t,i,"lower") = vm_bioenergy_utility.lo(i); - oq60_bioenergy_glo(t,"lower") = q60_bioenergy_glo.lo; - oq60_bioenergy_reg(t,i,"lower") = q60_bioenergy_reg.lo(i); - oq60_res_2ndgenBE(t,i,"lower") = q60_res_2ndgenBE.lo(i); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - diff --git a/modules/60_bioenergy/standard_flexreg_may17/preloop.gms b/modules/60_bioenergy/standard_flexreg_may17/preloop.gms deleted file mode 100644 index baaa1f958a..0000000000 --- a/modules/60_bioenergy/standard_flexreg_may17/preloop.gms +++ /dev/null @@ -1,16 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -$ifthen "%c60_2ndgen_biodem%" == "coupling" i60_bioenergy_dem(t,i) = f60_bioenergy_dem_coupling(t,i); -$elseif "%c60_2ndgen_biodem%" == "emulator" i60_bioenergy_dem(t,i) = f60_bioenergy_dem_emulator(t)/card(i); -$else i60_bioenergy_dem(t,i) = f60_bioenergy_dem(t,i,"%c60_2ndgen_biodem%"); -$endif -* Add minimal bioenergy demand in case of zero demand to avoid zero prices -i60_bioenergy_dem(t,i)$(i60_bioenergy_dem(t,i) = 0) = 0.01; - - -i60_res_2ndgenBE_dem(t,i) = - f60_res_2ndgenBE_dem(t,i,"%c60_res_2ndgenBE_dem%"); \ No newline at end of file diff --git a/modules/60_bioenergy/standard_flexreg_may17/presolve.gms b/modules/60_bioenergy/standard_flexreg_may17/presolve.gms deleted file mode 100644 index 100183d5f4..0000000000 --- a/modules/60_bioenergy/standard_flexreg_may17/presolve.gms +++ /dev/null @@ -1,43 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -*fix bioenergy demand to given values -vm_dem_bioen.fx(i,kall) = 0; - -*' @code For first generation bioenergy, input is provided on regional level -*' fixing the bioenergy demand variable $vm\_dem\_bioen$ to the input values -*' $f60\_dem\_1stgen\_bioen$ (in `presolve.gms`). - -vm_dem_bioen.fx(i,kall) = f60_1stgen_bioenergy_dem(t,i,"%c60_1stgen_biodem%",kall) - /fm_attributes("ge",kall); - -*' The used first generation bioenergy trajectory contains demand until 2050 -*' based on currently established and planned bioenergy policies -*' (@lotze-campen_impacts_2014). For the time -*' after 2050 it is assumed that bioenergy production will be fully transformed -*' to 2nd generation bioenergy crops and residues because of their higher -*' estimated efficiency respectively their low costs. -*' -*' For second generation bioenergy (`kbe60` = bioenergy grasses and bioenergy -*' trees), input is given either on regional or global level (defined via switch -*' $c60\_biodem\_level$). As the bioenergy demand for all crop types was fixed in the -*' first step it now has to be released again for second generation bioenergy -*' crops (`kbe60`). - -*relax boundaries for all crops which belong to kbe60 as their demand is -*calculated separately (see equations) -vm_dem_bioen.up(i,kbe60) = Inf; -vm_dem_bioen.lo(i,kbe60) = 0; - -*' Relax the upper bound for residues. - -vm_dem_bioen.up(i,kres) = Inf; - -*' In this realization, there is no financial incentive to produce bioenergy. -vm_bioenergy_utility.fx(i2) = 0; - -*' @stop diff --git a/modules/60_bioenergy/standard_flexreg_may17/sets.gms b/modules/60_bioenergy/standard_flexreg_may17/sets.gms deleted file mode 100644 index 563c3942c4..0000000000 --- a/modules/60_bioenergy/standard_flexreg_may17/sets.gms +++ /dev/null @@ -1,28 +0,0 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -sets - kbe60(kcr) bio energy activities - / betr, begr / - - scen1st60 first generation bioenergy scenarios - / const2020, const2030, phaseout2020 / - - scen2nd60 second generation bioenergy scenarios - / SSP1-Ref-SPA0, SSP2-Ref-SPA0, SSP5-Ref-SPA0, - SSP1-20-SPA0, SSP1-26-SPA0, SSP1-37-SPA0, SSP1-45-SPA0, - SSP2-20-SPA0, SSP2-26-SPA0, SSP2-37-SPA0, SSP2-45-SPA0, SSP2-60-SPA0, SSP2-OS-SPA2, - SSP5-20-SPA0, SSP5-26-SPA0, SSP5-37-SPA0, SSP5-45-SPA0, SSP5-60-SPA0, - SSP1-20-SPA1, SSP1-26-SPA1, SSP1-37-SPA1, SSP1-45-SPA1, - SSP2-20-SPA2, SSP2-26-SPA2, SSP2-37-SPA2, SSP2-45-SPA2, SSP2-60-SPA2, - SSP5-20-SPA5, SSP5-26-SPA5, SSP5-37-SPA5, SSP5-45-SPA5, SSP5-60-SPA5, SSP5-OS-SPA5 / - - scen2ndres60 residues for second generation bioenergy scenarios - / ssp1, ssp2, ssp3, ssp4, ssp5, off / - -; - - \ No newline at end of file diff --git a/modules/62_material/exo_flexreg_apr16/declarations.gms b/modules/62_material/exo_flexreg_apr16/declarations.gms index 7ebef7b9af..9223622cf2 100644 --- a/modules/62_material/exo_flexreg_apr16/declarations.gms +++ b/modules/62_material/exo_flexreg_apr16/declarations.gms @@ -1,30 +1,31 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -scalar - s62_historical Switch for turning off historical material demand (1) / 1 / -; - -parameters - p62_dem_material_lh(i,kall) Material demand in last historical timestep (mio. tDM per yr) - p62_dem_food_lh(i) Food demand in last historical timestep (mio. tDM per yr) -; - -positive variables - vm_dem_material(i,kall) Demand for material usage (mio. tDM per yr) -; - -equations - q62_dem_material(i,kall) Estimating material demand (mio. tDM per yr) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_dem_material(t,i,kall,type) Demand for material usage (mio. tDM per yr) - oq62_dem_material(t,i,kall,type) Estimating material demand (mio. tDM per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 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 + + +scalar + s62_historical Switch for turning off historical material demand (1) / 1 / +; + +parameters + p62_dem_material_lh(i,kall) Material demand in last historical timestep (mio. tDM per yr) + p62_dem_food_lh(i) Food demand in last historical timestep (mio. tDM per yr) +; + +positive variables + vm_dem_material(i,kall) Demand for material usage (mio. tDM per yr) +; + +equations + q62_dem_material(i,kall) Estimating material demand (mio. tDM per yr) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_dem_material(t,i,kall,type) Demand for material usage (mio. tDM per yr) + oq62_dem_material(t,i,kall,type) Estimating material demand (mio. tDM per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/62_material/exo_flexreg_apr16/equations.gms b/modules/62_material/exo_flexreg_apr16/equations.gms index 4521b02def..f8c1358162 100644 --- a/modules/62_material/exo_flexreg_apr16/equations.gms +++ b/modules/62_material/exo_flexreg_apr16/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations diff --git a/modules/62_material/exo_flexreg_apr16/input.gms b/modules/62_material/exo_flexreg_apr16/input.gms index 8a9dcd244d..581e7f2751 100644 --- a/modules/62_material/exo_flexreg_apr16/input.gms +++ b/modules/62_material/exo_flexreg_apr16/input.gms @@ -1,11 +1,12 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -table f62_dem_material(t_all,i,kall) Historical material demand (mio. tDM) -$ondelim -$include "./modules/62_material/input/f62_dem_material.cs3" -$offdelim; +*** | (C) 2008-2019 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 + + +table f62_dem_material(t_all,i,kall) Historical material demand (mio. tDM) +$ondelim +$include "./modules/62_material/input/f62_dem_material.cs3" +$offdelim; diff --git a/modules/62_material/exo_flexreg_apr16/postsolve.gms b/modules/62_material/exo_flexreg_apr16/postsolve.gms index 28b668fee7..207d51ea5a 100644 --- a/modules/62_material/exo_flexreg_apr16/postsolve.gms +++ b/modules/62_material/exo_flexreg_apr16/postsolve.gms @@ -1,22 +1,28 @@ -*' @code -*' The parameters `p62_dem_material_lh` and `p62_dem_food_lh` are overwritten -*' based on each time step optimization, in order to be used in next step. -*' This is only carried out when the model is still running in the time period -*' before (and including) y2010 with this model version. - -if (sum(sameas(t_past,t),1) = 1, - p62_dem_material_lh(i,kall) = f62_dem_material(t,i,kall); - p62_dem_food_lh(i)= sum(kfo, vm_dem_food.l(i,kfo)); -); -*' @stop - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_dem_material(t,i,kall,"marginal") = vm_dem_material.m(i,kall); - oq62_dem_material(t,i,kall,"marginal") = q62_dem_material.m(i,kall); - ov_dem_material(t,i,kall,"level") = vm_dem_material.l(i,kall); - oq62_dem_material(t,i,kall,"level") = q62_dem_material.l(i,kall); - ov_dem_material(t,i,kall,"upper") = vm_dem_material.up(i,kall); - oq62_dem_material(t,i,kall,"upper") = q62_dem_material.up(i,kall); - ov_dem_material(t,i,kall,"lower") = vm_dem_material.lo(i,kall); - oq62_dem_material(t,i,kall,"lower") = q62_dem_material.lo(i,kall); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 +*' @code +*' The parameters `p62_dem_material_lh` and `p62_dem_food_lh` are overwritten +*' based on each time step optimization, in order to be used in next step. +*' This is only carried out when the model is still running in the time period +*' before (and including) y2010 with this model version. + +if (sum(sameas(t_past,t),1) = 1, + p62_dem_material_lh(i,kall) = f62_dem_material(t,i,kall); + p62_dem_food_lh(i)= sum(kfo, vm_dem_food.l(i,kfo)); +); +*' @stop + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_dem_material(t,i,kall,"marginal") = vm_dem_material.m(i,kall); + oq62_dem_material(t,i,kall,"marginal") = q62_dem_material.m(i,kall); + ov_dem_material(t,i,kall,"level") = vm_dem_material.l(i,kall); + oq62_dem_material(t,i,kall,"level") = q62_dem_material.l(i,kall); + ov_dem_material(t,i,kall,"upper") = vm_dem_material.up(i,kall); + oq62_dem_material(t,i,kall,"upper") = q62_dem_material.up(i,kall); + ov_dem_material(t,i,kall,"lower") = vm_dem_material.lo(i,kall); + oq62_dem_material(t,i,kall,"lower") = q62_dem_material.lo(i,kall); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/62_material/exo_flexreg_apr16/preloop.gms b/modules/62_material/exo_flexreg_apr16/preloop.gms index 7664c23e62..574ba9989f 100644 --- a/modules/62_material/exo_flexreg_apr16/preloop.gms +++ b/modules/62_material/exo_flexreg_apr16/preloop.gms @@ -1,3 +1,9 @@ +*** | (C) 2008-2019 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 p62_dem_material_lh(i,kall) =0; - p62_dem_food_lh(i)=1; \ No newline at end of file + p62_dem_food_lh(i)=1; diff --git a/modules/62_material/exo_flexreg_apr16/presolve.gms b/modules/62_material/exo_flexreg_apr16/presolve.gms index e2e702cb42..e9bd1c982c 100644 --- a/modules/62_material/exo_flexreg_apr16/presolve.gms +++ b/modules/62_material/exo_flexreg_apr16/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 *' @code diff --git a/modules/62_material/exo_flexreg_apr16.gms b/modules/62_material/exo_flexreg_apr16/realization.gms similarity index 78% rename from modules/62_material/exo_flexreg_apr16.gms rename to modules/62_material/exo_flexreg_apr16/realization.gms index 294a42dc5f..c48e6f03fa 100644 --- a/modules/62_material/exo_flexreg_apr16.gms +++ b/modules/62_material/exo_flexreg_apr16/realization.gms @@ -1,24 +1,25 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description -*' In the exo_flexreg_apr16 realisation, demand for material usage -*' is estimated to grow proportional to food demand calculated by `vm_dem_food` interface -*' in food module([15_food]). Observed material demand is fed as an input to the -*' material module based on historical data. The assumption that material demand -*' grows proportional to food demand is a simplification that can be justified -*' by the minor importance of non-bioenergy material usage of agricultural products. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/62_material/exo_flexreg_apr16/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/62_material/exo_flexreg_apr16/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/62_material/exo_flexreg_apr16/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/62_material/exo_flexreg_apr16/equations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/62_material/exo_flexreg_apr16/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/62_material/exo_flexreg_apr16/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/62_material/exo_flexreg_apr16/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### - +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description +*' In the exo_flexreg_apr16 realisation, demand for material usage +*' is estimated to grow proportional to food demand calculated by `vm_dem_food` interface +*' in food module([15_food]). Observed material demand is fed as an input to the +*' material module based on historical data. The assumption that material demand +*' grows proportional to food demand is a simplification that can be justified +*' by the minor importance of non-bioenergy material usage of agricultural products. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/62_material/exo_flexreg_apr16/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/62_material/exo_flexreg_apr16/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/62_material/exo_flexreg_apr16/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/62_material/exo_flexreg_apr16/equations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/62_material/exo_flexreg_apr16/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/62_material/exo_flexreg_apr16/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/62_material/exo_flexreg_apr16/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### + diff --git a/modules/62_material/exo_flexreg_apr16/sets.gms b/modules/62_material/exo_flexreg_apr16/sets.gms index 049c866cc0..3a0f70f6a5 100644 --- a/modules/62_material/exo_flexreg_apr16/sets.gms +++ b/modules/62_material/exo_flexreg_apr16/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/62_material/62_material.gms b/modules/62_material/module.gms similarity index 67% rename from modules/62_material/62_material.gms rename to modules/62_material/module.gms index bbe9bb4958..553c43aa9a 100644 --- a/modules/62_material/62_material.gms +++ b/modules/62_material/module.gms @@ -1,22 +1,23 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Material -*' -*' @description -*' The material module describes the demand for material usage -*' based on historical data. Material uage is derived from FAO's "other utils" -*' category, and includes for example the use of agricultural products -*' for cosmetics, chemical usage or textiles. In contrast to FAO's other util -*' category, the use for bioenergy (oils and ethanol) has been excluded -*' and is accounted for in the demand for bioenergy. Material demand in this -*' context can be considered as a subset of "other utils" category of FAO. - -*' @authors Benjamin Bodirsky - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%material%" == "exo_flexreg_apr16" $include "./modules/62_material/exo_flexreg_apr16.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Material +*' +*' @description +*' The material module describes the demand for material usage +*' based on historical data. Material uage is derived from FAO's "other utils" +*' category, and includes for example the use of agricultural products +*' for cosmetics, chemical usage or textiles. In contrast to FAO's other util +*' category, the use for bioenergy (oils and ethanol) has been excluded +*' and is accounted for in the demand for bioenergy. Material demand in this +*' context can be considered as a subset of "other utils" category of FAO. + +*' @authors Benjamin Bodirsky + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%material%" == "exo_flexreg_apr16" $include "./modules/62_material/exo_flexreg_apr16/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/70_livestock/fbask_jan16/declarations.gms b/modules/70_livestock/fbask_jan16/declarations.gms index ca5d454f91..75e55626be 100644 --- a/modules/70_livestock/fbask_jan16/declarations.gms +++ b/modules/70_livestock/fbask_jan16/declarations.gms @@ -1,35 +1,36 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -positive variables - vm_dem_feed(i,kap,kall) Regional feed demand including byproducts (mio. tDM per yr) -; - -equations - q70_feed(i,kap,kall) Regional feed demand - q70_cost_prod_liv(i,kall) Regional factor input costs for livestock production - q70_cost_prod_fish(i) Regional factor input costs for fish production -; - -parameters - im_slaughter_feed_share(t_all,i,kap,attributes) Share of feed that is incorporated in animal biomass (1) - i70_livestock_productivity(t_all,i,sys) Productivity indicator for livestock production (t FM per animal per yr) - im_feed_baskets(t_all,i,kap,kall) Feed baskets in tDM per tDM livestock product (1) - p70_cattle_stock_proxy(t,i) Proxy for cattle stocks needed to fullfil domestic food demand (mio. animals per yr) - p70_incr_cattle(t,i) Change in estimated cattle stocks attributed to food demand projections (1) - pm_past_mngmnt_factor(t,i) Regional pasture management intensification factor (1) -; - - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_dem_feed(t,i,kap,kall,type) Regional feed demand including byproducts (mio. tDM per yr) - oq70_feed(t,i,kap,kall,type) Regional feed demand - oq70_cost_prod_liv(t,i,kall,type) Regional factor input costs for livestock production - oq70_cost_prod_fish(t,i,type) Regional factor input costs for fish production -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + +positive variables + vm_dem_feed(i,kap,kall) Regional feed demand including byproducts (mio. tDM per yr) +; + +equations + q70_feed(i,kap,kall) Regional feed demand + q70_cost_prod_liv(i,kall) Regional factor input costs for livestock production + q70_cost_prod_fish(i) Regional factor input costs for fish production +; + +parameters + im_slaughter_feed_share(t_all,i,kap,attributes) Share of feed that is incorporated in animal biomass (1) + i70_livestock_productivity(t_all,i,sys) Productivity indicator for livestock production (t FM per animal per yr) + im_feed_baskets(t_all,i,kap,kall) Feed baskets in tDM per tDM livestock product (1) + p70_cattle_stock_proxy(t,i) Proxy for cattle stocks needed to fullfil domestic food demand (mio. animals per yr) + p70_incr_cattle(t,i) Change in estimated cattle stocks attributed to food demand projections (1) + pm_past_mngmnt_factor(t,i) Regional pasture management intensification factor (1) +; + + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_dem_feed(t,i,kap,kall,type) Regional feed demand including byproducts (mio. tDM per yr) + oq70_feed(t,i,kap,kall,type) Regional feed demand + oq70_cost_prod_liv(t,i,kall,type) Regional factor input costs for livestock production + oq70_cost_prod_fish(t,i,type) Regional factor input costs for fish production +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/70_livestock/fbask_jan16/equations.gms b/modules/70_livestock/fbask_jan16/equations.gms index 29afc15a2f..75c7d75ab0 100644 --- a/modules/70_livestock/fbask_jan16/equations.gms +++ b/modules/70_livestock/fbask_jan16/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations diff --git a/modules/70_livestock/fbask_jan16/input.gms b/modules/70_livestock/fbask_jan16/input.gms index d74ecb2070..23462f0c7a 100644 --- a/modules/70_livestock/fbask_jan16/input.gms +++ b/modules/70_livestock/fbask_jan16/input.gms @@ -1,49 +1,50 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -$setglobal c70_feed_scen ssp2 -* options: ssp1,ssp2,ssp3,ssp4,ssp5,constant - -scalars - s70_pyld_intercept Intercept of linear relationship determining pasture intensification (1) / 0.24 / -; - -table f70_feed_baskets(t_all,i,kap,kall,feed_scen70) Feed baskets in tDM per tDM livestock product (1) -$ondelim -$include "./modules/70_livestock/fbask_jan16/input/f70_feed_baskets.cs3" -$offdelim; - -table fm_feed_balanceflow(t_all,i,kap,kall) Balanceflow balance difference between estimated feed baskets and FAO (mio. tDM) -$ondelim -$include "./modules/70_livestock/fbask_jan16/input/f70_feed_balanceflow.cs3" -$offdelim; - -table f70_livestock_productivity(t_all,i,sys,feed_scen70) Productivity indicator for livestock production (t FM per animal) -$ondelim -$include "./modules/70_livestock/fbask_jan16/input/f70_livestock_productivity.cs3" -$offdelim; - -table f70_cost_regr(kap,cost_regr) Factor requirements livestock (USD04 per tDM (A) and USD (B)) -$ondelim -$include "./modules/70_livestock/fbask_jan16/input/f70_capit_liv_regr.csv" -$offdelim -; - -parameter f70_slaughter_feed_share(t_all,i,kap,attributes,feed_scen70) Share of feed that is incorprated in animal biomass (1) -/ -$ondelim -$include "./modules/70_livestock/fbask_jan16/input/f70_slaughter_feed_share.cs4" -$offdelim -/ -; - -parameter f70_pyld_slope_reg(i) Regional slope of linear relationship determining pasture intensification (1) -/ -$ondelim -$include "./modules/70_livestock/fbask_jan16/input/f70_pyld_slope_reg.cs4" -$offdelim -/; +*** | (C) 2008-2019 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 + + +$setglobal c70_feed_scen ssp2 +* options: ssp1,ssp2,ssp3,ssp4,ssp5,constant + +scalars + s70_pyld_intercept Intercept of linear relationship determining pasture intensification (1) / 0.24 / +; + +table f70_feed_baskets(t_all,i,kap,kall,feed_scen70) Feed baskets in tDM per tDM livestock product (1) +$ondelim +$include "./modules/70_livestock/fbask_jan16/input/f70_feed_baskets.cs3" +$offdelim; + +table fm_feed_balanceflow(t_all,i,kap,kall) Balanceflow balance difference between estimated feed baskets and FAO (mio. tDM) +$ondelim +$include "./modules/70_livestock/fbask_jan16/input/f70_feed_balanceflow.cs3" +$offdelim; + +table f70_livestock_productivity(t_all,i,sys,feed_scen70) Productivity indicator for livestock production (t FM per animal) +$ondelim +$include "./modules/70_livestock/fbask_jan16/input/f70_livestock_productivity.cs3" +$offdelim; + +table f70_cost_regr(kap,cost_regr) Factor requirements livestock (USD04 per tDM (A) and USD (B)) +$ondelim +$include "./modules/70_livestock/fbask_jan16/input/f70_capit_liv_regr.csv" +$offdelim +; + +parameter f70_slaughter_feed_share(t_all,i,kap,attributes,feed_scen70) Share of feed that is incorprated in animal biomass (1) +/ +$ondelim +$include "./modules/70_livestock/fbask_jan16/input/f70_slaughter_feed_share.cs4" +$offdelim +/ +; + +parameter f70_pyld_slope_reg(i) Regional slope of linear relationship determining pasture intensification (1) +/ +$ondelim +$include "./modules/70_livestock/fbask_jan16/input/f70_pyld_slope_reg.cs4" +$offdelim +/; diff --git a/modules/70_livestock/fbask_jan16/not_used.txt b/modules/70_livestock/fbask_jan16/not_used.txt index 6ece3f27a1..4b81dfbae2 100644 --- a/modules/70_livestock/fbask_jan16/not_used.txt +++ b/modules/70_livestock/fbask_jan16/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason diff --git a/modules/70_livestock/fbask_jan16/postsolve.gms b/modules/70_livestock/fbask_jan16/postsolve.gms index a7885bba99..fd6dd07f07 100644 --- a/modules/70_livestock/fbask_jan16/postsolve.gms +++ b/modules/70_livestock/fbask_jan16/postsolve.gms @@ -1,26 +1,27 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_dem_feed(t,i,kap,kall,"marginal") = vm_dem_feed.m(i,kap,kall); - oq70_feed(t,i,kap,kall,"marginal") = q70_feed.m(i,kap,kall); - oq70_cost_prod_liv(t,i,kall,"marginal") = q70_cost_prod_liv.m(i,kall); - oq70_cost_prod_fish(t,i,"marginal") = q70_cost_prod_fish.m(i); - ov_dem_feed(t,i,kap,kall,"level") = vm_dem_feed.l(i,kap,kall); - oq70_feed(t,i,kap,kall,"level") = q70_feed.l(i,kap,kall); - oq70_cost_prod_liv(t,i,kall,"level") = q70_cost_prod_liv.l(i,kall); - oq70_cost_prod_fish(t,i,"level") = q70_cost_prod_fish.l(i); - ov_dem_feed(t,i,kap,kall,"upper") = vm_dem_feed.up(i,kap,kall); - oq70_feed(t,i,kap,kall,"upper") = q70_feed.up(i,kap,kall); - oq70_cost_prod_liv(t,i,kall,"upper") = q70_cost_prod_liv.up(i,kall); - oq70_cost_prod_fish(t,i,"upper") = q70_cost_prod_fish.up(i); - ov_dem_feed(t,i,kap,kall,"lower") = vm_dem_feed.lo(i,kap,kall); - oq70_feed(t,i,kap,kall,"lower") = q70_feed.lo(i,kap,kall); - oq70_cost_prod_liv(t,i,kall,"lower") = q70_cost_prod_liv.lo(i,kall); - oq70_cost_prod_fish(t,i,"lower") = q70_cost_prod_fish.lo(i); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 + + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_dem_feed(t,i,kap,kall,"marginal") = vm_dem_feed.m(i,kap,kall); + oq70_feed(t,i,kap,kall,"marginal") = q70_feed.m(i,kap,kall); + oq70_cost_prod_liv(t,i,kall,"marginal") = q70_cost_prod_liv.m(i,kall); + oq70_cost_prod_fish(t,i,"marginal") = q70_cost_prod_fish.m(i); + ov_dem_feed(t,i,kap,kall,"level") = vm_dem_feed.l(i,kap,kall); + oq70_feed(t,i,kap,kall,"level") = q70_feed.l(i,kap,kall); + oq70_cost_prod_liv(t,i,kall,"level") = q70_cost_prod_liv.l(i,kall); + oq70_cost_prod_fish(t,i,"level") = q70_cost_prod_fish.l(i); + ov_dem_feed(t,i,kap,kall,"upper") = vm_dem_feed.up(i,kap,kall); + oq70_feed(t,i,kap,kall,"upper") = q70_feed.up(i,kap,kall); + oq70_cost_prod_liv(t,i,kall,"upper") = q70_cost_prod_liv.up(i,kall); + oq70_cost_prod_fish(t,i,"upper") = q70_cost_prod_fish.up(i); + ov_dem_feed(t,i,kap,kall,"lower") = vm_dem_feed.lo(i,kap,kall); + oq70_feed(t,i,kap,kall,"lower") = q70_feed.lo(i,kap,kall); + oq70_cost_prod_liv(t,i,kall,"lower") = q70_cost_prod_liv.lo(i,kall); + oq70_cost_prod_fish(t,i,"lower") = q70_cost_prod_fish.lo(i); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/70_livestock/fbask_jan16/preloop.gms b/modules/70_livestock/fbask_jan16/preloop.gms index a92d3056b5..f53c7ec5cc 100644 --- a/modules/70_livestock/fbask_jan16/preloop.gms +++ b/modules/70_livestock/fbask_jan16/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 im_slaughter_feed_share(t_all,i,kap,attributes) = @@ -11,4 +12,4 @@ i70_livestock_productivity(t_all,i,sys) = f70_livestock_productivity(t_all,i,sys,"%c70_feed_scen%"); im_feed_baskets(t_all,i,kap,kall) = - f70_feed_baskets(t_all,i,kap,kall,"%c70_feed_scen%"); \ No newline at end of file + f70_feed_baskets(t_all,i,kap,kall,"%c70_feed_scen%"); diff --git a/modules/70_livestock/fbask_jan16/presolve.gms b/modules/70_livestock/fbask_jan16/presolve.gms index 3d0bf9aac2..f32c77f105 100644 --- a/modules/70_livestock/fbask_jan16/presolve.gms +++ b/modules/70_livestock/fbask_jan16/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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/70_livestock/fbask_jan16.gms b/modules/70_livestock/fbask_jan16/realization.gms similarity index 93% rename from modules/70_livestock/fbask_jan16.gms rename to modules/70_livestock/fbask_jan16/realization.gms index 62a450e0bf..698dcf4d20 100644 --- a/modules/70_livestock/fbask_jan16.gms +++ b/modules/70_livestock/fbask_jan16/realization.gms @@ -1,89 +1,90 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description The fbask_jan16 realization of the livestock module is based on -*' the methodology as described in @weindl_livestock_2017 and -*' @weindl_livestock_2017-1. An important part of the feed demand calculations -*' is conducted outside of the core MAgPIE-GAMS code. Livestock products -*' (ruminant meat, whole-milk, pork, poultry meat and eggs) are supplied by five -*' animal food systems (beef cattle, dairy cattle, pigs, broilers and laying -*' hens). The parameterization of the livestock sector in the initial year is -*' consistent with FAO statistics regarding livestock production, livestock -*' productivity and concentrate feed use. - -*' The fbask_jan16 realization requires regional and product-specific feed -*' baskets that are calculated by a set of preprocessing routines outside of the -*' MAgPIE-GAMS code. Following the methodology of @wirsenius_human_2000, feed -*' conversion (total feed input per product output in dry matter) and feed -*' baskets (demand for different feed types per product output in dry matter) -*' are derived by compiling system-specific feed energy balances. For the -*' establishment of these balances, we apply feed energy requirements per output, -*' as estimated by wirsenius_human_2000 for each animal function and animal food -*' system. These estimates are based on standardized bio-energetic equations and -*' include the minimum energy requirements for maintenance, growth, lactation, -*' reproduction and other basic biological functions of the animals. Moreover, -*' they comprise a general allowance for basic activity and temperature effects. - -*' By distributing the available feed at country level to animal food systems -*' according to their feed energy demand and dividing resulting dry matter feed -*' use by the production volume of the respective systems, we obtain both -*' estimates for feed conversion and feed baskets across different animal food -*' systems and countries. - -*' To facilitate projections of feed conversion and feed baskets, we create -*' regression models with livestock productivity (annual production per animal -*' [ton fresh matter/animal/year]) as predictor, which permit the construction -*' of livestock feeding scenarios. Currently, feeding scenarios are derived -*' based on exogenous livestock productivity scenarios consistent with the -*' storylines of the Shared Socioeconomic Pathways (SSPs). For beef cattle, pigs -*' and broilers, livestock productivity is defined as meat production per -*' animals in stock (e.g. total cattle herd) and for dairy cattle and laying hen -*' as milk or egg production per producing animals (e.g. milk cows). - -*' A power function is used to describe the functional relation between feed -*' conversion and livestock productivity: - -*' ![Relationship between feed conversion and livestock productivity -*' [@weindl_livestock_2017].](feed_conv.jpg){ width=100% } - -*' In the case of feed composition, we use an additional proxy parameter in our -*' analysis. What type of biomass is used to feed animals is to a certain extent -*' influenced by universal aspects (e.g. the need for more energy-rich feed at -*' higher productivity levels), whereas other aspects are strongly influenced by -*' geographical location (e.g. availability and costs of permanent pasture -*' compared to cropland feed, agro-ecological and climatic conditions that -*' favour selected feed items; socio-cultural determinants etc.). For cattle -*' systems the proxy (climate-zone specific factor) was determined by -*' calculating the share of the national population living in arid and cold -*' climate zones. - -*' ![Relationship between the share of crop residues, occasional feed and grazed -*' biomass in feed baskets and livestock productivity for beef cattle systems -*' [@weindl_livestock_2017].](feed_comp_beef.jpg){ width=60% } - -*' ![Relationship between the share of crop residues, occasional feed and grazed -*' biomass in feed baskets and livestock productivity for diary cattle systems -*' [@weindl_livestock_2017].](feed_comp_dairy.jpg){ width=60% } - -*' These relationships between feed baskets and livestock productivity are used -*' to construct feeding scenarios that reflect the narratives of the SSPs. The -*' resulting feed baskets enter the MAgPIE model as scenario-dependent input data -*' and are crucial for the feed demand calculations in the livestock module. - -*' @limitations Intensification of livestock production and related changes in -*' livestock feeding are modelled exogenously. Therefore, the livestock sector -*' does not endogenously respond to demand and climate shocks and policies, e.g. -*' targeting climate protection. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/70_livestock/fbask_jan16/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/70_livestock/fbask_jan16/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/70_livestock/fbask_jan16/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/70_livestock/fbask_jan16/equations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/70_livestock/fbask_jan16/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/70_livestock/fbask_jan16/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/70_livestock/fbask_jan16/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description The fbask_jan16 realization of the livestock module is based on +*' the methodology as described in @weindl_livestock_2017 and +*' @weindl_livestock_2017-1. An important part of the feed demand calculations +*' is conducted outside of the core MAgPIE-GAMS code. Livestock products +*' (ruminant meat, whole-milk, pork, poultry meat and eggs) are supplied by five +*' animal food systems (beef cattle, dairy cattle, pigs, broilers and laying +*' hens). The parameterization of the livestock sector in the initial year is +*' consistent with FAO statistics regarding livestock production, livestock +*' productivity and concentrate feed use. + +*' The fbask_jan16 realization requires regional and product-specific feed +*' baskets that are calculated by a set of preprocessing routines outside of the +*' MAgPIE-GAMS code. Following the methodology of @wirsenius_human_2000, feed +*' conversion (total feed input per product output in dry matter) and feed +*' baskets (demand for different feed types per product output in dry matter) +*' are derived by compiling system-specific feed energy balances. For the +*' establishment of these balances, we apply feed energy requirements per output, +*' as estimated by wirsenius_human_2000 for each animal function and animal food +*' system. These estimates are based on standardized bio-energetic equations and +*' include the minimum energy requirements for maintenance, growth, lactation, +*' reproduction and other basic biological functions of the animals. Moreover, +*' they comprise a general allowance for basic activity and temperature effects. + +*' By distributing the available feed at country level to animal food systems +*' according to their feed energy demand and dividing resulting dry matter feed +*' use by the production volume of the respective systems, we obtain both +*' estimates for feed conversion and feed baskets across different animal food +*' systems and countries. + +*' To facilitate projections of feed conversion and feed baskets, we create +*' regression models with livestock productivity (annual production per animal +*' [ton fresh matter/animal/year]) as predictor, which permit the construction +*' of livestock feeding scenarios. Currently, feeding scenarios are derived +*' based on exogenous livestock productivity scenarios consistent with the +*' storylines of the Shared Socioeconomic Pathways (SSPs). For beef cattle, pigs +*' and broilers, livestock productivity is defined as meat production per +*' animals in stock (e.g. total cattle herd) and for dairy cattle and laying hen +*' as milk or egg production per producing animals (e.g. milk cows). + +*' A power function is used to describe the functional relation between feed +*' conversion and livestock productivity: + +*' ![Relationship between feed conversion and livestock productivity +*' [@weindl_livestock_2017].](feed_conv.jpg){ width=100% } + +*' In the case of feed composition, we use an additional proxy parameter in our +*' analysis. What type of biomass is used to feed animals is to a certain extent +*' influenced by universal aspects (e.g. the need for more energy-rich feed at +*' higher productivity levels), whereas other aspects are strongly influenced by +*' geographical location (e.g. availability and costs of permanent pasture +*' compared to cropland feed, agro-ecological and climatic conditions that +*' favour selected feed items; socio-cultural determinants etc.). For cattle +*' systems the proxy (climate-zone specific factor) was determined by +*' calculating the share of the national population living in arid and cold +*' climate zones. + +*' ![Relationship between the share of crop residues, occasional feed and grazed +*' biomass in feed baskets and livestock productivity for beef cattle systems +*' [@weindl_livestock_2017].](feed_comp_beef.jpg){ width=60% } + +*' ![Relationship between the share of crop residues, occasional feed and grazed +*' biomass in feed baskets and livestock productivity for diary cattle systems +*' [@weindl_livestock_2017].](feed_comp_dairy.jpg){ width=60% } + +*' These relationships between feed baskets and livestock productivity are used +*' to construct feeding scenarios that reflect the narratives of the SSPs. The +*' resulting feed baskets enter the MAgPIE model as scenario-dependent input data +*' and are crucial for the feed demand calculations in the livestock module. + +*' @limitations Intensification of livestock production and related changes in +*' livestock feeding are modelled exogenously. Therefore, the livestock sector +*' does not endogenously respond to demand and climate shocks and policies, e.g. +*' targeting climate protection. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/70_livestock/fbask_jan16/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/70_livestock/fbask_jan16/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/70_livestock/fbask_jan16/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/70_livestock/fbask_jan16/equations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/70_livestock/fbask_jan16/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/70_livestock/fbask_jan16/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/70_livestock/fbask_jan16/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/70_livestock/fbask_jan16/sets.gms b/modules/70_livestock/fbask_jan16/sets.gms index 747498a385..37156bc508 100644 --- a/modules/70_livestock/fbask_jan16/sets.gms +++ b/modules/70_livestock/fbask_jan16/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets diff --git a/modules/70_livestock/70_livestock.gms b/modules/70_livestock/module.gms similarity index 75% rename from modules/70_livestock/70_livestock.gms rename to modules/70_livestock/module.gms index 4cd53ec822..b87501bd5e 100644 --- a/modules/70_livestock/70_livestock.gms +++ b/modules/70_livestock/module.gms @@ -1,26 +1,27 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Livestock -*' -*' @description The livestock module calculates how much and what kind of -*' biomass is required as feed to produce livestock food commodities. -*' -*' For this purpose, the livestock module provides for every time-step regional -*' and product-specific feed baskets that determine type and magnitude of feed -*' needed to produce one unit of livestock commodities. Estimated pasture -*' feed demand is also relevant for the module [31_past] in order to derive -*' required pasture areas. The information flow between the livestock and the -*' pasture module is organized via interfaces `vm_dem_feed`, `vm_supply` and -*' `vm_prod_reg` via modules [16_demand] and [21_trade]. Feed demand estimates -*' are also required for the modules [53_methane] and [55_awms]. Additionally, -*' the livestock module provides production costs for livestock commodities. -*' -*' @authors Isabelle Weindl, Benjamin Bodirsky - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%livestock%" == "fbask_jan16" $include "./modules/70_livestock/fbask_jan16.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Livestock +*' +*' @description The livestock module calculates how much and what kind of +*' biomass is required as feed to produce livestock food commodities. +*' +*' For this purpose, the livestock module provides for every time-step regional +*' and product-specific feed baskets that determine type and magnitude of feed +*' needed to produce one unit of livestock commodities. Estimated pasture +*' feed demand is also relevant for the module [31_past] in order to derive +*' required pasture areas. The information flow between the livestock and the +*' pasture module is organized via interfaces `vm_dem_feed`, `vm_supply` and +*' `vm_prod_reg` via modules [16_demand] and [21_trade]. Feed demand estimates +*' are also required for the modules [53_methane] and [55_awms]. Additionally, +*' the livestock module provides production costs for livestock commodities. +*' +*' @authors Isabelle Weindl, Benjamin Bodirsky + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%livestock%" == "fbask_jan16" $include "./modules/70_livestock/fbask_jan16/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/71_disagg_lvst/foragebased_aug18/declarations.gms b/modules/71_disagg_lvst/foragebased_aug18/declarations.gms index de051bdcef..889ed7b3dd 100644 --- a/modules/71_disagg_lvst/foragebased_aug18/declarations.gms +++ b/modules/71_disagg_lvst/foragebased_aug18/declarations.gms @@ -1,49 +1,50 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -positive variables - v71_prod_rum(j,kli_rum,kforage) Production of forage fed ruminants within a cell (mio. tDM per yr) - v71_additional_mon(j, kli_mon) Additional punished production of monogastric livestock (mio. tDM per yr) - vm_costs_additional_mon(i) Punishment cost for additionally transported monogastric livst_egg (mio. USD05MER per yr) -; - -variables - v71_feed_balanceflow(j,kli_rum,kforage) Cellular feed balanceflow for forage feed for ruminant livestock (mio. tDM per yr) -; - -equations - q71_feed_rum_liv(j,kforage) Production constraint for ruminant livestock products (mio. tDM per yr) - q71_balanceflow_constraint_nlp(j,kli_rum,kforage) Nonlinear balanceflow constraint for cellular forage feed products (mio. tDM per yr) - q71_balanceflow_constraint_lp(i,kli_rum,kforage) Linear balanceflow constraint for cellular forage feed product (mio. tDM per yr) - q71_sum_rum_liv(j,kli_rum) Total production of forage fed ruminants (mio. tDM per yr) - q71_prod_mon_liv(j,kli_mon) Production constraint for monogastric livestock products (mio. tDM per yr) - q71_punishment_mon(i) Punishment for additional monogastrics (mio. USD05MER per yr) -; - -parameters - i71_urban_area_share(j) Share of urban area within a region (1) -; - -scalars - s71_lp_fix Switch to fix equations to linear relation (Logical) - s71_scale_mon Scalar for flexible distribution of monogastrics (1) - s71_punish_additional_mon Scaling factor for transport punishment (USD05MER per tDM) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov71_prod_rum(t,j,kli_rum,kforage,type) Production of forage fed ruminants within a cell (mio. tDM per yr) - ov71_additional_mon(t,j,kli_mon,type) Additional punished production of monogastric livestock (mio. tDM per yr) - ov_costs_additional_mon(t,i,type) Punishment cost for additionally transported monogastric livst_egg (mio. USD05MER per yr) - ov71_feed_balanceflow(t,j,kli_rum,kforage,type) Cellular feed balanceflow for forage feed for ruminant livestock (mio. tDM per yr) - oq71_feed_rum_liv(t,j,kforage,type) Production constraint for ruminant livestock products (mio. tDM per yr) - oq71_balanceflow_constraint_nlp(t,j,kli_rum,kforage,type) Nonlinear balanceflow constraint for cellular forage feed products (mio. tDM per yr) - oq71_balanceflow_constraint_lp(t,i,kli_rum,kforage,type) Linear balanceflow constraint for cellular forage feed product (mio. tDM per yr) - oq71_sum_rum_liv(t,j,kli_rum,type) Total production of forage fed ruminants (mio. tDM per yr) - oq71_prod_mon_liv(t,j,kli_mon,type) Production constraint for monogastric livestock products (mio. tDM per yr) - oq71_punishment_mon(t,i,type) Punishment for additional monogastrics (mio. USD05MER per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +positive variables + v71_prod_rum(j,kli_rum,kforage) Production of forage fed ruminants within a cell (mio. tDM per yr) + v71_additional_mon(j, kli_mon) Additional punished production of monogastric livestock (mio. tDM per yr) + vm_costs_additional_mon(i) Punishment cost for additionally transported monogastric livst_egg (mio. USD05MER per yr) +; + +variables + v71_feed_balanceflow(j,kli_rum,kforage) Cellular feed balanceflow for forage feed for ruminant livestock (mio. tDM per yr) +; + +equations + q71_feed_rum_liv(j,kforage) Production constraint for ruminant livestock products (mio. tDM per yr) + q71_balanceflow_constraint_nlp(j,kli_rum,kforage) Nonlinear balanceflow constraint for cellular forage feed products (mio. tDM per yr) + q71_balanceflow_constraint_lp(i,kli_rum,kforage) Linear balanceflow constraint for cellular forage feed product (mio. tDM per yr) + q71_sum_rum_liv(j,kli_rum) Total production of forage fed ruminants (mio. tDM per yr) + q71_prod_mon_liv(j,kli_mon) Production constraint for monogastric livestock products (mio. tDM per yr) + q71_punishment_mon(i) Punishment for additional monogastrics (mio. USD05MER per yr) +; + +parameters + i71_urban_area_share(j) Share of urban area within a region (1) +; + +scalars + s71_lp_fix Switch to fix equations to linear relation (Logical) + s71_scale_mon Scalar for flexible distribution of monogastrics (1) + s71_punish_additional_mon Scaling factor for transport punishment (USD05MER per tDM) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov71_prod_rum(t,j,kli_rum,kforage,type) Production of forage fed ruminants within a cell (mio. tDM per yr) + ov71_additional_mon(t,j,kli_mon,type) Additional punished production of monogastric livestock (mio. tDM per yr) + ov_costs_additional_mon(t,i,type) Punishment cost for additionally transported monogastric livst_egg (mio. USD05MER per yr) + ov71_feed_balanceflow(t,j,kli_rum,kforage,type) Cellular feed balanceflow for forage feed for ruminant livestock (mio. tDM per yr) + oq71_feed_rum_liv(t,j,kforage,type) Production constraint for ruminant livestock products (mio. tDM per yr) + oq71_balanceflow_constraint_nlp(t,j,kli_rum,kforage,type) Nonlinear balanceflow constraint for cellular forage feed products (mio. tDM per yr) + oq71_balanceflow_constraint_lp(t,i,kli_rum,kforage,type) Linear balanceflow constraint for cellular forage feed product (mio. tDM per yr) + oq71_sum_rum_liv(t,j,kli_rum,type) Total production of forage fed ruminants (mio. tDM per yr) + oq71_prod_mon_liv(t,j,kli_mon,type) Production constraint for monogastric livestock products (mio. tDM per yr) + oq71_punishment_mon(t,i,type) Punishment for additional monogastrics (mio. USD05MER per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/71_disagg_lvst/foragebased_aug18/equations.gms b/modules/71_disagg_lvst/foragebased_aug18/equations.gms index 83bdae00ac..9b79710b8f 100644 --- a/modules/71_disagg_lvst/foragebased_aug18/equations.gms +++ b/modules/71_disagg_lvst/foragebased_aug18/equations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de *' @equations diff --git a/modules/71_disagg_lvst/foragebased_aug18/nl_fix.gms b/modules/71_disagg_lvst/foragebased_aug18/nl_fix.gms index bfdd294721..13da9f3cbd 100644 --- a/modules/71_disagg_lvst/foragebased_aug18/nl_fix.gms +++ b/modules/71_disagg_lvst/foragebased_aug18/nl_fix.gms @@ -1,15 +1,16 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -* ### nl_fix ### - -v71_feed_balanceflow.lo(j,kli_rum,kforage)$(sum(cell(i,j),fm_feed_balanceflow(t,i,kli_rum,kforage)) > 0) = 0; -v71_feed_balanceflow.up(j,kli_rum,kforage)$(sum(cell(i,j),fm_feed_balanceflow(t,i,kli_rum,kforage)) < 0) = 0; -v71_feed_balanceflow.fx(j,kli_rum,kforage)$(sum(cell(i,j),fm_feed_balanceflow(t,i,kli_rum,kforage)) = 0) = 0; -v71_feed_balanceflow.fx(j,kli_rum,"pasture")$(pcm_land(j,"past")=0) = 0; -v71_feed_balanceflow.fx(j,kli_rum,"foddr")$(pcm_land(j,"crop")=0) = 0; - -s71_lp_fix=1; \ No newline at end of file +*** | (C) 2008-2019 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 + +* ### nl_fix ### + +v71_feed_balanceflow.lo(j,kli_rum,kforage)$(sum(cell(i,j),fm_feed_balanceflow(t,i,kli_rum,kforage)) > 0) = 0; +v71_feed_balanceflow.up(j,kli_rum,kforage)$(sum(cell(i,j),fm_feed_balanceflow(t,i,kli_rum,kforage)) < 0) = 0; +v71_feed_balanceflow.fx(j,kli_rum,kforage)$(sum(cell(i,j),fm_feed_balanceflow(t,i,kli_rum,kforage)) = 0) = 0; +v71_feed_balanceflow.fx(j,kli_rum,"pasture")$(pcm_land(j,"past")=0) = 0; +v71_feed_balanceflow.fx(j,kli_rum,"foddr")$(pcm_land(j,"crop")=0) = 0; + +s71_lp_fix=1; diff --git a/modules/71_disagg_lvst/foragebased_aug18/nl_release.gms b/modules/71_disagg_lvst/foragebased_aug18/nl_release.gms index 93aece0ef4..bb40e99eb6 100644 --- a/modules/71_disagg_lvst/foragebased_aug18/nl_release.gms +++ b/modules/71_disagg_lvst/foragebased_aug18/nl_release.gms @@ -1,12 +1,13 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -* ### nl_release ### - -v71_feed_balanceflow.lo(j,kli_rum,kforage)= -Inf; -v71_feed_balanceflow.up(j,kli_rum,kforage)= Inf; - -s71_lp_fix=0; \ No newline at end of file +*** | (C) 2008-2019 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 + +* ### nl_release ### + +v71_feed_balanceflow.lo(j,kli_rum,kforage)= -Inf; +v71_feed_balanceflow.up(j,kli_rum,kforage)= Inf; + +s71_lp_fix=0; diff --git a/modules/71_disagg_lvst/foragebased_aug18/postsolve.gms b/modules/71_disagg_lvst/foragebased_aug18/postsolve.gms index 302b4b6086..50c346a651 100644 --- a/modules/71_disagg_lvst/foragebased_aug18/postsolve.gms +++ b/modules/71_disagg_lvst/foragebased_aug18/postsolve.gms @@ -1,48 +1,49 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov71_prod_rum(t,j,kli_rum,kforage,"marginal") = v71_prod_rum.m(j,kli_rum,kforage); - ov71_additional_mon(t,j,kli_mon,"marginal") = v71_additional_mon.m(j,kli_mon); - ov_costs_additional_mon(t,i,"marginal") = vm_costs_additional_mon.m(i); - ov71_feed_balanceflow(t,j,kli_rum,kforage,"marginal") = v71_feed_balanceflow.m(j,kli_rum,kforage); - oq71_feed_rum_liv(t,j,kforage,"marginal") = q71_feed_rum_liv.m(j,kforage); - oq71_balanceflow_constraint_nlp(t,j,kli_rum,kforage,"marginal") = q71_balanceflow_constraint_nlp.m(j,kli_rum,kforage); - oq71_balanceflow_constraint_lp(t,i,kli_rum,kforage,"marginal") = q71_balanceflow_constraint_lp.m(i,kli_rum,kforage); - oq71_sum_rum_liv(t,j,kli_rum,"marginal") = q71_sum_rum_liv.m(j,kli_rum); - oq71_prod_mon_liv(t,j,kli_mon,"marginal") = q71_prod_mon_liv.m(j,kli_mon); - oq71_punishment_mon(t,i,"marginal") = q71_punishment_mon.m(i); - ov71_prod_rum(t,j,kli_rum,kforage,"level") = v71_prod_rum.l(j,kli_rum,kforage); - ov71_additional_mon(t,j,kli_mon,"level") = v71_additional_mon.l(j,kli_mon); - ov_costs_additional_mon(t,i,"level") = vm_costs_additional_mon.l(i); - ov71_feed_balanceflow(t,j,kli_rum,kforage,"level") = v71_feed_balanceflow.l(j,kli_rum,kforage); - oq71_feed_rum_liv(t,j,kforage,"level") = q71_feed_rum_liv.l(j,kforage); - oq71_balanceflow_constraint_nlp(t,j,kli_rum,kforage,"level") = q71_balanceflow_constraint_nlp.l(j,kli_rum,kforage); - oq71_balanceflow_constraint_lp(t,i,kli_rum,kforage,"level") = q71_balanceflow_constraint_lp.l(i,kli_rum,kforage); - oq71_sum_rum_liv(t,j,kli_rum,"level") = q71_sum_rum_liv.l(j,kli_rum); - oq71_prod_mon_liv(t,j,kli_mon,"level") = q71_prod_mon_liv.l(j,kli_mon); - oq71_punishment_mon(t,i,"level") = q71_punishment_mon.l(i); - ov71_prod_rum(t,j,kli_rum,kforage,"upper") = v71_prod_rum.up(j,kli_rum,kforage); - ov71_additional_mon(t,j,kli_mon,"upper") = v71_additional_mon.up(j,kli_mon); - ov_costs_additional_mon(t,i,"upper") = vm_costs_additional_mon.up(i); - ov71_feed_balanceflow(t,j,kli_rum,kforage,"upper") = v71_feed_balanceflow.up(j,kli_rum,kforage); - oq71_feed_rum_liv(t,j,kforage,"upper") = q71_feed_rum_liv.up(j,kforage); - oq71_balanceflow_constraint_nlp(t,j,kli_rum,kforage,"upper") = q71_balanceflow_constraint_nlp.up(j,kli_rum,kforage); - oq71_balanceflow_constraint_lp(t,i,kli_rum,kforage,"upper") = q71_balanceflow_constraint_lp.up(i,kli_rum,kforage); - oq71_sum_rum_liv(t,j,kli_rum,"upper") = q71_sum_rum_liv.up(j,kli_rum); - oq71_prod_mon_liv(t,j,kli_mon,"upper") = q71_prod_mon_liv.up(j,kli_mon); - oq71_punishment_mon(t,i,"upper") = q71_punishment_mon.up(i); - ov71_prod_rum(t,j,kli_rum,kforage,"lower") = v71_prod_rum.lo(j,kli_rum,kforage); - ov71_additional_mon(t,j,kli_mon,"lower") = v71_additional_mon.lo(j,kli_mon); - ov_costs_additional_mon(t,i,"lower") = vm_costs_additional_mon.lo(i); - ov71_feed_balanceflow(t,j,kli_rum,kforage,"lower") = v71_feed_balanceflow.lo(j,kli_rum,kforage); - oq71_feed_rum_liv(t,j,kforage,"lower") = q71_feed_rum_liv.lo(j,kforage); - oq71_balanceflow_constraint_nlp(t,j,kli_rum,kforage,"lower") = q71_balanceflow_constraint_nlp.lo(j,kli_rum,kforage); - oq71_balanceflow_constraint_lp(t,i,kli_rum,kforage,"lower") = q71_balanceflow_constraint_lp.lo(i,kli_rum,kforage); - oq71_sum_rum_liv(t,j,kli_rum,"lower") = q71_sum_rum_liv.lo(j,kli_rum); - oq71_prod_mon_liv(t,j,kli_mon,"lower") = q71_prod_mon_liv.lo(j,kli_mon); - oq71_punishment_mon(t,i,"lower") = q71_punishment_mon.lo(i); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### +*** | (C) 2008-2019 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 + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov71_prod_rum(t,j,kli_rum,kforage,"marginal") = v71_prod_rum.m(j,kli_rum,kforage); + ov71_additional_mon(t,j,kli_mon,"marginal") = v71_additional_mon.m(j,kli_mon); + ov_costs_additional_mon(t,i,"marginal") = vm_costs_additional_mon.m(i); + ov71_feed_balanceflow(t,j,kli_rum,kforage,"marginal") = v71_feed_balanceflow.m(j,kli_rum,kforage); + oq71_feed_rum_liv(t,j,kforage,"marginal") = q71_feed_rum_liv.m(j,kforage); + oq71_balanceflow_constraint_nlp(t,j,kli_rum,kforage,"marginal") = q71_balanceflow_constraint_nlp.m(j,kli_rum,kforage); + oq71_balanceflow_constraint_lp(t,i,kli_rum,kforage,"marginal") = q71_balanceflow_constraint_lp.m(i,kli_rum,kforage); + oq71_sum_rum_liv(t,j,kli_rum,"marginal") = q71_sum_rum_liv.m(j,kli_rum); + oq71_prod_mon_liv(t,j,kli_mon,"marginal") = q71_prod_mon_liv.m(j,kli_mon); + oq71_punishment_mon(t,i,"marginal") = q71_punishment_mon.m(i); + ov71_prod_rum(t,j,kli_rum,kforage,"level") = v71_prod_rum.l(j,kli_rum,kforage); + ov71_additional_mon(t,j,kli_mon,"level") = v71_additional_mon.l(j,kli_mon); + ov_costs_additional_mon(t,i,"level") = vm_costs_additional_mon.l(i); + ov71_feed_balanceflow(t,j,kli_rum,kforage,"level") = v71_feed_balanceflow.l(j,kli_rum,kforage); + oq71_feed_rum_liv(t,j,kforage,"level") = q71_feed_rum_liv.l(j,kforage); + oq71_balanceflow_constraint_nlp(t,j,kli_rum,kforage,"level") = q71_balanceflow_constraint_nlp.l(j,kli_rum,kforage); + oq71_balanceflow_constraint_lp(t,i,kli_rum,kforage,"level") = q71_balanceflow_constraint_lp.l(i,kli_rum,kforage); + oq71_sum_rum_liv(t,j,kli_rum,"level") = q71_sum_rum_liv.l(j,kli_rum); + oq71_prod_mon_liv(t,j,kli_mon,"level") = q71_prod_mon_liv.l(j,kli_mon); + oq71_punishment_mon(t,i,"level") = q71_punishment_mon.l(i); + ov71_prod_rum(t,j,kli_rum,kforage,"upper") = v71_prod_rum.up(j,kli_rum,kforage); + ov71_additional_mon(t,j,kli_mon,"upper") = v71_additional_mon.up(j,kli_mon); + ov_costs_additional_mon(t,i,"upper") = vm_costs_additional_mon.up(i); + ov71_feed_balanceflow(t,j,kli_rum,kforage,"upper") = v71_feed_balanceflow.up(j,kli_rum,kforage); + oq71_feed_rum_liv(t,j,kforage,"upper") = q71_feed_rum_liv.up(j,kforage); + oq71_balanceflow_constraint_nlp(t,j,kli_rum,kforage,"upper") = q71_balanceflow_constraint_nlp.up(j,kli_rum,kforage); + oq71_balanceflow_constraint_lp(t,i,kli_rum,kforage,"upper") = q71_balanceflow_constraint_lp.up(i,kli_rum,kforage); + oq71_sum_rum_liv(t,j,kli_rum,"upper") = q71_sum_rum_liv.up(j,kli_rum); + oq71_prod_mon_liv(t,j,kli_mon,"upper") = q71_prod_mon_liv.up(j,kli_mon); + oq71_punishment_mon(t,i,"upper") = q71_punishment_mon.up(i); + ov71_prod_rum(t,j,kli_rum,kforage,"lower") = v71_prod_rum.lo(j,kli_rum,kforage); + ov71_additional_mon(t,j,kli_mon,"lower") = v71_additional_mon.lo(j,kli_mon); + ov_costs_additional_mon(t,i,"lower") = vm_costs_additional_mon.lo(i); + ov71_feed_balanceflow(t,j,kli_rum,kforage,"lower") = v71_feed_balanceflow.lo(j,kli_rum,kforage); + oq71_feed_rum_liv(t,j,kforage,"lower") = q71_feed_rum_liv.lo(j,kforage); + oq71_balanceflow_constraint_nlp(t,j,kli_rum,kforage,"lower") = q71_balanceflow_constraint_nlp.lo(j,kli_rum,kforage); + oq71_balanceflow_constraint_lp(t,i,kli_rum,kforage,"lower") = q71_balanceflow_constraint_lp.lo(i,kli_rum,kforage); + oq71_sum_rum_liv(t,j,kli_rum,"lower") = q71_sum_rum_liv.lo(j,kli_rum); + oq71_prod_mon_liv(t,j,kli_mon,"lower") = q71_prod_mon_liv.lo(j,kli_mon); + oq71_punishment_mon(t,i,"lower") = q71_punishment_mon.lo(i); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/71_disagg_lvst/foragebased_aug18/preloop.gms b/modules/71_disagg_lvst/foragebased_aug18/preloop.gms index 1e4c78c9f1..093d6ae0ec 100644 --- a/modules/71_disagg_lvst/foragebased_aug18/preloop.gms +++ b/modules/71_disagg_lvst/foragebased_aug18/preloop.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 i71_urban_area_share(j) = diff --git a/modules/71_disagg_lvst/foragebased_aug18.gms b/modules/71_disagg_lvst/foragebased_aug18/realization.gms similarity index 82% rename from modules/71_disagg_lvst/foragebased_aug18.gms rename to modules/71_disagg_lvst/foragebased_aug18/realization.gms index 26db67bf2c..3a723108e7 100644 --- a/modules/71_disagg_lvst/foragebased_aug18.gms +++ b/modules/71_disagg_lvst/foragebased_aug18/realization.gms @@ -1,25 +1,26 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description The foragebased_aug18 realization constrains the cellular ruminant livestock production by -*' the feed availability for grazed pasture and fodder crops. This accounts for the fact that pasture and fodder -*' (summarized with forage) feed stuff is usually not transported over long distances and at the same time -*' is very essential in livestock diets. The monogastric livestock is distributed following the idea -*' that these animals are held close to densely populated areas. For more detailed information on cellular livestock -*' distribution see @robinson_mapping_2014, which inspired this realization. - -*' @limitations Distribution of monogastrics do not account for feed availability within a cell. Crop residue feed stuff -*' for ruminant production is also not considered to restrict livestock production. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/71_disagg_lvst/foragebased_aug18/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/71_disagg_lvst/foragebased_aug18/declarations.gms" -$Ifi "%phase%" == "equations" $include "./modules/71_disagg_lvst/foragebased_aug18/equations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/71_disagg_lvst/foragebased_aug18/preloop.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/71_disagg_lvst/foragebased_aug18/postsolve.gms" -$Ifi "%phase%" == "nl_fix" $include "./modules/71_disagg_lvst/foragebased_aug18/nl_fix.gms" -$Ifi "%phase%" == "nl_release" $include "./modules/71_disagg_lvst/foragebased_aug18/nl_release.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description The foragebased_aug18 realization constrains the cellular ruminant livestock production by +*' the feed availability for grazed pasture and fodder crops. This accounts for the fact that pasture and fodder +*' (summarized with forage) feed stuff is usually not transported over long distances and at the same time +*' is very essential in livestock diets. The monogastric livestock is distributed following the idea +*' that these animals are held close to densely populated areas. For more detailed information on cellular livestock +*' distribution see @robinson_mapping_2014, which inspired this realization. + +*' @limitations Distribution of monogastrics do not account for feed availability within a cell. Crop residue feed stuff +*' for ruminant production is also not considered to restrict livestock production. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/71_disagg_lvst/foragebased_aug18/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/71_disagg_lvst/foragebased_aug18/declarations.gms" +$Ifi "%phase%" == "equations" $include "./modules/71_disagg_lvst/foragebased_aug18/equations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/71_disagg_lvst/foragebased_aug18/preloop.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/71_disagg_lvst/foragebased_aug18/postsolve.gms" +$Ifi "%phase%" == "nl_fix" $include "./modules/71_disagg_lvst/foragebased_aug18/nl_fix.gms" +$Ifi "%phase%" == "nl_release" $include "./modules/71_disagg_lvst/foragebased_aug18/nl_release.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/71_disagg_lvst/foragebased_aug18/sets.gms b/modules/71_disagg_lvst/foragebased_aug18/sets.gms index 3482bfe25a..a41abbe580 100644 --- a/modules/71_disagg_lvst/foragebased_aug18/sets.gms +++ b/modules/71_disagg_lvst/foragebased_aug18/sets.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 sets diff --git a/modules/71_disagg_lvst/71_disagg_lvst.gms b/modules/71_disagg_lvst/module.gms similarity index 53% rename from modules/71_disagg_lvst/71_disagg_lvst.gms rename to modules/71_disagg_lvst/module.gms index 795cc2a67e..e60797783d 100644 --- a/modules/71_disagg_lvst/71_disagg_lvst.gms +++ b/modules/71_disagg_lvst/module.gms @@ -1,19 +1,20 @@ -*** (C) 2008-2017 Potsdam Institute for Climate Impact Research (PIK), -*** authors, and contributors see AUTHORS file -*** This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** Contact: magpie@pik-potsdam.de - -*' @title Disaggregation of livestock distribution -*' -*' @description The module 71_disagg_lvst calculates the livestock distribution within a region onto -*' cellular level. Without constrains in this module cellular livestock production is determined by -*' the modules 40_transport accounting for transport costs and module 42_water_demand connecting -*' livestock production to water demand and thus to water availability. -*' -*' @authors Kristine Karstens, Benjamin Bodirsky - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%disagg_lvst%" == "foragebased_aug18" $include "./modules/71_disagg_lvst/foragebased_aug18.gms" -$Ifi "%disagg_lvst%" == "off" $include "./modules/71_disagg_lvst/off.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Disaggregation of livestock distribution +*' +*' @description The module 71_disagg_lvst calculates the livestock distribution within a region onto +*' cellular level. Without constrains in this module cellular livestock production is determined by +*' the modules 40_transport accounting for transport costs and module 42_water_demand connecting +*' livestock production to water demand and thus to water availability. +*' +*' @authors Kristine Karstens, Benjamin Bodirsky + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%disagg_lvst%" == "foragebased_aug18" $include "./modules/71_disagg_lvst/foragebased_aug18/realization.gms" +$Ifi "%disagg_lvst%" == "off" $include "./modules/71_disagg_lvst/off/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/71_disagg_lvst/off/declarations.gms b/modules/71_disagg_lvst/off/declarations.gms index dc0396da04..e5969fef59 100644 --- a/modules/71_disagg_lvst/off/declarations.gms +++ b/modules/71_disagg_lvst/off/declarations.gms @@ -1,14 +1,15 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -positive variables - vm_costs_additional_mon(i) Punishment cost for additionally transported monogastric livst_egg (mio. USD05MER per yr) -; -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_costs_additional_mon(t,i,type) Punishment cost for additionally transported monogastric livst_egg (mio. USD05MER per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +positive variables + vm_costs_additional_mon(i) Punishment cost for additionally transported monogastric livst_egg (mio. USD05MER per yr) +; +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_costs_additional_mon(t,i,type) Punishment cost for additionally transported monogastric livst_egg (mio. USD05MER per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/71_disagg_lvst/off/not_used.txt b/modules/71_disagg_lvst/off/not_used.txt index 54b92f6c52..617d0ccc76 100644 --- a/modules/71_disagg_lvst/off/not_used.txt +++ b/modules/71_disagg_lvst/off/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason @@ -10,4 +11,4 @@ fm_feed_balanceflow,input,questionnaire vm_prod,input,questionnaire vm_prod_reg,input,questionnaire pm_land_start,input,questionnaire -pcm_land,input,questionnaire \ No newline at end of file +pcm_land,input,questionnaire diff --git a/modules/71_disagg_lvst/off/postsolve.gms b/modules/71_disagg_lvst/off/postsolve.gms index cdcb5de450..ef7d8210a2 100644 --- a/modules/71_disagg_lvst/off/postsolve.gms +++ b/modules/71_disagg_lvst/off/postsolve.gms @@ -1,8 +1,14 @@ - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_costs_additional_mon(t,i,"marginal") = vm_costs_additional_mon.m(i); - ov_costs_additional_mon(t,i,"level") = vm_costs_additional_mon.l(i); - ov_costs_additional_mon(t,i,"upper") = vm_costs_additional_mon.up(i); - ov_costs_additional_mon(t,i,"lower") = vm_costs_additional_mon.lo(i); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - +*** | (C) 2008-2019 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 + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_costs_additional_mon(t,i,"marginal") = vm_costs_additional_mon.m(i); + ov_costs_additional_mon(t,i,"level") = vm_costs_additional_mon.l(i); + ov_costs_additional_mon(t,i,"upper") = vm_costs_additional_mon.up(i); + ov_costs_additional_mon(t,i,"lower") = vm_costs_additional_mon.lo(i); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### + diff --git a/modules/71_disagg_lvst/off/presolve.gms b/modules/71_disagg_lvst/off/presolve.gms index 2937c62e0f..78bbfebc8f 100644 --- a/modules/71_disagg_lvst/off/presolve.gms +++ b/modules/71_disagg_lvst/off/presolve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de vm_costs_additional_mon.fx(i)=0; diff --git a/modules/71_disagg_lvst/off.gms b/modules/71_disagg_lvst/off/realization.gms similarity index 65% rename from modules/71_disagg_lvst/off.gms rename to modules/71_disagg_lvst/off/realization.gms index 06439ed689..14c81779be 100644 --- a/modules/71_disagg_lvst/off.gms +++ b/modules/71_disagg_lvst/off/realization.gms @@ -1,15 +1,16 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description The off realization does not account for any further restriction of the livestock distribution. - -*' @limitations This realization underestimates real world drivers for livestock distribution. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "declarations" $include "./modules/71_disagg_lvst/off/declarations.gms" -$Ifi "%phase%" == "presolve" $include "./modules/71_disagg_lvst/off/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/71_disagg_lvst/off/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description The off realization does not account for any further restriction of the livestock distribution. + +*' @limitations This realization underestimates real world drivers for livestock distribution. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "declarations" $include "./modules/71_disagg_lvst/off/declarations.gms" +$Ifi "%phase%" == "presolve" $include "./modules/71_disagg_lvst/off/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/71_disagg_lvst/off/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/80_optimization/lp_nlp_apr17/declarations.gms b/modules/80_optimization/lp_nlp_apr17/declarations.gms index de6dbbe1d5..2cc1dfdf7f 100644 --- a/modules/80_optimization/lp_nlp_apr17/declarations.gms +++ b/modules/80_optimization/lp_nlp_apr17/declarations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de parameters diff --git a/modules/80_optimization/lp_nlp_apr17/input.gms b/modules/80_optimization/lp_nlp_apr17/input.gms index 98ccd2bbf6..16a42017bf 100644 --- a/modules/80_optimization/lp_nlp_apr17/input.gms +++ b/modules/80_optimization/lp_nlp_apr17/input.gms @@ -1,21 +1,22 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -scalars - s80_maxiter maximal solve iterations if modelstat is > 2 (1) / 30 / - s80_optfile switch to use specfied solver settings (1) / 0 / - s80_add_cplex add cplex optimization after conopt4 (1) / 0 / - s80_add_conopt3 add conopt3 optimization after conopt4 (1) / 0 / - s80_num_nonopt_allowed number of allowed non-optimal variables (1) / Inf / -; - - -$setglobal c80_nlp_solver conopt4 -* options: (conopt3): conopt3 -* (conopt4): conopt4 -* (conopt4+cplex): conopt4 followed by cplex with landdiff optimization -* (conopt4+conopt3): conopt4 followed by conopt3 - +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +scalars + s80_maxiter maximal solve iterations if modelstat is > 2 (1) / 30 / + s80_optfile switch to use specfied solver settings (1) / 0 / + s80_add_cplex add cplex optimization after conopt4 (1) / 0 / + s80_add_conopt3 add conopt3 optimization after conopt4 (1) / 0 / + s80_num_nonopt_allowed number of allowed non-optimal variables (1) / Inf / +; + + +$setglobal c80_nlp_solver conopt4 +* options: (conopt3): conopt3 +* (conopt4): conopt4 +* (conopt4+cplex): conopt4 followed by cplex with landdiff optimization +* (conopt4+conopt3): conopt4 followed by conopt3 + diff --git a/modules/80_optimization/lp_nlp_apr17.gms b/modules/80_optimization/lp_nlp_apr17/realization.gms similarity index 76% rename from modules/80_optimization/lp_nlp_apr17.gms rename to modules/80_optimization/lp_nlp_apr17/realization.gms index 6ee8fb23a7..432d9ec671 100644 --- a/modules/80_optimization/lp_nlp_apr17.gms +++ b/modules/80_optimization/lp_nlp_apr17/realization.gms @@ -1,25 +1,26 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description In this realization, instead of directly starting the nonlinear -*' optimization, a linear version of the model is solved beforehand. In order to -*' linearize the model all nonlinear terms are fixed to best guesses for the -*' respective values. The linear solution serves as an improved starting point -*' for the nonlinear optimization. -*' - -*' @limitations This realization requires that all module realizations with -*' nonlinear terms provide a `nl_fix.gms` and `nl_release.gms` which fix and -*' release all nonlinear terms in the module. If this is missing and there are -*' still active, nonlinear terms in the linear solve attempt the model run will -*' be cancelled by an error. - - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "declarations" $include "./modules/80_optimization/lp_nlp_apr17/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/80_optimization/lp_nlp_apr17/input.gms" -$Ifi "%phase%" == "solve" $include "./modules/80_optimization/lp_nlp_apr17/solve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description In this realization, instead of directly starting the nonlinear +*' optimization, a linear version of the model is solved beforehand. In order to +*' linearize the model all nonlinear terms are fixed to best guesses for the +*' respective values. The linear solution serves as an improved starting point +*' for the nonlinear optimization. +*' + +*' @limitations This realization requires that all module realizations with +*' nonlinear terms provide a `nl_fix.gms` and `nl_release.gms` which fix and +*' release all nonlinear terms in the module. If this is missing and there are +*' still active, nonlinear terms in the linear solve attempt the model run will +*' be cancelled by an error. + + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "declarations" $include "./modules/80_optimization/lp_nlp_apr17/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/80_optimization/lp_nlp_apr17/input.gms" +$Ifi "%phase%" == "solve" $include "./modules/80_optimization/lp_nlp_apr17/solve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/80_optimization/lp_nlp_apr17/solve.gms b/modules/80_optimization/lp_nlp_apr17/solve.gms index 831cad05f8..1ddbbaa3aa 100644 --- a/modules/80_optimization/lp_nlp_apr17/solve.gms +++ b/modules/80_optimization/lp_nlp_apr17/solve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 **************start solve loop************** diff --git a/modules/80_optimization/80_optimization.gms b/modules/80_optimization/module.gms similarity index 72% rename from modules/80_optimization/80_optimization.gms rename to modules/80_optimization/module.gms index 6070971fca..e32f8e83bb 100644 --- a/modules/80_optimization/80_optimization.gms +++ b/modules/80_optimization/module.gms @@ -1,25 +1,26 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @title Optimization -*' -*' @description This module takes care of the model optimization of -*' the main model, allowing for switching between optimization procedures. -*' It has been introduced to play with different ways to affect the runtime -*' performance of the model via more optimized model solution strategies. -*' The interfaces to the rest of the model are quite limited as it only requires -*' the variables to be optimized `vm_cost_glo` (total costs) and `vm_landdiff` -*' (gross land use changes compared to last time step) as direct input. -*' The latter was introduced to select out of a range of cost optimal patterns -*' that one which is closest to the pattern of the previous time step. While -*' CONOPT returns this solution by default, CPLEX does not. -*' -*' @authors Jan Philipp Dietrich, Todd Munson - -*###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%optimization%" == "lp_nlp_apr17" $include "./modules/80_optimization/lp_nlp_apr17.gms" -$Ifi "%optimization%" == "nlp_apr17" $include "./modules/80_optimization/nlp_apr17.gms" -*###################### R SECTION END (MODULETYPES) ############################ +*** | (C) 2008-2019 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 + +*' @title Optimization +*' +*' @description This module takes care of the model optimization of +*' the main model, allowing for switching between optimization procedures. +*' It has been introduced to play with different ways to affect the runtime +*' performance of the model via more optimized model solution strategies. +*' The interfaces to the rest of the model are quite limited as it only requires +*' the variables to be optimized `vm_cost_glo` (total costs) and `vm_landdiff` +*' (gross land use changes compared to last time step) as direct input. +*' The latter was introduced to select out of a range of cost optimal patterns +*' that one which is closest to the pattern of the previous time step. While +*' CONOPT returns this solution by default, CPLEX does not. +*' +*' @authors Jan Philipp Dietrich, Todd Munson + +*###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%optimization%" == "lp_nlp_apr17" $include "./modules/80_optimization/lp_nlp_apr17/realization.gms" +$Ifi "%optimization%" == "nlp_apr17" $include "./modules/80_optimization/nlp_apr17/realization.gms" +*###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/80_optimization/nlp_apr17/declarations.gms b/modules/80_optimization/nlp_apr17/declarations.gms index 8dcfe837aa..ff51ac3c33 100644 --- a/modules/80_optimization/nlp_apr17/declarations.gms +++ b/modules/80_optimization/nlp_apr17/declarations.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de parameters diff --git a/modules/80_optimization/nlp_apr17/input.gms b/modules/80_optimization/nlp_apr17/input.gms index a5e54a94fd..3ac14f63a1 100644 --- a/modules/80_optimization/nlp_apr17/input.gms +++ b/modules/80_optimization/nlp_apr17/input.gms @@ -1,15 +1,16 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -scalars - s80_maxiter maximal solve iterations if modelstat is > 2 (1) / 30 / - s80_optfile switch to use specfied solver settings (1) / 0 / - s80_num_nonopt_allowed number of allowed non-optimal variables (1) / Inf / -; - -$setglobal c80_nlp_solver conopt4 -* options: (conopt3): conopt3 -* (conopt4): conopt4 +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +scalars + s80_maxiter maximal solve iterations if modelstat is > 2 (1) / 30 / + s80_optfile switch to use specfied solver settings (1) / 0 / + s80_num_nonopt_allowed number of allowed non-optimal variables (1) / Inf / +; + +$setglobal c80_nlp_solver conopt4 +* options: (conopt3): conopt3 +* (conopt4): conopt4 diff --git a/modules/80_optimization/nlp_apr17/not_used.txt b/modules/80_optimization/nlp_apr17/not_used.txt index 4fb617dcc0..2d9f82bd02 100644 --- a/modules/80_optimization/nlp_apr17/not_used.txt +++ b/modules/80_optimization/nlp_apr17/not_used.txt @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). # | Contact: magpie@pik-potsdam.de name,type,reason vm_landdiff,input,questionnaire diff --git a/modules/80_optimization/nlp_apr17.gms b/modules/80_optimization/nlp_apr17/realization.gms similarity index 68% rename from modules/80_optimization/nlp_apr17.gms rename to modules/80_optimization/nlp_apr17/realization.gms index b45380662a..9a8c446553 100644 --- a/modules/80_optimization/nlp_apr17.gms +++ b/modules/80_optimization/nlp_apr17/realization.gms @@ -1,17 +1,18 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - -*' @description -*' In this realization the model is solved directly using nonlinear optimization. -*' If the optimization returns an infeasible solution the solve is repeated, -*' either until a feasible solution is found or the maximum number of iterations -*' as defined in `s80_maxiter` is reached. - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "declarations" $include "./modules/80_optimization/nlp_apr17/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/80_optimization/nlp_apr17/input.gms" -$Ifi "%phase%" == "solve" $include "./modules/80_optimization/nlp_apr17/solve.gms" -*######################## R SECTION END (PHASES) ############################### +*** | (C) 2008-2019 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description +*' In this realization the model is solved directly using nonlinear optimization. +*' If the optimization returns an infeasible solution the solve is repeated, +*' either until a feasible solution is found or the maximum number of iterations +*' as defined in `s80_maxiter` is reached. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "declarations" $include "./modules/80_optimization/nlp_apr17/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/80_optimization/nlp_apr17/input.gms" +$Ifi "%phase%" == "solve" $include "./modules/80_optimization/nlp_apr17/solve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/80_optimization/nlp_apr17/solve.gms b/modules/80_optimization/nlp_apr17/solve.gms index 6d1dad234c..e2704eb2d5 100644 --- a/modules/80_optimization/nlp_apr17/solve.gms +++ b/modules/80_optimization/nlp_apr17/solve.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 **************start solve loop************** diff --git a/modules/include.gms b/modules/include.gms index 04e0f240ee..1c9b532ba9 100644 --- a/modules/include.gms +++ b/modules/include.gms @@ -1,51 +1,52 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** | Contact: magpie@pik-potsdam.de - - -$setglobal phase %1 -$onrecurse -*######################## R SECTION START (MODULES) ############################ -$include "./modules/09_drivers/09_drivers.gms" -$include "./modules/10_land/10_land.gms" -$include "./modules/11_costs/11_costs.gms" -$include "./modules/12_interest_rate/12_interest_rate.gms" -$include "./modules/13_tc/13_tc.gms" -$include "./modules/14_yields/14_yields.gms" -$include "./modules/15_food/15_food.gms" -$include "./modules/16_demand/16_demand.gms" -$include "./modules/17_production/17_production.gms" -$include "./modules/18_residues/18_residues.gms" -$include "./modules/20_processing/20_processing.gms" -$include "./modules/21_trade/21_trade.gms" -$include "./modules/30_crop/30_crop.gms" -$include "./modules/31_past/31_past.gms" -$include "./modules/32_forestry/32_forestry.gms" -$include "./modules/34_urban/34_urban.gms" -$include "./modules/35_natveg/35_natveg.gms" -$include "./modules/38_factor_costs/38_factor_costs.gms" -$include "./modules/39_landconversion/39_landconversion.gms" -$include "./modules/40_transport/40_transport.gms" -$include "./modules/41_area_equipped_for_irrigation/41_area_equipped_for_irrigation.gms" -$include "./modules/42_water_demand/42_water_demand.gms" -$include "./modules/43_water_availability/43_water_availability.gms" -$include "./modules/45_climate/45_climate.gms" -$include "./modules/50_nr_soil_budget/50_nr_soil_budget.gms" -$include "./modules/51_nitrogen/51_nitrogen.gms" -$include "./modules/52_carbon/52_carbon.gms" -$include "./modules/53_methane/53_methane.gms" -$include "./modules/54_phosphorus/54_phosphorus.gms" -$include "./modules/55_awms/55_awms.gms" -$include "./modules/56_ghg_policy/56_ghg_policy.gms" -$include "./modules/57_maccs/57_maccs.gms" -$include "./modules/59_som/59_som.gms" -$include "./modules/60_bioenergy/60_bioenergy.gms" -$include "./modules/62_material/62_material.gms" -$include "./modules/70_livestock/70_livestock.gms" -$include "./modules/71_disagg_lvst/71_disagg_lvst.gms" -$include "./modules/80_optimization/80_optimization.gms" -*######################## R SECTION END (MODULES) ############################## -$offrecurse -*** EOF include.gms *** +*** | (C) 2008-2019 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 + + +$setglobal phase %1 +$onrecurse +*######################## R SECTION START (MODULES) ############################ +$include "./modules/09_drivers/module.gms" +$include "./modules/10_land/module.gms" +$include "./modules/11_costs/module.gms" +$include "./modules/12_interest_rate/module.gms" +$include "./modules/13_tc/module.gms" +$include "./modules/14_yields/module.gms" +$include "./modules/15_food/module.gms" +$include "./modules/16_demand/module.gms" +$include "./modules/17_production/module.gms" +$include "./modules/18_residues/module.gms" +$include "./modules/20_processing/module.gms" +$include "./modules/21_trade/module.gms" +$include "./modules/30_crop/module.gms" +$include "./modules/31_past/module.gms" +$include "./modules/32_forestry/module.gms" +$include "./modules/34_urban/module.gms" +$include "./modules/35_natveg/module.gms" +$include "./modules/38_factor_costs/module.gms" +$include "./modules/39_landconversion/module.gms" +$include "./modules/40_transport/module.gms" +$include "./modules/41_area_equipped_for_irrigation/module.gms" +$include "./modules/42_water_demand/module.gms" +$include "./modules/43_water_availability/module.gms" +$include "./modules/45_climate/module.gms" +$include "./modules/50_nr_soil_budget/module.gms" +$include "./modules/51_nitrogen/module.gms" +$include "./modules/52_carbon/module.gms" +$include "./modules/53_methane/module.gms" +$include "./modules/54_phosphorus/module.gms" +$include "./modules/55_awms/module.gms" +$include "./modules/56_ghg_policy/module.gms" +$include "./modules/57_maccs/module.gms" +$include "./modules/59_som/module.gms" +$include "./modules/60_bioenergy/module.gms" +$include "./modules/62_material/module.gms" +$include "./modules/70_livestock/module.gms" +$include "./modules/71_disagg_lvst/module.gms" +$include "./modules/80_optimization/module.gms" +*######################## R SECTION END (MODULES) ############################## +$offrecurse +*** EOF include.gms *** diff --git a/output.R b/output.R index ea7604b41d..137affefdc 100644 --- a/output.R +++ b/output.R @@ -1,8 +1,9 @@ -# | (C) 2008-2017 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# | Contact: magpie@pik-potsdam.de +# | (C) 2008-2019 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 ########################################################## #### MAgPIE output generation #### @@ -37,6 +38,7 @@ runOutputs <- function(comp=NULL, output=NULL, outputdirs=NULL, submit=NULL) { } else { dirs <- sub("fulldata.gdx","",sub("./output/","",tmp, fixed=TRUE), fixed=TRUE) } + dirs <- sort(dirs) dirs <- c("all",dirs) cat("\n",title,":\n", sep="") cat(paste(1:length(dirs), dirs, sep=": " ),sep="\n") @@ -123,7 +125,7 @@ runOutputs <- function(comp=NULL, output=NULL, outputdirs=NULL, submit=NULL) { "3" = "direct", "4" = "background", "5" = "debug") - + } else { comp <- switch(identifier, "1" = "direct", diff --git a/scripts/calibration/calc_calib.R b/scripts/calibration/calc_calib.R index 3f33b2995d..45c323a825 100644 --- a/scripts/calibration/calc_calib.R +++ b/scripts/calibration/calc_calib.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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/scripts/downloader/download.R b/scripts/downloader/download.R index f3368d1019..7c0028067b 100644 --- a/scripts/downloader/download.R +++ b/scripts/downloader/download.R @@ -1,286 +1,287 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# | Contact: magpie@pik-potsdam.de - -# ********************************************************************* -# *** This script downloads model input data *** -# *** and applies corresponding changes to gams code *** -# ********************************************************************* - -# New version is based on tgz files - -library(magclass) -library(lucode) - -################################################################################ -#Create file2destination mapping based on information from the model -################################################################################ -getfiledestinations <- function() { - folders <- base::list.dirs(recursive=FALSE, full.names=FALSE) - folders <- grep("^(\\.|225|output|calib_run|figure)",folders, invert=TRUE, value=TRUE) - files <- NULL - for(f in folders) files <- c(files,dir(path=f,pattern="^files$",recursive = TRUE, full.names=TRUE)) - out <- NULL - for(f in files) { - tmp <- grep("^\\*",readLines(f, warn = FALSE),invert=TRUE,value=TRUE) - add <- data.frame(file=tmp,destination=dirname(f),stringsAsFactors = FALSE) - out <- rbind(out,add) - } - out <- as.data.frame(lapply(out,trimws),stringsAsFactors=FALSE) - return(out[out[[1]]!="",]) -} - -################################################################################ -#Delete data provided in mapping -################################################################################ -delete_olddata <- function(x) { - if(is.character(x)) { - if(!file.exists(x)) stop("Cannot find file mapping!") - map <- read.csv(x, sep = ";", stringsAsFactors = FALSE, comment.char = "#") - } else { - map <- x - } - x <- map$file - names(x) <- map$destination - for(i in 1:length(x)) { - outputpath <- Sys.glob(path(names(x)[i],x[i])) - for(file in outputpath) file.remove(file) - } -} -################################################################################ - -################################################################################ -#Define the copy routine that additionally performs some checks -################################################################################ -copy_input <- function(x, sourcepath, low_res, move=FALSE) { - if(is.character(x)) { - if(!file.exists(x)) stop("Cannot find file mapping!") - map <- read.csv(x, sep = ";", stringsAsFactors = FALSE) - } else { - map <- x - } - x <- map$file - names(x) <- map$destination - if(move) { - cat("\nStart moving input files:\n") - } else { - cat("\nStart copying input files:\n") - } - nmax <- max(nchar(x)) - require(magclass) - for(i in 1:length(x)) { - outputpath <- path(names(x)[i],x[i]) - if(file.exists(outputpath)) file.remove(outputpath) - inputpath <- paste0(sourcepath,"/",x[i]) - if(!file.exists(inputpath)) { - inputpath <- Sys.glob(sub("^(.*)\\.[^\\.]*$", paste0(sourcepath,"/\\1_",low_res,".*"), x[i])) - if(length(inputpath)>1) { - stop("Problem determining the proper input path for file", x[i], "(more than one possible path found)") - } else if(length(inputpath)==0) { - warning("File ", x[i]," seems to be missing!") - cat(" ",format(x[i],width=nmax)," -> FAILED!\n") - next - } - } - copy.magpie(inputpath, outputpath, round=8) - if(move & !(i != length(x) & (x[i] %in% x[i+1:length(x)]))) { - file.remove(inputpath) - } - cat(" ",format(x[i],width=nmax)," -> ",outputpath, "\n") - } - cat("\n") -} -################################################################################ - -################################################################################ -#Define routine to update GAMS sets -################################################################################ -update_sets <- function(cpr,map) { - require(lucode) - - reg1 <- unique(map$RegionCode) - reg2 <- names(cpr) - if(!all(union(reg1,reg2) %in% intersect(reg1,reg2))) { - stop("Inconsistent region information!", - "\n cpr info: ",paste(reg2,collapse=", "), - "\n spatial header info: ", paste(reg1,collapse=", ")) - } - - - j <- 0; cells <- NULL - for(i in 1:length(cpr)) { - cells <- c(cells,paste(names(cpr)[i],"_",j+1,"*",names(cpr)[i],"_",j+cpr[i],sep="")) - j <- j+cpr[i] - } - - .tmp <- function(x,prefix="", suffix1="", suffix2=" /", collapse=",", n=10) { - content <- NULL - tmp <- lapply(split(x, ceiling(seq_along(x)/n)),paste,collapse=collapse) - end <- suffix1 - for(i in 1:length(tmp)) { - if(i==length(tmp)) end <- suffix2 - content <- c(content,paste0(' ',prefix,tmp[[i]],end)) - } - return(content) - } - - subject <- 'SETS' - modification_warning <- c( - '*THIS CODE IS CREATED AUTOMATICALLY, DO NOT MODIFY THESE LINES DIRECTLY', - '*ANY DIRECT MODIFICATION WILL BE LOST AFTER NEXT INPUT DOWNLOAD', - '*CHANGES CAN BE DONE USING THE INPUT DOWNLOADER UNDER SCRIPTS/DOWNLOAD', - '*THERE YOU CAN ALSO FIND ADDITIONAL INFORMATION') - content <- c(modification_warning,'','sets','') - - content <- c(content,paste(' i World regions /',paste(names(cpr),collapse=','),'/',sep=''),'') - - # write iso set with nice formatting (10 countries per line) - tmp <- lapply(split(map$CountryCode, ceiling(seq_along(map$CountryCode)/10)),paste,collapse=",") - content <- c(content,' iso Countries /') - content <- c(content, .tmp(map$CountryCode, suffix1=",", suffix2=" /")) - - content <- c(content, '', paste(' j Spatial clusters /\n ',paste(cells,collapse=',\n '),'/',sep=''),'', - ' cell(i,j) Mapping between regions i and clusters j',' /') - for(i in 1:length(cpr)) { - content <- c(content,paste(' ',names(cpr)[i],' . ',cells[i],sep='')) - } - content <- c(content,' /','') - - content <- c(content,' i_to_iso(i,iso) Mapping between regions and countries',' /') - map$RegionCode <- as.factor(map$RegionCode) - for(i in levels(map$RegionCode)) { - content <- c(content, .tmp(map$CountryCode[map$RegionCode==i], prefix=paste0(i," . ("), suffix1=")", suffix2=")")) - - } - content <- c(content,' /',';') - replace_in_file("core/sets.gms",content,subject) -} -################################################################################ - -################################################################################ -#Define routine to update info file in input folder and info in main.gms -################################################################################ -update_info <- function(datasets, low_res, high_res, cpr, - regionscode, reg_revision, warnings=NULL) { - require(lucode) - info <- readLines('input/info.txt') - subject <- 'VERSION INFO' - - useddata <- NULL - for(dataset in rownames(datasets)) { - useddata <- c(useddata, - '', - paste('Used data set:',dataset), - paste('md5sum:',datasets[dataset,"md5"]), - paste('Repository:',datasets[dataset,"repo"])) - } - - warnings <- attr(datasets,"warnings") - if(!is.null(warnings)) { - warnings <- capture.output(warnings) - } - - content <- c(useddata, - '', - paste('Low resolution:',low_res), - paste('High resolution:',high_res), - '', - paste('Total number of cells:',sum(cpr)), - '', - 'Number of cells per region:', - paste(format(names(cpr),width=5,justify="right"),collapse=""), - paste(format(cpr,width=5),collapse=""), - '', - paste('Regionscode:',regionscode), - '', - paste('Regions data revision:',reg_revision), - '', - info, - '', - warnings, - '', - paste('Last modification (input data):',date()), - '') - writeLines(content,'input/info.txt') - replace_in_file("main.gms",paste('*',content),subject) -} -################################################################################ - -################################################################################ -#Function to extract information from info.txt -################################################################################ -get_info <- function(file,grep_expression,sep,pattern="",replacement="") { - if(!file.exists(file)) stop("info.txt file is missing with required information about the input") - file <- readLines(file) - tmp <- grep(grep_expression,file, value=TRUE) - tmp <- strsplit(tmp, sep) - tmp <- sapply(tmp, "[[", 2) - tmp <- gsub(pattern,replacement,tmp) - if(length(tmp)==0) stop(grep_expression," could not be found!") - return(tmp) -} -################################################################################ - - -archive_download <- function(files=c("GLUES2-sresa2-constant_co2-miub_echo_g_ERB_rev22.1_n200_690d3718e151be1b450b394c1064b1c5.tgz", - "690d3718e151be1b450b394c1064b1c5_magpie_rev2.499.tgz"), - repositories=list("/p/projects/landuse/data/input/raw_data"=NULL, - "/p/projects/rd3mod/inputdata/output"=NULL), - modelfolder=".", - debug=FALSE) { - - require(lucode) - require(magclass) - warnings <- NULL - - cdir <- getwd() - setwd(modelfolder) - on.exit(setwd(cdir)) - - ################## GENERAL CLEAN UP ################################### - # delete old input files to avoid mixed inputs in the case that data - # download fails at some point - file2destination <- getfiledestinations() - - cat("\nDelete old data in input folders ... ") - # delete files which will be copied/moved later on with copy_input - delete_olddata(file2destination) - # delete additional files not treated by copy_input - delete_olddata("scripts/downloader/inputdelete.cfg") - cat("done!\n\n") - - ##################### DATA DOWNLOAD ######################################### - # load data from source and unpack it - filemap <- lucode::download_unpack(input=files, targetdir="input", repositories=repositories, debug=FALSE) - - low_res <- get_info("input/info.txt","^\\* Output ?resolution:",": ") - high_res <- get_info("input/info.txt","^\\* Input ?resolution:",": ") - - ################## COPY MAGPIE INPUT FILES ################################### - # In the following input files in MAgPIE format are converted (if required) to - # csX files and copied into the corresponding input folders. In this step also - # the resolution information in the file name (if existing) is removed to - # allow a resolution-indepedent gams-sourcecode. - - copy_input(file2destination, "input", low_res, !debug) - - - ###################### MANIPULATE GAMS FILES ################################### - # In the following the GAMS sourcecode files magpie.gms and core/sets.gms - # are manipulated. Therefore some information about the number of cells per - # region is required (CPR). This information is gained by extracting it from - # the avl_land.cs3 input file (any other cellular file could be used as well). - # This information is then transfered to update_info, which is - # updating the general information in magpie.gms and input/info.txt - # and update_sets, which is updating the resolution- and region-depending - # sets in core/sets.gms - - tmp <- read.magpie("modules/10_land/input/avl_land_t.cs3") - cpr <- getCPR(tmp) - # read spatial_header, map, reg_revision and regionscode - load("input/spatial_header.rda") - update_info(filemap,low_res,high_res,cpr,regionscode,reg_revision, warnings) - update_sets(cpr,map) -} +# | (C) 2008-2019 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 + +# ********************************************************************* +# *** This script downloads model input data *** +# *** and applies corresponding changes to gams code *** +# ********************************************************************* + +# New version is based on tgz files + +library(magclass) +library(lucode) + +################################################################################ +#Create file2destination mapping based on information from the model +################################################################################ +getfiledestinations <- function() { + folders <- base::list.dirs(recursive=FALSE, full.names=FALSE) + folders <- grep("^(\\.|225|output|calib_run|figure)",folders, invert=TRUE, value=TRUE) + files <- NULL + for(f in folders) files <- c(files,dir(path=f,pattern="^files$",recursive = TRUE, full.names=TRUE)) + out <- NULL + for(f in files) { + tmp <- grep("^\\*",readLines(f, warn = FALSE),invert=TRUE,value=TRUE) + add <- data.frame(file=tmp,destination=dirname(f),stringsAsFactors = FALSE) + out <- rbind(out,add) + } + out <- as.data.frame(lapply(out,trimws),stringsAsFactors=FALSE) + return(out[out[[1]]!="",]) +} + +################################################################################ +#Delete data provided in mapping +################################################################################ +delete_olddata <- function(x) { + if(is.character(x)) { + if(!file.exists(x)) stop("Cannot find file mapping!") + map <- read.csv(x, sep = ";", stringsAsFactors = FALSE, comment.char = "#") + } else { + map <- x + } + x <- map$file + names(x) <- map$destination + for(i in 1:length(x)) { + outputpath <- Sys.glob(path(names(x)[i],x[i])) + for(file in outputpath) file.remove(file) + } +} +################################################################################ + +################################################################################ +#Define the copy routine that additionally performs some checks +################################################################################ +copy_input <- function(x, sourcepath, low_res, move=FALSE) { + if(is.character(x)) { + if(!file.exists(x)) stop("Cannot find file mapping!") + map <- read.csv(x, sep = ";", stringsAsFactors = FALSE) + } else { + map <- x + } + x <- map$file + names(x) <- map$destination + if(move) { + cat("\nStart moving input files:\n") + } else { + cat("\nStart copying input files:\n") + } + nmax <- max(nchar(x)) + require(magclass) + for(i in 1:length(x)) { + outputpath <- path(names(x)[i],x[i]) + if(file.exists(outputpath)) file.remove(outputpath) + inputpath <- paste0(sourcepath,"/",x[i]) + if(!file.exists(inputpath)) { + inputpath <- Sys.glob(sub("^(.*)\\.[^\\.]*$", paste0(sourcepath,"/\\1_",low_res,".*"), x[i])) + if(length(inputpath)>1) { + stop("Problem determining the proper input path for file", x[i], "(more than one possible path found)") + } else if(length(inputpath)==0) { + warning("File ", x[i]," seems to be missing!") + cat(" ",format(x[i],width=nmax)," -> FAILED!\n") + next + } + } + copy.magpie(inputpath, outputpath, round=8) + if(move & !(i != length(x) & (x[i] %in% x[i+1:length(x)]))) { + file.remove(inputpath) + } + cat(" ",format(x[i],width=nmax)," -> ",outputpath, "\n") + } + cat("\n") +} +################################################################################ + +################################################################################ +#Define routine to update GAMS sets +################################################################################ +update_sets <- function(cpr,map) { + require(lucode) + + reg1 <- unique(map$RegionCode) + reg2 <- names(cpr) + if(!all(union(reg1,reg2) %in% intersect(reg1,reg2))) { + stop("Inconsistent region information!", + "\n cpr info: ",paste(reg2,collapse=", "), + "\n spatial header info: ", paste(reg1,collapse=", ")) + } + + + j <- 0; cells <- NULL + for(i in 1:length(cpr)) { + cells <- c(cells,paste(names(cpr)[i],"_",j+1,"*",names(cpr)[i],"_",j+cpr[i],sep="")) + j <- j+cpr[i] + } + + .tmp <- function(x,prefix="", suffix1="", suffix2=" /", collapse=",", n=10) { + content <- NULL + tmp <- lapply(split(x, ceiling(seq_along(x)/n)),paste,collapse=collapse) + end <- suffix1 + for(i in 1:length(tmp)) { + if(i==length(tmp)) end <- suffix2 + content <- c(content,paste0(' ',prefix,tmp[[i]],end)) + } + return(content) + } + + subject <- 'SETS' + modification_warning <- c( + '*THIS CODE IS CREATED AUTOMATICALLY, DO NOT MODIFY THESE LINES DIRECTLY', + '*ANY DIRECT MODIFICATION WILL BE LOST AFTER NEXT INPUT DOWNLOAD', + '*CHANGES CAN BE DONE USING THE INPUT DOWNLOADER UNDER SCRIPTS/DOWNLOAD', + '*THERE YOU CAN ALSO FIND ADDITIONAL INFORMATION') + content <- c(modification_warning,'','sets','') + + content <- c(content,paste(' i World regions /',paste(names(cpr),collapse=','),'/',sep=''),'') + + # write iso set with nice formatting (10 countries per line) + tmp <- lapply(split(map$CountryCode, ceiling(seq_along(map$CountryCode)/10)),paste,collapse=",") + content <- c(content,' iso Countries /') + content <- c(content, .tmp(map$CountryCode, suffix1=",", suffix2=" /")) + + content <- c(content, '', paste(' j Spatial clusters /\n ',paste(cells,collapse=',\n '),'/',sep=''),'', + ' cell(i,j) Mapping between regions i and clusters j',' /') + for(i in 1:length(cpr)) { + content <- c(content,paste(' ',names(cpr)[i],' . ',cells[i],sep='')) + } + content <- c(content,' /','') + + content <- c(content,' i_to_iso(i,iso) Mapping between regions and countries',' /') + map$RegionCode <- as.factor(map$RegionCode) + for(i in levels(map$RegionCode)) { + content <- c(content, .tmp(map$CountryCode[map$RegionCode==i], prefix=paste0(i," . ("), suffix1=")", suffix2=")")) + + } + content <- c(content,' /',';') + replace_in_file("core/sets.gms",content,subject) +} +################################################################################ + +################################################################################ +#Define routine to update info file in input folder and info in main.gms +################################################################################ +update_info <- function(datasets, low_res, high_res, cpr, + regionscode, reg_revision, warnings=NULL) { + require(lucode) + info <- readLines('input/info.txt') + subject <- 'VERSION INFO' + + useddata <- NULL + for(dataset in rownames(datasets)) { + useddata <- c(useddata, + '', + paste('Used data set:',dataset), + paste('md5sum:',datasets[dataset,"md5"]), + paste('Repository:',datasets[dataset,"repo"])) + } + + warnings <- attr(datasets,"warnings") + if(!is.null(warnings)) { + warnings <- capture.output(warnings) + } + + content <- c(useddata, + '', + paste('Low resolution:',low_res), + paste('High resolution:',high_res), + '', + paste('Total number of cells:',sum(cpr)), + '', + 'Number of cells per region:', + paste(format(names(cpr),width=5,justify="right"),collapse=""), + paste(format(cpr,width=5),collapse=""), + '', + paste('Regionscode:',regionscode), + '', + paste('Regions data revision:',reg_revision), + '', + info, + '', + warnings, + '', + paste('Last modification (input data):',date()), + '') + writeLines(content,'input/info.txt') + replace_in_file("main.gms",paste('*',content),subject) +} +################################################################################ + +################################################################################ +#Function to extract information from info.txt +################################################################################ +get_info <- function(file,grep_expression,sep,pattern="",replacement="") { + if(!file.exists(file)) stop("info.txt file is missing with required information about the input") + file <- readLines(file) + tmp <- grep(grep_expression,file, value=TRUE) + tmp <- strsplit(tmp, sep) + tmp <- sapply(tmp, "[[", 2) + tmp <- gsub(pattern,replacement,tmp) + if(length(tmp)==0) stop(grep_expression," could not be found!") + return(tmp) +} +################################################################################ + + +archive_download <- function(files=c("GLUES2-sresa2-constant_co2-miub_echo_g_ERB_rev22.1_n200_690d3718e151be1b450b394c1064b1c5.tgz", + "690d3718e151be1b450b394c1064b1c5_magpie_rev2.499.tgz"), + repositories=list("/p/projects/landuse/data/input/raw_data"=NULL, + "/p/projects/rd3mod/inputdata/output"=NULL), + modelfolder=".", + debug=FALSE) { + + require(lucode) + require(magclass) + warnings <- NULL + + cdir <- getwd() + setwd(modelfolder) + on.exit(setwd(cdir)) + + ################## GENERAL CLEAN UP ################################### + # delete old input files to avoid mixed inputs in the case that data + # download fails at some point + file2destination <- getfiledestinations() + + cat("\nDelete old data in input folders ... ") + # delete files which will be copied/moved later on with copy_input + delete_olddata(file2destination) + # delete additional files not treated by copy_input + delete_olddata("scripts/downloader/inputdelete.cfg") + cat("done!\n\n") + + ##################### DATA DOWNLOAD ######################################### + # load data from source and unpack it + filemap <- lucode::download_unpack(input=files, targetdir="input", repositories=repositories, debug=FALSE) + + low_res <- get_info("input/info.txt","^\\* Output ?resolution:",": ") + high_res <- get_info("input/info.txt","^\\* Input ?resolution:",": ") + + ################## COPY MAGPIE INPUT FILES ################################### + # In the following input files in MAgPIE format are converted (if required) to + # csX files and copied into the corresponding input folders. In this step also + # the resolution information in the file name (if existing) is removed to + # allow a resolution-indepedent gams-sourcecode. + + copy_input(file2destination, "input", low_res, !debug) + + + ###################### MANIPULATE GAMS FILES ################################### + # In the following the GAMS sourcecode files magpie.gms and core/sets.gms + # are manipulated. Therefore some information about the number of cells per + # region is required (CPR). This information is gained by extracting it from + # the avl_land.cs3 input file (any other cellular file could be used as well). + # This information is then transfered to update_info, which is + # updating the general information in magpie.gms and input/info.txt + # and update_sets, which is updating the resolution- and region-depending + # sets in core/sets.gms + + tmp <- read.magpie("modules/10_land/input/avl_land_t.cs3") + cpr <- getCPR(tmp) + # read spatial_header, map, reg_revision and regionscode + load("input/spatial_header.rda") + update_info(filemap,low_res,high_res,cpr,regionscode,reg_revision, warnings) + update_sets(cpr,map) +} diff --git a/scripts/downloader/inputdelete.cfg b/scripts/downloader/inputdelete.cfg index 5766c7f0a7..e0eb563209 100644 --- a/scripts/downloader/inputdelete.cfg +++ b/scripts/downloader/inputdelete.cfg @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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 file;destination *-to-*_*.spam;input diff --git a/scripts/insertheader/insertheader.R b/scripts/insertheader/insertheader.R index f890873b81..babe69434b 100644 --- a/scripts/insertheader/insertheader.R +++ b/scripts/insertheader/insertheader.R @@ -1,17 +1,22 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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 -insertheader <- function(maindir=".", - header=c("(C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK),", - "authors, and contributors see AUTHORS file", - "This file is part of MAgPIE and licensed under GNU AGPL Version 3", - "or later. See LICENSE file or go to http://www.gnu.org/licenses/", - "Contact: magpie@pik-potsdam.de"), +insertheader <- function(maindir=".", + header=c("(C) 2008-2019 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"), donottouch=c("AUTHORS","README","LICENSE",".lhd",".mz",".rda",".opt", - ".spam",".xlsx",".sh","files",".md",".RData"), + ".spam",".xlsx",".sh","files",".md",".RData", ".jpg", + ".png",".cff", ".rds", ".aux", ".log", ".out", ".pdf", + ".tex", ".htm", ".css", ".bib", ".ref", ".mif", ".gdx", + ".lst", ".git-id", ".csv", ".Rdata"), comments=c(".R"="#",".gms"="***",".cfg"="#",".csv"="*",".cs2"="*", ".cs3"="*",".cs4"="*",".sh"="#",".txt"="#"), line_endings="notwin", @@ -19,7 +24,7 @@ insertheader <- function(maindir=".", oldkey = NULL, test_only=FALSE) { - + .findheader <- function(f,key){ .escape <- function(x) return(gsub("([.|()\\^{}+$*?]|\\[|\\])", "\\\\\\1", x)) return(grep(paste0("^",.escape(key)," "),f)) @@ -34,7 +39,7 @@ insertheader <- function(maindir=".", setwd(maindir) if(is.null(oldkey)) oldkey <- key - + # create list of all files recursively files <- list.files(recursive = TRUE) @@ -48,21 +53,21 @@ insertheader <- function(maindir=".", for (file in files) { writefile <- FALSE - + ext <- .getExtension(file) co <- comments[ext] - + # Ommit files that are in the "donottouch" list if (ext %in% donottouch) { forbidden <- c(forbidden,file) next } - + if(is.na(co)) { warning("Unknown extension ",ext) next } - + cat("Checking",file,"\n") f <- readLines(file) @@ -73,9 +78,9 @@ insertheader <- function(maindir=".", writefile <- TRUE removed <- c(removed,file) } - + if(length(grep("^$",f,invert=TRUE))==0) warning("Empty file: ",file ,call. = FALSE) - + # insert header after line 0 withcomment <- paste(co,key,header) f <- append(f,withcomment,after = 0) @@ -85,7 +90,7 @@ insertheader <- function(maindir=".", # Write file only if it was modified if (writefile & !test_only) { if (line_endings == "win") { - writeLinesDOS(f,file) + lucode:::writeLinesDOS(f,file) } else { writeLines(f,file) } diff --git a/scripts/npi_ndc/start_npi_ndc.R b/scripts/npi_ndc/start_npi_ndc.R index 42aedc0d4b..fd6f07dace 100755 --- a/scripts/npi_ndc/start_npi_ndc.R +++ b/scripts/npi_ndc/start_npi_ndc.R @@ -1,271 +1,277 @@ -## Functions for the policy targets calculations - -get_info <- function(file, grep_expression, sep, pattern="", replacement=""){ - if(!file.exists(file)) return("#MISSING#") - file <- readLines(file, warn=FALSE) - tmp <- grep(grep_expression, file, value=TRUE) - tmp <- strsplit(tmp, sep) - tmp <- sapply(tmp, "[[", 2) - tmp <- gsub(pattern, replacement ,tmp) - if(all(!is.na(as.logical(tmp)))) return(as.vector(sapply(tmp, as.logical))) - if (all(!(regexpr("[a-zA-Z]",tmp) > 0))){ - tmp <- as.numeric(tmp) - } - return(tmp) -} - -## calculates policy for protecting different land pools from land use change -calc_NPI_NDC <- function(policyregions="iso"){ - - require(magclass) - require(luscale) - require(lucode) - - # load the cell mapping policy - pol_mapping <- readRDS("policies/country2cell.rds")[,policyregions] - - ############################################################################## - ########## Information from the reference observed data ########### - ############################################################################## - - #read in cellular land cover (stock) from landuse initialization - land_stock <- read.magpie("../../modules/10_land/input/avl_land_t_0.5.mz") - getRegions(land_stock) <- paste(pol_mapping,1:59199,sep=".") - - forest_stock <- dimSums(land_stock[,,c("primforest","secdforest","forestry")], dim=3) - getNames(forest_stock) <- "forest" - - ############################################################################## - ########## Structure of policy .csv files ############## - ############################################################################## - # "landpool" #Land pool policy type: forest, other, affore - # "policy" #Policy exists: npi, ndc - # "targettype" #Policy target type: 1 baseyear (e.g. 2005), 2 baseline - # "baseyear" #Baseyear (target type 1) / starting year (target type 2) for policy calculation - # "targetyear" #Year by which policy_target is achieved (e.g. 2020 or 2030) - # "target" #Policy target value in % (e.g. allowed deforestation in % in targetyear; afforestation in Mha in case of affore=TRUE) - ############################################################################## - - - # output file for formated writing of the npi/ndc policies - fname <- "npi_ndc_overview.txt" - if(file.exists(fname)) unlink(fname, force=TRUE) - file.create(fname) - # quick way of writing in the file line by line - addline <- function(x){ - cat(paste(x,"\n"), file=fname, append=TRUE) - } - addtable <- function(x){ - capture.output(print(x, print.gap=3, row.names=FALSE), file=fname, append=TRUE) - } - - pol_def <- read.csv("policies/policy_definitions.csv") - - addline("NPI/NDC policies") - addline("MAgPIE") - addline(date()) - - addline("") - addline("##----------------------------------------------------------------------------") - addline("## Avoiding Deforestation - AD (%)") - addline("## percentage protection: 0 = no protection, 1 = full protection") - addline("## Ref: BaseYear (1), Baseline (2)") - - cat("NPI AD policy\n") - addline("") - addline("##############") - addline("### NPI AD ###") - addline("##############") - npi_ad <- droplevels(subset(pol_def, policy=="npi" & landpool=="forest")) - addtable(npi_ad[,c(-2,-3)]) - npi_ad <- calc_policy(npi_ad,forest_stock,pol_type="ad",pol_mapping=pol_mapping) - getNames(npi_ad) <- "npi.forest" - - cat("NDC AD policy\n") - addline("") - addline("##############") - addline("### NDC AD ###") - addline("##############") - ndc_ad <- droplevels(subset(pol_def, policy=="ndc" & landpool=="forest")) - addtable(ndc_ad[,c(-2,-3)]) - ndc_ad <- calc_policy(ndc_ad,forest_stock,pol_type="ad",pol_mapping=pol_mapping) - getNames(ndc_ad) <- "ndc.forest" - #Set all values before 2015 to NPI values; copy the values til 2010 from the NPI data - ndc_ad[,which(getYears(ndc_ad,as.integer=TRUE)<=2020),] <- - npi_ad[,which(getYears(npi_ad,as.integer=TRUE)<=2020),] - - - addline("") - addline("##----------------------------------------------------------------------------") - addline("## Avoiding Other Land Conversion - AOLC (%)") - addline("## percentage protection: 0 = no protection, 1 = full protection") - addline("## Ref: BaseYear (1), Baseline (2)") - - cat("NPI AOLC policy\n") - addline("") - addline("################") - addline("### NPI AOLC ###") - addline("################") - npi_aolc <- droplevels(subset(pol_def, policy=="npi" & landpool=="other")) - addtable(npi_aolc[,c(-2,-3)]) - npi_aolc <- calc_policy(npi_aolc,land_stock[,,"other"],pol_type="ad",pol_mapping=pol_mapping) - getNames(npi_aolc) <- "npi.other" - - cat("NDC AOLC policy\n") - addline("") - addline("################") - addline("### NDC AOLC ###") - addline("################") - ndc_aolc <- droplevels(subset(pol_def, policy=="ndc" & landpool=="other")) - addtable(ndc_aolc[,c(-2,-3)]) - ndc_aolc <- calc_policy(ndc_aolc,land_stock[,,"other"],pol_type="ad",pol_mapping=pol_mapping) - getNames(ndc_aolc) <- "ndc.other" - #Set all values before 2015 to NPI values; copy the values til 2010 from the NPI data - ndc_aolc[,which(getYears(ndc_aolc,as.integer=TRUE)<=2020),] <- - npi_aolc[,which(getYears(npi_aolc,as.integer=TRUE)<=2020),] - - #write AD and AOLC policies together - none_ad_aolc_pol <- mbind(npi_ad,npi_aolc) - none_ad_aolc_pol[] <- 0 - getNames(none_ad_aolc_pol) <- c("none.forest","none.other") - ad_aolc_pol <- mbind(none_ad_aolc_pol,npi_ad,npi_aolc,ndc_ad,ndc_aolc) - write.magpie(ad_aolc_pol, "policies/npi_ndc_ad_aolc_pol.cs3") - - addline("") - addline("##----------------------------------------------------------------------------") - addline("## Afforestation - AFF (Mha)") - addline("## Ref: BaseYear (1), Baseline (2)") - - cat("NPI AFF policy\n") - addline("") - addline("###############") - addline("### NPI AFF ###") - addline("###############") - npi_aff <- droplevels(subset(pol_def, policy=="npi" & landpool=="affore")) - addtable(npi_aff[,c(-2,-3)]) - npi_aff <- calc_policy(npi_aff,land_stock,pol_type="aff",pol_mapping=pol_mapping, - weight=dimSums(land_stock[,2005,c("crop","past")])) - getNames(npi_aff) <- "npi" - - cat("NDC AFF policy\n") - addline("") - addline("###############") - addline("### NDC AFF ###") - addline("###############") - ndc_aff <- droplevels(subset(pol_def, policy=="ndc" & landpool=="affore")) - addtable(ndc_aff[,c(-2,-3)]) - ndc_aff <- calc_policy(ndc_aff,land_stock,pol_type="aff",pol_mapping=pol_mapping, - weight=dimSums(land_stock[,2005,c("crop","past")])) - getNames(ndc_aff) <- "ndc" - #set all values before 2015 to NPI values; copy the values til 2010 from the NPI data - ndc_aff[,which(getYears(ndc_aff,as.integer=TRUE)<=2020),] <- - npi_aff[,which(getYears(npi_aff,as.integer=TRUE)<=2020),] - - #write AFF policies - none_aff_pol <- npi_aff - none_aff_pol[] <- 0 - getNames(none_aff_pol) <- "none" - aff_pol <- mbind(none_aff_pol,npi_aff,ndc_aff) - write.magpie(aff_pol, "policies/npi_ndc_aff_pol.cs3") - - #copy files - file.copy("policies/npi_ndc_ad_aolc_pol.cs3", - "../../modules/35_natveg/input/npi_ndc_ad_aolc_pol.cs3",overwrite = TRUE) - file.copy("policies/npi_ndc_aff_pol.cs3", - "../../modules/32_forestry/input/npi_ndc_aff_pol.cs3",overwrite = TRUE) -} - -### calc flow function -calc_flows <- function(stock,t_periods) { - flow <- stock - flow[,,] <- 0 - for (y in 2:nyears(stock)) { - flow[,y,] <- (setYears(stock[,y-1,],NULL) - stock[,y,])/t_periods[y] - } - return(flow) -} - -### calc npi & ndc policy -calc_policy <- function(policy,stock,pol_type="aff",pol_mapping, weight=NULL) { - ## pol_type = {"aff","ad"} - - #extent stock beyond last observed value with constant values from the last year - ly <- tail(getYears(stock,as.integer=TRUE),1) - ly <- ly - ly%%5 - stock <- stock[,seq(1995,ly,5),] - stock_extent <- new.magpie(getCells(stock), seq(ly+5,2150,5), - getNames(stock), stock[,ly,]) - stock <- mbind(stock, stock_extent) - rm(stock_extent) - - #the the years and periods - tp <- getYears(stock, as.integer=TRUE) - t_periods <- c(1, sapply(seq_along(tp[-1]), function(i) tp[i+1] - tp[i])) - - #select and filter countries that exist in the chosen policy mapping - policy_countries <- intersect(policy$dummy,unique(pol_mapping)) - - #set stock to zero or Inf for countries without policies - # (representing no constraint for min and max constraints) - if(pol_type=="ad"){ - stock[setdiff(getRegions(stock),policy_countries),,] <- 0 - #calculate flows - flow <- calc_flows(stock,t_periods) - #account only for positive flows - flow[flow < 0] <- 0 - } - - #Initialize magpie_policy with 0 (country level) - #This is a return object of this function and contains policy targets at - #cluster level - magpie_policy <- new.magpie(unique(pol_mapping),tp,NULL,0) - for (i in policy_countries) { - cat(i,round(which(policy_countries==i)/length(policy_countries)*100),"%\n") - #get baseyear and targetyear - baseyear <- policy[which(policy$dummy==i),"baseyear"] - targetyear <- policy[which(policy$dummy==i),"targetyear"] - y_pol <- tp[tp>= baseyear & tp<=targetyear] - y_pol_forever <- tp[tp>= targetyear] - - #set target in targetyear - #percentage: 0 = no reduction, 1 = full reduction of deforestation - #Mha if pol_type=="aff" - magpie_policy[i,targetyear,] <- policy[which(policy$dummy==i),"target"] - #interpolate between baseyear and targetyear - magpie_policy[i,y_pol,] <- time_interpolate(magpie_policy[i,c(baseyear,targetyear),],y_pol) - #set same target for all years after targetyear - magpie_policy[i,y_pol_forever,] <- setYears(magpie_policy[i,targetyear,],NULL) - #get target type - targettype <- policy[which(policy$dummy==i),"targettype"] #1 baseyear target #2 baseline target - - #set reference flow based on target type - if(pol_type=="ad") { - stock[i,tp>targetyear,] <- setYears(stock[i,targetyear,],NULL) - ref_flow <- new.magpie(getCells(stock),getYears(stock),NULL,0) - if (targettype == 1) { - ref_flow[i,,] <- setYears(flow[i,baseyear,],NULL) - } else if (targettype == 2) { - ref_flow[i,,] <- flow[i,,] - } else stop("unknow targettype; needs to be 1 or 2") - } - } - - #calculate the reduction target in absolute numbers - rel <- data.frame(from=pol_mapping,to=paste(pol_mapping,1:length(pol_mapping),sep=".")) - if(pol_type=="aff") { - magpie_policy <- speed_aggregate(x=magpie_policy, rel=rel, weight=weight) - } else if(pol_type=="ad") { - magpie_policy <- speed_aggregate(x=magpie_policy, rel=rel) - magpie_policy <- magpie_policy * ref_flow * t_periods + stock - } - - load("../../input/spatial_header.rda") - getCells(magpie_policy) <- spatial_header - - res_out <- get_info("../../input/info.txt","^\\* Output ?resolution:",": ") - res_high <- get_info("../../input/info.txt","^\\* Input ?resolution:",": ") - spam_file <- path("../../input",paste0(res_high,"-to-",res_out,"_sum.spam")) - magpie_policy <- speed_aggregate(magpie_policy,spam_file) - - return(magpie_policy) -} +# | (C) 2008-2019 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 +## Functions for the policy targets calculations + +get_info <- function(file, grep_expression, sep, pattern="", replacement=""){ + if(!file.exists(file)) return("#MISSING#") + file <- readLines(file, warn=FALSE) + tmp <- grep(grep_expression, file, value=TRUE) + tmp <- strsplit(tmp, sep) + tmp <- sapply(tmp, "[[", 2) + tmp <- gsub(pattern, replacement ,tmp) + if(all(!is.na(as.logical(tmp)))) return(as.vector(sapply(tmp, as.logical))) + if (all(!(regexpr("[a-zA-Z]",tmp) > 0))){ + tmp <- as.numeric(tmp) + } + return(tmp) +} + +## calculates policy for protecting different land pools from land use change +calc_NPI_NDC <- function(policyregions="iso"){ + + require(magclass) + require(luscale) + require(lucode) + + # load the cell mapping policy + pol_mapping <- readRDS("policies/country2cell.rds")[,policyregions] + + ############################################################################## + ########## Information from the reference observed data ########### + ############################################################################## + + #read in cellular land cover (stock) from landuse initialization + land_stock <- read.magpie("../../modules/10_land/input/avl_land_t_0.5.mz") + getRegions(land_stock) <- paste(pol_mapping,1:59199,sep=".") + + forest_stock <- dimSums(land_stock[,,c("primforest","secdforest","forestry")], dim=3) + getNames(forest_stock) <- "forest" + + ############################################################################## + ########## Structure of policy .csv files ############## + ############################################################################## + # "landpool" #Land pool policy type: forest, other, affore + # "policy" #Policy exists: npi, ndc + # "targettype" #Policy target type: 1 baseyear (e.g. 2005), 2 baseline + # "baseyear" #Baseyear (target type 1) / starting year (target type 2) for policy calculation + # "targetyear" #Year by which policy_target is achieved (e.g. 2020 or 2030) + # "target" #Policy target value in % (e.g. allowed deforestation in % in targetyear; afforestation in Mha in case of affore=TRUE) + ############################################################################## + + + # output file for formated writing of the npi/ndc policies + fname <- "npi_ndc_overview.txt" + if(file.exists(fname)) unlink(fname, force=TRUE) + file.create(fname) + # quick way of writing in the file line by line + addline <- function(x){ + cat(paste(x,"\n"), file=fname, append=TRUE) + } + addtable <- function(x){ + capture.output(print(x, print.gap=3, row.names=FALSE), file=fname, append=TRUE) + } + + pol_def <- read.csv("policies/policy_definitions.csv") + + addline("NPI/NDC policies") + addline("MAgPIE") + addline(date()) + + addline("") + addline("##----------------------------------------------------------------------------") + addline("## Avoiding Deforestation - AD (%)") + addline("## percentage protection: 0 = no protection, 1 = full protection") + addline("## Ref: BaseYear (1), Baseline (2)") + + cat("NPI AD policy\n") + addline("") + addline("##############") + addline("### NPI AD ###") + addline("##############") + npi_ad <- droplevels(subset(pol_def, policy=="npi" & landpool=="forest")) + addtable(npi_ad[,c(-2,-3)]) + npi_ad <- calc_policy(npi_ad,forest_stock,pol_type="ad",pol_mapping=pol_mapping) + getNames(npi_ad) <- "npi.forest" + + cat("NDC AD policy\n") + addline("") + addline("##############") + addline("### NDC AD ###") + addline("##############") + ndc_ad <- droplevels(subset(pol_def, policy=="ndc" & landpool=="forest")) + addtable(ndc_ad[,c(-2,-3)]) + ndc_ad <- calc_policy(ndc_ad,forest_stock,pol_type="ad",pol_mapping=pol_mapping) + getNames(ndc_ad) <- "ndc.forest" + #Set all values before 2015 to NPI values; copy the values til 2010 from the NPI data + ndc_ad[,which(getYears(ndc_ad,as.integer=TRUE)<=2020),] <- + npi_ad[,which(getYears(npi_ad,as.integer=TRUE)<=2020),] + + + addline("") + addline("##----------------------------------------------------------------------------") + addline("## Avoiding Other Land Conversion - AOLC (%)") + addline("## percentage protection: 0 = no protection, 1 = full protection") + addline("## Ref: BaseYear (1), Baseline (2)") + + cat("NPI AOLC policy\n") + addline("") + addline("################") + addline("### NPI AOLC ###") + addline("################") + npi_aolc <- droplevels(subset(pol_def, policy=="npi" & landpool=="other")) + addtable(npi_aolc[,c(-2,-3)]) + npi_aolc <- calc_policy(npi_aolc,land_stock[,,"other"],pol_type="ad",pol_mapping=pol_mapping) + getNames(npi_aolc) <- "npi.other" + + cat("NDC AOLC policy\n") + addline("") + addline("################") + addline("### NDC AOLC ###") + addline("################") + ndc_aolc <- droplevels(subset(pol_def, policy=="ndc" & landpool=="other")) + addtable(ndc_aolc[,c(-2,-3)]) + ndc_aolc <- calc_policy(ndc_aolc,land_stock[,,"other"],pol_type="ad",pol_mapping=pol_mapping) + getNames(ndc_aolc) <- "ndc.other" + #Set all values before 2015 to NPI values; copy the values til 2010 from the NPI data + ndc_aolc[,which(getYears(ndc_aolc,as.integer=TRUE)<=2020),] <- + npi_aolc[,which(getYears(npi_aolc,as.integer=TRUE)<=2020),] + + #write AD and AOLC policies together + none_ad_aolc_pol <- mbind(npi_ad,npi_aolc) + none_ad_aolc_pol[] <- 0 + getNames(none_ad_aolc_pol) <- c("none.forest","none.other") + ad_aolc_pol <- mbind(none_ad_aolc_pol,npi_ad,npi_aolc,ndc_ad,ndc_aolc) + write.magpie(ad_aolc_pol, "policies/npi_ndc_ad_aolc_pol.cs3") + + addline("") + addline("##----------------------------------------------------------------------------") + addline("## Afforestation - AFF (Mha)") + addline("## Ref: BaseYear (1), Baseline (2)") + + cat("NPI AFF policy\n") + addline("") + addline("###############") + addline("### NPI AFF ###") + addline("###############") + npi_aff <- droplevels(subset(pol_def, policy=="npi" & landpool=="affore")) + addtable(npi_aff[,c(-2,-3)]) + npi_aff <- calc_policy(npi_aff,land_stock,pol_type="aff",pol_mapping=pol_mapping, + weight=dimSums(land_stock[,2005,c("crop","past")])) + getNames(npi_aff) <- "npi" + + cat("NDC AFF policy\n") + addline("") + addline("###############") + addline("### NDC AFF ###") + addline("###############") + ndc_aff <- droplevels(subset(pol_def, policy=="ndc" & landpool=="affore")) + addtable(ndc_aff[,c(-2,-3)]) + ndc_aff <- calc_policy(ndc_aff,land_stock,pol_type="aff",pol_mapping=pol_mapping, + weight=dimSums(land_stock[,2005,c("crop","past")])) + getNames(ndc_aff) <- "ndc" + #set all values before 2015 to NPI values; copy the values til 2010 from the NPI data + ndc_aff[,which(getYears(ndc_aff,as.integer=TRUE)<=2020),] <- + npi_aff[,which(getYears(npi_aff,as.integer=TRUE)<=2020),] + + #write AFF policies + none_aff_pol <- npi_aff + none_aff_pol[] <- 0 + getNames(none_aff_pol) <- "none" + aff_pol <- mbind(none_aff_pol,npi_aff,ndc_aff) + write.magpie(aff_pol, "policies/npi_ndc_aff_pol.cs3") + + #copy files + file.copy("policies/npi_ndc_ad_aolc_pol.cs3", + "../../modules/35_natveg/input/npi_ndc_ad_aolc_pol.cs3",overwrite = TRUE) + file.copy("policies/npi_ndc_aff_pol.cs3", + "../../modules/32_forestry/input/npi_ndc_aff_pol.cs3",overwrite = TRUE) +} + +### calc flow function +calc_flows <- function(stock,t_periods) { + flow <- stock + flow[,,] <- 0 + for (y in 2:nyears(stock)) { + flow[,y,] <- (setYears(stock[,y-1,],NULL) - stock[,y,])/t_periods[y] + } + return(flow) +} + +### calc npi & ndc policy +calc_policy <- function(policy,stock,pol_type="aff",pol_mapping, weight=NULL) { + ## pol_type = {"aff","ad"} + + #extent stock beyond last observed value with constant values from the last year + ly <- tail(getYears(stock,as.integer=TRUE),1) + ly <- ly - ly%%5 + stock <- stock[,seq(1995,ly,5),] + stock_extent <- new.magpie(getCells(stock), seq(ly+5,2150,5), + getNames(stock), stock[,ly,]) + stock <- mbind(stock, stock_extent) + rm(stock_extent) + + #the the years and periods + tp <- getYears(stock, as.integer=TRUE) + t_periods <- c(1, sapply(seq_along(tp[-1]), function(i) tp[i+1] - tp[i])) + + #select and filter countries that exist in the chosen policy mapping + policy_countries <- intersect(policy$dummy,unique(pol_mapping)) + + #set stock to zero or Inf for countries without policies + # (representing no constraint for min and max constraints) + if(pol_type=="ad"){ + stock[setdiff(getRegions(stock),policy_countries),,] <- 0 + #calculate flows + flow <- calc_flows(stock,t_periods) + #account only for positive flows + flow[flow < 0] <- 0 + } + + #Initialize magpie_policy with 0 (country level) + #This is a return object of this function and contains policy targets at + #cluster level + magpie_policy <- new.magpie(unique(pol_mapping),tp,NULL,0) + for (i in policy_countries) { + cat(i,round(which(policy_countries==i)/length(policy_countries)*100),"%\n") + #get baseyear and targetyear + baseyear <- policy[which(policy$dummy==i),"baseyear"] + targetyear <- policy[which(policy$dummy==i),"targetyear"] + y_pol <- tp[tp>= baseyear & tp<=targetyear] + y_pol_forever <- tp[tp>= targetyear] + + #set target in targetyear + #percentage: 0 = no reduction, 1 = full reduction of deforestation + #Mha if pol_type=="aff" + magpie_policy[i,targetyear,] <- policy[which(policy$dummy==i),"target"] + #interpolate between baseyear and targetyear + magpie_policy[i,y_pol,] <- time_interpolate(magpie_policy[i,c(baseyear,targetyear),],y_pol) + #set same target for all years after targetyear + magpie_policy[i,y_pol_forever,] <- setYears(magpie_policy[i,targetyear,],NULL) + #get target type + targettype <- policy[which(policy$dummy==i),"targettype"] #1 baseyear target #2 baseline target + + #set reference flow based on target type + if(pol_type=="ad") { + stock[i,tp>targetyear,] <- setYears(stock[i,targetyear,],NULL) + ref_flow <- new.magpie(getCells(stock),getYears(stock),NULL,0) + if (targettype == 1) { + ref_flow[i,,] <- setYears(flow[i,baseyear,],NULL) + } else if (targettype == 2) { + ref_flow[i,,] <- flow[i,,] + } else stop("unknow targettype; needs to be 1 or 2") + } + } + + #calculate the reduction target in absolute numbers + rel <- data.frame(from=pol_mapping,to=paste(pol_mapping,1:length(pol_mapping),sep=".")) + if(pol_type=="aff") { + magpie_policy <- speed_aggregate(x=magpie_policy, rel=rel, weight=weight) + } else if(pol_type=="ad") { + magpie_policy <- speed_aggregate(x=magpie_policy, rel=rel) + magpie_policy <- magpie_policy * ref_flow * t_periods + stock + } + + load("../../input/spatial_header.rda") + getCells(magpie_policy) <- spatial_header + + res_out <- get_info("../../input/info.txt","^\\* Output ?resolution:",": ") + res_high <- get_info("../../input/info.txt","^\\* Input ?resolution:",": ") + spam_file <- path("../../input",paste0(res_high,"-to-",res_out,"_sum.spam")) + magpie_policy <- speed_aggregate(magpie_policy,spam_file) + + return(magpie_policy) +} diff --git a/scripts/output/comparison/forestmaps.R b/scripts/output/comparison/forestmaps.R index 4c97ccab4b..86c9eb71be 100644 --- a/scripts/output/comparison/forestmaps.R +++ b/scripts/output/comparison/forestmaps.R @@ -1,8 +1,9 @@ -# (C) 2008-2017 Potsdam Institute for Climate Impact Research (PIK), -# authors, and contributors see AUTHORS file -# This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# Contact: magpie@pik-potsdam.de +# | (C) 2008-2019 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 ######################### #### check modelstat #### diff --git a/scripts/output/comparison/merge_report.R b/scripts/output/comparison/merge_report.R index 2c1b9d25bb..9b1c7baa1e 100644 --- a/scripts/output/comparison/merge_report.R +++ b/scripts/output/comparison/merge_report.R @@ -1,8 +1,10 @@ -# (C) 2008-2017 Potsdam Institute for Climate Impact Research (PIK), -# authors, and contributors see AUTHORS file -# This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# Contact: magpie@pik-potsdam.de +# | (C) 2008-2019 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 + ######################### #### check modelstat #### @@ -48,4 +50,4 @@ if (!is.null(missing)) { print(missing) } -if(file.exists("output/report_comp.csv")) saveRDS(read.quitte("output/report_comp.csv"),file = "output/report_comp.rds") \ No newline at end of file +if(file.exists("output/report_comp.csv")) saveRDS(read.quitte("output/report_comp.csv"),file = "output/report_comp.rds") diff --git a/scripts/output/comparison/modelstat.R b/scripts/output/comparison/modelstat.R index 5b5a8113f1..ae07775ede 100644 --- a/scripts/output/comparison/modelstat.R +++ b/scripts/output/comparison/modelstat.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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/scripts/output/comparison/resubmit.R b/scripts/output/comparison/resubmit.R index 2c5670ec70..e168cff8fb 100644 --- a/scripts/output/comparison/resubmit.R +++ b/scripts/output/comparison/resubmit.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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/scripts/output/comparison/runtime.R b/scripts/output/comparison/runtime.R index eb4086b086..9d7e231b5e 100644 --- a/scripts/output/comparison/runtime.R +++ b/scripts/output/comparison/runtime.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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 ############################# LOAD LIBRARIES ############################# diff --git a/scripts/output/comparison/validation.R b/scripts/output/comparison/validation.R index 42540f6b61..dbb3f8b368 100644 --- a/scripts/output/comparison/validation.R +++ b/scripts/output/comparison/validation.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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 library(mip) diff --git a/scripts/output/single/ForestMaps.R b/scripts/output/single/ForestMaps.R index f7cc1542a5..b57f0ca939 100644 --- a/scripts/output/single/ForestMaps.R +++ b/scripts/output/single/ForestMaps.R @@ -1,8 +1,9 @@ -# (C) 2008-2017 Potsdam Institute for Climate Impact Research (PIK), -# authors, and contributors see AUTHORS file -# This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# Contact: magpie@pik-potsdam.de +# | (C) 2008-2019 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 library(magclass) library(luplot) diff --git a/scripts/output/single/LandusePlots.R b/scripts/output/single/LandusePlots.R index 396cfa2707..7fcb458158 100644 --- a/scripts/output/single/LandusePlots.R +++ b/scripts/output/single/LandusePlots.R @@ -1,8 +1,9 @@ -# (C) 2008-2017 Potsdam Institute for Climate Impact Research (PIK), -# authors, and contributors see AUTHORS file -# This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# Contact: magpie@pik-potsdam.de +# | (C) 2008-2019 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 library(magpie4) library(magpiesets) @@ -45,7 +46,7 @@ for (i in LU) { modout_landuse[,j,i], title = paste0(i),legend_breaks = breakpoints, lowcol = "white",midcol = "red",highcol = "green", legendname = "m ha", - legend_range = c(0,0.3),land_colour = "grey",sea=F) + legend_range = c(0,0.3),land_colour = "grey",sea=F) } else { swlatex(sw,"This functionality requires the package luplot to be loaded. Send an email to magpie[at]pik-potsdam.de for more details.") break diff --git a/scripts/output/single/coupling_report.R b/scripts/output/single/coupling_report.R index ef0b08003b..6ae55edded 100644 --- a/scripts/output/single/coupling_report.R +++ b/scripts/output/single/coupling_report.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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/scripts/output/single/demandtest.R b/scripts/output/single/demandtest.R index 7bcb8b06ec..41bb91ba27 100644 --- a/scripts/output/single/demandtest.R +++ b/scripts/output/single/demandtest.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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/scripts/output/single/emulator.R b/scripts/output/single/emulator.R index c4ea24f8fb..84db0554e1 100644 --- a/scripts/output/single/emulator.R +++ b/scripts/output/single/emulator.R @@ -1,3 +1,9 @@ +# | (C) 2008-2019 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 library(magclass) library(lucode) library(lusweave) @@ -193,4 +199,4 @@ collect_data_and_make_emulator <- function(outputdir,name_of_fit="linear") { readArgs("outputdir") } -collect_data_and_make_emulator(outputdir,name_of_fit="linear") \ No newline at end of file +collect_data_and_make_emulator(outputdir,name_of_fit="linear") diff --git a/scripts/output/single/interpolation.R b/scripts/output/single/interpolation.R index 92da8f0c86..5515008b24 100644 --- a/scripts/output/single/interpolation.R +++ b/scripts/output/single/interpolation.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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/scripts/output/single/interpolation_cropsplit.R b/scripts/output/single/interpolation_cropsplit.R index ea5d64967d..9d81410655 100644 --- a/scripts/output/single/interpolation_cropsplit.R +++ b/scripts/output/single/interpolation_cropsplit.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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/scripts/output/single/rds_report.R b/scripts/output/single/rds_report.R index 9ece05e862..ceade894af 100644 --- a/scripts/output/single/rds_report.R +++ b/scripts/output/single/rds_report.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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 library(magclass) diff --git a/scripts/output/single/report.R b/scripts/output/single/report.R index a77396aa89..bbf2c93dbc 100644 --- a/scripts/output/single/report.R +++ b/scripts/output/single/report.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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 library(magclass) diff --git a/scripts/output/single/scp.R b/scripts/output/single/scp.R index 51450b35da..5854fdfaa7 100644 --- a/scripts/output/single/scp.R +++ b/scripts/output/single/scp.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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/scripts/output/single/scp_feed.R b/scripts/output/single/scp_feed.R index 462a06b6e5..8886ebfb4d 100644 --- a/scripts/output/single/scp_feed.R +++ b/scripts/output/single/scp_feed.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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/scripts/output/single/sustag_report.R b/scripts/output/single/sustag_report.R index 61f26b4f93..88743e7e35 100644 --- a/scripts/output/single/sustag_report.R +++ b/scripts/output/single/sustag_report.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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 @@ -49,15 +50,30 @@ MIF2SUSTAg <- function(x,model="MAgPIE",scenario="default") { name <- "Emissions|CO2|AFOLU (Mt CO2/yr)" new <- mbind(new,setNames(x[,,"Emissions|CO2|Land (Mt CO2/yr)"],paste(model,scenario,name,sep="."))) + name <- "Emissions|CO2|AFOLU|Land-use Change (Mt CO2/yr)" + new <- mbind(new,setNames(x[,,"Emissions|CO2|Land|+|Land-use Change (Mt CO2/yr)"],paste(model,scenario,name,sep="."))) + + name <- "Emissions|CO2|AFOLU|Climate Change (Mt CO2/yr)" + new <- mbind(new,setNames(x[,,"Emissions|CO2|Land|+|Climate Change (Mt CO2/yr)"],paste(model,scenario,name,sep="."))) + name <- "Emissions|NH3|Agriculture (Mt NH3/yr)" new <- mbind(new,setNames(x[,,"Emissions|NH3|Land|+|Agriculture (Mt NH3/yr)"],paste(model,scenario,name,sep="."))) name <- "Emissions|NOx|Agriculture (Mt NO2/yr)" - new <- mbind(new,setNames(x[,,"Emissions|NOx|Land|+|Agriculture (Mt NOx/yr)"],paste(model,scenario,name,sep="."))) + new <- mbind(new,setNames(x[,,"Emissions|NO2|Land|+|Agriculture (Mt NO2/yr)"],paste(model,scenario,name,sep="."))) name <- "Emissions|NO3-|Agriculture (Mt NO3/yr)" new <- mbind(new,setNames(x[,,"Emissions|NO3-|Land|+|Agriculture (Mt NO3-/yr)"],paste(model,scenario,name,sep="."))) + #Cumulative + name <- "Emissions|CO2|AFOLU|Cumulative (Gt CO2)" + new <- mbind(new,setNames(x[,,"Emissions|CO2|Land|Cumulative (Gt CO2)"],paste(model,scenario,name,sep="."))) + + name <- "Emissions|CO2|AFOLU|Cumulative|Land-use Change (Gt CO2)" + new <- mbind(new,setNames(x[,,"Emissions|CO2|Land|Cumulative|+|Land-use Change (Gt CO2)"],paste(model,scenario,name,sep="."))) + + name <- "Emissions|CO2|AFOLU|Cumulative|Climate Change (Gt CO2)" + new <- mbind(new,setNames(x[,,"Emissions|CO2|Land|Cumulative|+|Climate Change (Gt CO2)"],paste(model,scenario,name,sep="."))) @@ -196,15 +212,15 @@ MIF2SUSTAg <- function(x,model="MAgPIE",scenario="default") { #????# aktuell nur aggregiert verfügbar für alle food items ?????????????? name <- "Prices|Producer Price Index|Food (index relative to 2010)" - new <- mbind(new,setNames(x[,,"Prices|Food Price Index (Index 2005=100)"],paste(model,scenario,name,sep="."))) + new <- mbind(new,setNames(x[,,"Prices|Food Price Index (Index 2010=100)"],paste(model,scenario,name,sep="."))) # #????# Index für food crops fehlt ?????????????????????????????????????? # name <- "Prices|Producer Price Index|Crops (index relative to 2010)" -# new <- mbind(new,setNames(x[,,"Prices|Food Price Index (Index 2005=100)"],paste(model,scenario,name,sep="."))) +# new <- mbind(new,setNames(x[,,"Prices|Food Price Index (Index 2010=100)"],paste(model,scenario,name,sep="."))) # #????# Index für livestock fehlt ????????????????????????????????????????? # name <- "Prices|Producer Price Index|Livestock (index relative to 2010)" -# new <- mbind(new,setNames(x[,,"Prices|Food Price Index (Index 2005=100)"],paste(model,scenario,name,sep="."))) +# new <- mbind(new,setNames(x[,,"Prices|Food Price Index (Index 2010=100)"],paste(model,scenario,name,sep="."))) name <- "Prices|Producer Prices|Ethanol (US$05/tDM)" @@ -288,8 +304,8 @@ MIF2SUSTAg <- function(x,model="MAgPIE",scenario="default") { ### Food Intake name <- "Food Intake (kcal/cap/day)" - reg.intake <- Intake(gdx,level = "reg",calibrated=TRUE, pregnancy = TRUE, per_capita = TRUE, age_groups = FALSE) - glo.intake <- Intake(gdx,level = "glo",calibrated=TRUE, pregnancy = TRUE, per_capita = TRUE, age_groups = FALSE) + reg.intake <- Intake(gdx,level = "reg",calibrated=TRUE, pregnancy = TRUE, per_capita = TRUE, age = FALSE) + glo.intake <- Intake(gdx,level = "glo",calibrated=TRUE, pregnancy = TRUE, per_capita = TRUE, age = FALSE) new <- mbind(new,setNames(mbind(reg.intake,glo.intake)[,-1,],paste(model,scenario,name,sep="."))) name <- "Food Intake|Staple products (kcal/cap/day)" @@ -319,6 +335,32 @@ MIF2SUSTAg <- function(x,model="MAgPIE",scenario="default") { glo <- FoodExpenditure(gdx,level = "glo",products = "kfo",product_aggr = TRUE, per_capita = TRUE) new <- mbind(new,setNames(mbind(reg,glo)[,-1,],paste(model,scenario,name,sep="."))) +###################################################### + + ### Bioenergy Production + name <- "Energy|Bioenergy (EJ/yr)" + reg <- collapseNames(demand(gdx,level="reg",products = "kall",product_aggr = TRUE,attributes = "ge")[,,"bioenergy"])/1000 + glo <- collapseNames(demand(gdx,level="glo",products = "kall",product_aggr = TRUE,attributes = "ge")[,,"bioenergy"])/1000 + new <- mbind(new,setNames(mbind(reg,glo)[,-1,],paste(model,scenario,name,sep="."))) + + name <- "Energy|Bioenergy|2nd generation bioenergy crops (EJ/yr)" + reg <- collapseNames(demand(gdx,level="reg",products = c("betr","begr"),product_aggr = TRUE,attributes = "ge")[,,"bioenergy"])/1000 + glo <- collapseNames(demand(gdx,level="glo",products = c("betr","begr"),product_aggr = TRUE,attributes = "ge")[,,"bioenergy"])/1000 + new <- mbind(new,setNames(mbind(reg,glo)[,-1,],paste(model,scenario,name,sep="."))) + + name <- "Energy|Bioenergy|Residues (EJ/yr)" + reg <- collapseNames(demand(gdx,level="reg",products = c("res_cereals","res_fibrous","res_nonfibrous"),product_aggr = TRUE,attributes = "ge")[,,"bioenergy"])/1000 + glo <- collapseNames(demand(gdx,level="glo",products = c("res_cereals","res_fibrous","res_nonfibrous"),product_aggr = TRUE,attributes = "ge")[,,"bioenergy"])/1000 + new <- mbind(new,setNames(mbind(reg,glo)[,-1,],paste(model,scenario,name,sep="."))) + +# name <- "Energy|Bioenerg|1st generation bioenergy (EJ/yr)" +# reg <- collapseNames(demand(gdx,level="reg",products = "kall",product_aggr = TRUE,attributes = "ge")[,,"bioenergy"])/1000 +# - collapseNames(demand(gdx,level="reg",products = c("betr","begr"),product_aggr = TRUE,attributes = "ge")[,,"bioenergy"])/1000 +# - collapseNames(demand(gdx,level="reg",products = c("res_cereals","res_fibrous","res_nonfibrous"),product_aggr = TRUE,attributes = "ge")[,,"bioenergy"])/1000 +# glo <- collapseNames(demand(gdx,level="glo",products = "kall",product_aggr = TRUE,attributes = "ge")[,,"bioenergy"])/1000 +# - collapseNames(demand(gdx,level="glo",products = c("betr","begr"),product_aggr = TRUE,attributes = "ge")[,,"bioenergy"])/1000 +# - collapseNames(demand(gdx,level="glo",products = c("res_cereals","res_fibrous","res_nonfibrous"),product_aggr = TRUE,attributes = "ge")[,,"bioenergy"])/1000 +# new <- mbind(new,setNames(mbind(reg,glo)[,-1,],paste(model,scenario,name,sep="."))) return(new) diff --git a/scripts/output/single/validation.R b/scripts/output/single/validation.R index 29c1484109..85c9d6d33e 100644 --- a/scripts/output/single/validation.R +++ b/scripts/output/single/validation.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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 library(magpie4) diff --git a/scripts/performance_test.R b/scripts/performance_test.R index 344ef89b39..ae9c784508 100644 --- a/scripts/performance_test.R +++ b/scripts/performance_test.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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 source("scripts/start_functions.R") diff --git a/scripts/run_submit/submit.R b/scripts/run_submit/submit.R index 289dbb5053..01901095d2 100644 --- a/scripts/run_submit/submit.R +++ b/scripts/run_submit/submit.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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 library(magclass) diff --git a/scripts/start/MAg4_candidate.R b/scripts/start/MAg4_candidate.R deleted file mode 100644 index eaf3403fb3..0000000000 --- a/scripts/start/MAg4_candidate.R +++ /dev/null @@ -1,81 +0,0 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# | Contact: magpie@pik-potsdam.de - - -###################################### -#### Script to start a MAgPIE run #### -###################################### - -library(lucode) -library(magclass) -#withMetadata(TRUE) ## Doesn't work. - -############################################################################################################### -## Following script is with H12 regions, All SSPs (ref and rcp2.6), on a livestock gridded configuration, ## -## with forest protection policy in Japan and new tau implementation jun18. Includes correct GDP calculation ## -## and also includes other land protetction in Japan. ## -############################################################################################################### - -# Load start_run(cfg) function which is needed to start MAgPIE runs -source("scripts/start_functions.R") - -#start MAgPIE run -source("config/default.cfg") - -cfg$results_folder <- "output/:title:" - -#specify the title flag for all the scenarios -#flag <- "" - -#SSPs -for(reg in c("H12")) { - ## 200 clusters - cellcode <- "h200" - regionscode <- "690d3718e151be1b450b394c1064b1c5" - - forest_pro <- c(paste0("isimip_rcp-IPSL_CM5A_LR-rcp2p6-co2_rev33_",cellcode,"_",regionscode,".tgz"), - paste0("rev3.36_",regionscode,"_magpie.tgz"), - paste0("rev3.36_",regionscode,"_validation.tgz"), - "additional_data_rev3.45.tgz") - - ### better use scenario_config for such complicated settings! - for (ssp in c("SSP1","SSP2","SSP3","SSP4","SSP5")) { - for (rcp in c("Ref","26")){ - #if(rcp=="26" && ssp %in% c("SSP3","SSP4")) next - for(tc in c("lg")) { - for(jpn in c("JPNfp")){ - for(tau in c("endo_jun18")){ - - cfg$title <- paste(ssp,rcp,sep="_") - - cfg <- setScenario(cfg,c(ssp,if(rcp=="ref") "NPI" else "NDC")) - if(rcp=="Ref"){spa="SPA0"}else{spa=paste0("SPA",substring(ssp,4,5))} - if(ssp%in%c("SSP1","SSP2","SSP5")){ - model="REMIND-MAgPIE" - } else if (ssp=="SSP3"){ - model="AIM-CGE" - } else { - model="GCAM4" - } - cfg$gms$c56_pollutant_prices <- paste(ssp,rcp,spa,"V15",model,sep="-") - cfg$gms$c60_2ndgen_biodem <- paste(if(ssp %in% c("SSP3","SSP4")) "SSP2" else ssp,rcp,"SPA0",sep="-") - - cfg$gms$tc <- tau - - cfg$input <- forest_pro - - cfg$gms$s40_pasture_transport_costs <- 0 - cfg$damping_factor <- 0.98 - cfg$gms$disagg_lvst <- "simple_oct17" - - start_run(cfg,codeCheck=FALSE) - - } - } - } - } - } -} diff --git a/scripts/start/aff_test.R b/scripts/start/aff_test.R deleted file mode 100644 index 84fa217982..0000000000 --- a/scripts/start/aff_test.R +++ /dev/null @@ -1,50 +0,0 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# | Contact: magpie@pik-potsdam.de - - -###################################### -#### Script to start a MAgPIE run #### -###################################### - -library(lucode) -library(magclass) - -# Load start_run(cfg) function which is needed to start MAgPIE runs -source("scripts/start_functions.R") - -#start MAgPIE run -source("config/default.cfg") -cfg$results_folder <- "output/:title:" - -cfg$title <- "SSP2_Ref" -cfg$gms$c56_pollutant_prices <- "SSP2-Ref-SPA0-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-Ref-SPA0" -start_run(cfg,codeCheck=FALSE) - -cfg$title <- "SSP2_26_Aff33" -cfg$gms$c56_pollutant_prices <- "SSP2-26-SPA2-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-26-SPA2" -cfg$gms$c56_aff_policy <- "vegc33" -start_run(cfg,codeCheck=FALSE) - -cfg$title <- "SSP2_26_Aff50" -cfg$gms$c56_pollutant_prices <- "SSP2-26-SPA2-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-26-SPA2" -cfg$gms$c56_aff_policy <- "vegc50" -start_run(cfg,codeCheck=FALSE) - -cfg$title <- "SSP2_26_Aff75" -cfg$gms$c56_pollutant_prices <- "SSP2-26-SPA2-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-26-SPA2" -cfg$gms$c56_aff_policy <- "vegc75" -start_run(cfg,codeCheck=FALSE) - -cfg$title <- "SSP2_26_Aff100" -cfg$gms$c56_pollutant_prices <- "SSP2-26-SPA2-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-26-SPA2" -cfg$gms$c56_aff_policy <- "vegc100" -start_run(cfg,codeCheck=FALSE) - diff --git a/scripts/start/bmi_shr.R b/scripts/start/bmi_shr.R index 28e7a0cc16..4c088549f1 100644 --- a/scripts/start/bmi_shr.R +++ b/scripts/start/bmi_shr.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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/scripts/start/bra_comp.R b/scripts/start/bra_comp.R index d1dddaa0d6..4f257ec015 100644 --- a/scripts/start/bra_comp.R +++ b/scripts/start/bra_comp.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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/scripts/start/cemics2.R b/scripts/start/cemics2.R index 9362e8e9e5..3c89d294f2 100644 --- a/scripts/start/cemics2.R +++ b/scripts/start/cemics2.R @@ -1,64 +1,65 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# | Contact: magpie@pik-potsdam.de - - -########################################################## -#### Script to MAgPIE test runs #### -########################################################## - -library(lucode) -source("scripts/start_functions.R") -source("scripts/performance_test.R") -source("config/default.cfg") - -#set defaults -codeCheck <- FALSE - -buildInputVector <- function(regionmapping = "h11", - project_name = "isimip_rcp", - climatescen_name= "rcp2p6", - co2 = "noco2", - climate_model = "IPSL_CM5A_LR", - resolution = "h200", - archive_rev = "24", - madrat_rev = "3.3", - validation_rev = "3.3", - additional_data = "additional_data_rev3.16.tgz") { - mappings <- c(h11="8a828c6ed5004e77d1ba2025e8ea2261", - h12="690d3718e151be1b450b394c1064b1c5", - mag="c30c1c580039c2b300d86cc46ff4036a") - archive_name=paste(project_name,climate_model,climatescen_name,co2,sep="-") - archive <- paste0(archive_name, "_rev", archive_rev, "_", resolution, "_", mappings[regionmapping], ".tgz") - madrat <- paste0("magpie_", mappings[regionmapping], "_rev", madrat_rev, ".tgz") - validation <- paste0("validation_", mappings[regionmapping], "_rev", validation_rev, ".tgz") - return(c(archive,madrat,validation,additional_data)) -} - - -### Single runs ### -#general settings -cfg$gms$c_timesteps <- 11 -cfg$gms$s15_elastic_demand <- 1 - -cfg$title <- "CEMICS2_SSP2_RCP45" -cfg<-lucode::setScenario(cfg,"SUSTAg2") -cfg$force_download <- TRUE -cfg$input <- buildInputVector() -cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp4p5") -cfg$gms$c56_pollutant_prices <- "SSP2-45-SPA2-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-45-SPA2" -cfg$recalibrate <- TRUE -start_run(cfg=cfg,codeCheck=codeCheck) - -cfg$title <- "CEMICS2_SSP2_RCP26" -cfg<-lucode::setScenario(cfg,"SUSTAg2") -cfg$force_download <- TRUE -cfg$input <- buildInputVector() -cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp2p6") -cfg$gms$c56_pollutant_prices <- "SSP2-26-SPA2-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-26-SPA2" -cfg$recalibrate <- TRUE -start_run(cfg=cfg,codeCheck=codeCheck) +# | (C) 2008-2019 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 + + +########################################################## +#### Script to MAgPIE test runs #### +########################################################## + +library(lucode) +source("scripts/start_functions.R") +source("scripts/performance_test.R") +source("config/default.cfg") + +#set defaults +codeCheck <- FALSE + +buildInputVector <- function(regionmapping = "h11", + project_name = "isimip_rcp", + climatescen_name= "rcp2p6", + co2 = "noco2", + climate_model = "IPSL_CM5A_LR", + resolution = "h200", + archive_rev = "24", + madrat_rev = "3.3", + validation_rev = "3.3", + additional_data = "additional_data_rev3.16.tgz") { + mappings <- c(h11="8a828c6ed5004e77d1ba2025e8ea2261", + h12="690d3718e151be1b450b394c1064b1c5", + mag="c30c1c580039c2b300d86cc46ff4036a") + archive_name=paste(project_name,climate_model,climatescen_name,co2,sep="-") + archive <- paste0(archive_name, "_rev", archive_rev, "_", resolution, "_", mappings[regionmapping], ".tgz") + madrat <- paste0("magpie_", mappings[regionmapping], "_rev", madrat_rev, ".tgz") + validation <- paste0("validation_", mappings[regionmapping], "_rev", validation_rev, ".tgz") + return(c(archive,madrat,validation,additional_data)) +} + + +### Single runs ### +#general settings +cfg$gms$c_timesteps <- 11 +cfg$gms$s15_elastic_demand <- 1 + +cfg$title <- "CEMICS2_SSP2_RCP45" +cfg<-lucode::setScenario(cfg,"SUSTAg2") +cfg$force_download <- TRUE +cfg$input <- buildInputVector() +cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp4p5") +cfg$gms$c56_pollutant_prices <- "SSPDB-SSP2-45-REMIND-MAGPIE" +cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP2-45-REMIND-MAGPIE" +cfg$recalibrate <- TRUE +start_run(cfg=cfg,codeCheck=codeCheck) + +cfg$title <- "CEMICS2_SSP2_RCP26" +cfg<-lucode::setScenario(cfg,"SUSTAg2") +cfg$force_download <- TRUE +cfg$input <- buildInputVector() +cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp2p6") +cfg$gms$c56_pollutant_prices <- "SSPDB-SSP2-26-REMIND-MAGPIE" +cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP2-26-REMIND-MAGPIE" +cfg$recalibrate <- TRUE +start_run(cfg=cfg,codeCheck=codeCheck) diff --git a/scripts/start/check_code.R b/scripts/start/check_code.R index a3ae4506ff..44c7b131ab 100644 --- a/scripts/start/check_code.R +++ b/scripts/start/check_code.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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/scripts/start/default.R b/scripts/start/default.R index 482faee1f5..87a0ab3816 100644 --- a/scripts/start/default.R +++ b/scripts/start/default.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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/scripts/start/demandtest.R b/scripts/start/demandtest.R index 019e95cfbb..ed4a8ed8b8 100644 --- a/scripts/start/demandtest.R +++ b/scripts/start/demandtest.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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 @@ -38,8 +39,8 @@ for (ssp in c("SSP2","SSP1","SSP3","SSP4","SSP5")) { } cfg$title <- paste(if(rcp=="26" & ssp %in% c("SSP3","SSP4")) next else ssp,rcp,flag,sep="_") - cfg$gms$c56_pollutant_prices <- paste(if(rcp=="Ref" & ssp=="SSP3") "SSP2" else ssp,rcp,spa,"V15",if(rcp=="Ref" & ssp=="SSP3") "REMIND-MAGPIE" else model,sep="-") - cfg$gms$c60_2ndgen_biodem <- paste(if(ssp %in% c("SSP3","SSP4")) "SSP2" else ssp,rcp,spa,sep="-") + cfg$gms$c56_pollutant_prices <- paste("SSPDB",ssp,rcp,model,sep="-") + cfg$gms$c60_2ndgen_biodem <- paste("SSPDB",ssp,rcp,model,sep="-") start_run(cfg,codeCheck=FALSE) cfg$recalibrate <- FALSE } @@ -61,8 +62,8 @@ cfg$gms$c52_carbon_scenario <- "cc" cfg$title <- paste("SSP1_Ref_RCP60_co2",flag,sep="_") cfg <- setScenario(cfg,c("SSP1","NPI")) -cfg$gms$c56_pollutant_prices <- "SSP1-Ref-SPA0-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP1-Ref-SPA0" +cfg$gms$c56_pollutant_prices <- "SSPDB-SSP1-Ref-REMIND-MAGPIE" +cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP1-Ref-REMIND-MAGPIE" cfg$input[1] <- "isimip_rcp-IPSL_CM5A_LR-rcp6p0-co2_rev33_h200_690d3718e151be1b450b394c1064b1c5.tgz" start_run(cfg,codeCheck=FALSE) @@ -75,8 +76,8 @@ start_run(cfg,codeCheck=FALSE) cfg$title <- paste("SSP1_26_RCP26_co2",flag,sep="_") cfg <- setScenario(cfg,c("SSP1","NDC")) -cfg$gms$c56_pollutant_prices <- "SSP1-26-SPA1-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP1-26-SPA0" +cfg$gms$c56_pollutant_prices <- "SSPDB-SSP1-26-REMIND-MAGPIE" +cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP1-26-REMIND-MAGPIE" cfg$input[1] <- "isimip_rcp-IPSL_CM5A_LR-rcp2p6-co2_rev33_h200_690d3718e151be1b450b394c1064b1c5.tgz" start_run(cfg,codeCheck=FALSE) @@ -90,8 +91,8 @@ start_run(cfg,codeCheck=FALSE) cfg$title <- paste("SSP2_Ref_RCP60_co2",flag,sep="_") cfg <- setScenario(cfg,c("SSP2","NPI")) -cfg$gms$c56_pollutant_prices <- "SSP2-Ref-SPA0-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-Ref-SPA0" +cfg$gms$c56_pollutant_prices <- "SSPDB-SSP2-Ref-REMIND-MAGPIE" +cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP2-Ref-REMIND-MAGPIE" cfg$input[1] <- "isimip_rcp-IPSL_CM5A_LR-rcp6p0-co2_rev33_h200_690d3718e151be1b450b394c1064b1c5.tgz" start_run(cfg,codeCheck=FALSE) @@ -104,8 +105,8 @@ start_run(cfg,codeCheck=FALSE) cfg$title <- paste("SSP2_26_RCP26_co2",flag,sep="_") cfg <- setScenario(cfg,c("SSP2","NDC")) -cfg$gms$c56_pollutant_prices <- "SSP2-26-SPA2-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-26-SPA0" +cfg$gms$c56_pollutant_prices <- "SSPDB-SSP2-26-REMIND-MAGPIE" +cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP2-26-REMIND-MAGPIE" cfg$input[1] <- "isimip_rcp-IPSL_CM5A_LR-rcp2p6-co2_rev33_h200_690d3718e151be1b450b394c1064b1c5.tgz" start_run(cfg,codeCheck=FALSE) @@ -119,8 +120,8 @@ start_run(cfg,codeCheck=FALSE) # cfg$title <- paste("SSP3_Ref_RCP60_co2",flag,sep="_") cfg <- setScenario(cfg,c("SSP3","NPI")) -cfg$gms$c56_pollutant_prices <- "SSP2-Ref-SPA0-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-Ref-SPA0" +cfg$gms$c56_pollutant_prices <- "SSPDB-SSP2-Ref-REMIND-MAGPIE" +cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP2-Ref-REMIND-MAGPIE" cfg$input[1] <- "isimip_rcp-IPSL_CM5A_LR-rcp6p0-co2_rev33_h200_690d3718e151be1b450b394c1064b1c5.tgz" start_run(cfg,codeCheck=FALSE) @@ -166,8 +167,8 @@ for (ssp in c("SSP2","SSP1","SSP3","SSP4","SSP5")) { } cfg$title <- paste(if(rcp=="26" & ssp %in% c("SSP3","SSP4")) next else ssp,rcp,flag,sep="_") - cfg$gms$c56_pollutant_prices <- paste(if(rcp=="Ref" & ssp=="SSP3") "SSP2" else ssp,rcp,spa,"V15",if(rcp=="Ref" & ssp=="SSP3") "REMIND-MAGPIE" else model,sep="-") - cfg$gms$c60_2ndgen_biodem <- paste(if(ssp %in% c("SSP3","SSP4")) "SSP2" else ssp,rcp,spa,sep="-") + cfg$gms$c56_pollutant_prices <- paste("SSPDB",ssp,rcp,model,sep="-") + cfg$gms$c60_2ndgen_biodem <- paste("SSPDB",ssp,rcp,model,sep="-") start_run(cfg,codeCheck=FALSE) cfg$recalibrate <- FALSE } @@ -189,8 +190,8 @@ cfg$gms$c52_carbon_scenario <- "cc" cfg$title <- paste("SSP1_Ref_RCP60_co2",flag,sep="_") cfg <- setScenario(cfg,c("SSP1","NPI")) -cfg$gms$c56_pollutant_prices <- "SSP1-Ref-SPA0-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP1-Ref-SPA0" +cfg$gms$c56_pollutant_prices <- "SSPDB-SSP1-Ref-REMIND-MAGPIE" +cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP1-Ref-REMIND-MAGPIE" cfg$input[1] <- "isimip_rcp-IPSL_CM5A_LR-rcp6p0-co2_rev33_h200_690d3718e151be1b450b394c1064b1c5.tgz" start_run(cfg,codeCheck=FALSE) @@ -203,8 +204,8 @@ start_run(cfg,codeCheck=FALSE) cfg$title <- paste("SSP1_26_RCP26_co2",flag,sep="_") cfg <- setScenario(cfg,c("SSP1","NDC")) -cfg$gms$c56_pollutant_prices <- "SSP1-26-SPA1-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP1-26-SPA0" +cfg$gms$c56_pollutant_prices <- "SSPDB-SSP1-26-REMIND-MAGPIE" +cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP1-26-REMIND-MAGPIE" cfg$input[1] <- "isimip_rcp-IPSL_CM5A_LR-rcp2p6-co2_rev33_h200_690d3718e151be1b450b394c1064b1c5.tgz" start_run(cfg,codeCheck=FALSE) @@ -218,8 +219,8 @@ start_run(cfg,codeCheck=FALSE) cfg$title <- paste("SSP2_Ref_RCP60_co2",flag,sep="_") cfg <- setScenario(cfg,c("SSP2","NPI")) -cfg$gms$c56_pollutant_prices <- "SSP2-Ref-SPA0-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-Ref-SPA0" +cfg$gms$c56_pollutant_prices <- "SSPDB-SSP2-Ref-REMIND-MAGPIE" +cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP2-Ref-REMIND-MAGPIE" cfg$input[1] <- "isimip_rcp-IPSL_CM5A_LR-rcp6p0-co2_rev33_h200_690d3718e151be1b450b394c1064b1c5.tgz" start_run(cfg,codeCheck=FALSE) @@ -232,8 +233,8 @@ start_run(cfg,codeCheck=FALSE) cfg$title <- paste("SSP2_26_RCP26_co2",flag,sep="_") cfg <- setScenario(cfg,c("SSP2","NDC")) -cfg$gms$c56_pollutant_prices <- "SSP2-26-SPA2-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-26-SPA0" +cfg$gms$c56_pollutant_prices <- "SSPDB-SSP2-26-REMIND-MAGPIE" +cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP2-26-REMIND-MAGPIE" cfg$input[1] <- "isimip_rcp-IPSL_CM5A_LR-rcp2p6-co2_rev33_h200_690d3718e151be1b450b394c1064b1c5.tgz" start_run(cfg,codeCheck=FALSE) @@ -247,8 +248,8 @@ start_run(cfg,codeCheck=FALSE) # cfg$title <- paste("SSP3_Ref_RCP60_co2",flag,sep="_") cfg <- setScenario(cfg,c("SSP3","NPI")) -cfg$gms$c56_pollutant_prices <- "SSP2-Ref-SPA0-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-Ref-SPA0" +cfg$gms$c56_pollutant_prices <- "SSPDB-SSP2-Ref-REMIND-MAGPIE" +cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP2-Ref-REMIND-MAGPIE" cfg$input[1] <- "isimip_rcp-IPSL_CM5A_LR-rcp6p0-co2_rev33_h200_690d3718e151be1b450b394c1064b1c5.tgz" start_run(cfg,codeCheck=FALSE) diff --git a/scripts/start/disagg.R b/scripts/start/disagg.R index 5ec87053b3..8c079327e5 100644 --- a/scripts/start/disagg.R +++ b/scripts/start/disagg.R @@ -1,31 +1,32 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# | Contact: magpie@pik-potsdam.de - - -###################################### -#### Script to start a MAgPIE run #### -###################################### - -library(lucode) -source("scripts/start_functions.R") -source("config/default.cfg") - - -test <- c("foragebased_aug18","simple_oct17","foragebased_sep18_nocalib","foragebased_sep18") - -for(i in (1:4)){ - cfg$title <- paste0("SSP2_REF_",test[i]) - if(i==3) cfg$gms$disagg_lvst <- "foragebased_sep18" - if(i==3) cfg$recalibrate <- FALSE - cfg <- setScenario(cfg,c("SSP2","NPI")) - cfg$gms$c56_pollutant_prices <- "SSP2-Ref-SPA0-V15-REMIND-MAGPIE" - cfg$gms$c60_2ndgen_biodem <- "SSP2-Ref-SPA0" - start_run(cfg=cfg,codeCheck=FALSE) - cfg$recalibrate <- TRUE -} - - - +# | (C) 2008-2019 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 + + +###################################### +#### Script to start a MAgPIE run #### +###################################### + +library(lucode) +source("scripts/start_functions.R") +source("config/default.cfg") + + +test <- c("foragebased_aug18","simple_oct17","foragebased_sep18_nocalib","foragebased_sep18") + +for(i in (1:4)){ + cfg$title <- paste0("SSP2_REF_",test[i]) + if(i==3) cfg$gms$disagg_lvst <- "foragebased_sep18" + if(i==3) cfg$recalibrate <- FALSE + cfg <- setScenario(cfg,c("SSP2","NPI")) + cfg$gms$c56_pollutant_prices <- "SSPDB-SSP2-Ref-REMIND-MAGPIE" + cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP2-Ref-REMIND-MAGPIE" + start_run(cfg=cfg,codeCheck=FALSE) + cfg$recalibrate <- TRUE +} + + + diff --git a/scripts/start/download_data_only.R b/scripts/start/download_data_only.R index f721ec3ebe..9047bd70a6 100644 --- a/scripts/start/download_data_only.R +++ b/scripts/start/download_data_only.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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/scripts/start/emulator.R b/scripts/start/emulator.R index efb920ae6e..0c87cc9215 100644 --- a/scripts/start/emulator.R +++ b/scripts/start/emulator.R @@ -1,3 +1,9 @@ +# | (C) 2008-2019 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 ######################################################### #### Start MAgPIE runs to derive price emulator from #### ######################################################### diff --git a/scripts/start/fable_prep.R b/scripts/start/fable_prep.R index 008841e4da..8fe3eaf150 100644 --- a/scripts/start/fable_prep.R +++ b/scripts/start/fable_prep.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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 @@ -23,23 +24,25 @@ buildInputVector <- function(regionmapping = "aus", climate_model = "IPSL_CM5A_LR", resolution = "c200", archive_rev = "34", - madrat_rev = "4.14", - validation_rev = "4.14", + madrat_rev = "4.18", + validation_rev = "4.18", calibration = NULL, - additional_data = "additional_data_rev3.58.tgz") { + additional_data = "additional_data_rev3.66.tgz") { mappings <- c(h12="690d3718e151be1b450b394c1064b1c5") archive_name=paste(project_name,climate_model,climatescen_name,co2,sep="-") - archive <- paste0(archive_name, "_rev", archive_rev, "_", resolution, "_", toupper(regionmapping),"4_",mappings["h12"], ".tgz") + if(regionmapping=="h12") archive <- paste0(archive_name, "_rev", archive_rev, "_", resolution, "_", mappings["h12"], ".tgz") + else archive <- paste0(archive_name, "_rev", archive_rev, "_", resolution, "_", toupper(regionmapping),"4_",mappings["h12"], ".tgz") madrat <- paste0("rev", madrat_rev, "_", mappings["h12"], "_magpie.tgz") validation <- paste0("rev", validation_rev, "_", mappings["h12"], "_validation.tgz") return(c(archive,madrat,validation,calibration,additional_data)) } -#calib_date <- NULL +calib_date <- "21Mar19" -for(x in c("ind","cha")) { +for(x in c("h12","ind","cha")) { if(exists("calib_date") && !is.null(calib_date)) { calibration <- paste0("calibration_",x,"_",calib_date,".tgz") + if(x=="h12") calibration <- "calibration_H12_c200_12Sep18.tgz" } else { calibration <- NULL } @@ -50,5 +53,6 @@ for(x in c("ind","cha")) { calib <- submitCalibration(x) cfg$input <- c(cfg$input,calib) } - publish_data(input=cfg, name=paste0("magpie4.0_",x,"_oct18"), target=".") + if(x=="h12") x <- "default" + publish_data(input=cfg, name=paste0("magpie4.1_",x,"_apr19"), target=".") } diff --git a/scripts/start/fable_start.R b/scripts/start/fable_start.R index e8a3ccb159..96becc52b0 100644 --- a/scripts/start/fable_start.R +++ b/scripts/start/fable_start.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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/scripts/start/factor_cost_comparison.R b/scripts/start/factor_cost_comparison.R deleted file mode 100644 index 4b2f0b0f69..0000000000 --- a/scripts/start/factor_cost_comparison.R +++ /dev/null @@ -1,103 +0,0 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# | Contact: magpie@pik-potsdam.de - - -########################################################## -#### Script to MAgPIE test runs #### -########################################################## - -library(lucode) -source("scripts/start_functions.R") -source("scripts/performance_test.R") -source("config/default.cfg") - -#set defaults -codeCheck <- FALSE - -# buildInputVector <- function(regionmapping = "h11", -# project_name = "isimip_rcp", -# climatescen_name= "rcp2p6", -# co2 = "noco2", -# climate_model = "IPSL_CM5A_LR", -# resolution = "h200", -# archive_rev = "27", -# madrat_rev = "3.8", -# validation_rev = "3.8", -# calibration = NULL, -# additional_data = "additional_data_rev3.18.tgz") { -# mappings <- c(h11="8a828c6ed5004e77d1ba2025e8ea2261", -# h12="690d3718e151be1b450b394c1064b1c5", -# mag="c30c1c580039c2b300d86cc46ff4036a") -# archive_name=paste(project_name,climate_model,climatescen_name,co2,sep="-") -# archive <- paste0(archive_name, "_rev", archive_rev, "_", resolution, "_", mappings[regionmapping], ".tgz") -# madrat <- paste0("rev", madrat_rev, "_", mappings[regionmapping], "_magpie.tgz") -# validation <- paste0("rev", validation_rev, "_", mappings[regionmapping], "_validation.tgz") -# return(c(archive,madrat,validation,calibration,additional_data)) -# } - - -### Single runs ### -#general settings -cfg$gms$c_timesteps <- 10 -cfg$gms$s15_elastic_demand <- 1 -cfg$recalibrate <- TRUE - -# MIXED - -cfg$title <- "mixed" -cfg$gms$factor_costs <- "mixed_feb17" -start_run(cfg=cfg,codeCheck=codeCheck) - -cfg$title <- "mixed_past_switch_50" -cfg$gms$s14_yld_past_switch <- 0.5 -start_run(cfg=cfg,codeCheck=codeCheck) - -cfg$title <- "mixed_past_switch_100" -cfg$gms$s14_yld_past_switch <- 1 -start_run(cfg=cfg,codeCheck=codeCheck) - -cfg$title <- "mixed_water_available_75" -cfg$gms$s14_yld_past_switch <- 0 -cfg$gms$s42_reserved_fraction <- 0.25 -start_run(cfg=cfg,codeCheck=codeCheck) - -# FIXED_per_ton old (differs for rainfed and irrigated) - -cfg$title <- "fixed_old" -cfg$gms$factor_costs <- "fixed_per_ton_nov16" -start_run(cfg=cfg,codeCheck=codeCheck) - -cfg$title <- "fixed_old_past_switch_50" -cfg$gms$s14_yld_past_switch <- 0.5 -start_run(cfg=cfg,codeCheck=codeCheck) - -cfg$title <- "fixed_old_past_switch_100" -cfg$gms$s14_yld_past_switch <- 1 -start_run(cfg=cfg,codeCheck=codeCheck) - -cfg$title <- "fixed_old_water_available_75" -cfg$gms$s14_yld_past_switch <- 0 -cfg$gms$s42_reserved_fraction <- 0.25 -start_run(cfg=cfg,codeCheck=codeCheck) - -# FIXED_per_ton new (not differs for rainfed and irrigated) - -cfg$title <- "fixed_new" -cfg$gms$factor_costs="fixed_per_ton_mar18" -start_run(cfg=cfg,codeCheck=codeCheck) - -cfg$title <- "fixed_new_past_switch_50" -cfg$gms$s14_yld_past_switch <- 0.5 -start_run(cfg=cfg,codeCheck=codeCheck) - -cfg$title <- "fixed_new_past_switch_100" -cfg$gms$s14_yld_past_switch <- 1 -start_run(cfg=cfg,codeCheck=codeCheck) - -cfg$title <- "fixed_new_water_available_75" -cfg$gms$s14_yld_past_switch <- 0 -cfg$gms$s42_reserved_fraction <- 0.25 -start_run(cfg=cfg,codeCheck=codeCheck) diff --git a/scripts/start/fix_som.R b/scripts/start/fix_som.R index 17404be884..cb78696d19 100644 --- a/scripts/start/fix_som.R +++ b/scripts/start/fix_som.R @@ -1,55 +1,56 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# | Contact: magpie@pik-potsdam.de - - -########################################################## -#### Script to MAgPIE test runs #### -########################################################## - -library(lucode) -source("scripts/start_functions.R") -source("config/default.cfg") - - -buildInputVector <- function(regionmapping = "h12", - project_name = "isimip_rcp", - climatescen_name= "rcp2p6", - co2 = "noco2", - climate_model = "IPSL_CM5A_LR", - resolution = "h200", - archive_rev = "33", - madrat_rev = "3.33", - validation_rev = "3.33", - calibration = NULL, - additional_data = "additional_data_rev3.40.tgz", - npi_base = "calibration_H12_29Jun18.tgz") { - mappings <- c(h11="8a828c6ed5004e77d1ba2025e8ea2261", - h12="690d3718e151be1b450b394c1064b1c5", - mag="c30c1c580039c2b300d86cc46ff4036a") - archive_name=paste(project_name,climate_model,climatescen_name,co2,sep="-") - archive <- paste0(archive_name, "_rev", archive_rev, "_", resolution, "_", mappings[regionmapping], ".tgz") - madrat <- paste0("rev", madrat_rev, "_", mappings[regionmapping], "_magpie.tgz") - validation <- paste0("rev", validation_rev, "_", mappings[regionmapping], "_validation.tgz") - return(c(archive,madrat,validation,calibration,additional_data,npi_base)) -} - - -cfg$title <- "new_carbon_som_on" -cfg$input <- buildInputVector() -cfg$gms$som <- "cellpool_aug16" -cfg$gms$c59_som_scenario <- "nocc" # def = "nocc" -start_run(cfg=cfg,codeCheck=FALSE) - -cfg$title <- "new_carbon_som_off" -cfg$input <- buildInputVector() -cfg$gms$som <- "off" -start_run(cfg=cfg,codeCheck=FALSE) - - -cfg$title <- "old_carbon_som_off" -cfg$input <- buildInputVector(archive_rev="32") -cfg$gms$som <- "off" -start_run(cfg=cfg,codeCheck=FALSE) +# | (C) 2008-2019 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 + + +########################################################## +#### Script to MAgPIE test runs #### +########################################################## + +library(lucode) +source("scripts/start_functions.R") +source("config/default.cfg") + + +buildInputVector <- function(regionmapping = "h12", + project_name = "isimip_rcp", + climatescen_name= "rcp2p6", + co2 = "noco2", + climate_model = "IPSL_CM5A_LR", + resolution = "h200", + archive_rev = "33", + madrat_rev = "3.33", + validation_rev = "3.33", + calibration = NULL, + additional_data = "additional_data_rev3.40.tgz", + npi_base = "calibration_H12_29Jun18.tgz") { + mappings <- c(h11="8a828c6ed5004e77d1ba2025e8ea2261", + h12="690d3718e151be1b450b394c1064b1c5", + mag="c30c1c580039c2b300d86cc46ff4036a") + archive_name=paste(project_name,climate_model,climatescen_name,co2,sep="-") + archive <- paste0(archive_name, "_rev", archive_rev, "_", resolution, "_", mappings[regionmapping], ".tgz") + madrat <- paste0("rev", madrat_rev, "_", mappings[regionmapping], "_magpie.tgz") + validation <- paste0("rev", validation_rev, "_", mappings[regionmapping], "_validation.tgz") + return(c(archive,madrat,validation,calibration,additional_data,npi_base)) +} + + +cfg$title <- "new_carbon_som_on" +cfg$input <- buildInputVector() +cfg$gms$som <- "cellpool_aug16" +cfg$gms$c59_som_scenario <- "nocc" # def = "nocc" +start_run(cfg=cfg,codeCheck=FALSE) + +cfg$title <- "new_carbon_som_off" +cfg$input <- buildInputVector() +cfg$gms$som <- "off" +start_run(cfg=cfg,codeCheck=FALSE) + + +cfg$title <- "old_carbon_som_off" +cfg$input <- buildInputVector(archive_rev="32") +cfg$gms$som <- "off" +start_run(cfg=cfg,codeCheck=FALSE) diff --git a/scripts/start/gams26_test.R b/scripts/start/gams26_test.R deleted file mode 100644 index ef46ae134b..0000000000 --- a/scripts/start/gams26_test.R +++ /dev/null @@ -1,48 +0,0 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# | Contact: magpie@pik-potsdam.de - - -###################################### -#### Script to start a MAgPIE run #### -###################################### - -library(lucode) -library(magclass) -library(gdx) - -# Load start_run(cfg) function which is needed to start MAgPIE runs -source("scripts/start_functions.R") - -#start MAgPIE run -source("config/default.cfg") -cfg$results_folder <- "output/:title:" -cfg$recalibrate <- FALSE - -getInput <- function(gdx) { - a <- readGDX(gdx,"f56_pollutant_prices_coupling") - write.magpie(a,"modules/56_ghg_policy/input/f56_pollutant_prices_coupling.cs3") - a <- readGDX(gdx,"f60_bioenergy_dem_coupling") - write.magpie(a,"modules/60_bioenergy/input/reg.2ndgen_bioenergy_demand.csv") -} - -cfg$gms$c56_pollutant_prices <- "coupling" -cfg$gms$c60_2ndgen_biodem <- "coupling" - -cfg$title <- "SSP2_Base_GAMS26" -cfg <- setScenario(cfg,c("SSP2","NPI")) -getInput("/p/projects/remind/runs/magpie_40-develop-2019-02-08/output/r8332_coupled_Base-mag-5/fulldata.gdx") -start_run(cfg,codeCheck=FALSE) - -cfg$title <- "SSP2_NDC_GAMS26" -cfg <- setScenario(cfg,c("SSP2","NDC")) -getInput("/p/projects/remind/runs/magpie_40-develop-2019-02-08/output/r8332_coupled_NDC-mag-5/fulldata.gdx") -start_run(cfg,codeCheck=FALSE) - -cfg$title <- "SSP2_budg600_GAMS26" -cfg <- setScenario(cfg,c("SSP2","NDC")) -getInput("/p/projects/remind/runs/magpie_40-develop-2019-02-08/output/r8332_coupled_Budg600-mag-5/fulldata.gdx") -start_run(cfg,codeCheck=FALSE) - diff --git a/scripts/start/inms.R b/scripts/start/inms.R index 6ae627e980..2fa7950231 100644 --- a/scripts/start/inms.R +++ b/scripts/start/inms.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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 @@ -51,8 +52,8 @@ cfg$gms$c_timesteps <- 12 cfg$title <- "INMS2_casestudies" cfg<-lucode::setScenario(cfg,"SUSTAg2") cfg$gms$s15_elastic_demand = 1 -cfg$gms$c56_pollutant_prices <- "SSP2-60-SPA2-V15-MESSAGE-GLOBIOM" -cfg$gms$c60_2ndgen_biodem <- "SSP2-60-SPA2" +cfg$gms$c56_pollutant_prices <- "SSPDB-SSP2-60-MESSAGE-GLOBIOM" +cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP2-60-MESSAGE-GLOBIOM" cfg$force_download <- TRUE cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp6p0",regionmapping="inms") #cfg$gms$som<-"cellpool_aug16" @@ -71,13 +72,13 @@ cfg$recalibrate <- FALSE cfg$title <- "INMS1_casestudies" cfg<-lucode::setScenario(cfg,"SUSTAg1") cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp2p6",regionmapping="inms") -cfg$gms$c56_pollutant_prices <- "SSP5-26-SPA5-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP5-26-SPA5" +cfg$gms$c56_pollutant_prices <- "SSPDB-SSP5-26-REMIND-MAGPIE" +cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP5-26-REMIND-MAGPIE" start_run(cfg=cfg,codeCheck=codeCheck) cfg$title <- "INMS5_casestudies" cfg<-lucode::setScenario(cfg,"SUSTAg5") cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp4p5",regionmapping="inms") -cfg$gms$c56_pollutant_prices <- "SSP1-45-SPA1-V15-IMAGE" -cfg$gms$c60_2ndgen_biodem <- "SSP1-45-SPA1" +cfg$gms$c56_pollutant_prices <- "SSPDB-SSP1-45-IMAGE" +cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP1-45-IMAGE" start_run(cfg=cfg,codeCheck=codeCheck) diff --git a/scripts/start/inms2.R b/scripts/start/inms2.R index 31de71e3f5..ffffb92d4a 100644 --- a/scripts/start/inms2.R +++ b/scripts/start/inms2.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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 @@ -17,27 +18,28 @@ source("config/default.cfg") #set defaults codeCheck <- FALSE -buildInputVector <- function(regionmapping = "h11", +buildInputVector <- function(regionmapping = "agmip", project_name = "isimip_rcp", climatescen_name= "rcp2p6", co2 = "noco2", climate_model = "IPSL_CM5A_LR", - resolution = "h200", - archive_rev = "29", - madrat_rev = "3.15", - validation_rev = "3.15", - additional_data = "additional_data_rev3.26.tgz", - npi="npi_ndc_base_SSP2_fixed.tgz") { + resolution = "c200", + archive_rev = "34", + madrat_rev = "4.14", + validation_rev = "4.14", + calibration = "calibration_agmip_c200_19Dec18.tgz", + additional_data = "additional_data_rev3.65.tgz") { mappings <- c(h11="8a828c6ed5004e77d1ba2025e8ea2261", h12="690d3718e151be1b450b394c1064b1c5", mag="c30c1c580039c2b300d86cc46ff4036a", inms="69c65bb3c88e8033cf8df6b5ac5d52a9", - inms2="ef2ae7cd6110d5d142a9f8bd7d5a68f2") + inms2="ef2ae7cd6110d5d142a9f8bd7d5a68f2", + agmip="c77f075908c3bc29bdbe1976165eccaf") archive_name=paste(project_name,climate_model,climatescen_name,co2,sep="-") archive <- paste0(archive_name, "_rev", archive_rev, "_", resolution, "_", mappings[regionmapping], ".tgz") madrat <- paste0("rev", madrat_rev,"_", mappings[regionmapping], "_magpie.tgz") validation <- paste0("rev",validation_rev,"_", mappings[regionmapping], "_validation", ".tgz") - return(c(archive,madrat,validation,additional_data,npi)) + return(c(archive,madrat,validation,additional_data)) } @@ -48,36 +50,73 @@ cfg$gms$c_timesteps <- 12 # clalibration runs -cfg$title <- "INMS2" +cfg$title <- "INMS_SSP2_RCP45_Nmed" cfg<-lucode::setScenario(cfg,"SUSTAg2") -cfg$gms$s15_elastic_demand = 1 -cfg$gms$c56_pollutant_prices <- "SSP2-60-SPA2-V15-MESSAGE-GLOBIOM" -cfg$gms$c60_2ndgen_biodem <- "SSP2-60-SPA2" +cfg$gms$c56_pollutant_prices <- "SSPDB-SSP2-45-MESSAGE-GLOBIOM" +cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP2-45-MESSAGE-GLOBIOM" cfg$force_download <- TRUE -cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp6p0",regionmapping="inms2") -#cfg$gms$som<-"cellpool_aug16" -cfg$gms$factor_costs <- "sticky_feb18" -cfg$recalc_npi_ndc <- FALSE -cfg$gms$c32_aff_policy <- "none" -cfg$gms$c35_ad_policy <- "none" -cfg$recalibrate <- TRUE +cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp4p5",regionmapping="agmip") +cfg$gms$som<-"cellpool_aug16" +#cfg$gms$factor_costs <- "sticky_feb18" start_run(cfg=cfg,codeCheck=codeCheck) -cfg$recalibrate <- FALSE #SSP1,5 family +cfg$title <- "INMS_SSP1_RCP26_Nhigh_diet" -cfg$title <- "INMS1" +cfg$title <- "INMS_SSP1_RCP26_Nhigh" cfg<-lucode::setScenario(cfg,"SUSTAg1") -cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp2p6",regionmapping="inms2") -cfg$gms$c56_pollutant_prices <- "SSP5-26-SPA5-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP5-26-SPA5" +cfg$gms$c56_pollutant_prices <- "SSPDB-SSP1-26-IMAGE" +cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP1-26-IMAGE" +cfg$force_download <- TRUE +cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp2p6",regionmapping="agmip") +cfg$gms$som<-"cellpool_aug16" +#cfg$gms$factor_costs <- "sticky_feb18" +cfg$gms$c50_scen_neff <- "neff80_85_starty2010" +start_run(cfg=cfg,codeCheck=codeCheck) + +cfg$title <- "INMS_SSP1_RCP45_Nhigh" +cfg<-lucode::setScenario(cfg,"SUSTAg1") +cfg$gms$c56_pollutant_prices <- "SSPDB-SSP1-45-IMAGE" +cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP1-45-IMAGE" +cfg$force_download <- TRUE +cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp4p5",regionmapping="agmip") +cfg$gms$som<-"cellpool_aug16" +#cfg$gms$factor_costs <- "sticky_feb18" +cfg$gms$c50_scen_neff <- "neff80_85_starty2010" start_run(cfg=cfg,codeCheck=codeCheck) -cfg$title <- "INMS5" + +cfg$title <- "INMS_SSP2_RCP45_Nlow" +cfg<-lucode::setScenario(cfg,"SUSTAg2") +cfg$gms$c56_pollutant_prices <- "SSPDB-SSP2-45-MESSAGE-GLOBIOM" +cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP2-45-MESSAGE-GLOBIOM" +cfg$force_download <- TRUE +cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp4p5",regionmapping="agmip") +cfg$gms$som<-"cellpool_aug16" +cfg$gms$c50_scen_neff <- "constant" +#cfg$gms$factor_costs <- "sticky_feb18" +start_run(cfg=cfg,codeCheck=codeCheck) + +cfg$title <- "INMS_SSP2_RCP45_Nhigh" +cfg<-lucode::setScenario(cfg,"SUSTAg2") +cfg$gms$c56_pollutant_prices <- "SSPDB-SSP2-45-MESSAGE-GLOBIOM" +cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP2-45-MESSAGE-GLOBIOM" +cfg$force_download <- TRUE +cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp4p5",regionmapping="agmip") +cfg$gms$som<-"cellpool_aug16" +cfg$gms$c50_scen_neff <- "neff80_85_starty2010" +#cfg$gms$factor_costs <- "sticky_feb18" +start_run(cfg=cfg,codeCheck=codeCheck) + +cfg$title <- "SSP5_RCP85_Nlow" cfg<-lucode::setScenario(cfg,"SUSTAg5") -cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp4p5",regionmapping="inms2") -cfg$gms$c56_pollutant_prices <- "SSP1-45-SPA1-V15-IMAGE" -cfg$gms$c60_2ndgen_biodem <- "SSP1-45-SPA1" +cfg$gms$c56_pollutant_prices <- "SSPDB-SSP5-Ref-REMIND-MAGPIE" +cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP5-Ref-REMIND-MAGPIE" +cfg$force_download <- TRUE +cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp8p5",regionmapping="agmip") +cfg$gms$som<-"cellpool_aug16" +cfg$gms$c50_scen_neff <- "constant" +#cfg$gms$factor_costs <- "sticky_feb18" start_run(cfg=cfg,codeCheck=codeCheck) diff --git a/scripts/start/land_bugfix4.R b/scripts/start/land_bugfix4.R deleted file mode 100644 index fffd4155ac..0000000000 --- a/scripts/start/land_bugfix4.R +++ /dev/null @@ -1,50 +0,0 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# | Contact: magpie@pik-potsdam.de - - -###################################### -#### Script to start a MAgPIE run #### -###################################### - -library(lucode) -library(magclass) -library(gdx) - -# Load start_run(cfg) function which is needed to start MAgPIE runs -source("scripts/start_functions.R") - -#start MAgPIE run -source("config/default.cfg") -cfg$results_folder <- "output/:title:" -cfg$recalibrate <- FALSE - -getInput <- function(gdx) { - a <- readGDX(gdx,"f56_pollutant_prices_coupling") - write.magpie(a,"modules/56_ghg_policy/input/f56_pollutant_prices_coupling.cs3") - a <- readGDX(gdx,"f60_bioenergy_dem_coupling") - write.magpie(a,"modules/60_bioenergy/input/reg.2ndgen_bioenergy_demand.csv") -} - -cfg$gms$c56_pollutant_prices <- "coupling" -cfg$gms$c60_2ndgen_biodem <- "coupling" - -for (ssp in c("SSP1","SSP2","SSP3","SSP4","SSP5")) { - cfg$title <- paste(ssp,"Base",sep="_") - cfg <- setScenario(cfg,c(ssp,"NPI")) - getInput("/p/projects/remind/runs/magpie_40-develop/output/r8239_coupled_Base-mag-9/fulldata.gdx") - start_run(cfg,codeCheck=FALSE) - - cfg$title <- paste(ssp,"budg600",sep="_") - cfg <- setScenario(cfg,c(ssp,"NDC")) - getInput("/p/projects/remind/runs/magpie_40-develop/output/r8239_coupled_Budg600-mag-9/fulldata.gdx") - start_run(cfg,codeCheck=FALSE) - - cfg$title <- paste(ssp,"budg950",sep="_") - cfg <- setScenario(cfg,c(ssp,"NDC")) - getInput("/p/projects/remind/runs/magpie_40-develop/output/r8239_coupled_Budg950-mag-9/fulldata.gdx") - start_run(cfg,codeCheck=FALSE) -} - diff --git a/scripts/start/lu_emis_pricing.R b/scripts/start/lu_emis_pricing.R deleted file mode 100644 index 137a99aaae..0000000000 --- a/scripts/start/lu_emis_pricing.R +++ /dev/null @@ -1,101 +0,0 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# | Contact: magpie@pik-potsdam.de - - -###################################### -#### Script to start a MAgPIE run #### -###################################### - -library(lucode) -library(magclass) -library(gdx) - -# Load start_run(cfg) function which is needed to start MAgPIE runs -source("scripts/start_functions.R") - -#start MAgPIE run -source("config/default.cfg") -cfg$results_folder <- "output/:title:" -cfg$recalibrate <- FALSE - -getInput <- function(gdx) { - a <- readGDX(gdx,"f56_pollutant_prices_coupling") - write.magpie(a,"modules/56_ghg_policy/input/f56_pollutant_prices_coupling.cs3") - a <- readGDX(gdx,"f60_bioenergy_dem_coupling") - write.magpie(a,"modules/60_bioenergy/input/reg.2ndgen_bioenergy_demand.csv") -} - -cfg$gms$c56_pollutant_prices <- "coupling" -cfg$gms$c60_2ndgen_biodem <- "coupling" - -cfg$title <- "SSP2_Base_price_jan19" -cfg <- setScenario(cfg,c("SSP2","NPI")) -getInput("/p/projects/remind/runs/magpie_40-develop/output/r8239_coupled_Base-mag-9/fulldata.gdx") -cfg$gms$ghg_policy <- "price_jan19" -start_run(cfg,codeCheck=FALSE) - -cfg$title <- "SSP2_budg600_price_jan19" -cfg <- setScenario(cfg,c("SSP2","NDC")) -getInput("/p/projects/remind/runs/magpie_40-develop/output/r8239_coupled_Budg600-mag-9/fulldata.gdx") -cfg$gms$ghg_policy <- "price_jan19" -start_run(cfg,codeCheck=FALSE) - -cfg$title <- "SSP2_budg600_price_sep16" -cfg <- setScenario(cfg,c("SSP2","NDC")) -getInput("/p/projects/remind/runs/magpie_40-develop/output/r8239_coupled_Budg600-mag-9/fulldata.gdx") -cfg$gms$ghg_policy <- "price_sep16" -start_run(cfg,codeCheck=FALSE) - -cfg$title <- "SSP2_budg950_price_jan19" -cfg <- setScenario(cfg,c("SSP2","NDC")) -getInput("/p/projects/remind/runs/magpie_40-develop/output/r8239_coupled_Budg950-mag-9/fulldata.gdx") -cfg$gms$ghg_policy <- "price_jan19" -start_run(cfg,codeCheck=FALSE) - -cfg$title <- "SSP2_budg950_price_sep16" -cfg <- setScenario(cfg,c("SSP2","NDC")) -getInput("/p/projects/remind/runs/magpie_40-develop/output/r8239_coupled_Budg950-mag-9/fulldata.gdx") -cfg$gms$ghg_policy <- "price_sep16" -start_run(cfg,codeCheck=FALSE) - - -# cfg$title <- "SSP2_budg600_price_dec18_dev25" -# cfg <- setScenario(cfg,c("SSP2","NDC")) -# getInput("/p/projects/remind/runs/magpie_40-develop/output/r8239_coupled_Budg600-mag-9/fulldata.gdx") -# cfg$gms$ghg_policy <- "price_dec18" -# cfg$gms$s56_emis_pricing_dev_threshold <- 0.25 -# start_run(cfg,codeCheck=FALSE) - - -# cfg$title <- "SSP1_budg600_devMultiPhaseIn5" -# cfg <- setScenario(cfg,c("SSP1","NDC")) -# getInput("/p/projects/remind/runs/magpie_40-develop/output/r8239_coupled_Budg600-mag-9/fulldata.gdx") -# cfg$gms$ghg_policy <- "price_dec18" -# start_run(cfg,codeCheck=FALSE) -# -# cfg$title <- "SSP2_budg600_devMultiPhaseIn5" -# cfg <- setScenario(cfg,c("SSP2","NDC")) -# getInput("/p/projects/remind/runs/magpie_40-develop/output/r8239_coupled_Budg600-mag-9/fulldata.gdx") -# cfg$gms$ghg_policy <- "price_dec18" -# start_run(cfg,codeCheck=FALSE) -# -# cfg$title <- "SSP3_budg600_devMultiPhaseIn5" -# cfg <- setScenario(cfg,c("SSP3","NDC")) -# getInput("/p/projects/remind/runs/magpie_40-develop/output/r8239_coupled_Budg600-mag-9/fulldata.gdx") -# cfg$gms$ghg_policy <- "price_dec18" -# start_run(cfg,codeCheck=FALSE) -# -# cfg$title <- "SSP4_budg600_devMultiPhaseIn5" -# cfg <- setScenario(cfg,c("SSP4","NDC")) -# getInput("/p/projects/remind/runs/magpie_40-develop/output/r8239_coupled_Budg600-mag-9/fulldata.gdx") -# cfg$gms$ghg_policy <- "price_dec18" -# start_run(cfg,codeCheck=FALSE) -# -# cfg$title <- "SSP5_budg600_devMultiPhaseIn5" -# cfg <- setScenario(cfg,c("SSP5","NDC")) -# getInput("/p/projects/remind/runs/magpie_40-develop/output/r8239_coupled_Budg600-mag-9/fulldata.gdx") -# cfg$gms$ghg_policy <- "price_dec18" -# start_run(cfg,codeCheck=FALSE) diff --git a/scripts/start/maccs_bugfix.R b/scripts/start/maccs_bugfix.R deleted file mode 100644 index 672f95fd31..0000000000 --- a/scripts/start/maccs_bugfix.R +++ /dev/null @@ -1,36 +0,0 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# | Contact: magpie@pik-potsdam.de - - -###################################### -#### Script to start a MAgPIE run #### -###################################### - -library(lucode) -library(magclass) - -# Load start_run(cfg) function which is needed to start MAgPIE runs -source("scripts/start_functions.R") - -#start MAgPIE run -source("config/default.cfg") -cfg$results_folder <- "output/:title:" -cfg$recalibrate <- FALSE - -##SSP2 -cfg$title <- "SSP2_Ref_bugfix2" -cfg <- setScenario(cfg,c("SSP2","NPI")) -cfg$gms$c56_pollutant_prices <- "SSP2-Ref-SPA0-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-Ref-SPA0" -start_run(cfg,codeCheck=FALSE) - -##SSP2 -cfg$title <- "SSP2_26_bugfix2" -cfg <- setScenario(cfg,c("SSP2","NDC")) -cfg$gms$c56_pollutant_prices <- "SSP2-26-SPA2-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-26-SPA2" -start_run(cfg,codeCheck=FALSE) - diff --git a/scripts/start/order.cfg b/scripts/start/order.cfg index e06d799ff1..054b1d8108 100644 --- a/scripts/start/order.cfg +++ b/scripts/start/order.cfg @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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 # Order of start scripts...Scripts not mentioned here will be shown alphabetically diff --git a/scripts/start/overprod_bugfix.R b/scripts/start/overprod_bugfix.R deleted file mode 100644 index b9a2ba6c83..0000000000 --- a/scripts/start/overprod_bugfix.R +++ /dev/null @@ -1,54 +0,0 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# | Contact: magpie@pik-potsdam.de - - -###################################### -#### Script to start a MAgPIE run #### -###################################### - -library(lucode) -library(magclass) - -# Load start_run(cfg) function which is needed to start MAgPIE runs -source("scripts/start_functions.R") - -#start MAgPIE run -source("config/default.cfg") -cfg$results_folder <- "output/:title:" -cfg$recalibrate <- FALSE - -##master -cfg$title <- "SSP2_Ref_master" -cfg <- setScenario(cfg,c("SSP2","NPI")) -cfg$gms$c56_pollutant_prices <- "SSP2-Ref-SPA0-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-Ref-SPA0" -start_run(cfg,codeCheck=FALSE) - -cfg$title <- "SSP2_26_master" -cfg <- setScenario(cfg,c("SSP2","NDC")) -cfg$gms$c56_pollutant_prices <- "SSP2-26-SPA2-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-26-SPA2" -start_run(cfg,codeCheck=FALSE) - - -##dev -cfg$title <- "SSP2_Ref_dev" -cfg <- setScenario(cfg,c("SSP2","NPI")) -cfg$gms$c56_pollutant_prices <- "SSP2-Ref-SPA0-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-Ref-SPA0" -cfg$gms$bioenergy <- "1stgen_priced_dec18" -cfg$gms$processing <- "substitution_dec18" -start_run(cfg,codeCheck=FALSE) - - -cfg$title <- "SSP2_26_dev" -cfg <- setScenario(cfg,c("SSP2","NDC")) -cfg$gms$c56_pollutant_prices <- "SSP2-26-SPA2-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-26-SPA2" -cfg$gms$bioenergy <- "1stgen_priced_dec18" -cfg$gms$processing <- "substitution_dec18" -start_run(cfg,codeCheck=FALSE) - diff --git a/scripts/start/recalibrate.R b/scripts/start/recalibrate.R index 61d04a7472..76ff87e31c 100644 --- a/scripts/start/recalibrate.R +++ b/scripts/start/recalibrate.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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/scripts/start/run_time.R b/scripts/start/run_time.R deleted file mode 100644 index 3a85700045..0000000000 --- a/scripts/start/run_time.R +++ /dev/null @@ -1,52 +0,0 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# | Contact: magpie@pik-potsdam.de - - -###################################### -#### Script to start a MAgPIE run #### -###################################### - -library(lucode) -library(magclass) - -# Load start_run(cfg) function which is needed to start MAgPIE runs -source("scripts/start_functions.R") - -#start MAgPIE run -source("config/default.cfg") -cfg$results_folder <- "output/:title:" -cfg$gms$c_timesteps <- "coup2100" - -cfg$gms$c80_nlp_solver <- "conopt4" -cfg$gms$s80_optfile <- 0 - -cfg$recalibrate <- TRUE - -for (res in c("h200","h600","h1000")) { - for (scen in c("Base","Pol")) { - for (food in c("E1","E0")) { - for (fcost in c("m","f")) { - cfg$input <- c(paste0("isimip_rcp-IPSL_CM5A_LR-rcp2p6-noco2_rev30_",res,"_8a828c6ed5004e77d1ba2025e8ea2261.tgz"), - "rev3.17_8a828c6ed5004e77d1ba2025e8ea2261_magpie.tgz", - "rev3.17_8a828c6ed5004e77d1ba2025e8ea2261_validation.tgz", - "additional_data_rev3.32.tgz") - if (scen == "Base") { - cfg$gms$c56_pollutant_prices <- "SSP2-Ref-SPA0-V15-REMIND-MAGPIE" - cfg$gms$c60_2ndgen_biodem <- "SSP2-Ref-SPA0" - } else { - cfg$gms$c56_pollutant_prices <- "SSP2-26-SPA0-V15-REMIND-MAGPIE" - cfg$gms$c60_2ndgen_biodem <- "SSP2-26-SPA0" - } - if (food == "E1") cfg$gms$s15_elastic_demand <- 1 else cfg$gms$s15_elastic_demand <- 0 - if (fcost == "m") cfg$gms$factor_costs <- "mixed_feb17" else cfg$gms$factor_costs <- "fixed_per_ton_mar18" - - cfg$title <- paste(res,scen,food,fcost,sep="_") - print(cfg$title) - start_run(cfg,codeCheck=FALSE) - } - } - } -} diff --git a/scripts/start/sim4nexus.R b/scripts/start/sim4nexus.R index 0dd562172f..731c112595 100644 --- a/scripts/start/sim4nexus.R +++ b/scripts/start/sim4nexus.R @@ -1,13 +1,14 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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 -########################################################## -#### Script to MAgPIE test runs #### -########################################################## +############################################################ +#### Script for the generation of SIM4NEXUS simulations #### +############################################################ library(lucode) source("scripts/start_functions.R") @@ -17,124 +18,136 @@ source("config/default.cfg") #set defaults codeCheck <- FALSE -buildInputVector <- function(regionmapping = "sim4nexus", +buildInputVector <- function(regionmapping = "agmip", project_name = "isimip_rcp", climatescen_name= "rcp2p6", co2 = "noco2", climate_model = "IPSL_CM5A_LR", - resolution = "h200", - archive_rev = "24.1", - madrat_rev = "3.3", - validation_rev = "3.3", - additional_data = "additional_data_rev3.16.tgz") { - mappings <- c(h11="8a828c6ed5004e77d1ba2025e8ea2261", - h12="690d3718e151be1b450b394c1064b1c5", + resolution = "c400", + archive_rev = "34", + madrat_rev = "4.14", + validation_rev = "4.14", + calibration = NULL, + additional_data = "additional_data_rev3.65.tgz") { + mappings <- c(H11="8a828c6ed5004e77d1ba2025e8ea2261", + H12="690d3718e151be1b450b394c1064b1c5", mag="c30c1c580039c2b300d86cc46ff4036a", - sim4nexus= "270870819da5607e288b6d0e5a5e6594") + agmip="c77f075908c3bc29bdbe1976165eccaf", + sim4nexus="25dd7264e8e145385b3bd0b89ec5f3fc", + capri="e7e72fddc44cc3d546af7b038c651f51") archive_name=paste(project_name,climate_model,climatescen_name,co2,sep="-") archive <- paste0(archive_name, "_rev", archive_rev, "_", resolution, "_", mappings[regionmapping], ".tgz") - madrat <- paste0("magpie_", mappings[regionmapping], "_rev", madrat_rev, ".tgz") - validation <- paste0("validation_", mappings[regionmapping], "_rev", validation_rev, ".tgz") - return(c(archive,madrat,validation,additional_data)) + madrat <- paste0("rev", madrat_rev,"_", mappings[regionmapping], "_magpie", ".tgz") + validation <- paste0("rev", validation_rev,"_", mappings[regionmapping], "_validation", ".tgz") + return(c(archive,madrat,validation,calibration,additional_data)) } -### Single runs ### +### SIM4NEXUS runs ### #general settings -cfg$gms$c_timesteps <- 7 -cfg$gms$s15_elastic_demand <- 1 -cfg$gms$food <- "intake_dez17" +cfg$gms$c_timesteps <- "coup2100" +cfg$input <- buildInputVector() +cfg$output <- c(cfg$output,"sustag_report") +cfg$recalibrate <- FALSE -# clalibration runs +# SSP control runs############################################### -cfg$title <- "SUSTAg2" -cfg<-lucode::setScenario(cfg,"SUSTAg2") +# SSP2 +cfg$title <- "SSP2_standard" +cfg<-lucode::setScenario(cfg,"SSP2") +cfg<-lucode::setScenario(cfg,"nocc") cfg$force_download <- TRUE -cfg$gms$factor_costs="fixed_per_ton_nov16" cfg$input <- buildInputVector(co2="co2") -cfg$recalibrate <- TRUE -start_run(cfg=cfg,codeCheck=codeCheck) -cfg$recalibrate <- FALSE +#cfg$recalibrate <- TRUE +#start_run(cfg=cfg,codeCheck=codeCheck) +#cfg$recalibrate <- FALSE +# SSP1 +cfg$title <- "SSP1" +cfg<-lucode::setScenario(cfg,"SSP1") +cfg<-lucode::setScenario(cfg,"nocc") +cfg$recalibrate <- TRUE +cfg$input <- buildInputVector(co2="nocc",regionmapping = "sim4nexus") +start_run(cfg=cfg,codeCheck=codeCheck) +calib<-magpie4::submitCalibration(name = "calibration_sim4nexus_jan2019.tgz") +cfg$recalibrate <- "ifneeded" -# SSP1 family +# SSP2 +cfg$title <- "SSP2" +cfg<-lucode::setScenario(cfg,"SSP2") +cfg<-lucode::setScenario(cfg,"nocc") +cfg$input <- buildInputVector(co2="nocc",regionmapping = "sim4nexus",calibration=calib) +start_run(cfg=cfg,codeCheck=codeCheck) -cfg$title <- "SUSTAg1" -cfg<-lucode::setScenario(cfg,"SUSTAg1") -cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp2p6") +# SSP3 +cfg$title <- "SSP3" +cfg<-lucode::setScenario(cfg,"SSP3") +cfg<-lucode::setScenario(cfg,"nocc") +cfg$input <- buildInputVector(co2="nocc",regionmapping = "sim4nexus",calibration=calib) start_run(cfg=cfg,codeCheck=codeCheck) -# SSP3 family +# SSP4 +cfg$title <- "SSP4" +cfg<-lucode::setScenario(cfg,"SSP4") +cfg<-lucode::setScenario(cfg,"nocc") +cfg$input <- buildInputVector(co2="nocc",regionmapping = "sim4nexus",calibration=calib) +start_run(cfg=cfg,codeCheck=codeCheck) -cfg$title <- "SUSTAg3" -cfg<-lucode::setScenario(cfg,"SUSTAg3") -cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp6p0") +# SSP5 +cfg$title <- "SSP5" +cfg<-lucode::setScenario(cfg,"SSP5") +cfg<-lucode::setScenario(cfg,"nocc") +cfg$input <- buildInputVector(co2="nocc",regionmapping = "sim4nexus",calibration=calib) start_run(cfg=cfg,codeCheck=codeCheck) -# SSP4 family -cfg$title <- "SUSTAg4" -cfg<-lucode::setScenario(cfg,"SUSTAg4") -cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp4p5") -start_run(cfg=cfg,codeCheck=codeCheck) -# SSP5 family -cfg$title <- "SUSTAg5" -cfg<-lucode::setScenario(cfg,"SUSTAg5") -cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp4p5") -start_run(cfg=cfg,codeCheck=codeCheck) +#SIM4NEXUS standard runs############################################# #SSP2 family -# SSP2 control run -cfg$title <- "SSP2" +# SSP2 Baseline RCP6.0 without CC mitigation +cfg$title <- "SSP2_base_rcp6p0" cfg<-lucode::setScenario(cfg,"SSP2") -cfg$input <- buildInputVector(co2="noco2") +cfg<-lucode::setScenario(cfg,"cc") +cfg$input <- buildInputVector(co2="nocc",climatescen_name="rcp6p0",regionmapping = "sim4nexus",calibration=calib) start_run(cfg=cfg,codeCheck=codeCheck) -cfg$title <- "SUSTAg2_Ref" -cfg<-lucode::setScenario(cfg,"SUSTAg2") -cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp6p0") -cfg$gms$c56_pollutant_prices <- "SSP2-Ref-SPA0-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-Ref-SPA0" -cfg$recalibrate <- TRUE -start_run(cfg=cfg,codeCheck=codeCheck) -cfg$recalibrate <- FALSE -cfg$title <- "SUSTAg2_nocc" -cfg<-lucode::setScenario(cfg,"SUSTAg2") -cfg$input <- buildInputVector(co2="noco2") -cfg<-lucode::setScenario(cfg,"nocc") -cfg$recalibrate <- TRUE +# SSP2 Mitigation RCP2.6 +cfg$title <- "SSP2_policy_rcp2p6" +cfg<-lucode::setScenario(cfg,"SSP2") +cfg<-lucode::setScenario(cfg,"cc") +cfg$input <- buildInputVector(co2="nocc",climatescen_name="rcp2p6",regionmapping = "sim4nexus",calibration=calib) +cfg$gms$c56_pollutant_prices <- "SSPDB-SSP2-26-MESSAGE-GLOBIOM" +cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP2-26-MESSAGE-GLOBIOM" +cfg$gms$forestry <- "affore_vegc_dec16" +cfg$gms$maccs <- "on_sep16" start_run(cfg=cfg,codeCheck=codeCheck) -cfg$recalibrate <- FALSE -cfg$title <- "SUSTAg2_co2fix" -cfg<-lucode::setScenario(cfg,"SUSTAg2") -cfg$input <- buildInputVector(co2="noco2") -cfg$recalibrate <- TRUE + +# SSP2 Baseline RCP6.0 without CC mitigation with EFP +cfg$title <- "SSP2_base_rcp6p0_efp" +cfg<-lucode::setScenario(cfg,"SSP2") +cfg<-lucode::setScenario(cfg,"cc") +cfg$input <- buildInputVector(co2="nocc",climatescen_name="rcp6p0",regionmapping = "sim4nexus",calibration=calib) +cfg$gms$c42_env_flow_policy <- "on" start_run(cfg=cfg,codeCheck=codeCheck) -cfg$recalibrate <- FALSE -cfg$title <- "SUSTAg2_Ref_co2fix" -cfg<-lucode::setScenario(cfg,"SUSTAg2") -cfg$input <- buildInputVector(co2="noco2",climatescen_name="rcp6p0") -cfg$gms$c56_pollutant_prices <- "SSP2-Ref-SPA0-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-Ref-SPA0" -cfg$recalibrate <- TRUE + +# SSP2 Mitigation RCP2.6 with EFP +cfg$title <- "SSP2_policy_rcp2p6_efp" +cfg<-lucode::setScenario(cfg,"SSP2") +cfg<-lucode::setScenario(cfg,"cc") +cfg$input <- buildInputVector(co2="nocc",climatescen_name="rcp2p6",regionmapping = "sim4nexus",calibration=calib) +cfg$gms$c56_pollutant_prices <- "SSPDB-SSP2-26-MESSAGE-GLOBIOM" +cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP2-26-MESSAGE-GLOBIOM" +cfg$gms$forestry <- "affore_vegc_dec16" +cfg$gms$maccs <- "on_sep16" +cfg$gms$c42_env_flow_policy <- "on" start_run(cfg=cfg,codeCheck=codeCheck) -cfg$recalibrate <- FALSE -### mixed -cfg$title <- "SUSTAg2_mixedfactorcosts" -cfg<-lucode::setScenario(cfg,"SUSTAg2") -cfg$input <- buildInputVector(co2="co2") -cfg$gms$factor_costs="mixed_feb17" -cfg$recalibrate <- TRUE -start_run(cfg=cfg,codeCheck=codeCheck) -cfg$recalibrate <- FALSE -cfg$gms$factor_costs="fixed_per_ton_nov16" diff --git a/scripts/start/sim4nexus_temporary.R b/scripts/start/sim4nexus_temporary.R deleted file mode 100644 index 43219f00da..0000000000 --- a/scripts/start/sim4nexus_temporary.R +++ /dev/null @@ -1,55 +0,0 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# | Contact: magpie@pik-potsdam.de - - -########################################################## -#### Script to MAgPIE test runs #### -########################################################## - -library(lucode) -source("scripts/start_functions.R") -source("scripts/performance_test.R") -source("config/default.cfg") - -#set defaults -codeCheck <- FALSE - -buildInputVector <- function(regionmapping = "sim4nexus", - project_name = "isimip_rcp", - climatescen_name= "rcp2p6", - co2 = "noco2", - climate_model = "IPSL_CM5A_LR", - resolution = "h200", - archive_rev = "24.1", - madrat_rev = "3.3", - validation_rev = "3.3", - additional_data = "additional_data_rev3.16.tgz") { - mappings <- c(h11="8a828c6ed5004e77d1ba2025e8ea2261", - h12="690d3718e151be1b450b394c1064b1c5", - mag="c30c1c580039c2b300d86cc46ff4036a", - sim4nexus= "270870819da5607e288b6d0e5a5e6594") - archive_name=paste(project_name,climate_model,climatescen_name,co2,sep="-") - archive <- paste0(archive_name, "_rev", archive_rev, "_", resolution, "_", mappings[regionmapping], ".tgz") - madrat <- paste0("magpie_", mappings[regionmapping], "_rev", madrat_rev, ".tgz") - validation <- paste0("validation_", mappings[regionmapping], "_rev", validation_rev, ".tgz") - return(c(archive,madrat,validation,additional_data)) -} - -### Single runs ### -#general settings -cfg$gms$c_timesteps <- 7 -cfg$gms$s15_elastic_demand <- 1 -cfg$gms$food <- "intake_dez17" - -# clalibration runs - -cfg$title <- "SUSTAg1" -cfg<-lucode::setScenario(cfg,"SUSTAg1") -cfg$force_download <- TRUE -cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp2p6") -cfg$recalibrate <- TRUE -start_run(cfg=cfg,codeCheck=codeCheck) -cfg$recalibrate <- FALSE diff --git a/scripts/start/ssp2.R b/scripts/start/ssp2.R new file mode 100644 index 0000000000..9ca0be1d31 --- /dev/null +++ b/scripts/start/ssp2.R @@ -0,0 +1,48 @@ +# | (C) 2008-2019 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 + + +###################################### +#### Script to start a MAgPIE run #### +###################################### + +library(lucode) +library(magclass) + +# Load start_run(cfg) function which is needed to start MAgPIE runs +source("scripts/start_functions.R") + +#start MAgPIE run +source("config/default.cfg") + +cfg$force_download <- TRUE + +cfg$results_folder <- "output/:title:" + +cfg$title <- "R2M41_SSP2_NPi_v5" +cfg <- setScenario(cfg,c("SSP2","NPI")) +cfg$gms$c56_pollutant_prices <- "R2M41-SSP2-NPi" +cfg$gms$c60_2ndgen_biodem <- "R2M41-SSP2-NPi" +start_run(cfg,codeCheck=FALSE) + +cfg$title <- "R2M41_SSP2_NDC_v5" +cfg <- setScenario(cfg,c("SSP2","NDC")) +cfg$gms$c56_pollutant_prices <- "R2M41-SSP2-NDC" +cfg$gms$c60_2ndgen_biodem <- "R2M41-SSP2-NDC" +start_run(cfg,codeCheck=FALSE) + +cfg$title <- "R2M41_SSP2_Budg600_v5" +cfg <- setScenario(cfg,c("SSP2","NDC")) +cfg$gms$c56_pollutant_prices <- "R2M41-SSP2-Budg600" +cfg$gms$c60_2ndgen_biodem <- "R2M41-SSP2-Budg600" +start_run(cfg,codeCheck=FALSE) + +cfg$title <- "SSPDB_SSP2_26_v5" +cfg <- setScenario(cfg,c("SSP2","NDC")) +cfg$gms$c56_pollutant_prices <- "SSPDB-SSP2-26-REMIND-MAGPIE" +cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP2-26-REMIND-MAGPIE" +start_run(cfg,codeCheck=FALSE) diff --git a/scripts/start/ssp_cc.R b/scripts/start/ssp_cc.R deleted file mode 100644 index 609ead04ab..0000000000 --- a/scripts/start/ssp_cc.R +++ /dev/null @@ -1,176 +0,0 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# | Contact: magpie@pik-potsdam.de - - -###################################### -#### Script to start a MAgPIE run #### -###################################### - -library(lucode) -library(magclass) - -# Load start_run(cfg) function which is needed to start MAgPIE runs -source("scripts/start_functions.R") - -#start MAgPIE run -source("config/default.cfg") -cfg$results_folder <- "output/:title:" -cfg$recalibrate <- FALSE - -#res -res <- "c200" -cfg$input[1] <- paste0("isimip_rcp-IPSL_CM5A_LR-rcp2p6-co2_rev34_",res,"_690d3718e151be1b450b394c1064b1c5.tgz") -cfg$input[5] <- paste0("calibration_H12_",res,"_12Sep18.tgz") - -### Runs without CC - -##SSP1 -cfg$title <- paste("SSP1_Ref",res,sep="_") -cfg <- setScenario(cfg,c("SSP1","NPI")) -cfg$gms$c56_pollutant_prices <- "SSP1-Ref-SPA0-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP1-Ref-SPA0" -start_run(cfg,codeCheck=FALSE) - -cfg$title <- paste("SSP1_26",res,sep="_") -cfg <- setScenario(cfg,c("SSP1","NDC")) -cfg$gms$c56_pollutant_prices <- "SSP1-26-SPA1-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP1-26-SPA1" -start_run(cfg,codeCheck=FALSE) - -##SSP2 -cfg$title <- paste("SSP2_Ref",res,sep="_") -cfg <- setScenario(cfg,c("SSP2","NPI")) -cfg$gms$c56_pollutant_prices <- "SSP2-Ref-SPA0-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-Ref-SPA0" -start_run(cfg,codeCheck=FALSE) - -cfg$title <- paste("SSP2_26",res,sep="_") -cfg <- setScenario(cfg,c("SSP2","NDC")) -cfg$gms$c56_pollutant_prices <- "SSP2-26-SPA2-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-26-SPA2" -start_run(cfg,codeCheck=FALSE) - -##SSP3 -cfg$title <- paste("SSP3_Ref",res,sep="_") -cfg <- setScenario(cfg,c("SSP3","NPI")) -cfg$gms$c56_pollutant_prices <- "SSP2-Ref-SPA0-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-Ref-SPA0" -start_run(cfg,codeCheck=FALSE) - -cfg$title <- paste("SSP3_26",res,sep="_") -cfg <- setScenario(cfg,c("SSP3","NDC")) -cfg$gms$c56_pollutant_prices <- "SSP2-26-SPA2-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-26-SPA2" -start_run(cfg,codeCheck=FALSE) - -##SSP4 -cfg$title <- paste("SSP4_Ref",res,sep="_") -cfg <- setScenario(cfg,c("SSP4","NPI")) -cfg$gms$c56_pollutant_prices <- "SSP2-Ref-SPA0-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-Ref-SPA0" -start_run(cfg,codeCheck=FALSE) - -cfg$title <- paste("SSP4_26",res,sep="_") -cfg <- setScenario(cfg,c("SSP4","NDC")) -cfg$gms$c56_pollutant_prices <- "SSP2-26-SPA2-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-26-SPA2" -start_run(cfg,codeCheck=FALSE) - -##SSP5 -cfg$title <- paste("SSP5_Ref",res,sep="_") -cfg <- setScenario(cfg,c("SSP5","NPI")) -cfg$gms$c56_pollutant_prices <- "SSP5-Ref-SPA0-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP5-Ref-SPA0" -start_run(cfg,codeCheck=FALSE) - -cfg$title <- paste("SSP5_26",res,sep="_") -cfg <- setScenario(cfg,c("SSP5","NDC")) -cfg$gms$c56_pollutant_prices <- "SSP5-26-SPA5-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP5-26-SPA5" -start_run(cfg,codeCheck=FALSE) - -### Runs with CC - -#CC -cfg$gms$c14_yields_scenario <- "cc" -cfg$gms$c42_watdem_scenario <- "cc" -cfg$gms$c43_watavail_scenario <- "cc" -cfg$gms$c52_carbon_scenario <- "cc" - -##SSP1 -cfg$title <- paste("SSP1_Ref_RCP60_co2",res,sep="_") -cfg <- setScenario(cfg,c("SSP1","NPI")) -cfg$gms$c56_pollutant_prices <- "SSP1-Ref-SPA0-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP1-Ref-SPA0" -cfg$input[1] <- paste0("isimip_rcp-IPSL_CM5A_LR-rcp6p0-co2_rev34_",res,"_690d3718e151be1b450b394c1064b1c5.tgz") -start_run(cfg,codeCheck=FALSE) - -cfg$title <- paste("SSP1_26_RCP26_co2",res,sep="_") -cfg <- setScenario(cfg,c("SSP1","NDC")) -cfg$gms$c56_pollutant_prices <- "SSP1-26-SPA1-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP1-26-SPA1" -cfg$input[1] <- paste0("isimip_rcp-IPSL_CM5A_LR-rcp2p6-co2_rev34_",res,"_690d3718e151be1b450b394c1064b1c5.tgz") -start_run(cfg,codeCheck=FALSE) - -##SSP2 -cfg$title <- paste("SSP2_Ref_RCP60_co2",res,sep="_") -cfg <- setScenario(cfg,c("SSP2","NPI")) -cfg$gms$c56_pollutant_prices <- "SSP2-Ref-SPA0-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-Ref-SPA0" -cfg$input[1] <- paste0("isimip_rcp-IPSL_CM5A_LR-rcp6p0-co2_rev34_",res,"_690d3718e151be1b450b394c1064b1c5.tgz") -start_run(cfg,codeCheck=FALSE) - -cfg$title <- paste("SSP2_26_RCP26_co2",res,sep="_") -cfg <- setScenario(cfg,c("SSP2","NDC")) -cfg$gms$c56_pollutant_prices <- "SSP2-26-SPA2-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-26-SPA2" -cfg$input[1] <- paste0("isimip_rcp-IPSL_CM5A_LR-rcp2p6-co2_rev34_",res,"_690d3718e151be1b450b394c1064b1c5.tgz") -start_run(cfg,codeCheck=FALSE) - -##SSP3 -cfg$title <- paste("SSP3_Ref_RCP60_co2",res,sep="_") -cfg <- setScenario(cfg,c("SSP3","NPI")) -cfg$gms$c56_pollutant_prices <- "SSP2-Ref-SPA0-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-Ref-SPA0" -cfg$input[1] <- paste0("isimip_rcp-IPSL_CM5A_LR-rcp6p0-co2_rev34_",res,"_690d3718e151be1b450b394c1064b1c5.tgz") -start_run(cfg,codeCheck=FALSE) - -cfg$title <- paste("SSP3_26_RCP26_co2",res,sep="_") -cfg <- setScenario(cfg,c("SSP3","NDC")) -cfg$gms$c56_pollutant_prices <- "SSP2-26-SPA2-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-26-SPA2" -cfg$input[1] <- paste0("isimip_rcp-IPSL_CM5A_LR-rcp2p6-co2_rev34_",res,"_690d3718e151be1b450b394c1064b1c5.tgz") -start_run(cfg,codeCheck=FALSE) - -##SSP4 -cfg$title <- paste("SSP4_Ref_RCP60_co2",res,sep="_") -cfg <- setScenario(cfg,c("SSP4","NPI")) -cfg$gms$c56_pollutant_prices <- "SSP2-Ref-SPA0-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-Ref-SPA0" -cfg$input[1] <- paste0("isimip_rcp-IPSL_CM5A_LR-rcp6p0-co2_rev34_",res,"_690d3718e151be1b450b394c1064b1c5.tgz") -start_run(cfg,codeCheck=FALSE) - -cfg$title <- paste("SSP4_26_RCP26_co2",res,sep="_") -cfg <- setScenario(cfg,c("SSP4","NDC")) -cfg$gms$c56_pollutant_prices <- "SSP2-26-SPA2-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-26-SPA2" -cfg$input[1] <- paste0("isimip_rcp-IPSL_CM5A_LR-rcp2p6-co2_rev34_",res,"_690d3718e151be1b450b394c1064b1c5.tgz") -start_run(cfg,codeCheck=FALSE) - -##SSP5 -cfg$title <- paste("SSP5_Ref_RCP60_co2",res,sep="_") -cfg <- setScenario(cfg,c("SSP5","NPI")) -cfg$gms$c56_pollutant_prices <- "SSP5-Ref-SPA0-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP5-Ref-SPA0" -cfg$input[1] <- paste0("isimip_rcp-IPSL_CM5A_LR-rcp6p0-co2_rev34_",res,"_690d3718e151be1b450b394c1064b1c5.tgz") -start_run(cfg,codeCheck=FALSE) - -cfg$title <- paste("SSP5_26_RCP26_co2",res,sep="_") -cfg <- setScenario(cfg,c("SSP5","NDC")) -cfg$gms$c56_pollutant_prices <- "SSP5-26-SPA5-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP5-26-SPA5" -cfg$input[1] <- paste0("isimip_rcp-IPSL_CM5A_LR-rcp2p6-co2_rev34_",res,"_690d3718e151be1b450b394c1064b1c5.tgz") -start_run(cfg,codeCheck=FALSE) diff --git a/scripts/start/ssp_deforestation.R b/scripts/start/ssp_deforestation.R index 83df2dc01c..4ce8ed08a1 100644 --- a/scripts/start/ssp_deforestation.R +++ b/scripts/start/ssp_deforestation.R @@ -1,111 +1,112 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# | Contact: magpie@pik-potsdam.de - - -###################################### -#### Script to start a MAgPIE run #### -###################################### - -library(lucode) -library(magclass) - -# Load start_run(cfg) function which is needed to start MAgPIE runs -source("scripts/start_functions.R") - -#start MAgPIE run -source("config/default.cfg") - -cfg$results_folder <- "output/:title:" -cfg$recalibrate <- TRUE -cfg$force_download <- TRUE - -#specify the title flag for all the scenarios -#flag <- "" - -#SSPs -for(reg in c("BRA","H12")) { - if(reg=="BRA"){ - ## Brazil run with 500 clusters and extra weight to region BRA - cellcode <- "n500_BRA18_LAM26_ROW01" - regionscode <- "d49a7a8baaab0edc754ebfc09462be0a" - } else if(reg=="H12") { - ## 12 region run with 200 clusters - cellcode <- "h200" - regionscode <- "690d3718e151be1b450b394c1064b1c5" - } else { - stop("Unknown region setting!") - } - - ## Test for artificial NPI policy for Japan. - ## forest_pro is forest protection in JPN - ## forest_nopro is no NPI in JPN with older version of additional_data_rev3.43 - - forest_pro <- c(paste0("isimip_rcp-IPSL_CM5A_LR-rcp2p6-noco2_rev33_",cellcode,"_",regionscode,".tgz"), - paste0("rev3.35_",regionscode,"_magpie.tgz"), - paste0("rev3.35_",regionscode,"_validation.tgz"), - "additional_data_rev3.44.tgz") - forest_nopro <- c(paste0("isimip_rcp-IPSL_CM5A_LR-rcp2p6-noco2_rev33_",cellcode,"_",regionscode,".tgz"), - paste0("rev3.35_",regionscode,"_magpie.tgz"), - paste0("rev3.35_",regionscode,"_validation.tgz"), - "additional_data_rev3.43.tgz") - - ## Three SSP scenarios to analyse - for (ssp in c("SSP2","SSP1","SSP5")) { - ## reference and mitigation runs (without co2 fertilization) - for (rcp in c("ref","26")){ - #if(rcp=="26" && ssp %in% c("SSP3","SSP4")) next - - ## lg is livestock gridded implementation by Kristine. ptc15 is pasture transport cost of 0.15 by Geanderson - for(tc in c("lg","ptc15")) { - - ## JPNfp is forest protection in JPN related to forest_pro - ## JPNdf is no forest protection in JPN related to forest_nopro - for(jpn in c("JPNfp","JPNdf")){ - - ## Two realization for Tau implementation. - for(tau in c("endo_JUN16","endo_jun18")){ - - cfg$title <- paste(reg,tc,jpn,tau,ssp,rcp,sep="_") - - cfg <- setScenario(cfg,c(ssp,if(rcp=="ref") "NPI" else "NDC")) - - if(rcp=="Ref"){spa="SPA0"}else{spa=paste0("SPA",substring(ssp,4,5))} - if(ssp%in%c("SSP1","SSP2","SSP5")){ - model="REMIND-MAgPIE" - } else if (ssp=="SSP3"){ - model="AIM-CGE" - } else { - model="GCAM4" - } - cfg$gms$c56_pollutant_prices <- paste(ssp,rcp,spa,"V15",model,sep="-") - cfg$gms$c60_2ndgen_biodem <- paste(if(ssp %in% c("SSP3","SSP4")) "SSP2" else ssp,rcp,"SPA0",sep="-") - - cfg$gms$tc <- tau - - if(jpn=="JPNdf"){ - cfg$input <- forest_nopro - } else if(jpn=="JPNfp"){ - cfg$input <- forest_pro - } else stop("Unknown transport cost setting!") - - if(tc=="ptc15") { - cfg$gms$s40_pasture_transport_costs <- 0.15 #ptc15 - cfg$damping_factor <- 0.7 - cfg$gms$disagg_lvst <- "off" - } else if(tc=="lg") { - cfg$gms$s40_pasture_transport_costs <- 0 - cfg$damping_factor <- 0.98 - cfg$gms$disagg_lvst <- "simple_oct17" - } else stop("Unknown transport cost setting!") - - ## Submit the runs - start_run(cfg,codeCheck=FALSE) - } - } - } - } - } -} +# | (C) 2008-2019 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 + + +###################################### +#### Script to start a MAgPIE run #### +###################################### + +library(lucode) +library(magclass) + +# Load start_run(cfg) function which is needed to start MAgPIE runs +source("scripts/start_functions.R") + +#start MAgPIE run +source("config/default.cfg") + +cfg$results_folder <- "output/:title:" +cfg$recalibrate <- TRUE +cfg$force_download <- TRUE + +#specify the title flag for all the scenarios +#flag <- "" + +#SSPs +for(reg in c("BRA","H12")) { + if(reg=="BRA"){ + ## Brazil run with 500 clusters and extra weight to region BRA + cellcode <- "n500_BRA18_LAM26_ROW01" + regionscode <- "d49a7a8baaab0edc754ebfc09462be0a" + } else if(reg=="H12") { + ## 12 region run with 200 clusters + cellcode <- "h200" + regionscode <- "690d3718e151be1b450b394c1064b1c5" + } else { + stop("Unknown region setting!") + } + + ## Test for artificial NPI policy for Japan. + ## forest_pro is forest protection in JPN + ## forest_nopro is no NPI in JPN with older version of additional_data_rev3.43 + + forest_pro <- c(paste0("isimip_rcp-IPSL_CM5A_LR-rcp2p6-noco2_rev33_",cellcode,"_",regionscode,".tgz"), + paste0("rev3.35_",regionscode,"_magpie.tgz"), + paste0("rev3.35_",regionscode,"_validation.tgz"), + "additional_data_rev3.44.tgz") + forest_nopro <- c(paste0("isimip_rcp-IPSL_CM5A_LR-rcp2p6-noco2_rev33_",cellcode,"_",regionscode,".tgz"), + paste0("rev3.35_",regionscode,"_magpie.tgz"), + paste0("rev3.35_",regionscode,"_validation.tgz"), + "additional_data_rev3.43.tgz") + + ## Three SSP scenarios to analyse + for (ssp in c("SSP2","SSP1","SSP5")) { + ## reference and mitigation runs (without co2 fertilization) + for (rcp in c("ref","26")){ + #if(rcp=="26" && ssp %in% c("SSP3","SSP4")) next + + ## lg is livestock gridded implementation by Kristine. ptc15 is pasture transport cost of 0.15 by Geanderson + for(tc in c("lg","ptc15")) { + + ## JPNfp is forest protection in JPN related to forest_pro + ## JPNdf is no forest protection in JPN related to forest_nopro + for(jpn in c("JPNfp","JPNdf")){ + + ## Two realization for Tau implementation. + for(tau in c("endo_JUN16","endo_jun18")){ + + cfg$title <- paste(reg,tc,jpn,tau,ssp,rcp,sep="_") + + cfg <- setScenario(cfg,c(ssp,if(rcp=="ref") "NPI" else "NDC")) + + if(rcp=="Ref"){spa="SPA0"}else{spa=paste0("SPA",substring(ssp,4,5))} + if(ssp%in%c("SSP1","SSP2","SSP5")){ + model="REMIND-MAgPIE" + } else if (ssp=="SSP3"){ + model="AIM-CGE" + } else { + model="GCAM4" + } + cfg$gms$c56_pollutant_prices <- paste("SSPDB",ssp,rcp,model,sep="-") + cfg$gms$c60_2ndgen_biodem <- paste("SSPDB",ssp,rcp,model,sep="-") + + cfg$gms$tc <- tau + + if(jpn=="JPNdf"){ + cfg$input <- forest_nopro + } else if(jpn=="JPNfp"){ + cfg$input <- forest_pro + } else stop("Unknown transport cost setting!") + + if(tc=="ptc15") { + cfg$gms$s40_pasture_transport_costs <- 0.15 #ptc15 + cfg$damping_factor <- 0.7 + cfg$gms$disagg_lvst <- "off" + } else if(tc=="lg") { + cfg$gms$s40_pasture_transport_costs <- 0 + cfg$damping_factor <- 0.98 + cfg$gms$disagg_lvst <- "simple_oct17" + } else stop("Unknown transport cost setting!") + + ## Submit the runs + start_run(cfg,codeCheck=FALSE) + } + } + } + } + } +} diff --git a/scripts/start/sustag.R b/scripts/start/sustag.R index b92103bdc6..a0abac052a 100644 --- a/scripts/start/sustag.R +++ b/scripts/start/sustag.R @@ -1,12 +1,13 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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 ########################################################## -#### Script to MAgPIE test runs #### +#### Script for the generation of SUSTAg simulations #### ########################################################## library(lucode) @@ -17,66 +18,111 @@ source("config/default.cfg") #set defaults codeCheck <- FALSE -buildInputVector <- function(regionmapping = "h11", +buildInputVector <- function(regionmapping = "agmip", project_name = "isimip_rcp", climatescen_name= "rcp2p6", co2 = "noco2", climate_model = "IPSL_CM5A_LR", - resolution = "h200", - archive_rev = "30", - madrat_rev = "4", - validation_rev = "4", - additional_data = "additional_data_rev3.30.tgz") { - mappings <- c(h11="8a828c6ed5004e77d1ba2025e8ea2261", - h12="690d3718e151be1b450b394c1064b1c5", + resolution = "c200", + archive_rev = "34", + madrat_rev = "4.14", + validation_rev = "4.14", + calibration = "calibration_agmip_c200_19Dec18.tgz", + additional_data = "additional_data_rev3.58.tgz") { + mappings <- c(H11="8a828c6ed5004e77d1ba2025e8ea2261", + H12="690d3718e151be1b450b394c1064b1c5", mag="c30c1c580039c2b300d86cc46ff4036a", + agmip="c77f075908c3bc29bdbe1976165eccaf", + sim4nexus="270870819da5607e288b6d0e5a5e6594", + inms="69c65bb3c88e8033cf8df6b5ac5d52a9", + inms2="ef2ae7cd6110d5d142a9f8bd7d5a68f2", capri="e7e72fddc44cc3d546af7b038c651f51") archive_name=paste(project_name,climate_model,climatescen_name,co2,sep="-") archive <- paste0(archive_name, "_rev", archive_rev, "_", resolution, "_", mappings[regionmapping], ".tgz") madrat <- paste0("rev", madrat_rev,"_", mappings[regionmapping], "_magpie", ".tgz") validation <- paste0("rev", validation_rev,"_", mappings[regionmapping], "_validation", ".tgz") - return(c(archive,madrat,validation,additional_data)) + return(c(archive,madrat,validation,calibration,additional_data)) } -### Single runs ### +### SUSTAg runs ### #general settings cfg$gms$c_timesteps <- 12 -cfg$input <- buildInputVector(regionmapping="h11") +cfg$input <- buildInputVector() cfg$output <- c(cfg$output,"sustag_report") +cfg$recalibrate <- FALSE -# clalibration runs -cfg$title <- "SUSTAg2" -cfg<-lucode::setScenario(cfg,"SUSTAg2") +# SSP control runs############################################### + +# SSP2 +cfg$title <- "SSP2" +cfg<-lucode::setScenario(cfg,"SSP2") +cfg<-lucode::setScenario(cfg,"nocc") cfg$force_download <- TRUE -cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp2p6") -cfg$recalibrate <- FALSE +cfg$input <- buildInputVector(co2="co2") +#cfg$recalibrate <- TRUE +start_run(cfg=cfg,codeCheck=codeCheck) +#cfg$recalibrate <- FALSE + +# SSP1 +cfg$title <- "SSP1" +cfg<-lucode::setScenario(cfg,"SSP1") +cfg<-lucode::setScenario(cfg,"nocc") +cfg$input <- buildInputVector(co2="co2") +start_run(cfg=cfg,codeCheck=codeCheck) + +# SSP3 +cfg$title <- "SSP3" +cfg<-lucode::setScenario(cfg,"SSP3") +cfg<-lucode::setScenario(cfg,"nocc") +cfg$input <- buildInputVector(co2="co2") +start_run(cfg=cfg,codeCheck=codeCheck) + +# SSP4 +cfg$title <- "SSP4" +cfg<-lucode::setScenario(cfg,"SSP4") +cfg<-lucode::setScenario(cfg,"nocc") +cfg$input <- buildInputVector(co2="co2") +start_run(cfg=cfg,codeCheck=codeCheck) + +# SSP5 +cfg$title <- "SSP5" +cfg<-lucode::setScenario(cfg,"SSP5") +cfg<-lucode::setScenario(cfg,"nocc") +cfg$input <- buildInputVector(co2="co2") start_run(cfg=cfg,codeCheck=codeCheck) -cfg$recalibrate <- FALSE -# SSP1 family + + + +#SUSTAg standard runs############################################# + +# SSP1 family cfg$title <- "SUSTAg1" cfg<-lucode::setScenario(cfg,"SUSTAg1") cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp2p6") start_run(cfg=cfg,codeCheck=codeCheck) -# SSP3 family +# SSP2 family +cfg$title <- "SUSTAg2" +cfg<-lucode::setScenario(cfg,"SUSTAg2") +cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp2p6") +start_run(cfg=cfg,codeCheck=codeCheck) +# SSP3 family cfg$title <- "SUSTAg3" cfg<-lucode::setScenario(cfg,"SUSTAg3") cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp6p0") start_run(cfg=cfg,codeCheck=codeCheck) # SSP4 family - cfg$title <- "SUSTAg4" cfg<-lucode::setScenario(cfg,"SUSTAg4") cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp4p5") start_run(cfg=cfg,codeCheck=codeCheck) # SSP5 family - cfg$title <- "SUSTAg5" cfg<-lucode::setScenario(cfg,"SUSTAg5") cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp4p5") @@ -84,45 +130,54 @@ start_run(cfg=cfg,codeCheck=codeCheck) -#SSP2 family - -# SSP2 control run -cfg$title <- "SSP2" -cfg<-lucode::setScenario(cfg,"SSP2") -cfg$input <- buildInputVector(co2="noco2") -start_run(cfg=cfg,codeCheck=codeCheck) +#Sensitivity tests based on SUSTAg2############################### +#SUSTAg2 scenario without global CC mitigation policy cfg$title <- "SUSTAg2_Ref" cfg<-lucode::setScenario(cfg,"SUSTAg2") cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp6p0") -cfg$gms$c56_pollutant_prices <- "SSP2-Ref-SPA0-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-Ref-SPA0" +cfg$gms$c56_pollutant_prices <- "SSPDB-SSP2-Ref-REMIND-MAGPIE" +cfg$gms$c60_2ndgen_biodem <- "SSPDB-SSP2-Ref-REMIND-MAGPIE" start_run(cfg=cfg,codeCheck=codeCheck) +#SUSTAg2 scenario without CC impacts cfg$title <- "SUSTAg2_nocc" cfg<-lucode::setScenario(cfg,"SUSTAg2") -cfg$input <- buildInputVector(co2="noco2") +cfg$input <- buildInputVector(co2="co2") cfg<-lucode::setScenario(cfg,"nocc") start_run(cfg=cfg,codeCheck=codeCheck) -cfg$title <- "SUSTAg2_co2fix" -cfg<-lucode::setScenario(cfg,"SUSTAg2") -cfg$input <- buildInputVector(co2="noco2") -start_run(cfg=cfg,codeCheck=codeCheck) -cfg$title <- "SUSTAg2_Ref_co2fix" +#cfg$title <- "SUSTAg2_co2fix" +#cfg<-lucode::setScenario(cfg,"SUSTAg2") +#cfg$input <- buildInputVector(co2="noco2") +#start_run(cfg=cfg,codeCheck=codeCheck) +# +#cfg$title <- "SUSTAg2_Ref_co2fix" +#cfg<-lucode::setScenario(cfg,"SUSTAg2") +#cfg$input <- buildInputVector(co2="noco2",climatescen_name="rcp6p0") +#cfg$gms$c56_pollutant_prices <- "SSP2-Ref-SPA0-V15-REMIND-MAGPIE" +#cfg$gms$c60_2ndgen_biodem <- "SSP2-Ref-SPA0" +#start_run(cfg=cfg,codeCheck=codeCheck) + +# SUSTAg2 scenario with variation of 1st gen. bioenergy: phaseout2020 +cfg$title <- "SUSTAg2_1stgenbio_phaseout" cfg<-lucode::setScenario(cfg,"SUSTAg2") -cfg$input <- buildInputVector(co2="noco2",climatescen_name="rcp6p0") -cfg$gms$c56_pollutant_prices <- "SSP2-Ref-SPA0-V15-REMIND-MAGPIE" -cfg$gms$c60_2ndgen_biodem <- "SSP2-Ref-SPA0" +cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp2p6") +cfg$gms$c60_1stgen_biodem <- "phaseout2020" start_run(cfg=cfg,codeCheck=codeCheck) -cfg$title <- "SUSTAg2_fixedperton" +# SUSTAg2 scenario with variation of 1st gen. bioenergy: const2030 +cfg$title <- "SUSTAg2_1stgenbio_const2030" cfg<-lucode::setScenario(cfg,"SUSTAg2") -cfg$gms$factor_costs="fixed_per_ton_nov16" -cfg$input <- buildInputVector(co2="co2") +cfg$input <- buildInputVector(co2="co2",climatescen_name="rcp2p6") +cfg$gms$c60_1stgen_biodem <- "const2030" start_run(cfg=cfg,codeCheck=codeCheck) -cfg$gms$factor_costs="mixed_feb17" + + + + + diff --git a/scripts/start/testruns.R b/scripts/start/testruns.R deleted file mode 100644 index b34bdf84e5..0000000000 --- a/scripts/start/testruns.R +++ /dev/null @@ -1,200 +0,0 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# | Contact: magpie@pik-potsdam.de - - -########################################################## -#### Script to MAgPIE test runs #### -########################################################## - -library(lucode) -library(magpie4) - -source("scripts/start_functions.R") -source("scripts/performance_test.R") -source("config/default.cfg") - -buildInputVector <- function(regionmapping = "h11", - project_name = "isimip_rcp", - climatescen_name= "rcp2p6", - co2 = "noco2", - climate_model = "IPSL_CM5A_LR", - resolution = "h200", - archive_rev = "29", - madrat_rev = "3.15", - validation_rev = "3.15", - calibration = NULL, - additional_data = "additional_data_rev3.29.tgz", - npi_base = "npi_ndc_base_SSP2_mixed.tgz") { - mappings <- c(h11="8a828c6ed5004e77d1ba2025e8ea2261", - h12="690d3718e151be1b450b394c1064b1c5", - mag="c30c1c580039c2b300d86cc46ff4036a") - archive_name=paste(project_name,climate_model,climatescen_name,co2,sep="-") - archive <- paste0(archive_name, "_rev", archive_rev, "_", resolution, "_", mappings[regionmapping], ".tgz") - madrat <- paste0("rev", madrat_rev, "_", mappings[regionmapping], "_magpie.tgz") - validation <- paste0("rev", validation_rev, "_", mappings[regionmapping], "_validation.tgz") - return(c(archive,madrat,validation,calibration,additional_data,npi_base)) -} - -fixed <- function(cfg, ...) { - cfg$title <- paste0(cfg$title,"_fixed") - cfg$gms$factor_costs <- "fixed_per_ton_mar18" - cfg$input <- buildInputVector(npi_base="npi_ndc_base_SSP2_fixed.tgz", ...) - return(cfg) -} - -mixed <- function(cfg, ...) { - cfg$title <- paste0(cfg$title,"_mixed") - cfg$gms$factor_costs <- "mixed_feb17" - cfg$input <- buildInputVector(npi_base="npi_ndc_base_SSP2_mixed.tgz", ...) - return(cfg) -} - - -### test run definitions ### - -default <- function(cfg, func=mixed, ...) { - cfg$force_download <- TRUE - cfg$title <- "default" - cfg <- func(cfg, ...) - try(start_run(cfg=cfg, codeCheck=FALSE)) - return(submitCalibration(cfg$title)) -} - -default_rcp26 <- function(cfg, func=mixed, ...) { - cfg$title <- "default_rcp26" - cfg <- func(cfg, ...) - cfg$gms$c56_pollutant_prices <- "SSP2-26-SPA2-V15-REMIND-MAGPIE" - cfg$gms$c60_2ndgen_biodem <- "SSP2-26-SPA2" - try(start_run(cfg=cfg, codeCheck=FALSE)) -} - -performance_bau <- function(cfg, func=mixed, ...) { - cfg$title <- "bau" - cfg <- func(cfg,...) - try(performance_start(cfg=cfg, id=cfg$title, sequential=NA)) -} - -performance_rcp26 <- function(cfg, func=mixed, ...) { - cfg$title <- "rcp26" - cfg <- func(cfg,...) - cfg$gms$c56_pollutant_prices <- "SSP2-26-SPA2-V15-REMIND-MAGPIE" - cfg$gms$c60_2ndgen_biodem <- "SSP2-26-SPA2" - try(performance_start(cfg=cfg, id=cfg$title, sequential=NA)) -} - -cc_default <- function(cfg, func=mixed, ...) { - cfg$title <- "cc_default" - cfg <- func(cfg,...) - cfg <- setScenario(cfg, "cc") - try(start_run(cfg=cfg, codeCheck=FALSE)) -} - -timesteps <- function(cfg, func=mixed, ...) { - cfg$title <- "timesteps" - cfg <- func(cfg,...) - cfg$gms$c_timesteps <- "test_TS" - try(start_run(cfg=cfg, codeCheck=FALSE)) -} - -ssp1 <- function(cfg, func=mixed, ...) { - cfg$title <- "ssp1" - cfg <- func(cfg,...) - try(start_run(cfg=cfg,scenario="SSP1",codeCheck=FALSE)) -} - -ssp5 <- function(cfg, func=mixed, ...) { - cfg$title <- "ssp5" - cfg <- func(cfg,...) - try(start_run(cfg=cfg,scenario="SSP5",codeCheck=FALSE)) -} - -cc_rcp26 <- function(cfg, func=mixed, ...) { - cfg$title <- "cc_rcp26" - cfg <- func(cfg,...) - cfg$gms$c56_pollutant_prices <- "SSP2-26-SPA2-V15-REMIND-MAGPIE" - cfg$gms$c60_2ndgen_biodem <- "SSP2-26-SPA2" - cfg <- setScenario(cfg, "cc") - try(start_run(cfg=cfg, codeCheck=FALSE)) -} - -cc_co2_rcp26 <- function(cfg, func=mixed, ...) { - cfg$title <- "cc_co2_rcp26" - cfg <- func(cfg, co2="co2", ...) - cfg$gms$c56_pollutant_prices <- "SSP2-26-SPA2-V15-REMIND-MAGPIE" - cfg$gms$c60_2ndgen_biodem <- "SSP2-26-SPA2" - cfg <- setScenario(cfg, "cc") - try(start_run(cfg=cfg, codeCheck=FALSE)) -} - -indc <- function(cfg, func=mixed, ...) { - cfg$title <- "indc" - cfg <- func(cfg,...) - try(start_run(cfg=cfg,scenario="INDC",codeCheck=FALSE)) -} - -indc_rcp26 <- function(cfg, func=mixed, ...) { - cfg$title <- "indc_rcp26" - cfg <- func(cfg,...) - cfg$gms$c56_pollutant_prices <- "SSP2-26-SPA2-V15-REMIND-MAGPIE" - cfg$gms$c60_2ndgen_biodem <- "SSP2-26-SPA2" - try(start_run(cfg=cfg,scenario="INDC",codeCheck=FALSE)) -} - -h12 <- function(cfg, func=mixed, ...) { - cfg$title <- "h12" - cfg <- func(cfg, regionmapping = "h12", ...) - try(start_run(cfg=cfg, codeCheck=FALSE)) - return(submitCalibration(cfg$title)) -} - -h12_rcp26 <- function(cfg, func=mixed, ...) { - cfg$title <- "h12_rcp26" - cfg <- func(cfg, regionmapping = "h12", ...) - cfg$gms$c56_pollutant_prices <- "SSP2-26-SPA2-V15-REMIND-MAGPIE" - cfg$gms$c60_2ndgen_biodem <- "SSP2-26-SPA2" - try(start_run(cfg=cfg, codeCheck=FALSE)) -} - - -clusterres <- function(cfg, func=mixed, ...) { - for(res in c("n200","h100","n100","h600","h1000","h2000")) { - cfg$title <- res - cfg <- func(cfg, resolution = res, ...) - try(start_run(cfg=cfg, codeCheck=FALSE)) - } -} - - -### General settings ### -cfg$gms$c_timesteps <- "coup2100" -cfg$output <- "rds_report" -cfg <- setScenario(cfg,"SSP2") - - -### test runs ### - -for(func in c(mixed,fixed)){ - calibration <- default(cfg, func) - default_rcp26(cfg, func, calibration=calibration) - - performance_bau(cfg, func, calibration=calibration) - performance_rcp26(cfg, func, calibration=calibration) - - cc_default(cfg, func, calibration=calibration) - cc_rcp26(cfg, func, calibration=calibration) - cc_co2_rcp26(cfg, func, calibration=calibration) - - timesteps(cfg, func, calibration=calibration) - - ssp1(cfg, func, calibration=calibration) - ssp5(cfg, func, calibration=calibration) - - indc(cfg, func, calibration=calibration) - indc_rcp26(cfg, func, calibration=calibration) - - h12calibration <-h12(cfg, func) - h12_rcp26(cfg, func, calibration=h12calibration) -} diff --git a/scripts/start/tradetest.R b/scripts/start/tradetest.R deleted file mode 100644 index ba15e39373..0000000000 --- a/scripts/start/tradetest.R +++ /dev/null @@ -1,36 +0,0 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ -# | Contact: magpie@pik-potsdam.de - - -###################################### -#### Script to start a MAgPIE run #### -###################################### - -# Load start_run(cfg) function which is needed to start MAgPIE runs -source("scripts/start_functions.R") - - -source("config/default.cfg") - -cfg$gms$trade <- "selfsuff_reduced" - - -for(i in c( - "free2000","regionalized","globalized","fragmented", - "a909090","a908080","a909595","a808080","a807070","a809090", - "l909090r808080","l908080r807070","l909595r809090")){ - cfg$title <- paste0("tradetest_",i) - cfg$gms$c21_trade_liberalization = i - start_run(cfg=cfg) - -} - -source("config/default.cfg") - - -cfg$title <- "default" -#start MAgPIE run -start_run(cfg=cfg) diff --git a/scripts/start_functions.R b/scripts/start_functions.R index bc3200bf89..8a69c7db40 100644 --- a/scripts/start_functions.R +++ b/scripts/start_functions.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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 start_run <- function(cfg,scenario=NULL,codeCheck=TRUE, @@ -78,11 +79,75 @@ start_run <- function(cfg,scenario=NULL,codeCheck=TRUE, #check all setglobal settings for consistency lucode::settingsCheck() - ############# PROCESSING INPUT DATA ########################################## - # Check whether input data has to be processed or is already processed + ########################################################################################################### + ############# PROCESSING INPUT DATA ###################### START ########################################## + ########################################################################################################### + + ################################################################################ + # Define internal functions + ################################################################################ + .update_sets <- function(cpr,map) { + + reg1 <- unique(map$RegionCode) + reg2 <- names(cpr) + if(!all(union(reg1,reg2) %in% intersect(reg1,reg2))) { + stop("Inconsistent region information!", + "\n cpr info: ",paste(reg2,collapse=", "), + "\n spatial header info: ", paste(reg1,collapse=", ")) + } + + + j <- 0; cells <- NULL + for(i in 1:length(cpr)) { + cells <- c(cells,paste(names(cpr)[i],"_",j+1,"*",names(cpr)[i],"_",j+cpr[i],sep="")) + j <- j+cpr[i] + } + + .tmp <- function(x,prefix="", suffix1="", suffix2=" /", collapse=",", n=10) { + content <- NULL + tmp <- lapply(split(x, ceiling(seq_along(x)/n)),paste,collapse=collapse) + end <- suffix1 + for(i in 1:length(tmp)) { + if(i==length(tmp)) end <- suffix2 + content <- c(content,paste0(' ',prefix,tmp[[i]],end)) + } + return(content) + } + + subject <- 'SETS' + modification_warning <- c( + '*THIS CODE IS CREATED AUTOMATICALLY, DO NOT MODIFY THESE LINES DIRECTLY', + '*ANY DIRECT MODIFICATION WILL BE LOST AFTER NEXT INPUT DOWNLOAD', + '*CHANGES CAN BE DONE USING THE INPUT DOWNLOADER UNDER SCRIPTS/DOWNLOAD', + '*THERE YOU CAN ALSO FIND ADDITIONAL INFORMATION') + content <- c(modification_warning,'','sets','') + + content <- c(content,paste(' i all economic regions /',paste(names(cpr),collapse=','),'/',sep=''),'') + + # write iso set with nice formatting (10 countries per line) + tmp <- lapply(split(map$CountryCode, ceiling(seq_along(map$CountryCode)/10)),paste,collapse=",") + content <- c(content,' iso list of iso countries /') + content <- c(content, .tmp(map$CountryCode, suffix1=",", suffix2=" /")) + + content <- c(content, '', paste(' j number of LPJ cells /\n ',paste(cells,collapse=',\n '),'/',sep=''),'', + ' cell(i,j) number of LPJ cells per region i',' /') + for(i in 1:length(cpr)) { + content <- c(content,paste(' ',names(cpr)[i],' . ',cells[i],sep='')) + } + content <- c(content,' /','') + + content <- c(content,' i_to_iso(i,iso) mapping regions to iso countries',' /') + map$RegionCode <- as.factor(map$RegionCode) + for(i in levels(map$RegionCode)) { + content <- c(content, .tmp(map$CountryCode[map$RegionCode==i], prefix=paste0(i," . ("), suffix1=")", suffix2=")")) + + } + content <- c(content,' /',';') + lucode::replace_in_file("core/sets.gms",content,subject) + } # Function to extract information from info.txt - get_info <- function(file, grep_expression, sep, pattern="", replacement="") { + .get_info <- function(file, grep_expression, sep, pattern="", replacement="") { if(!file.exists(file)) return("#MISSING#") file <- readLines(file, warn=FALSE) tmp <- grep(grep_expression, file, value=TRUE) @@ -96,17 +161,92 @@ start_run <- function(cfg,scenario=NULL,codeCheck=TRUE, return(tmp) } - input_old <- get_info("input/info.txt", "^Used data set:", ": ") + #Define routine to update info file in input folder and info in main.gms + .update_info <- function(datasets, cpr, regionscode, reg_revision, warnings=NULL) { + + low_res <- .get_info("input/info.txt","^\\* Output ?resolution:",": ") + high_res <- .get_info("input/info.txt","^\\* Input ?resolution:",": ") + info <- readLines('input/info.txt') + subject <- 'VERSION INFO' - if(!setequal(cfg$input, input_old) | cfg$force_download) { - source("scripts/downloader/download.R") - archive_download(files=cfg$input, - repositories=cfg$repositories, - modelfolder=".", - debug=cfg$debug) + useddata <- NULL + for(dataset in rownames(datasets)) { + useddata <- c(useddata, + '', + paste('Used data set:',dataset), + paste('md5sum:',datasets[dataset,"md5"]), + paste('Repository:',datasets[dataset,"repo"])) + } + + warnings <- attr(datasets,"warnings") + if(!is.null(warnings)) { + warnings <- capture.output(warnings) + } + + content <- c(useddata, + '', + paste('Low resolution:',low_res), + paste('High resolution:',high_res), + '', + paste('Total number of cells:',sum(cpr)), + '', + 'Number of cells per region:', + paste(format(names(cpr),width=5,justify="right"),collapse=""), + paste(format(cpr,width=5),collapse=""), + '', + paste('Regionscode:',regionscode), + '', + paste('Regions data revision:',reg_revision), + '', + info, + '', + warnings, + '', + paste('Last modification (input data):',date()), + '') + writeLines(content,'input/info.txt') + lucode::replace_in_file("main.gms",paste('*',content),subject) + } + + ################################################################################ + ################################################################################ + + input_old <- .get_info("input/info.txt", "^Used data set:", ": ") + input_new <- cfg$input + + ###################### Download files ################################### + # Delete previously downloaded files, download new files and distribute + # them within the model. + if(!setequal(input_new, input_old) | cfg$force_download) { + filemap <- lucode::download_distribute(files = input_new, + repositories = cfg$repositories, # defined in your local .Rprofile or on the cluster /p/projects/rd3mod/R/.Rprofile + modelfolder = ".", + additionalDelete="scripts/downloader/inputdelete.cfg", + debug = cfg$debug) } + ###################### MANIPULATE GAMS FILES ################################### + # In the following the GAMS sourcecode files magpie.gms and core/sets.gms + # are manipulated. Therefore some information about the number of cells per + # region is required (CPR). This information is gained by extracting it from + # the avl_land.cs3 input file (any other cellular file could be used as well). + # This information is then transfered to .update_info, which is + # updating the general information in magpie.gms and input/info.txt + # and .update_sets, which is updating the resolution- and region-depending + # sets in core/sets.gms + + tmp <- magclass::read.magpie("modules/10_land/input/avl_land_t.cs3") + cpr <- magclass::getCPR(tmp) + # read spatial_header, map, reg_revision and regionscode + load("input/spatial_header.rda") + .update_info(filemap,cpr,regionscode,reg_revision, warnings) + .update_sets(cpr,map) + + ########################################################################################################### + ############# PROCESSING INPUT DATA ###################### END ############################################ + ########################################################################################################### + if(cfg$recalc_npi_ndc=="ifneeded") { aff_pol <- magclass::read.magpie("modules/32_forestry/input/npi_ndc_aff_pol.cs3") ad_aolc_pol <- magclass::read.magpie("modules/35_natveg/input/npi_ndc_ad_aolc_pol.cs3") diff --git a/standalone/demand_model.gms b/standalone/demand_model.gms index a71c814c1c..bf951b1b48 100644 --- a/standalone/demand_model.gms +++ b/standalone/demand_model.gms @@ -1,8 +1,9 @@ -*** (C) 2008-2017 Potsdam Institute for Climate Impact Research (PIK), -*** authors, and contributors see AUTHORS file -*** This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** or later. See LICENSE file or go to http://www.gnu.org/licenses/ -*** Contact: magpie@pik-potsdam.de +*** | (C) 2008-2019 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 $title demand_model_standalone @@ -128,4 +129,4 @@ $batinclude "./modules/include.gms" postsolve * clear ct set ct(t) = no; ); -****************************TIMESTEP LOOP END*********************************** \ No newline at end of file +****************************TIMESTEP LOOP END*********************************** diff --git a/standalone/template.gms b/standalone/template.gms index c8cdd886f4..48261810a3 100644 --- a/standalone/template.gms +++ b/standalone/template.gms @@ -1,7 +1,8 @@ -*** | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -*** | authors, and contributors see AUTHORS file -*** | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -*** | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +*** | (C) 2008-2019 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 * This is a standalone skeleton which should be used as template diff --git a/start.R b/start.R index 428b662b48..c3ad8a6210 100644 --- a/start.R +++ b/start.R @@ -1,7 +1,8 @@ -# | (C) 2008-2018 Potsdam Institute for Climate Impact Research (PIK), -# | authors, and contributors see AUTHORS file -# | This file is part of MAgPIE and licensed under GNU AGPL Version 3 -# | or later. See LICENSE file or go to http://www.gnu.org/licenses/ +# | (C) 2008-2019 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 ##########################################################