"d"为第一栏中的标签Fortran 77

编程入门 行业动态 更新时间:2024-10-27 07:29:23
本文介绍了"d"为第一栏中的标签Fortran 77的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在从用Fortran 77编写的模型中修改代码,但是我遇到了一件奇怪的事情.在某些文件中,一行的第一列中有一个标签"d",如下例所示:

I am modifying a code from a model written in Fortran 77, but I have come across an odd thing to me. In some files, there is a label "d" in the first column of a line, like the example below:

d real*8 co2rootfix,co2rootloss,co2shootfix d character komma*1 d open(unit=87,file='crop_CO2.csv',status='unknown') d write(87,*) 'date,co2rootfix,co2rootloss,co2shootfix' d open(unit=88,file='crop_dm.csv',status='unknown') d write(88,*) 'date,wrtpot,wrt,wstpot,wst,rdpot,rd,laipot,lai, d &gwrt,gwst,drrt,drlv,drst'

奇怪的是,它已被Intel的ifort编译器成功编译.但是,gfortran在逻辑上返回以下错误:

The weird thing is that it is successfully compiled by Intel's ifort compiler. However, gfortran logically returns the following error:

错误:语句标签(1)处的非数字字符

Error: Non-numeric character in statement label at (1)

我想知道:

  • 该标签的含义;
  • 为什么只能被ifort和识别?
  • 我如何使其与gfortran一起使用.
  • 推荐答案

    在ifort文档中,有选项-d-lines和-nod-lines:

    From the ifort documentation there are the options -d-lines and -nod-lines:

    此选项编译调试语句.它指定在固定格式文件中的第1列(调试语句)中包含D的行应视为源代码.

    This option compiles debug statements. It specifies that lines in fixed-format files that contain a D in column 1 (debug statements) should be treated as source code.

    因此,如果代码是在没有-d-lines(或默认为-nod-lines)的情况下编译的,则第一栏中带有d的行将被视为注释并被忽略.

    So, if the code is compiled without -d-lines (or with -nod-lines which is the default) then those lines with d in the first column in treated as comments and ignored.

    在gfortran中,-fd-lines-as-code和-fd-lines-as-comments具有相同的效果.此处的区别在于,ifort作为扩展名,不考虑标志而接受代码(如上所述,它具有隐式的-nod-lines). gfortran要求确切指定其中一个标志以接受代码.

    In gfortran -fd-lines-as-code and -fd-lines-as-comments have the same effect. The difference here is that ifort, as an extension, accepts the code regardless of flags (as above, it has the implicit -nod-lines). gfortran requires exactly one of the flags to be specified to accept the code.

    更多推荐

    "d"为第一栏中的标签Fortran 77

    本文发布于:2023-10-14 19:07:13,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1491944.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:栏中   标签   quot   Fortran

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!