2008-11-14

fortran coding tips

データの書き出し

  if(it==0) then
  open(888,file='check_Rmag.dat',status="replace",position="rewind")
    write(888,"(1x,' it time cb(2)x cb(2)y cb(2)z piv(2)x piv(2)y piv(2)z cgRw2piv_x cgRw2piv_y cgRw2piv_z Rmag')")
  else
    open(888,file='check_Rmag.dat',status="old",position="append")
  endif
  write(888,"(i7,1x,11(f10.4,1x))") it, time, cb(2,1:xyz), pivot(2,1:xyz), cg_Rwing2pivot(1:xyz), r_mag(2)
  close(888)

No comments: