dsossl.f 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. *DECK DSOSSL
  2. SUBROUTINE DSOSSL (K, N, L, X, C, B, M)
  3. C***BEGIN PROLOGUE DSOSSL
  4. C***SUBSIDIARY
  5. C***PURPOSE Subsidiary to DSOS
  6. C***LIBRARY SLATEC
  7. C***TYPE DOUBLE PRECISION (SOSSOL-S, DSOSSL-D)
  8. C***AUTHOR (UNKNOWN)
  9. C***DESCRIPTION
  10. C
  11. C DSOSSL solves an upper triangular type of linear system by back
  12. C substitution.
  13. C
  14. C The matrix C is upper trapezoidal and stored as a linear array by
  15. C rows. The equations have been normalized so that the diagonal
  16. C entries of C are understood to be unity. The off diagonal entries
  17. C and the elements of the constant right hand side vector B have
  18. C already been stored as the negatives of the corresponding equation
  19. C values.
  20. C With each call to DSOSSL a (K-1) by (K-1) triangular system is
  21. C resolved. For L greater than K, column L of C is included in the
  22. C right hand side vector.
  23. C
  24. C***SEE ALSO DSOS
  25. C***ROUTINES CALLED (NONE)
  26. C***REVISION HISTORY (YYMMDD)
  27. C 801001 DATE WRITTEN
  28. C 890831 Modified array declarations. (WRB)
  29. C 891214 Prologue converted to Version 4.0 format. (BAB)
  30. C 900328 Added TYPE section. (WRB)
  31. C***END PROLOGUE DSOSSL
  32. C
  33. C
  34. INTEGER J, JKM, K, KJ, KM, KM1, KMM1, KN, L, LK, M, N, NP1
  35. DOUBLE PRECISION B(*), C(*), X(*), XMAX
  36. C
  37. C***FIRST EXECUTABLE STATEMENT DSOSSL
  38. NP1 = N + 1
  39. KM1 = K - 1
  40. LK = KM1
  41. IF (L .EQ. K) LK = K
  42. KN = M
  43. C
  44. C
  45. DO 40 KJ = 1, KM1
  46. KMM1 = K - KJ
  47. KM = KMM1 + 1
  48. XMAX = 0.0D0
  49. KN = KN - NP1 + KMM1
  50. IF (KM .GT. LK) GO TO 20
  51. JKM = KN
  52. C
  53. DO 10 J = KM, LK
  54. JKM = JKM + 1
  55. XMAX = XMAX + C(JKM)*X(J)
  56. 10 CONTINUE
  57. 20 CONTINUE
  58. C
  59. IF (L .LE. K) GO TO 30
  60. JKM = KN + L - KMM1
  61. XMAX = XMAX + C(JKM)*X(L)
  62. 30 CONTINUE
  63. X(KMM1) = XMAX + B(KMM1)
  64. 40 CONTINUE
  65. C
  66. RETURN
  67. END