01:       LOGICAL          FUNCTION LSAMEN( N, CA, CB )
02: *
03: *  -- LAPACK auxiliary routine (version 3.2) --
04: *     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
05: *     November 2006
06: *
07: *     .. Scalar Arguments ..
08:       CHARACTER*( * )    CA, CB
09:       INTEGER            N
10: *     ..
11: *
12: *  Purpose
13: *  =======
14: *
15: *  LSAMEN  tests if the first N letters of CA are the same as the
16: *  first N letters of CB, regardless of case.
17: *  LSAMEN returns .TRUE. if CA and CB are equivalent except for case
18: *  and .FALSE. otherwise.  LSAMEN also returns .FALSE. if LEN( CA )
19: *  or LEN( CB ) is less than N.
20: *
21: *  Arguments
22: *  =========
23: *
24: *  N       (input) INTEGER
25: *          The number of characters in CA and CB to be compared.
26: *
27: *  CA      (input) CHARACTER*(*)
28: *  CB      (input) CHARACTER*(*)
29: *          CA and CB specify two character strings of length at least N.
30: *          Only the first N characters of each string will be accessed.
31: *
32: * =====================================================================
33: *
34: *     .. Local Scalars ..
35:       INTEGER            I
36: *     ..
37: *     .. External Functions ..
38:       LOGICAL            LSAME
39:       EXTERNAL           LSAME
40: *     ..
41: *     .. Intrinsic Functions ..
42:       INTRINSIC          LEN
43: *     ..
44: *     .. Executable Statements ..
45: *
46:       LSAMEN = .FALSE.
47:       IF( LEN( CA ).LT.N .OR. LEN( CB ).LT.N )
48:      $   GO TO 20
49: *
50: *     Do for each character in the two strings.
51: *
52:       DO 10 I = 1, N
53: *
54: *        Test if the characters are equal using LSAME.
55: *
56:          IF( .NOT.LSAME( CA( I: I ), CB( I: I ) ) )
57:      $      GO TO 20
58: *
59:    10 CONTINUE
60:       LSAMEN = .TRUE.
61: *
62:    20 CONTINUE
63:       RETURN
64: *
65: *     End of LSAMEN
66: *
67:       END
68: