ifort行长度限制

时间:2014-11-17 14:50:35

标签: fortran intel-fortran

所以似乎有一些关于gfortran的线宽限制的问题,但没有一个关于ifort的问题。编译时我遇到以下问题:

../../../src/70_gw/gwls_lineqsolver.F90(298): error #5082: Syntax error, found IDENTIFIER 'ENDIF' when expecting one of: ( * ) :: , <END-OF-STATEMENT> ; + . - (/ [ : ] /) ' ** / // > ...
&"        endif
----------^
../../../src/70_gw/gwls_lineqsolver.F90(298): error #6404: This name does not have a type, and must have an explicit type.   [ENDIF]
&"        endif
----------^
../../../src/70_gw/gwls_lineqsolver.F90(297): warning #6043: This Hollerith or character constant is too long and cannot be used in the current numeric context.   ['=# of valence states).']
             write(std_out,*) "              subspace (the kernel contains state i=",min_index," > ",nbandv,"=# of valence states).&
------------------------------------------------------------------------------------------------------------^
../../../src/70_gw/gwls_lineqsolver.F90(290): error #6321: An unterminated block exists.
  if (singular .and. ( (project_on_what==1 .and. (min_index > nbandv)) .or. project_on_what==0 ))  then
^
compilation aborted for ../../../src/70_gw/gwls_lineqsolver.F90 (code 1)
make[3]: *** [gwls_lineqsolver.o] Error 1
make[3]: Leaving directory `/home/stud2/7.11.3-private/build/src/70_gw'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/stud2/7.11.3-private/build/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/stud2/7.11.3-private/build'
make: *** [all] Error 2

触发错误的实际代码如下:

if (project_on_what==1 .and. (min_index > nbandv)) then
             write(std_out,*) " "
             write(std_out,*) "              There is a projection on the conduction states, but A is singular in this "
             write(std_out,*) "              subspace (the kernel contains state i=",min_index," > ",nbandv,"=# of valence states)."
end if

我没有gfortran编译器来测试它,但我相信我得到这个是因为行长度限制。 ifort中是否有一个标志来删除此限制?

1 个答案:

答案 0 :(得分:7)

错误可能是由ifort 11.x(Source)中的错误引起的:

  

从11.x版本开始,英特尔Fortran编译器无法正确忽略以.F90扩展名命名的自由格式源文件的-extend-source(和其他变体)。对于以小写.f90扩展名命名的源文件,该选项被正确忽略。

     

对选项的错误处理将导致任何超出使用-extend-source选项指定的指定语句字段长度的Fortran源语句出现错误的语法错误。

通过将文件扩展名更改为.f90并添加标志-fpp以便维护预处理,可以轻松避免错误。