GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
dsolsy.f
Go to the documentation of this file.
1 SUBROUTINE dsolsy (WM, IWM, X, TEM)
2C***BEGIN PROLOGUE DSOLSY
3C***SUBSIDIARY
4C***PURPOSE ODEPACK linear system solver.
5C***TYPE DOUBLE PRECISION (SSOLSY-S, DSOLSY-D)
6C***AUTHOR Hindmarsh, Alan C., (LLNL)
7C***DESCRIPTION
8C
9C This routine manages the solution of the linear system arising from
10C a chord iteration. It is called if MITER .ne. 0.
11C If MITER is 1 or 2, it calls DGETRS to accomplish this.
12C If MITER = 3 it updates the coefficient h*EL0 in the diagonal
13C matrix, and then computes the solution.
14C If MITER is 4 or 5, it calls DGBTRS.
15C Communication with DSOLSY uses the following variables:
16C WM = real work space containing the inverse diagonal matrix if
17C MITER = 3 and the LU decomposition of the matrix otherwise.
18C Storage of matrix elements starts at WM(3).
19C WM also contains the following matrix-related data:
20C WM(1) = SQRT(UROUND) (not used here),
21C WM(2) = HL0, the previous value of h*EL0, used if MITER = 3.
22C IWM = integer work space containing pivot information, starting at
23C IWM(21), if MITER is 1, 2, 4, or 5. IWM also contains band
24C parameters ML = IWM(1) and MU = IWM(2) if MITER is 4 or 5.
25C X = the right-hand side vector on input, and the solution vector
26C on output, of length N.
27C TEM = vector of work space of length N, not used in this version.
28C IERSL = output flag (in COMMON). IERSL = 0 if no trouble occurred.
29C IERSL = 1 if a singular matrix arose with MITER = 3.
30C This routine also uses the COMMON variables EL0, H, MITER, and N.
31C
32C***SEE ALSO DLSODE
33C***ROUTINES CALLED DGBTRS, DGETRS
34C***COMMON BLOCKS DLS001
35C***REVISION HISTORY (YYMMDD)
36C 791129 DATE WRITTEN
37C 890501 Modified prologue to SLATEC/LDOC format. (FNF)
38C 890503 Minor cosmetic changes. (FNF)
39C 930809 Renamed to allow single/double precision versions. (ACH)
40C 010418 Reduced size of Common block /DLS001/. (ACH)
41C 031105 Restored 'own' variables to Common block /DLS001/, to
42C enable interrupt/restart feature. (ACH)
43C***END PROLOGUE DSOLSY
44C**End
45 INTEGER IWM
46 DOUBLE PRECISION WM, X, TEM
47 dimension wm(*), iwm(*), x(*), tem(*)
48 INTEGER ILLIN, INIT, LYH, LEWT, LACOR, LSAVF, LWM, LIWM,
49 1 MXSTEP, MXHNIL, NHNIL, NTREP, NSLAST, NYH,
50 2 IALTH, IPUP, LMAX, MEO, NQNYH, NSLP
51 INTEGER ICF, IERPJ, IERSL, JCUR, JSTART, KFLAG, L, METH, MITER,
52 2 MAXORD, MAXCOR, MSBP, MXNCF, N, NQ, NST, NFE, NJE, NQU
53 DOUBLE PRECISION CONIT, CRATE, EL, ELCO, HOLD, RMAX, TESCO,
54 2 CCMAX, EL0, H, HMIN, HMXI, HU, RC, TN, UROUND
55 COMMON /dls001/ conit, crate, el(13), elco(13,12),
56 1 hold, rmax, tesco(3,12),
57 2 ccmax, el0, h, hmin, hmxi, hu, rc, tn, uround,
58 2 illin, init, lyh, lewt, lacor, lsavf, lwm, liwm,
59 3 mxstep, mxhnil, nhnil, ntrep, nslast, nyh,
60 3 ialth, ipup, lmax, meo, nqnyh, nslp,
61 4 icf, ierpj, iersl, jcur, jstart, kflag, l, meth, miter,
62 5 maxord, maxcor, msbp, mxncf, n, nq, nst, nfe, nje, nqu
63 INTEGER I, MEBAND, ML, MU
64 INTEGER INLPCK
65 DOUBLE PRECISION DI, HL0, PHL0, R
66C
67C***FIRST EXECUTABLE STATEMENT DSOLSY
68 iersl = 0
69 GO TO (100, 100, 300, 400, 400), miter
70 100 CALL dgetrs ( 'N', n, 1, wm(3), n, iwm(21), x, n, inlpck)
71 RETURN
72C
73 300 phl0 = wm(2)
74 hl0 = h*el0
75 wm(2) = hl0
76 IF (hl0 .EQ. phl0) GO TO 330
77 r = hl0/phl0
78 DO 320 i = 1,n
79 di = 1.0d0 - r*(1.0d0 - 1.0d0/wm(i+2))
80 IF (abs(di) .EQ. 0.0d0) GO TO 390
81 320 wm(i+2) = 1.0d0/di
82 330 DO 340 i = 1,n
83 340 x(i) = wm(i+2)*x(i)
84 RETURN
85 390 iersl = 1
86 RETURN
87C
88 400 ml = iwm(1)
89 mu = iwm(2)
90 meband = 2*ml + mu + 1
91 CALL dgbtrs ( 'N', n, ml, mu, 1, wm(3), meband, iwm(21), x, n,
92 * inlpck)
93 RETURN
94C----------------------- END OF SUBROUTINE DSOLSY ----------------------
95 END
subroutine dsolsy(wm, iwm, x, tem)
Definition dsolsy.f:2