aboutsummaryrefslogtreecommitdiff
path: root/src/Write.c
diff options
context:
space:
mode:
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)
{