"错误无法分类的陈述"在Linux上

时间:2016-03-27 10:47:17

标签: linux compiler-errors fortran gfortran

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

输入gfortran -O2 calpuff.for -o calpuff.exe,碰巧有一个错误

  

不可分类的陈述

错误
 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有什么问题?有人可以提一些建议吗?

1 个答案:

答案 0 :(得分:1)

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

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上的众多其他人重复。

相关问题