! Program Example from "Essential Fortran 90 & 95" by Loren P. Meissner
! Copyright 1996. Copying for sale requires permission from the author.
! Otherwise, distribution is permitted if these three lines are included.

! Example 1.5. Kind type parameter for complex variables.
  program B05
    implicit none
    integer, parameter :: TRAD = kind( 0.0 ), SRK12 = selected_real_kind( 6 )
    complex (kind = TRAD) :: X, B
    complex (kind = SRK12), parameter :: A = (1.0_SRK12, 10.0_SRK12)
! start program B05
    B = (6.94_SRK12, 5.9_SRK12) ! Coerced to kind of B during assignment
    X = A + B ! Expression coerced to highest kind, then to kind of X
    write (unit = *, fmt = *) X, A, B
    stop
  end program B05
