File: pslabad.f

package info (click to toggle)
scalapack 2.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 37,012 kB
  • sloc: fortran: 339,113; ansic: 74,517; makefile: 1,494; sh: 34
file content (76 lines) | stat: -rw-r--r-- 2,545 bytes parent folder | download | duplicates (4)
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
      SUBROUTINE PSLABAD( ICTXT, SMALL, LARGE )
*
*  -- ScaLAPACK auxiliary routine (version 1.7) --
*     University of Tennessee, Knoxville, Oak Ridge National Laboratory,
*     and University of California, Berkeley.
*     May 1, 1997
*
*     .. Scalar Arguments ..
      INTEGER            ICTXT
      REAL               LARGE, SMALL
*     ..
*
*  Purpose
*  =======
*
*  PSLABAD takes as input the values computed by PSLAMCH for underflow
*  and overflow, and returns the square root of each of these values if
*  the log of LARGE is sufficiently large.  This subroutine is intended
*  to identify machines with a large exponent range, such as the Crays,
*  and redefine the underflow and overflow limits to be the square roots
*  of the values computed by PSLAMCH.  This subroutine is needed because
*  PSLAMCH does not compensate for poor arithmetic in the upper half of
*  the exponent range, as is found on a Cray.
*
*  In addition, this routine performs a global minimization and maximi-
*  zation on these values, to support heterogeneous computing networks.
*
*  Arguments
*  =========
*
*  ICTXT   (global input) INTEGER
*          The BLACS context handle in which the computation takes
*          place.
*
*  SMALL   (local input/local output) REAL
*          On entry, the underflow threshold as computed by PSLAMCH.
*          On exit, if LOG10(LARGE) is sufficiently large, the square
*          root of SMALL, otherwise unchanged.
*
*  LARGE   (local input/local output) REAL
*          On entry, the overflow threshold as computed by PSLAMCH.
*          On exit, if LOG10(LARGE) is sufficiently large, the square
*          root of LARGE, otherwise unchanged.
*
*  =====================================================================
*
*     .. Local Scalars ..
      INTEGER            IDUMM
*     ..
*     .. External Subroutines ..
      EXTERNAL           SGAMN2D, SGAMX2D
*     ..
*     .. Intrinsic Functions ..
      INTRINSIC          LOG10, SQRT
*     ..
*     .. Executable Statements ..
*
*     If it looks like we're on a Cray, take the square root of
*     SMALL and LARGE to avoid overflow and underflow problems.
*
      IF( LOG10( LARGE ).GT.2000. ) THEN
         SMALL = SQRT( SMALL )
         LARGE = SQRT( LARGE )
      END IF
      IDUMM = 0
*
      CALL SGAMX2D( ICTXT, 'All', ' ', 1, 1, SMALL, 1, IDUMM,
     $              IDUMM, -1, -1, IDUMM )
      CALL SGAMN2D( ICTXT, 'All', ' ', 1, 1, LARGE, 1, IDUMM,
     $              IDUMM, -1, -1, IDUMM )
*
      RETURN
*
*     End of PSLABAD
*
      END