The TELEMAC-MASCARET system  trunk
to_upper.f
Go to the documentation of this file.
1  FUNCTION to_upper(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_upper