Fortran Coder

查看: 8589|回复: 6
打印 上一主题 下一主题

[数学库] 调用imsl的 DN2QNJ出现错误

[复制链接]

21

帖子

4

主题

0

精华

入门

F 币
87 元
贡献
50 点
跳转到指定楼层
楼主
发表于 2018-6-14 20:33:58 | 显示全部楼层 |只看大图 回帖奖励 |倒序浏览 |阅读模式

test.txt (12.46 KB, 下载次数: 4)

调用imsl的 DN2QNJ的时候(封装在module中)出现以下错误提示:
1>C:\Users\wenv\source\repos\Console5\Console5\Source1.f90(238): error #7061: The characteristics of dummy argument 1 of the associated actual procedure differ from the characteristics of dummy argument 1 of the dummy procedure.   [FCN]
1>C:\Users\wenv\source\repos\Console5\Console5\Source1.f90(238): error #7062: The characteristics of dummy argument 2 of the associated actual procedure differ from the characteristics of dummy argument 2 of the dummy procedure.   [FCN]
1>C:\Users\wenv\source\repos\Console5\Console5\Source1.f90(238): error #7063: The characteristics of dummy argument 3 of the associated actual procedure differ from the characteristics of dummy argument 3 of the dummy procedure.   [FCN]
1>C:\Users\wenv\source\repos\Console5\Console5\Source1.f90(238): error #7061: The characteristics of dummy argument 1 of the associated actual procedure differ from the characteristics of dummy argument 1 of the dummy procedure.   [LSJAC]
1>C:\Users\wenv\source\repos\Console5\Console5\Source1.f90(238): error #7062: The characteristics of dummy argument 2 of the associated actual procedure differ from the characteristics of dummy argument 2 of the dummy procedure.   [LSJAC]
1>C:\Users\wenv\source\repos\Console5\Console5\Source1.f90(238): error #7063: The characteristics of dummy argument 3 of the associated actual procedure differ from the characteristics of dummy argument 3 of the dummy procedure.   [LSJAC]




调用指令如下:
program kakusann

Include 'link_fnl_shared.h'
!use numerical_libraries
use DN2QNJ_int
USE UMACH_INT
USE Inverse


call  DN2QNJ (FCN, LSJAC, ERRREL, N, ITMAX, XGUESS, X, FNORM, FVEC, FJAC, R, QTF, WK)


具体代码在附件里面,希望得到大佬的帮助,谢谢。
分享到:  微信微信
收藏收藏 点赞点赞 点踩点踩

21

帖子

4

主题

0

精华

入门

F 币
87 元
贡献
50 点
沙发
 楼主| 发表于 2018-6-15 09:56:57 | 显示全部楼层
vvt 发表于 2018-6-15 07:49
[mw_shl_code=fortran,true]  subroutine fcn(X,F,N)
    integer, intent(in) :: n   
    real(kind(1d0 ...

谢谢回复,貌似是能成功调用函数了,但是又出现了新的问题。也没有错误提示。您知道C:\Users\wenv\Desktop\zhao是什么意思吗?

21

帖子

4

主题

0

精华

入门

F 币
87 元
贡献
50 点
板凳
 楼主| 发表于 2018-6-15 15:45:41 | 显示全部楼层
vvt 发表于 2018-6-15 10:41
这个问题需要精细的单步调试才能找到原因。

谢谢回复。问题解决了,出错是数组越界。但我有一点不明白。
我有两台电脑,一个mac,一个windows。都装的ivf。mac用终端运行,windows用vs。
一模一样的代码,mac能运行,windows就会出问题。
比如数组
integer::i
real::a(3)


do i=1,3
a(i+2)=i
end do

在mac会出结果a(3)=1,a(4)=2,a(5)=3
但在windos就会报错,说数组越界。
您知道这个是什么原因吗?

21

帖子

4

主题

0

精华

入门

F 币
87 元
贡献
50 点
地板
 楼主| 发表于 2018-6-16 22:58:06 | 显示全部楼层
vvt 发表于 2018-6-15 15:54
跟操作系统没关系呀,主要是编译器的默认参数不一样。
ivf 用VS编译,会默认检查数组越界,而命令行则不会
...

谢谢回复,解决了我很大的困惑。
您需要登录后才可以回帖 登录 | 极速注册

本版积分规则

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

GMT+8, 2024-5-8 00:11

Powered by Tencent X3.4

© 2013-2024 Tencent

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