diff options
Diffstat (limited to 'Carpet/CarpetIOBasic')
-rw-r--r-- | Carpet/CarpetIOBasic/param.ccl | 1 | ||||
-rw-r--r-- | Carpet/CarpetIOBasic/src/iobasic.cc | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/Carpet/CarpetIOBasic/param.ccl b/Carpet/CarpetIOBasic/param.ccl index 252e873e8..8d105ff6a 100644 --- a/Carpet/CarpetIOBasic/param.ccl +++ b/Carpet/CarpetIOBasic/param.ccl @@ -28,6 +28,7 @@ KEYWORD outInfo_criterion "Criterion to select scalar output intervals, override { "never" :: "Never output" "iteration" :: "Output every so many iterations" + "divisor" :: "Output if iteration mod divisor == 0." "time" :: "Output every that much coordinate time" } "iteration" diff --git a/Carpet/CarpetIOBasic/src/iobasic.cc b/Carpet/CarpetIOBasic/src/iobasic.cc index 2d0dcb895..2c413e3c2 100644 --- a/Carpet/CarpetIOBasic/src/iobasic.cc +++ b/Carpet/CarpetIOBasic/src/iobasic.cc @@ -562,6 +562,23 @@ namespace CarpetIOBasic { output_this_iteration = false; } + } else if (CCTK_EQUALS (myoutcriterion, "divisor")) { + + int myoutevery = outInfo_every; + if (myoutevery == -2) { + myoutevery = out_every; + } + if (myoutevery <= 0) { + // output is disabled + output_this_iteration = false; + } else if ((cctk_iteration % myoutevery) == 0 ) { + // we already decided to output this iteration + output_this_iteration = true; + } else { + // we want no output at this iteration + output_this_iteration = false; + } + } else if (CCTK_EQUALS (myoutcriterion, "time")) { CCTK_REAL myoutdt = outInfo_dt; |