diff options
Diffstat (limited to 'Carpet')
-rw-r--r-- | Carpet/CarpetIOASCII/param.ccl | 6 | ||||
-rw-r--r-- | Carpet/CarpetIOASCII/src/ioascii.cc | 19 |
2 files changed, 23 insertions, 2 deletions
diff --git a/Carpet/CarpetIOASCII/param.ccl b/Carpet/CarpetIOASCII/param.ccl index 0a470559e..e9a057c23 100644 --- a/Carpet/CarpetIOASCII/param.ccl +++ b/Carpet/CarpetIOASCII/param.ccl @@ -1,5 +1,5 @@ # Parameter definitions for thorn CarpetIOASCII -# $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetIOASCII/param.ccl,v 1.13 2004/04/03 12:38:12 schnetter Exp $ +# $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetIOASCII/param.ccl,v 1.14 2004/06/03 10:03:47 bzink Exp $ @@ -126,6 +126,7 @@ KEYWORD out0D_criterion "Criterion to select 0D ASCII output intervals, override "default" :: "Use IO::out_criterion" "never" :: "Never output" "iteration" :: "Output every so many iterations" + "divisor" :: "Output if iteration mod divisor == 0." "time" :: "Output every that much coordinate time" } "default" @@ -134,6 +135,7 @@ KEYWORD out1D_criterion "Criterion to select 1D ASCII output intervals, override "default" :: "Use IO::out_criterion" "never" :: "Never output" "iteration" :: "Output every so many iterations" + "divisor" :: "Output if (iteration % out_every) == 0." "time" :: "Output every that much coordinate time" } "default" @@ -142,6 +144,7 @@ KEYWORD out2D_criterion "Criterion to select 2D ASCII output intervals, override "default" :: "Use IO::out_criterion" "never" :: "Never output" "iteration" :: "Output every so many iterations" + "divisor" :: "Output if (iteration % out_every) == 0." "time" :: "Output every that much coordinate time" } "default" @@ -150,6 +153,7 @@ KEYWORD out3D_criterion "Criterion to select 3D ASCII output intervals, override "default" :: "Use IO::out_criterion" "never" :: "Never output" "iteration" :: "Output every so many iterations" + "divisor" :: "Output if (iteration % out_every) == 0." "time" :: "Output every that much coordinate time" } "default" diff --git a/Carpet/CarpetIOASCII/src/ioascii.cc b/Carpet/CarpetIOASCII/src/ioascii.cc index 13923fa80..4622ea479 100644 --- a/Carpet/CarpetIOASCII/src/ioascii.cc +++ b/Carpet/CarpetIOASCII/src/ioascii.cc @@ -31,7 +31,7 @@ #include "ioascii.hh" extern "C" { - static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetIOASCII/src/ioascii.cc,v 1.71 2004/05/27 12:23:03 schnetter Exp $"; + static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetIOASCII/src/ioascii.cc,v 1.72 2004/06/03 10:03:47 bzink Exp $"; CCTK_FILEVERSION(Carpet_CarpetIOASCII_ioascii_cc); } @@ -680,6 +680,23 @@ namespace CarpetIOASCII { output_this_iteration = false; } + } else if (CCTK_EQUALS (myoutcriterion, "divisor")) { + + int myoutevery = GetIntParameter("out%dD_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 = GetRealParameter("out%dD_dt"); |