如何将 gfortran 用于带有 .for 文件扩展名的 Fortran 90? [英] How to use gfortran for Fortran 90 with .for file extension?

查看:27
本文介绍了如何将 gfortran 用于带有 .for 文件扩展名的 Fortran 90?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Ubuntu (16.04) 中安装 Gfortran 后指向 f95.我在 gfortran 手册中看到可以为 f95 和转发提供 -std 选项.我从手册中看到的默认 -std 选项值是gnu".如果我将 f95 用于 f90 代码,我不确定编译内部的含义.

After I installed Gfortran in Ubuntu (16.04) is pointing to f95. I see in gfortran manual that -std option can be given for f95 and forward. The default -std option value I see from manual is "gnu". I am not sure of implications of internals of compiling if I use f95 for f90 code.

如何将 gfortran 用于扩展名为 .for 的 Fortran 90 文件?我不想为 Fortran 90 代码使用 Fortran 95 编译器,尽管 Fortran 95 可能能够(不确定)编译 Fortran 90.

How do I use gfortran for Fortran 90 files with .for extension? I do not want to use Fortran 95 compiler for Fortran 90 code though Fortran 95 might be able to (not sure) compile Fortran 90.

推荐答案

Fortran 90 死了.它有严重的缺陷,特别是对于可分配的,由 Fortran 95 修复.例如,它允许存在未定义的分配状态.

Fortran 90 is dead. It had serious deficiencies, especially with allocatables, that were fixed by Fortran 95. For example, it allowed existence of undefined allocation ststus.

很多时候有人说他正在使用 Fortran 90,但实际上他正在使用其他东西.

Many times someone says he is using Fortran 90 he is in fact using something else.

Fortran 90 和 Fortran 95 非常接近,以至于在编译器中甚至没有启用 Fortran 90 的选项.它通常只会启用标准中的那些错误和疏忽,而只会禁用一些功能.

Fortran 90 and Fortran 95 are so close that there is even no option to enable Fortran 90 in compilers. It would mostly just enable those errors and oversights in the standard and disable just a few features.

Gfortran,在默认模式下 gnu 实际上接近于 Fortran 2003 或 2008 编译器.一些默认设置与 Fortran 90 和 95 不同.例如,分配时自动重新分配.但它通常适用于 Fortran 90 和 95 中的程序,甚至是 77 中的一些程序.它支持标准的某些常见扩展.可以通过特殊标志启用 Certsin 不太常见的扩展.

Gfortran, in the default mode gnu is actually close to a Fortran 2003 or 2008 compiler. Some of the default settings are different from Fortran 90 and 95. For example the automatic re-allocation on assignment. But it is normally good for programs in Fortran 90 and 95 and even some in 77. It enables certain common extensions to the standard. Certsin less common extensions can be enabled by special flags.

没有理由担心.Fortran 95 是人们应该关心的标准.Fortran 90 不是.

There is no reason to worry. Fortran 95 is the standard people should care about. Fortran 90 is not.

关于 .for 扩展名,如果它符合固定格式源,无论是 77、90、95、2008 等,编译器都应该正确处理.

Regarding the .for extension, the compiler should process correctly if it is conforming fixed form source, be it 77, 90, 95, 2008, whatever.

这篇关于如何将 gfortran 用于带有 .for 文件扩展名的 Fortran 90?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆