歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> Fortran中Windows與Linux中結果不一樣

Fortran中Windows與Linux中結果不一樣

日期:2017/3/1 10:07:09   编辑:Linux編程

做一個c轉fortran的程序,在windows下編譯的,能跑出結果,沒想到在lunix中跑出來的結果是錯的。找了好久,原以為全局變量的原因,沒想到是do while中初值的問題。integer nnew我在wndows上沒設初值,但是運行的正確,在lunix中不知道設的是初值是什麼。同時,fortran中do while和c中的運行還不一樣,反正自己弄通了,具體的原因就不知道了,希望大家不要犯同樣的錯誤。

do while (nnew > 0)
nnew = 0
do inew=1,ncur,1
xcn = nmatx(inew)
ycn = nmaty(inew)
zcn = nmatz(inew)

Copyright © Linux教程網 All Rights Reserved