subroutine SetGCMRInit
! ファイル入出力補助
! File I/O support
!
use dc_iounit, only: FileOpen
! ヒストリデータ出力
! History data output
!
use gtool_historyauto, only: HistoryAutoAddVariable
! NAMELIST ファイル入力に関するユーティリティ
! Utilities for NAMELIST file input
!
use namelist_util, only: namelist_filename, NmlutilMsg, NmlutilAryValid
!
! Work variables
!
integer:: unit_nml ! NAMELIST ファイルオープン用装置番号.
! Unit number for NAMELIST file open
integer:: iostat_nml ! NAMELIST 読み込み時の IOSTAT.
! IOSTAT of NAMELIST read
! NAMELIST 変数群
! NAMELIST group name
!
namelist /set_gcmr_nml/ MRCO2, CO2File, CO2Name, MRN2O, N2OFile, N2OName, MRCH4, CH4File, CH4Name
!
! デフォルト値については初期化手続 "set_gcmr#SetGCMRInit"
! のソースコードを参照のこと.
!
! Refer to source codes in the initialization procedure
! "set_gcmr#SetGCMRInit" for the default values.
!
if ( set_gcmr_inited ) return
! デフォルト値の設定
! Default values settings
!
!!$ MRCO2 = 382.0d-6 ! old default value
MRCO2 = 369.0d-6 ! Value at 2000 in CMIP5 recommendation, PRE2005_MIDYR_CONC.DAT
CO2File = ''
CO2Name = ''
MRN2O = 316.0d-9 ! Value at 2000 in CMIP5 recommendation, PRE2005_MIDYR_CONC.DAT
N2OFile = ''
N2OName = ''
MRCH4 = 1751.0d-9 ! Value at 2000 in CMIP5 recommendation, PRE2005_MIDYR_CONC.DAT
CH4File = ''
CH4Name = ''
! NAMELIST の読み込み
! NAMELIST is input
!
if ( trim(namelist_filename) /= '' ) then
call FileOpen( unit_nml, namelist_filename, mode = 'r' ) ! (in)
rewind( unit_nml )
read( unit_nml, nml = set_gcmr_nml, iostat = iostat_nml ) ! (out)
close( unit_nml )
call NmlutilMsg( iostat_nml, module_name ) ! (in)
end if
call HistoryAutoAddVariable( "CO2", (/ 'time' /), "carbon dioxide", '1' ) ! (in)
call HistoryAutoAddVariable( "N2O", (/ 'time' /), "nitric oxide", '1' ) ! (in)
call HistoryAutoAddVariable( "CH4", (/ 'time' /), "methen", '1' ) ! (in)
! 印字 ; Print
!
call MessageNotify( 'M', module_name, '----- Initialization Messages -----' )
call MessageNotify( 'M', module_name, ' MRCO2 = %f', d = (/ MRCO2 /) )
call MessageNotify( 'M', module_name, ' CO2File = %c', c1 = trim( CO2File ) )
call MessageNotify( 'M', module_name, ' CO2Name = %c', c1 = trim( CO2Name ) )
call MessageNotify( 'M', module_name, ' MRN2O = %f', d = (/ MRN2O /) )
call MessageNotify( 'M', module_name, ' N2OFile = %c', c1 = trim( N2OFile ) )
call MessageNotify( 'M', module_name, ' N2OName = %c', c1 = trim( N2OName ) )
call MessageNotify( 'M', module_name, ' MRCH4 = %f', d = (/ MRCH4 /) )
call MessageNotify( 'M', module_name, ' CH4File = %c', c1 = trim( CH4File ) )
call MessageNotify( 'M', module_name, ' CH4Name = %c', c1 = trim( CH4Name ) )
call MessageNotify( 'M', module_name, '-- version = %c', c1 = trim(version) )
set_gcmr_inited = .true.
end subroutine SetGCMRInit