! 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 6.24. Whole-structure assignment.
  program G24
    use Element_M
    implicit none
    type (Chem_El_Type_2) :: Carbon, Temp_E  ! Type declaration
    type (Isotope_Type) :: Temp_I
! start program G24
    Temp_I = Isotope_Type( 999, 999.9 )
    read (unit = *, fmt = *) Temp_E
    Carbon = Temp_E
    Carbon % Principal_Isotope = Temp_I
    write (unit = *, fmt = *) Temp_E, Carbon
    stop
  end program G24
