aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrideout <rideout@94b1c47f-dcfd-45ef-a468-0854c0e9e350>2003-12-03 21:48:43 +0000
committerrideout <rideout@94b1c47f-dcfd-45ef-a468-0854c0e9e350>2003-12-03 21:48:43 +0000
commit3af4dbc1bda0e5da9175bf7cf3eecd5b3dcd1894 (patch)
treeabadf9975dc076d85d93d505ffea7aaf8d44e422
parent8d9c801b413f28ef506952d0550de1471b2977a0 (diff)
Provide level 1 warning if OutputVarAs() is called on an invalid variable name.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOASCII/trunk@153 94b1c47f-dcfd-45ef-a468-0854c0e9e350
-rw-r--r--src/Output1D.c8
-rw-r--r--src/Output2D.c7
-rw-r--r--src/Output3D.c8
3 files changed, 18 insertions, 5 deletions
diff --git a/src/Output1D.c b/src/Output1D.c
index b0e73c5..b780e26 100644
--- a/src/Output1D.c
+++ b/src/Output1D.c
@@ -117,8 +117,12 @@ int IOASCII_Output1DVarAs (const cGH *GH, const char *fullname, const char *alia
retval = -1;
vindex = CCTK_VarIndex (fullname);
-
- if (CheckOutputVar (vindex))
+ if (vindex<0)
+ {
+ CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "There is no such variable %s. Ignoring IOASCII 1D output.",
+ fullname);
+ } else if (CheckOutputVar (vindex))
{
retval = IOASCII_Write1D (GH, vindex, alias);
}
diff --git a/src/Output2D.c b/src/Output2D.c
index a830e42..7d046a9 100644
--- a/src/Output2D.c
+++ b/src/Output2D.c
@@ -117,7 +117,12 @@ int IOASCII_Output2DVarAs (const cGH *GH, const char *fullname, const char *alia
retval = -1;
vindex = CCTK_VarIndex (fullname);
- if (CheckOutputVar (vindex) == 0)
+ if (vindex<0)
+ {
+ CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "There is no such variable %s. Ignoring IOASCII 2D output.",
+ fullname);
+ } else if (CheckOutputVar (vindex) == 0)
{
retval = IOASCII_Write2D (GH, vindex, alias);
}
diff --git a/src/Output3D.c b/src/Output3D.c
index 92a1119..886cd75 100644
--- a/src/Output3D.c
+++ b/src/Output3D.c
@@ -117,8 +117,12 @@ int IOASCII_Output3DVarAs (const cGH *GH, const char *fullname, const char *alia
retval = -1;
vindex = CCTK_VarIndex (fullname);
-
- if (CheckOutputVar (vindex) == 0)
+ if (vindex<0)
+ {
+ CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "There is no such variable %s. Ignoring IOASCII 3D output.",
+ fullname);
+ } else if (CheckOutputVar (vindex) == 0)
{
retval = IOASCII_Write3D (GH, vindex, alias);
}