!---------------------------------------------------------------------
!     Copyright (C) GFD Dennou Club, 2004, 2005, 2006. All rights reserved.
!---------------------------------------------------------------------
!= Module DebugSet
!
!   * Developer: ODAKA Masatsugu, SUGIYAMA Ko-ichiro
!   * Version: $Id: $
!   * Tag Name: $Name:  $
!   * Change History: 
!
!== Overview 
!
!デバグ設定モジュール
!
!== Error Handling
!
!== Known Bugs
!
!== Note
!
!== Future Plans
!

module debugset
  !
  !デバグ設定モジュール
  !

  !モジュール読み込み
  use dc_trace,   only: SetDebug

  !暗黙の型宣言禁止
  implicit none

  !save 属性
  save

  !公開変数
  logical :: DebugOn   ! デバッグ出力スイッチ

contains

  subroutine debugset_init(cfgfile)
    !
    !NAMELIST から情報を得て, デバッグ出力スイッチの切替えを行う.
    !

    !モジュール読み込み
    use dc_message,    only: MessageNotify

    !暗黙の型宣言禁止
    implicit none

    !入力変数
    character(*), intent(in) :: cfgfile

    !NAMELIST から情報取得
    NAMELIST /debugset/ DebugOn
    
    open (10, FILE=cfgfile)
    read(10, NML=debugset)
    close(10)

    !デバッグモードなら dc_trace を ON にする
!    if ( DebugOn ) call SetDebug

  end subroutine debugset_init
  
end module debugset
