!+ Subroutine to find saturated mixing ratio of water.
!
! Method:
!	The standard Goff-Gratsch formula is implemented.
!
! Current Owner of Code: J. M. Edwards
!
! History:
!	Version		Date			Comment
!	1.0		12-04-95		First Version under RCS
!						(J. M. Edwards)
!
! Description of Code:
!   FORTRAN 77  with extensions listed in documentation.
!
!- ---------------------------------------------------------------------
      SUBROUTINE QSAT_GG(QS, T, P)
!
!
      IMPLICIT NONE
!
!
!     DUMMY ARGUMENTS
      REAL*8	!, INTENT(IN)
     &     T
!             TEMPERATURE
     &   , P
!             PRESSURE
      REAL*8	!, INTENT(OUT)
     &     QS
!             SATURATION MIXING RATIO
!
!     LOCAL VARIABLES.
      REAL*8
     &     X
     &   , U1
     &   , U2
     &   , U3
     &   , U4
!             TEMPORARY VARIABLES
     &   , EW
!             SATURATION VAPOUR PRESSURE OF WATER VAPOUR
     &   , R
!             HUMIDITY MIXING RATIO
!
!
!
      X=3.7316D+02/T
      U1=-7.90298D+00*(X-1.0D+00)
      U2=5.02808D+00*LOG10(X)
      U3=-1.3816D-07*(1.0D+01**(1.1344D+01*(1.0D+00-1.0D+00/X))
     &   -1.0D+00)
      U4=8.1328D-03*(1.0D+01**(-3.49149D+00*(X-1.0D+00))-1.0D+00)
      EW=1.013246D+05*1.0D+01**(U1+U2+U3+U4)
      R=6.2197D-01*EW/(P-EW)
      QS=R/(1.0D+00+R)
!
!
!
      RETURN
      END
