diff --git a/CHANGELOG.md b/CHANGELOG.md index 64143768e..95a5a39bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **config** initial treecover on cropland starts from zero - **config** additional data update additional_data_rev4.53.tgz - **29_cropland** added option for linear and sigmoidal faders +- **scripts** output/extra/highres.R use default 13_tc realization ### added diff --git a/DESCRIPTION b/DESCRIPTION index 5420bd36b..779c99c49 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -21,7 +21,7 @@ Imports: m4fsdp, madrat, magclass (>= 6.14.0), - magpie4 (>= 2.10.3), + magpie4 (>= 2.11.0), MagpieNCGains, magpiesets, mip, diff --git a/modules/73_timber/default/equations.gms b/modules/73_timber/default/equations.gms index 0b062cc87..dad60fffe 100644 --- a/modules/73_timber/default/equations.gms +++ b/modules/73_timber/default/equations.gms @@ -55,7 +55,7 @@ q73_prod_woodfuel(j2).. *' Production of residues is calculated based on `s73_residue_ratio`. This fraction *' of industrial roundwood production is assumed to be lost during harvesting processes. *' USDA reports that ca. 30% of roundwood harvested are residues (@oswalt2019forest). -*' Not all of this residue is recoverwed from forest and we assume 50% of residue +*' Not all of this residue is recovered from forest and we assume 50% of residue *' removal based on @pokharel2017factors. These numbers (residue levels and residude *' removals vary strongly among different studies, the numbers used here are from *' a USDA report on state of forests in USA which has consistent reporting over years) diff --git a/scripts/output/extra/highres.R b/scripts/output/extra/highres.R index ae270348a..3d93842c7 100644 --- a/scripts/output/extra/highres.R +++ b/scripts/output/extra/highres.R @@ -37,7 +37,10 @@ resultsarchive <- "/p/projects/rd3mod/models/results/magpie" # Load start_run(cfg) function which is needed to start MAgPIE runs source("scripts/start_functions.R") -highres <- function(cfg) { +# Plausible values for "res" (high resolution): "c1000" and "c2000" +# Options for "tc" (13_tc realization): NULL (no change), "exo" and "endo_jan22" + +highres <- function(cfg = cfg, res = "c1000", tc = NULL) { #lock the model folder lockId <- gms::model_lock(timeout1 = 24) withr::defer(gms::model_unlock(lockId)) @@ -46,9 +49,6 @@ highres <- function(cfg) { cfg$output <- cfg$output[cfg$output!="extra/highres"] - # set high resolution, available options are c1000 and c2000 - res <- "c1000" - # search for matching high resolution file in repositories # pattern: "rev4.65_h12_*_cellularmagpie_c2000_MRI-ESM2-0-ssp370_lpjml-3eb70376.tgz" x <- unlist(strsplit(cfg$input["cellular"],"_")) @@ -139,10 +139,12 @@ highres <- function(cfg) { f21_trade_balance <- toolAggregate(ov_prod_reg - (ov_supply + import_for_feasibility), supreg) write.magpie(f21_trade_balance, paste0("modules/21_trade/input/f21_trade_balance.cs3")) - #get tau from low resolution run with c200 - ov_tau <- readGDX(gdx, "ov_tau",select=list(type="level")) - write.magpie(ov_tau,"modules/13_tc/input/f13_tau_scenario.csv") - cfg$gms$tc <- "exo" + if(!is.null(tc)) { + #get tau from low resolution run with c200 + ov_tau <- readGDX(gdx, "ov_tau",select=list(type="level")) + write.magpie(ov_tau,"modules/13_tc/input/f13_tau_scenario.csv") + cfg$gms$tc <- tc + } #use exo trade and parallel optimization cfg$gms$trade <- "exo"