!///////////////////////////////////////////////////////////////////
!//
!// ctest.f90
!//
!// A program to test the functionality of a class declaration
!// with subclass
!//
!///////////////////////////////////////////////////////////////////

PROGRAM ctest
  !// Use the module containign the class declratations
  USE class_circle
  IMPLICIT NONE
  !// Declare an instance of the circle object
  TYPE(circle)                        :: ct
  !// Declare an instance of the sphere object
  TYPE(sphere)                        :: st
  !// Use the intrinsic constructor to initialize the
  !// circle object
  ct = circle(1.5)
  !// Call the subroutine circ for this instance of the circle
  !// object
  CALL ct%circ()
  !// Print the result from this object
  PRINT *, ct%circumference
  CALL ct%area()
  PRINT *, ct%surface_area
  !// Use the intrinsic constructor to initialize the
  !// sphere object
  st = sphere(2.5)
  !// Call the subroutine spvol for this instance of the sphere
  !// object
  CALL st%spvol()
  PRINT *, st%volume
  !// Call the inherited subroutine circ fot this instance of the
  !// sphere object
  CALL st%circ()
  !// Print the result
  PRINT *, st%circumference
  !// Call the inherited subroutine area fot this instance of the
  !// sphere object
  CALL st%area()
  !// Print the result
  PRINT *, st%surface_area
  
END PROGRAM ctest
