| 6 | 1/1 | 返回列表 |
| 查看: 1679 | 回復(fù): 5 | |||
wl6183725新蟲 (初入文壇)
|
[求助]
求大家?guī)蛶兔Γ衒ortran的主程序和幾個(gè)模塊,如何讓他們運(yùn)行,急。!
|
|
最近在看老師編的程序,改程序有一個(gè)主程序和幾個(gè)模塊,但運(yùn)行主程序時(shí)總顯示有錯(cuò)誤,由于我之前從來都沒有接觸過fortran,但老師催的又很急,所以只好求大家?guī)兔,我知道金幣很少,不過還是請(qǐng)大家?guī)蛶兔Γx謝。 主程序開始部分如下: 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 一樣的。 |


| 6 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 296求調(diào)劑 +4 | 大口吃飯 身體健 2026-03-13 | 4/200 |
|
|---|---|---|---|---|
|
[碩博家園] 湖北工業(yè)大學(xué) 生命科學(xué)與健康學(xué)院-課題組招收2026級(jí)食品/生物方向碩士 +3 | 1喜春8 2026-03-17 | 5/250 |
|
|
[考研] 341求調(diào)劑 +5 | 搗蛋豬豬 2026-03-11 | 6/300 |
|
|
[考研] 308求調(diào)劑 +4 | 是Lupa啊 2026-03-16 | 4/200 |
|
|
[考研] 化學(xué)工程321分求調(diào)劑 +11 | 大米飯! 2026-03-15 | 14/700 |
|
|
[考研] 材料專碩326求調(diào)劑 +6 | 墨煜姒莘 2026-03-15 | 7/350 |
|
|
[考研] 290求調(diào)劑 +3 | p asserby. 2026-03-15 | 4/200 |
|
|
[考研] 289求調(diào)劑 +6 | 步川酷紫123 2026-03-11 | 6/300 |
|
|
[考研] 材料與化工304求B區(qū)調(diào)劑 +7 | 邱gl 2026-03-11 | 8/400 |
|
|
[論文投稿] 有沒有大佬發(fā)小論文能帶我個(gè)二作 +3 | 增銳漏人 2026-03-17 | 4/200 |
|
|
[基金申請(qǐng)]
今年的國基金是打分制嗎?
50+3
|
zhanghaozhu 2026-03-14 | 3/150 |
|
|
[考研] 一志愿211 0703方向310分求調(diào)劑 +3 | 努力奮斗112 2026-03-15 | 3/150 |
|
|
[考研] 277材料科學(xué)與工程080500求調(diào)劑 +3 | 自由煎餅果子 2026-03-16 | 3/150 |
|
|
[考研] 學(xué)碩285求調(diào)劑 +13 | Wisjxn 2026-03-12 | 46/2300 |
|
|
[考研] 招收0805(材料)調(diào)劑 +3 | 18595523086 2026-03-13 | 3/150 |
|
|
[考研] 341求調(diào)劑 +4 | 番茄頭--- 2026-03-10 | 4/200 |
|
|
[考研] 一志愿西南交大,材料專碩317求調(diào)劑 +5 | lx8568 2026-03-11 | 5/250 |
|
|
[考研] 295求調(diào)劑 +3 | 小匕仔汁 2026-03-12 | 3/150 |
|
|
[考研] 328化工專碩求調(diào)劑 +4 | 。,。,。,。i 2026-03-12 | 4/200 |
|
|
[考研] 270求調(diào)劑 085600材料與化工專碩 +3 | YXCT 2026-03-11 | 3/150 |
|