C$$$  SUBPROGRAM DOCUMENTATION BLOCK 
C                .      .    .                                       . 
C SUBPROGRAM:    INTLST
C  
C   PRGMMR: TRACY SMITH      ORG: FSL/PROFS  DATE: 90-07-19 
C 
C ABSTRACT: THIS PROGRAM ATTEMPTS TO REINTEGRATE A Z VALUE
C
C PROGRAM HISTORY LOG: 
C
C USAGE:    CALL INTLST(P,Z,T,KBOT,KTOP,ZTEST)
C   INPUT ARGUMENT LIST: 
C     P     - REAL ARRAY  PRESSURE (MB)
C     Z     - REAL ARRAY  HEIGHT (M)
C     T     - REAL ARRAY  TEMPERATURE (K)
C     DPD   - REAL ARRAY  DEW POINT DEPRESSION (K)
C     KBOT  - INTEGER     INDEX FOR BOTTOM OF REINTEGRATION
C     KTOP  - INTEGER     INDEX FOR TOP OF REINTEGRATION
C
C 
C   OUTPUT ARGUMENT LIST:   
C     ZTEST - REAL        REINTEGRATED HEIGHT (M)
C
C REMARKS: 
C 
C ATTRIBUTES: 
C   LANGUAGE: FORTRAN-77
C   MACHINE:  NAS-9000 
C$$$ 
C
      SUBROUTINE INTLST(P,Z,T,DPD,KBOT,KTOP,ZTEST)

      INCLUDE 'IMPLICIT'
      INCLUDE 'MAPSCON'
      INCLUDE 'METCON'

      REAL*4           P(SND_LEV_P),
     +                 Z(SND_LEV_P),
     +                 T(SND_LEV_P),
     +                 DPD(SND_LEV_P)
      INTEGER*4 KBOT,KTOP

      REAL*4 TVBOT,TVK,TVMEAN,ZTEST,TV,ALOG

C*** START THE PROGRAM BY GETTING TV AT LOWER LEVEL
      IF(DPD(KBOT).LT.SPVAL_P .AND. P(KBOT).LT.99990.) THEN
        TVBOT=TV(T(KBOT),(T(KBOT)-DPD(KBOT)),P(KBOT))
      ELSE
        TVBOT=T(KBOT)
      END IF

C*** NOW GET TV AT THE UPPER LEVEL
      IF(DPD(KTOP).LT.SPVAL_P .AND. P(KTOP).LT.99990.) THEN
        TVK=TV(T(KTOP),(T(KTOP)-DPD(KTOP)),P(KTOP))
      ELSE
        TVK=T(KTOP)
      END IF

C*** REINTEGRATE THE HEIGHT
      TVMEAN=((TVBOT+TVK)*0.5)
      ZTEST=Z(KBOT)+TVMEAN*RDOVG0_P*ALOG(P(KBOT)/P(KTOP))

      RETURN
      END
