Fortranリファレンス
back
現在作成途中
1 Basic
77と90の違いを意識する場合
- *77のとき・・・行の右端は桁を空ける
- 90のとき・・・空けなくてよい
implicit宣言
2 入出力
準備中
3 file入出力
準備中
fortran90雛形
! コメントアウト
! program test(プログラム名をかく場合はこのように)
implicit double precision(a-h,j-m,o-z)
! common文は、変数をかく順番が大切
common x,y,z
external fun
open(1,file='data.dat')
x = 1.0
y = 0.0
do z = 1.0,100.0,1.0
x = x + 1.0
y = fun(z)
write(*,*) x,y,z
write(1,*) x,y,z
end do
close(1)
if(y.lt.10.0.and.y.gt.0.0) then
write(*,*) y
end if
end program
function fun(xxx)
implicit double precision(a-h,j-m,o-z)
common x,y,z
fun = x+y+z
return
end
back