Aim: Switch from lower to upper case or vice-versa.
The routine declaration is:
function changeCase(instring,dir) result(outstring)
! instring : input string
! dir : direction (1: to lower case; 2: to uppercase; 0: switch case)
character(len=*), intent(in) :: instring
integer, intent(in) :: dir
character(len=len(instring)) :: outstring