aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Utils.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Utils.c b/src/Utils.c
index ef3ceff..c17a8f1 100644
--- a/src/Utils.c
+++ b/src/Utils.c
@@ -257,12 +257,12 @@ int IOUtil_2DPlanes (const cGH *GH,
for (dir = 0; dir < num_dims; dir++)
{
if (CCTK_CoordRange (GH, &lower_range[dir], &upper_range[dir],
- dir + 1, NULL, coord_system_name) < 0)
+ num_dims - dir, NULL, coord_system_name) < 0)
{
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
"IOUtil_2DPlanes: Could not get ranges for %c-direction "
"of coordinate system '%s'",
- 'x' + dir, coord_system_name);
+ 'x' + (num_dims - dir - 1), coord_system_name);
}
}
@@ -280,23 +280,24 @@ int IOUtil_2DPlanes (const cGH *GH,
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
"IOUtil_2DPlanes: %c-coordinate for slice center of 2D "
"planes (%f) is out of grid coordinates range (%f, %f)",
- 'x' + dir, (double) origin_phys[dir],
+ 'x' + (num_dims - dir - 1), (double) origin_phys[dir],
(double) lower_range[dir], (double) upper_range[dir]);
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
"IOUtil_2DPlanes: no 2D planes in %c-direction will be "
"written for %dD variables with this slice center default",
- 'x' + dir, num_dims);
+ 'x' + (num_dims - dir - 1), num_dims);
slice_center[dir] = 0;
}
else
{
/* Find index for first point above the chosen coordinate */
slice_center[dir] = ceil ((origin_phys[dir] - lower_range[dir]) /
- GH->cctk_delta_space[dir] - 1e-6);
+ GH->cctk_delta_space[(num_dims - dir - 1)] -
+ 1e-6);
#ifdef DEBUG_IOUTIL
printf("sp2xyz for planes perpendicular to %d-direction is %d\n",
- dir, (CCTK_INT) slice_center[dir]);
+ (num_dims - dir - 1), (CCTK_INT) slice_center[dir]);
#endif
}
}