Fortran Coder

用IVF分配动态数组提示“allocate”关键字需要定义

查看数: 11385 | 评论数: 8 | 收藏 0
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2019-11-4 08:57

正文摘要:

用real,allocateble::定义了一个实型动态数组,在内存分配是提示“allocate”关键字需要定义,之前没出现过这个问题。是编译器的问题吗,少了什么组件? 请了解的人帮帮忙,谢谢。 代码中: 1)数组定义:   ...

回复

铁人6 发表于 2019-11-5 11:11:01
麻蛋,找出问题了,是前面的一行代码的末尾多写了一个“&”,哎,我也是够了
铁人6 发表于 2019-11-5 10:54:39
我尝试了新建一个项目,把子程序按流程一个个的加进来,在出现问题的子程序加进来之前都能编译与运行,但加了这个子程序就出现问题。之前加载的子程序也有allocate,但没出现问题
铁人6 发表于 2019-11-5 10:52:31
更奇怪的是出现问题的子程序中:出现allocate问题的前部分代码也有动态数组allocate的代码,但内存分配和释放都没问题,轮到这部分代码了就丫的有问题了
铁人6 发表于 2019-11-5 10:47:36
       
这是编译过程中的日志BuildLog.htm文件内信息:

Compiling with Intel(R) Visual Fortran Compiler XE 15.0.0.108 [IA-32]...
ifort /nologo /debug:full /Od /warn:interfaces /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc120.pdb" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /Qvc12 /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\\bin" "C:\Users\Administrator\Desktop\PKI\PKI\Solver\BuildUpFactorProcess\GPFactorCalc.f90"
C:\Users\Administrator\Desktop\PKI\PKI\Solver\BuildUpFactorProcess\GPFactorCalc.f90(596): error #6632: Keyword arguments are invalid without an explicit interface.   [STAT]
        allocate(tempMaterialExposureBdUpFactorByDifferentMfp(buildUpFactorMaterialNum,buildUpFactorMaterialNum),stat = status)
-----------------------------------------------------------------------------------------------------------------^
C:\Users\Administrator\Desktop\PKI\PKI\Solver\BuildUpFactorProcess\GPFactorCalc.f90(596): error #6404: This name does not have a type, and must have an explicit type.   [ALLOCATE]
        allocate(tempMaterialExposureBdUpFactorByDifferentMfp(buildUpFactorMaterialNum,buildUpFactorMaterialNum),stat = status)
--------^
compilation aborted for C:\Users\Administrator\Desktop\PKI\PKI\Solver\BuildUpFactorProcess\GPFactorCalc.f90 (code 1)


PKI - 3 error(s), 0 warning(s)
铁人6 发表于 2019-11-5 10:45:40
特别奇怪的是:其他子程序存在allocate分配动态数组内存没有问题, 就这个子程序里面用allocate分配会出现问题
铁人6 发表于 2019-11-5 10:14:16
感觉像是用于程序编译的与关键字相关的资源没有加进来,不懂是不是这个意思,麻烦各位了
fcode 发表于 2019-11-4 13:29:18
截个图吧

捐赠本站|Archiver|关于我们 About Us|小黑屋|Fcode ( 京ICP备18005632-2号 )

GMT+8, 2025-6-8 14:52

Powered by Tencent X3.4

© 2013-2025 Tencent

快速回复 返回顶部 返回列表