
! -----------------------------------------------------------------------------
! -- Much improved version of the quadratic solver --- now the interface
!    to each subroutine is explicit, that is, the compiler can check 
!    each subroutine call to ensure the parameters are correct so eliminating
!    a major source of bugs.
! -----------------------------------------------------------------------------


PROGRAM quadratic

USE quad_mod

  IMPLICIT NONE
  REAL    :: a, b, c
  COMPLEX :: root_1, root_2

  ! -- Read in (real) coefficients of quadratic ax^2 + bx + c = 0 then
  !    examine them to work out what kind of solution we expect and tell
  !    our customer;  compute roots and output them.

  CALL Get_Coefficients(a, b, c)
  CALL Compute_Roots(a, b, c, root_1, root_2)
  CALL Put_Roots(root_1, root_2)

END 


! -----------------------------------------------------------------------------
! -----------------------------------------------------------------------------
