
      SUBROUTINE usrinf(filename)

C---
C subroutine to append user record to filename.rec file
C---
C 4/4/87 - kaa
C---
C
      INTEGER ierr, iunit, lenn
      CHARACTER*(*) filename
      CHARACTER*256 ctmp
      CHARACTER*12 username
      CHARACTER*9 datestring
      CHARACTER*8 timestring

      INTEGER lenact
      CHARACTER cgdocd*128
      EXTERNAL lenact, cgdocd

C
      CALL getlun(iunit)
      CALL xtend(filename, 'rec')
      ctmp = cgdocd()
      lenn = lenact(ctmp)
      ctmp = ctmp(1:lenn)//filename
      CALL openwr(iunit, ctmp, 'unknown', 'e', ' ', 0, 0,
     &            ierr)
      IF (ierr.NE.0) RETURN
C
      CALL getuse(username, ierr)
      IF (ierr.NE.0) RETURN
      CALL getdat(datestring)
      CALL gettim(timestring)
C
      WRITE (iunit, '(3(1x,a))', IOSTAT=ierr) datestring, timestring,
     &                                        username(:lenact(username)
     &                                        )
C
      CLOSE (iunit)
      CALL frelun(iunit)
      END
