以下是有效的 Fortran 语言吗
Program LogicalAllocation
class(*), pointer :: bool
allocate(bool, source=.false.)
select type(bool)
type is (logical)
Print *, bool
end select
End Program LogicalAllocation
在我的 intel fortran oneapi 版本 2023.0.0.25839 上,此代码似乎会随机打印“T”或“F”。
对于未来的访客。它应该是有效的 Fortran 语法,而且它似乎是一个编译器错误。