subroutine constants_init
!==== Dependency
use type_mod , only : REKIND, DBKIND, INTKIND, TOKEN, STRING
use nmlfile_mod, only : nmlfile_init, nmlfile_open, nmlfile_close
use dc_trace , only : BeginSub, EndSub, DbgMessage
use dc_message , only : MessageNotify
!=end
implicit none
!
! This namelist is require physical constants
namelist /constants_nml/ PI , R0 , Omega , Grav , Cp , RAir , EL , CpVap , RVap , DH2O , EpsV , ES0 , StB , FKarm , EpsVT , SecPerDay , EFoldTime , TempAve , TimeFilter , TimeFilterStepInt , VisOrder ! 超粘性の次数
!=end
integer(INTKIND) :: nmlstat, nmlunit
logical :: nmlreadable
character(STRING), parameter:: subname = "constants_init"
continue
!----------------------------------------------------------------
! Check Initialization
!----------------------------------------------------------------
call BeginSub(subname)
if (constants_initialized) then
call EndSub( subname, '%c is already called', c1=trim(subname) )
return
else
constants_initialized = .true.
endif
!----------------------------------------------------------------
! Version identifier
!----------------------------------------------------------------
call DbgMessage('%c :: %c', c1=trim(version), c2=trim(tagname))
!----------------------------------------------------------------
! read constants_nml
!----------------------------------------------------------------
call nmlfile_init
call nmlfile_open(nmlunit, nmlreadable)
if (nmlreadable) then
read(nmlunit, nml=constants_nml, iostat=nmlstat)
call DbgMessage('Stat of NAMELIST constants_nml Input is <%d>', i=(/nmlstat/))
write(0, nml=constants_nml)
else
call DbgMessage('Not Read NAMELIST constants_nml')
call MessageNotify('W', subname, 'Can not Read NAMELIST constants_nml. Force Use Default Value.')
end if
call nmlfile_close
call EndSub( subname )
end subroutine constants_init