      program main
      implicit none

      real sz,k,r,t,tdiv,div,v(4),rate
      real psi,xmu,rho,cbscall,camc,ceur,cams
      integer repb,reps,i, j, times

      real timediff,timearray(2),dtime, rtimes

      k = 100.00                                                     
      sz = 110
      repb = 100
      reps = 17
      psi = 1.0
      xmu = 0.0
      rate = 0.15
      rho = 0.234
      k = 100.00                                                   
      r = 4.50                                                             
      t = .25                                                      
      v(1) = 0.15  
      v(2) = 0.15                                                 
      v(3) = 0.15 
      v(4) = 0.15           
      div = 1.0
      tdiv = 0.125
      times = 1
      rtimes = float(times)

c     --- Black-Scholes
      print *,'Black-Sholes:'
      timediff = dtime(timearray)
      do 4000 i = 1, times
         call bscall(sz,k,rate,t,v(1),cbscall)
 4000 continue
      timediff = dtime(timearray)/rtimes
      print *,'Value =', cbscall,' Total time = ',timediff
      
      print *
      
c --- constant volatility American Model
      print *,'constant volatility American Model:'
      timediff = dtime(timearray)
      do 5000 i = 1, times
         call binomc(sz,k,rate,t,v(2),tdiv,div,repb,camc)
 5000 continue
      timediff = dtime(timearray)/rtimes
      print *,'Value =', camc, ' Total time = ',timediff
      
      print *
      
c --- stochastic volatility European Model
      print *,'stochastic volatility European Model'
      print *,'--------------------------------------'
      print *,'reps           Value       Time(sec.)'
      do 1111 reps = 17, 17
         timediff = dtime(timearray)
         do 6000 i = 1, times
            call svcorp2(sz,k,rate,t,v(3),psi,xmu,rho,reps,ceur)
 6000    continue
         timediff = dtime(timearray)/rtimes
         write(*,'(I3,9X,f9.4,5X,f8.4)') reps,ceur,timediff
 1111 continue
      
 9991 print *

c --- stochastic volatility American Model
      print *,'stochastic volatility American Model'
      print *,'reps   reps1       Value       Time(sec.)'
      print *,'-----------------------------------------'
      
      do 2222 reps = 17, 17
         do 3333 j = 0, reps-1
            tdiv = t*j/float(reps)
            timediff = dtime(timearray)
            do 7000 i = 1, times
               call asvcorp2(sz,k,rate,t,v(4),tdiv,div,psi,
     &              xmu,rho,reps,cams) 
 7000       continue
            timediff = dtime(timearray)/rtimes
        write(*,'(I3,5X,I3,5X,f9.4,5X,f8.4)') reps,(INT(reps*tdiv/t)+1),
     &  cams,timediff
 3333 continue
 2222 continue

      stop
      end




