! Subroutine to convert lowercase ASCII characters in a string ! to uppercase. Generalizing this to multinational character sets ! requires a significant effort. ! ! This is just one of many possible implementations. For example, one ! might use a table indexed by the character value, this could be written ! as a function or as a subroutine with an optional output argument, etc. ! subroutine UPCASE (STRING) implicit none character (len=*),INTENT(INOUT) :: STRING integer I character(len=1) C do I = 1,LEN(STRING) C = STRING(I:I) if ((C >= 'a') .and. (C <= 'z')) then STRING(I:I) = CHAR(ICHAR(C)-32) end if end do return end subroutine UPCASE ! Subroutine to convert uppercase ASCII characters in a string ! to lowercase. Generalizing this to multinational character sets ! requires a significant effort. ! ! This is just one of many possible implementations. For example, one ! might use a table indexed by the character value, this could be written ! as a function or as a subroutine with an optional output argument, etc. ! subroutine DOWNCASE (STRING) implicit none character (len=*),INTENT(INOUT) :: STRING integer I character(len=1) C do I = 1,LEN(STRING) C = STRING(I:I) if ((C >= 'A') .and. (C <= 'Z')) then STRING(I:I) = CHAR(ICHAR(C)+32) end if end do return end subroutine DOWNCASE