!------------------------------------------------------------------------------
!
!  Program name:
!
!    name_birthdate
!
!  Purpose:
!
!   This program defines a derived type namedate, which is used 
!   to store a name and a date of birth.
!
!------------------------------------------------------------------------------

PROGRAM name_birthdate

  IMPLICIT NONE
  TYPE namedate       ! defines type date
    CHARACTER (LEN = 15) name
    INTEGER day
    CHARACTER (LEN = 3) month
    INTEGER year
  END TYPE namedate
 
  TYPE (namedate) :: person

  person = namedate('Neil Smith', 18, 'Nov', 1968)

  WRITE (*, *) 'Printing by components'
  WRITE (*, '(1X, A15, I2, A3, I4/)') &
	          person%name, person%day, person%month, person%year
  WRITE (*, *) 'Printing by structure'
  WRITE (*, *) person
  
END PROGRAM name_birthdate




