Fortran 90 和 Fortran 95 之间的区别
我可以使用 Fortran 95 编译器编译 Fortran 90 文件吗? Fortran 95 似乎有很多,但 Fortran 90 却没有。
Can I compile Fortran 90 files with a Fortran 95 compiler? There seems to be a lot for Fortran 95 but not Fortran 90.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,您可以使用 Fortran 95 编译器编译 Fortran 90 程序。实际上,现在大多数编译器在很大程度上但并不完全兼容 Fortran 2003。除非您有特殊要求,否则您最好使用 Fortran 95/2003/2008 编译器,而不是仅使用 Fortran 90。 Fortran 95 在某种程度上是对 Fortran 90 的“错误修复”...这是基于实际使用 Fortran 90 的经验进行的适度更新,这与 Fortran 77 相比是一个巨大的变化。例如,更容易出现内存泄漏在 Fortran 90 中...在 Fortran 95 中,局部可分配变量必须在退出子例程时自动释放,因此程序员不必显式执行释放。在 Fortran 90 中,如果未显式编码释放,则允许发生内存泄漏。
对于免费编译器来说,最新版本的 gfortran 已经相当不错了。
Yes, you can compile Fortran 90 programs with a Fortran 95 compiler. Actually, most of the compilers out there are now largely but not totally compliant with Fortran 2003. Unless you have unusual requirements, you are better off with a Fortran 95/2003/2008 compiler rather than a Fortran 90 only one. Fortran 95 is somewhat of a "bug fix" to Fortran 90 ... it was a modest update based upon the experience with actually using Fortran 90, which was a huge change from Fortran 77. For example, it is easier to have memory leaks in Fortran 90 ... in Fortran 95 local allocatable variables must be automatically deallocated upon exit from a subroutine so the programmer doesn't have to explicitly do the deallocation. In Fortran 90, if the deallocation wasn't explicitly coded, a memory leak was allowed to occur.
For a free compiler, recent versions of gfortran are quite good.
这个可以:
NAGWare f95 编译器版本 5.1
另请参阅:
Michel Olagnon 的 Fortran 90 列表
This one can:
NAGWare f95 Compiler Release 5.1
See also:
Clive Page's list of Fortran Resources
Michel Olagnon's Fortran 90 List