C//DELCF we have a routine FLUSH

      SUBROUTINE CPUTIM(TIM)
      IMPLICIT REAL*8 (A-H,O-Z)
C
C     UNIX SYSTEM
C
      REAL T(2),SEC1,ETIME
      SEC1=ETIME(T)
      TIM=DBLE(T(1)+T(2))
C
C dummy
C
C     TIM=0.
C
C  AIX/PS2     
C
C     INTEGER CLOCK
C     I=CLOCK(I)
C     TIM=DBLE(I/1000000.)
C
C RS6000 
C
C     REAL T
C     T=MCLOCK(TIMES)
C     TIM=T/100.
      RETURN
      END
C
      REAL*8 FUNCTION CPTIME(I)
      IMPLICIT REAL*8 (A-H,O-Z)
      INTEGER I
C
      IF (I.EQ.1) THEN
       CALL CPUTIM(X)
       CPTIME=X
      ELSEIF (I.EQ.4.OR.I.EQ.3) THEN
       CALL CPUTIM(X)
       IX1=INT(X/3600.)
       IX2=INT((X-REAL(IX1*3600))/60.)
       X2=X-REAL(IX1*3600 + IX2*60)
       IF (I.EQ.4) THEN
        CALL TIMING(' ALL ')
        WRITE(6,*)
        WRITE (6,9991) IX1,IX2,X2
       END IF
 9991  FORMAT(' TOTAL CPUTIME: ',I5,' hrs '
     -     ,I3,' mins and ',f7.4,' secs')
       CPTIME=X
      ENDIF
      RETURN
      END
C
      SUBROUTINE SECNND(X)
      REAL*8 X,CPTIME
      X=CPTIME(1)
      RETURN
      END
C
      SUBROUTINE TIMG(NOMZ)
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
      CHARACTER*4 NOMZ
      CALL SECNND(FT)
      WRITE(6,100)NOMZ,FT
 100  FORMAT(1X,53('T'),1X,A4,' CPU',F11.3)
      RETURN
      END
C
      SUBROUTINE TIMING(NOMZ)
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
      CHARACTER*4 NOMZ
      CALL SECNND(FT)
      WRITE(6,100)NOMZ,FT
 100  FORMAT(1X,53('T'),1X,A4,' CPU',F11.3)
CF    CALL FLUSH(6)
      RETURN
      END
C
