bvder.f 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. *DECK BVDER
  2. SUBROUTINE BVDER (X, Y, YP, G, IPAR)
  3. C***BEGIN PROLOGUE BVDER
  4. C***SUBSIDIARY
  5. C***PURPOSE Subsidiary to BVSUP
  6. C***LIBRARY SLATEC
  7. C***TYPE SINGLE 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 FMAT how to access
  37. C the dependent variables corresponding to this initial
  38. C value problem. For example, during any call to FMAT,
  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 BVSUP
  45. C***ROUTINES CALLED (NONE)
  46. C***COMMON BLOCKS ML8SZ, MLIVP
  47. C***REVISION HISTORY (YYMMDD)
  48. C 750601 DATE WRITTEN
  49. C 890921 Realigned order of variables in certain COMMON blocks.
  50. C (WRB)
  51. C 891214 Prologue converted to Version 4.0 format. (BAB)
  52. C 900328 Added TYPE section. (WRB)
  53. C 910701 Corrected ROUTINES CALLED section. (WRB)
  54. C 910722 Updated AUTHOR section. (ALS)
  55. C 920618 Minor restructuring of code. (RWC, WRB)
  56. C***END PROLOGUE BVDER
  57. DIMENSION Y(*),YP(*),G(*)
  58. C
  59. C **********************************************************************
  60. C
  61. COMMON /ML8SZ/ C,XSAV,IGOFX,INHOMO,IVP,NCOMP,NFC
  62. C
  63. C **********************************************************************
  64. C The COMMON block below is used to communicate with the user
  65. C supplied subroutine FMAT. The user should not alter this
  66. C COMMON block.
  67. C
  68. COMMON /MLIVP/ NOFST
  69. C **********************************************************************
  70. C
  71. C***FIRST EXECUTABLE STATEMENT BVDER
  72. IF (IVP .GT. 0) CALL UIVP(X,Y(IVP+1),YP(IVP+1))
  73. NOFST = IVP
  74. NA = 1
  75. DO 10 K=1,NFC
  76. CALL FMAT(X,Y(NA),YP(NA))
  77. NOFST = NOFST - NCOMP
  78. NA = NA + NCOMP
  79. 10 CONTINUE
  80. C
  81. IF (INHOMO .NE. 1) RETURN
  82. CALL FMAT(X,Y(NA),YP(NA))
  83. C
  84. IF (IGOFX .EQ. 0) RETURN
  85. IF (X .NE. XSAV) THEN
  86. IF (IVP .EQ. 0) CALL GVEC(X,G)
  87. IF (IVP .GT. 0) CALL UVEC(X,Y(IVP+1),G)
  88. XSAV = X
  89. ENDIF
  90. C
  91. C If the user has chosen not to normalize the particular
  92. C solution, then C is defined in BVPOR to be 1.0
  93. C
  94. C The following loop is just
  95. C CALL SAXPY (NCOMP, 1.0E0/C, G, 1, YP(NA), 1)
  96. C
  97. DO 20 J=1,NCOMP
  98. L = NA + J - 1
  99. YP(L) = YP(L) + G(J)/C
  100. 20 CONTINUE
  101. RETURN
  102. END