0
多態性をFortranで使用しようとしていますが、型の割り当てに問題があります。私はどのようにこの作品を理解することはできません。インテルコンパイラは、このエラーを投げた:ここPolymoprhic Variable Fortranでの割り当て型
error #6460: This is not a field name that is defined in the encompassing structure.
analitic%param%a0=2
---------------^
は、最小限の例です。
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
はここに何が間違っているのですか?
ありがとうございました!