From a1866295732a3302b5f11cdca2f880b271ca30ba Mon Sep 17 00:00:00 2001 From: tradke Date: Tue, 15 Jun 2004 08:41:31 +0000 Subject: Initialize the extent_int[] array before it is being used ! This closes PR CactusBase/1770: "IOAscii 3D output no longer works". git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOASCII/trunk@184 94b1c47f-dcfd-45ef-a468-0854c0e9e350 --- src/Write3D.c | 12 ++++-------- 1 file 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; -- cgit v1.2.3