Fortran Coder

查看: 18831|回复: 4
打印 上一主题 下一主题

[求助] initialization-expr is missing; an initialization expression错误

[复制链接]

23

帖子

9

主题

0

精华

熟手

F 币
124 元
贡献
79 点
跳转到指定楼层
楼主
发表于 2015-5-29 19:16:45 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
大家好,我在运行程序时候,发生如下错误:
错误 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


应该如何修改呢?

分享到:  微信微信
收藏收藏 点赞点赞 点踩点踩

712

帖子

4

主题

0

精华

大师

农村外出务工人员

F 币
607 元
贡献
311 点

新人勋章爱心勋章水王勋章元老勋章热心勋章

沙发
发表于 2015-5-29 19:24:26 | 只看该作者
给出代码,至少错误行给出来

23

帖子

9

主题

0

精华

熟手

F 币
124 元
贡献
79 点
板凳
 楼主| 发表于 2015-5-29 19:28:33 | 只看该作者
本帖最后由 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

1963

帖子

12

主题

5

精华

论坛跑堂

臭石头雪球

F 币
1357 元
贡献
574 点

美女勋章热心勋章星光勋章新人勋章贡献勋章管理勋章帅哥勋章爱心勋章规矩勋章元老勋章水王勋章

地板
发表于 2015-5-29 19:38:06 | 只看该作者
integer,parameter:: no_carbon,no_temp,no_carbon_0
parameter 需要给出值

23

帖子

9

主题

0

精华

熟手

F 币
124 元
贡献
79 点
5#
 楼主| 发表于 2015-5-29 19:40:55 | 只看该作者
fcode 发表于 2015-5-29 19:38
integer,parameter:: no_carbon,no_temp,no_carbon_0
parameter 需要给出值

谢谢  谢谢 。。。

您需要登录后才可以回帖 登录 | 极速注册

本版积分规则

捐赠本站|Archiver|关于我们 About Us|小黑屋|Fcode ( 京ICP备18005632-2号 )

GMT+8, 2024-5-4 06:48

Powered by Tencent X3.4

© 2013-2024 Tencent

快速回复 返回顶部 返回列表