PLASMA  2.4.5
PLASMA - Parallel Linear Algebra for Scalable Multi-core Architectures
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
xerbla.f
Go to the documentation of this file.
1  SUBROUTINE xerbla( SRNAME, INFO )
2 *
3 * -- LAPACK auxiliary routine (version 3.1) --
4 * Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
5 * November 2006
6 *
7 * .. Scalar Arguments ..
8  CHARACTER*(*) srname
9  INTEGER info
10 * ..
11 *
12 * Purpose
13 * =======
14 *
15 * This is a special version of XERBLA to be used only as part of
16 * the test program for testing error exits from the LAPACK routines.
17 * Error messages are printed if INFO.NE.INFOT or if SRNAME.NE.SRMANT,
18 * where INFOT and SRNAMT are values stored in COMMON.
19 *
20 * Arguments
21 * =========
22 *
23 * SRNAME (input) CHARACTER*(*)
24 * The name of the subroutine calling XERBLA. This name should
25 * match the COMMON variable SRNAMT.
26 *
27 * INFO (input) INTEGER
28 * The error return code from the calling subroutine. INFO
29 * should equal the COMMON variable INFOT.
30 *
31 * Further Details
32 * ======= =======
33 *
34 * The following variables are passed via the common blocks INFOC and
35 * SRNAMC:
36 *
37 * INFOT INTEGER Expected integer return code
38 * NOUT INTEGER Unit number for printing error messages
39 * OK LOGICAL Set to .TRUE. if INFO = INFOT and
40 * SRNAME = SRNAMT, otherwise set to .FALSE.
41 * LERR LOGICAL Set to .TRUE., indicating that XERBLA was called
42 * SRNAMT CHARACTER*(*) Expected name of calling subroutine
43 *
44 *
45 * .. Scalars in Common ..
46  LOGICAL lerr, ok
47  CHARACTER*32 srnamt
48  INTEGER infot, nout
49 * ..
50 * .. Intrinsic Functions ..
51  INTRINSIC len_trim
52 * ..
53 * .. Common blocks ..
54  common / infoc / infot, nout, ok, lerr
55  common / srnamc / srnamt
56 * ..
57 * .. Executable Statements ..
58 *
59  lerr = .true.
60  IF( info.NE.infot ) THEN
61  IF( infot.NE.0 ) THEN
62  WRITE( nout, fmt = 9999 )
63  $ srnamt( 1:len_trim( srnamt ) ), info, infot
64  ELSE
65  WRITE( nout, fmt = 9997 )
66  $ srname( 1:len_trim( srname ) ), info
67  END IF
68  ok = .false.
69  END IF
70  IF( srname.NE.srnamt ) THEN
71  WRITE( nout, fmt = 9998 )
72  $ srname( 1:len_trim( srname ) ),
73  $ srnamt( 1:len_trim( srnamt ) )
74  ok = .false.
75  END IF
76  return
77 *
78  9999 format( ' *** XERBLA was called from ', a, ' with INFO = ', i6,
79  $ ' instead of ', i2, ' ***' )
80  9998 format( ' *** XERBLA was called with SRNAME = ', a,
81  $ ' instead of ', a6, ' ***' )
82  9997 format( ' *** On entry to ', a, ' parameter number ', i6,
83  $ ' had an illegal value ***' )
84 *
85 * End of XERBLA
86 *
87  END