diff --git a/CHANGELOG.md b/CHANGELOG.md index c68602a951..35f2a5a968 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] ### changed +- **14_yields_and_config** The new default is to not use yield calibration factors from a calibration run. The switch s14_use_yield_calib can optionally reenable the use of yield calibration factors. - **inputdata** There was another bug (terra default na.rm changed) in the inputdata that was fixed with rev4.93 - **inputdata** There was a major bug (related to proj/terra) in the rev4.91 inputdata that was fixed with rev4.92 - **scripts** LUH2_disaggregation output script was modified. Specifically, flooded area was made compatible with the LUH definition, cropland and grazing land were added to the states.nc file, and specific naming/details (datatype, zname, xname, and yname) were added when creating the .nc files. diff --git a/config/default.cfg b/config/default.cfg index ecb455b574..f0cc0aa48a 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -56,11 +56,18 @@ cfg$force_download <- FALSE cfg$force_replace <- FALSE # Settings for the yield calibration +# For this yield calibration (that uses results from a special MAgPIE calibration run +# triggered by the recalibrate switch) to be activated the switch s14_use_yield_calib needs +# to be turned on. (Default is off) +# This switch should only be activated for penalty_apr22 crop realization. +# For other realizations, it is recommended not to use this yield calibration. +# +# Switch to turn on/off recalibration of yields. # * (TRUE): Yield calibration will be performed # * (ifneeded): Yield calibration will only be executed if input data is # * downloaded from repository # * (FALSE): Yield calibration will not be performed -cfg$recalibrate <- "ifneeded" # def = "ifneeded" +cfg$recalibrate <- FALSE # def = FALSE # Up to which accuracy shall be recalibrated? cfg$calib_accuracy <- 0.05 # def = 0.05 # What is the maximum number of iterations if the precision goal is not reached? @@ -316,6 +323,14 @@ cfg$gms$s14_calib_ir2rf <- 1 # def = 1 # * 0 (land degradation is switched off) cfg$gms$s14_degradation <- 0 # def = 0 +# Switch to toggle the use of yield calibration factors (that resulted from a calibration run). +# If 0, no yield calibration factors are used, meaning all calibration factors are set to 1. +# If 1, yield calibration factors are used. (For this option to function, either an existing calibration file +# must be supplied in the input directory, or yields must be recalibrated during preprocessing.) +# This switch should only be activated for penalty_apr22 crop realization. +# For other realizations, it is recommended not to use this yield calibration. +cfg$gms$s14_use_yield_calib <- 0 # def = 0 + # ***--------------------- 15_food --------------------------------------- # * (anthropometrics_jan18): estimates food using scenario dependent regression # * and demography drivers diff --git a/config/scenario_fsec.csv b/config/scenario_fsec.csv index 3728e722ad..4768afbbce 100644 --- a/config/scenario_fsec.csv +++ b/config/scenario_fsec.csv @@ -5,6 +5,7 @@ gms$c09_pal_scenario;;;;SSP1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$s12_interest_lic;;;0.06;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$s12_interest_hic;;;0.04;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$food;anthro_iso_jun22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s14_use_yield_calib;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$s15_exo_waste;;;;;;;;0;0;0;0;0;0;0;0;1;;;;;;;;;;;;;;;;;0;1;;;;;;;;;;;;;;; gms$s15_exo_diet;;;;;;;;1;1;1;1;1;1;1;1;0;;;;;;;;;;;;;;;;;1;1;;;;;;;;;;;;;;; gms$c15_kcal_scen;;;;;;;;no_underweight;half_overweight;endo;endo;endo;endo;endo;endo;endo;;;;;;;;;;;;;;;;;no_underweight_half_overweight;no_underweight_half_overweight;;;;;;;;;;;;;;; diff --git a/modules/14_yields/managementcalib_aug19/input.gms b/modules/14_yields/managementcalib_aug19/input.gms index 62e1a60cb6..ffab5eb9ee 100644 --- a/modules/14_yields/managementcalib_aug19/input.gms +++ b/modules/14_yields/managementcalib_aug19/input.gms @@ -16,6 +16,8 @@ scalar s14_calib_ir2rf Switch to calibrate rainfed to irrigated yield ratios ( scalar s14_degradation Switch to include yield impacts of land degradation(0=no degradation 1=with degradation) / 0 /; +scalar s14_use_yield_calib Switch for using or not using yield calibration factors from the preprocessing (1=use facs 0=not use facs) / 0 /; + scalars s14_yld_past_switch Spillover parameter for translating technological change in the crop sector into pasture yield increases (1) / 0.25 / s14_yld_reduction_soil_loss Decline of land productivity in areas with severe soil loss (1) / 0.08 / diff --git a/modules/14_yields/managementcalib_aug19/preloop.gms b/modules/14_yields/managementcalib_aug19/preloop.gms index b7649dfa3c..9785cbea2a 100644 --- a/modules/14_yields/managementcalib_aug19/preloop.gms +++ b/modules/14_yields/managementcalib_aug19/preloop.gms @@ -144,13 +144,14 @@ if ((s14_calib_ir2rf = 1), ***YIELD CALIBRATION*********************************************************************** *' @code -*' Calibrated yields are additionally adjusted by calibration factors 'f14_yld_calib' +*' Calibrated yields can additionally be adjusted by calibration factors 'f14_yld_calib' *' determined in a calibration run. As MAgPIE optimizes yield patterns and FAO regional -*' yields are outlier corrected, historical production and croparea can only be reproduced -*' with this additional step of correction: +*' yields are outlier corrected, historical production and croparea can in some cases +*' be better represented with this additional correction: -* set default values in case of missing input file -if(sum((i,ltype14),f14_yld_calib(i,ltype14)) = 0, +* set yield calib factors to 1 in case of no use of yield calibration factors (s14_use_yield_calib = 0) +* or missing input file +if(s14_use_yield_calib = 0 OR sum((i,ltype14),f14_yld_calib(i,ltype14)) = 0, f14_yld_calib(i,ltype14) = 1; ); diff --git a/scripts/start/extra/recalibrate_FSEC.R b/scripts/start/extra/recalibrate_FSEC.R index 5833ccaf5b..22c894b2d1 100644 --- a/scripts/start/extra/recalibrate_FSEC.R +++ b/scripts/start/extra/recalibrate_FSEC.R @@ -22,7 +22,7 @@ source("scripts/projects/fsec.R") cfg <- fsecScenario(scenario = "c_BAU") cfg$title <- "FSEC24Mar23" cfg$results_folder <- "output/:title:" -cfg$recalibrate <- TRUE +cfg$recalibrate <- TRUE # required when penality_apr22 activated cfg$best_calib <- TRUE cfg$recalibrate_landconversion_cost <- TRUE cfg$best_calib_landconversion_cost <- FALSE