        SUBROUTINE MAKMAT(OUTFIL,NSTAT,N1,ERRCD,ERRMSG)
C
C       FUNCTION:
CF
CF
C       USAGE:
CU
CU
C       INPUTS:
CI
CI
C       OUTPUTS:
CO
CO
C       ALGORITHM:
CA
CA
C       MACHINE DEPENDENCIES:
CM
CM
C       HISTORY:
CH
CH      written by:
CH      date:
CH      current version:
CH      modifications:
CH				added dpcom: 7/16/88 jdb
CH
C       ROUTINES CALLED:
CC
CC
C       COMMON MEMORY USED:
CM
CM      DPCOM -- see dpcommon.f and dpcom.f
CM
C----------------------------------------------------------------------
C       written for:    The CASCADE Project
C                       Oak Ridge National Laboratory
C                       U.S. Department of Energy
C                       contract number DE-AC05-840R21400
C                       subcontract number 37B-07685C S13
C                       organization:   The University of Tennessee
C----------------------------------------------------------------------
C       THIS SOFTWARE IS IN THE PUBLIC DOMAIN
C       NO RESTRICTIONS ON ITS USE ARE IMPLIED
C----------------------------------------------------------------------
C
C
        INCLUDE         'Parameter.f'
C
        DOUBLE PRECISION        ZERO(SIZE,SIZE)
        DOUBLE PRECISION        IDENT(SIZE,SIZE)
C
        INTEGER                 ERRCD
        INTEGER                 NSTAT
        INTEGER                 N1
C
        CHARACTER*(*)           ERRMSG
        CHARACTER*(*)           OUTFIL
C
	INCLUDE			'dpcom.f'
C
        ERRCD=0
C
        DO 10, I = 1, NSTAT
          DO 10, J = 1, NSTAT
            ZERO(J,I) = 0.D0
 10     CONTINUE
C
        DO 20, I = 1, N1
          DO 30, J = 1, N1
            IDENT(J,I) = 0.D0
 30       CONTINUE
          IDENT(I,I) = 1.D0
 20     CONTINUE
C
        OPEN (UNIT=UNIT1,FILE=OUTFIL,ERR=9999)
        DO 40, I = 1, NSTAT
          WRITE (UNIT1,*,ERR=9999) (ZERO(I,J),J=1,NSTAT)
 40     CONTINUE
        DO 50, I = 1, N1
            WRITE (UNIT1,*,ERR=9999) (IDENT(I,J),J=1,N1)
 50     CONTINUE
        CLOSE (UNIT=UNIT1)
C
        RETURN
C
C--ERROR EXIT
C
9999    ERRCD=1
        ERRMSG = 'MAKMAT: fatal error writing '//OUTFIL
        CLOSE (UNIT=UNIT1)
        RETURN
        END