program main

  use ChemDataBase
  use ChemEquiv, only: ChemEquiv_Init, ss_SvapPress_ss, SvapPress
  implicit none
  
  integer, parameter :: SpcNum = 3
  integer, parameter :: XMin = 0
  integer, parameter :: XMax = 3
  integer, parameter :: ZMin = 0
  integer, parameter :: ZMax = 1
  integer      :: SpcName(SpcNum)
  character(5) :: SpcSymbol(SpcNum)
  real(8)      :: Temp(XMin:XMax, ZMin:ZMax)
  real(8)      :: SvapPress1(XMin:XMax, ZMin:ZMax, SpcNum)
  real(8)      :: SvapPress2, Temp2
  integer      :: i

  call ChemData_Init

  SpcSymbol = (/ 'N2-g ', 'H2O-g', 'H2O-l' /)
  SpcName   = ChemData_SpcName(3, SpcSymbol)

  write(*,*) SpcSymbol
  write(*,*) SpcName


  call ChemEquiv_Init(XMin, XMax, ZMin, ZMax, SpcNum, SpcName)  

  do i = XMin, XMax
    Temp(i,:) = i * 10.0d0 + 250.0d0
  end do
  Temp2 = 250.0d0
  
  SvapPress1  = ss_SvapPress_ss(Temp)
  SvapPress2 = SvapPress(SpcName(3), Temp2)

  do i = XMin, XMax
    write(*,*) Temp(i,:)
    write(*,*) SvapPress1(i,:,1)
    write(*,*) SvapPress1(i,:,2)
    write(*,*) SvapPress1(i,:,3)
  end do
  write(*,*) SvapPress2

end program main
