aboutsummaryrefslogtreecommitdiff
path: root/src/Write2D.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Write2D.c')
-rw-r--r--src/Write2D.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/Write2D.c b/src/Write2D.c
index e3e9847..65fdebb 100644
--- a/src/Write2D.c
+++ b/src/Write2D.c
@@ -108,8 +108,17 @@ CCTK_FILEVERSION(CactusBase_IOASCII_Write2D_c)
@vtype const char *
@vio in
@endvar
+
+ @returntype int
+ @returndesc
+ 0 for success, or<BR>
+ -1 if variable has no storage assigned<BR>
+ -2 if output file couldn't be opened<BR>
+ -3 if hyperslab for coordinates and/or variable couldn't be
+ extracted
+ @endreturndesc
@@*/
-void IOASCII_Write2D (const cGH *GH, int vindex, const char *alias)
+int IOASCII_Write2D (const cGH *GH, int vindex, const char *alias)
{
DECLARE_CCTK_PARAMETERS
int myproc;
@@ -152,7 +161,7 @@ void IOASCII_Write2D (const cGH *GH, int vindex, const char *alias)
CCTK_VWarn (2, __LINE__, __FILE__, CCTK_THORNSTRING,
"No IOASCII 2D output for '%s' (no storage)", fullname);
free (fullname);
- return;
+ return (-1);
}
/* Get the handle for IOASCII extensions */
@@ -294,7 +303,7 @@ void IOASCII_Write2D (const cGH *GH, int vindex, const char *alias)
{
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
"Cannot open 2D output file '%s'", filename);
- return;
+ return (-2);
}
/* advertise the file for downloading and write file info */
@@ -398,7 +407,7 @@ void IOASCII_Write2D (const cGH *GH, int vindex, const char *alias)
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
"Failed to extract 2D hyperslab for %c-coordinate",
'x' + dir_i);
- return;
+ return (-3);
}
/* get the j-coordinate slice */
@@ -410,7 +419,7 @@ void IOASCII_Write2D (const cGH *GH, int vindex, const char *alias)
"Failed to extract 2D hyperslab for %c-coordinate",
'x' + dir_j);
free (coord_data_i);
- return;
+ return (-3);
}
}
else
@@ -436,7 +445,7 @@ void IOASCII_Write2D (const cGH *GH, int vindex, const char *alias)
{
free (coord_data_j);
}
- return;
+ return (-3);
}
/* proc 0 writes */
@@ -552,4 +561,6 @@ void IOASCII_Write2D (const cGH *GH, int vindex, const char *alias)
} /* end of outputting the data by processor 0 */
} /* end of looping through xyz directions */
+
+ return (0);
}