diff options
author | tradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a> | 2001-06-26 08:50:42 +0000 |
---|---|---|
committer | tradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a> | 2001-06-26 08:50:42 +0000 |
commit | f8b9d0f3d37bc9f7a4380b071f1dba6c3856a4ca (patch) | |
tree | 9f0a70a9e6f46ee2fb7475a5307d35990abeaef2 | |
parent | 5e8954e2ebdd504c7dbaaa7dc45b5dbdcd6f18f3 (diff) |
Fixed wrong min_ext and max_ext attributes.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOFlexIO/trunk@207 ebee0441-1374-4afa-a3b5-247f3ba15b9a
-rw-r--r-- | src/Write2D.c | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/src/Write2D.c b/src/Write2D.c index bce6b82..a3f0673 100644 --- a/src/Write2D.c +++ b/src/Write2D.c @@ -23,6 +23,7 @@ #include <stdio.h> #include <stdlib.h> +#include <string.h> #include "cctk.h" #include "cctk_Parameters.h" @@ -73,8 +74,8 @@ void IOFlexIO_Write2D (cGH *GH, int vindex, const char *alias) int ioflex_type; /* IEEEIO output datatype */ int groupindex; /* variable's group index */ cGroup groupinfo; /* variable's group information */ - CCTK_REAL min_ext[2], max_ext[2]; /* bounding box information */ - CCTK_REAL coord_origin3D[3]; /* origin of the 3D grid */ + CCTK_REAL min_ext[3], max_ext[3]; /* bounding box information */ + CCTK_REAL min_ext_attr[2], max_ext_attr[2], delta_attr[2]; IOFile *IEEEfile_2D; /* file descriptors */ @@ -230,11 +231,9 @@ void IOFlexIO_Write2D (cGH *GH, int vindex, const char *alias) } /* get the coordinate ranges */ - CCTK_CoordRange (GH, &coord_origin3D[0], &min_ext[0], -1, "x", "cart3d"); - CCTK_CoordRange (GH, &coord_origin3D[1], &min_ext[0], -1, "y", "cart3d"); - CCTK_CoordRange (GH, &coord_origin3D[2], &min_ext[0], -1, "z", "cart3d"); - CCTK_CoordRange (GH, &min_ext[0], &max_ext[0], 1, NULL, "cart3d"); - CCTK_CoordRange (GH, &min_ext[1], &max_ext[1], 1, NULL, "cart3d"); + CCTK_CoordRange (GH, &min_ext[0], &max_ext[0], -1, "x", "cart3d"); + CCTK_CoordRange (GH, &min_ext[1], &max_ext[1], -1, "y", "cart3d"); + CCTK_CoordRange (GH, &min_ext[2], &max_ext[2], -1, "z", "cart3d"); /* loop over all 3 planes */ for (dir = 0; dir < 3; dir++) @@ -285,31 +284,28 @@ void IOFlexIO_Write2D (cGH *GH, int vindex, const char *alias) /* processor 0 write the hyperslab data */ if (myproc == 0) { - CCTK_REAL origin_attr[2], delta_attr[2]; - - /* the data itself */ CACTUS_IEEEIO_ERROR (IOwrite (IEEEfile_2D[dir], ioflex_type, 2, data_hsizes, data)); free (data); - /* Time and space attributes */ - origin_attr[0] = coord_origin3D[dir_i]; - origin_attr[1] = coord_origin3D[dir_j]; + /* Time, space, and coordinate attributes */ + min_ext_attr[0] = min_ext[dir_i]; + min_ext_attr[1] = min_ext[dir_j]; + max_ext_attr[0] = max_ext[dir_i]; + max_ext_attr[1] = max_ext[dir_j]; delta_attr[0] = GH->cctk_delta_space[dir_i]; delta_attr[1] = GH->cctk_delta_space[dir_j]; CACTUS_IEEEIO_ERROR (IOwriteAttribute (IEEEfile_2D[dir], "time", FLEXIO_REAL, 1, &GH->cctk_time)); CACTUS_IEEEIO_ERROR (IOwriteAttribute (IEEEfile_2D[dir], "origin", - FLEXIO_REAL, 2, origin_attr)); - CACTUS_IEEEIO_ERROR (IOwriteAttribute (IEEEfile_2D[dir], "delta", - FLEXIO_REAL, 2, delta_attr)); - - /* and also the coordinate ranges */ + FLEXIO_REAL, 2, min_ext_attr)); CACTUS_IEEEIO_ERROR (IOwriteAttribute (IEEEfile_2D[dir], "min_ext", - FLEXIO_REAL, 2, min_ext)); + FLEXIO_REAL, 2, min_ext_attr)); CACTUS_IEEEIO_ERROR (IOwriteAttribute (IEEEfile_2D[dir], "max_ext", - FLEXIO_REAL, 2, max_ext)); + FLEXIO_REAL, 2, max_ext_attr)); + CACTUS_IEEEIO_ERROR (IOwriteAttribute (IEEEfile_2D[dir], "delta", + FLEXIO_REAL, 2, delta_attr)); } } /* end of loop over all 3 planes */ |