The TELEMAC-MASCARET system  trunk
to_lower.f
Go to the documentation of this file.
1  FUNCTION to_lower(STRIN) RESULT(STROUT)
2  ! Adapted from http://www.star.le.ac.uk/~cgp/fortran.html (25 May
3  ! 2012)
4  ! Original author: Clive Page
5 
6  IMPLICIT NONE
7 
8  CHARACTER(LEN=*), INTENT(IN) :: strin
9  CHARACTER(LEN=LEN(STRIN)) :: strout
10  INTEGER :: i,j
11 
12  DO i = 1, len(strin)
13  j = iachar(strin(i:i))
14  IF (j>= iachar("A") .AND. j<=iachar("Z") ) THEN
15  strout(i:i) = achar(iachar(strin(i:i))+32)
16  ELSE
17  strout(i:i) = strin(i:i)
18  END IF
19  END DO
20 
21  END FUNCTION to_lower