连接 FORTRAN lapack 例程时参数损坏
我在使用 Intel Fortran 编译器 11 的 Visual Studio 2008 中遇到堆损坏问题。我正在使用 Windows 7 64 位。
这是对我的 F90 程序中的 (F77) lapack 子例程的调用:
call dgetrs('N', nbParams, one, a, nbParams, ipv, x, nbParams, err)
在此调用之前,调试器显示所有参数的预期值。 a 和 x 分别代表两个“可分配”变量,其大小分别为 (nbParams,nbParams) 和 (nbParams)。
但是,运行此行后,执行会停止,并出现读取位置 0x0000000000000001 的访问冲突。因为我已经在调试模式下编译了 lapack,所以我可以进入调用内部,并且我看到除了“TRANS”之外的所有内容都在 DGETRS 的第一个语句中被损坏。
SUBROUTINE DGETRS( TRANS, N, NRHS, A, LDA, IPIV, B, LDB, INFO )
...
CHARACTER TRANS
INTEGER INFO, LDA, LDB, N, NRHS
...
INTEGER IPIV( * )
DOUBLE PRECISION A( LDA, * ), B( LDB, * )
......
INFO = 0 **--> Now all input vars but TRANS are corrupted or dereferenced!**
我已经尝试了一切,但无法找到问题所在。有人可以帮我找出问题所在吗?
感谢您的帮助!
I'm stucked with a heap corruption problem in Visual Studio 2008 with Intel Fortran Compiler 11. I'm working on Windows 7 64-bit.
This is a call to a (F77) lapack subroutine in my F90 program:
call dgetrs('N', nbParams, one, a, nbParams, ipv, x, nbParams, err)
Before this call the debugger shows expected values for all parameters. a and x stand for two "allocatable" variables with size (nbParams,nbParams) and (nbParams) respectively.
However, after running this line the execution stops with an Access violation reading location 0x0000000000000001. Since I have compiled lapack in debug mode I'm able to go inside the call, and I see that everything but 'TRANS' gets corrupted just in the first statement of DGETRS.
SUBROUTINE DGETRS( TRANS, N, NRHS, A, LDA, IPIV, B, LDB, INFO )
...
CHARACTER TRANS
INTEGER INFO, LDA, LDB, N, NRHS
...
INTEGER IPIV( * )
DOUBLE PRECISION A( LDA, * ), B( LDB, * )
......
INFO = 0 **--> Now all input vars but TRANS are corrupted or dereferenced!**
I'm tried everything and I'm unable to locate the problem. Could anybody help me locating the problem?
Thanks for your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当使用没有接口的假定形状数组时,通常会出现此类问题。尝试声明一个接口,例如:
This kind of problems usually appear when using assumed shape arrays without an interface. Try declaring an interface such as: