aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@eff87b29-5268-4891-90a3-a07138403961>2002-04-22 11:49:11 +0000
committertradke <tradke@eff87b29-5268-4891-90a3-a07138403961>2002-04-22 11:49:11 +0000
commit23443ad6636304a04fe8e204a6a12e2e0704afba (patch)
tree8e3f5e0435b06ea098dbccfbc2c5f3138e32c7ec
parent7a7576f739c42f4c2fbc099c6524446f48d05596 (diff)
Bugfix for setting the extent of the requested 2D hyperslab.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusIO/IOJpeg/trunk@63 eff87b29-5268-4891-90a3-a07138403961
-rw-r--r--src/Write.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/Write.c b/src/Write.c
index f4a15db..0d0215d 100644
--- a/src/Write.c
+++ b/src/Write.c
@@ -78,7 +78,7 @@ int IOJpeg_Write (const cGH *GH, CCTK_INT vindex, const char *alias)
char *fullname;
int extent_int[3];
CCTK_INT mapping;
- CCTK_INT origin[3], extent[3], direction[6], hsize[2];
+ CCTK_INT origin[3], extent[2], direction[6], hsize[2];
void *hdata;
CCTK_REAL min, max;
const CCTK_INT htype = CCTK_VARIABLE_REAL;
@@ -151,10 +151,8 @@ int IOJpeg_Write (const cGH *GH, CCTK_INT vindex, const char *alias)
}
/* set the extent vector */
- for (i = 0; i < 3; i++)
- {
- extent[i] = extent_int[i];
- }
+ extent[0] = extent_int[dir_i];
+ extent[1] = extent_int[dir_j];
/* set the origin using the slice center from IOUtil */
memset (origin, 0, sizeof (origin));
@@ -173,16 +171,16 @@ int IOJpeg_Write (const cGH *GH, CCTK_INT vindex, const char *alias)
if (mapping < 0)
{
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
- "IOJpeg_Write: Failed to define hyperslab mapping for "
- "variable '%s'", fullname);
+ "Failed to define hyperslab mapping for variable '%s'",
+ fullname);
continue;
}
total_hsize = hsize[0] * hsize[1];
if (total_hsize <= 0)
{
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
- "IOJpeg_Write: selected hyperslab has zero size for "
- "variable '%s' direction %d", fullname, dir);
+ "Selected hyperslab has zero size for variable '%s' "
+ "direction %d", fullname, dir);
Hyperslab_FreeMapping (mapping);
continue;
}
@@ -199,8 +197,7 @@ int IOJpeg_Write (const cGH *GH, CCTK_INT vindex, const char *alias)
if (i != 1)
{
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
- "IOJpeg_Write: Failed to extract hyperslab for variable '%s'",
- fullname);
+ "Failed to extract hyperslab for variable '%s'", fullname);
}
/* release the mapping structure */