forked from JeffersonLab/mc_hms_single
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lowcase.f
32 lines (27 loc) · 936 Bytes
/
lowcase.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
!--------------------------------------------------------------------
C subroutine lowcase(str1,str2,length)
C Which returns in str2 a lower cased copy of str1
C Length is the length of the 2 strings (or max chars
C to convert
C
C pillaged (and slightly modified)
C from the /src directory of T. Payerle, UMD.
subroutine lowcase(str1,str2)
implicit none
character*(*) str1,str2
C Local vars
character*26 caps,lcase
data caps /'ABCDEFGHIJKLMNOPQRSTUVWXYZ' /
data lcase /'abcdefghijklmnopqrstuvwxyz' /
integer i,j,l
l = len(str1)
do i=1,l
j = index(caps,str1(i:i) )
C index returns 0 if can't find substring
if (j .gt. 0) then
str2(i:i) = lcase(j:j)
else
str2(i:i) = str1(i:i)
endif
enddo
end