module saturation_simple

  use vtype_module

  implicit none

  public :: CalcPressH2OVapSat
  public :: CalcDPressH2OVapSatDTemp

contains

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

  function CalcPressH2OVapSat( LatentHeatPerMol, Temp ) result( PressH2OVapSat )

    use constants0, only : GasRUniv

    real(DP), intent(in ) :: LatentHeatPerMol
    real(DP), intent(in ) :: Temp

    real(DP) :: PressH2OVapSat


    PressH2OVapSat = 1.4d11 * exp( - LatentHeatPerMol / ( GasRUniv * Temp ) )

  end function CalcPressH2OVapSat

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

  function CalcDPressH2OVapSatDTemp( LatentHeatPerMol, Temp ) result( DPressH2OVapSatDTemp )

    use vtype_module
    use constants0, only : GasRUniv

    real(DP), intent(in ) :: LatentHeatPerMol
    real(DP), intent(in ) :: Temp

    real(DP) :: DPressH2OVapSatDTemp


    DPressH2OVapSatDTemp = &
      & 1.4d11 * exp( - LatentHeatPerMol / ( GasRUniv * Temp ) ) &
      & * LatentHeatPerMol / ( GasRUniv * Temp**2 )

  end function CalcDPressH2OVapSatDTemp

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

end module saturation_simple
