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