diff --git a/scripts/createShockFiles.R b/scripts/createShockFiles.R index f330388e996f1dd4589d90d7e87e2a4340d3ebc2..991dd137666726031780f053760794c846088aca 100644 --- a/scripts/createShockFiles.R +++ b/scripts/createShockFiles.R @@ -93,7 +93,7 @@ createShockFile = function(scenario){ if (dir.exists(file.path(baseOutputDir,ensDir))) { print(paste(ensDir, "exists. Creating shock file")) write.csv(paramValues, file.path(baseOutputDir,ensDir,"shocks.csv"), row.names=FALSE, quote=FALSE) - write.csv(shockValues, file.path(baseOutputDir,ensDir,"shocksRecord.csv"), row.names=FALSE, quote=FALSE) + write.csv(shockValues, file.path(baseOutputDir,ensDir,paste0("shocksRecord_",scenario[,Scenario],".csv")), row.names=FALSE, quote=FALSE) } else{ print(paste(ensDir, "does not exist. Stopping")) @@ -112,7 +112,8 @@ drawValue <- function(shockType, paramName){ randomValue } -baseDataDir = "/exports/csce/eddie/geos/groups/LURG/models/PLUM" +plumDirectory = "/exports/csce/eddie/geos/groups/LURG/models/PLUM" +baseDataDir = "/exports/csce/eddie/geos/groups/LURG/models/PLUM/plumv2/data" baseOutputDir="/exports/csce/eddie/geos/groups/LURG/models/PLUM/output" # "~/Downloads" shockDistFile = fread(file.path(baseDataDir, "shockDistributions.csv")) @@ -120,7 +121,7 @@ shockProbs = fread(file.path(baseDataDir,"shockProbabilities.csv")) ensembleFile = commandArgs(trailingOnly = TRUE)[1] -scenarioTable = fread(file.path(baseDataDir,"sims",ensembleFile)) +scenarioTable = fread(file.path(plumDirectory,ensembleFile)) for(i in 1:nrow(scenarioTable)){ #first if column exists