Skip to content

Commit

Permalink
use downscaleRunESM
Browse files Browse the repository at this point in the history
  • Loading branch information
pascal-sauer committed Aug 8, 2024
1 parent c22704e commit 141cc01
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Imports:
Suggests:
goxygen,
languageserver,
mrdownscale (>= 0.23.0),
qgraph,
shinyresults,
XML
Expand Down
17 changes: 1 addition & 16 deletions scripts/output/extra/disaggregation_mrdownscale.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,4 @@
# description: Downscale MAgPIE results to 0.25 degree resolution in LUH2 format for ESMs
# comparison script: FALSE
# ------------------------------------------------------------------------------------------------
library(mrdownscale)

outputdir <- normalizePath(outputdir)

clustermap <- Sys.glob(file.path(outputdir, "clustermap_*.rds"))
gdx <- file.path(outputdir, "fulldata.gdx")
stopifnot(file.exists(gdx), length(clustermap) == 1)

scenario <- gsub("_", "-", sub("-mag-[0-9]+$", "", basename(outputdir)))

local({ # redirectSource is local by default, running it in the global environment does not work
redirectSource("MagpieFulldataGdx", c(clustermap, gdx), linkOthers = FALSE)
stopifnot(length(getConfig("redirections")) >= 1)
retrieveData("ESM", rev = format(Sys.time(), "%Y-%m-%d"), scenario = scenario, progress = FALSE,
outputfolder = outputdir)
})
mrdownscale::downscaleRunESM(outputdir)

0 comments on commit 141cc01

Please sign in to comment.