Octopus
scalapack.F90
Go to the documentation of this file.
1!! Copyright (C) 2011 D. Strubbe
2!!
3!! This program is free software; you can redistribute it and/or modify
4!! it under the terms of the GNU General Public License as published by
5!! the Free Software Foundation; either version 2, or (at your option)
6!! any later version.
7!!
8!! This program is distributed in the hope that it will be useful,
9!! but WITHOUT ANY WARRANTY; without even the implied warranty of
10!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11!! GNU General Public License for more details.
12!!
13!! You should have received a copy of the GNU General Public License
14!! along with this program; if not, write to the Free Software
15!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16!! 02110-1301, USA.
17!!
18
19#include "global.h"
20
21! -----------------------------------------------------------------------
36! -----------------------------------------------------------------------
37
38module scalapack_oct_m
39 implicit none
40#ifdef HAVE_SCALAPACK
41
42 interface
43 integer function iceil(inum, idenom)
44 implicit none
45 integer, intent(in) :: inum
46 integer, intent(in) :: idenom
47 end function iceil
48 end interface
49
50 interface
51 subroutine descinit(desc, m, n, mb, nb, irsrc, icsrc, ictxt, lld, info)
52 implicit none
53 integer, intent(in) :: desc
54 integer, intent(in) :: m
55 integer, intent(in) :: n
56 integer, intent(in) :: mb
57 integer, intent(in) :: nb
58 integer, intent(in) :: irsrc
59 integer, intent(in) :: icsrc
60 integer, intent(in) :: ictxt
61 integer, intent(in) :: lld
62 integer, intent(out) :: info
63 end subroutine descinit
64 end interface
65
66 interface
67 subroutine infog2l(grindx, gcindx, desc, nprow, npcol, myrow, mycol, lrindx, lcindx, rsrc, csrc)
68 implicit none
69 integer, intent(in) :: grindx
70 integer, intent(in) :: gcindx
71 integer, intent(in) :: desc
72 integer, intent(in) :: nprow
73 integer, intent(in) :: npcol
74 integer, intent(in) :: myrow
75 integer, intent(in) :: mycol
76 integer, intent(out) :: lrindx
77 integer, intent(out) :: lcindx
78 integer, intent(out) :: rsrc
79 integer, intent(out) :: csrc
80 end subroutine infog2l
81 end interface
82
87 interface scalapack_geqrf
88 subroutine pdgeqrf(m, n, a, ia, ja, desca, tau, work, lwork, info)
89 implicit none
90 integer ia, info, ja, lwork, m, n
91 integer desca
92 double precision a, tau, work
93 end subroutine pdgeqrf
94
95 subroutine pzgeqrf(m, n, a, ia, ja, desca, tau, work, lwork, info)
96 use, intrinsic :: iso_fortran_env
97 implicit none
98 integer ia, info, ja, lwork, m, n
99 integer desca
100 complex(real64) a, tau, work
101 end subroutine pzgeqrf
102 end interface scalapack_geqrf
103
113 interface scalapack_orgqr
114 subroutine pdorgqr(m, n, k, a, ia, ja, desca, tau, work, lwork, info)
115 implicit none
116 integer ia, info, ja, k, lwork, m, n
117 integer desca
118 double precision a, tau, work
119 end subroutine pdorgqr
120
121 subroutine pzungqr(m, n, k, a, ia, ja, desca, tau, work, lwork, info)
122 use, intrinsic :: iso_fortran_env
123 implicit none
124 integer ia, info, ja, k, lwork, m, n
125 integer desca
126 complex(real64) a, tau, work
127 end subroutine pzungqr
128 end interface scalapack_orgqr
129
130 interface
131 subroutine pdgesv(n, nrhs, a, ia, ja, desca, ipiv, b, ib, jb, descb, info)
132 implicit none
133 integer ia, ib, info, ja, jb, n, nrhs
134 integer desca, descb, ipiv
135 double precision a, b
136 end subroutine pdgesv
137 end interface
138
139 interface
140 subroutine pzgesv(n, nrhs, a, ia, ja, desca, ipiv, b, ib, jb, descb, info)
141 use, intrinsic :: iso_fortran_env
142 implicit none
143 integer ia, ib, info, ja, jb, n, nrhs
144 integer desca, descb, ipiv
145 complex(real64) a, b
146 end subroutine pzgesv
147 end interface
148
169 interface scalapack_syev
170 subroutine pdsyev(jobz, uplo, n, a, ia, ja, desca, w, z, iz, jz, descz, work, lwork, info)
171 use, intrinsic :: iso_fortran_env
172 implicit none
173 character, intent(in) :: jobz
174 character, intent(in) :: uplo
175 integer, intent(in) :: n
176 real(real64), intent(inout) :: a
177 integer, intent(in) :: ia
178 integer, intent(in) :: ja
179 integer, intent(in) :: desca
180 real(real64), intent(out) :: w
181 real(real64), intent(out) :: z
182 integer, intent(in) :: iz
183 integer, intent(in) :: jz
184 integer, intent(in) :: descz
185 real(real64), intent(out) :: work
186 integer, intent(in) :: lwork
187 integer, intent(out) :: info
188 end subroutine pdsyev
189
190 subroutine pzheev(jobz, uplo, n, a, ia, ja, desca, w, z, iz, jz, descz, work, lwork, rwork, lrwork, info)
191 use, intrinsic :: iso_fortran_env
192 implicit none
193 character, intent(in) :: jobz
194 character, intent(in) :: uplo
195 integer, intent(in) :: n
196 complex(real64), intent(inout) :: a
197 integer, intent(in) :: ia
198 integer, intent(in) :: ja
199 integer, intent(in) :: desca
200 real(real64), intent(out) :: w
201 complex(real64), intent(out) :: z
202 integer, intent(in) :: iz
203 integer, intent(in) :: jz
204 integer, intent(in) :: descz
205 complex(real64), intent(out) :: work
206 integer, intent(in) :: lwork
207 complex(real64), intent(out) :: rwork
208 integer, intent(in) :: lrwork
209 integer, intent(out) :: info
210 end subroutine pzheev
211 end interface scalapack_syev
212
218 interface scalapack_syevx
219 subroutine pdsyevx( jobz, range, uplo, n, a, ia, ja, desca, vl, vu, il, iu, abstol, &
220 m, nz, w, orfac, z, iz, jz, descz, work, lwork, iwork, liwork, ifail, iclustr, gap, info )
221 use, intrinsic :: iso_fortran_env
222 implicit none
223 character(1), intent(in) :: jobz
224 character(1), intent(in) :: range
225 character(1), intent(in) :: uplo
226 integer, intent(in) :: n
227 real(real64), intent(inout) :: a
228 integer, intent(in) :: ia
229 integer, intent(in) :: ja
230 integer, intent(in) :: desca
231 real(real64), intent(in) :: vl
232 real(real64), intent(in) :: vu
233 integer, intent(in) :: il
234 integer, intent(in) :: iu
235 real(real64) , intent(in) :: abstol
236 integer, intent(out) :: m
237 integer, intent(out) :: nz
238 real(real64), intent(out) :: w
239 real(real64), intent(in) :: orfac
240 real(real64), intent(out) :: z
241 integer, intent(in) :: iz
242 integer, intent(in) :: jz
243 integer, intent(in) :: descz
244 real(real64), intent(out) :: work
245 integer, intent(in) :: lwork
246 integer, intent(inout) :: iwork
247 integer, intent(in) :: liwork
248 integer, intent(out) :: ifail
249 integer, intent(out) :: iclustr
250 real(real64), intent(out) :: gap
251 integer, intent(out) :: info
252
253 end subroutine pdsyevx
254
255 subroutine pzheevx(jobz, range, uplo, n, a, ia, ja, desca, vl, vu, il, iu, abstol, m, nz, w, orfac, z, iz, &
256 jz, descz, work, lwork, rwork, lrwork, iwork, liwork, ifail, iclustr, gap, info)
257 use, intrinsic :: iso_fortran_env
258 implicit none
259 character(1), intent(in) :: jobz
260 character(1), intent(in) :: range
261 character(1), intent(in) :: uplo
262 integer, intent(in) :: n
263 complex(real64), intent(inout) :: a
264 integer, intent(in) :: ia
265 integer, intent(in) :: ja
266 integer, intent(in) :: desca
267 real(real64), intent(in) :: vl
268 real(real64), intent(in) :: vu
269 integer, intent(in) :: il
270 integer, intent(in) :: iu
271 real(real64), intent(in) :: abstol
272 integer, intent(out) :: m
273 integer, intent(out) :: nz
274 real(real64), intent(out) :: w
275 real(real64), intent(in) :: orfac
276 complex(real64), intent(out) :: z
277 integer, intent(in) :: iz
278 integer, intent(in) :: jz
279 integer, intent(in) :: descz
280 complex(real64), intent(out) :: work
281 integer, intent(in) :: lwork
282 real(real64), intent(out) :: rwork
283 integer, intent(in) :: lrwork
284 integer, intent(inout) :: iwork
285 integer, intent(in) :: liwork
286 integer, intent(out) :: ifail
287 integer, intent(out) :: iclustr
288 real(real64), intent(out) :: gap
289 integer, intent(out) :: info
290 end subroutine pzheevx
291 end interface scalapack_syevx
292
301 interface scalapack_sygvx
302 subroutine pdsygvx(ibtype, jobz, range, uplo, n, a, ia, ja, &
303 desca, b, ib, jb, descb, vl, vu, il, iu, abstol, m, nz, w, orfac, z, iz, jz, descz, &
304 work, lwork, iwork, liwork, ifail, iclustr, gap, info)
305 use, intrinsic :: iso_fortran_env
306 implicit none
307 integer, intent(in) :: ibtype
308 character, intent(in) :: jobz
309 character, intent(in) :: range
310 character, intent(in) :: uplo
311 integer, intent(in) :: n
312 real(real64), intent(inout) :: a
313 integer, intent(in) :: ia
314 integer, intent(in) :: ja
315 integer, intent(in) :: desca
316 real(real64), intent(inout) :: b
317 integer, intent(in) :: ib
318 integer, intent(in) :: jb
319 integer, intent(in) :: descb
320 real(real64), intent(in) :: vl
321 real(real64), intent(in) :: vu
322 integer, intent(in) :: il
323 integer, intent(in) :: iu
324 real(real64), intent(in) :: abstol
325 integer, intent(out) :: m
326 integer, intent(out) :: nz
327 real(real64), intent(in) :: w
328 real(real64), intent(in) :: orfac
329 real(real64), intent(out) :: z
330 integer, intent(in) :: iz
331 integer, intent(in) :: jz
332 integer, intent(in) :: descz
333 real(real64), intent(out) :: work
334 integer, intent(in) :: lwork
335 integer, intent(out) :: iwork
336 integer, intent(in) :: liwork
337 integer, intent(out) :: ifail
338 integer, intent(out) :: iclustr
339 real(real64), intent(out) :: gap
340 integer, intent(out) :: info
341 end subroutine pdsygvx
342 end interface scalapack_sygvx
343
344 ! -------------------------------------------------------------
353 interface scalapack_hegvx
354 subroutine pzhegvx(ibtype, jobz, range, uplo, n, a, ia, ja, &
355 desca, b, ib, jb, descb, vl, vu, il, iu, abstol, m, nz, w, orfac, z, iz, jz, descz, &
356 work, lwork, rwork, lrwork, iwork, liwork, ifail, iclustr, gap, info)
357 use, intrinsic :: iso_fortran_env
358 implicit none
359 integer, intent(in) :: ibtype
360 character, intent(in) :: jobz
361 character, intent(in) :: range
362 character, intent(in) :: uplo
363 integer, intent(in) :: n
364 complex(real64), intent(inout) :: a
365 integer, intent(in) :: ia
366 integer, intent(in) :: ja
367 integer, intent(in) :: desca
368 complex(real64), intent(inout) :: b
369 integer, intent(in) :: ib
370 integer, intent(in) :: jb
371 integer, intent(in) :: descb
372 real(real64), intent(in) :: vl
373 real(real64), intent(in) :: vu
374 integer, intent(in) :: il
375 integer, intent(in) :: iu
376 real(real64), intent(in) :: abstol
377 integer, intent(out) :: m
378 integer, intent(out) :: nz
379 real(real64), intent(in) :: w
380 real(real64), intent(in) :: orfac
381 complex(real64), intent(out) :: z
382 integer, intent(in) :: iz
383 integer, intent(in) :: jz
384 integer, intent(in) :: descz
385 complex(real64), intent(out) :: work
386 integer, intent(in) :: lwork
387 real(real64), intent(out) :: rwork
388 integer, intent(in) :: lrwork
389 integer, intent(out) :: iwork
390 integer, intent(in) :: liwork
391 integer, intent(out) :: ifail
392 integer, intent(out) :: iclustr
393 real(real64), intent(out) :: gap
394 integer, intent(out) :: info
395 end subroutine pzhegvx
396 end interface scalapack_hegvx
397
398 ! -------------------------------------------------------------
414 interface scalapack_potrf
415 subroutine pdpotrf(uplo, n, a, ia, ja, desca, info)
416 use, intrinsic :: iso_fortran_env
417 implicit none
418 character(1), intent(in) :: uplo
419 integer, intent(in) :: n
420 real(real64), intent(inout) :: a
421 integer, intent(in) :: ia
422 integer, intent(in) :: ja
423 integer, intent(in) :: desca
424 integer, intent(out) :: info
425 end subroutine pdpotrf
426
427 subroutine pzpotrf(uplo, n, a, ia, ja, desca, info)
428 use, intrinsic :: iso_fortran_env
429 implicit none
430 character(1), intent(in) :: uplo
431 integer, intent(in) :: n
432 complex(real64), intent(inout) :: a
433 integer, intent(in) :: ia
434 integer, intent(in) :: ja
435 integer, intent(in) :: desca
436 integer, intent(out) :: info
437 end subroutine pzpotrf
438 end interface scalapack_potrf
439
440 interface
441 subroutine pzlacp3(m, i, a, desca, b, ldb, ii, jj, rev)
442 use, intrinsic :: iso_fortran_env
443 implicit none
444 integer i, ii, jj, ldb, m, rev
445 integer desca
446 complex(real64) a, b
447 end subroutine pzlacp3
448 end interface
449
450 interface
451 subroutine pdlacp3(m, i, a, desca, b, ldb, ii, jj, rev)
452 use, intrinsic :: iso_fortran_env
453 implicit none
454 integer i, ii, jj, ldb, m, rev
455 integer desca
456 real(real64) a, b
457 end subroutine pdlacp3
458 end interface
459
460 interface
461 integer function indxl2g(indxloc, nb, iproc, isrcproc, nprocs)
462 implicit none
463 integer indxloc, iproc, isrcproc, nb, nprocs
464 end function
465 end interface
466
467 interface
468 integer function indxg2l(indxglob, nb, iproc, isrcproc, nprocs)
469 implicit none
470 integer indxglob, iproc, isrcproc, nb, nprocs
471 end function
472 end interface
473
474 interface
475 integer function indxg2p(indxglob, nb, iproc, isrcproc, nprocs)
476 implicit none
477 integer indxglob, iproc, isrcproc, nb, nprocs
478 end function
479 end interface
480
481#endif
482end module scalapack_oct_m
483
484!! local Variables:
485!! mode: f90
486!! coding: utf-8
487!! End:
subroutine info()
Definition: em_resp.F90:1096
Computes a QR factorization of a real distributed .
Definition: scalapack.F90:180
Computes all the eigenvalues, and optionally, the eigenvectors of a complex generalized Hermitian-def...
Definition: scalapack.F90:446
Generates an real distributed matrix Q denoting A(IA:IA+M-1,JA:JA+N-1) with orthonormal columns,...
Definition: scalapack.F90:206
Computes the Cholesky factorization of an real symmetric positive definite distributed matrix sub(A)...
Definition: scalapack.F90:507
Computes all eigenvalues and, optionally, eigenvectors of a real symmetric matrix A by calling the re...
Definition: scalapack.F90:262
Computes selected eigenvalues and, optionally, eigenvectors of a real symmetric matrix A by calling t...
Definition: scalapack.F90:311
Computes all the eigenvalues, and optionally, the eigenvectors of a real generalized SY-definite eige...
Definition: scalapack.F90:394
This module contains interfaces for ScaLAPACK routines Interfaces are from http:
Definition: scalapack.F90:131