Merge lp:~asc/fluidity/here into lp:fluidity

Proposed by Adam Candy
Status: Work in progress
Proposed branch: lp:~asc/fluidity/here
Merge into: lp:fluidity
Diff against target: 36 lines (+15/-0)
2 files modified
debug/Debug.F90 (+14/-0)
include/fdebug.h (+1/-0)
To merge this branch: bzr merge lp:~asc/fluidity/here
Reviewer Review Type Date Requested Status
Fluidity Core Team Pending
Review via email: mp+73886@code.launchpad.net

Description of the change

A new debugging function FLHere(string) which prints out filename:linenumber followed by 'string' - much like FLExit and FLAbort. This function will not be called in release code, but is useful for debugging.

To post a comment you must log in.
Revision history for this message
Adam Candy (asc) wrote :

I've had some feedback on this request, and plan to make changes shortly, when I have time - watch this space.

Unmerged revisions

3570. By Adam Candy

A new debugging function FLHere(string) which prints out filename:linenumber followed by 'string' - much like FLExit and FLAbort. This function will not be called in release code, but is useful for debugging.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debug/Debug.F90'
2--- debug/Debug.F90 2011-04-22 16:21:29 +0000
3+++ debug/Debug.F90 2011-09-02 21:06:25 +0000
4@@ -123,6 +123,20 @@
5 STOP
6 END SUBROUTINE FLExit_pinpoint
7
8+ SUBROUTINE FLHere_pinpoint(HereStr, FromFile, LineNumber)
9+
10+ CHARACTER*(*) HereStr, FromFile
11+ INTEGER LineNumber
12+ LOGICAL UsingMPI
13+ INTEGER IERR
14+#ifndef NDEBUG
15+ ewrite(-1,FMT='(3A,I0,2A)') "Here at: ", FromFile, ":", LineNumber, " ", HereStr
16+#else
17+ ewrite(-1,FMT='(2A)') "Here: ", HereStr
18+#endif
19+
20+ END SUBROUTINE FLHere_pinpoint
21+
22 subroutine write_minmax_real_array(array, array_expression)
23 ! the array to print its min and max of
24 real, dimension(:), intent(in):: array
25
26=== modified file 'include/fdebug.h'
27--- include/fdebug.h 2011-04-22 16:21:29 +0000
28+++ include/fdebug.h 2011-09-02 21:06:25 +0000
29@@ -55,6 +55,7 @@
30
31 #define FLAbort(X) call FLAbort_pinpoint(X, __FILE__, __LINE__)
32 #define FLExit(X) call FLExit_pinpoint(X, __FILE__, __LINE__)
33+#define FLHere(X) call FLHere_pinpoint(X, __FILE__, __LINE__)
34
35 ! #define FORTRAN_DISALLOWS_LONG_LINES
36 #ifdef NDEBUG