C$$$  SUBPROGRAM DOCUMENTATION BLOCK
C                .      .    .                                       .
C SUBPROGRAM:    M_STVPPR    GET SATURATION VAPOR FROM TEMPERATURE
C   PRGMMR: PATTY MILLER     ORG: FSL/PROFS  DATE: 90-06-15
C
C ABSTRACT: FUNCTION TO GET SATURATION VAPOR FROM TEMPERATURE IN
C   CELSIUS OR KELVIN.
C
C PROGRAM HISTORY LOG:
C   84-02-??  R. G. RASMUSSEN    ORIGINAL VERSION
C   84-05-??  R. G. RASMUSSEN    REPLACED THE MURRAY APPROXIMATION
C                                WITH THE BOLTON APPROXIMATION FOR
C                                WATER REFERENCE.  THIS WAS DONE
C                                BECAUSE THE LATTER APPROXIMATION IS
C                                MORE ACCURATE.  ALSO, THE ICE
C                                -REFERENCE AND MIXED WATER-ICE
C                                COMPUTATIONS WERE REMOVED.
C                                THIS WAS DONE TO ALLOW AN EFFICIENT
C                                INVERSE MACRO TO BE ADDED.
C   99-09-20  M. BARTH           COPIED FROM MSAS & MODIFIED FOR MADIS.
C
C USAGE:    M_STVPPR(T,SPVAL)
C   INPUT ARGUMENT LIST:
C     T        - REAL  TEMPERATURE IN CELSIUS OR KELVIN
C     SPVAL    - REAL  MISSING DATA FLAG
C
C   OUTPUT ARGUMENT LIST:
C
C REMARKS: MURRAY'S PARAMETER B WAS MODIFIED TO REFLECT A
C   CELSIUS-KELVIN CONVERSION CONSTANT OF 273.15 (RATHER THAN 273.16
C   AS HE USED).
C
C ATTRIBUTES:
C   LANGUAGE: FORTRAN-77
C   MACHINE:  NAS-9000
C$$$
C
C   M_STVPPR          Saturation vapor pressure
C   M_STVPPR_ICE      Saturation vapor pressure, ice reference
C   M_STVPPR_WATER    Saturation vapor pressure, water reference
C
C   References: Murray, F. W., 1967: On the computation of saturation v
Capor
C               pressure. J. Appl. Meteor., 6, 203-204.
C
C               Bolton, D., 1980: The computation of equivalent potenti
Cal
C               temperature.  Mon. Wea. Rev., 108, 1046-1053.
C
C   Remarks:    Murray's parameter b was modified to reflect a Celsius-
CKelvin
C               conversion constant of 273.15 (rather than 273.16 as he
C used).
C
C   History:    05/84 - R. G. Rasmussen replaced the Murray approximati
Con with
C               the Bolton approximation for water reference.  This was
C done
C               because the latter approximation is more accurate.  Als
Co, the
C               ice-reference and mixed water-ice computations were rem
Coved.
C               This was done to allow an efficient inverse macro to be
C added.
C
C               02/84 - R. G. Rasmussen wrote macros to implement the M
Curray
C               approximations of saturation vapor pressure over water,
C over
C               ice, and over a mixture of water and ice.
C
C   New Code:   Bolton Approximation.
C
C  T: TEMPERATURE IN CELSIUS OR KELVIN
C  OUTPUT IS IN KILOPASCALS
C
      REAL FUNCTION M_STVPPR(T,SPVAL)
      IF(T.LT.SPVAL) THEN
         IF(T.LT.150.) THEN
C* T IN CELSIUS
           M_STVPPR = 611.2*EXP(17.67*T/(T+243.5))
         ELSE
           M_STVPPR = 611.2*EXP(17.67*(T-273.15)/(T-29.65))
          ENDIF
      ELSE
         M_STVPPR = SPVAL
       ENDIF
      RETURN
       END
C**---------------------------------------------------------------------
C**REQUIRED STANDARD FSL DISCLAIMER (NOVEMBER 2000)
C**---------------------------------------------------------------------
C**  OPEN SOURCE LICENSE/DISCLAIMER,  FORECAST SYSTEMS LABORATORY
C**  NOAA/OAR/FSL, 325 BROADWAY BOULDER, CO 80305
C**
C**  THIS SOFTWARE IS DISTRIBUTED UNDER THE OPEN SOURCE DEFINITION, 
C**  WHICH MAY BE FOUND AT http://www.opensource.org/osd.html.
C**
C**  IN PARTICULAR, REDISTRIBUTION AND USE IN SOURCE AND BINARY FORMS,
C**  WITH OR WITHOUT MODIFICATION, ARE PERMITTED PROVIDED THAT THE 
C**  FOLLOWING CONDITIONS ARE MET:
C**
C**  - REDISTRIBUTIONS OF SOURCE CODE MUST RETAIN THIS NOTICE, THIS LIST
C**    OF CONDITIONS AND THE FOLLOWING DISCLAIMER.
C**
C**  - REDISTRIBUTIONS IN BINARY FORM MUST PROVIDE ACCESS TO THIS 
C**    NOTICE, THIS LIST OF CONDITIONS AND THE FOLLOWING DISCLAIMER, AND
C**    THE UNDERLYING SOURCE CODE.
C**
C**  - ALL MODIFICATIONS TO THIS SOFTWARE MUST BE CLEARLY DOCUMENTED, 
C**    AND ARE SOLELY THE RESPONSIBILITY OF THE AGENT MAKING THE 
C**    MODIFICATIONS.
C**
C**  - IF SIGNIFICANT MODIFICATIONS OR ENHANCEMENTS ARE MADE TO THIS
C**    SOFTWARE, THE FSL SOFTWARE POLICY MANAGER 
C**    (softwaremgr.fsl@noaa.gov) BE NOTIFIED.
C**
C**  THIS SOFTWARE AND ITS DOCUMENTATION ARE IN THE PUBLIC DOMAIN AND 
C**  ARE FURNISHED "AS IS."  THE AUTHORS, THE UNITED STATES GOVERNMENT,
C**  ITS INSTRUMENTALITIES, OFFICERS, EMPLOYEES, AND AGENTS MAKE NO 
C**  WARRANTY, EXPRESS OR IMPLIED, AS TO THE USEFULNESS OF THE SOFTWARE
C**  AND DOCUMENTATION FOR ANY PURPOSE.  THEY ASSUME NO RESPONSIBILITY 
C**  (1) FOR THE USE OF THE SOFTWARE AND DOCUMENTATION; OR (2) TO 
C**  PROVIDE TECHNICAL SUPPORT TO USERS.
C**---------------------------------------------------------------------
