      SUBROUTINE AMHMTM(DEL,RPI,SV,P1,P2,AM,HM,TM)
      DIMENSION DEL( 7 ),RPI( 6 ),SV( 7 ),
     1 P1( 7 ),P2( 7 ),LLL( 7 ),MMM( 7 ),
     2 AM( 7 , 7 ),HM( 7 , 7 ),TM( 7 , 7 )
      DO 5 J=1, 7
      DO 5 I=1, 7
      HM(I,J) = 0.
5     TM(I,J) = 0.
      DO 6 LE=1, 6
      HM(LE,LE) = 1.
      TM(LE,LE) = 0.5 *  1005.  * (RPI(LE)-1.)
C
      HM(LE,LE+1) = -1.
6     TM(LE,LE+1) = 0.5 *  1005.  * (1.-1./RPI(LE))
      DO 7 LE=1, 7
      HM( 7 ,LE) = DEL(LE)
7     TM( 7 ,LE) =  287.05  * DEL(LE)
      CALL IMINV (HM,  7 , DET, LLL, MMM)
      DO 8 I=1, 7
      DO 8 J=1, 7
      AM(I,J) = 0.
      DO 8 K=1, 7
8     AM(I,J) = AM(I,J) + HM(I,K)*TM(K,J)
C     HERE IS A GOOD PLACE TO DIVIDE BY A**2 FOR LAPLACIAN
C     STORE AM IN TM AND DIVIDE AM
      DO 10 I=1, 7
      DO 10 J=1, 7
      TM(I,J) = AM(I,J)
      HM(I,J) = AM(I,J)
10    AM(I,J) = AM(I,J) / ( 6370000.  *  6370000. )
      CALL IMINV(TM, 7 ,DET,LLL,MMM)
      DO 9 LE=1, 7
9     SV(LE) = -DEL(LE)
      DO 11 LE=1, 6
      P1(LE) = 1. / RPI(LE)
11    P2(LE+1) = RPI(LE)
      P1( 7 ) = 0.
      P2 ( 1 ) = 0.
      WRITE(6,333)
333   FORMAT(1H0,'  END SR AMHMTM')
C(DEBUGLINE) VERSION CREATED JULY 8 1982 BY J.SELA,NMC.
      RETURN
      END
