From: glen herrmannsfeldt on
widmar wrote:

> Last revised in Nov. 2006 (by UTK, Berkeley, NAG) - clf's stringing
> enthusiasts are invited to scale it to a string quartet subject to the
> specs therein:
>
> logical function lsame (ca, cb)
> character ca, cb
> *
> * LSAME returns .TRUE. if CA is the same letter as CB
> * regardless of case.
> * ...

lsame=.true.
if(ca.eq.cb) return
lsame=.false.
if((ca.lt.'a'.or.ca.gt.'z').and.(ca.lt.'A'.or.ca.gt.'Z') return
if((cb.lt.'a'.or.cb.gt.'z').and.(cb.lt.'A'.or.cb.gt.'Z') return
if(ieor(ichar(ca),ichar(cb)).ne.ieor(ichar('z'),ichar('Z'))return
lsame=.true.
return
end

From: widmar on
glen herrmannsfeldt wrote:
>
> > logical function lsame (ca, cb)
> > character ca, cb
> > *
> > * LSAME returns .TRUE. if CA is the same letter as CB
> > * regardless of case.
> > * ...
>
> lsame=.true.
> if(ca.eq.cb) return
> lsame=.false.
> if((ca.lt.'a'.or.ca.gt.'z').and.(ca.lt.'A'.or.ca.gt.'Z') return
> if((cb.lt.'a'.or.cb.gt.'z').and.(cb.lt.'A'.or.cb.gt.'Z') return
> if(ieor(ichar(ca),ichar(cb)).ne.ieor(ichar('z'),ichar('Z'))return
> lsame=.true.
> return
> end

Very clever - a quantum improvement, however team LAPACK probably won't
allow the use of "ieor" intrinsic. btw, you missed one ) in each of the
last three if statements.
From: widmar on
glen herrmannsfeldt wrote:
>
> > logical function lsame (ca, cb)
> > character ca, cb
> > *
> > * LSAME returns .TRUE. if CA is the same letter as CB
> > * regardless of case.
> > * ...
>
> lsame=.true.
> if(ca.eq.cb) return
> lsame=.false.
> if((ca.lt.'a'.or.ca.gt.'z').and.(ca.lt.'A'.or.ca.gt.'Z') return
> if((cb.lt.'a'.or.cb.gt.'z').and.(cb.lt.'A'.or.cb.gt.'Z') return
> if(ieor(ichar(ca),ichar(cb)).ne.ieor(ichar('z'),ichar('Z'))return
> lsame=.true.
> return
> end

Very clever - a quantum improvement, however team LAPACK probably won't
allow the use of "ieor" intrinsic. btw, you missed one ) in each of the
last three if statements.

From: widmar on
glen herrmannsfeldt wrote:
>
> > logical function lsame (ca, cb)
> > character ca, cb
> > *
> > * LSAME returns .TRUE. if CA is the same letter as CB
> > * regardless of case.
> > * ...
>
> lsame=.true.
> if(ca.eq.cb) return
> lsame=.false.
> if((ca.lt.'a'.or.ca.gt.'z').and.(ca.lt.'A'.or.ca.gt.'Z') return
> if((cb.lt.'a'.or.cb.gt.'z').and.(cb.lt.'A'.or.cb.gt.'Z') return
> if(ieor(ichar(ca),ichar(cb)).ne.ieor(ichar('z'),ichar('Z'))return
> lsame=.true.
> return
> end

Very clever - a quantum improvement, however team LAPACK probably won't
allow the use of "ieor" intrinsic. btw, you missed one ) in each of the
last three if statements.
From: robin on
"glen herrmannsfeldt" <gah(a)ugcs.caltech.edu> wrote in message
news:c6Kdna0xMtBKsnLanZ2dnUVZ_oimnZ2d(a)comcast.com...
> widmar wrote:
>
> > Last revised in Nov. 2006 (by UTK, Berkeley, NAG) - clf's stringing
> > enthusiasts are invited to scale it to a string quartet subject to the
> > specs therein:
> >
> > logical function lsame (ca, cb)
> > character ca, cb
> > *
> > * LSAME returns .TRUE. if CA is the same letter as CB
> > * regardless of case.
> > * ...
>
> lsame=.true.
> if(ca.eq.cb) return
> lsame=.false.
> if((ca.lt.'a'.or.ca.gt.'z').and.(ca.lt.'A'.or.ca.gt.'Z') return
> if((cb.lt.'a'.or.cb.gt.'z').and.(cb.lt.'A'.or.cb.gt.'Z') return
> if(ieor(ichar(ca),ichar(cb)).ne.ieor(ichar('z'),ichar('Z'))return
> lsame=.true.
> return
> end

That isn't portable.
Nor it is correct: the test for non-alphabetic characters comes
after the test for equality??!