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

PROGRAM birthdate

  IMPLICIT NONE
  TYPE date                      ! defines type date
    INTEGER day
    CHARACTER(LEN = 3) month
    INTEGER year
  END TYPE date

  TYPE(date) mydate              ! mydate is of type date

  mydate = date(18, 'Nov', 1968) ! mydate assigned

  WRITE (*, *) 'Printing by components'
  WRITE (*, '(1X, I2, A3, I4)') mydate%day, mydate%month, mydate%year
  WRITE (*, *) 'Printing by structure'
  WRITE (*, *) mydate

END PROGRAM birthdate







