错误:(1)的READ语句中的预期变量 [英] Error: Expected variable in READ statement at (1)

查看:68
本文介绍了错误:(1)的READ语句中的预期变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在fortran中有一个代码,例如:

I've a code in fortran like:

READ( INPUT, 1020 ) ( WK( A + I ), I = 1, NNZA )

其中:

INPUT = 55 (integer)
WK= some data (real)
A and NNZA = some data (integer)
1020 FORMAT( ( 1P, 4D16.8 ) ).

但是当我尝试使用gfortran-4.6进行编译时,会收到错误消息:

But when I try to compile it with gfortran-4.6 I receive an error:

READ( INPUT, 1020 ) ( WK( A + I ), I = 1, NNZA )
                   1
Error: Expected variable in READ statement at (1)

有人对错误有任何建议吗?谢谢!

Does anybody have some suggestion about error? Thanks!

推荐答案

我认为您的错误是格式声明中的错误,如

I think your error is in the format statement as in

1020 FORMAT( ( 1P, 4D16.8 ) ).

这不应该只是

1020 FORMAT( ( 1P, 4D16.8 ) )

没有最后的."吗?如果删除它,它将编译.

Without the final "."? If I remove it, it compiles.

这篇关于错误:(1)的READ语句中的预期变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆