编译 FORTRAN IV 或转换为 FORTRAN 77?

发布于 2024-11-14 17:51:58 字数 166 浏览 3 评论 0原文

我有一些需要运行的代码,用 FORTRAN IV 编写。运行此代码有哪些选项?是否有可以在 PC 上编译和运行 FORTRAN IV 代码的应用程序?或者如果可能的话,我正在寻找一个实用程序将 Fortran IV 代码转换为 FORTRAN 77 或更高版本。我对 Fortran 和一般编程缺乏经验。 谢谢你的帮助

I've got some code I need to run, written in FORTRAN IV. What are my options for running this code? Is there an application out there that can compile and run FORTRAN IV code on a PC? Or if possible I am looking for a utility to convert Fortran IV code to FORTRAN 77 or later. I have little experience in Fortran and in programing in general.
Thanks for you help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

世态炎凉 2024-11-21 17:51:58

Intel's Fortran compiler supports Fortran IV. If you don't want to go that way, there are some conversion utilities mentioned in this question --- but none of them sound very promising.

很快妥协 2024-11-21 17:51:58

Fortran 中删除的功能很少。在最新的语言标准中,还有一些功能已被标记为过时。但编译器倾向于支持大部分或全部这些功能,因为一些客户不想仅仅因为他们使用“坏”功能而重新编码工作遗留程序。有时必须使用编译器选项才能使用其中一些功能。所以我只是选择一个编译器并在现有代码上尝试它。有很多可供选择。也许在付款之前先获取试用版,看看它是否有效,或者使用免费版本。

另一个可能的问题是您的代码库可能具有非标准功能。在 Fortran-90 之前的日子里,人们对语言标准的关注较少,一些供应商添加了额外的功能来方便用户并区分他们的产品。如果存在,此类功能可能会导致更大的问题并需要重新编码。

Very few features have been deleted from Fortran. A few more features have been marked as obsolescent in the more recent language standards. But the compilers tend to support most or all of these features because some customers don't want to recode working legacy programs just because they use "bad" features. Sometimes one has to use compiler options to use some of these features. So I'd just pick a compiler and try it on the existing code. There are many to choose from. Maybe get a trial version to see whether it works before paying your money or use a free one.

Another possible problem is that your code base might have non-standard features. In pre Fortran-90 days there was less concern with language standards and some vendors added extra features for user convenience and to differentiate their product. If present, such features might cause greater problems and require recoding.

随风而去 2024-11-21 17:51:58

Fortran IV 最重要的特征可能是 do 循环在最后检查变量。因此 do 循环总是至少执行一次。当更改为当前方法时,这是一个大问题。

    n = 5
    do 99 i = n, 4
     write(*,*) i
99  continue

在 Fortran IV 中将打印出“5”,而在 Fortran 77 中则不会打印任何内容。使用此功能的代码可能很难移植。

Probably the most important feature of Fortran IV is that do loops check the variable at the end. Thus do loops always execute at least once. This was a big issue when it was changed to the current method.

    n = 5
    do 99 i = n, 4
     write(*,*) i
99  continue

Will print out "5" in Fortran IV, and nothing in Fortran 77. Codes that use this feature can be hard to port.

与君绝 2024-11-21 17:51:58

我只想补充一点,如果代码确实使用了编译器无法处理的非标准功能,fortranwiki.org 的维护者会在他们的 现代化旧版 Fortran 页面。

I'll just add that if the code does use non-standard features that your compiler doesn't handle, the maintainers at fortranwiki.org maintain a nice list of explanations of, and workarounds for, many such contstructs on their Modernizing Old Fortran page.

东风软 2024-11-21 17:51:58

显而易见的答案是在 Hercules 模拟器下的 MVS 3.8J 上运行它。 MVS 3.8J 以及 IBM FORTRAN G 和 FORTRAN H 属于公共领域。

您将能够像拥有真正的大型机一样编译和运行代码! IBM FORTRAN 编译器支持(实际上已定义)完整的 FORTRAN IV 语言以及 IBM 扩展。

The obvious answer is to run it as is on MVS 3.8J under the Hercules emulator. MVS 3.8J and IBM FORTRAN G and FORTRAN H are public domain.

You will be able to compile and run the code as if you had a real mainframe! The IBM FORTRAN compilers support (defined, actually) the full FORTRAN IV language along with IBM extensions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文