在 Fortran2003 程序中,我想创建一个派生类型,其中包含一个具有asynchronous
属性的可分配数组:
module async_in_type
type async_array
integer, dimension(:), allocatable, asynchronous :: a
end type async_array
end module async_in_type
当我尝试使用 GCC 编译上面的代码时,我收到以下错误消息:
$ gfortran -c -Wall -Wextra async_in_type.F90
GNU Fortran (GCC) 4.10.0 20140718 (experimental)
async_in_type.F90:3.52:
integer, dimension(:), allocatable, asynchronous :: a
1
Error: Attribute at (1) is not allowed in a TYPE definition
使用 NAG Fortran 时,消息类似:
$ nagfor -c async_in_type.F90
NAG Fortran Compiler Release 6.0(Hibiya)
Product NPL6A60NA for x86-64 Linux
Error: async_in_type.F90, line 3: Syntax error
detected at ,@ASYNCHRONOUS
[NAG Fortran Compiler pass 1 error termination, 1 error]
这种限制的原因是什么?是否有可能克服这个限制?