Polymorphism in fortran
问题 I have a code similar to: Module C_sys use class_A implicit none Private Type, public :: C_sys_type private logical :: Ao_set = .false. type(A) :: Ao Contains Private Procedure, public :: get_Ao Procedure, public :: set_Ao End Type C_sys_type interface C_sys_type Procedure C_sys_type_constructor end interface C_sys_type Contains type(C_sys_type) elemental function C_sys_type_constructor(Ao) result(C_sys) type(A), intent(in), optional :: Ao C_sys % Ao = Ao C_sys % Ao_set = .true. end function