15SUBROUTINE tridslv(a, d, b, c, jmin, jmax, mnd1, ns, nrhs)
21 INTEGER,
INTENT(in) :: jmax, mnd1, ns, nrhs
22 INTEGER,
DIMENSION(0:mnd1),
INTENT(in) :: jmin
23 REAL(rprec),
DIMENSION(ns,0:mnd1) :: a, d, b
24 REAL(rprec),
DIMENSION(ns,0:mnd1, nrhs),
INTENT(inout) :: c
26 REAL(rprec),
PARAMETER :: zero = 0.0_dp, one = 1.0_dp
28 INTEGER :: mn, in, i0, in1, jrhs
29 REAL(rprec),
ALLOCATABLE,
DIMENSION(:,:) :: alf
30 REAL(rprec),
DIMENSION(0:mnd1) :: psi0
37 IF (jmax .gt. ns) stop
'jmax>ns in tridslv'
39 ALLOCATE (alf(ns,0:mnd1), stat = in)
40 IF (in .ne. 0) stop
'Allocation error in tridslv'
54 d(in:in1, mn) = 1.0_dp
55 c(in:in1, mn, 1:nrhs) = 0.0_dp
56 b(in:in1, mn) = 0.0_dp
57 a(in:in1, mn) = 0.0_dp
64 IF (any(psi0 .eq. zero)) stop
'psi0 == 0 error in tridslv'
67 c(in,:,jrhs) = c(in,:,jrhs)*psi0(:)
71 alf(i0-1,:) = a(i0-1,:)*psi0(:)
72 psi0 = d(i0,:) - b(i0,:)*alf(i0-1,:)
73 IF (any(abs(psi0) .le. 1.e-8_dp*abs(d(i0,:))))
then
74 stop
'psi0/d(i0) < 1.E-8: possible singularity in tridslv'
78 c(i0,:,jrhs) = (c(i0,:,jrhs) - b(i0,:)*c(i0-1,:,jrhs)) * psi0
82 DO i0 = jmax - 1, in, -1
84 c(i0,:,jrhs) = c(i0,:,jrhs) - alf(i0,:)*c(i0+1,:,jrhs)
subroutine tridslv(a, d, b, c, jmin, jmax, mnd1, ns, nrhs)
Solve a tridiagonal system of equations.