dbvder.f 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. *DECK DBVDER
  2. SUBROUTINE DBVDER (X, Y, YP, G, IPAR)
  3. C***BEGIN PROLOGUE DBVDER
  4. C***SUBSIDIARY
  5. C***PURPOSE Subsidiary to DBVSUP
  6. C***LIBRARY SLATEC
  7. C***TYPE DOUBLE PRECISION (BVDER-S, DBVDER-D)
  8. C***AUTHOR Watts, H. A., (SNLA)
  9. C***DESCRIPTION
  10. C
  11. C **********************************************************************
  12. C NFC = Number of base solution vectors
  13. C
  14. C NCOMP = Number of components per solution vector
  15. C
  16. C 1 -- Nonzero particular solution
  17. C INHOMO =
  18. C 2 or 3 -- Zero particular solution
  19. C
  20. C 0 -- Inhomogeneous vector term G(X) identically zero
  21. C IGOFX =
  22. C 1 -- Inhomogeneous vector term G(X) not identically zero
  23. C
  24. C G = Inhomogeneous vector term G(X)
  25. C
  26. C XSAV = Previous value of X
  27. C
  28. C C = Normalization factor for the particular solution
  29. C
  30. C 0 ( if NEQIVP = 0 )
  31. C IVP =
  32. C Number of differential equations integrated due to
  33. C the original boundary value problem ( if NEQIVP .GT. 0 )
  34. C
  35. C NOFST - For problems with auxiliary initial value equations,
  36. C NOFST communicates to the routine DFMAT how to access
  37. C the dependent variables corresponding to this initial
  38. C value problem. For example, during any call to DFMAT,
  39. C the first dependent variable for the initial value
  40. C problem is in position Y(NOFST + 1).
  41. C See example in SAND77-1328.
  42. C **********************************************************************
  43. C
  44. C***SEE ALSO DBVSUP
  45. C***ROUTINES CALLED (NONE)
  46. C***COMMON BLOCKS DML8SZ, DMLIVP
  47. C***REVISION HISTORY (YYMMDD)
  48. C 750601 DATE WRITTEN
  49. C 890831 Modified array declarations. (WRB)
  50. C 890921 Realigned order of variables in certain COMMON blocks.
  51. C (WRB)
  52. C 891214 Prologue converted to Version 4.0 format. (BAB)
  53. C 900328 Added TYPE section. (WRB)
  54. C 910701 Corrected ROUTINES CALLED section. (WRB)
  55. C 910722 Updated AUTHOR section. (ALS)
  56. C 920618 Minor restructuring of code. (RWC, WRB)
  57. C***END PROLOGUE DBVDER
  58. INTEGER IGOFX, INHOMO, IPAR, IVP, J, K, L, NA, NCOMP, NFC, NOFST
  59. DOUBLE PRECISION C, G(*), X, XSAV, Y(*), YP(*)
  60. C
  61. C **********************************************************************
  62. C
  63. COMMON /DML8SZ/ C,XSAV,IGOFX,INHOMO,IVP,NCOMP,NFC
  64. C
  65. C **********************************************************************
  66. C The COMMON block below is used to communicate with the user
  67. C supplied subroutine DFMAT. The user should not alter this
  68. C COMMON block.
  69. C
  70. COMMON /DMLIVP/ NOFST
  71. C **********************************************************************
  72. C
  73. C***FIRST EXECUTABLE STATEMENT DBVDER
  74. IF (IVP .GT. 0) CALL DUIVP(X,Y(IVP+1),YP(IVP+1))
  75. NOFST = IVP
  76. NA = 1
  77. DO 10 K=1,NFC
  78. CALL DFMAT(X,Y(NA),YP(NA))
  79. NOFST = NOFST - NCOMP
  80. NA = NA + NCOMP
  81. 10 CONTINUE
  82. C
  83. IF (INHOMO .NE. 1) RETURN
  84. CALL DFMAT(X,Y(NA),YP(NA))
  85. C
  86. IF (IGOFX .EQ. 0) RETURN
  87. IF (X .NE. XSAV) THEN
  88. IF (IVP .EQ. 0) CALL DGVEC(X,G)
  89. IF (IVP .GT. 0) CALL DUVEC(X,Y(IVP+1),G)
  90. XSAV = X
  91. ENDIF
  92. C
  93. C If the user has chosen not to normalize the particular
  94. C solution, then C is defined in DBVPOR to be 1.0
  95. C
  96. C The following loop is just
  97. C CALL DAXPY (NCOMP, 1.0D0/C, G, 1, YP(NA), 1)
  98. C
  99. DO 20 J=1,NCOMP
  100. L = NA + J - 1
  101. YP(L) = YP(L) + G(J)/C
  102. 20 CONTINUE
  103. RETURN
  104. END