!///////////////////////////////////////////////////////////////////
!//
!// circle_and_sphere.f90
!//
!// A module contianing type definitons for a circle and
!// a sphere
!//
!///////////////////////////////////////////////////////////////////

MODULE circle_and_sphere
  IMPLICIT NONE
  !// The radius for the circle and sphere
  REAL                           :: radius
  !// The circumferenc of the circle after calculations
  REAL                           :: circumference
  !// The surface area of the circle after calculations
  REAL                           :: surface_area
  !// The volume of the sphere after calculations
  REAL                           :: sphere_volume
  !// The velue of pi
  REAL                           :: pi

CONTAINS

  !// Subroutine ti initialize pi
  SUBROUTINE init_pi()
    pi = 4 * ATAN(1.)
  END SUBROUTINE init_pi
  !// Subroutine to calculate the circumference of the
  !// circle
  SUBROUTINE circumf()
    circumference = 2 * radius * pi
  END SUBROUTINE circumf
  !// Subroutine to calculate the surface area of the
  !// circle  
  SUBROUTINE area()
    surface_area = pi * radius ** 2
  END SUBROUTINE area
  
  !// Subroutine to calculate the volume of the
  !// sphere
  SUBROUTINE volume()
    sphere_volume = 4./3. * pi * radius * radius &
                    * radius
  END SUBROUTINE volume
  
END MODULE circle_and_sphere