* PACKAGE UCLOC  
*
*"  [HIS] 90/11/08(numaguti)
*
*******************************************************************
      SUBROUTINE  CLCOUT         
*
*   [INTERNAL SAVE] 
      INTEGER    NCLMAX
      PARAMETER  ( NCLMAX=30 )
      ReaL*8       CPUTIM ( NCLMAX )
      ReaL*8       VPUTIM ( NCLMAX )
      ReaL*8       CPUOLD ( NCLMAX )
      ReaL*8       VPUOLD ( NCLMAX )
      CHARACTER  HTITLE ( NCLMAX ) *16
      DATA       HTITLE / NCLMAX*' ' /
      CHARACTER  HTTL  *(*)
      LOGICAL    OFIRST
      DATA       OFIRST / .TRUE. /
      INTEGER    NCLOCK
      DATA       NCLOCK / 0 /
      SAVE
*
*   [INTERNAL WORK] 
      INTEGER    IC
      ReaL*8       CPUT, VPUT
*
*
      WRITE ( 6,* ) '############## CPU TIME SUMMARY ################'
      DO 1100 IC = 1, NCLOCK
         IF ( HTITLE(IC) .NE. ' ' ) THEN
            WRITE ( 6, 1600 ) HTITLE(IC), CPUTIM(IC), VPUTIM(IC)
         ENDIF
 1100 CONTINUE
 1600 FORMAT ( ' ', A16, 2D15.6 )
*
      CALL YCLOCK ( CPUT, VPUT )
      WRITE ( 6, 1600 ) ' TOTAL TIME = ', CPUT, VPUT
*
      RETURN
*====================================================================
      ENTRY       CLCSTR      
     I          ( HTTL    )
*
      IF ( OFIRST ) THEN
         OFIRST = .FALSE.
         CALL YCLOCL
      ENDIF
*
      CALL YCLOCK ( CPUT, VPUT )
*
      DO 2100 IC = 1, NCLOCK
         IF ( HTITLE( IC ) .EQ. HTTL ) THEN
            CPUOLD( IC ) = CPUT
            VPUOLD( IC ) = VPUT
                                               RETURN
         ENDIF
 2100 CONTINUE
*
      IF ( NCLOCK .LE. NCLMAX ) THEN
         NCLOCK = NCLOCK + 1
         HTITLE( NCLOCK ) = HTTL
         CPUOLD( NCLOCK ) = CPUT
         VPUOLD( NCLOCK ) = VPUT
      ENDIF
*
      RETURN
*====================================================================
      ENTRY       CLCEND      
     I          ( HTTL    )
*
      CALL YCLOCK ( CPUT, VPUT )
*
      DO 3100 IC = 1, NCLOCK
         IF ( HTITLE( IC ) .EQ. HTTL ) THEN
            CPUTIM( IC ) = CPUTIM( IC ) + CPUT - CPUOLD( IC )
            VPUTIM( IC ) = VPUTIM( IC ) + VPUT - VPUOLD( IC )
                                               RETURN
         ENDIF
 3100 CONTINUE
*
      RETURN
      END
