我是 Fortran 初学者,我正在尝试采用一些 ifort 代码来使用 gfortran 进行编译。
我的函数有问题c_loc()
,它在 ifort 中似乎接受动态数组,但 gfortran 编译因错误而停止:
错误:(1)处的参数“septr1”到“c_loc”必须是关联的标量指针
那么有谁知道如何调整以下 ifort 代码以使用 gfortran 进行编译?
integer(c_int), dimension(:), pointer :: septr1=>null()
type(c_PTR) :: septr
allocate (septr1(10))
septr1 = 33
septr = c_loc(septr1)