mirror of
https://git.gfz-potsdam.de/naaice/poet.git
synced 2025-12-16 12:54:50 +01:00
fix: bring back old time and dt output to RDS file
This commit is contained in:
parent
a3bd0cef6d
commit
dc036cfcee
@ -60,13 +60,13 @@ master_iteration_end <- function(setup) {
|
|||||||
# if (iter %in% setup$out_save) {
|
# if (iter %in% setup$out_save) {
|
||||||
nameout <- paste0(fileout, "/iter_", sprintf("%03d", iter), ".rds")
|
nameout <- paste0(fileout, "/iter_", sprintf("%03d", iter), ".rds")
|
||||||
info <- list(
|
info <- list(
|
||||||
tr_req_dt = as.integer(setup$requested_dt),
|
tr_req_dt = as.integer(setup$req_dt)
|
||||||
tr_allow_dt = setup$allowed_dt,
|
# tr_allow_dt = setup$allowed_dt,
|
||||||
tr_inniter = as.integer(setup$inniter)
|
# tr_inniter = as.integer(setup$inniter)
|
||||||
)
|
)
|
||||||
saveRDS(list(
|
saveRDS(list(
|
||||||
T = setup$state_T, C = setup$state_C,
|
T = setup$state_T, C = setup$state_C,
|
||||||
simtime = as.integer(setup$simulation_time),
|
simtime = as.integer(setup$simtime),
|
||||||
tr_info = info
|
tr_info = info
|
||||||
), file = nameout)
|
), file = nameout)
|
||||||
msgm("results stored in <", nameout, ">")
|
msgm("results stored in <", nameout, ">")
|
||||||
|
|||||||
@ -48,6 +48,8 @@ inline double RunMasterLoop(SimParams ¶ms, RInside &R, Grid &grid,
|
|||||||
* master for the following loop) */
|
* master for the following loop) */
|
||||||
uint32_t maxiter = R.parseEval("mysetup$iterations");
|
uint32_t maxiter = R.parseEval("mysetup$iterations");
|
||||||
|
|
||||||
|
double sim_time = .0;
|
||||||
|
|
||||||
ChemistryInstance C(params, R, grid);
|
ChemistryInstance C(params, R, grid);
|
||||||
C.InitModule(chem_params);
|
C.InitModule(chem_params);
|
||||||
/* SIMULATION LOOP */
|
/* SIMULATION LOOP */
|
||||||
@ -74,6 +76,12 @@ inline double RunMasterLoop(SimParams ¶ms, RInside &R, Grid &grid,
|
|||||||
|
|
||||||
C.Simulate(dt);
|
C.Simulate(dt);
|
||||||
|
|
||||||
|
R["req_dt"] = dt;
|
||||||
|
R["simtime"] = (sim_time += dt);
|
||||||
|
|
||||||
|
R.parseEval("mysetup$req_dt <- req_dt");
|
||||||
|
R.parseEval("mysetup$simtime <- simtime");
|
||||||
|
|
||||||
// MDL master_iteration_end just writes on disk state_T and
|
// MDL master_iteration_end just writes on disk state_T and
|
||||||
// state_C after every iteration if the cmdline option
|
// state_C after every iteration if the cmdline option
|
||||||
// --ignore-results is not given (and thus the R variable
|
// --ignore-results is not given (and thus the R variable
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user