COSMOS v7.655  COSMOSv7655
(AirShowerMC)
c2lowerCase.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine c2lowercase (cu, cl)
 
subroutine c2uppercase (cl, cu)
 

Function/Subroutine Documentation

◆ c2lowercase()

subroutine c2lowercase ( character*(*)  cu,
character*(*)  cl 
)

Definition at line 11 of file c2lowerCase.f.

Referenced by cbeginrun(), and cprocprimdt().

11 !
12 ! convert [A-Z] in "cu" into [a-z] and put it in "cl"
13 ! This is for standard ASCII.
14 !
15 ! cu: character string. input
16 ! cl: // . output. cl may be cu.
17 !
18 ! if cl is shorter than cu, overflowing part
19 ! is not moved.
20 !
21  implicit none
22  character*(*) cu, cl
23 !
24  integer i, ic, imax
25 !
26 
27  imax = min(len(cu), len(cl))
28  do i = 1, imax
29  ic = ichar( cu(i:i) )
30  if( ic .ge. 65 .and. ic .le. 90 ) then ! A-Z
31  cl(i:i) = char(ic+32)
32  else
33  cl(i:i) = cu(i:i)
34  endif
35  enddo
nodes i
Here is the caller graph for this function:

◆ c2uppercase()

subroutine c2uppercase ( character*(*)  cl,
character*(*)  cu 
)

Definition at line 38 of file c2lowerCase.f.

38 !
39 ! convert [a-z] in "cl" into [A-Z] and put it in "cu"
40 ! This is for standard ASCII.
41 !
42 ! cl: character string. input
43 ! cu: // . output. cu may be cl.
44 !
45 ! if cu is shorter than cl, overflowing part
46 ! is not moved.
47 !
48  implicit none
49  character*(*) cl, cu
50 !
51  integer i, ic, imax
52 !
53 
54  imax = min(len(cu), len(cl))
55  do i = 1, imax
56  ic = ichar( cl(i:i) )
57  if( ic .ge. 97 .and. ic .le. 122 ) then ! a-z
58  cu(i:i) = char(ic-32)
59  else
60  cu(i:i) = cl(i:i)
61  endif
62  enddo
nodes i