4 | character(100) :: to_upper
| 1
Error: Explicit interface required for 'to_upper' at (1): result with non-constant character length
program main
implicit none
character(100) :: to_upper
character(100) :: some_str
some_str = "hello world"
some_str = to_upper(some_str)
end program main
pure function to_upper (str) Result (string)
! Changes a string to upper case
implicit None
Character(*), Intent(In) :: str
Character(LEN(str)) :: string
! An algorithm goes here...
end function