| 5 | 1/1 | 返回列表 |
| 查看: 1680 | 回復(fù): 5 | ||
| 當(dāng)前只顯示滿足指定條件的回帖,點(diǎn)擊這里查看本話題的所有回帖 | ||
wl6183725新蟲 (初入文壇)
|
[求助]
求大家?guī)蛶兔Γ衒ortran的主程序和幾個(gè)模塊,如何讓他們運(yùn)行,急!。
|
|
|
最近在看老師編的程序,改程序有一個(gè)主程序和幾個(gè)模塊,但運(yùn)行主程序時(shí)總顯示有錯(cuò)誤,由于我之前從來都沒有接觸過fortran,但老師催的又很急,所以只好求大家?guī)兔Γ抑澜饚藕苌,不過還是請(qǐng)大家?guī)蛶兔,謝謝。 主程序開始部分如下: program monte_main use monte_define use monte_io use monte_sub use monte_go implicit none 顯示的錯(cuò)誤如下: :\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) |
新蟲 (初入文壇)
木蟲 (小有名氣)
木蟲 (正式寫手)
|
假設(shè): 1 你在Linux下編譯運(yùn)行程序(Windows下我不了解) 2 你的module都是存放在獨(dú)立文件中的,比如module.f90。主程序的文件為program.f90 這樣,你可以使用如下方法(以gfortran編譯器為例,ifort一樣的) gfortran -c module.f90 gfortran -o program program.f90 module.o 第一步會(huì)產(chǎn)生module.o文件和一堆.mod文件。.mod文件名就是你放在module.f90中的module名字 第二步就是產(chǎn)生程序了。這里需要用的并不是.mod文件,而是module.o文件。 當(dāng)然,你也可以先用 gfortran -c program.f90 產(chǎn)生program.o,然后 gfortran -o program program.o module.o 一樣的。 |

| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 0703化學(xué)336分求調(diào)劑 +4 | zbzihdhd 2026-03-15 | 5/250 |
|
|---|---|---|---|---|
|
[考研] 301求調(diào)劑 +4 | A_JiXing 2026-03-16 | 4/200 |
|
|
[考研] 085601求調(diào)劑 +4 | Du.11 2026-03-16 | 4/200 |
|
|
[考研] 本人考085602 化學(xué)工程 專碩 +16 | 不知道叫什么! 2026-03-15 | 18/900 |
|
|
[考研] 303求調(diào)劑 +3 | 睿08 2026-03-17 | 3/150 |
|
|
[考研] 一志愿蘇州大學(xué)材料工程(085601)專碩有科研經(jīng)歷三項(xiàng)國獎(jiǎng)兩個(gè)實(shí)用型專利一項(xiàng)省級(jí)立項(xiàng) +6 | 大火山小火山 2026-03-16 | 8/400 |
|
|
[考研] 08工科 320總分 求調(diào)劑 +4 | 梨花珞晚風(fēng) 2026-03-17 | 4/200 |
|
|
[考研] 211本,11408一志愿中科院277分,曾在中科院自動(dòng)化所實(shí)習(xí) +6 | Losir 2026-03-12 | 7/350 |
|
|
[考研] 283求調(diào)劑 +3 | 聽風(fēng)就是雨; 2026-03-16 | 3/150 |
|
|
[考研]
|
zhouzhen654 2026-03-16 | 3/150 |
|
|
[考研] 333求調(diào)劑 +3 | 文思客 2026-03-16 | 7/350 |
|
|
[考研] 環(huán)境工程調(diào)劑 +6 | 大可digkids 2026-03-16 | 6/300 |
|
|
[基金申請(qǐng)]
今年的國基金是打分制嗎?
50+3
|
zhanghaozhu 2026-03-14 | 3/150 |
|
|
[考研] 321求調(diào)劑 +5 | 大米飯! 2026-03-15 | 5/250 |
|
|
[考研] 一志愿哈工大材料324分求調(diào)劑 +5 | 閆旭東 2026-03-14 | 5/250 |
|
|
[考研] 336求調(diào)劑 +6 | Iuruoh 2026-03-11 | 6/300 |
|
|
[考研] 求材料調(diào)劑 +5 | 隔壁陳先生 2026-03-12 | 5/250 |
|
|
[考研] 315求調(diào)劑 +9 | 小羊小羊_ 2026-03-11 | 10/500 |
|
|
[考研] 085600材料與化工 309分請(qǐng)求調(diào)劑 +7 | dtdxzxx 2026-03-12 | 8/400 |
|
|
[考研] 0817化學(xué)工程與技術(shù)考研312分調(diào)劑 +3 | T123 tt 2026-03-12 | 3/150 |
|