!------------------------------------------------------------------------------
!
!  Program name:
!
!    vector_main
!
!  Purpose:
!
!    This program uses the vector module and shows how to apply all 
!    associated operators overloading to the variables of derived type 
!    vector.
!
!------------------------------------------------------------------------------

PROGRAM vector_main

  USE vector_module

  IMPLICIT NONE  
  TYPE (vector) :: v, v1, v2

  WRITE(*, *) 'Assign values to v1 and v2'

  v1 = vector(1.0, 2.0)
  WRITE(*, *) 'v1 = ', v1

  v2 = vector(4.0, 5.0)
  WRITE(*, *) 'v2 = ', v2
 
  WRITE(*, *)
  WRITE(*, *) 'Use new vector operators'

  v = -v2
  WRITE(*, *) 'v = -v2 = ', v

  v = v1 + v2
  WRITE(*, *) 'v = v1 + v2 = ', v

  v = v1 - v2
  WRITE(*, *) 'v = v1 - v2 = ', v

END PROGRAM vector_main






