我写了个小代码测试,是没有问题的。
[Fortran] syntaxhighlighter_viewsource syntaxhighlighter_copycode Program www_fcode_cn
use , intrinsic :: ISO_C_Binding
Implicit None
Real , target :: p( 3 , 3 )
integer :: ii=2 , iblock=1 , jj=1 , num=3
type(c_ptr),pointer::c_array(:)
Allocate( c_array(5))
c_array(num)=c_loc(p(ii-iblock,jj))
write(*,*) 'OK'
End Program www_fcode_cn
你再其他地方找找原因吧。 |