aboutsummaryrefslogtreecommitdiff
path: root/src/Storage.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Storage.c')
-rw-r--r--src/Storage.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Storage.c b/src/Storage.c
index acfec4b..c3f8b6f 100644
--- a/src/Storage.c
+++ b/src/Storage.c
@@ -427,6 +427,10 @@ int PUGH_DisableGroupStorage (const cGH *GH, const char *groupname)
/* get global index of first variable in group */
first_var = CCTK_FirstVarIndexI (group);
+ if (first_var < 0)
+ {
+ CCTK_WARN (0, "Illegal group index -- group has no variables");
+ }
variables = (pGA ***) PUGH_pGH (GH)->variables;
@@ -1145,6 +1149,12 @@ static int PUGHi_EnableGArrayGroupStorage (pGH *pughGH,
pGA *GA;
int level;
+
+ if (first_var < 0)
+ {
+ CCTK_WARN (0, "Illegal variable index");
+ }
+
retval = 0;
nstorage = 0;
nnostorage = 0;
@@ -1249,6 +1259,12 @@ static int PUGHi_DisableGArrayGroupStorage (pGH *pughGH,
pGA *GA;
int level;
+
+ if (first_var < 0)
+ {
+ CCTK_WARN (0, "Illegal variable index");
+ }
+
retval = 0;
nstorage = 0;
nnostorage = 0;
@@ -1320,6 +1336,12 @@ int PUGH_NumTimeLevels(const pGH *pughGH, int var)
int timelevels;
+
+ if (var < 0)
+ {
+ CCTK_WARN (0, "Illegal variable index");
+ }
+
timelevels = CCTK_MaxTimeLevelsVI(var);
retval = PUGHi_NumTimeLevelsArray(pughGH, var, timelevels);
@@ -1359,6 +1381,12 @@ int PUGHi_NumTimeLevelsArray(const pGH *pughGH, int var, int timelevels)
int level;
pGA *GA;
+
+ if (var < 0)
+ {
+ CCTK_WARN (0, "Illegal variable index");
+ }
+
retval = 0;
for (level = 0; level < timelevels; level++)