SCALAPACK 2.2.2
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ lsame()

logical function lsame ( character  ca,
character  cb 
)

Definition at line 1723 of file tools.f.

1724*
1725* -- LAPACK auxiliary routine (version 2.0) --
1726* Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
1727* Courant Institute, Argonne National Lab, and Rice University
1728* June 30, 1994
1729*
1730* .. Scalar Arguments ..
1731 CHARACTER CA, CB
1732* ..
1733*
1734* Purpose
1735* =======
1736*
1737* LSAME returns .TRUE. if CA is the same letter as CB regardless of
1738* case.
1739*
1740* Arguments
1741* =========
1742*
1743* CA (input) CHARACTER*1
1744* CB (input) CHARACTER*1
1745* CA and CB specify the single characters to be compared.
1746*
1747* =====================================================================
1748*
1749* .. Intrinsic Functions ..
1750 INTRINSIC ichar
1751* ..
1752* .. Local Scalars ..
1753 INTEGER INTA, INTB, ZCODE
1754* ..
1755* .. Executable Statements ..
1756*
1757* Test if the characters are equal
1758*
1759 lsame = ca.EQ.cb
1760 IF( lsame )
1761 $ RETURN
1762*
1763* Now test for equivalence if both characters are alphabetic.
1764*
1765 zcode = ichar( 'Z' )
1766*
1767* Use 'Z' rather than 'A' so that ASCII can be detected on Prime
1768* machines, on which ICHAR returns a value with bit 8 set.
1769* ICHAR('A') on Prime machines returns 193 which is the same as
1770* ICHAR('A') on an EBCDIC machine.
1771*
1772 inta = ichar( ca )
1773 intb = ichar( cb )
1774*
1775 IF( zcode.EQ.90 .OR. zcode.EQ.122 ) THEN
1776*
1777* ASCII is assumed - ZCODE is the ASCII code of either lower or
1778* upper case 'Z'.
1779*
1780 IF( inta.GE.97 .AND. inta.LE.122 ) inta = inta - 32
1781 IF( intb.GE.97 .AND. intb.LE.122 ) intb = intb - 32
1782*
1783 ELSE IF( zcode.EQ.233 .OR. zcode.EQ.169 ) THEN
1784*
1785* EBCDIC is assumed - ZCODE is the EBCDIC code of either lower or
1786* upper case 'Z'.
1787*
1788 IF( inta.GE.129 .AND. inta.LE.137 .OR.
1789 $ inta.GE.145 .AND. inta.LE.153 .OR.
1790 $ inta.GE.162 .AND. inta.LE.169 ) inta = inta + 64
1791 IF( intb.GE.129 .AND. intb.LE.137 .OR.
1792 $ intb.GE.145 .AND. intb.LE.153 .OR.
1793 $ intb.GE.162 .AND. intb.LE.169 ) intb = intb + 64
1794*
1795 ELSE IF( zcode.EQ.218 .OR. zcode.EQ.250 ) THEN
1796*
1797* ASCII is assumed, on Prime machines - ZCODE is the ASCII code
1798* plus 128 of either lower or upper case 'Z'.
1799*
1800 IF( inta.GE.225 .AND. inta.LE.250 ) inta = inta - 32
1801 IF( intb.GE.225 .AND. intb.LE.250 ) intb = intb - 32
1802 END IF
1803 lsame = inta.EQ.intb
1804*
1805* RETURN
1806*
1807* End of LSAME
1808*
logical function lsame(ca, cb)
Definition tools.f:1724
Here is the call graph for this function: