現在(&lastmod;)作成中です。
既に書いている内容も&color(#ff0000){大幅に変わる};可能性が高いので注意。

-------

神戸大学 大学院システム情報学研究科 計算科学専攻 陰山 聡

-------

-------
【目次】
#contents
-------

前回の宿題は、「thermal_diffusion.f90を理解しておくこと」であったので、
その中身がわかっているものと仮定して今回は話を進める。


* 2次元可視化 [#bf59a9bb]
今回は2次元データの可視化を行う。
前回と同様gnuplotを利用する。

gnuplotで2次元データをプロットする場合、そのデータのフォーマットは
 x00 y00 関数値
 x01 y00 関数値
 x02 y00 関数値
  ・
  ・
  ・
 x09 y00 関数値
 (空行)
 x00 y01 関数値
 x01 y01 関数値
 x02 y01 関数値
  ・
  ・
  ・
 x09 y01 関数値
 (空行)
  ・
  ・
  ・
 x09 y09 関数値
である。


* 2次元データ出力ルーチン [#y1cbe462]

thermal_diffusion.f90による2次元データ出力ルーチン
temperature__output_2d_profile
は、正方形上(x,y平面上)に分布する温度をすべて書き出すものである。
中身を見てみよう。

  subroutine temperature__output_2d_profile
    real(DP), dimension(0:MESH_SIZE+1,    &
                        0:MESH_SIZE+1) :: prof
    integer                            :: counter = 0   ! saved
    integer                            :: ierr          ! use for MPI
    integer                            :: jstart_, jend_
    character(len=4)                   :: serial_num    ! put on file name
    character(len=*), parameter        :: base = "../data/temp.2d."
    integer :: i, j
    call set_jstart_and_jend(jstart_,jend_)
    write(serial_num,'(i4.4)') counter
    prof(:,:) = parallel__set_prof_2d(jstart_,jend_,temp(:,jstart_:jend_))
    if ( myrank==0 ) then
       open(10,file=base//serial_num)
       do j = 0 , MESH_SIZE+1
          do i = 0 , MESH_SIZE+1
             write(10,*) i, j, prof(i,j)
          end do
          write(10,*)' ' ! gnuplot requires a blank line here.
       end do
       close(10)
    end if
    counter = counter + 1
  end subroutine temperature__output_2d_profile



*  &color(#0000ff){【演習】}; [#ibe877dc]
heat2_sendrecv_check.f90をmpif90コマンドでコンパイルし、



--


#ref()



* 宿題 [#g714ae01]

上記 thermal_diffusion.f90コードを理解しておくこと。(レポート提出必要なし。)


* 授業アンケート [#k7c29103]
今回の演習内容はどうでしたか?(どれか一つ、一度だけ押してください。)
#vote(簡単すぎた[0], 難しすぎた[0], ちょうどよかった[0])


* 質問、コメントなど自由にどうぞ [#ve482de9]

「お名前」欄は空欄で可。

#pcomment


------------------------------

as of &_now; (&counter;)