c c c
      program sifunc
      implicit none
      real a,b,c,x,y,z,f1
      data c / 5./
c
c    This is a statement function.  It is considered an executable
c    statement, and commonly positioned at the beginning of executable
c    statements.  It may actually exist anywhere in the executable
c    portion of the program unit before it is put to use.
c
      f1(x,y)=a+b*x**2+c*y
c
      a = 1
      b = 2
      z = f1(2.,2.)
      print *, 'f1(2.,2.) = ', z
      z = f1( b,b)
      print *, 'f1(b ,b ) = ', z
c
      z = f2(2.,2.)
      print *, 'f2(2.,2.) = ', z
      z = f2( b,b)
      print *, 'f2(b ,b ) = ', z
c
c    The following CONTAINS statement marks the end of the main program unit
c    and the beginning of a block of "INTERNAL" subprograms.  Here I'm
c    just including one function.  Notice that it knows the values of
c    a, b, and c set in the main program.  (You can put internal subprograms
c    at the end of normal external subroutines, functions, and modules)
c
      contains
c
c
      function f2(x,y)
      real x,y,f2
      f2 = a + b*x**2 + c*y
      return
      end function f2
c
c    Don't forget the end statement for the main program
c
      end
c
c c