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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
*DECK ALVDLS
SUBROUTINE ALVDLS (LTSW,MU1,ASS,F,ISEG,LON,NBL,LBL)
*
*-----------------------------------------------------------------------
*
*Purpose:
* solution of a symmetric linear system where the coefficient matrix
* have been previously factorized as LDL(T). Supervectorial version.
*
*Copyright:
* Copyright (C) 1992 Ecole Polytechnique de Montreal
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version
*
*Author(s): A. Hebert
*
*Parameters: input
* LTSW maximum bandwidth. =2 for tridiagonal systems.
* MU1 position of each diagonal element in vector ass.
* DIMENSION MU1(L4) where L4=SUM(LBL(I))
* ASS LDL(T) factors of the coefficient matrix in compressed
* diagonal storage mode. DIMENSION ASS(ISEG,MU1(L4))
* F right-hand side of the linear system. DIMENSION F(ISEG,L4)
* ISEG number of elements in a vector register.
* LON number of groups of linear systems.
* NBL number of linear systems in each group. DIMENSION NBL(LON)
* LBL number of unknowns in each group. DIMENSION LBL(LON)
*
*Parameters: output
* F solution of the linear system. DIMENSION F(ISEG,L4)
*
*-----------------------------------------------------------------------
*
INTEGER ISEG,LON,MU1(*),NBL(LON),LBL(LON)
REAL ASS(ISEG,*),F(ISEG,*)
REAL, DIMENSION(:), ALLOCATABLE :: T
*
ALLOCATE(T(ISEG))
LBL0=0
IMAX=0
DO 200 ILON=1,LON
L4=LBL(ILON)
NBANC=NBL(ILON)
IF(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*(I-LBL0)-1
CDIR$ SHORTLOOP
DO 140 IB=1,NBANC
F(IB,I)=F(IB,I)*ASS(IB,K1)
140 CONTINUE
145 CONTINUE
*
K1=IMAX+2*L4-2
DO 170 I=LBL0+L4,LBL0+2,-1
KJ=I-1
CDIR$ SHORTLOOP
DO 150 IB=1,NBANC
T(IB)=-F(IB,I)
150 CONTINUE
CDIR$ SHORTLOOP
DO 160 IB=1,NBANC
F(IB,KJ)=F(IB,KJ)+ASS(IB,K1)*T(IB)
160 CONTINUE
K1=K1-2
170 CONTINUE
IMAX=IMAX+2*L4-1
ENDIF
LBL0=LBL0+L4
200 CONTINUE
DEALLOCATE(T)
RETURN
END
|