program main

  use ChemData
  use ChemCalc
  implicit none
  
  integer, parameter :: SpcNum = 3
  integer            :: SpcNum1 
  integer, parameter :: XMin = 0
  integer, parameter :: XMax = 3
  integer, parameter :: ZMin = 0
  integer, parameter :: ZMax = 1
  integer      :: SpcID(SpcNum)
  character(20) :: SpcSymbol(SpcNum)
  real(8)      :: Temp(XMin:XMax, ZMin:ZMax)
  real(8)      :: SvapPress1(XMin:XMax, ZMin:ZMax, SpcNum)
  real(8)      :: SvapPressTest(100, 100, 100)
  real(8)      :: SvapPress2, Temp2
  integer      :: i, k, s


  call ChemData_Init

  SpcSymbol = (/ 'H2O-s  ', &
    &            'H2O-l  ', &
    &            'NH3-s  ' /)
  SpcID(:)  = ChemData_SpcID(SpcNum, SpcSymbol)

  write(*,*) SpcSymbol
  write(*,*) SpcID

  call ChemCalc_Init(XMin, XMax, ZMin, ZMax, SpcNum, SpcID)  

  !計算に利用する飽和蒸気圧と, 飽和蒸気圧との測定値をチェック. 
  call CheckSvapPress()

!  do i = XMin, XMax
!    Temp(i,:) = i * 10.0d0 + 250.0d0
!  end do
  Temp2 = 273.15d0
  
!  SvapPress1(:,:,:)  = ss_SvapPress_ss(Temp(:,:))
!  write(*,*) SvapPress1  

  do s = 1, SpcNum
    SvapPress2 = SvapPress(SpcID(s), Temp2)
    write(*,*) SvapPress2 
  end do
  
end program main
