aboutsummaryrefslogtreecommitdiff
path: root/Carpet
diff options
context:
space:
mode:
authorschnetter <>2001-07-04 11:55:00 +0000
committerschnetter <>2001-07-04 11:55:00 +0000
commit7d15598e09630796312a5cdac178eb9658a44dd0 (patch)
treed9bc99f19d45855cae20fd34c5115245af43b593 /Carpet
parentf1aa84c14ac110f5802603b4bf9ceb7923c5b471 (diff)
Fixed bug in ASCII output -- only the x dimesion was output, and not y and z.
darcs-hash:20010704115523-07bb3-7b9654076c9c8a713187ced500383516a952ef26.gz
Diffstat (limited to 'Carpet')
-rw-r--r--Carpet/CarpetIOASCII/src/ioascii.cc31
-rw-r--r--Carpet/CarpetTest/schedule.ccl6
-rw-r--r--Carpet/CarpetTest/src/carpettest_check_arguments.F7725
-rw-r--r--Carpet/CarpetTest/test/arraysizes.par27
4 files changed, 68 insertions, 21 deletions
diff --git a/Carpet/CarpetIOASCII/src/ioascii.cc b/Carpet/CarpetIOASCII/src/ioascii.cc
index 348c81630..f6a5a049e 100644
--- a/Carpet/CarpetIOASCII/src/ioascii.cc
+++ b/Carpet/CarpetIOASCII/src/ioascii.cc
@@ -24,7 +24,7 @@
#include "ioascii.hh"
-static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetIOASCII/src/ioascii.cc,v 1.14 2001/07/04 12:29:49 schnetter Exp $";
+static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetIOASCII/src/ioascii.cc,v 1.15 2001/07/04 13:55:23 schnetter Exp $";
@@ -167,7 +167,8 @@ int CarpetIOASCII<outdim>
vect<int,outdim> dirs;
for (int d=0; d<outdim; ++d) dirs[d] = 0;
- for (;;) {
+ bool done;
+ do {
// Output each combination only once
bool ascending = true;
@@ -324,8 +325,8 @@ int CarpetIOASCII<outdim>
abort();
}
- // Traverse all components on this refinement and
- // multigrid level
+ // Traverse all components on this refinement and multigrid
+ // level
BEGIN_COMPONENT_LOOP(cgh) {
generic_gf<dim>* ff = 0;
@@ -355,7 +356,6 @@ int CarpetIOASCII<outdim>
tl, reflevel, component, mglevel);
} END_COMPONENT_LOOP(cgh);
- break;
// Append EOL after every complete set of components
if (CCTK_MyProc(cgh)==0) {
@@ -371,16 +371,17 @@ int CarpetIOASCII<outdim>
} // if (ascending)
// Next direction combination
+ done = true;
for (int d=0; d<outdim; ++d) {
++dirs[d];
- if (dirs[d]<CCTK_GroupDimI(group)) goto notyetdone;
+ if (dirs[d]<CCTK_GroupDimI(group)) {
+ done = false;
+ break;
+ }
dirs[d] = 0;
}
- break;
-
- notyetdone: ;
- } // all directions
+ } while (! done); // all directions
break;
}
@@ -466,7 +467,7 @@ int CarpetIOASCII<outdim>
const char* ctempl, const char* cglobal,
const CCTK_REAL cfallback)
{
- /* First choice: explicit coordinate */
+ // First choice: explicit coordinate
char cparam[1000];
sprintf (cparam, ctempl, outdim);
if (CCTK_ParameterQueryTimesSet (cparam, CCTK_THORNSTRING) > 0) {
@@ -479,7 +480,7 @@ int CarpetIOASCII<outdim>
return CoordToOffset (cgh, dir, coord);
}
- /* Second choice: explicit index */
+ // Second choice: explicit index
char iparam[1000];
sprintf (iparam, itempl, outdim);
if (CCTK_ParameterQueryTimesSet (iparam, CCTK_THORNSTRING) > 0) {
@@ -492,7 +493,7 @@ int CarpetIOASCII<outdim>
return index;
}
- /* Third choice: explicit global coordinate */
+ // Third choice: explicit global coordinate
if (CCTK_ParameterQueryTimesSet (cglobal, "IO") > 0) {
int ptype;
const CCTK_REAL* const pcoord
@@ -503,7 +504,7 @@ int CarpetIOASCII<outdim>
return CoordToOffset (cgh, dir, coord);
}
- /* Fourth choice: explicit global index */
+ // Fourth choice: explicit global index
if (CCTK_ParameterQueryTimesSet (iglobal, "IO") > 0) {
int ptype;
const int* const pindex
@@ -514,7 +515,7 @@ int CarpetIOASCII<outdim>
return index;
}
- /* Fifth choice: default coordinate */
+ // Fifth choice: default coordinate
return CoordToOffset (cgh, dir, cfallback);
}
diff --git a/Carpet/CarpetTest/schedule.ccl b/Carpet/CarpetTest/schedule.ccl
index 49b161fba..ce64a4728 100644
--- a/Carpet/CarpetTest/schedule.ccl
+++ b/Carpet/CarpetTest/schedule.ccl
@@ -1,14 +1,14 @@
# Schedule definitions for thorn CarpetTest
-# $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetTest/schedule.ccl,v 1.1 2001/07/04 12:29:54 schnetter Exp $
+# $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetTest/schedule.ccl,v 1.2 2001/07/04 13:55:24 schnetter Exp $
+
+STORAGE: gfg arrg1 arrg2 arrg3
schedule carpettest_check_sizes AT initial
{
LANG: C
- STORAGE: gfg arrg1 arrg2 arrg3
} "Check grid function and grid array sizes"
schedule carpettest_check_arguments AT initial
{
LANG: Fortran
- STORAGE: gfg arrg1 arrg2 arrg3
} "Check grid function and grid array arguments"
diff --git a/Carpet/CarpetTest/src/carpettest_check_arguments.F77 b/Carpet/CarpetTest/src/carpettest_check_arguments.F77
index 7c4fab201..d24f2a391 100644
--- a/Carpet/CarpetTest/src/carpettest_check_arguments.F77
+++ b/Carpet/CarpetTest/src/carpettest_check_arguments.F77
@@ -1,4 +1,4 @@
-c $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetTest/src/carpettest_check_arguments.F77,v 1.1 2001/07/04 12:29:54 schnetter Exp $
+c $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetTest/src/carpettest_check_arguments.F77,v 1.2 2001/07/04 13:55:25 schnetter Exp $
#include "cctk.h"
#include "cctk_Arguments.h"
@@ -8,9 +8,32 @@ c $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetTest/src/carpettest_c
implicit none
DECLARE_CCTK_ARGUMENTS
DECLARE_CCTK_PARAMETERS
+ integer i,j,k
print *, "gfg ", gfg0, gfg1, gfg2
print *, "arrg3 ", arrg30, arrg31, arrg32
print *, "arrg2 ", arrg20, arrg21
print *, "arrg1 ", arrg10
print *
+ do k=1,gfg2
+ do j=1,gfg1
+ do i=1,gfg0
+ gf(i,j,k) = i*10000 + j*100 + k
+ end do
+ end do
+ end do
+ do k=1,arrg32
+ do j=1,arrg31
+ do i=1,arrg30
+ arr3(i,j,k) = i*10000 + j*100 + k
+ end do
+ end do
+ end do
+ do j=1,arrg21
+ do i=1,arrg20
+ arr2(i,j) = i*100 + j
+ end do
+ end do
+ do i=1,arrg10
+ arr1(i) = i
+ end do
end
diff --git a/Carpet/CarpetTest/test/arraysizes.par b/Carpet/CarpetTest/test/arraysizes.par
index 9660c8e36..416bc883c 100644
--- a/Carpet/CarpetTest/test/arraysizes.par
+++ b/Carpet/CarpetTest/test/arraysizes.par
@@ -1,5 +1,28 @@
-# $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetTest/test/arraysizes.par,v 1.1 2001/07/04 12:29:55 schnetter Exp $
+# $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetTest/test/arraysizes.par,v 1.2 2001/07/04 13:55:25 schnetter Exp $
!DESC "Check array sizes"
-ActiveThorns = "Carpet CarpetLib CarpetTest"
+ActiveThorns = "Carpet CarpetLib CarpetSlab Cart3d IOUtil CarpetIOASCII CarpetTest"
+
+Cactus::cctk_itlast = 0
+
+IO::outdir = "arraysizes"
+
+IOASCII::out1D_every = 1
+IOASCII::out2D_every = 1
+IOASCII::out3D_every = 1
+
+IOASCII::out1D_xline_yi = 0
+IOASCII::out1D_xline_zi = 0
+IOASCII::out1D_yline_xi = 0
+IOASCII::out1D_yline_zi = 0
+IOASCII::out1D_zline_xi = 0
+IOASCII::out1D_zline_yi = 0
+
+IOASCII::out2D_xyplane_zi = 0
+IOASCII::out2D_xzplane_yi = 0
+IOASCII::out2D_yzplane_xi = 0
+
+IOASCII::out1D_vars = "CarpetTest::gfg CarpetTest::arrg3 CarpetTest::arrg2 CarpetTest::arrg1"
+IOASCII::out2D_vars = "CarpetTest::gfg CarpetTest::arrg3 CarpetTest::arrg2 CarpetTest::arrg1"
+IOASCII::out3D_vars = "CarpetTest::gfg CarpetTest::arrg3 CarpetTest::arrg2 CarpetTest::arrg1"