! ------------------------------- ! Example program ! ! A simple user-defined data type ! ------------------------------- module structures type rational integer :: numer,denom end type rational end module structures program test use structures implicit none type(rational):: ratio real(kind(1.d0)):: decimal ratio%numer = 15 ratio%denom = 32 print*,ratio write(*,'(i0,"/",i0)') ratio decimal = dble(ratio%numer)/dble(ratio%denom) print*,decimal end program test