LMDZ
xersve.F
Go to the documentation of this file.
1 *DECK XERSVE
2  SUBROUTINE xersve (LIBRAR, SUBROU, MESSG, KFLAG, NERR, LEVEL,
3  + icount)
4  IMPLICIT NONE
5 C***BEGIN PROLOGUE XERSVE
6 C***SUBSIDIARY
7 C***PURPOSE Record that an error has occurred.
8 C***LIBRARY SLATEC (XERROR)
9 C***CATEGORY R3
10 C***TYPE ALL (XERSVE-A)
11 C***KEYWORDS ERROR, XERROR
12 C***AUTHOR Jones, R. E., (SNLA)
13 C***DESCRIPTION
14 C
15 C *Usage:
16 C
17 C INTEGER KFLAG, NERR, LEVEL, ICOUNT
18 C CHARACTER * (len) LIBRAR, SUBROU, MESSG
19 C
20 C CALL XERSVE (LIBRAR, SUBROU, MESSG, KFLAG, NERR, LEVEL, ICOUNT)
21 C
22 C *Arguments:
23 C
24 C LIBRAR :IN is the library that the message is from.
25 C SUBROU :IN is the subroutine that the message is from.
26 C MESSG :IN is the message to be saved.
27 C KFLAG :IN indicates the action to be performed.
28 C when KFLAG > 0, the message in MESSG is saved.
29 C when KFLAG=0 the tables will be dumped and
30 C cleared.
31 C when KFLAG < 0, the tables will be dumped and
32 C not cleared.
33 C NERR :IN is the error number.
34 C LEVEL :IN is the error severity.
35 C ICOUNT :OUT the number of times this message has been seen,
36 C or zero if the table has overflowed and does not
37 C contain this message specifically. When KFLAG=0,
38 C ICOUNT will not be altered.
39 C
40 C *Description:
41 C
42 C Record that this error occurred and possibly dump and clear the
43 C tables.
44 C
45 C***REFERENCES R. E. Jones and D. K. Kahaner, XERROR, the SLATEC
46 C Error-handling Package, SAND82-0800, Sandia
47 C Laboratories, 1982.
48 C***ROUTINES CALLED I1MACH, XGETUA
49 C***REVISION HISTORY (YYMMDD)
50 C 800319 DATE WRITTEN
51 C 861211 REVISION DATE from Version 3.2
52 C 891214 Prologue converted to Version 4.0 format. (BAB)
53 C 900413 Routine modified to remove reference to KFLAG. (WRB)
54 C 900510 Changed to add LIBRARY NAME and SUBROUTINE to calling
55 C sequence, use IF-THEN-ELSE, make number of saved entries
56 C easily changeable, changed routine name from XERSAV to
57 C XERSVE. (RWC)
58 C 910626 Added LIBTAB and SUBTAB to SAVE statement. (BKS)
59 C 920501 Reformatted the REFERENCES section. (WRB)
60 C***END PROLOGUE XERSVE
61  INTEGER,PARAMETER :: LENTAB=10
62  INTEGER LUN(5)
63  CHARACTER*(*) LIBRAR, SUBROU, MESSG
64  CHARACTER*8 LIBTAB(lentab), SUBTAB(lentab), LIB, SUB
65  CHARACTER*20 MESTAB(lentab), MES
66  dimension nertab(lentab), levtab(lentab), kount(lentab)
67  SAVE libtab, subtab, mestab, nertab, levtab, kount, kountx, nmsg
68  DATA kountx/0/, nmsg/0/
69  INTEGER NERR,LEVEL,KONTRL
70  INTEGER NERTAB, LEVTAB, KOUNT, KOUNTX, NMSG
71  INTEGER KFLAG, ICOUNT, NUNIT, KUNIT, IUNIT, I1MACH, I
72 C***FIRST EXECUTABLE STATEMENT XERSVE
73 C
74  IF (kflag.LE.0) THEN
75 C
76 C Dump the table.
77 C
78  IF (nmsg.EQ.0) RETURN
79 C
80 C Print to each unit.
81 C
82  CALL xgetua (lun, nunit)
83  DO 20 kunit = 1,nunit
84  iunit = lun(kunit)
85  IF (iunit.EQ.0) iunit = i1mach(4)
86 C
87 C Print the table header.
88 C
89  WRITE (iunit,9000)
90 C
91 C Print body of table.
92 C
93  DO 10 i = 1,nmsg
94  WRITE (iunit,9010) libtab(i), subtab(i), mestab(i),
95  * nertab(i),levtab(i),kount(i)
96  10 CONTINUE
97 C
98 C Print number of other errors.
99 C
100  IF (kountx.NE.0) WRITE (iunit,9020) kountx
101  WRITE (iunit,9030)
102  20 CONTINUE
103 C
104 C Clear the error tables.
105 C
106  IF (kflag.EQ.0) THEN
107  nmsg = 0
108  kountx = 0
109  ENDIF
110  ELSE
111 C
112 C PROCESS A MESSAGE...
113 C SEARCH FOR THIS MESSG, OR ELSE AN EMPTY SLOT FOR THIS MESSG,
114 C OR ELSE DETERMINE THAT THE ERROR TABLE IS FULL.
115 C
116  lib = librar
117  sub = subrou
118  mes = messg
119  DO 30 i = 1,nmsg
120  IF (lib.EQ.libtab(i) .AND. sub.EQ.subtab(i) .AND.
121  * mes.EQ.mestab(i) .AND. nerr.EQ.nertab(i) .AND.
122  * level.EQ.levtab(i)) THEN
123  kount(i) = kount(i) + 1
124  icount = kount(i)
125  RETURN
126  ENDIF
127  30 CONTINUE
128 C
129  IF (nmsg.LT.lentab) THEN
130 C
131 C Empty slot found for new message.
132 C
133  nmsg = nmsg + 1
134  libtab(i) = lib
135  subtab(i) = sub
136  mestab(i) = mes
137  nertab(i) = nerr
138  levtab(i) = level
139  kount(i) = 1
140  icount = 1
141  ELSE
142 C
143 C Table is full.
144 C
145  kountx = kountx+1
146  icount = 0
147  ENDIF
148  ENDIF
149  RETURN
150 C
151 C Formats.
152 C
153  9000 FORMAT ('0 ERROR MESSAGE SUMMARY' /
154  + ' LIBRARY SUBROUTINE MESSAGE START NERR',
155  + ' LEVEL COUNT')
156  9010 FORMAT (1x,a,3x,a,3x,a,3i10)
157  9020 FORMAT ('0OTHER ERRORS NOT INDIVIDUALLY TABULATED = ', i10)
158  9030 FORMAT (1x)
159  END
subroutine xersve(LIBRAR, SUBROU, MESSG, KFLAG, NERR, LEVEL, ICOUNT)
Definition: xersve.F:4
subroutine xgetua(IUNITA, N)
Definition: xgetua.F:3
!$Header!c c INCLUDE fxyprim h c c c Fonctions in line c c REAL fyprim REAL rj c c il faut la calculer avant d appeler ces fonctions c c c Fonctions a changer selon x(x) et y(y) choisis.c-----------------------------------------------------------------c c.....ici