      module casing

        interface operator ( + )
          module procedure upper_case
        end interface

        interface operator ( - )
          module procedure lower_case
        end interface

      contains

        function upper_case ( old ) result ( k_new )
        character*20              :: k_new
        character*20, intent(in ) :: old
        k_new = old
        do i = 1, len_trim(old), 1
           if ( lge ( old(i:i), 'a' ) .and. &
                lle ( old(i:i), 'z' )       )  &
                k_new(i:i) = achar ( iachar(old(i:i)) - 32 )
        end do
        end function upper_case

        function lower_case ( old ) result ( k_new )
        character*20              :: k_new
        character*20, intent(in ) :: old
        k_new = old
        do i = 1, len_trim(old), 1
           if ( lge ( old(i:i), 'A' ) .and. &
                lle ( old(i:i), 'Z' )       )  &
                k_new(i:i) = achar ( iachar(old(i:i)) + 32 )
        end do
        end function lower_case

      end module casing
      program operate2
      use casing
      character*20  :: string = 'This uses MIXED case'
      print *, " "
      print *, "Base string .. ",   string
      print *, "Upper case ... ", + string
      print *, "Lower case ... ", - string
      print *, " "
      end program operate2
