summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorlanfer <lanfer@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-11-27 02:32:34 +0000
committerlanfer <lanfer@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-11-27 02:32:34 +0000
commit8c2cdc55827a15dc5484132ec71ba296dd0f8fb4 (patch)
tree42343ef26ddf8116ce95753ed0f3aa049faa1999 /src/include
parentf2cfa41b76866d31b8fe50b322d2756972789be4 (diff)
adding macro for easy error/ok checking, works like this:
call CCTK_ReduceLocalScalar(ierr, cctkGH, -1, sum_handle, $ resnorm, residual, CCTK_VARIABLE_REAL) call CCTKi_EXPECTOK(ierr,0,1,"Reduction of norm failed") you plug the return value (ierr) into macro, along with the success value (0). You give the warning level if (ierr.ne.0) and the message to output. Saves some if then statments. there is also a CCTK_EXPECTERROR, where you compare ierr to an error value, handles the same way. (Currently internal CCTKi) gerd git-svn-id: http://svn.cactuscode.org/flesh/trunk@1172 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/include')
-rw-r--r--src/include/cctk.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/include/cctk.h b/src/include/cctk.h
index 77dd3099..f1208a10 100644
--- a/src/include/cctk.h
+++ b/src/include/cctk.h
@@ -51,6 +51,11 @@
CCTK_POINTER cctkGH&&\
#define CCTK_WARN(a,b) CCTK_Warn(a,__LINE__,__FORTRANFILE__,CCTK_THORNSTRING,b)
+
+#define CCTKi_EXPECTERR(in,err,warnonerr,message) CCTKi_ExpectError(in,err,warnonerr,__LINE__,__FORTRANFILE__,CCTK_THORNSTRING,message)
+
+#define CCTKi_EXPECTOK(in,ok,warnonerr,message) CCTKi_ExpectOK(in,ok,warnonerr,__LINE__,__FORTRANFILE__,CCTK_THORNSTRING,message)
+
#define CCTK_EQUALS(a,b) (CCTK_Equals(a,b).eq.1)
#define CCTK_PASS_FTOF CCTK_FARGUMENTS
@@ -170,6 +175,10 @@ extern int _cctk_one;
#define CCTK_WARN(a,b) CCTK_Warn(a,__LINE__,__FILE__,CCTK_THORNSTRING,b)
+#define CCTKi_EXPCTERR(in,err,warnonerr,message) CCTKi_ExpectError(in,err,warnonerr,__LINE__,__FORTRANFILE__,CCTK_THORNSTRING,message)
+
+#define CCTKi_EXPCTOK(in,ok,onerr,message) CCTKi_ExpectOK(in,ok,warnonerr,__LINE__,__FORTRANFILE__,CCTK_THORNSTRING,message)
+
#endif /*CCODE*/
#define CCTK_INFO(a) CCTK_Info(CCTK_THORNSTRING,a)