0

我试图为土壤植物大气模型编译一个fortran程序,但我无法在Ubuntu下编译它,它一直给我这样的错误消息:

f77 -c -o o/cupin2.o  src/cupin2.f
src/cupin2.f: In subroutine `reflt':
src/cupin2.f:742: 
         dimension tairgl,eairgl,windgl,psisgl,hsoil,ecpy,hcpy
                         ^
Invalid form for DIMENSION statement at (^)
make: *** 
[o/cupin2.o] Error 1

谁能帮我这个。谢谢。完整的源代码在这里:源代码

4

2 回答 2

2

DIMENSION 语句用于对数组进行维数 - 因此您必须指定数组维数。例如:

dimension tairgl(100),eairgl(20,50), ...

您实际上并不需要 DIMENSION 语句,但是,您也可以这样说:

real tairgl(100)
integer eairgl(20,50)
于 2009-12-22T18:51:34.257 回答
1

您没有说这是您的编辑还是其他人编写了代码。DIMENSION 语句在: http ://en.wikipedia.org/wiki/Fortran_language_features 中进行了描述, 例如:

INTEGER, DIMENSION(0:100, -50:50) :: map

它期望它之后的数组边界。它相当过时并且通常被类型(例如 REAL 和数组边界)所取代。

If you have inherited the code (and if it's got a long history) it's possible it has some syntax which is now non-standard but still compiles on some machines. If you are actively editing the code you will need to learn some FORTRAN.

UPDATE from a previous question the OP appears to have deleted the array bounds from a syntactically correct dimension statement.

于 2009-12-22T18:58:29.470 回答