      SUBROUTINE TEND(Z,X,Y,QM,DIM,TEM,A,TO,B,DEL)
      COMPLEX Z( 17 , 17 ),QM( 17 , 17 ),DD,
     1X( 17 , 17 , 7 ),Y( 17 , 17 , 7 ),
     2DIM( 17 , 17 , 7 ),TEM( 17 , 17 , 7 )
      DIMENSION A( 7 , 7 ),B( 7 , 7 ),
     1TO( 7 ),DEL( 7 )
      DO 10 LL=1, 17
      N=LL-2
      DO 10 I=1, 17
      N=N+1
      DO 15 K=1, 7
      F=-DEL(K)
      DD=DIM(LL,I,K)
      Z(LL,I)=Z(LL,I)+CMPLX(F*REAL(DD),F*AIMAG(DD))
      F=N*(N+1.)*TO(K)* 287.05 /( 6370000. * 6370000. )
      DD=QM(LL,I)
      X(LL,I,K)=X(LL,I,K)+CMPLX(F*REAL(DD),F*AIMAG(DD))
      DO 20 KV=1, 7
      F=N*(N+1.)*A(K,KV)
      DD=TEM(LL,I,KV)
      X(LL,I,K)=X(LL,I,K)+CMPLX(F*REAL(DD),F*AIMAG(DD))
      F=B(K,KV)
      DD=DIM(LL,I,KV)
   20 Y(LL,I,K)=Y(LL,I,K)+CMPLX(F*REAL(DD),F*AIMAG(DD))
   15 CONTINUE
   10 CONTINUE
      RETURN
      END
