aboutsummaryrefslogtreecommitdiff
path: root/CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexioUtil.cc
diff options
context:
space:
mode:
authorcott <>2004-01-08 18:43:00 +0000
committercott <>2004-01-08 18:43:00 +0000
commit0f1abbf0a0a976a359eb3c1eaf4c8061a6fdfbb6 (patch)
tree114b5468154aa31a35ec88c7bcf3db7daa2a0886 /CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexioUtil.cc
parentc6e7dedec9e6ea4bfad9b2a22b75b5f6ba7e78bc (diff)
Okay. Here we go. Recovery goes through without any crashes on a very simple
Okay. Here we go. Recovery goes through without any crashes on a very simple test case. No test for consistency yet. The code is still a huge construction site... darcs-hash:20040108184333-19929-b0d1df37d71a59413ba5893926fef4e5862ea7a7.gz
Diffstat (limited to 'CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexioUtil.cc')
-rw-r--r--CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexioUtil.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexioUtil.cc b/CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexioUtil.cc
index 08719a3e2..97ee800cf 100644
--- a/CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexioUtil.cc
+++ b/CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexioUtil.cc
@@ -92,7 +92,7 @@ IObase::DataType FlexIODataType (int cctk_type){
void DumpCommonAttributes (const cGH *cgh, IObase* writer, ioRequest* request)
{
- int dim, vdim;
+ int dim, vdim, tl;
CCTK_INT attr_int,dimscalar;
CCTK_REAL *attr_real;
char coord_system_name[20];
@@ -123,7 +123,13 @@ void DumpCommonAttributes (const cGH *cgh, IObase* writer, ioRequest* request)
attr_int = CCTK_MaxTimeLevelsVI (request->vindex);
writer->writeAttribute("ntimelevels",FlexIODataType(CCTK_VARIABLE_INT),1,&attr_int);
- writer->writeAttribute("timelevel",FlexIODataType(CCTK_VARIABLE_INT),1,&request->timelevel);
+ // lets get the correct Carpet time level (which is the (-1) * timelevel):
+ if (request->timelevel==0)
+ tl = 0;
+ else
+ tl = - request->timelevel;
+
+ writer->writeAttribute("timelevel",FlexIODataType(CCTK_VARIABLE_INT),1,&tl);
/* we have to do below since cactus believes scalars have dimension 0, but
flexio likes them to be of dimension 1