linux - Linux 上为 "Error Unclassifiable statement"

标签 linux compiler-errors fortran gfortran

在我的 Linux 集群中使用 gfortran 编译 .for 格式文件。

输入 gfortran -O2 calpuff.for -o calpuff.exe ,发生了一个错误:

Unclassifiable statement

错误
 In file calutils.for:2912
 Included at calpuff.for:2115
   cdeflt=ctext      
 Error: Unclassifiable statement at (1)   

相应的calutil.for显示如下:

c ----------------------------------------
c
      character*132 ctext,cdeflt
c
c --- Microsoft variables
c *** integer*2 iarg,istat
c
c --- HP declaration
c *** external getarg
c *** external iargc
c
c --- The following is for any system without a command line routine
c --- and is also used as a default
       cdeflt=ctext   ## Line 2912
c
c ---------------------------------------- 
c ----------------
## Another subroutine.
c --- Sun compiler
c ----------------
     numargs=IARGC()
     if(numargs.ge.1)then
     call GETARG(1,ctext)
     endif   



### Add another subroutine which are the only code related to `cdeflt`
c --- If no command line arguments, use default
  if(ctext(1:1).eq.' ')ctext=cdeflt   # Line 2954

  return
  end

更新

感谢@Alexander Vogt的提醒,下面的代码是calpuff.for

c----------------------------------------------------------------------
c --- BRING IN SUBROUTINES for MCHEM=6,7 OPTIONS (API)
      include 'api_chem.for'
      include 'isorropia.for'
c --- BRING IN CALPUFF SYSTEM UTILITY SUBROUTINES
      include 'calutils.for'   ### This is line 2115
      include 'coordlib.for'
c----------------------------------------------------------------------

cdeflt=ctext 有什么问题吗? ?有人可以给一些建议吗?

最佳答案

实际错误发生在后面的行中:

c ----------------
c --- Sun compiler
c ----------------
     numargs=IARGC()
     if(numargs.ge.1)then
     call GETARG(1,ctext)
     endif

那里只有五个空格,(至少)六个是必需的。应该是这样的:

c ----------------
c --- Sun compiler
c ----------------
      numargs=IARGC()
      if(numargs.ge.1)then
        call GETARG(1,ctext)
      endif

在固定形式的 Fortran 中,前六列具有特殊含义,不能用于代码。

不幸的是,这(再次)使您​​的问题与 SO 上的许多其他问题重复。

关于linux - Linux 上为 "Error Unclassifiable statement",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36246475/

相关文章:

linux - Bash 脚本 : CPU stress test while watching clock speed

android - Android “The specified child already has a parent.” fragment onCreateView()吗?

testing - 模拟脚本语言(PHP 和 JS)的编译时检查

arrays - Fortran 中的维度如何工作

linux - 如何使这个 AWK 命令不区分大小写?

linux - pentaho 无法通过 chrome 访问

c - 在 Centos 7 的 libgcrypt 中找不到宏

c++ - 具有多个模板参数错误的模板部分特化

string - 在Fortran中读取带空格的字符串

fortran - Fortran 中的纯子例程 - 编译器优化