Fortran编译错误
我尝试为土壤-植物-大气模型编译一个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
谁能帮我解决这个问题。谢谢。 完整的源代码在这里:源代码
I tried to compile a fortran program for soil-plant-atmosphere model, but I can't compile it under Ubuntu, it keeps giving me the error message like this:
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
Can anyone help me with this. Thanks.
Complete source code is here:Source Code
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
DIMENSION 语句用于确定数组的维度 - 因此您必须指定数组的维度。例如:
您实际上不需要 DIMENSION 语句,但是,您也可以这样说:
The DIMENSION statement is used to dimension arrays - so you have to specify the array dimensions. For example:
You don't actually need the DIMENSION statement, however, you could also say something like:
您没有说明这是否是您的编辑或是否是其他人编写的代码。 DIMENSION 语句的描述如下:
http://en.wikipedia.org/wiki/Fortran_language_features
例如:
它期望后面有数组边界。它相当过时,通常由类型(例如 REAL 和数组边界)代替。
如果您继承了该代码(并且如果它有很长的历史),则它可能有一些现在不是标准的语法,但仍然可以在某些机器上编译。如果您正在积极编辑代码,您将需要学习一些 FORTRAN。
更新从上一个问题OP似乎已经从语法正确的维度语句中删除了数组边界。
You don't say whether this is your edit or whether someone else has written the code. The DIMENSION statement is described in:
http://en.wikipedia.org/wiki/Fortran_language_features
for example:
It expects array bounds after it. It's rather outdated and normally replaced by the type (e.g. REAL and the array bounds).
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.