  FUNCTION f(a, b)
    REAL, TARGET :: a, b      
    REAL, POINTER :: f

    IF ( a > b ) THEN
      f => a
    ELSE
      f => b
    END IF
  END FUNCTION

! =================

  PROGRAM Main

    INTERFACE
      FUNCTION f(a, b)
        REAL, TARGET :: a, b
        REAL, POINTER :: f
      END FUNCTION
    END INTERFACE

    REAL :: x, y
    REAL, POINTER :: p

    x = 3
    y = 8

    p => f(x, y)

    p = 1001

    print *, " x = ", x, "   y = ", y

  END PROGRAM
