      SUBROUTINE DGEMM_NOTRANS_NOTRANS( M, N, K, ALPHA, A, LDA, 
     %                 B, LDB, BETA, C, LDC )
*     .. Scalar Arguments ..
      INTEGER            M, N, K, LDA, LDB, LDC
      DOUBLE PRECISION   ALPHA, BETA
*     .. Array Arguments ..
      DOUBLE PRECISION   A( LDA, * ), B( LDB, * ), C( LDC, * )



*     .. External Functions ..
      LOGICAL            LSAME
      EXTERNAL           LSAME
*     .. External Subroutines ..
      EXTERNAL           XERBLA
*     .. Intrinsic Functions ..
      INTRINSIC          MAX
*     .. Local Scalars ..
      LOGICAL            NOTA, NOTB
      INTEGER            I, INFO, J, L, NCOLA, NROWA, NROWB
      DOUBLE PRECISION   TEMP
*     .. Parameters ..
      DOUBLE PRECISION   ONE         , ZERO
      PARAMETER        ( ONE = 1.0D+0, ZERO = 0.0D+0 )
*     ..
*     .. Executable Statements ..
*
*     Set  NOTA  and  NOTB  as  true if  A  and  B  respectively are not
*     transposed and set  NROWA, NCOLA and  NROWB  as the number of rows
*     and  columns of  A  and the  number of  rows  of  B  respectively.
*
      NOTA  = .TRUE.
      NOTB  = .TRUE.

      NROWA = M
      NCOLA = K

      NROWB = K
*
*     Test the input parameters.
*

*
*     Quick return if possible.
*
      IF( ( M.EQ.0 ).OR.( N.EQ.0 ).OR.
     $    ( ( ( ALPHA.EQ.ZERO ).OR.( K.EQ.0 ) ).AND.( BETA.EQ.ONE ) ) )
     $   RETURN
*
*     And if  alpha.eq.zero.
*
      IF( ALPHA.EQ.ZERO )THEN
         IF( BETA.EQ.ZERO )THEN
            DO 20, J = 1, N
               DO 10, I = 1, M
                  C( I, J ) = ZERO
   10          CONTINUE
   20       CONTINUE
         ELSE
            DO 40, J = 1, N
               DO 30, I = 1, M
                  C( I, J ) = BETA*C( I, J )
   30          CONTINUE
   40       CONTINUE
         END IF
         RETURN
      END IF
*
*     Start the operations.
*
*     
*     Form  C := alpha*A*B + beta*C.
*     
      DO 90, J = 1, N
         IF( BETA.EQ.ZERO )THEN
            DO 50, I = 1, M
               C( I, J ) = ZERO
 50         CONTINUE
         ELSE IF( BETA.NE.ONE )THEN
            DO 60, I = 1, M
               C( I, J ) = BETA*C( I, J )
 60         CONTINUE
         END IF
         DO 80, L = 1, K
            IF( B( L, J ).NE.ZERO )THEN
               TEMP = ALPHA*B( L, J )
               DO 70, I = 1, M
                  C( I, J ) = C( I, J ) + TEMP*A( I, L )
 70            CONTINUE
            END IF
 80      CONTINUE
 90   CONTINUE
*
      RETURN
*
*     End of DGEMM .
*
      END
