问在调用C_F_POINTER时Fortran指针和Fortran可分配性的差异EN当您向期望指针的过程发送可分配变量时,任...
double precision, pointer :: my_global_ndarray(:,:,:) contains subroutine link_global_variable(c_pointer, dims, n_dims) bind(C, name="f_link_global_variable") type(c_ptr), intent(in) :: c_pointer integer(c_int), intent(in) :: dims(*) integer(c_int), intent(in) :: n_dims ...
C_ASSOCIATED(C_PTR_1 [, C_PTR_2]) 表示C_PTR_1的关联状态,或者表示C_PTR_1和C_PTR_2是否与同一个实体关联。 C_F_POINTER(CPTR, FPTR [, SHAPE]) 将指针与 C 指针的目标关联并指定其形式。 有关ISO_C_BINDING内模块的详细信息,请参见http://www.j3-fortran.org上的 Fortran 2003 标准的第...
(in) :: c_name type(c_funptr) :: choose_func end function real(c_float) function float_func(x) import :: c_float real(c_float), intent(in), value :: x end function end interface character(len=:), allocatable, target :: name procedure(real_func), pointer :: f type(c_funptr...
表示C_PTR_1 的关联状态,或者表示 C_PTR_1 和C_PTR_2 是否与同一个实体关联。 C_F_POINTER(CPTR, FPTR [, SHAPE]) 将指针与 C 指针的目标关联并指定其形式。 有关ISO_C_BINDING 内模块的详细信息,请参见 http://www.j3-fortran.org 上的Fortran 2003 标准的第 15 章。2.3...
TYPE(PRV),POINTER,DIMENSION( : ) :: AGTYPE(C_PTR), POINTER :: CPAG CALL C_F_POINTER(PAG,CPAG) ALLOCATE(AG(SZ)) DO I = 1, SZ CALL C_F_POINTER(CPAG,AG(I)%PA) ENDDO ! ! Do something in Fortran code ! AG =>REALLOCATE(AG, new_size) ! My own realloc function ... DO I...
Deletion of the character "C_NULL_CHAR"chaine=chaine(1:lg_chaine)PRINT'(2a)','chaine finale = ',chainePRINT'(a,i0)','longueur de la chaine finale = ',lg_chainePRINT'(a,f0.4)','reel passe par adresse = ',reelcellule=creat(acos(-1.),1756)callC_F_POINTER(CPTR=cellule,FPTR=...
-c Compile only, do not run the linker. -o Specify the name of the output file, either an object file or the executable. 可以一次指定多个源文件和目标文件。 Fortran文件由以“.f”,“.F”,“。for”,“.FOR”,“。f90”,“.F90”,“。f95”,“.F95”,“。”结尾的名称表示。 f03“和”...
INTEGER,POINTER::P!定义指针变量P INTEGER,TARGET::X!定义整型变量X READ*,X P=>X!使P指向X,这时两者实际上是同一个变量 PRINT*,"X=",X PRINT*,"P=",P输入3 END 输出结果为:X=3 P=3 P193例10.2指针变量示例2INTEGER,POINTER::P1,P2,P3,P4INTEGER,TARGET::X1,X2INTEGERX,S1,S2,S3,S4,S5...
CHARACTER(4)::CHAR_num(6)=(/'a','b','c','3','4','5'/)CHARACTER(42)::CHAR_50='蜘蛛网计算机语言--订阅号--字符串为字符常量' !变量的初始化 integer,dimension(:),allocatable::Da !动态数组声明--有些浪费内存 CHARACTER*10,allocatable::DDc(:)integer,dimension(:),pointer::Pa !声明...