module circle_module use shape_module type, extends (shape_type) :: circle_type integer, private :: radius_ contains procedure, pass (this) :: getradius procedure, pass (this) :: setradius procedure, pass (this) :: draw => draw_circle end type circle_type interface circle_type module procedure circle_type_constructor end interface circle_type contains type (circle_type) function circle_type_constructor(x, y, radius) implicit none integer, intent (in) :: x integer, intent (in) :: y integer, intent (in) :: radius call circle_type_constructor%setx(x) call circle_type_constructor%sety(y) circle_type_constructor%radius_ = radius end function circle_type_constructor integer function getradius(this) implicit none class (circle_type), intent (in) :: this getradius = this%radius_ end function getradius subroutine setradius(this, radius) implicit none class (circle_type), intent (inout) :: this integer, intent (in) :: radius this%radius_ = radius end subroutine setradius subroutine draw_circle(this) implicit none class (circle_type), intent (in) :: this print *, ' x = ', this%getx() print *, ' y = ', this%gety() print *, ' radius = ', this%radius_ end subroutine draw_circle end module circle_module