| 5 | 1/1 | 返回列表 |
| 查看: 1683 | 回復(fù): 5 | |||
| 當(dāng)前只顯示滿足指定條件的回帖,點(diǎn)擊這里查看本話題的所有回帖 | |||
wl6183725新蟲 (初入文壇)
|
[求助]
求大家?guī)蛶兔,有fortran的主程序和幾個(gè)模塊,如何讓他們運(yùn)行,急!!
|
||
|
最近在看老師編的程序,改程序有一個(gè)主程序和幾個(gè)模塊,但運(yùn)行主程序時(shí)總顯示有錯(cuò)誤,由于我之前從來都沒有接觸過fortran,但老師催的又很急,所以只好求大家?guī)兔Γ抑澜饚藕苌,不過還是請大家?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ā)表 | |
|---|---|---|---|---|
|
[考研] 281求調(diào)劑(0805) +3 | 煙汐憶海 2026-03-16 | 7/350 |
|
|---|---|---|---|---|
|
[考研] 277調(diào)劑 +5 | 自由煎餅果子 2026-03-16 | 6/300 |
|
|
[考研] 材料專碩306英一數(shù)二 +7 | z1z2z3879 2026-03-16 | 9/450 |
|
|
[考研] 311求調(diào)劑 +8 | 冬十三 2026-03-15 | 8/400 |
|
|
[考研] 085600材料與化工求調(diào)劑 +5 | 緒幸與子 2026-03-17 | 5/250 |
|
|
[考研] 材料與化工304求B區(qū)調(diào)劑 +7 | 邱gl 2026-03-11 | 8/400 |
|
|
[考研] 東南大學(xué)364求調(diào)劑 +5 | JasonYuiui 2026-03-15 | 5/250 |
|
|
[考研] 304求調(diào)劑 +4 | ahbd 2026-03-14 | 4/200 |
|
|
[考研] 318求調(diào)劑 +3 | Yanyali 2026-03-15 | 3/150 |
|
|
[考研] 一志愿華中師范071000,325求調(diào)劑 +6 | RuitingC 2026-03-12 | 6/300 |
|
|
[考研] 327求調(diào)劑 +6 | 拾光任染 2026-03-15 | 11/550 |
|
|
[考研] 0856專碩279求調(diào)劑 +5 | 加油加油!? 2026-03-15 | 5/250 |
|
|
[考研] 289求調(diào)劑 +4 | 這么名字咋樣 2026-03-14 | 6/300 |
|
|
[考研] 328求調(diào)劑 +3 | 5201314Lsy! 2026-03-13 | 6/300 |
|
|
[考研] 331求調(diào)劑(0703有機(jī)化學(xué) +5 | ZY-05 2026-03-13 | 6/300 |
|
|
[考研] 308 085701 四六級已過求調(diào)劑 +7 | 溫喬喬喬喬 2026-03-12 | 14/700 |
|
|
[考研] 266求調(diào)劑 +4 | 學(xué)員97LZgn 2026-03-13 | 4/200 |
|
|
[考研] 0703化學(xué)調(diào)劑 +4 | 快樂的香蕉 2026-03-11 | 4/200 |
|
|
[考研] 26調(diào)劑/材料/英一數(shù)二/總分289/已過A區(qū)線 +6 | 步川酷紫123 2026-03-13 | 6/300 |
|
|
[考研] 0703化學(xué)一志愿211 總分320求調(diào)劑 +5 | 瑪卡巴卡啊哈 2026-03-11 | 5/250 |
|