!= 迚ｩ逅��謨ｰ蟄ｦ螳壽焚險ｭ螳�
!
!= Physical and mathematical constants settings
!
! Authors::   Yasuhiro MORIKAWA, Yoshiyuki O. Takahashi
! Version::   $Id: constants0.f90,v 1.3 2013/06/12 08:57:12 yot Exp $
! Tag Name::  $Name:  $
! Copyright:: Copyright (C) GFD Dennou Club, 2008. All rights reserved.
! License::   See COPYRIGHT[link:../../../COPYRIGHT]
!

module constants0
  !
  != 迚ｩ逅��謨ｰ蟄ｦ螳壽焚險ｭ螳�
  !
  != Physical and mathematical constants settings
  !
  ! <b>Note that Japanese and English are described in parallel.</b>
  !
  ! 迚ｩ逅��謨ｰ蟄ｦ螳壽焚縺ｮ險ｭ螳壹♀繧医�菫晉ｮ｡繧定｡後＞縺ｾ縺�.
  ! 繝�ヵ繧ｩ繝ｫ繝亥､縺ｯ蝨ｰ逅�､ｧ豌励ｒ諠ｳ螳壹＠縺溷､縺瑚ｨｭ螳壹＆繧後※縺�∪縺�.
  !
  ! Physical and mathematical constants are set and stored.
  ! By default, values on atmosphere of earth are set.
  !
  !== References
  !
  ! Mohr, P. J., B. N. Taylor, and D. B. Newell,
  !   CODATA recommended values of the fundamental physical constants: 2010,
  !   Rev. Mod. Phys., 84, 1527, 2012.
  !   See also http://physics.nist.gov/cuu/Constants/index.html.
  !
  !== Procedures List
  !
  ! Constants0Init :: 迚ｩ逅�ｮ壽焚縺ｮ險ｭ螳�
  ! ------------  :: ------------
  ! Constants0Init :: Settings of physical constants
  !
  !== NAMELIST
  !
  ! N/A
  !

  ! 繝｢繧ｸ繝･繝ｼ繝ｫ蠑慕畑 ; USE statements
  !

  ! 遞ｮ蛻･蝙九ヱ繝ｩ繝｡繧ｿ
  ! Kind type parameter
  !
  use dc_types, only: DP     ! 蛟咲ｲｾ蠎ｦ螳滓焚蝙�. Double precision.

  ! 螳｣險譁� ; Declaration statements
  !
  implicit none
  private

  ! 蜈ｬ髢区焔邯壹″
  ! Public procedure
  !
  public:: Constants0Init

  ! 蜈ｬ髢句､画焚
  ! Public variables
  !
  logical, save, public:: constants0_inited = .false.
                              ! 蛻晄悄險ｭ螳壹ヵ繝ｩ繧ｰ.
                              ! Initialization flag

  real(DP), parameter, public:: PI = 3.1415926535897932_DP
                              ! $ \pi $ .
                              ! 蜀�捉邇�.  Circular constant
  real(DP), parameter, public:: GasRUniv = 8.3144621_DP
                              ! $ R^{*} $ [J K-1 mol-1].
                              ! 譎ｮ驕肴ｰ嶺ｽ灘ｮ壽焚.  Universal gas constant
                              ! (Mohr et al., 2012; CODATA 2010)
  real(DP), parameter, public:: Boltz = 1.3806488e-23_DP
                              ! $ k $ [J K-1].
                              ! 繝懊Ν繝��繝ｳ螳壽焚.  Boltzmann constant
                              ! (Mohr et al., 2012; CODATA 2010)
  real(DP), parameter, public:: StB = 5.670373e-8_DP
                              ! $ \sigma_{SB} $ .
                              ! 繧ｹ繝�ヵ繧｡繝ｳ繝懊Ν繝��繝ｳ螳壽焚.
                              ! Stefan-Boltzmann constant
                              ! (Mohr et al., 2012; CODATA 2010)
  real(DP), parameter, public:: WaterHeatCap = 4.187e3_DP
                              !
                              !
                              ! Water heat capacity (J K-1 kg-1)

  ! 髱槫�髢句､画焚
  ! Private variables
  !

  character(*), parameter:: module_name = 'constants0'
                              ! 繝｢繧ｸ繝･繝ｼ繝ｫ縺ｮ蜷咲ｧｰ.
                              ! Module name
  character(*), parameter:: version = &
    & '$Name:  $' // &
    & '$Id: constants0.f90,v 1.3 2013/06/12 08:57:12 yot Exp $'
                              ! 繝｢繧ｸ繝･繝ｼ繝ｫ縺ｮ繝舌�繧ｸ繝ｧ繝ｳ
                              ! Module version

contains

  !--------------------------------------------------------------------------------------

  subroutine Constants0Init
    !
    ! constants0 繝｢繧ｸ繝･繝ｼ繝ｫ縺ｮ蛻晄悄蛹悶ｒ陦後＞縺ｾ縺�.
    !
    ! "constants0" module is initialized.
    !

    ! 繝｢繧ｸ繝･繝ｼ繝ｫ蠑慕畑 ; USE statements
    !

    ! 繝｡繝�そ繝ｼ繧ｸ蜃ｺ蜉�
    ! Message output
    !
    use dc_message, only: MessageNotify

    ! 螳｣險譁� ; Declaration statements
    !
    implicit none

    ! 螳溯｡梧枚 ; Executable statement
    !

    if ( constants0_inited ) return

    ! 蜊ｰ蟄� ; Print
    !
    call MessageNotify( 'M', module_name, '----- Initialization Messages -----' )
    call MessageNotify( 'M', module_name, '  PI               = %f', d = (/ PI               /) )
    call MessageNotify( 'M', module_name, '  GasRUniv         = %f', d = (/ GasRUniv         /) )
    call MessageNotify( 'M', module_name, '  Boltz            = %f', d = (/ Boltz            /) )
    call MessageNotify( 'M', module_name, '  StB              = %f', d = (/ StB              /) )
    call MessageNotify( 'M', module_name, '-- version = %c', c1 = trim(version) )

    constants0_inited = .true.

  end subroutine Constants0Init

  !--------------------------------------------------------------------------------------

end module constants0