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