diff options
author | tradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880> | 1999-12-13 18:29:24 +0000 |
---|---|---|
committer | tradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880> | 1999-12-13 18:29:24 +0000 |
commit | dacd91bb5504ab769340bd20fb6b56a1eb689258 (patch) | |
tree | 22042ead33634adea5b32d189c953a516138cba1 /src/WriteInfo.c | |
parent | da453eedc9ebd8af963fc4b1219b7e00c73d8510 (diff) |
Moved the test, if storage was assigned to a variable to be output,
from the TimeToOutput() routines into the lower level WriteOutput()
routines. Fixing by that
* the behaviour of triggers, where TimeToOutput() is called BEFORE
storage is possibly assigned (BR 170)
* a potential bug when calling OutputVarAs() where no such test was
done before
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOBasic/trunk@18 b589c3ab-70e8-4b4d-a09f-cba2dd200880
Diffstat (limited to 'src/WriteInfo.c')
-rw-r--r-- | src/WriteInfo.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/WriteInfo.c b/src/WriteInfo.c index e3a17a7..d8f1a9d 100644 --- a/src/WriteInfo.c +++ b/src/WriteInfo.c @@ -24,6 +24,20 @@ CCTK_REAL IOBasic_WriteInfo (cGH *GH, int index, const char *operator, const cha int reduce_handle; CCTK_REAL retval; + + /* first, check if variable has storage assigned */ + if (! CCTK_QueryGroupStorageI (GH, CCTK_GroupIndexFromVarI (index))) { + char *msg, *fullname; + + fullname = CCTK_FullName (index); + msg = (char *) malloc (200 * sizeof (char) + strlen (fullname)); + sprintf (msg, "No info output for '%s' (no storage)", fullname); + CCTK_WARN (2, msg); + free (fullname); + free (msg); + return (0); + } + reduce_handle = CCTK_ReductionHandle(operator); if (reduce_handle > -1) |