lsame(3f) - [BLAS:AUX_BLAS] compare two letters ignoring case
logical function lsame(ca,cb)
.. Scalar Arguments ..
character(len=1),intent(in) :: ca,cb
..
LSAME returns .TRUE. if CA is the same letter as CB regardless of case.
CA
CA is CHARACTER*1
CB
CB is CHARACTER*1
CA and CB specify the single characters to be compared.
date:December 2016
Online html documentation available at
http://www.netlib.org/lapack/explore-html/
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=1), | intent(in) | :: | ca | |||
character(len=1), | intent(in) | :: | cb |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | inta | ||||
integer, | public | :: | intb |
pure logical function lsame(ca,cb)
implicit none
! -- Reference BLAS level1 routine (version 3.1) --
! -- Reference BLAS is a software package provided by Univ. of Tennessee, --
! -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
! December 2016
! .. Scalar Arguments ..
character(len=1),intent(in) :: ca,cb
! ..
! =====================================================================
! .. Intrinsic Functions ..
intrinsic iachar
! ..
! .. Local Scalars ..
integer :: inta,intb
! ..
! Test if the characters are equal
lsame = ca .eq. cb
if (lsame) return
! Now test for equivalence after converting uppercase to lowercase
! if characters are alphameric
inta = ichar(ca)
intb = ichar(cb)
if (inta.ge.97 .and. inta.le.122) inta = inta - 32
if (intb.ge.97 .and. intb.le.122) intb = intb - 32
lsame = inta .eq. intb
end function lsame