From 53b2ec1501a117c1f3bbbf59d4769e9f7bd3205e Mon Sep 17 00:00:00 2001 From: schnetter Date: Tue, 10 Jul 2007 15:55:34 +0000 Subject: Check whether Fortran parameters work correctly git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/Fortran/trunk@37 51d2df92-0e4f-0410-a727-bd43d766d6b6 --- param.ccl | 5 +++++ schedule.ccl | 5 +++++ src/make.code.defn | 3 ++- src/paramcheck.F90 | 15 +++++++++++++++ 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/paramcheck.F90 diff --git a/param.ccl b/param.ccl index 5519aea..3ea8fa1 100644 --- a/param.ccl +++ b/param.ccl @@ -1 +1,6 @@ # Parameter definitions for thorn Fortran + +CCTK_INT one "This parameter has the value one" +{ + 1:1 :: "1" +} 1 diff --git a/schedule.ccl b/schedule.ccl index fb282a2..7adc0c9 100644 --- a/schedule.ccl +++ b/schedule.ccl @@ -1 +1,6 @@ # Schedule definitions for thorn Fortran + +SCHEDULE CheckFortranParameters AT paramcheck +{ + LANG: Fortran +} "Test whether Fortran parameters work correctly" diff --git a/src/make.code.defn b/src/make.code.defn index d9c9c05..1c0e5d7 100644 --- a/src/make.code.defn +++ b/src/make.code.defn @@ -39,7 +39,8 @@ SRCS = cctk.F90 \ cctk_Types.F90 \ cctk_Version.F90 \ cctk_WarnLevel.F90 \ - util_Table.F90 + util_Table.F90 \ + paramcheck.F90 else diff --git a/src/paramcheck.F90 b/src/paramcheck.F90 new file mode 100644 index 0000000..489949e --- /dev/null +++ b/src/paramcheck.F90 @@ -0,0 +1,15 @@ +#include +#include +#include +#include + +subroutine CheckFortranParameters (CCTK_ARGUMENTS) + implicit none + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + DECLARE_CCTK_FUNCTIONS + + if (one /= 1) then + call CCTK_PARAMWARN ("Fortran parameters do not work -- check the C/Fortran language interface") + end if +end subroutine CheckFortranParameters -- cgit v1.2.3