首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Fortran错误#5082:语法错误,查找标识符时期待:<结束-语句>;

Fortran错误#5082:语法错误,查找标识符时期待:<结束-语句>;
EN

Stack Overflow用户
提问于 2018-04-14 14:10:07
回答 1查看 5.3K关注 0票数 0

我在“做”一个密码。

使用make进行的编译无法产生此错误

代码语言:javascript
复制
mpif90 -mkl -O3 -no-prec-div -fpp -openmp -xHost -DMPI -DEFTCOSMOMC -module ReleaseEFTMPI -IReleaseEFTMPI/ -c equations_EFT.f90 -o ReleaseEFTMPI/equations_EFT.o
equations_EFT.f90(267): error #5082: Syntax error, found IDENTIFIER 'EFTCAMBINITIALCONDITIONS' when expecting one of: <END-OF-STATEMENT> ;
        module subroutine EFTCAMBInitialConditions( y, EV, tau )
--------------------------^
equations_EFT.f90(267): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( % [ . = =>
        module subroutine EFTCAMBInitialConditions( y, EV, tau )
----------------------------------------------------------------^
equations_EFT.f90(271): error #6786: This is an invalid statement; an END [MODULE] statement is required.
        end subroutine EFTCAMBInitialConditions
--------^
equations_EFT.f90(271): error #6758: This name is invalid; if a name is present, it must match the corresponding interface body name.   [EFTCAMBINITIALCONDITIONS]
        end subroutine EFTCAMBInitialConditions
-----------------------^
equations_EFT.f90(268): error #6457: This derived type name has not been declared.   [EVOLUTIONVARS]
            type(EvolutionVars) EV
-----------------^
equations_EFT.f90(269): error #6683: A kind type parameter must be a compile-time constant.   [DL]
            real(dl) :: y(EV%nvar)
-----------------^
equations_EFT.f90(269): error #6535: This variable or component must be of a derived or structure type   [EV]
            real(dl) :: y(EV%nvar)
--------------------------^
equations_EFT.f90(269): error #6460: This is not a field name that is defined in the encompassing structure.   [NVAR]
            real(dl) :: y(EV%nvar)
-----------------------------^
equations_EFT.f90(269): error #6223: A specification expression is invalid.   [NVAR]
            real(dl) :: y(EV%nvar)
-----------------------------^
equations_EFT.f90(270): error #6683: A kind type parameter must be a compile-time constant.   [DL]
            real(dl) :: tau
-----------------^
equations_EFT.f90(269): error #6279: A specification expression object must be a dummy argument, a COMMON block object, or an object accessible through host or use association   [EV]
            real(dl) :: y(EV%nvar)
--------------------------^
compilation aborted for equations_EFT.f90 (code 1)

我附上了来自equations_EFT.f90的片段

代码语言:javascript
复制
interface

        module subroutine EFTCAMBInitialConditions( y, EV, tau )
            type(EvolutionVars) EV
            real(dl) :: y(EV%nvar)
            real(dl) :: tau
        end subroutine EFTCAMBInitialConditions

    end interface

这段片段有什么问题吗?这很奇怪,因为这是分布式软件,但我实际上只是按照指令来编写代码。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-04-14 14:50:05

这个问题的代码是一个使用https://stackoverflow.com/q/22825841/3157076的例子,这是2008年修订版中新引入Fortran的一个特性。要编译这段代码,您需要一个理解这个概念的编译器。

GNU和Intel编译器就是这样的例子,但是您需要一个适当的版本。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49832316

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档