!Description:
!  単位の換算プログラム
!    K(ケルビン)  <-->  C (摂氏)
!    Pa(パスカル) <-->  mmHg(水銀柱高度)
!
! Current Code Owner: sugiyama@gfd-dennou.org
!
! History: 
!   Version    Date          Comment
!   -------    ----------    -------
!   1.0        2003-01-19    新規作成
!   1.1        2003-01-23    原子記号を原子番号に変換するように
!
! Copyright (C) SUGIYAMA Ko-ichiro, 2003, All rights reserved

module interface_convertunits
  interface

     subroutine convertunits(units, value)
       real(8), intent(inout)   :: value
       character(5), intent(in) :: units
     end subroutine convertunits

  end interface
end module interface_convertunits



subroutine convertunits(units, value)
  implicit none
  
  real(8), intent(inout)   :: value
  character(5), intent(in) :: units
  

!!!
!!! K(ケルビン)  <-->  C (摂氏)
!!!
  if (units == "C") then 
     value = value + 273.15d0
  end if


!!!
!!! Pa(パスカル)  <-->  mmHg (水銀柱高度)
!!!  1 [atm] = 760 [mmHg] = 101325 [Pa]
!!!
  if (units == "mmHg") then 
     value = value * (101325.0d0/760.0d0) 
  end if


!!!
!!! units が K, Pa ならば何もしないで終了
!!!

end subroutine convertunits
