Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/mathlibs/src/parpack/pdseigt.f
5215 views
1
c-----------------------------------------------------------------------
2
c\BeginDoc
3
c
4
c\Name: pdseigt
5
c
6
c Message Passing Layer: MPI
7
c
8
c\Description:
9
c Compute the eigenvalues of the current symmetric tridiagonal matrix
10
c and the corresponding error bounds given the current residual norm.
11
c
12
c\Usage:
13
c call pdseigt
14
c ( COMM, RNORM, N, H, LDH, EIG, BOUNDS, WORKL, IERR )
15
c
16
c\Arguments
17
c COMM MPI Communicator for the processor grid. (INPUT)
18
c
19
c RNORM Double precision scalar. (INPUT)
20
c RNORM contains the residual norm corresponding to the current
21
c symmetric tridiagonal matrix H.
22
c
23
c N Integer. (INPUT)
24
c Size of the symmetric tridiagonal matrix H.
25
c
26
c H Double precision N by 2 array. (INPUT)
27
c H contains the symmetric tridiagonal matrix with the
28
c subdiagonal in the first column starting at H(2,1) and the
29
c main diagonal in second column.
30
c
31
c LDH Integer. (INPUT)
32
c Leading dimension of H exactly as declared in the calling
33
c program.
34
c
35
c EIG Double precision array of length N. (OUTPUT)
36
c On output, EIG contains the N eigenvalues of H possibly
37
c unsorted. The BOUNDS arrays are returned in the
38
c same sorted order as EIG.
39
c
40
c BOUNDS Double precision array of length N. (OUTPUT)
41
c On output, BOUNDS contains the error estimates corresponding
42
c to the eigenvalues EIG. This is equal to RNORM times the
43
c last components of the eigenvectors corresponding to the
44
c eigenvalues in EIG.
45
c
46
c WORKL Double precision work array of length 3*N. (WORKSPACE)
47
c Private (replicated) array on each PE or array allocated on
48
c the front end.
49
c
50
c IERR Integer. (OUTPUT)
51
c Error exit flag from dstqrb.
52
c
53
c\EndDoc
54
c
55
c-----------------------------------------------------------------------
56
c
57
c\BeginLib
58
c
59
c\Local variables:
60
c xxxxxx real
61
c
62
c\Routines called:
63
c dstqrb ARPACK routine that computes the eigenvalues and the
64
c last components of the eigenvectors of a symmetric
65
c and tridiagonal matrix.
66
c second ARPACK utility routine for timing.
67
c pdvout Parallel ARPACK utility routine that prints vectors.
68
c dcopy Level 1 BLAS that copies one vector to another.
69
c dscal Level 1 BLAS that scales a vector.
70
c
71
c\Author
72
c Danny Sorensen Phuong Vu
73
c Richard Lehoucq CRPC / Rice University
74
c Dept. of Computational & Houston, Texas
75
c Applied Mathematics
76
c Rice University
77
c Houston, Texas
78
c
79
c\Parallel Modifications
80
c Kristi Maschhoff
81
c
82
c\Revision history:
83
c Starting Point: Serial Code FILE: seigt.F SID: 2.2
84
c
85
c\SCCS Information:
86
c FILE: seigt.F SID: 1.3 DATE OF SID: 4/19/96
87
c
88
c\Remarks
89
c None
90
c
91
c\EndLib
92
c
93
c-----------------------------------------------------------------------
94
c
95
subroutine pdseigt
96
& ( comm, rnorm, n, h, ldh, eig, bounds, workl, ierr )
97
c
98
c %--------------------%
99
c | MPI Communicator |
100
c %--------------------%
101
c
102
integer comm
103
c
104
c %----------------------------------------------------%
105
c | Include files for debugging and timing information |
106
c %----------------------------------------------------%
107
c
108
include 'debug.h'
109
include 'stat.h'
110
c
111
c %------------------%
112
c | Scalar Arguments |
113
c %------------------%
114
c
115
integer ierr, ldh, n
116
Double precision
117
& rnorm
118
c
119
c %-----------------%
120
c | Array Arguments |
121
c %-----------------%
122
c
123
Double precision
124
& eig(n), bounds(n), h(ldh,2), workl(3*n)
125
c
126
c %------------%
127
c | Parameters |
128
c %------------%
129
c
130
Double precision
131
& zero
132
parameter (zero = 0.0)
133
c
134
c %---------------%
135
c | Local Scalars |
136
c %---------------%
137
c
138
integer i, k, msglvl
139
c
140
c %----------------------%
141
c | External Subroutines |
142
c %----------------------%
143
c
144
external dcopy, dstqrb, pdvout, second
145
c
146
c %---------------------%
147
c | Intrinsic Functions |
148
c %---------------------%
149
c
150
intrinsic abs
151
c
152
c %-----------------------%
153
c | Executable Statements |
154
c %-----------------------%
155
c
156
c %-------------------------------%
157
c | Initialize timing statistics |
158
c | & message level for debugging |
159
c %-------------------------------%
160
c
161
call second (t0)
162
msglvl = mseigt
163
c
164
if (msglvl .gt. 0) then
165
call pdvout (comm, logfil, n, h(1,2), ndigit,
166
& '_seigt: main diagonal of matrix H')
167
if (n .gt. 1) then
168
call pdvout (comm, logfil, n-1, h(2,1), ndigit,
169
& '_seigt: sub diagonal of matrix H')
170
end if
171
end if
172
c
173
c
174
call dcopy (n, h(1,2), 1, eig, 1)
175
call dcopy (n-1, h(2,1), 1, workl, 1)
176
call dstqrb (n, eig, workl, bounds, workl(n+1), ierr)
177
if (ierr .ne. 0) go to 9000
178
c
179
if (msglvl .gt. 1) then
180
call pdvout (comm, logfil, n, bounds, ndigit,
181
& '_seigt: last row of the eigenvector matrix for H')
182
end if
183
c
184
c %-----------------------------------------------%
185
c | Finally determine the error bounds associated |
186
c | with the n Ritz values of H. |
187
c %-----------------------------------------------%
188
c
189
do 30 k = 1, n
190
bounds(k) = rnorm*abs(bounds(k))
191
30 continue
192
c
193
call second (t1)
194
tseigt = tseigt + (t1 - t0)
195
c
196
9000 continue
197
return
198
c
199
c %-----------------%
200
c | End of pdseigt |
201
c %-----------------%
202
c
203
end
204
205