| 6 | 1/1 | 返回列表 |
| 查看: 1681 | 回復(fù): 5 | ||
wl6183725新蟲 (初入文壇)
|
[求助]
求大家?guī)蛶兔,有fortran的主程序和幾個模塊,如何讓他們運行,急!。
|
|
最近在看老師編的程序,改程序有一個主程序和幾個模塊,但運行主程序時總顯示有錯誤,由于我之前從來都沒有接觸過fortran,但老師催的又很急,所以只好求大家?guī)兔,我知道金幣很少,不過還是請大家?guī)蛶兔,謝謝。 主程序開始部分如下: 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) |
木蟲 (小有名氣)
新蟲 (初入文壇)
木蟲 (正式寫手)
|
假設(shè): 1 你在Linux下編譯運行程序(Windows下我不了解) 2 你的module都是存放在獨立文件中的,比如module.f90。主程序的文件為program.f90 這樣,你可以使用如下方法(以gfortran編譯器為例,ifort一樣的) gfortran -c module.f90 gfortran -o program program.f90 module.o 第一步會產(chǎn)生module.o文件和一堆.mod文件。.mod文件名就是你放在module.f90中的module名字 第二步就是產(chǎn)生程序了。這里需要用的并不是.mod文件,而是module.o文件。 當然,你也可以先用 gfortran -c program.f90 產(chǎn)生program.o,然后 gfortran -o program program.o module.o 一樣的。 |


| 6 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 考研化學學碩調(diào)劑,一志愿985 +4 | 張vvvv 2026-03-15 | 6/300 |
|
|---|---|---|---|---|
|
[考研] 化學工程321分求調(diào)劑 +11 | 大米飯! 2026-03-15 | 14/700 |
|
|
[考研] 085600材料與化工求調(diào)劑 +5 | 緒幸與子 2026-03-17 | 5/250 |
|
|
[考研] 材料與化工304求B區(qū)調(diào)劑 +7 | 邱gl 2026-03-11 | 8/400 |
|
|
[考研] 267一志愿南京工業(yè)大學0817化工求調(diào)劑 +6 | SUICHILD 2026-03-12 | 6/300 |
|
|
[考研] 0854控制工程 359求調(diào)劑 可跨專業(yè) +3 | 626776879 2026-03-14 | 9/450 |
|
|
[考研] 318求調(diào)劑 +3 | Yanyali 2026-03-15 | 3/150 |
|
|
[考研] 材料與化工一志愿南昌大學327求調(diào)劑推薦 +7 | Ncdx123456 2026-03-13 | 8/400 |
|
|
[考研] 26考研一志愿中國石油大學(華東)305分求調(diào)劑 +3 | 嘉年新程 2026-03-15 | 3/150 |
|
|
[考研] 070305求調(diào)劑 +3 | mlpqaz03 2026-03-14 | 4/200 |
|
|
[考研] 085601材料工程315分求調(diào)劑 +3 | yang_0104 2026-03-15 | 3/150 |
|
|
[考研] 279求調(diào)劑 +3 | 抓著星星的女孩 2026-03-10 | 3/150 |
|
|
[考研] 材料專碩288分求調(diào)劑 一志愿211 +4 | 在家想你 2026-03-11 | 4/200 |
|
|
[考研] 315求調(diào)劑 +9 | 小羊小羊_ 2026-03-11 | 10/500 |
|
|
[考研] 301求調(diào)劑 +6 | Liyouyumairs 2026-03-11 | 6/300 |
|
|
[考研] 材料工程調(diào)劑 +4 | 咪咪空空 2026-03-11 | 4/200 |
|
|
[考研] 工科材料085601 279求調(diào)劑 +8 | 困于星晨 2026-03-12 | 10/500 |
|
|
[考研] 290求調(diào)劑 +7 | ADT 2026-03-12 | 7/350 |
|
|
[考研] 求調(diào)劑 +3 | 程雨杭 2026-03-12 | 3/150 |
|
|
[論文投稿]
投稿問題
5+4
|
星光燦爛xt 2026-03-12 | 6/300 |
|