0
포트란에서 다형성을 사용하려고하는데이 유형을 할당하는 데 문제가 있습니다. 나는이 일을 어떻게하는지 알 수 없다.Polymoprhic 변수에 포트를 할당하십시오.
program new
implicit none
integer, parameter :: dp = kind(1.0d0)
type :: potential
class(*),allocatable :: param
endtype
type(potential) :: analitic
type :: pa1d_param
real(dp) :: a0
real(dp) :: b0
end type
allocate(pa1d_param::analitic%param)
analitic%param%a0=2.0_dp
end program
여기에 어떤 문제가 :
여기error #6460: This is not a field name that is defined in the encompassing structure.
analitic%param%a0=2
---------------^
는 최소한의 예입니다 : 인텔 컴파일러는이 오류가 발생했습니다?
감사합니다.