24小时热门版块排行榜    

CyRhmU.jpeg
查看: 1521  |  回复: 5
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

wl6183725

新虫 (初入文坛)

[求助] 求大家帮帮忙,有fortran的主程序和几个模块,如何让他们运行,急!!!

最近在看老师编的程序,改程序有一个主程序和几个模块,但运行主程序时总显示有错误,由于我之前从来都没有接触过fortran,但老师催的又很急,所以只好求大家帮忙,我知道金币很少,不过还是请大家帮帮忙,谢谢。
主程序开始部分如下:
program monte_main
use monte_define
use monte_io
use monte_sub
use monte_go
implicit none
显示的错误如下:
:\mycode\monte_main.f90(3): Could not find the file monte_io.mod.
E:\mycode\monte_main.f90(4): Could not find the file monte_sub.mod.
E:\mycode\monte_main.f90(5): Could not find the file monte_go.mod.
Compiling Fortran...
E:\mycode\monte_main.f90
E:\mycode\monte_main.f90(3) : Error: Error in opening the Library module file.   [MONTE_IO]
use monte_io
----^
E:\mycode\monte_main.f90(4) : Error: Error in opening the Library module file.   [MONTE_SUB]
use monte_sub
----^
E:\mycode\monte_main.f90(5) : Error: Error in opening the Library module file.   [MONTE_GO]
use monte_go
----^
Error executing df.exe.

monte_main.exe - 3 error(s), 0 warning(s)
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

fmying

银虫 (小有名气)

Windows下可否先编译成.o或者.obj之类的文件,然后再Link,而不是一步编译链接到位?
不清楚,只是提供一个想法而已。
上善若水
6楼2013-03-15 08:25:23
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 6 个回答

chembetsey

木虫 (小有名气)

【答案】应助回帖

感谢参与,应助指数 +1
你编译的时候要把主程序和模块放在一起才行啊
2楼2013-03-07 23:02:54
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

wl6183725

新虫 (初入文坛)

引用回帖:
2楼: Originally posted by chembetsey at 2013-03-07 23:02:54
你编译的时候要把主程序和模块放在一起才行啊

要把他们贴在一起吗
3楼2013-03-08 09:39:25
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

sxf2012

木虫 (正式写手)

【答案】应助回帖

感谢参与,应助指数 +1
省事儿的方法是:
把以下四个模块
monte_define
monte_io
monte_sub
monte_go
的内容拷贝到主程序里,放在“program monte_main”上方,然后编译链接
4楼2013-03-08 14:46:22
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
信息提示
请填处理意见