       FUNCTION PRSINT(TMDWUP, TMDWDN, PRESUP, PRESDN, PRESTP)
C
C**********************************************************************
C
C   NAME- PRSINT
C
C   LANGUAGE- FORTRAN 77  TYPE- REAL FUNCTION    COMPUTER- CRAY
C
C   VERSION- 1.0  DATE- 06/03/93  PROGRAMMER- MOHAMMED SIKDER (SMSRC)
C   VERSION- 3.0  DATE- 05/16/96  PROGRAMMER- FRANK TILLEY (SMSRC)
C     FOR REHOSTING TO CRAY, CHANGED R*4 TO REAL.
C
C   FUNCTION-
C   THIS FUNCTION RETURNS THE INTERPOLATED VALUE OF TEMPERATURE OR DEW
C   POINT TEMPERATURE FOR A CERTAIN PRESSURE LEVEL PRESTP WHICH IS
C   BOUNDED BY THE PRESSURE LEVEL PRESDN AT THE LOWER BOUNDARY AND
C   PRESUP AT THE UPPER BOUNDARY.  PRSINT IS SET TO A MISSING VALUE
C   IF ONE OR MORE INPUT PRESSURES IS 0 OR LESS.
C
C   CALLING SEQUENCE PARAMETERS-
C     VARIABLE          TYPE  I/O  DESCRIPTION
C     --------          ----  ---  ------------------
C     TMDWUP            REAL   I   UPPER LEVEL TEMPERATURE IN DEGREES
C                                  KELVIN OR UPPER LEVEL DEW POINT
C                                  TEMPERATURE IN DEGREES CELSIUS.
C
C     TMDWDN            REAL   I   LOWER LEVEL TEMPERATURE IN DEGREES
C                                  KELVIN OR LOWER LEVEL DEW POINT
C                                  TEMPERATURE IN DEGREES CELSIUS.
C
C     PRESUP            REAL   I   UPPER LEVEL PRESSURE IN MB.
C
C     PRESDN            REAL   I   LOWER LEVEL PRESSURE IN MB.
C
C     PRESTP            REAL   I   DESIGNATED PRESSURE LEVEL (MB) AT
C                                  THE TOP.
C
C
C   FUNCTION USED- ALOG
C
C   EXIT STATES- NONE
C
C   COMMENTS-
C   UNITS OF UPPER LEVEL AND LOWER LEVEL TEMPERATURE AND DEW POINT
C   TEMPERATURE HAVE BEEN TAILORED ACCORDING TO THE PRESENT DESIGN
C   OF THE FUNCTION Z.  ALGORITHMS USED IN THIS FUNCTION MAY BE
C   FOUND IN ANY STANDARD TEXT BOOK ON CLASSICAL THERMODYNAMICS/
C   FLUID MECHANICS. REF: THE AFOREMENTIONED ALGORITHMS WERE
C   PROVIDED BY DR. KARL COX (SMSRC).
C
      INCLUDE 'SPVAL'
C
C *********************************************************************
C
      REAL         TMDWUP,TMDWDN,PRESUP,PRESDN,PRESTP,PRSINT
C
C   IF ANY OF THE INPUT PRESSURES IS 0 OR LESS, SET PRSINT AS A
C   MISSING VALUE AND RETURN.
C
      IF (.NOT.((PRESTP.GT.0.).AND.(PRESDN.GT.0.).AND.
     +          (PRESUP.GT.0.))) THEN
         PRSINT=R4SPV
         RETURN
      END IF
C
C   IF THE PRESSURE AT THE LOWER BOUNDARY IS NOT EQUAL TO THAT OF THE
C   UPPER BOUNDARY, COMPUTE THE INTERPOLATED TEMPERATURE/DEW POINT
C   TEMPERATURE USING THE CONVENTIONAL ALGORITHM. OTHERWISE, TAKE THEIR
C   GEOMETRICAL MEAN TO GET THE INTERPOLATED VALUE.
C
      IF(PRESDN .NE. PRESUP)THEN
         PRSINT=TMDWDN + ALOG(PRESTP/PRESDN)/ALOG(PRESUP/PRESDN) *
     +           (TMDWUP-TMDWDN)
      ELSE
         PRSINT=0.5 *(TMDWDN+TMDWUP)
      END IF
      RETURN
      END
