GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
xerrwv.f
Go to the documentation of this file.
1 *DECK XERRWV
2  SUBROUTINE xerrwv (MSG, NMES, NERR, LEVEL, NI, I1, I2, NR, R1, R2)
3 C***BEGIN PROLOGUE XERRWV
4 C***SUBSIDIARY
5 C***PURPOSE Write error message with values.
6 C***CATEGORY R3C
7 C***TYPE SINGLE PRECISION (XERRWV-S, XERRWD-D)
8 C***AUTHOR Hindmarsh, Alan C., (LLNL)
9 C***DESCRIPTION
10 C
11 C Subroutines XERRWV, XSETF, XSETUN, and the function routine IXSAV,
12 C as given here, constitute a simplified version of the SLATEC error
13 C handling package.
14 C
15 C All arguments are input arguments.
16 C
17 C MSG = The message (character array).
18 C NMES = The length of MSG (number of characters).
19 C NERR = The error number (not used).
20 C LEVEL = The error level..
21 C 0 or 1 means recoverable (control returns to caller).
22 C 2 means fatal (run is aborted--see note below).
23 C NI = Number of integers (0, 1, or 2) to be printed with message.
24 C I1,I2 = Integers to be printed, depending on NI.
25 C NR = Number of reals (0, 1, or 2) to be printed with message.
26 C R1,R2 = Reals to be printed, depending on NR.
27 C
28 C Note.. this routine is machine-dependent and specialized for use
29 C in limited context, in the following ways..
30 C 1. The argument MSG is assumed to be of type CHARACTER, and
31 C the message is printed with a format of (1X,A).
32 C 2. The message is assumed to take only one line.
33 C Multi-line messages are generated by repeated calls.
34 C 3. If LEVEL = 2, control passes to the statement STOP
35 C to abort the run. This statement may be machine-dependent.
36 C 4. R1 and R2 are assumed to be in single precision and are printed
37 C in E21.13 format.
38 C
39 C***ROUTINES CALLED IXSAV
40 C***REVISION HISTORY (YYMMDD)
41 C 791129 DATE WRITTEN
42 C 890413 Heavily revised, with Common eliminated. (ACH, PNB)
43 C 921118 Replaced MFLGSV/LUNSAV by IXSAV. (ACH)
44 C 930329 Modified prologue to SLATEC format. (FNF)
45 C 930407 Changed MSG from CHARACTER*1 array to variable. (FNF)
46 C 930922 Minor cosmetic change. (FNF)
47 C***END PROLOGUE XERRWV
48 C
49 C*Internal Notes:
50 C
51 C For a different default logical unit number, IXSAV (or a subsidiary
52 C routine that it calls) will need to be modified.
53 C For a different run-abort command, change the statement following
54 C statement 100 at the end.
55 C-----------------------------------------------------------------------
56 C Subroutines called by XERRWV.. None
57 C Function routine called by XERRWV.. IXSAV
58 C-----------------------------------------------------------------------
59 C**End
60 C
61 C Declare arguments.
62 C
63  REAL R1, R2
64  INTEGER NMES, NERR, LEVEL, NI, I1, I2, NR
65  CHARACTER*(*) MSG
66 C
67 C Declare local variables.
68 C
69  INTEGER LUNIT, IXSAV, MESFLG
70 C
71 C Get logical unit number and message print flag.
72 C
73 C***FIRST EXECUTABLE STATEMENT XERRWV
74  lunit = ixsav(1, 0, .false.)
75  mesflg = ixsav(2, 0, .false.)
76  IF (mesflg .EQ. 0) GO TO 100
77 C
78 C Write the message.
79 C
80  WRITE (lunit,10) msg(1:nmes)
81  10 FORMAT(1x,a)
82  IF (ni .EQ. 1) WRITE (lunit, 20) i1
83  20 FORMAT(6x,'In above message, I1 =',i10)
84  IF (ni .EQ. 2) WRITE (lunit, 30) i1,i2
85  30 FORMAT(6x,'In above message, I1 =',i10,3x,'I2 =',i10)
86  IF (nr .EQ. 1) WRITE (lunit, 40) r1
87  40 FORMAT(6x,'In above message, R1 =',e21.13)
88  IF (nr .EQ. 2) WRITE (lunit, 50) r1,r2
89  50 FORMAT(6x,'In above, R1 =',e21.13,3x,'R2 =',e21.13)
90 C
91 C Abort the run if LEVEL = 2.
92 C
93  100 IF (level .NE. 2) RETURN
94  CALL xstopx (' ')
95 C----------------------- End of Subroutine XERRWV ----------------------
96  END
subroutine xerrwv(MSG, NMES, NERR, LEVEL, NI, I1, I2, NR, R1, R2)
Definition: xerrwv.f:3