module Rectangle_mod use kinds_mod, only : DP use Shape_mod, only : Shape implicit none private type, extends(Shape), public :: Rectangle private real(DP) :: length real(DP) :: width contains private procedure, pass(this) :: ConstructRectangle procedure, pass(this), public :: getArea generic, public :: Construct => ConstructRectangle end type Rectangle contains subroutine ConstructRectangle(this, length, width, xCenter, yCenter) class(Rectangle), intent(inout) :: this real(DP), intent(in) :: length real(DP), intent(in) :: width real(DP), intent(in) :: xCenter real(DP), intent(in) :: yCenter !.. Create the base class call this%Construct(xCenter=xCenter, yCenter=yCenter) print *, "Constructing rectangle" this%length = length this%width = width !How to invoke the base class constructor here? !The line below works for non-abstract base classes where the !constructor result can be type(Shape) end subroutine ConstructRectangle function getArea(this) result(area) class(Rectangle), intent(in) :: this real(DP) :: area area = this%length * this%width end function getArea end module Rectangle_mod