Fortran Coder

标题: initialization-expr is missing; an initialization expression错误 [打印本页]

作者: muzili2008    时间: 2015-5-29 19:16
标题: initialization-expr is missing; an initialization expression错误
大家好,我在运行程序时候,发生如下错误:
错误 1  error #6557: An =initialization-expr is missing; an initialization expression is required when using the PARAMETER attribute.   [NO_CARBON] D:\Fortran\ABCs\Project_Components\Project_Components\main.f 3
错误 2  error #6557: An =initialization-expr is missing; an initialization expression is required when using the PARAMETER attribute.   [NO_TEMP] D:\Fortran\ABCs\Project_Components\Project_Components\main.f 3
错误 3  error #6557: An =initialization-expr is missing; an initialization expression is required when using the PARAMETER attribute.   [NO_CARBON_0] D:\Fortran\ABCs\Project_Components\Project_Components\main.f 3
错误 4  error #6219: A specification expression object must be a dummy argument, a COMMON block object, or an object accessible through host or use association   [NO_CARBON] D:\Fortran\ABCs\Project_Components\Project_Components\main.f 3
错误 5  error #6219: A specification expression object must be a dummy argument, a COMMON block object, or an object accessible through host or use association   [NO_TEMP] D:\Fortran\ABCs\Project_Components\Project_Components\main.f 3
错误 6  error #6591: An automatic object is invalid in a main program.   [VAR_PL] D:\Fortran\ABCs\Project_Components\Project_Components\main.f 4
错误 7  error #6591: An automatic object is invalid in a main program.   [VAR_TEMP] D:\Fortran\ABCs\Project_Components\Project_Components\main.f 6
错误 8 Compilation Aborted (code 1) D:\Fortran\ABCs\Project_Components\Project_Components\main.f 1


应该如何修改呢?


作者: 楚香饭    时间: 2015-5-29 19:24
给出代码,至少错误行给出来
作者: muzili2008    时间: 2015-5-29 19:28
本帖最后由 muzili2008 于 2015-5-29 19:56 编辑
楚香饭 发表于 2015-5-29 19:24
给出代码,至少错误行给出来

谢谢
[Fortran] 纯文本查看 复制代码

program main
      implicit none
      integer,parameter:: no_carbon,no_temp,no_carbon_0
      real*8  var_pl(no_carbon,no_temp)
      real*8  temp_max,temp_min
      real*8  var_temp(no_temp)
      
      integer i,j
      
      no_carbon = 150
      no_temp   =  30
      no_carbon_0   =  30
      
      end do

作者: fcode    时间: 2015-5-29 19:38
integer,parameter:: no_carbon,no_temp,no_carbon_0
parameter 需要给出值
作者: muzili2008    时间: 2015-5-29 19:40
fcode 发表于 2015-5-29 19:38
integer,parameter:: no_carbon,no_temp,no_carbon_0
parameter 需要给出值

谢谢  谢谢 。。。






欢迎光临 Fortran Coder (http://bbs.fcode.cn/) Powered by Discuz! X3.2