+       SUBROUTINE ACTIME(IOPT,IPR,ISP,IERR)CAC_TITLE  ACTIME: output the connect and cpu times and I/O counts.C;C_ARGS     TYPE       VARIABLE        I/O      DESCRIPTION 	C        ;        CHARACTER*2     IOPT          !I        option codeC        INTEGER*4       IPR           !I        logical unit number;C                                               for printerC        INTEGER*4       ISP           !I        logical unit number=C                                               for terminal >        INTEGER*4       IERR          !O         error code   CCCC_HIST  85Jun18    Verna Gregg  U.S.G.S. Flagstaff Original Version=C       86Sept29   Joni Bauers_JB  updated documentation     CC_ENDG*********************************************************************** "        CHARACTER*2 IOP(2), ACTION	DATA IOP/'IN','WT'/HC***********************************************************************GC   CALL ACTINF to extract accounting information before any processingC   is performed.AC       ICON1 = current connect time of process in milli-seconds.?C	ICPU1 = current cpu time elapsed in process in milli-seconds.1C	IDIR1 = number of direct I/O counts in process.+C	IFLT1 = number of page faults in process.HC*********************************************************************** 	ACTION = 'CO'	IF (IERR .EQ. 0) ACTION = 'AB'	IF (IOPT .EQ. IOP(1)) THEN3        CALL ACTINF(ICON1,ICPU1,IDIR1,IFLT1,IERROR)#           IF (IERROR .NE. 0) THEN .	      CALL ERRMES('ACTIME','ACTIME',1,ACTION)	      IERR = -1		   ENDIF	ELSEIC************************************************************************FC   CALL ACTINF to get current process information, then calculate and%C   print the accounting information.IC************************************************************************	IF (IOPT .EQ. IOP(2)) THEN/        CALL ACTINF(ICON,ICPU,IDIR,IFLT,IERROR)	   IF (IERROR .NE. 0) THEN.	      CALL ERRMES('ACTIME','ACTIME',1,ACTION)	      IERR = -1		   ENDIF	   ICON = ICON - ICON1	   ICPU = ICPU - ICPU1	   IDIR = IDIR - IDIR1	   IFLT = IFLT - IFLT1	   ICONM = ICON / 60	   ICONS = (ICON - ICONM * 60)	   ICPUM = ICPU / 60000"	   ILEFT = (ICPU - ICPUM * 60000)	   ICPUS = ILEFT / 1000'	   ICPUH = (ILEFT - ICPUS * 1000) / 10<	   WRITE (ISP,1000) ICONM,ICONS,ICPUM,ICPUS,ICPUH,IDIR,IFLT<	   WRITE (IPR,1000) ICONM,ICONS,ICPUM,ICPUS,ICPUH,IDIR,IFLT>1000	   FORMAT(' *** END ***',I4,':',I2.2,'(connect) ',I4,':',;     .	   I2.2,'.',I2.2,'(cpu)',I6,'(I/0)',I6,'(faults)',/)	ELSEJC*************************************************************************C   INVALID OPTION CODE.JC*************************************************************************+	   CALL ERRMES('ACTIME','ACTIME',2,ACTION)
	   IERR = -1	ENDIF	ENDIF	RETURN	END