
      SUBROUTINE FLOPS(IO,NC,TSTEPS,RCUT,TIME, MX, MY, MZ)
      IMPLICIT NONE
      INTEGER IO, NC, NTOT, TSTEPS
      DOUBLE PRECISION RCUT
      DOUBLE PRECISION TIME
      INTEGER MX, MY, MZ

      INTEGER MULT, MXRED, MYRED, MZRED, NCMARK
      DOUBLE PRECISION FCOUNT, FORCE1, FORCE2, FORCE3
      DOUBLE PRECISION PIRED, SIMBEN, BENCH

      PARAMETER(PIRED = 88/21)

      NTOT = 4*NC*NC*NC

      MULT  = MX * MY * MZ
      MXRED = MX - 2
      MYRED = MY - 2
      MZRED = MZ - 2

      NCMARK = NTOT/MULT
      FORCE1 = (PIRED*MULT*RCUT**3)/27
      FORCE2 = (8+4*(MXRED+MYRED+MZRED)+
     1        2*(MXRED*MYRED+MXRED*MZRED+MYRED*MZRED))/MULT
      FORCE3 = (FORCE1*5*13*NCMARK*MXRED*MYRED*MZRED)/MULT
     
      FCOUNT = 30*NTOT+13.5*NTOT*NCMARK*((9+35*FORCE1)*
     1         (FORCE2+1)+5*FORCE1*FORCE3)

      BENCH=TSTEPS*FCOUNT/TIME/1E6
      SIMBEN=0.03*TSTEPS/TIME

      WRITE(IO,*)
      WRITE(IO,*)'CALCULATION FINISHED.'
      WRITE(IO,*)
      WRITE(IO,*)'Data type - DOUBLE PRECISION'
      WRITE(IO,*)'TOTAL NUMBER OF NOMINAL FLOPS  = ',INT(FCOUNT),' flop'
      WRITE(IO,*)'NUMBER OF TIME-STEPS           = ',TSTEPS,' tstep'
      WRITE(IO,*)
      WRITE(IO,*)'********************************************'
      WRITE(IO,*)
      WRITE(IO,'( 4(A, F7.3, A/))')
     *     'ELAPSED TIME            =',TIME,' s' ,
     *     'TEMPORAL PERFORMANCE    =',TSTEPS/TIME,' tstep/s',
     *     'SIMULATION PERFORMANCE  =',SIMBEN,' sim-ps/s',
     *     'BENCHMARK PERFORMANCE   =',BENCH,' Mflop/s'
      WRITE(IO,*)
      WRITE(IO,*)'********************************************'

      END
