aboutsummaryrefslogtreecommitdiff
path: root/src/DumpVar.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/DumpVar.c')
-rw-r--r--src/DumpVar.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/DumpVar.c b/src/DumpVar.c
index caafb13..35920bb 100644
--- a/src/DumpVar.c
+++ b/src/DumpVar.c
@@ -87,22 +87,24 @@ int IOJpeg_DumpVar (cGH *GH, int index, int timelevel, IOJpegGeo_t *geo, FILE *f
return (-1);
}
- /* Output routine for valid fid (was set in Write nD) */
- if (fid)
+ /* Output the hyperslab data */
+ if (IOJpeg_Output (GH, index, timelevel, data, geo->sdim, hsizes,
+ vtype, fid)<0)
{
- if (IOJpeg_Output(GH, index, timelevel, data,
- geo->sdim, hsizes, vtype, fid)<0) {
- char *fullname = CCTK_FullName (index);
- CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
- "IOJpeg_Output failed for variable '%s'", fullname);
- free (fullname);
- return (-1);
- }
+ char *fullname = CCTK_FullName (index);
+
+
+ CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "IOJpeg_Output failed for variable '%s'", fullname);
+ free (fullname);
+ return (-1);
}
+ /* free allocated resources */
if (data)
+ {
free (data);
-
+ }
if (hsizes)
{
free (hsizes);
@@ -139,7 +141,7 @@ int IOJpeg_Output(cGH *GH, int index, int timelevel, CCTK_REAL *data,
CCTK_VARIABLE_REAL,&min, 1, index);
}
- if(CCTK_MyProc(GH) == 0)
+ if(fid)
{
AutoColorDataSlice(hsize[0],
hsize[1],