2
SUBROUTINE SCHKW (NAME, LOCIW, LENIW, LOCW, LENW, IERR, ITER, ERR)
3
C***BEGIN PROLOGUE SCHKW
5
C***PURPOSE SLAP WORK/IWORK Array Bounds Checker.
6
C This routine checks the work array lengths and interfaces
7
C to the SLATEC error handler if a problem is found.
8
C***LIBRARY SLATEC (SLAP)
10
C***TYPE SINGLE PRECISION (SCHKW-S, DCHKW-D)
11
C***KEYWORDS ERROR CHECKING, SLAP, WORKSPACE CHECKING
12
C***AUTHOR Seager, Mark K., (LLNL)
13
C Lawrence Livermore National Laboratory
15
C Livermore, CA 94550 (510) 423-3141
21
C INTEGER LOCIW, LENIW, LOCW, LENW, IERR, ITER
24
C CALL SCHKW( NAME, LOCIW, LENIW, LOCW, LENW, IERR, ITER, ERR )
27
C NAME :IN Character*(*).
28
C Name of the calling routine. This is used in the output
29
C message, if an error is detected.
31
C Location of the first free element in the integer workspace
34
C Length of the integer workspace array.
36
C Location of the first free element in the real workspace
39
C Length of the real workspace array.
42
C IERR = 0 => All went well.
43
C IERR = 1 => Insufficient storage allocated for
46
C Set to zero on return.
48
C Set to the smallest positive magnitude if all went well.
49
C Set to a very large number if an error is detected.
52
C***ROUTINES CALLED R1MACH, XERMSG
53
C***REVISION HISTORY (YYMMDD)
55
C 881213 Previous REVISION DATE
56
C 890915 Made changes requested at July 1989 CML Meeting. (MKS)
57
C 890922 Numerous changes to prologue to make closer to SLATEC
59
C 890929 Numerous changes to reduce SP/DP differences. (FNF)
60
C 900805 Changed XERRWV calls to calls to XERMSG. (RWC)
61
C 910411 Prologue converted to Version 4.0 format. (BAB)
62
C 910502 Corrected XERMSG calls to satisfy Section 6.2.2 of ANSI
64
C 910506 Made subsidiary. (FNF)
65
C 920511 Added complete declaration section. (WRB)
66
C 921015 Added code to initialize ITER and ERR when IERR=0. (FNF)
67
C***END PROLOGUE SCHKW
68
C .. Scalar Arguments ..
70
INTEGER IERR, ITER, LENIW, LENW, LOCIW, LOCW
73
CHARACTER XERN1*8, XERN2*8, XERNAM*8
74
C .. External Functions ..
77
C .. External Subroutines ..
79
C***FIRST EXECUTABLE STATEMENT SCHKW
81
C Check the Integer workspace situation.
86
IF( LOCIW.GT.LENIW ) THEN
90
WRITE (XERN1, '(I8)') LOCIW
91
WRITE (XERN2, '(I8)') LENIW
92
CALL XERMSG ('SLATEC', 'SCHKW',
93
$ 'In ' // XERNAM // ', INTEGER work array too short. ' //
94
$ 'IWORK needs ' // XERN1 // '; have allocated ' // XERN2,
98
C Check the Real workspace situation.
99
IF( LOCW.GT.LENW ) THEN
103
WRITE (XERN1, '(I8)') LOCW
104
WRITE (XERN2, '(I8)') LENW
105
CALL XERMSG ('SLATEC', 'SCHKW',
106
$ 'In ' // XERNAM // ', REAL work array too short. ' //
107
$ 'RWORK needs ' // XERN1 // '; have allocated ' // XERN2,
111
C------------- LAST LINE OF SCHKW FOLLOWS ----------------------------