-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathshootf.f
56 lines (56 loc) · 1.52 KB
/
shootf.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
SUBROUTINE SHOOTF(NVAR,V1,V2,DELV1,DELV2,N1,N2,X1,X2,XF,EPS,H1,HMI
*N,F,DV1,DV2)
PARAMETER (NP=20)
DIMENSION V1(N2),DELV1(N2),V2(N1),DELV2(N1),F(NVAR),DV1(N2),
* DV2(N1),Y(NP),F1(NP),F2(NP),DFDV(NP,NP),INDX(NP)
EXTERNAL DERIVS,RKQC
CALL LOAD1(X1,V1,Y)
CALL ODEINT(Y,NVAR,X1,XF,EPS,H1,HMIN,NOK,NBAD,DERIVS,RKQC)
CALL SCORE(XF,Y,F1)
CALL LOAD2(X2,V2,Y)
CALL ODEINT(Y,NVAR,X2,XF,EPS,H1,HMIN,NOK,NBAD,DERIVS,RKQC)
CALL SCORE(XF,Y,F2)
J=0
DO 12 IV=1,N2
J=J+1
SAV=V1(IV)
V1(IV)=V1(IV)+DELV1(IV)
CALL LOAD1(X1,V1,Y)
CALL ODEINT(Y,NVAR,X1,XF,EPS,H1,HMIN,NOK,NBAD,DERIVS,RKQC)
CALL SCORE(XF,Y,F)
DO 11 I=1,NVAR
DFDV(I,J)=(F(I)-F1(I))/DELV1(IV)
11 CONTINUE
V1(IV)=SAV
12 CONTINUE
DO 14 IV=1,N1
J=J+1
SAV=V2(IV)
V2(IV)=V2(IV)+DELV2(IV)
CALL LOAD2(X2,V2,Y)
CALL ODEINT(Y,NVAR,X2,XF,EPS,H1,HMIN,NOK,NBAD,DERIVS,RKQC)
CALL SCORE(XF,Y,F)
DO 13 I=1,NVAR
DFDV(I,J)=(F2(I)-F(I))/DELV2(IV)
13 CONTINUE
V2(IV)=SAV
14 CONTINUE
DO 15 I=1,NVAR
F(I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