【发布时间】:2016-03-27 10:47:16
【问题描述】:
在我的 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 有什么问题?谁能给点建议?
【问题讨论】:
-
好的。我马上上传!
-
感谢您的耐心等待。我在
calutil.for的第 2912 行之后添加了更多代码。更重要的是,我将整个文件上传到Code。 -
更多背景故事:代码文件可以编译成
calpuff.exe用于空气质量建模。我曾尝试修改calutil.for中的一些子例程以更改编译器。原来是Lahel compiler用于Windows。我想改成gfortran。
标签: linux compiler-errors fortran gfortran