diff --git a/config/conopt3.op4 b/config/conopt3.op4 deleted file mode 100644 index ee300d6cc82e50b1377f83b4c3e0a7db523a9fce..0000000000000000000000000000000000000000 --- a/config/conopt3.op4 +++ /dev/null @@ -1,10 +0,0 @@ -rtnwtr = 1.e-7; -lfnicr = 1000; -lfstal = 1000; -lfilog = 500; -rtredg = 1.d-7; -rvhess 100; -lfdegi 500; -lfnsup 7000; -rtmins 0.0009765625; -rtnwmi = 1.d-9; diff --git a/config/conopt3.op5 b/config/conopt3.op5 deleted file mode 100644 index ee300d6cc82e50b1377f83b4c3e0a7db523a9fce..0000000000000000000000000000000000000000 --- a/config/conopt3.op5 +++ /dev/null @@ -1,10 +0,0 @@ -rtnwtr = 1.e-7; -lfnicr = 1000; -lfstal = 1000; -lfilog = 500; -rtredg = 1.d-7; -rvhess 100; -lfdegi 500; -lfnsup 7000; -rtmins 0.0009765625; -rtnwmi = 1.d-9; diff --git a/config/conopt3.op8 b/config/conopt3.op8 deleted file mode 100644 index b3cd02178303ff4acab07d07ce2c828e7598c4a0..0000000000000000000000000000000000000000 --- a/config/conopt3.op8 +++ /dev/null @@ -1,10 +0,0 @@ -rtnwtr = 1.e-7; -lfnicr = 1000; -lfstal = 1000; -lfilog = 500; -rtredg = 1.d-8; -rvhess 100; -lfdegi 500; -lfnsup 7000; -rtmins 0.0009765625; -rtnwmi = 1.d-9; diff --git a/config/conopt4.op2 b/config/conopt4.op2 deleted file mode 100644 index 0bd27e75f4598e4854169c14683ac57ea368e768..0000000000000000000000000000000000000000 --- a/config/conopt4.op2 +++ /dev/null @@ -1,10 +0,0 @@ -rtnwtr = 1.e-7; -lfnicr = 1000; -lfstal = 1000; -lfilog = 500; -rtredg = 1.d-6; -rvhess 100; -lfdegi 500; -lfnsup 7000; -rtmins 0.0009765625; -rtnwmi = 1.d-9; diff --git a/config/conopt4.op3 b/config/conopt4.op3 deleted file mode 100644 index ee300d6cc82e50b1377f83b4c3e0a7db523a9fce..0000000000000000000000000000000000000000 --- a/config/conopt4.op3 +++ /dev/null @@ -1,10 +0,0 @@ -rtnwtr = 1.e-7; -lfnicr = 1000; -lfstal = 1000; -lfilog = 500; -rtredg = 1.d-7; -rvhess 100; -lfdegi 500; -lfnsup 7000; -rtmins 0.0009765625; -rtnwmi = 1.d-9; diff --git a/config/conopt4.op4 b/config/conopt4.op4 deleted file mode 100644 index ee300d6cc82e50b1377f83b4c3e0a7db523a9fce..0000000000000000000000000000000000000000 --- a/config/conopt4.op4 +++ /dev/null @@ -1,10 +0,0 @@ -rtnwtr = 1.e-7; -lfnicr = 1000; -lfstal = 1000; -lfilog = 500; -rtredg = 1.d-7; -rvhess 100; -lfdegi 500; -lfnsup 7000; -rtmins 0.0009765625; -rtnwmi = 1.d-9; diff --git a/config/conopt4.op5 b/config/conopt4.op5 deleted file mode 100644 index ee300d6cc82e50b1377f83b4c3e0a7db523a9fce..0000000000000000000000000000000000000000 --- a/config/conopt4.op5 +++ /dev/null @@ -1,10 +0,0 @@ -rtnwtr = 1.e-7; -lfnicr = 1000; -lfstal = 1000; -lfilog = 500; -rtredg = 1.d-7; -rvhess 100; -lfdegi 500; -lfnsup 7000; -rtmins 0.0009765625; -rtnwmi = 1.d-9; diff --git a/config/conopt4.op8 b/config/conopt4.op8 deleted file mode 100644 index b3cd02178303ff4acab07d07ce2c828e7598c4a0..0000000000000000000000000000000000000000 --- a/config/conopt4.op8 +++ /dev/null @@ -1,10 +0,0 @@ -rtnwtr = 1.e-7; -lfnicr = 1000; -lfstal = 1000; -lfilog = 500; -rtredg = 1.d-8; -rvhess 100; -lfdegi 500; -lfnsup 7000; -rtmins 0.0009765625; -rtnwmi = 1.d-9; diff --git a/config/conopt4.op9 b/config/conopt4.op9 deleted file mode 100644 index f2a6e21babc280337a33da66d054a9687d13522b..0000000000000000000000000000000000000000 --- a/config/conopt4.op9 +++ /dev/null @@ -1,10 +0,0 @@ -rtnwtr = 1.e-7; -lfnicr = 1000; -lfstal = 1000; -lfilog = 500; -rtredg = 1.d-9; -rvhess 100; -lfdegi 500; -lfnsup 7000; -rtmins 0.0009765625; -rtnwmi = 1.d-9; diff --git a/config/conopt4.opt b/config/conopt4.opt deleted file mode 100644 index 81e2b17d47959027cb52c29499dbb785c5c07ce7..0000000000000000000000000000000000000000 --- a/config/conopt4.opt +++ /dev/null @@ -1,10 +0,0 @@ -rtnwtr = 1.e-7; -lfnicr = 1000; -lfstal = 1000; -lfilog = 500; -rtredg = 1.d-5; -rvhess 100; -lfdegi 500; -lfnsup 7000; -rtmins 0.0009765625; -rtnwmi = 1.d-9; diff --git a/config/default.cfg b/config/default.cfg index 6a5e7140204116c2ae291c5ab7282ffac45b5337..2331fe658c26dc9b016a64b71949e0f98c8b12a2 100755 --- a/config/default.cfg +++ b/config/default.cfg @@ -425,12 +425,7 @@ cfg$files2export <- list() cfg$files2export$start <- c("config/conopt3.opt", "config/conopt3.op2", "config/conopt3.op3", - "config/conopt3.op4", - "config/conopt3.op5", - "config/conopt3.op8", "config/conopt3.op9", - "scripts/run_submit/submit.cmd", - "scripts/run_submit/submit.R", "scripts/run_submit/run_magicc.R", "scripts/run_submit/run_magicc_temperatureImpulseResponse.R", "scripts/run_submit/read_DAT_TOTAL_ANTHRO_RF.R", @@ -439,7 +434,7 @@ cfg$files2export$start <- c("config/conopt3.opt", "scripts/input/exoGAINSAirpollutants.R", "config/input.gdx", "config/input_ref.gdx", - "core/magicc", + "core/magicc", ".Rprofile", "config/mappingEDGEtoREMINDsectors.csv") diff --git a/modules/80_optimization/negishi/solve.gms b/modules/80_optimization/negishi/solve.gms index 1178dd7d28756047691d964349c65cd043806859..867a525c94c72ae133d2ff4db551168c151e1de8 100644 --- a/modules/80_optimization/negishi/solve.gms +++ b/modules/80_optimization/negishi/solve.gms @@ -24,20 +24,20 @@ if(o_modelstat eq 2, IF(o_modelstat eq 2, *AJS*2013-05* Default Negishi convergence scheme: - if (ord(iteration) eq 1, s80_cnptfile = 2); - if (ord(iteration) eq 2, s80_cnptfile = 3); - if (ord(iteration) eq 3, s80_cnptfile = 4); - if (ord(iteration) eq 4, s80_cnptfile = 5); + if (ord(iteration) eq 1, s80_cnptfile = 2); !! rtredg = 1.d-6 + if (ord(iteration) eq 2, s80_cnptfile = 3); !! rtredg = 1.d-7 + if (ord(iteration) eq 3, s80_cnptfile = 3); !! rtredg = 1.d-7 + if (ord(iteration) eq 4, s80_cnptfile = 3); !! rtredg = 1.d-7 *RP* Slower convergence scheme $IFTHEN.cm_SlowConvergence %cm_SlowConvergence% == "on" - if (ord(iteration) eq 1, s80_cnptfile = 1); - if (ord(iteration) eq 2, s80_cnptfile = 2); - if (ord(iteration) eq 3, s80_cnptfile = 2); - if (ord(iteration) eq 4, s80_cnptfile = 3); - if (ord(iteration) eq 5, s80_cnptfile = 3); - if (ord(iteration) eq 6, s80_cnptfile = 4); - if (ord(iteration) eq 7, s80_cnptfile = 4); - if (ord(iteration) eq 8, s80_cnptfile = 5); + if (ord(iteration) eq 1, s80_cnptfile = 1); !! rtredg = 1.d-5 + if (ord(iteration) eq 2, s80_cnptfile = 2); !! rtredg = 1.d-6 + if (ord(iteration) eq 3, s80_cnptfile = 2); !! rtredg = 1.d-6 + if (ord(iteration) eq 4, s80_cnptfile = 3); !! rtredg = 1.d-7 + if (ord(iteration) eq 5, s80_cnptfile = 3); !! rtredg = 1.d-7 + if (ord(iteration) eq 6, s80_cnptfile = 3); !! rtredg = 1.d-7 + if (ord(iteration) eq 7, s80_cnptfile = 3); !! rtredg = 1.d-7 + if (ord(iteration) eq 8, s80_cnptfile = 3); !! rtredg = 1.d-7 $ENDIF.cm_SlowConvergence ); *** EOF ./modules/80_optimization/negishi/solve.gms diff --git a/modules/80_optimization/testOneRegi/solve.gms b/modules/80_optimization/testOneRegi/solve.gms index 870fece4e18ba1f3b89858487fae3f9c25dcfbe7..d411b54c7499de847cc6e27bedb33a6a4014407e 100644 --- a/modules/80_optimization/testOneRegi/solve.gms +++ b/modules/80_optimization/testOneRegi/solve.gms @@ -6,8 +6,7 @@ *** | Contact: remind@pik-potsdam.de *** SOF ./modules/80_optimization/testOneRegi/solve.gms -$IFI %optimization% == "testOneRegi" s80_cnptfile = 9; -hybrid.optfile = s80_cnptfile; +hybrid.optfile = 9; ***reduce the problem to one region regi(all_regi) = NO; diff --git a/scripts/start/prepare_and_run.R b/scripts/start/prepare_and_run.R index 13374438ab80c5c3641dd26ed91058175b267d36..4bdeca00d4f77c7d9b1edef69df0ffadac9a4509 100644 --- a/scripts/start/prepare_and_run.R +++ b/scripts/start/prepare_and_run.R @@ -688,6 +688,9 @@ prepare_and_run <- function() { } } + # Print REMIND runtime + cat("\n gams_runtime is ", gams_runtime, "\n") + # Collect and submit run statistics to central data base lucode::runstatistics(file = "runstatistics.rda", modelstat = readGDX(gdx="fulldata.gdx","o_modelstat", format="first_found"), @@ -714,7 +717,7 @@ prepare_and_run <- function() { no_ref_runs <- identical(cfg$RunsUsingTHISgdxAsBAU,character(0)) | all(is.na(cfg$RunsUsingTHISgdxAsBAU)) | coupled_run if(!no_ref_runs) { - source("scripts/start/submit_run.R") + source("scripts/start/submit.R") # Save the current cfg settings into a different data object, so that they are not overwritten cfg_main <- cfg @@ -740,7 +743,7 @@ prepare_and_run <- function() { } else { # Save the current cfg settings into a different data object, so that they are not overwritten cfg_main <- cfg - source("scripts/start/submit_run.R") + source("scripts/start/submit.R") for(run in seq(1,length(cfg_main$subsequentruns))){ # for each of the subsequent runs, read in the cfg, ... @@ -753,7 +756,7 @@ prepare_and_run <- function() { # Subsequent runs will be started in submit.R using the RData files written above # after the current run has finished. cat("Starting subsequent run ",cfg_main$subsequentruns[run],"\n") - submit_run(cfg) + submit(cfg) } # Set cfg back to original cfg <- cfg_main @@ -783,18 +786,6 @@ prepare_and_run <- function() { #=================== END - Subsequent runs ======================== - # Reload the REMIND run configuration - load(cfg$val_workspace) - - # Print REMIND runtime - cat("\n gams_runtime is ", gams_runtime, "\n") - - # Save runtime for REMIND validation - validation$technical$time$full.gms <- gams_runtime - save(validation, file = cfg$val_workspace) - # Remove unused variables - rm(gams_runtime, validation) - # Copy important files into output_folder (after REMIND execution) for (file in cfg$files2export$end) file.copy(file, cfg$results_folder, overwrite = TRUE) @@ -814,5 +805,5 @@ prepare_and_run <- function() { } -# call prepare and run (always without cfg, because cfg is always read from results folder, where it has been copied by submit_run(cfg)) +# call prepare and run (always without cfg, because cfg is always read from results folder, where it has been copied by submit(cfg)) prepare_and_run() \ No newline at end of file diff --git a/scripts/start/submit_run.R b/scripts/start/submit.R similarity index 99% rename from scripts/start/submit_run.R rename to scripts/start/submit.R index 3076d3985c73cf855885f3db96a976133df71644..e100b46ac018a9ae9fe2b6a18a90d3bfe0f3f881 100644 --- a/scripts/start/submit_run.R +++ b/scripts/start/submit.R @@ -13,7 +13,7 @@ ############## Define function: runsubmit ######################### -submit_run <- function(cfg) { +submit <- function(cfg) { # Create name of output folder and output folder itself date <- format(Sys.time(), "_%Y-%m-%d_%H.%M.%S") diff --git a/start_coupled.R b/start_coupled.R index aae8e91483ab482f22b2b919689cf66c84ad2d5d..63ca85f8725a07b9cc57df000bf0e30cd7c466cf 100644 --- a/start_coupled.R +++ b/start_coupled.R @@ -104,7 +104,7 @@ start_coupled <- function(path_remind,path_magpie,cfg_rem,cfg_mag,runname,max_it cfg_rem$gms$cm_MAgPIE_coupling <- "off" cat("### COUPLING ### No MAgPIE report for REMIND input provided.\n") cat("### COUPLING ### REMIND will be startet in stand-alone mode with\n ",runname,"\n ",cfg_rem$results_folder,"\n") - outfolder_rem <- submit_run(cfg_rem) + outfolder_rem <- submit(cfg_rem) } else if (grepl(paste0("report.mif"),report)) { # if it is a MAgPIE report ######### S T A R T R E M I N D C O U P L E D ############## cfg_rem$gms$cm_MAgPIE_coupling <- "on" @@ -114,7 +114,7 @@ start_coupled <- function(path_remind,path_magpie,cfg_rem,cfg_mag,runname,max_it mag_report_keep_in_mind <- report ####### START REMIND ####### cfg_rem$pathToMagpieReport <- report - outfolder_rem <- submit_run(cfg_rem) + outfolder_rem <- submit(cfg_rem) ############################ } else if (grepl("REMIND_generic_",report)) { # if it is a REMIND report ############### O M I T R E M I N D ############################### diff --git a/start_new.R b/start_new.R index e2a8c2d60bdc4fdf785b2ab489024835ebedb3ec..457b54e9ae15128d1549d9ecb54810161f4309a7 100644 --- a/start_new.R +++ b/start_new.R @@ -1,6 +1,6 @@ library(lucode) -source("scripts/start/submit_run.R") +source("scripts/start/submit.R") ####################################################################### ############### Select slurm partitiion ############################### @@ -191,7 +191,7 @@ for (scen in rownames(scenarios)) { if (start_now){ cat("Creating and starting: ",cfg$title,"\n") - submit_run(cfg) + submit(cfg) } }