gpt4 book ai didi

fortran - ifort 行长度限制

转载 作者:行者123 更新时间:2023-12-05 01:22:46 30 4
gpt4 key购买 nike

所以似乎有一些关于 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 中是否有标志可以取消此限制?

最佳答案

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

Beginning with the 11.x release, the Intel Fortran compiler does not correctly ignore the -extend-source (and other variants) for free-form source files named with the .F90 extension. The option is correctly ignored for source files named with the lower-case .f90 extension.

The mishandling of the option will cause erroneous syntax errors for any Fortran source statement that extends beyond the designated statement field length specified with the -extend-source option.

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

关于fortran - ifort 行长度限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26975314/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com