Class gridset
In: setup/gridset.f90

引数に与えられた NAMELIST ファイルから, 格子点情報を取得し, 保管するための変数型モジュール

Methods

NCMAX   NX   NY   NZ   Xmg   Ymg   Zmg   gridset_init   imax   imin   jmax   jmin   kmax   kmin  

Included Modules

dc_types dc_iounit dc_message mpi_wrapper

Public Instance methods

NCMAX
Variable :
NCMAX = 3 :integer, public, save
: 格子点数
NX
Variable :
NX = 10 :integer, public, save
: 格子点数
NY
Variable :
NY = 10 :integer, public, save
: 格子点数
NZ
Variable :
NZ = 10 :integer, public, save
: 格子点数
Xmg
Variable :
Xmg = 5 :integer, public, save
: 糊代格子点数
Ymg
Variable :
Ymg = 5 :integer, public, save
: 糊代格子点数
Zmg
Variable :
Zmg = 5 :integer, public, save
: 糊代格子点数
Subroutine :
cfgfile :character(STRING), intent(in)

NAMELIST から情報を得て, 格子点を計算する

This procedure input/output NAMELIST#gridset_nml .

[Source]

  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
imax
Variable :
imax :integer, public, save
: x 方向の配列の上限
imin
Variable :
imin :integer, public, save
: x 方向の配列の下限
jmax
Variable :
jmax :integer, public, save
: y 方向の配列の下限
jmin
Variable :
jmin :integer, public, save
: y 方向の配列の下限
kmax
Variable :
kmax :integer, public, save
: z 方向の配列の下限
kmin
Variable :
kmin :integer, public, save
: z 方向の配列の下限