FUNCTION f(x,y,z)
  IMPLICIT NONE

  DOUBLE PRECISION, INTENT (in) :: x, y, z
  DOUBLE PRECISION :: f

  f = x*x + y*y + z*z
END FUNCTION f

PROGRAM sumsq
  IMPLICIT NONE
  INTERFACE
     FUNCTION f(x, y, z)
       IMPLICIT NONE

       DOUBLE PRECISION, INTENT (in) :: x, y, z
       DOUBLE PRECISION :: f
     END FUNCTION f
  END INTERFACE

  PRINT *, f(3.2d0, 5.6d0, 8.1d0)
END PROGRAM sumsq
