1 C MAIN PROGRAM TO TEST FIXPQS, FIXPNS, AND FIXPDS
3 C THIS PROGRAM TESTS THE HOMPACK ROUTINES FIXPNS, FIXPQS, AND
4 C FIXPDS. THE USER MAY INSERT CALLS TO A SYSTEM TIMER AT THE
5 C DESIGNATED LOCATIONS IN ORDER TO GET EXECUTION TIME FOR THESE
8 C THE MODIFICATIONS TO BE MADE FOR THE SYSTEM TIMER ARE INDICATED
9 C BY A LINE OF M'S, E.G.
10 CMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
13 C THE OUTPUT FROM THIS ROUTINE SHOULD BE AS FOLLOWS, WITH THE
14 C EXECUTION TIMES CORRESPONDING TO A VAX 11/785.
18 C LAMBDA = 1.00000000 FLAG = 1 33 JACOBIAN EVALUATIONS
19 C ARC LENGTH = 1.274 EXECUTION TIME(SECS) = 2.31
20 C 4.00864019E-01 2.65454893E-01 8.40421103E-02 4.83042527E-01
21 C 3.01797132E-01 2.32508994E-01 4.96639853E-01 3.00908894E-01
25 C LAMBDA = 1.00000000 FLAG = 1 20 JACOBIAN EVALUATIONS
26 C ARC LENGTH = 1.275 EXECUTION TIME(SECS) = 1.04
27 C 4.00864019E-01 2.65454893E-01 8.40421103E-02 4.83042527E-01
28 C 3.01797132E-01 2.32508994E-01 4.96639853E-01 3.00908894E-01
32 C LAMBDA = 1.00000000 FLAG = 1 70 JACOBIAN EVALUATIONS
33 C ARC LENGTH = 1.281 EXECUTION TIME(SECS) = 1.78
34 C 4.00864019E-01 2.65454893E-01 8.40421103E-02 4.83042527E-01
35 C 3.01797132E-01 2.32508994E-01 4.96639853E-01 3.00908894E-01
39 IMPLICIT DOUBLE PRECISION(A
-H
,O
-Z
)
40 DOUBLE PRECISION Y
(9),
41 + YP
(9),YOLD
(9),YPOLD
(9),A
(8),QR
(18),WORK
(200),
42 + SSPAR
(8),PAR
(1),PP
(8),RHOVEC
(9),Z0
(9),DZ
(9),T
(9),
43 + WT
(9),PHI
(9,16),P
(9)
44 INTEGER PIVOT
(10),IPAR
(1)
45 INTEGER IFLAG
,II
,J
,LENQR
,N
,NFE
,NP1
,NDIMA
,TRACE
46 DOUBLE PRECISION ARCRE
,ARCAE
,ANSRE
,ANSAE
,ARCLEN
51 C TEST EACH OF THE THREE ALGORITHMS.
55 C INITIALIZE TIMER VARIABLES.
61 C DFEFINE ARGUMENTS FOR CALL TO HOMPACK PROCEDURE.
77 CMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
79 C INSERT CALL TO INITIALIZE SYSTEM TIMER HERE. FOR EXAMPLE, FOR
80 C THE VAX, THE FOLLOWING STATEMENT IS USED.
84 CMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
86 C CALL TO HOMPACK ROUTINE.
91 CALL FIXPQS
(N
,Y
,IFLAG
,ARCRE
,ARCAE
,ANSRE
,ANSAE
,TRACE
,
92 + A
,NFE
,ARCLEN
,YP
,YOLD
,YPOLD
,QR
,LENQR
,PIVOT
,PP
,RHOVEC
,
93 + Z0
,DZ
,T
,WORK
,SSPAR
,PAR
,IPAR
)
94 ELSE IF (II
.EQ
. 2) THEN
96 CALL FIXPNS
(N
,Y
,IFLAG
,ARCRE
,ARCAE
,ANSRE
,ANSAE
,TRACE
,A
,
97 + NFE
,ARCLEN
,YP
,YOLD
,YPOLD
,QR
,LENQR
,PIVOT
,WORK
,
101 CALL FIXPDS
(N
,Y
,IFLAG
,ARCRE
,ANSRE
,TRACE
,A
,NDIMA
,NFE
,
102 + ARCLEN
,YP
,YPOLD
,QR
,LENQR
,PIVOT
,PP
,WORK
,WT
,PHI
,P
,
106 CMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
108 C INSERT CALL TO RETURN EXECUTION TIME IN SECONDS IN DTIME.
109 C FOR EXAMPLE, THE VAX STATEMENTS ARE AS FOLLOWS.
110 C CALL LIB$STAT_TIMER(CODE,TIME)
113 CMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
116 45 FORMAT(//,8X
,'TESTING',1X
,6A
)
117 WRITE (6,50) Y
(NP1
),IFLAG
,NFE
,ARCLEN
,DTIME
,(Y
(J
),J
=1,N
)
118 50 FORMAT(/' LAMBDA =',F11
.8
,' FLAG =',I2
,I8
,' JACOBIAN ',
119 + 'EVALUATIONS',/,1X
,' ARC LENGTH =',F8
.3
,
120 + ' EXECUTION TIME(SECS) =',F10
.2
/(1X
,1P
,4E16
.8
))
126 C****************************************************************
128 C SUBROUTINE F(X,V) -- COMPUTES F AT THE POINT X,
129 C RETURNING THE VALUE IN V.
131 C****************************************************************
132 DOUBLE PRECISION X
(8),V
(8)
133 V
(1)=X
(1)**3+6.0*X
(2)*X
(3)-1+2.0*X
(1)
134 V
(2)=6.0*X
(1)*X
(3)+X
(2)**4*X
(5)-1+3.0*X
(2)
135 V
(3)=6.0*X
(1)*X
(2)+X
(3)*X
(5)-1+4.0*X
(3)
136 V
(4)=X
(4)**3*X
(8)-1+2.0*X
(4)
137 V
(5)=X
(2)**5/5.0 + X
(3)**2/2.0 + X
(8)*X
(5)-1+3.0*X
(5)
138 V
(6)=X
(6)*X
(8)-1+4.0*X
(6)
139 V
(7)=X
(7)**2*X
(8)**3-1+2.0*X
(7)
140 V
(8)=X
(4)**4/4.0 + X
(5)**2/2.0 + X
(6)**2/2.0 + X
(7)**3*
144 SUBROUTINE FJACS
(X
,QR
,LENQR
,PIVOT
)
145 C******************************************************************
147 C SUBROUTINE FJACS(X,QR,LENQR,PIVOT)
149 C -- COMPUTES THE JACOBIAN OF F AT THE POINT X, RETURNING
150 C THE JACOBIAN MATRIX IN PACKED SKYLINE FORM IN THE
151 C ARRAYS QR, AND PIVOT.
153 C*****************************************************************
154 DOUBLE PRECISION X
(8),QR
(LENQR
)
155 INTEGER LENQR
,PIVOT
(9)
165 QR
(1)=3.0*X
(1)**2+2.0
166 QR
(2)=4.0*X
(2)**3*X
(5)+3.0
171 QR
(7)=3.0*X
(4)**2*X
(8)+2.0
177 QR
(13)=2.0*X
(7)*X
(8)**3+2.0
178 QR
(14)=2.0*X
(7)**3*X
(8)+3.0
179 QR
(15)=3.0*X
(7)**2*X
(8)**2