Fortran 中的运行时代码跟踪
我有一个很大的 Fortran 77 程序。当在某些常数下运行时,它运行良好。但是,当我改变这个常数时,它就停止了。
我找不到代码中的问题出在哪里。 有没有专门的软件可以在运行过程中检查程序?我的意思是一种跟踪......
提前感谢
Ghazooo
I have a big fortran 77 program. when running under certain constants it runs fine. but, when I change that constants it stoped.
I can not find where is the problem in the code.
Is there any specific software to make a checking for the program during running?? I mean a kind of tracking ......
Thanks in Advance
Ghazooo
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
关于学习如何使用调试器,您已经得到的建议是很好的建议。有比 GDB 更好的调试器,但如果你没有它们,GDB 也可以。
然而,在您深入了解 GDB 程序的内部结构之前,请停下来思考一下。你说改变一些常量会停止程序。你到底是什么意思?您的意思是,如果您更改 Fortran 在源代码中调用的 PARAMETER,重新编译并尝试运行程序会失败?或者您的意思是,如果您提供某些值作为输入,程序就会运行并失败?
当程序失败时,编译器或运行时系统会提供哪些错误消息?程序执行到什么时候会失败?
我想您已经研究过该程序的这些方面,但如果您还没有,您应该这样做。您仍然应该开始学习如何使用调试器,但一般来说,它们有一个不太容易使用的名声。部分原因是我们中没有多少人经常使用它们而能够流利地使用它们。
The advice you have already been given, about learning how to use a debugger, is good advice. There are better debuggers than GDB, but if you don't have any of them GDB is OK.
However, before you dive into the entrails of the program with GDB stop and think. You say that changing some constants stops the program. What exactly do you mean ? Do you mean that if you change what Fortran calls PARAMETERs in the source code, recompile and try to run the program fails ? Or do you mean that if you provide certain values as input the program runs and fails ?
What error messages does the compiler or run-time system provide when the program fails ? How far into its execution does the program fail ?
I guess you have already studied these aspects of the program, but if you haven't you should do so. You should still start learning how to use a debugger but they have a justified reputation, in general, of not being very easy to use. That's partly because not many of us use them frequently enough to become fluent with them.
我建议使用 GDB 进行 Fortran 调试。 GDB 很好地集成在各种 Linux IDE 中。如果您使用英特尔 Fortran 编译器,英特尔还会分发 调试器。
I would recommend Fortran debugging with GDB. GDB is well integrated in various Linux IDE's. If you use the Intel Fortran compiler, intel also distributes a debugger.