        FUNCTION add ( x, y )
	 USE complexType
	 IMPLICIT NONE

         TYPE(complexNumber) :: x, y, add

	 add%re = x%re + y%re
	 add%im = x%im + y%im
        END FUNCTION

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

	PROGRAM main
	 USE complexType

	 INTERFACE
	  FUNCTION add ( x, y )
           USE complexType
	   TYPE(complexNumber) :: x, y, add
	  END FUNCTION
	 END INTERFACE

	 TYPE(complexNumber) :: a, b, c

	 a%re = 3; a%im = 4
	 b%re = 5; b%im = -8

	 c = add (a, b)

         print *, "a = ", a
         print *, "b = ", b
         print *, "c = ", c
	END PROGRAM
