aboutsummaryrefslogtreecommitdiff
path: root/Carpet
diff options
context:
space:
mode:
authorschnetter <>2004-06-21 14:07:00 +0000
committerschnetter <>2004-06-21 14:07:00 +0000
commit37501ed4c981f0c5385f9b71fce811b080f977ac (patch)
tree39968fdb4e7f4f9afcbc979f77628316d5ad0ec2 /Carpet
parent152cf03aed1f37a898ff5e0df6cd6f5b5a1edf61 (diff)
Store the last output iteration/time instead of the next output
Store the last output iteration/time instead of the next output iteration/time. This makes it easier to change the output interval. darcs-hash:20040621140719-07bb3-aef65e9eca849a82c360b8bf6684829ada3860af.gz
Diffstat (limited to 'Carpet')
-rw-r--r--Carpet/CarpetIOASCII/interface.ccl6
-rw-r--r--Carpet/CarpetIOASCII/schedule.ccl4
-rw-r--r--Carpet/CarpetIOASCII/src/ioascii.cc17
3 files changed, 14 insertions, 13 deletions
diff --git a/Carpet/CarpetIOASCII/interface.ccl b/Carpet/CarpetIOASCII/interface.ccl
index f02a98e5e..049da8c86 100644
--- a/Carpet/CarpetIOASCII/interface.ccl
+++ b/Carpet/CarpetIOASCII/interface.ccl
@@ -1,5 +1,5 @@
# Interface definition for thorn CarpetIOASCII
-# $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetIOASCII/interface.ccl,v 1.13 2004/06/08 21:09:25 schnetter Exp $
+# $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetIOASCII/interface.ccl,v 1.14 2004/06/21 16:07:19 schnetter Exp $
IMPLEMENTS: IOASCII
@@ -17,6 +17,6 @@ uses include header: ggf.hh
-CCTK_INT next_output_iteration[4] TYPE=scalar
-CCTK_REAL next_output_time[4] TYPE=scalar
+CCTK_INT last_output_iteration[4] TYPE=scalar
+CCTK_REAL last_output_time[4] TYPE=scalar
CCTK_INT this_iteration[4] TYPE=scalar
diff --git a/Carpet/CarpetIOASCII/schedule.ccl b/Carpet/CarpetIOASCII/schedule.ccl
index 50b16ce48..9cdfdd7b1 100644
--- a/Carpet/CarpetIOASCII/schedule.ccl
+++ b/Carpet/CarpetIOASCII/schedule.ccl
@@ -1,7 +1,7 @@
# Schedule definitions for thorn CarpetIOASCII
-# $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetIOASCII/schedule.ccl,v 1.7 2004/05/31 19:00:24 schnetter Exp $
+# $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetIOASCII/schedule.ccl,v 1.8 2004/06/21 16:07:19 schnetter Exp $
-storage: next_output_iteration next_output_time this_iteration
+storage: last_output_iteration last_output_time this_iteration
schedule CarpetIOASCIIStartup at STARTUP after IOUtil_Startup
{
diff --git a/Carpet/CarpetIOASCII/src/ioascii.cc b/Carpet/CarpetIOASCII/src/ioascii.cc
index 7aa154c03..668cc88ab 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.75 2004/06/21 12:28:19 schnetter Exp $";
+ static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetIOASCII/src/ioascii.cc,v 1.76 2004/06/21 16:07:19 schnetter Exp $";
CCTK_FILEVERSION(Carpet_CarpetIOASCII_ioascii_cc);
}
@@ -113,9 +113,9 @@ namespace CarpetIOASCII {
DECLARE_CCTK_ARGUMENTS;
for (int d=0; d<4; ++d) {
- this_iteration[d] = -1;
- next_output_iteration[d] = 0;
- next_output_time[d] = cctk_time;
+ this_iteration[d] = 0;
+ last_output_iteration[d] = 0;
+ last_output_time[d] = cctk_time;
}
}
@@ -672,10 +672,11 @@ namespace CarpetIOASCII {
} else if (cctk_iteration == this_iteration[outdim]) {
// we already decided to output this iteration
output_this_iteration = true;
- } else if (cctk_iteration >= next_output_iteration[outdim]) {
+ } else if (cctk_iteration
+ >= last_output_iteration[outdim] + myoutevery) {
// it is time for the next output
output_this_iteration = true;
- next_output_iteration[outdim] = cctk_iteration + myoutevery;
+ last_output_iteration[outdim] = cctk_iteration;
this_iteration[outdim] = cctk_iteration;
} else {
// we want no output at this iteration
@@ -715,10 +716,10 @@ namespace CarpetIOASCII {
// we already decided to output this iteration
output_this_iteration = true;
} else if (cctk_time / cctk_delta_time
- >= next_output_time[outdim] / cctk_delta_time - 1.0e-12) {
+ >= (last_output_time[outdim] + myoutdt) / cctk_delta_time - 1.0e-12) {
// it is time for the next output
output_this_iteration = true;
- next_output_time[outdim] = cctk_time + myoutdt;
+ last_output_time[outdim] = cctk_time;
this_iteration[outdim] = cctk_iteration;
} else {
// we want no output at this iteration