aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Write3D.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/Write3D.c b/src/Write3D.c
index 4a6bab7..9664e41 100644
--- a/src/Write3D.c
+++ b/src/Write3D.c
@@ -210,9 +210,12 @@ int IOASCII_Write3D (const cGH *GH, int vindex, const char *alias)
file = myproc == 0 ? OpenFile (GH, fullname, alias) : NULL;
/* get the total number of grid points to check for zero-sized variables */
- for (i = 0, total_hsize = 1; i < gdata.dim; i++)
+ /* set the extent vector (copy from 'int' to 'CCTK_INT' */
+ CCTK_GroupgshVI (GH, 3, extent_int, vindex);
+ for (i = 0, total_hsize = 1; i < 3; i++)
{
total_hsize *= extent_int[i];
+ extent[i] = extent_int[i];
}
if (total_hsize <= 0)
{
@@ -220,13 +223,6 @@ int IOASCII_Write3D (const cGH *GH, int vindex, const char *alias)
return (0);
}
- /* set the extent vector (copy from 'int' to 'CCTK_INT' */
- CCTK_GroupgshVI (GH, 3, extent_int, vindex);
- for (i = 0; i < 3; i++)
- {
- extent[i] = extent_int[i];
- }
-
downsample[0] = out_downsample_x;
downsample[1] = out_downsample_y;
downsample[2] = out_downsample_z;