[Developers] patch: make "cctk_WarnLevel.h" includable by Fortran code

Tom Goodale goodale at cct.lsu.edu
Wed May 11 05:24:32 CDT 2005


Looks good.  Please apply.

Tom

On Sat, 7 May 2005, Jonathan Thornburg wrote:

> As of current CVS, "cctk_WarnLevel.h" is a C/C++-only header file,
> i.e. it's not valid for Fortran code (either 77 or 90).  In particular,
> this means that the warning-level #defines we introduced on 10.Dec.2004
> in responce to Cactus bug#1742,
>
> /* suggested values for warning levels (courtesy of Steve, PR#1742) */
> #define CCTK_WARN_ABORT    0    /* abort the Cactus run */
> #define CCTK_WARN_ALERT    1    /* the results of this run will be wrong, */
>                                /* and this will surprise the user, */
>                                /* but we can still continue the run */
> #define CCTK_WARN_COMPLAIN 2    /* the user should know about this, */
>                                /* but the this problem is not terribly */
>                                /* surprising */
> #define CCTK_WARN_PICKY    3    /* this is for small problems that can */
>                                /* probably be ignored, but that careful */
>                                /* people may want to know about */
> #define CCTK_WARN_DEBUG    4    /* these messages are probably useful */
>                                /* only for debugging purposes */
>
> are not available to Fortran code.
>
> I propose that we change this (making these defines available to Fortran
> as well as C/C++), by applying the enclosed patch.
>
> This would change 2 flesh header files in  src/include/ :
> * cctk.h would be changed to #include "cctk_WarnLevel.h" for Fortran
>  as well as for C/C++
> * cctk_WarnLevel.h would be changed so it could safely be #included
>  from Fortran (as well as still from C/C++, of course), by guarding
>  C/C++-only constructs with  #ifdef CCODE  ...  #endif .
>
> [I had thought we had already made this change, and in fact I was the
> one who (also on 10.Dec.2004) changed the Fortran example for CCTK_WARN()
> in the Cactus Reference Manual to use CCTK_WARN_ABORT.  Hence my surprise
> to discover that this gives a syntax error because CCTK_WARN_ABORT isn't
> (yet) defined for Fortran code, and hence this patch proposal.....]
>
> ciao,
>
>



More information about the Developers mailing list