      SUBROUTINE TLINEAR

C     LINEAR TEMPERATURE PROFILE



      implicit double precision (a-h,o-z)



C     COMMON DECK "RKAM" INSERTED HERE

      DOUBLE PRECISION KR,KTH,KPH

      COMMON//R,TH,PH,KR,KTH,KPH,RKVARS(14),TPULSE,CSTEP,DRDT(20)

C     COMMON DECK "MM" INSERTED HERE

      DOUBLE PRECISION M,MODM

      COMMON/MM/MODM(4),M,PMT,PMR,PMTH,PMPH

C     COMMON DECK "TT" INSERTED HERE

      DOUBLE PRECISION MODT

      COMMON/TT/MODT(4), T,PTT,PTR,PTTH,PTPH

C     COMMON DECK "WW" INSERTED HERE

      PARAMETER (NWARSZ=1000)

      COMMON/WW/ dum(10),MAXW,W(NWARSZ)

      EQUIVALENCE (EARTHR,W(1))

C

C     TEMPERATURE    200-224

C

       EQUIVALENCE (TGND, W(203)), (A, W(204))



C     COMMON DECK "B5" INSERTED HERE

      INTEGER TMX,TNTBL,TITBL,TFRMTBL,IDST(10)

      COMMON/B5/TMX,TNTBL(10),TITBL(10),TFRMTBL(10),TGP(262)

      EQUIVALENCE (TGP,IDST),(ANT,TGP(11))

      DATA ANT/0.0/

      DATA TMX/1/

      DATA TNTBL/1,11,8*0/

      DATA TITBL/1,9*0/

      DATA TFRMTBL/1,9*0/



      ENTRY ITEMP

C

      if (w(200) .ne. 1) then

           PRINT*,' Model check number mismatch: '

           STOP ' W(200) should be 1 if you are using model TLINEAR.'

      endif



C

      MODT(1)=7HTLINEAR

      MODT(2)= w(202)

      CALL IPTEMP

C

      RETURN

C

      ENTRY TEMP

      H = R - EARTHR

      T = TGND + A * H

      CALL CLEAR(PTT,4)

      PTR=A

C

      CALL PTEMP

      RETURN

      END

