      SUBROUTINE CMMULT(M,R1,R2,R3,R4,S1,S2,S3,S4,MX,W1,W2,W3,W4)
C
C     THIS SUBROUTINE ACCUMULATES THE PRODUCT OF THE TRANSITION
C     MATRICES R (CONSISTING OF R1,R2,R3 AND R4) IN THE MATRIX S
C     (CONSISTING OF S1,S2,S3 AND S4).
C
C
      IMPLICIT REAL*8 (A-H,O-Z)
      COMPLEX*16 R1(MX,MX),R2(MX,MX),R3(MX,MX),R4(MX,MX)
      COMPLEX*16 S1(MX,MX),S2(MX,MX),S3(MX,MX),S4(MX,MX)
      COMPLEX*16 W1(MX,MX),W2(MX,MX),W3(MX,MX),W4(MX,MX)
      COMPLEX*16 SUM1,SUM2,SUM3,SUM4,ZERO
C
C
      ZERO=DCMPLX(0.0,0.0)
C
      DO 300 II=1,M
      DO 200 I=1,M
C
      SUM1=ZERO
      SUM2=ZERO
      SUM3=ZERO
      SUM4=ZERO
C
      DO 100 K=1,M
C
      SUM1=SUM1+R1(II,K)*S1(K,I)+R2(II,K)*S3(K,I)
      SUM2=SUM2+R1(II,K)*S2(K,I)+R2(II,K)*S4(K,I)
      SUM3=SUM3+R3(II,K)*S1(K,I)+R4(II,K)*S3(K,I)
      SUM4=SUM4+R3(II,K)*S2(K,I)+R4(II,K)*S4(K,I)
C
  100 CONTINUE
C
      W1(II,I)=SUM1
      W2(II,I)=SUM2
      W3(II,I)=SUM3
      W4(II,I)=SUM4
C
  200 CONTINUE
  300 CONTINUE
C
      DO 600 II=1,M
      DO 500 I=1,M
C
      S1(II,I)=W1(II,I)
      S2(II,I)=W2(II,I)
      S3(II,I)=W3(II,I)
      S4(II,I)=W4(II,I)
C
  500 CONTINUE
  600 CONTINUE
C
      RETURN
      END
