diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a63682fe4..09405b9b20 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 +- **start_functions** Check if cfg$recalibrate is consistent with cfg$gms$s14_use_yield_calib - **inputdata** Now using inputdata rev4.94 which is based on 67420 cells (67k, previously 59k) - **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. - **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/scripts/start_functions.R b/scripts/start_functions.R index 55bda9ae88..a6d47fe389 100644 --- a/scripts/start_functions.R +++ b/scripts/start_functions.R @@ -433,6 +433,18 @@ start_run <- function(cfg, scenario = NULL, codeCheck = TRUE, lock_model = TRUE) } # Yield calibration + + # check for inconsistent settings + if((cfg$recalibrate == TRUE || cfg$recalibrate == "ifneeded") + && cfg$gms$s14_use_yield_calib == 0) { + stop("The combination of the switch configurations `cfg$recalibrate <- TRUE/ifneeded` + and `cfg$gms$s14_use_yield_calib <- 0` is inconsistent. + Please check the config and set `cfg$gms$s14_use_yield_calib <- 1` + if yield calibration is desired, or `cfg$recalibrate <- FALSE` if not. + Note that the current default is to not use yield calibration.") + } + + # decide if calibration is needed if "ifneeded" is specified calib_file <- "modules/14_yields/input/f14_yld_calib.csv" if(cfg$recalibrate=="ifneeded") { if(!file.exists(calib_file)) {