C PREABLE FILE TO PREPROCESS MESURX C C RATFOR LIBRARY TIMING ROUTINE MESURX SUBROUTINE MESURX INTEGER * 4 COUNT ( 200 ), TICS, TEMP INTEGER * 4 CALLS ( 200 ), TCALLS INTEGER SFLAG REAL NAMES ( 200 ), NTEMP LOGICAL * 1 HOLD ( 6 ), FN ( 41 ), T ( 9 ), D ( 9 ) COMMON / MESURC / NAMES, COUNT, CALLS, TCALLS, SFLAG, TICS, $NUMNAM, ELAPSD, FN N = NUMNAM NUMNAM = - 1 IF (.NOT.( N . LE . 0 )) GOTO 20000 RETURN 20000 CONTINUE ELAPSD = SECNDS ( ELAPSD ) CLOSE ( UNIT = 1 ) OPEN ( UNIT = 1, NAME = FN ) IF (.NOT.( N . LE . 1 )) GOTO 20002 GO TO 50 20002 CONTINUE DO 20004 I = 1, N - 1 DO 20006 J = 1, N - I IF (.NOT.( COUNT ( J ) . GE . COUNT ( J + 1 ) )) GOTO 20008 GOTO 20006 20008 CONTINUE TEMP = COUNT ( J ) COUNT ( J ) = COUNT ( J + 1 ) COUNT ( J + 1 ) = TEMP NTEMP = NAMES ( J ) NAMES ( J ) = NAMES ( J + 1 ) NAMES ( J + 1 ) = NTEMP TEMP = CALLS ( J ) CALLS ( J ) = CALLS ( J + 1 ) CALLS ( J + 1 ) = TEMP 20006 CONTINUE 20007 CONTINUE 20004 CONTINUE 20005 CONTINUE CALL DATE ( D ) CALL TIME ( T ) 50 WRITE ( 1, 55 ) D, T, ELAPSD, TICS, TCALLS, N 55 FORMAT ( ' PROGRAM RUN ON ', 9A1, ' AND FINISHED AT ', 9A1, / $ ' ', F10 . 2, ' SECONDS ELAPSED TIME' /, 1X, I11, ' SAMPLES', $2X, I11, ' TOTAL CALLS', I8, ' ROUTINES' / / 1X, 'NAME', 12X, $'SAMPLES', 17X, 'CALLS', 8X, 'TIME/EXECUTION' / ) DO 20010 I = 1, N TPRCNT = FLOAT ( COUNT ( I ) ) / FLOAT ( TICS ) * 100 . CPRCNT = FLOAT ( CALLS ( I ) ) / FLOAT ( TCALLS ) * 100 . IF (.NOT.( CALLS ( I ) .GT. 0 )) GOTO 20012 TPERC = ELAPSD * . 01 * TPRCNT / FLOAT ( CALLS ( I ) ) GOTO 20013 20012 CONTINUE TPERC = ELAPSD * . 01 * TPRCNT / 1 . 20013 CONTINUE CALL R50ASC ( 6, NAMES ( I ), HOLD ) WRITE ( 1, 65 ) HOLD, COUNT ( I ), TPRCNT, CALLS ( I ), CPRCNT, $TPERC 65 FORMAT ( 1X, 6A1, I11, 2X, F7 . 2, '%', 2X, I11, 2X, F7 . 2, '%', $ 4X, 1PE11 . 4 ) 20010 CONTINUE 20011 CONTINUE CLOSE ( UNIT = 1 ) RETURN END