LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
logical function lsame ( character  CA,
character  CB 
)

LSAME

Purpose:
 LSAME returns .TRUE. if CA is the same letter as CB regardless of
 case.
Parameters
[in]CA
 
[in]CB
          CA and CB specify the single characters to be compared.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011

Definition at line 53 of file lsame.f.

53 *
54 * -- LAPACK auxiliary routine (version 3.4.0) --
55 * -- LAPACK is a software package provided by Univ. of Tennessee, --
56 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
57 * November 2011
58 *
59 * .. Scalar Arguments ..
60  CHARACTER ca, cb
61 * ..
62 *
63 * =====================================================================
64 *
65 * .. Intrinsic Functions ..
66  INTRINSIC ichar
67 * ..
68 * .. Local Scalars ..
69  INTEGER inta, intb, zcode
70 * ..
71 * .. Executable Statements ..
72 *
73 * Test if the characters are equal
74 *
75  lsame = ca.EQ.cb
76  IF( lsame )
77  $ RETURN
78 *
79 * Now test for equivalence if both characters are alphabetic.
80 *
81  zcode = ichar( 'Z' )
82 *
83 * Use 'Z' rather than 'A' so that ASCII can be detected on Prime
84 * machines, on which ICHAR returns a value with bit 8 set.
85 * ICHAR('A') on Prime machines returns 193 which is the same as
86 * ICHAR('A') on an EBCDIC machine.
87 *
88  inta = ichar( ca )
89  intb = ichar( cb )
90 *
91  IF( zcode.EQ.90 .OR. zcode.EQ.122 ) THEN
92 *
93 * ASCII is assumed - ZCODE is the ASCII code of either lower or
94 * upper case 'Z'.
95 *
96  IF( inta.GE.97 .AND. inta.LE.122 ) inta = inta - 32
97  IF( intb.GE.97 .AND. intb.LE.122 ) intb = intb - 32
98 *
99  ELSE IF( zcode.EQ.233 .OR. zcode.EQ.169 ) THEN
100 *
101 * EBCDIC is assumed - ZCODE is the EBCDIC code of either lower or
102 * upper case 'Z'.
103 *
104  IF( inta.GE.129 .AND. inta.LE.137 .OR.
105  $ inta.GE.145 .AND. inta.LE.153 .OR.
106  $ inta.GE.162 .AND. inta.LE.169 ) inta = inta + 64
107  IF( intb.GE.129 .AND. intb.LE.137 .OR.
108  $ intb.GE.145 .AND. intb.LE.153 .OR.
109  $ intb.GE.162 .AND. intb.LE.169 ) intb = intb + 64
110 *
111  ELSE IF( zcode.EQ.218 .OR. zcode.EQ.250 ) THEN
112 *
113 * ASCII is assumed, on Prime machines - ZCODE is the ASCII code
114 * plus 128 of either lower or upper case 'Z'.
115 *
116  IF( inta.GE.225 .AND. inta.LE.250 ) inta = inta - 32
117  IF( intb.GE.225 .AND. intb.LE.250 ) intb = intb - 32
118  END IF
119  lsame = inta.EQ.intb
120 *
121 * RETURN
122 *
123 * End of LSAME
124 *
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the call graph for this function: