初識fortran條件預處理

下面給出一個fortran條件預處理的程序
編譯器爲IVF

在linux上的程序命令與windows的有差別
比如linux: mv 1.txt 2.txt
windows: move 1.txt 2.txt

!DEC$ define linux
program test
        implicit none
!DEC$ if defined (linux)
        call system( 'mv ' // '1.txt 2.txt' )
!DEC$ else
        call system( 'move ' // '1.txt 2.txt' )
!DEC$ endif
end program test

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章