Variables being deleted in Fortran Arrays?
问题 I have a following code, with an abstract type, inherited type and a short program, where I'm creating an object and storing it in an array. module m implicit none type :: container class(a), allocatable :: item end type container type, abstract :: a integer, public :: num end type a type, extends(a) :: b integer, public :: num2 end type b end module m program mwe use m implicit none class(a), allocatable :: o1 class(container), allocatable :: arr(:) o1 = b(1, 2) allocate(arr(2)) arr(1) =