!start shape_module_common_code integer function getx(this) implicit none class (shape_type), intent (in) :: this getx = this%x_ end function getx integer function gety(this) implicit none class (shape_type), intent (in) :: this gety = this%y_ end function gety subroutine setx(this, x) implicit none class (shape_type), intent (inout) :: this integer, intent (in) :: x this%x_ = x end subroutine setx subroutine sety(this, y) implicit none class (shape_type), intent (inout) :: this integer, intent (in) :: y this%y_ = y end subroutine sety subroutine moveto(this, newx, newy) implicit none class (shape_type), intent (inout) :: this integer, intent (in) :: newx integer, intent (in) :: newy this%x_ = newx this%y_ = newy end subroutine moveto subroutine draw(this) implicit none class (shape_type), intent (in) :: this print *, ' x = ', this%x_ print *, ' y = ', this%y_ end subroutine draw !end shape_module_common_code