aboutsummaryrefslogtreecommitdiff
path: root/src/WriteInfo.c
diff options
context:
space:
mode:
authorallen <allen@b589c3ab-70e8-4b4d-a09f-cba2dd200880>2000-07-19 12:20:56 +0000
committerallen <allen@b589c3ab-70e8-4b4d-a09f-cba2dd200880>2000-07-19 12:20:56 +0000
commit5ef5219e049640848f134969fec13edf850606c7 (patch)
tree34d6f00ec5b9ae1600c7cb25eecb54a815b35faf /src/WriteInfo.c
parent4708b9c442dcf8919a614866d599e8a0a239ebcf (diff)
Only output scalar's if their values have been successfully
calculated git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOBasic/trunk@63 b589c3ab-70e8-4b4d-a09f-cba2dd200880
Diffstat (limited to 'src/WriteInfo.c')
-rw-r--r--src/WriteInfo.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/src/WriteInfo.c b/src/WriteInfo.c
index ca06ae9..504b7a9 100644
--- a/src/WriteInfo.c
+++ b/src/WriteInfo.c
@@ -19,34 +19,49 @@
#include "cctk.h"
#include "CactusBase/IOUtil/src/ioGH.h"
-CCTK_REAL IOBasic_WriteInfo (cGH *GH, int index, const char *operator, const char *alias)
+int IOBasic_WriteInfo (cGH *GH,
+ CCTK_REAL *val,
+ int index,
+ const char *operator,
+ const char *alias)
{
+ int ierr;
int reduce_handle;
- CCTK_REAL retval = 0;
-
+ int retval = 0;
/* first, check if variable has storage assigned */
- if (! CCTK_QueryGroupStorageI (GH, CCTK_GroupIndexFromVarI (index))) {
+ if (! CCTK_QueryGroupStorageI (GH, CCTK_GroupIndexFromVarI (index)))
+ {
char *fullname;
fullname = CCTK_FullName (index);
CCTK_VWarn (2, __LINE__, __FILE__, CCTK_THORNSTRING,
- "No info output for '%s' (no storage)", fullname);
+ "IOBasic_WriteInfo: No info output for '%s' (no storage)",
+ fullname);
free (fullname);
- return (0);
+ return -3;
}
reduce_handle = CCTK_ReductionHandle(operator);
if (reduce_handle > -1)
{
- CCTK_Reduce(GH,0,reduce_handle,1,CCTK_VARIABLE_REAL,&retval,1,index);
+ ierr = CCTK_Reduce(GH,0,reduce_handle,1,
+ CCTK_VARIABLE_REAL,val,1,index);
+ if (ierr < 0)
+ {
+ CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "IOBasic_WriteInfo: Internal error in reduction '%s'",
+ operator);
+ retval = -2;
+ }
}
else
{
CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING,
- "Reduction operator '%s' doesn't exist or failed internally", operator);
- retval = -27;
+ "IOBasic_WriteInfo: Reduction operator '%s' not found",
+ operator);
+ retval = -1;
}
return retval;