subroutine xerrwv (msg, nmes, nerr, level, ni, i1, i2, nr, r1, r2) C***BEGIN PROLOGUE XERRWV C***SUBSIDIARY C***PURPOSE Write error message with values. C***CATEGORY R3C C***TYPE SINGLE PRECISION (XERRWV-S, XERRWD-D) C***AUTHOR Hindmarsh, Alan C., (LLNL) C***DESCRIPTION C C Subroutines XERRWV, XSETF, XSETUN, and the function routine IXSAV, C as given here, constitute a simplified version of the SLATEC error C handling package. C C All arguments are input arguments. C C MSG = The message (character array). C NMES = The length of MSG (number of characters). C NERR = The error number (not used). C LEVEL = The error level.. C 0 or 1 means recoverable (control returns to caller). C 2 means fatal (run is aborted--see note below). C NI = Number of integers (0, 1, or 2) to be printed with message. C I1,I2 = Integers to be printed, depending on NI. C NR = Number of reals (0, 1, or 2) to be printed with message. C R1,R2 = Reals to be printed, depending on NR. C C Note.. this routine is machine-dependent and specialized for use C in limited context, in the following ways.. C 1. The argument MSG is assumed to be of type CHARACTER, and C the message is printed with a format of (1X,A). C 2. The message is assumed to take only one line. C Multi-line messages are generated by repeated calls. C 3. If LEVEL = 2, control passes to the statement STOP C to abort the run. This statement may be machine-dependent. C 4. R1 and R2 are assumed to be in single precision and are printed C in E21.13 format. C C***ROUTINES CALLED IXSAV C***REVISION HISTORY (YYMMDD) C 791129 DATE WRITTEN C 890413 Heavily revised, with Common eliminated. (ACH, PNB) C 921118 Replaced MFLGSV/LUNSAV by IXSAV. (ACH) C 930329 Modified prologue to SLATEC format. (FNF) C 930407 Changed MSG from CHARACTER*1 array to variable. (FNF) C 930922 Minor cosmetic change. (FNF) C***END PROLOGUE XERRWV C C*Internal Notes: C C For a different default logical unit number, IXSAV (or a subsidiary C routine that it calls) will need to be modified. C For a different run-abort command, change the statement following C statement 100 at the end. C----------------------------------------------------------------------- C Subroutines called by XERRWV.. None C Function routine called by XERRWV.. IXSAV C----------------------------------------------------------------------- C**End C C Declare arguments. C real r1, r2 integer nmes, nerr, level, ni, i1, i2, nr character*(*) msg c c declare local variables. c integer lunit, ixsav, mesflg c c get logical unit number and message print flag. c c***first executable statement xerrwv lunit = ixsav (1, 0, .false.) mesflg = ixsav (2, 0, .false.) if (mesflg .eq. 0) go to 100 c c write the message. c write (lunit,10) msg 10 format(1x,a) if (ni .eq. 1) write (lunit, 20) i1 20 format(6x,'in above message, i1 =',i10) if (ni .eq. 2) write (lunit, 30) i1,i2 30 format(6x,'in above message, i1 =',i10,3x,'i2 =',i10) if (nr .eq. 1) write (lunit, 40) r1 40 format(6x,'in above message, r1 =',e21.13) if (nr .eq. 2) write (lunit, 50) r1,r2 50 format(6x,'in above, r1 =',e21.13,3x,'r2 =',e21.13) c c abort the run if level = 2. c 100 if (level .ne. 2) return stop c----------------------- end of subroutine xerrwv ---------------------- end