aboutsummaryrefslogtreecommitdiff
path: root/src/Write.c
diff options
context:
space:
mode:
authortradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880>1999-12-13 18:29:24 +0000
committertradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880>1999-12-13 18:29:24 +0000
commitdacd91bb5504ab769340bd20fb6b56a1eb689258 (patch)
tree22042ead33634adea5b32d189c953a516138cba1 /src/Write.c
parentda453eedc9ebd8af963fc4b1219b7e00c73d8510 (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/Write.c')
-rw-r--r--src/Write.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Write.c b/src/Write.c
index c2c9531..7eca768 100644
--- a/src/Write.c
+++ b/src/Write.c
@@ -28,6 +28,20 @@ void IOBasic_Write (cGH *GH, int index, const char *alias)
CCTK_REAL *data_real;
CCTK_INT *data_int;
+
+ /* 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 scalar output for '%s' (no storage)", fullname);
+ CCTK_WARN (2, msg);
+ free (fullname);
+ free (msg);
+ return;
+ }
+
/* Open the file (we write only on proc0) */
if (CCTK_MyProc (GH) == 0)
{