Professional Documents
Culture Documents
AlphabeticDescriptionof
SubroutineLibrarv
All subroutinescalledby the programsin this book appeareither at the end of the
main programsor are held in a subroutinelibrary. In this appendix,all the library
subroutinesare describedtogetherwith their argumentlists.Underlinedarguments
are thosereturnedby the routinesas output. Other argumentsare providedto the
routinesasinput, althoughin somecasesthesameargumentsare usedfor both input
and output.Namesin parentheses indicatesubroutinesnormally usedin conjunction
with the onesthey follow.
Subroutine Description
BILIN Computesvaluesof the bilinearshapefunctionsand their derivativeswith
respectto local coordinatesover a quadrilatcral,at Gaussianintegration
points
Arguments
DER Shapefunction derivativesin local coordinates
FUN Shapefunctions
SAMP Array holding sampling points (column l) and weighting coefficients
(column 2) for Gauss-Irgendre quadrature
Subroutine Description
CHECK Checks the change in a scalar from one iteration to the next to seeif
convergence is achieved. X0 is updated to Xl
Arguments
X1 New value
XO Old value
I
Subroutine Description
CHECON Checks the change in a vector (column array) from one iteration to the
n€xt to see if convergenceis achieved.OLDLDS is updated to LOADS
Arguments
LOADS Vector of new values
Subroutine Description
CHOF/TC Factorisesa lower triangular symmetrical banded matrix (stored as a
(cuosue) rectangle)usingCholesky'smethod
Arguments
LB (N rows,IW + I columns).
Symmetricalbandedmatrixstoredasa rectangle
Holds Choleskyfactorson output
N Number of equations
IW Half bandwidth
h
I r Subroutine Description
i CHOSUB Performsforward and back substitutionusing Choleskyfactorsproduced
(cHorec) by cHonec
Arguments
LB Array holdingCholeskyfactorson whichbacksubstitutionis to beperformed
t; ILB Sizeof LB in main program
q Right hand sidevector,overwrittenby solution vector
N Number of equations
IW Half bandwidth
A L P H A B E T I CD E S C R I P T I O N
O F S U B R O U T I N EL I B R A R Y 305
Subroutine Dexription
GAULAG Generatesweights and sampling points for Gauss-Laguerre quadrature
Arguments
SAMP Array holding sampring points (column r) and weighting coefficients
(column 2) for Gauss_Laguerrequadrature.
Arguments
SAMP Array holding sampring points (corumn l) and weighting coefficients
(column 2) for Gauss_lrgendre quadrature
Subroutine Description
LDLFoR Performs forward substitution on factors in LDLr method
(sunnac)
Arguments
A Array holding upper triangular factorsstoredas a lower triangleon which
forward substitution is to be performed
IA Sizeof A in main progrnm
Subroutine Description
LDLT Factorisesa symmetricalmatrix usingLDLr method
(LDLFoR)
(suBBAc)
Arguments
4 Array holding symmetricalmatrix on input. Holds U and Ur on output.
IA Sizeof A in main program
p Vectorcontainingdiagonalsof D
N Number of equations
JUO A P P E N D I X1
Subroutine Description
LUFAC Factorisesa matrix using LU method
(suBFoR,
(su n nnc)
Arguments
Array holdingequationcoefficients
N Numberof cquations
Subroutlhe Description
LUPFAC Factorisesa matrix using LU method with pivoting
(LUPSoL)
Arguments
Array holding equation coefficients on input. Holds LU factors after
pivoting on output
N Number of equations
F'
I
ROW
Subroutine
Vector of integers holding reordered row numbers
Description
I LUPSOL Performs forward and back substitution on factors in LU method with
(lunrrc) pivoting
i
lr Arguments
Array holding LU factors
i ,
IA Size of A in main program
N Numbcr of equation
Subroutine Description
MATINV Invertsa non-singularmatrix
Arguments
4 Array on input and the inverseon output
Subroutine Description
MATMUL Multiplies matricesA and B to give C
NJ
Subroutine Descriptton
MATRAN Forms matrix A which is the transposeof matrix B
Arguments
4 Transposeof array B
B is required
Array whosetransPose
M Number of rows in B
N Number of columnsin B
A P P E N D I X1
Subroutine Description
MSMULT Multipliesmatrix A by scalarC
Arguments
4 Array on input and aftermultiplicationby scalarC on output
C Scalarmultiplier
M Number of rows in A
N Number of columnsin A
Subroutine Description
MVMULT Multipliesmatrix M by vectorV to give vectorY
a
Arguments
M Array
v Vector(lengthL)
K Number of rows in M
L Number of columnsin M
Subroutine Description
NEWCOT Providesweightingcocfficientsfor Newton{otes quadrature
Argunents
WEIGHT Vector of weightingcoefficientsfor Newton{otes integration rules
I
I
NNC Requirednumbcrof points
I
Subroutine Description
NULL Nulls a twodimensionalarray
Arguments
4 Array on input and nulledarray on outPut
M Number of rows in A
N Number of columnsin A
A L P H A B E T I CD E S C R I P T I O NO F S U B R O U T I N EL I B R A R Y 309
Subroutine Description
NULVEC Nulls a vector (column array)
Arguments
VEC Vectoron input and nulled vector on outpul
N Lcnglh of vector
Subroutine Description
PRINTA Prints an array to the requircd output channel
Arguments
A Array to be printed to output channetICH, with format 6EI2-4
N Number of columnsin A
Subroutine Description
PRINTV Prints a vcctor (column array) to the required output channel
Arguments
VEC Vector to be printed to output channelICH, with format 6812.4
N I-ength of vector
ICH Output channel
Subroutine Description
SKYFAC Factorisesa symmetricalbandedmatrix storedasa vectorusinga'skyline'
(SKYSUB) storageapproach and Cholesky'smethod
Arguments
4 Vector of 'skyline' coefficientson input and Choleskyfactors on output
N Number of equations
Subroutine Description
SKYSUB Performs forward and back substitution using Cholesky factors from
(sxvrrc) 'skyline'storageapproach
Arguments
A Vector of Choleskyfactors
N Numbcr of equations
KDIAG Vector of integersholding locations of diagonal terms in A
Subroutine Description
SOLVE Solves a system of equations using Gaussian elimination with partial
a pivoting
Argumcnts
K Array of equation coefficients
g Solution vector
N Number of equations
Subroutine Description
SUBBAC Performs back substitution on factors following forward substitution
(suBFoR) in LDLr or LU methods
(LDLFoR)
Arguments
r;
A Array of upper triangular factors for back substitution
N Number of equations
I A L P H A B E T I CD E S C R I P T I O O
N F S U B R O U T I N EL I B R A R Y 311
Subroutine Description
SUBFOR Performs forward substitution on factors from LU method
(suBBAc)
Arguments
A Array of lower triangular factors for forward substitution
IA Sizeof A in main program
Subroutine Description
VDOTV Forms dot product DOTPR of vcctors Vl and V2
Arf,uments
VI First vector
v2 Secondvector
DOTPR Dot product
N kngth of Vl and V2
Subroutine Description
VECADD Adds vectors A and B to give C
Arguments
A First vector
B Second vcctor
N I.ength of vectors
Subroutine Description
VECCOP Forms vector copy B of vector A
Arguments
A Vector to be copied
E Copy of A
N I"rngfh of vectors
\
312 A P P E N D I X1
Subroutine Description
VECSUB Forms vectorC by subtractingB from A
Arguments
A First vector
B Secondvector
q Resultof subtractingB from A
N Lcngth of vectors
Subroutine Description
VSMULT Multiplies vector V by scalarSCAL
Argument5
v Vector on input and after multiplicationby scalarSCAL on output
SCAL Scalarmultiplier
N lrngth of vector
Subroutine Description
VVMULT Forms vector product of vcctors Vl and V2 to give matrix A
Arguments
vl First vector (lengfh M)
M Number of rows in A
N Numbcr of columns in A
A2
AlphabeticListing of subroutineLibrary
i n F O R T R A N7 7
c
c
c
a^
BIG = 0.
Do 1 I = 1,N
I IF (ABS(LoADS(I) ).GT.BIG) BIG = ABS(LoADS(I) )
DO 2 I = 1,N
' ICoN = 0
IF (ABs(LoADs(I)-oLDLDs(I) )/BIG.Gr.rol,)
2 oLDLDS(I) = LoADS(I)
RETURN
END
l
RETURN
END
c
c
c
S U B R O U T I N E C H O S U B( L B , I L B , B , N , I W )
; ; c
c CHOLESKI FORWARD AND BACKWARD SUBSTITTJ:IION COMBINED
c
REAL LB(rLB,*),8(*)
B(1) = B(1)/LB(1,rw+l)
DO 1 I = 2,N
X = 0.o
^ = I
IF (I.LE.IW+1) K = Iw - I + 2
D o 2 J = K , I W
X : X + LB(I,J)*B(I+J-IW-1)
2 CONTINUE
B(I) = (B(I)-x) /LB(I,Iw+1)
r CONTTNUE
B(N) = B(N) /LB(N,rw+1)
DO 3 I = N - 1,1,-1
X = 0.O
L = I + I W
rF (I.GT.N-IW)L=N
M = I + 1
{
LISTlNG OF SUBROUTINELIBRARY IN FORTRAN77 315
D O 4 J = M , L
X = X + LB(J,IW+I-J+1)*61'f1
CONTTNUE
B(I) : (B(I) -x) /LB(I, Iw+1)
CONTINUE
RETURN
END
c
c
SUBROTITINE GAUI"AG( SA}.IP, ISAUP, NGL)
c
c WEIGHTS AND SAMPLTNG POINTS
c FOR GAUSS-I,AGUERRE QUADRATTTRE
c
REAI SAUP(rSA],IP, *)
GO TO ( L . 2 , 3 , 4 , 5 ) , N G L
1 SAHP( 1 , 1 ) = 1 .
sAlrP ( L , 2 1 = 1 -
GO TO 1 0 0
2 sAr{P ( 1 , 1 ) = O . 5 A 5 7 A 6 4 3 7 6 2 7
SAHP ( 2 , ! ) = 3.4142\3562373
SAMP(L , 2 ) = 0 . 8 5 3 5 5 3 3 9 0 5 9 3
SAHP ( 2 , 2 , = o . 1 4 6 4 4 6 6 0 9 4 0 7
GO TO 1 0 0
3 SAUP( 1 , L ) = o . 4 L 5 7 7 4 5 5 6 7 4 3
SAHP( 2 , )', = 2 . 29 42Ao3 6027 9
SAHP( 3 , 1 ) = 6 . 2 A 9 9 4 5 0 A 2 9 3 7
sAl.{P ( L , 2 l = o . 7 1 1 0 9 3 0 0 9 9 2 e
sAr.{P( 2 , 2 , = O . 2 7 A 5 L 7 7 3 3 5 6 9
SA},{P( 3 , 2 1 : 0 . 0 1 0 3 8 9 2 5 6 5 0 1 6
GO TO 1 0 0
4 SAMP(1 , 1 ) : O . 3 2 2 5 4 7 6 a 9 6 I 9
SAMP ( 2 , L ) = 1 . 7 4 5 7 6 1 1 0 1 1 5 8
SAHP ( 3 , 1 ) = 4 . 5 3 6 6 2 0 2 9 6 9 2 1
sAuP( 4 , 1 ) : 9 . 3 9 5 0 7 0 9 1 2 3 0 1 '
SAMP ( L , 2 , : 0 . 6 0 3 1 5 4 1 o 4 3 4 2
sAuP( 2 , 2 1 : o . 3 5 7 4 1 8 6 9 2 4 3 8
SAHP ( 3 , 2 ) : O . 0 3 8 8 8 7 9 0 8 s 1 5
sA_l,lP( 4 , 2 ) = o . o o 0 5 3 9 2 9 4 7 0 5 5 6 1
GO TO 1 0 0
5 SAMP 1 , 1 ) = 0 . 2 6 3 5 6 0 3 1 9 7 1 8
SAMP 2 , L l = 1 . 4 1 3 4 0 3 0 5 9 1 o 7
SA}IP 3 , 1 ) = 3 . 5 9 6 4 2 5 7 7 I o 4 I
SAHP 4 , 1 ) = 7 . 0 8 5 8 1 0 0 0 5 8 5 9
SA},tP 5 , 1 ) : l - 2 . 6 4 0 8 o 0 8 4 4 2 7 6
SAI'{P I , 2 ) = o . 5 2 1 7 5 5 6 1 0 5 8 3
SA],1P 2 , 2 ) : o . 3 9 8 6 6 6 8 1 L o 8 3
SAHP 3 , 2 ) : O - 0 7 5 9 4 2 4 4 9 6 4 ] . 7
sAl.rP 4 , 2 ' t : 0 . 0 0 3 6 1 1 7 5 8 6 7 9 9 2
SAUP ( 5 , 2 ) : o . 0 0 0 0 2 3 3 6 9 9 7 2 3 8 s 4
100 c o N T r NUE
RETURN
END
c
c
SUBROUTINE GAULEG ( SAMP, I SAHP , NGP)
c
c WEIGHTS AND SA}IPLING POTNTS
FOR GAUSS_LEGENDRE QUADRATURE
REAL SAUP(ISAHP, *)
co To (1,2,3,4,5,6,7),NGP
I sA.l,lP(1,1) = o.
SAfiP(l,2) = z.
316 A P P E N D I X2
GO TO 100
2 SA],IP(1,1) = 1. /sQRr(3. )
S A M P( 2 , 1 ) : -SAHP ( 1, 1)
SAMP(1,2)
SA],IP(2,2)
co To 100
3 S A H P( t - , 1 ) : .2*SQRT(15.)
SAMP(2,1) : .0
SAHP(3,1) = -SAHP(1,1)
sAl,rP(1,2) = s.le.
sAl,rP(2,2) = 8.le-
sAtlP(3,2) : SAHP(1,2)
GO TO 100
4 SAUP(1,1) = .861136311594053
SAHP(2,1) : .339981043584856
sAl.IP(3,L) : -SAHP (2 r l)
sAr'IP(4,1) = -SAUP ( 1, 1)
SAMP(1,2) : .347854845L37454
SA],IP(2,2) = .652145154862546
SAMP(3,2) : sAuP(2,2)
r SA}IP(4r2) : SAUP(1,2)
co To 100
5 SAl,lP(1,r.) = .906179845938664
SAHP(2,1) : .538469310105683
sAIlP(3,1)
sAl,tP(4,L) = -sAl,IP(2,1)
s A l ' I P( 5 , 1 ) = -SA-MP(1,1)
SAMP(1,2) : -236926Aa5O56189
sAuP(2,2) :.47a62a6'70499366
sAr.rP(3,2) : .568888888888889
sAxP(4,2) : sAr{P(2,2)
SAI'{P(5,2) : sAuP(1,2)
GO TO 100
6 sA],lP( l, 1 = -9324695L42O3I52
sAl{P(2,1 : .661209386466265
h, l#ili;i
: .238619185083197
: -sAl4P (3, 1)
sAl4P(5,1 = -sAuP(2,1)
sAuP ( 6, 1 : -SAHP(1,1)
S A M P( 1 , 2 :.171324492379]-7o
SAI.{P(2,2 : .360761,573048139
SAHP(3,2 : .4679L393457269I
sAr.rP(4,2 = SAUP(3,2)
SAfiP(5,2 : SAHP(2,2)
1i
sAHP(6,2 = S A } { P( 1 , 2 )
GO TO 100
7 SAflP ( 1, 1) = -949LO79L2342759
s A l , l P( 2 , 1 ) : .741531-185s99394
sAr'1P(3,1) = .4o584515I377397
S A H P( 4 , l , )
SA],IP(5,1) : -SAHP(3,1)
SAMP(6,1) = -SAHP(2,1)
S A I , I P( 7 , 1 ) = -SAl'fP(1,1)
sAilP(1,2) :.L29484966168870
SAI-{P(2,2) = .2797O53914a92'77
SAHP(3,2) : .381830o5050s119
SAHP(4,2) = .4L7959La3673469
SAHP(5,2) = SAHP(3,2)
sAl,IP(6,2) = SAHP(2,2)
sAr.rP(7,2) : SAUP(1,2)
IOO CONTINUE
RETURN
END
c
C
c
I LISTINGOF SUBROUTINE LIBRARY IN FORTRAN
77 J t /
tI c
c
c
SUBROUTINE LDLFOR(A, IA, B, N)
c
SUBROUTTNE LUFAC (A, UPTRT, LOWTRI , TA, N)
c
L*U FAqIORTSATION OF A SQUARE MATRIX A
C
REAL A(rA, *),upTRr(IA, *),LOWTRI (ra, *1
CALL NULL (UPTRI, TA,N, N)
CALL NULL (LOI{TRT, IA, N, N)
DO 10 I=L,N
UPTRI(1,I):A(1,r)
10 LowTRI (I, r1 =1. p
Do 1 K:1,N-1
IF(ABS (UPTRI(X,K) ) .GT. 1. E-6) THEN
DO 2 f:K+].rN
I.OWER TRTANGUI,AR COMPONENTS
DO 3 J:1,I-1
S U M = o .O
DO 4 L:1,J-1
S U M = S U M - I O W T R I( I , L ) * U p T R r ( L , J )
4 CONTTNUE
318 A P P E N D I X2
WRITE(6,1000)
WRITE(6,*)K
STOP
ENDTF
1 CONTINUE
1OOO FORMAT('ZERO PIVOT FOIJND IN THIS ROWI)
RETIJRN
.END
c
c
C
SUBROUTINE LUPFAC(A, TA, N, ROW)
C
c L*U FACTORISATION OF A SQUARE MATRIX WITH PIVOTS
c
REAL A(rA, *)
TNTEGERROW(*)
DO 1 I : 1,N
1 Row(I) : I
DO 2 I : 1,N - 1
I P : r
PVAL = A(Row(IP),IP)
DO 3 J = I + J.,N
rF (ABS(A(RoW(J),r) ).GT.ABs(PVAL) ) THEN
IT _ U
pvAL = A(Row(J) ,I)
END IF
3 CONTINUE
rF (ABS(PVAL).LT.1.E-1O) THEN
WRITE (6,1OOO)
STOP
END IF
F; IH - Row(IP)
Row(IP) = Row(I)
Row(I) = 111
DO 4 J : I + 1,N
IE : Row(J)
PIVoT : A(IE,I)/PVAL
A(IE,I) : PIvoT
IRoW : Row(I)
DO 5 K = I + 1rN
A(IE,K) = A(IE,K) - A(IRow,K)*PIVoT
5 CONTINUE
CONTINUE
) CONTINUE
r F ( A B S ( A ( R o w ( N ), N ) ) . L T . 1 . E - 1 0 ) THEN
wRrTE (6,1OOo)
STOP
END IF
1 0 0 0 FORMAT ('STNGUI,AR EQUATIONS DETECTEDI )
RETURN
END
L I S T I N GO F S U B R O U T I N EL I B R A R YI N F O R T R A N7 7 319
X = X + A(I,K)*B(K,J)
c(I,J) = x
CONTINUE
RETURN
END
c
c
c
S U B R O U T I N E M A T R A N( A , I A , B , I B , M , N )
c
a
S U B R O U T I N E M S M U L T( A , I A , C , H , N )
c
S U B R O U T I N E M W T U L T ( H ,T H , V , K , L , Y ) -:
REAL M(rM,*),V(*),Y(*)
DO 1 f : 1,K
X : O .
DO 2 J : 1,L
x=X+l{(I,J)*v(J)
Y(I) : X
1 CONTINUE
RETURN
END
c
S U B R O I I T I N E N E W C O T( W E I G H T , N N C )
WEIGHTING COEFFICIENTS
C FOR NEWTON_COTES QUADRATTIRE
c
REAL WEIGHT(*)
co ro (1,2,3,4,5) NNC
t WEIGHT(I) = 1.
GO TO 100
WETGHT(1) : .s
WEIGHT(2) : .s
GO TO 100
WEIGHT(1): 0.333333333333333
WEIGHT(2)= 1.333333333333333
W E I G H T ( 3 ): o . 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
GO TO 100
I
I
I
I
I w E T G H (T1 )
WETGHT( 2 )
o.375
L. T25
L I S T I N GO F S U B R O U T I N E
L I B R A R YI N F O R T ' R A 7
N7 JZI
r^rErcHT( 3 ) L . L Z )
wETGHT (4)
co To 100
wETGHT ( 1) 0 . 3 1 1 1 1 1 1 1 l- 1 1 1 1 1 1
wErcHT(2 ) L.422222222222222
wErcHT( 3 ) o . 53 333 33 33 33 333 3
wErcHT( 4 ) r.422222222222222
wErcHT( 5 ) o . 3 11 111 111 11 I 111
1 0 0 CONTINUE
RETURN
END
c
c
S U B R O U T T N EN U L L ( A , I A , M , N )
c
c NULLS A 2-D ARRAY
c
REAL A(rA,*)
f l 6 l T = 1 M
DO 1 J = 1,N
A(I,J) = 6.6
RETURN
END
S U B R o U T I N E N U L V E C( v E C , N )
c
NULLS A COLUMN VEqTOR
c
REAL VEC(*)
Do r f : 1,N
vEc(I) - o-
RETURN
END
c
suBRou:frNE PRTNTA(A, rA,lI, N, ICH)
RF){L A(rA, *)
DO 1 I = 1,M
1 WRITE (rcH,2) (A(r,J),.r=1,N)
FORMAT(1X,6E12.4)
RETURN
END
c
c
SUBROUTINE PRINTV (VEC, N, ICH)
C
c WRITES A COLUI.IN VECTOR TO OUTPUT CHANNEL 'TCH'
c
REAL VEC(*)
wRrTE (rcH.1) (vEc(I) , I:1,N)
FORMAT(1X,6E12.4)
RETURN
END
322 A P P E N D I X2
suBRouTrNE S K Y F A C( A , N , K D I A G )
c
c CHOLESKT FACTORISATION OF VARTABLE BANDWIDTH
c A STORED AS A VECTOR AND OVERWRTTTEN
c
REAL A(*)
INTEGER KDIAG(*)
A(1) : sQRr(A(r) )
DO 1 I = 2rN
K I = K D T A G ( I ) - I
L=KDIAG(I-I) -Kr+1
Do 2 J = L,I
x = A(KI+J)
KJ:KDTAG(J) -J
rF (J.NE.1) THEN
LL=KDIAG(J-I) -KJ+1
LL = l.rAxo(L,LL)
rF (LL.NE.J) THEN
M = J - 1
D O 3 K = L L , H
. X=X-A(Kr+K)*A(KJ+K)
CONTTNUE
END IF
END IF
A(KI+J) = X/A(KJ+J)
CONTTNUE
A(KI+r) = sQRr(x)
CONTINUE
RETIJRN
END
c
c
S U B R O I j : I I N E S K Y S U B( A , B , N , K D I A G )
B(1) = B(1)/A(1)
RETURN
END
a
c
S U B R O U : T I N ES O L V E ( K , I K , U , F ' N )
WITH
PERFORMS GAUSSIAN ELIMINATION
N*N MATRIX
c PANTTAI PIVOTING ON A FULL
REALK(rK,*),F(*),u(*)
c
c PIVOTING STAGE
c
- 1
DO 1 I = 1,N
BIG = ABS(K(I,I) )
IHOLD : I
D O l O J = I + 1 , N
IF (ABS(K(J,I) ) .GT.BIG) THEN
BIG = ABS(K(J,I))
IHoLD = J
END IF
10 CONTINUE
IF (IHOLD.NE.I) THEN
D O 1 2 J : I , N
HoLD = K(I,J)
K(I,J) : K(IHoLD'J)
K(IHoLD,J) = HoLD
L2 CONTINUE
HoLD = r(I)
F(I) = F(IHoLD)
F(IHoLD) = HoLD
END IF
ELIMINATION STAGE
c
DO 3 J : I + 1,N
FAc = K(J'I)/K(I,I)
DO 4 L = I,N
- X(I'r';*P1g
4 K(J,L) = K(J,L)
- F(r1*Pnq
F(J) : F(J)
3 CONTINUE
I CONTINUE
BACK-SUBSTITUTION STAGE
?
D o g I = N , 1 , - l
SUM = o.
DO 6 L = I + 1,N
su}l: SUM + K(r,L)*u(L)
u(I) = (F(I)-suM)/K(I'I)
9 CONTINUE
RETURN
END
S U B R O U T I N E S U B B A C( A ' I A , B ' N )
c
BACKWARD SUBSTITUTION ON AN U P P E R T R I A N G L E
c
c
REAL A(IA, *) ,B(*)
D o l T = N , 1 , - 1
suM = B(I)
IF (I.LT.N) THEN
324 A P P E N D I X2
DO 2 J = I + 1,N
suM = SUM - A(I,J) *B(J)
2 CONTINUE
END IF
B(r) : suM/A(r,r)
1 CONTINUE
RETURN
END
c
C
c
S U B R O U T I N E S U B F O R ( A ,I A , B , N ) -.
U
c FORWARD SUBSTITT]ITION ON A I-OWER TRIANGLE
c
REALA(IA,*),B(i)
Do 1 I : 1,N
sljl,l = B(I)
rF (r.cr-1) THEN
Do 2 J = 1,I - 1
r S U I , I: S U l . { - A ( I , J ) *B(J)
CONTINUE
END IF
B(I) : sgM/A(I,I)
CONTTNUE
RETURN
END
c
c
c
S U B R o U T I N E V D O T V( V l , V 2 , D O T P R ,N )
DOT PRODUCTV1*V2
C
REAL Vl(*),V2(*)
DOTPR = 0.0
DO 1 I = 1,N
1 DoTPR = DoTPR + v1(I)*V2(I)
RETURN
END
c
c
c
S U B R O I . ] I T I N EV E C A D D( A , B , C , N )
c
S U B R O U T I N E V E C S U B( A , B , C , N )
c
c VECTOR SUBTRACT C:=A-B
c
R E A LA ( * ) , B ( * ) , C ( * )
DO 1 I = l,N
c ( I ) = A ( I ) - B ( I )
RETURN
END
c
C
c
S U B R O U I T I N E V S M U L T( V , S C A L , N )
c
c MULTIPLY A VECTOR BY A SCAI,AR
c
REAL V(*)
DO 1 I = l,N
v(I) = v(I)*5941
RETIJRN
END
c
a
c
S U B R O U T I N E V V M U L T( V l , V 2 , A , I A , M , N )
C
FORMS A VECTOR PRODUCA
327
l
328 INDEX
Forward-substitution16,100,109 Jacobiiteration 4l
Functionsin nontnl^- 3 Program2.8 42
J a c o b id i a g o n a l i s a t i o n 1 1 3 NAc library 2
Program 4.6 ll4 NEwcor 308,320
r
l.
INDEX 329
vDorv 3I1,324
vEcADD 3It,3Z4 Wavecquation 277
vEccoP 311,324 Weightingcoe6cients 169
vEcsuB 3l2,3Zs Weightedresidualmethods 261,269
Vcctor itcration 94
'r
I