我想写个能读取数据的小程序,因为数据量多,首先定义几个一维数组,这个一维数组的维数为10000,程序前几行如下,但老是提示对整形变量定义加赋值语句有错误,还请指导一下。
1. 如果这样写程序:
PROGRAM RATIO
INTEGER(NUM=100)
REAL UOC(NUM),ISC(NUM),RS(NUM)
REAL RSH(NUM),FF(NUM),NCELL(NUM)
错误提示:
D:\Analysis\analysis.f90(3) : Error: Syntax error, found END-OF-STATEMENT when expecting one of: :: %FILL , TYPE COMPLEX BYTE CHARACTER DOUBLE DOUBLECOMPLEX DOUBLEPRECISION ...
INTEGER(NUM=100)
----------------^
Error executing df.exe.
2. 如果这样写程序:
PROGRAM RATIO
INTEGER:: NUM=10000
REAL UOC(NUM),ISC(NUM),RS(NUM)
REAL RSH(NUM),FF(NUM),NCELL(NUM)
错误提示:
D:\Analysis\analysis.f90(3) : Error: This object is not a valid DATA statement object. [NUM]
INTEGER:: NUM=10000
----------^
D:\Analysis\analysis.f90(3) : Error: A specification expression object must be a dummy argument, a COMMON block object, or an object accessible through host or use association [NUM]
INTEGER:: NUM=10000
----------^
D:\Analysis\analysis.f90(4) : Error: An automatic object is invalid in a main program. [UOC]
REAL UOC(NUM),ISC(NUM),RS(NUM)
-----^
D:\Analysis\analysis.f90(4) : Error: An automatic object is invalid in a main program. [ISC]
REAL UOC(NUM),ISC(NUM),RS(NUM)
--------------^
D:\Analysis\analysis.f90(4) : Error: An automatic object is invalid in a main program. [RS]
REAL UOC(NUM),ISC(NUM),RS(NUM)
-----------------------^
D:\Analysis\analysis.f90(5) : Error: An automatic object is invalid in a main program. [RSH]
REAL RSH(NUM),FF(NUM),NCELL(NUM)
-----^
D:\Analysis\analysis.f90(5) : Error: An automatic object is invalid in a main program. [FF]
REAL RSH(NUM),FF(NUM),NCELL(NUM)
--------------^
D:\Analysis\analysis.f90(5) : Error: An automatic object is invalid in a main program. [NCELL]
REAL RSH(NUM),FF(NUM),NCELL(NUM)
----------------------^
Error executing df.exe.
analysis.obj - 8 error(s), 0 warning(s)
我认为以上两种定义变量的同时赋值语句应该没错啊,求解!!
谢谢 |