subroutine ssolsy (wm, iwm, x, tem) C***BEGIN PROLOGUE SSOLSY C***SUBSIDIARY C***PURPOSE ODEPACK linear system solver. C***TYPE SINGLE PRECISION (SSOLSY-S, DSOLSY-D) C***AUTHOR Hindmarsh, Alan C., (LLNL) C***DESCRIPTION C C This routine manages the solution of the linear system arising from C a chord iteration. It is called if MITER .ne. 0. C If MITER is 1 or 2, it calls SGESL to accomplish this. C If MITER = 3 it updates the coefficient h*EL0 in the diagonal C matrix, and then computes the solution. C If MITER is 4 or 5, it calls SGBSL. C Communication with SSOLSY uses the following variables: C WM = real work space containing the inverse diagonal matrix if C MITER = 3 and the LU decomposition of the matrix otherwise. C Storage of matrix elements starts at WM(3). C WM also contains the following matrix-related data: C WM(1) = SQRT(UROUND) (not used here), C WM(2) = HL0, the previous value of h*EL0, used if MITER = 3. C IWM = integer work space containing pivot information, starting at C IWM(21), if MITER is 1, 2, 4, or 5. IWM also contains band C parameters ML = IWM(1) and MU = IWM(2) if MITER is 4 or 5. C X = the right-hand side vector on input, and the solution vector C on output, of length N. C TEM = vector of work space of length N, not used in this version. C IERSL = output flag (in COMMON). IERSL = 0 if no trouble occurred. C IERSL = 1 if a singular matrix arose with MITER = 3. C This routine also uses the COMMON variables EL0, H, MITER, and N. C C***SEE ALSO SLSODE C***ROUTINES CALLED SGBSL, SGESL C***COMMON BLOCKS SLS001 C***REVISION HISTORY (YYMMDD) C 791129 DATE WRITTEN C 890501 Modified prologue to SLATEC/LDOC format. (FNF) C 890503 Minor cosmetic changes. (FNF) C 930809 Renamed to allow single/double precision versions. (ACH) C 010412 Reduced size of Common block /SLS001/. (ACH) C***END PROLOGUE SSOLSY C**End integer iwm integer icf, ierpj, iersl, jcur, jstart, kflag, l, 1 lyh, lewt, lacor, lsavr, lwm, liwm, meth, miter, 2 maxord, maxcor, msbp, mxncf, n, nq, nst, nfe, nje, nqu integer i, meband, ml, mu real wm, x, tem real ccmax, el0, h, hmin, hmxi, hu, rc, tn, uround real di, hl0, phl0, r dimension wm(*), iwm(*), x(*), tem(*) common /sls001/ ccmax, el0, h, hmin, hmxi, hu, rc, tn, uround, 1 icf, ierpj, iersl, jcur, jstart, kflag, l, 2 lyh, lewt, lacor, lsavr, lwm, liwm, meth, miter, 3 maxord, maxcor, msbp, mxncf, n, nq, nst, nfe, nje, nqu c c***first executable statement ssolsy iersl = 0 go to (100, 100, 300, 400, 400), miter 100 call sgesl (wm(3), n, n, iwm(21), x, 0) return c 300 phl0 = wm(2) hl0 = h*el0 wm(2) = hl0 if (hl0 .eq. phl0) go to 330 r = hl0/phl0 do 320 i = 1,n di = 1.0e0 - r*(1.0e0 - 1.0e0/wm(i+2)) if (abs(di) .eq. 0.0e0) go to 390 320 wm(i+2) = 1.0e0/di 330 do 340 i = 1,n 340 x(i) = wm(i+2)*x(i) return 390 iersl = 1 return c 400 ml = iwm(1) mu = iwm(2) meband = 2*ml + mu + 1 call sgbsl (wm(3), meband, n, ml, mu, iwm(21), x, 0) return c----------------------- end of subroutine ssolsy ---------------------- end