!= ç‰©ç†ãƒ»æ•°å¦å®šæ•°è¨å®š
!
!= 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)

  ! éžå…¬é–‹å¤‰æ•°
  ! 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