! 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.20. Expressions with Structure Components.
  program G20
    use Element_M
    implicit none
    type (Chem_El_Type_1) :: Carbon_12, Temp, Linoleum ! Type declaration
! start program G20
    read (unit = *, fmt = *) Carbon_12 % Atomic_Mass  ! Structure component
    Temp % Element_Name = ""
    Temp % Symbol = ""
    Temp % Atomic_Number = 0
    Temp % Atomic_Mass = Carbon_12 % Atomic_Mass + 0.532
    Linoleum = Temp
    write (unit = *, fmt = *) Linoleum
    stop
  end program G20
