aboutsummaryrefslogtreecommitdiff
path: root/Carpet
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2010-02-13 18:38:16 -0600
committerBarry Wardell <barry.wardell@gmail.com>2011-12-14 16:45:27 +0000
commit0696f61f7b1b1eea20f13eedcf57bb45c7a059e3 (patch)
tree70613aa0e4524faa5fd8fe91d964e921da92285a /Carpet
parent90957740d78d290157f3866c798628bca387f577 (diff)
CarpetIOHDF5: Use parameter IO::out_timesteps_per_file
Diffstat (limited to 'Carpet')
-rw-r--r--Carpet/CarpetIOHDF5/param.ccl1
-rw-r--r--Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc8
2 files changed, 9 insertions, 0 deletions
diff --git a/Carpet/CarpetIOHDF5/param.ccl b/Carpet/CarpetIOHDF5/param.ccl
index 025414e16..c8d7afa30 100644
--- a/Carpet/CarpetIOHDF5/param.ccl
+++ b/Carpet/CarpetIOHDF5/param.ccl
@@ -13,6 +13,7 @@ USES BOOLEAN out_unchunked AS io_out_unchunked
USES KEYWORD verbose
USES BOOLEAN out_single_precision
USES KEYWORD out_mode
+USES INT out_timesteps_per_file
USES KEYWORD out_save_parameters
USES BOOLEAN abort_on_io_errors
diff --git a/Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc b/Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc
index d54619ee6..0c0e8a282 100644
--- a/Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc
+++ b/Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc
@@ -669,6 +669,14 @@ static int OutputVarAs (const cGH* const cctkGH, const char* const fullname,
string filename;
filename.append (myGH->out_dir);
filename.append (alias);
+ if (out_timesteps_per_file > 0) {
+ // Round down to nearest multiple of out_timesteps_per_file
+ int const iter =
+ cctk_iteration / out_timesteps_per_file * out_timesteps_per_file;
+ char buffer[32];
+ snprintf (buffer, sizeof (buffer), ".iter_%d", iter);
+ filename.append (buffer);
+ }
if (not (CCTK_EQUALS (out_mode, "onefile") or
request->out_unchunked or
groupdata.disttype == CCTK_DISTRIB_CONSTANT or