program main
  implicit none

  type :: point ! A point in x,y,z space
     real :: x,y,z
  end type point

  type :: tet   ! Tetrahedron defined by 4 points
     type (point) :: p1,p2,p3,p4
  end type tet

  type (tet) :: t_a, t_b

  ! First way to define a tet
  t_a%p1%x = 1.0
  t_a%p1%y = 2.0
  t_a%p1%z = 3.0

  t_a%p2%x = 0.0
  t_a%p2%y = 0.0
  t_a%p2%z = 0.0

  t_a%p3%x = 6.0
  t_a%p3%y = 7.0
  t_a%p3%z = 8.0

  t_a%p4%x = 10.0
  t_a%p4%y = 10.0
  t_a%p4%z = 10.0

  ! Second way to define a tet
  t_b = tet(point(0.,0.,0.),point(4.,5.,6.),point(17.,18.,19.),point(30.,31.,32.))

end program main
