Class | gridset |
In: |
setup/gridset.f90
|
引数に与えられた NAMELIST ファイルから, 格子点情報を取得し, 保管するための変数型モジュール
Subroutine : | |
cfgfile : | character(STRING), intent(in) |
NAMELIST から情報を得て, 格子点を計算する
This procedure input/output NAMELIST#gridset_nml .
subroutine gridset_init(cfgfile) ! !NAMELIST から情報を得て, 格子点を計算する ! !暗黙の型宣言禁止 implicit none !モジュール読み込み !入力変数 character(STRING), intent(in) :: cfgfile !内部変数 integer :: unit !----------------------------------------------------------------- ! NAMELIST から情報を取得 ! NAMELIST /gridset_nml/ NX, NY, NZ, NCMAX, Xmg, Ymg, Zmg call FileOpen(unit, file=cfgfile, mode='r') read(unit, NML=gridset_nml) close(unit) if ( NX < xmg ) then call MessageNotify( "E", "gridset_init", "NX < Xmg" ) end if if ( NY < ymg ) then call MessageNotify( "E", "gridset_init", "NY < Ymg" ) end if if ( NZ < zmg ) then call MessageNotify( "E", "gridset_init", "NZ < Zmg" ) end if !----------------------------------------------------------------- ! 配列の上限・下限を決める ! imin = 1 - xmg imax = nx + xmg jmin = 1 - ymg jmax = ny + ymg kmin = 1 - zmg kmax = nz + zmg !----------------------------------------------------------------- ! 確認 ! if (myrank == 0) then call MessageNotify( "M", "gridset_init", "NX = %d", i=(/NX/) ) call MessageNotify( "M", "gridset_init", "NY = %d", i=(/NY/) ) call MessageNotify( "M", "gridset_init", "NZ = %d", i=(/NZ/) ) call MessageNotify( "M", "gridset_init", "NCMAX = %d", i=(/NCMAX/) ) call MessageNotify( "M", "gridset_init", "xmg = %d", i=(/Xmg/) ) call MessageNotify( "M", "gridset_init", "ymg = %d", i=(/Ymg/) ) call MessageNotify( "M", "gridset_init", "zmg = %d", i=(/Zmg/) ) call MessageNotify( "M", "gridset_init", "imin = %d", i=(/imin/) ) call MessageNotify( "M", "gridset_init", "imax = %d", i=(/imax/) ) call MessageNotify( "M", "gridset_init", "jmin = %d", i=(/jmin/) ) call MessageNotify( "M", "gridset_init", "jmax = %d", i=(/jmax/) ) call MessageNotify( "M", "gridset_init", "kmin = %d", i=(/kmin/) ) call MessageNotify( "M", "gridset_init", "kmax = %d", i=(/kmax/) ) end if end subroutine gridset_init