1 SUBROUTINE SINTRP
(X
,Y
,XOUT
,YOUT
,YPOUT
,NEQN
,KOLD
,PHI
,IVC
,IV
,KGI
,GI
,
4 C***BEGIN PROLOGUE SINTRP
5 C***DATE WRITTEN 740101 (YYMMDD)
6 C***REVISION DATE 840201 (YYMMDD)
8 C***KEYWORDS INITIAL VALUE ORDINARY DIFFERENTIAL EQUATIONS,
9 C VARIABLE ORDER ADAMS METHODS, SMOOTH INTERPOLANT FOR
10 C DEABM IN THE DEPAC PACKAGE
11 C***AUTHOR SHAMPINE, L.F., SNLA
13 C MODIFIED BY H.A. WATTS
14 C***PURPOSE APPROXIMATES THE SOLUTION AT XOUT BY EVALUATING THE
15 C POLYNOMIAL COMPUTED IN STEPS AT XOUT. MUST BE USED IN
16 C CONJUNCTION WITH STEPS.
19 C WRITTEN BY L. F. SHAMPINE AND M. K. GORDON
24 C THE METHODS IN SUBROUTINE STEPS APPROXIMATE THE SOLUTION NEAR X
25 C BY A POLYNOMIAL. SUBROUTINE SINTRP APPROXIMATES THE SOLUTION AT
26 C XOUT BY EVALUATING THE POLYNOMIAL THERE. INFORMATION DEFINING THIS
27 C POLYNOMIAL IS PASSED FROM STEPS SO SINTRP CANNOT BE USED ALONE.
29 C THIS CODE IS COMPLETELY EXPLAINED AND DOCUMENTED IN THE TEXT,
30 C COMPUTER SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS, THE INITIAL
31 C VALUE PROBLEM BY L. F. SHAMPINE AND M. K. GORDON.
32 C FURTHER DETAILS ON USE OF THIS CODE ARE AVAILABLE IN *SOLVING
33 C ORDINARY DIFFERENTIAL EQUATIONS WITH ODE, STEP, AND INTRP*,
34 C BY L. F. SHAMPINE AND M. K. GORDON, SLA-73-1060.
38 C THE USER PROVIDES STORAGE IN THE CALLING PROGRAM FOR THE ARRAYS IN
40 C DIMENSION Y(NEQN),YOUT(NEQN),YPOUT(NEQN),PHI(NEQN,16),P(NEQN),
41 C ALPHA(12),G(13),W(12),GI(11),IV(10)
43 C XOUT -- POINT AT WHICH SOLUTION IS DESIRED.
44 C THE REMAINING PARAMETERS ARE DEFINED IN STEPS AND PASSED TO
45 C SINTRP FROM THAT SUBROUTINE.
47 C OUTPUT FROM SINTRP --
49 C YOUT(*) -- SOLUTION AT XOUT
50 C YPOUT(*) -- DERIVATIVE OF SOLUTION AT XOUT
52 C THE REMAINING PARAMETERS ARE RETURNED UNALTERED FROM THEIR INPUT
53 C VALUES. INTEGRATION WITH STEPS MAY BE CONTINUED.
55 C***REFERENCES SHAMPINE L.F., GORDON M.K., *SOLVING ORDINARY
56 C DIFFERENTIAL EQUATIONS WITH ODE, STEP, AND INTRP*,
57 C SLA-73-1060, SANDIA LABORATORIES, 1973.
58 C WATTS H.A., SHAMPINE L.F., *A SMOOTHER INTERPOLANT FOR
59 C DE/STEP,INTRP : II*, SAND84-0293, SANDIA LABORATORIES,
61 C***ROUTINES CALLED (NONE)
62 C***END PROLOGUE SINTRP
64 DOUBLE PRECISION ALP
,ALPHA
,C
,G
,GAMMA
,GDI
,GDIF
,GI
,GTEMP
,
65 1 H
,HI
,HMU
,P
,PHI
,RMU
,SIGMA
,TEMP1
,TEMP2
,TEMP3
,W
,WTEMP
,
66 2 X
,XI
,XIM1
,XIQ
,XOLD
,XOUT
,Y
,YOUT
,YPOUT
67 INTEGER I
,IQ
,IV
,IVC
,IW
,J
,JQ
,KGI
,KOLD
,KP1
,KP2
,L
,M
,NEQN
69 DIMENSION Y
(NEQN
),YOUT
(NEQN
),YPOUT
(NEQN
),PHI
(NEQN
,16),P
(NEQN
)
70 DIMENSION GTEMP
(13),C
(13),WTEMP
(13),G
(13),W
(12),ALPHA
(12),
73 C***FIRST EXECUTABLE STATEMENT
82 C INITIALIZE WTEMP(*) FOR COMPUTING GTEMP(*)
88 10 WTEMP
(IQ
) = XIQ
/TEMP1
90 C COMPUTE THE DOUBLE INTEGRAL TERM GDI
92 IF (KOLD
.LE
. KGI
) GO TO 50
93 IF (IVC
.GT
. 0) GO TO 20
100 30 IF (M
.GT
. KOLD
) GO TO 60
102 40 GDI
= W
(KP2
-I
) - ALPHA
(I
)*GDI
106 C COMPUTE GTEMP(*) AND C(*)
112 IF (KOLD
.LT
. 2) GO TO 90
115 GAMMA
= 1.0 + XIM1*ALP
118 70 WTEMP
(JQ
) = GAMMA*WTEMP
(JQ
) - ALP*WTEMP
(JQ
+1)
119 GTEMP
(I
+1) = WTEMP
(1)
120 80 C
(I
+1) = GAMMA*C
(I
)
122 C DEFINE INTERPOLATION PARAMETERS
124 90 SIGMA
= (WTEMP
(2) - XIM1*WTEMP
(1))/GDI
125 RMU
= XIM1*C
(KP1
)/GDI
128 C INTERPOLATE FOR THE SOLUTION -- YOUT
129 C AND FOR THE DERIVATIVE OF THE SOLUTION -- YPOUT
137 TEMP2
= (GTEMP
(I
) - GTEMP
(I
-1)) - SIGMA*GDIF
138 TEMP3
= (C
(I
) - C
(I
-1)) + RMU*GDIF
140 YOUT
(L
) = YOUT
(L
) + TEMP2*PHI
(L
,I
)
141 110 YPOUT
(L
) = YPOUT
(L
) + TEMP3*PHI
(L
,I
)
144 YOUT
(L
) = ((1.0 - SIGMA
)*P
(L
) + SIGMA*Y
(L
)) +
145 1 H*
(YOUT
(L
) + (GTEMP
(1) - SIGMA*G
(1))*PHI
(L
,1))
146 130 YPOUT
(L
) = HMU*
(P
(L
) - Y
(L
)) +
147 1 (YPOUT
(L
) + (C
(1) + RMU*G
(1))*PHI
(L
,1))