Converts an input string to all lowercase characters.
Useful for normalizing namelist inputs and performing case-insensitive comparison of species names or boundary conditions.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | text |
The source string to convert. |
pure function lowercase(text) result(out) character(len=*), intent(in) :: text character(len=len(text)) :: out integer :: i integer :: code do i = 1, len(text) code = iachar(text(i:i)) if (code >= iachar('A') .and. code <= iachar('Z')) then out(i:i) = achar(code + iachar('a') - iachar('A')) else out(i:i) = text(i:i) end if end do end function lowercase