Sun Apr 19 16:06:28 1992CM5 Fortran Version: 1.1.3  SourceRev: f5000	page: 1
Source Listing File: /export/home/A/gcheng/finance/enew2.fcm
    1     1  1 	cc finance92.for          1/19/92  "European Models"
    2     2  1 	
    3     3  1 	      program finance92
    4     4  1 	
    5     5  1 	      real a1,a2,xmu,rho,sig              
    6     6  1 	      real s,k,r,t,v,vic(3),hedge                          
    7     7  1 	      real cl(4),clp,cl0,cln,biasp,bias0,biasn  
    8     8  1 	      real sz,kz,tz,cz                           
    9     9  1 	      real er(4),clb,bias,biasx                  
   10    10  1 	      real emax(4),emin(4),ser(4),varm(75,4),mean(4)  
   11    11  1 	      real sd(4),en,sz2,k2                               
   12    12  1 	      real ksh,ksl,vh,vl,cdvh(3),cdvl(3),cv0(3),kl,kh
   13    13  1 	      real clba,va,ksa,ka,ks               
   14    14  1 	      real pdvh(3),pdvl(3)                    
   15    15  1 	      real clbl,clbh,psi,none,pone,cor,clp2,clp3,clp4,clp5
   16    16  1 	     &        clp6,clp7
   17    17  1 	
   18    18  1 	      real vv(200),hh(200),ccl(200)
   19    19  1 	      
   20    20  1 	      integer reps,errst,nt,srep,rep0,repn,repp       
   21    21  1 	      integer repp2,repn2,bmethd,smethd               
   22    22  1 	
   23    23  1 	      bmethd=1
   24    24  1 	      smethd=0                                                   
   25    25  1 	      s=100.00                                                     
   26    26  1 	      sz=s-10.00                                                          
   27    27  1 	      sz2=s+10.00                                   
   28    28  1 	  200 continue                                                
   29    29  1 	      rep0=200
   30    30  1 	      repn=200
   31    31  1 	      repp=200                                                  
   32    32  1 	      repp2=17
   33    33  1 	      repn2=17                                                      
   34    34  1 	      srep=16384
   35    35  1 	      nt=90                                                   
   36    36  1 	      psi=1.0
   37    37  1 	      xmu=0.0                                                    
   38    38  1 	      rho=-1.0                                                     
   39    39  1 	      none=-1.0                                                
   40    40  1 	      pone=1.0                                                        
   41    41  1 	      iflg=0                                                   
   42    42  1 	      k=100.00                                                   
   43    43  1 	      r=2.34                                                             
   44    44  1 	      t=.25                                                      
   45    45  1 	      v=0.15     
   46    46  1 	c      call CM_set_safety_mode(0)   ! Turn off run-time c 
   47    47  1 	                                          
   48    48  1 	      do i = 13,20
   49    49  1 	         print *,'i = ',i
   50    50  1 	 
   51    51  1 	        cor = 1.0 
   52    52  1 	        call CM_timer_clear(1)
Sun Apr 19 16:06:28 1992CM5 Fortran Version: 1.1.3  SourceRev: f5000	page: 2
Source Listing File: /export/home/A/gcheng/finance/enew2.fcm
   53    53  1 	        call CM_timer_start(1)
   54    54  1 	        do ii=1,10
   55    55  1 	         call svcorp2(sz,k,r,t,v,psi,xmu,cor,i,clp2)   
   56    56  1 	        enddo    
   57    57  1 	        call CM_timer_stop(1)
   58    58  1 	        call CM_timer_print(1)
   59    59  1 	        print *,'old value= ',clp2
   60    60  1 	
   61    61  1 	        cor = 1.0
   62    62  1 	        call CM_timer_clear(1)
   63    63  1 	         call CM_timer_start(1)
   64    64  1 	        do ii=1,10
   65    65  1 	         call svcorp4(sz,k,r,t,v,psi,xmu,cor,i,clp4)    
   66    66  1 	        enddo     
   67    67  1 	         call CM_timer_stop(1)
   68    68  1 	        call CM_timer_print(1)
   69    69  1 	c        print *,'new4 value= ',clp4
   70    70  1 	
   71    71  1 	        cor = 1.0
   72    72  1 	        call CM_timer_clear(1)
   73    73  1 	         call CM_timer_start(1)
   74    74  1 	        do ii=1,10
   75    75  1 	         call svcorp5(sz,k,r,t,v,psi,xmu,cor,i,clp5)  
   76    76  1 	         enddo         
   77    77  1 	        call CM_timer_stop(1)
   78    78  1 	        call CM_timer_print(1)
   79    79  1 	        print *,'new5 value= ',clp5
   80    80  1 	
   81    81  1 	        cor = 1.0
   82    82  1 	        call CM_timer_clear(1)
   83    83  1 	         call CM_timer_start(1)
   84    84  1 	        do ii=1,10
   85    85  1 	         call svcorp6(sz,k,r,t,v,psi,xmu,cor,i,clp6)  
   86    86  1 	         enddo         
   87    87  1 	        call CM_timer_stop(1)
   88    88  1 	        call CM_timer_print(1)
   89    89  1 	        print *,'new6 value= ',clp6
   90    90  1 	
   91    91  1 	      enddo
   92    92  1 	
   93    93  1 	      stop
   94    94  1 	      end
   95    95  1 	
   96    96  1 	C       ROUTINE NAME       - SVCORP2
   97    97  1 	C
   98    98  1 	c----------------------------------------------------------------------
   99    99  1 	c       PURPOSE           - THIS SUBROUTINE CALCULATES THE VALUE OF A
  100   100  1 	C                           EUROPEAN CALL WITH STOCHASTIC VOLATILITY
  101   101  1 	C                           AND A CORRELATION OF 1 OR -1 WITH THE STOCK
  102   102  1 	C                           PRICE BY USING A BINOMIAL APPROX. TO THE
  103   103  1 	C                           LOGNORMAL VOLATILITY DISTRIBUTION.
  104   104  1 	C                           (FULL LATTICE)
Sun Apr 19 16:06:28 1992CM5 Fortran Version: 1.1.3  SourceRev: f5000	page: 3
Source Listing File: /export/home/A/gcheng/finance/enew2.fcm
  105   105  1 	C       REQUIRED ROUTINES - NONE
  106   106  1 	C
  107   107  1 	C----------------------------------------------------------------------
  108   108  1 	C
Sun Apr 19 16:06:28 1992CM5 Fortran Version: 1.1.3  SourceRev: f5000	page: 4
Symbol Storage Map   File: /export/home/A/gcheng/finance/enew2.fcm
ENTRY POINTS
  Offset  Type    Name
       0  NONE    FINANCE92                       


STORAGE BLOCKS
    Size  Block
     116  local
     267  constants




VARIABLES
  Offset    Size  Type        Block           Name
     ---       4  REAL4       not-referenced  FE       A1                              
     ---       4  REAL4       not-referenced  FE       A2                              
     ---       4  REAL4       not-referenced  FE       BIAS                            
     ---       4  REAL4       not-referenced  FE       BIAS0                           
     ---       4  REAL4       not-referenced  FE       BIASN                           
     ---       4  REAL4       not-referenced  FE       BIASP                           
     ---       4  REAL4       not-referenced  FE       BIASX                           
     128       4  INT4        local           FE       BMETHD                          
     ---       4  REAL4       not-referenced  FE       CL0                             
     ---       4  REAL4       not-referenced  FE       CLB                             
     ---       4  REAL4       not-referenced  FE       CLBA                            
     ---       4  REAL4       not-referenced  FE       CLBH                            
     ---       4  REAL4       not-referenced  FE       CLBL                            
     ---       4  REAL4       not-referenced  FE       CLN                             
     ---       4  REAL4       not-referenced  FE       CLP                             
     200       4  REAL4       local           FE       CLP2                            
     ---       4  REAL4       not-referenced  FE       CLP3                            
     192       4  REAL4       local           FE       CLP4                            
      88       4  REAL4       local           FE       CLP5                            
     ---       4  REAL4       not-referenced  FE       CLP5CLP6                        
      80       4  REAL4       local           FE       CLP6                            
     ---       4  REAL4       not-referenced  FE       CLP7                            
     208       4  REAL4       local           FE       COR                             
     ---       4  REAL4       not-referenced  FE       CZ                              
     ---       4  REAL4       not-referenced  FE       EN                              
     ---       4  INT4        not-referenced  FE       ERRST                           
     ---       0  NONE        not-referenced  FE       FINANCE92_constants             
     ---       4  REAL4       not-referenced  FE       HEDGE                           
     104       4  INT4        local           FE       I                               
     112       4  INT4        local           FE       IFLG                            
      96       4  INT4        local           FE       II                              
     280       4  REAL4       local           FE       K                               
     ---       4  REAL4       not-referenced  FE       K2                              
     ---       4  REAL4       not-referenced  FE       KA                              
     ---       4  REAL4       not-referenced  FE       KH                              
     ---       4  REAL4       not-referenced  FE       KL                              
     ---       4  REAL4       not-referenced  FE       KS                              
     ---       4  REAL4       not-referenced  FE       KSA                             
Sun Apr 19 16:06:28 1992CM5 Fortran Version: 1.1.3  SourceRev: f5000	page: 5
Symbol Storage Map   File: /export/home/A/gcheng/finance/enew2.fcm
     ---       4  REAL4       not-referenced  FE       KSH                             
     ---       4  REAL4       not-referenced  FE       KSL                             
     ---       4  REAL4       not-referenced  FE       KZ                              
     224       4  REAL4       local           FE       NONE                            
     184       4  INT4        local           FE       NT                              
     216       4  REAL4       local           FE       PONE                            
     232       4  REAL4       local           FE       PSI                             
     272       4  REAL4       local           FE       R                               
     168       4  INT4        local           FE       REP0                            
     160       4  INT4        local           FE       REPN                            
     136       4  INT4        local           FE       REPN2                           
     152       4  INT4        local           FE       REPP                            
     144       4  INT4        local           FE       REPP2                           
     ---       4  INT4        not-referenced  FE       REPS                            
     296       4  REAL4       local           FE       RHO                             
     288       4  REAL4       local           FE       S                               
     ---       4  REAL4       not-referenced  FE       SIG                             
     120       4  INT4        local           FE       SMETHD                          
     176       4  INT4        local           FE       SREP                            
     248       4  REAL4       local           FE       SZ                              
     240       4  REAL4       local           FE       SZ2                             
     264       4  REAL4       local           FE       T                               
     ---       4  REAL4       not-referenced  FE       TZ                              
     256       4  REAL4       local           FE       V                               
     ---       4  REAL4       not-referenced  FE       VA                              
     ---       4  REAL4       not-referenced  FE       VH                              
     ---       4  REAL4       not-referenced  FE       VL                              
     304       4  REAL4       local           FE       XMU                             


ARRAYS
  Offset    Size  Type        Block/Class     Home     Name
     ---     ---  REAL4       not-referenced  FE       CCL                             
     ---     ---  REAL4       not-referenced  FE       CDVH                            
     ---     ---  REAL4       not-referenced  FE       CDVL                            
     ---     ---  REAL4       not-referenced  FE       CL                              
     ---     ---  REAL4       not-referenced  FE       CV0                             
     ---     ---  REAL4       not-referenced  FE       EMAX                            
     ---     ---  REAL4       not-referenced  FE       EMIN                            
     ---     ---  REAL4       not-referenced  FE       ER                              
     ---     ---  REAL4       not-referenced  FE       HH                              
     ---     ---  REAL4       not-referenced  FE       MEAN                            
     ---     ---  REAL4       not-referenced  FE       PDVH                            
     ---     ---  REAL4       not-referenced  FE       PDVL                            
     ---     ---  REAL4       not-referenced  FE       SD                              
     ---     ---  REAL4       not-referenced  FE       SER                             
     ---     ---  REAL4       not-referenced  FE       VARM                            
     ---     ---  REAL4       not-referenced  FE       VIC                             
     ---     ---  REAL4       not-referenced  FE       VV                              


PARAMETERS (Offset is within Storage Block 'constants')
Sun Apr 19 16:06:28 1992CM5 Fortran Version: 1.1.3  SourceRev: f5000	page: 6
Symbol Storage Map   File: /export/home/A/gcheng/finance/enew2.fcm
  Offset  Type    Name                            Value


INTRINSIC PROCEDURES
  Name


STATEMENT FUNCTIONS
  Type    Name


EXTERNALS
  Type    Unit_Kind     Name
  NONE    subroutine    CM_TIMER_CLEAR                  
  NONE    subroutine    CM_TIMER_PRINT                  
  NONE    subroutine    CM_TIMER_START                  
  NONE    subroutine    CM_TIMER_STOP                   
  NONE    subroutine    SVCORP2                         
  NONE    subroutine    SVCORP4                         
  NONE    subroutine    SVCORP5                         
  NONE    subroutine    SVCORP6                         


NAME LISTS
  Name


CONSTRUCT NAMES
  Name



COMMUNICATION ROUTINES
  Name                          Line Number (number of times)


Sun Apr 19 16:06:28 1992CM5 Fortran Version: 1.1.3  SourceRev: f5000	page: 7
Source Listing File: /export/home/A/gcheng/finance/enew2.fcm
  109   109  1 	      subroutine svcorp2(s,x,r,t,v,psi,xmu,cor,reps,call)
  110   110  1 	      implicit none
  111   111  1 	
  112   112  1 	      real s,x,r,t,v,psi,xmu,cor,call
  113   113  1 	      integer reps
  114   114  1 	
  115   115  1 	      real,array(1:2**reps) :: s1,v1,ux,dx,atmp1,atmp2
  116   116  1 	      real u,d,dt,r1,tmp1,tmp2,rx,xreps
  117   117  1 	      integer i,n
  118   118  1 	cmf$  layout ux(:news),dx(:news),atmp1(:news),atmp2(:news)
  119   119  1 	cmf$  layout s1(:news),v1(:news)
  120   120  1 	
  121   121  1 	      xreps = float(reps)
  122   122  1 	      dt = t/xreps
  123   123  1 	
  124   124  1 	CCCC  SET RX (PERIODIC 1+RF) TO RISK FREE RATE + 1
  125   125  1 	
  126   126  1 	      rx=(r+1.0)**dt
  127   127  1 	
  128   128  1 	      tmp1 = (xmu-0.5*psi*psi)*dt
  129   129  1 	      tmp2 = cor*psi*sqrt(dt) 
  130   130  1 	      u = exp(tmp1+tmp2)
  131   131  1 	      d = exp(tmp1-tmp2)
  132   132  1 	
  133   133  1 	cccc  create stock price lattice (sl)
  134   134  1 	        
  135   135  1 	      v1 = 0.0
  136   136  1 	      s1 = 0.0
  137   137  1 	
  138   138  1 	      v1(1) = v*v
  139   139  1 	      s1(1) = s
  140   140  1 	      n = 1
  141   141  1 	      do i = 1,reps
  142   142  1 	         atmp1 = (r-0.5*v1)*dt
  143   143  1 	         atmp2 = sqrt(v1*dt)
  144   144  1 		 ux = exp(atmp1+atmp2)
  145   145  1 	         dx = exp(atmp1-atmp2)
  146   146  1 	         v1 =  u*v1 + eoshift(d*v1,dim = 1,shift = -n)
  147   147  1 	         s1 = ux*s1 + eoshift(dx*s1,dim = 1,shift = -n)
  148   148  1 	         n = 2*n
  149   149  1 	      enddo
  150   150  1 	
  151   151  1 	cccc  calculate call price
  152   152  1 	
  153   153  1 	      s1 = s1 - x   
  154   154  1 	      where (s1.lt.0.0)  s1 = 0.0
  155   155  1 	      call = SUM(s1)/((2*rx)**xreps)
  156   156  1 	
  157   157  1 	      return
  158   158  1 	      end
  159   159  1 	
Sun Apr 19 16:06:28 1992CM5 Fortran Version: 1.1.3  SourceRev: f5000	page: 8
Symbol Storage Map   File: /export/home/A/gcheng/finance/enew2.fcm
ENTRY POINTS
  Offset  Type    Name
       0  NONE    SVCORP2                         


STORAGE BLOCKS
    Size  Block
      36  local
      60  constants




VARIABLES
  Offset    Size  Type        Block           Name
     ---       4  REAL4       dummy           FE       CALL                            
     ---       4  REAL4       dummy           FE       COR                             
      88       4  REAL4       local           FE       D                               
      80       4  REAL4       local           FE       DT                              
      40       4  INT4        local           FE       I                               
      32       4  INT4        local           FE       N                               
     ---       4  REAL4       dummy           FE       PSI                             
     ---       4  REAL4       dummy           FE       R                               
     ---       4  REAL4       not-referenced  FE       R1                              
     ---       4  INT4        dummy           FE       REPS                            
      56       4  REAL4       local           FE       RX                              
     ---       4  REAL4       dummy           FE       S                               
     ---       0  NONE        not-referenced  FE       SVCORP2_constants               
     ---       4  REAL4       dummy           FE       T                               
      72       4  REAL4       local           FE       TMP1                            
      64       4  REAL4       local           FE       TMP2                            
      96       4  REAL4       local           FE       U                               
     ---       4  REAL4       dummy           FE       V                               
     ---       4  REAL4       dummy           FE       X                               
     ---       4  REAL4       dummy           FE       XMU                             
      48       4  REAL4       local           FE       XREPS                           
     ---       0  NONE        not-referenced  FE       _svcorp2_pe_code_0              
     ---       0  NONE        global          FE       _svcorp2_pe_code_1              
     ---       0  NONE        global          FE       _svcorp2_pe_code_2              
     ---       0  NONE        global          FE       _svcorp2_pe_code_3              
     ---       0  NONE        global          FE       _svcorp2_pe_code_4              


ARRAYS
  Offset    Size  Type        Block/Class     Home     Name
     ---     ---  REAL4       local-automatic CM       ATMP1                           
     ---     ---  REAL4       local-automatic CM       ATMP2                           
     ---     ---  REAL4       local-automatic CM       DX                              
     ---     ---  REAL4       local-automatic CM       S1                              
     ---     ---  REAL4       local-automatic CM       UX                              
     ---     ---  REAL4       local-automatic CM       V1                              


Sun Apr 19 16:06:28 1992CM5 Fortran Version: 1.1.3  SourceRev: f5000	page: 9
Symbol Storage Map   File: /export/home/A/gcheng/finance/enew2.fcm
PARAMETERS (Offset is within Storage Block 'constants')
  Offset  Type    Name                            Value


INTRINSIC PROCEDURES
  Name
  EOSHIFT                         
  EXP                             
  FLOAT                           
  SQRT                            
  SUM                             


STATEMENT FUNCTIONS
  Type    Name


EXTERNALS
  Type    Unit_Kind     Name


NAME LISTS
  Name


CONSTRUCT NAMES
  Name



COMMUNICATION ROUTINES
  Name                          Line Number (number of times)
  SUM (into scalar)             155
  EOSHIFT                       146, 147


Sun Apr 19 16:06:28 1992CM5 Fortran Version: 1.1.3  SourceRev: f5000	page: 10
Source Listing File: /export/home/A/gcheng/finance/enew2.fcm
  160   160  1 	      subroutine svcorp4(s,x,r,t,v,psi,xmu,cor,reps,call)
  161   161  1 	      implicit none
  162   162  1 	
  163   163  1 	      real s,x,r,t,v,psi,xmu,cor,call
  164   164  1 	      integer reps
  165   165  1 	
  166   166  1 	      real,array(1:(2**(reps-12)-1),1:8192) :: ss1,vv1,uux,ddx,
  167   167  1 	     &                                     aatmp1,aatmp2
  168   168  1 	      real u,d,dt,r1,tmp1,tmp2,rx,xreps
  169   169  1 	      integer i,n,reps1,nreps1
  170   170  1 	
  171   171  1 	cmf$  layout ss1(:serial,:news),vv1(:serial,:news)
  172   172  1 	cmf$  layout uux(:serial,:news),ddx(:serial,:news)
  173   173  1 	cmf$  layout aatmp1(:serial,:news),aatmp2(:serial,:news)
  174   174  1 	
  175   175  1 	CMPF MAP ss1(MEMORY,ALLBITS),vv1(MEMORY,ALLBITS)
  176   176  1 	CMPF MAP uux(MEMORY,ALLBITS),ddx(MEMORY,ALLBITS)
  177   177  1 	CMPF MAP aatmp1(MEMORY,ALLBITS),aatmp2(MEMORY,ALLBITS)
  178   178  1 	
  179   179  1 	      xreps = float(reps)
  180   180  1 	      dt = t/xreps
  181   181  1 	
  182   182  1 	CCCC  SET RX (PERIODIC 1+RF) TO RISK FREE RATE + 1
  183   183  1 	
  184   184  1 	      rx=(r+1.0)**dt
  185   185  1 	
  186   186  1 	      tmp1 = (xmu-0.5*psi*psi)*dt
  187   187  1 	      tmp2 = cor*psi*sqrt(dt) 
  188   188  1 	      u = exp(tmp1+tmp2)
  189   189  1 	      d = exp(tmp1-tmp2)
  190   190  1 	
  191   191  1 	cccc  create stock price lattice (sl)
  192   192  1 	        
  193   193  1 	      vv1(1,:) = 0.0
  194   194  1 	      ss1(1,:) = 0.0
  195   195  1 	
  196   196  1 	      vv1(1,1) = v*v
  197   197  1 	      ss1(1,1) = s
  198   198  1 	      n = 1
  199   199  1 	      do i = 1,13
  200   200  1 	         aatmp1(1,:) = (r-0.5*vv1(1,:))*dt
  201   201  1 	         aatmp2(1,:) = sqrt(vv1(1,:)*dt)
  202   202  1 		 uux(1,:) = exp(aatmp1(1,:)+aatmp2(1,:))
  203   203  1 	         ddx(1,:) = exp(aatmp1(1,:)-aatmp2(1,:))
  204   204  1 	         vv1(1,:) =  u*vv1(1,:) + 
  205   205  1 	     &      eoshift(d*vv1(1,:),dim = 1,shift = -n)
  206   206  1 	         ss1(1,:) = uux(1,:)*ss1(1,:) + 
  207   207  1 	     &      eoshift(ddx(1,:)*ss1(1,:),dim = 1,shift = -n)
  208   208  1 	         n = 2*n
  209   209  1 	      enddo
  210   210  1 	
  211   211  1 	      if (reps.gt.13) then
Sun Apr 19 16:06:28 1992CM5 Fortran Version: 1.1.3  SourceRev: f5000	page: 11
Source Listing File: /export/home/A/gcheng/finance/enew2.fcm
  212   212  1 	         reps1 = reps - 13
  213   213  1 	         nreps1 = 2**(reps1+1) - 1
  214   214  1 	         
  215   215  1 	         do i = 1, nreps1/2
  216   216  1 	           aatmp1(i,:) = (r-0.5*vv1(i,:))*dt
  217   217  1 	           aatmp2(i,:) = sqrt(vv1(i,:)*dt)
  218   218  1 		   uux(i,:) = exp(aatmp1(i,:)+aatmp2(i,:))
  219   219  1 	           ddx(i,:) = exp(aatmp1(i,:)-aatmp2(i,:))
  220   220  1 	           vv1(2*i,:) =  u*vv1(i,:)  
  221   221  1 	           vv1((2*i+1),:) = d*vv1(i,:)
  222   222  1 	           ss1(2*i,:) = uux(i,:)*ss1(i,:)
  223   223  1 	           ss1((2*i+1),:) = ddx(i,:)*ss1(i,:)
  224   224  1 	           ss1(i,:) = 0.0
  225   225  1 	         enddo
  226   226  1 	     
  227   227  1 	         ss1 = ss1 - x  
  228   228  1 	         call =  SUM(ss1,mask=ss1.gt.0.0)/((2*rx)**xreps)
  229   229  1 	      else
  230   230  1 	cccc  calculate call price
  231   231  1 	
  232   232  1 	          ss1 = ss1 - x
  233   233  1 	          call =  SUM(ss1(1,:),mask=ss1(1,:).gt.0.0)/((2*rx)**xreps)  
  234   234  1 	c        where (s1.lt.0.0)  s1 = 0.0
  235   235  1 	c        call = SUM(s1)/((2*rx)**xreps)
  236   236  1 	      endif
  237   237  1 	
  238   238  1 	      return
  239   239  1 	      end
  240   240  1 	
Sun Apr 19 16:06:28 1992CM5 Fortran Version: 1.1.3  SourceRev: f5000	page: 12
Symbol Storage Map   File: /export/home/A/gcheng/finance/enew2.fcm
ENTRY POINTS
  Offset  Type    Name
       0  NONE    SVCORP4                         


STORAGE BLOCKS
    Size  Block
      44  local
     124  constants




VARIABLES
  Offset    Size  Type        Block           Name
     ---       4  REAL4       dummy           FE       CALL                            
     ---       4  REAL4       dummy           FE       COR                             
     104       4  REAL4       local           FE       D                               
      96       4  REAL4       local           FE       DT                              
      56       4  INT4        local           FE       I                               
      48       4  INT4        local           FE       N                               
      32       4  INT4        local           FE       NREPS1                          
     ---       4  REAL4       dummy           FE       PSI                             
     ---       4  REAL4       dummy           FE       R                               
     ---       4  REAL4       not-referenced  FE       R1                              
     ---       4  INT4        dummy           FE       REPS                            
      40       4  INT4        local           FE       REPS1                           
      72       4  REAL4       local           FE       RX                              
     ---       4  REAL4       dummy           FE       S                               
     ---       0  NONE        not-referenced  FE       SVCORP4_constants               
     ---       4  REAL4       dummy           FE       T                               
      88       4  REAL4       local           FE       TMP1                            
      80       4  REAL4       local           FE       TMP2                            
     112       4  REAL4       local           FE       U                               
     ---       4  REAL4       dummy           FE       V                               
     ---       4  REAL4       dummy           FE       X                               
     ---       4  REAL4       dummy           FE       XMU                             
      64       4  REAL4       local           FE       XREPS                           
     ---       0  NONE        not-referenced  FE       _svcorp4_pe_code_0              
     ---       0  NONE        global          FE       _svcorp4_pe_code_1              
     ---       0  NONE        global          FE       _svcorp4_pe_code_2              
     ---       0  NONE        global          FE       _svcorp4_pe_code_3              
     ---       0  NONE        global          FE       _svcorp4_pe_code_4              
     ---       0  NONE        global          FE       _svcorp4_pe_code_5              
     ---       0  NONE        global          FE       _svcorp4_pe_code_6              
     ---       0  NONE        global          FE       _svcorp4_pe_code_7              


ARRAYS
  Offset    Size  Type        Block/Class     Home     Name
     ---     ---  REAL4       local-automatic CM       AATMP1                          
     ---     ---  REAL4       local-automatic CM       AATMP2                          
     ---     ---  REAL4       local-automatic CM       DDX                             
Sun Apr 19 16:06:28 1992CM5 Fortran Version: 1.1.3  SourceRev: f5000	page: 13
Symbol Storage Map   File: /export/home/A/gcheng/finance/enew2.fcm
     ---     ---  REAL4       local-automatic CM       SS1                             
     ---     ---  REAL4       local-automatic CM       UUX                             
     ---     ---  REAL4       local-automatic CM       VV1                             


PARAMETERS (Offset is within Storage Block 'constants')
  Offset  Type    Name                            Value


INTRINSIC PROCEDURES
  Name
  EOSHIFT                         
  EXP                             
  FLOAT                           
  SQRT                            
  SUM                             


STATEMENT FUNCTIONS
  Type    Name


EXTERNALS
  Type    Unit_Kind     Name


NAME LISTS
  Name


CONSTRUCT NAMES
  Name



COMMUNICATION ROUTINES
  Name                          Line Number (number of times)
  SUM (into scalar)             233, 228
  EOSHIFT                       204, 206


Sun Apr 19 16:06:28 1992CM5 Fortran Version: 1.1.3  SourceRev: f5000	page: 14
Source Listing File: /export/home/A/gcheng/finance/enew2.fcm
  241   241  1 	      subroutine svcorp5(s,x,r,t,v,psi,xmu,cor,reps,call)
  242   242  1 	      implicit none
  243   243  1 	
  244   244  1 	      real s,x,r,t,v,psi,xmu,cor,call
  245   245  1 	      integer reps
  246   246  1 	
  247   247  1 	      real,array(1:(2**(reps-12)-1),1:8192) :: ss1,vv1,uux,ddx,
  248   248  1 	     &                                     aatmp1,aatmp2
  249   249  1 	      integer,array(1:8192) :: index,ud
  250   250  1 	      real u,d,dt,r1,tmp1,tmp2,rx,xreps
  251   251  1 	      integer i,reps1,nreps1,n2
  252   252  1 	
  253   253  1 	cmf$  layout ss1(:serial,:news),vv1(:serial,:news)
  254   254  1 	cmf$  layout uux(:serial,:news),ddx(:serial,:news)
  255   255  1 	cmf$  layout aatmp1(:serial,:news),aatmp2(:serial,:news)
  256   256  1 	cmf$  layout index(:news),ud(:news)
  257   257  1 	
  258   258  1 	CMPF MAP ss1(ALLBITS,MEMORY),vv1(ALLBITS,MEMORY)
  259   259  1 	CMPF MAP uux(ALLBITS,MEMORY),ddx(ALLBITS,MEMORY)
  260   260  1 	CMPF MAP aatmp1(ALLBITS,MEMORY),aatmp2(ALLBITS,MEMORY)
  261   261  1 	CMPF MAP index(ALLBITS),ud(ALLBITS)
  262   262  1 	
  263   263  1 	      xreps = float(reps)
  264   264  1 	      dt = t/xreps
  265   265  1 	      index = [0:8191]
  266   266  1 	
  267   267  1 	CCCC  SET RX (PERIODIC 1+RF) TO RISK FREE RATE + 1
  268   268  1 	
  269   269  1 	      rx=(r+1.0)**dt
  270   270  1 	
  271   271  1 	      tmp1 = (xmu-0.5*psi*psi)*dt
  272   272  1 	      tmp2 = cor*psi*sqrt(dt) 
  273   273  1 	      u = exp(tmp1+tmp2)
  274   274  1 	      d = exp(tmp1-tmp2)
  275   275  1 	
  276   276  1 	cccc  create stock price lattice (sl)
  277   277  1 	        
  278   278  1 	      vv1(1,:) = v*v
  279   279  1 	      ss1(1,:) = s
  280   280  1 	      n2 = 4096
  281   281  1 	      do i = 1,13
  282   282  1 	         aatmp1(1,:) = (r-0.5*vv1(1,:))*dt
  283   283  1 	         aatmp2(1,:) = sqrt(vv1(1,:)*dt)
  284   284  1 		 uux(1,:) = exp(aatmp1(1,:)+aatmp2(1,:))
  285   285  1 	         ddx(1,:) = exp(aatmp1(1,:)-aatmp2(1,:))
  286   286  1 	         ud = index/n2
  287   287  1 	         where (mod(ud,2) .eq. 0)
  288   288  1 	           vv1(1,:) =  u*vv1(1,:)
  289   289  1 	           ss1(1,:) = uux(1,:)*ss1(1,:)
  290   290  1 	         elsewhere
  291   291  1 	           vv1(1,:) =  d*vv1(1,:)
  292   292  1 	           ss1(1,:) = ddx(1,:)*ss1(1,:)
Sun Apr 19 16:06:28 1992CM5 Fortran Version: 1.1.3  SourceRev: f5000	page: 15
Source Listing File: /export/home/A/gcheng/finance/enew2.fcm
  293   293  1 	         endwhere
  294   294  1 	         n2 = n2/2
  295   295  1 	      enddo
  296   296  1 	
  297   297  1 	      if (reps.gt.13) then
  298   298  1 	         reps1 = reps - 13
  299   299  1 	         nreps1 = 2**(reps1+1) - 1
  300   300  1 	         
  301   301  1 	         do i = 1, nreps1/2
  302   302  1 	           aatmp1(i,:) = (r-0.5*vv1(i,:))*dt
  303   303  1 	           aatmp2(i,:) = sqrt(vv1(i,:)*dt)
  304   304  1 		   uux(i,:) = exp(aatmp1(i,:)+aatmp2(i,:))
  305   305  1 	           ddx(i,:) = exp(aatmp1(i,:)-aatmp2(i,:))
  306   306  1 	           vv1(2*i,:) =  u*vv1(i,:)  
  307   307  1 	           vv1((2*i+1),:) = d*vv1(i,:)
  308   308  1 	           ss1(2*i,:) = uux(i,:)*ss1(i,:)
  309   309  1 	           ss1((2*i+1),:) = ddx(i,:)*ss1(i,:)
  310   310  1 	           ss1(i,:) = 0.0
  311   311  1 	         enddo
  312   312  1 	     
  313   313  1 	         ss1 = ss1 - x  
  314   314  1 	         call =  SUM(ss1,mask=ss1.gt.0.0)/((2*rx)**xreps)
  315   315  1 	      else
  316   316  1 	cccc  calculate call price
  317   317  1 	
  318   318  1 	          ss1 = ss1 - x
  319   319  1 	          call =  SUM(ss1(1,:),mask=ss1(1,:).gt.0.0)/((2*rx)**xreps)  
  320   320  1 	c        where (s1.lt.0.0)  s1 = 0.0
  321   321  1 	c        call = SUM(s1)/((2*rx)**xreps)
  322   322  1 	      endif
  323   323  1 	
  324   324  1 	      return
  325   325  1 	      end
  326   326  1 	
  327   327  1 	
Sun Apr 19 16:06:28 1992CM5 Fortran Version: 1.1.3  SourceRev: f5000	page: 16
Symbol Storage Map   File: /export/home/A/gcheng/finance/enew2.fcm
ENTRY POINTS
  Offset  Type    Name
       0  NONE    SVCORP5                         


STORAGE BLOCKS
    Size  Block
   65580  local
     132  constants




VARIABLES
  Offset    Size  Type        Block           Name
     ---       4  REAL4       dummy           FE       CALL                            
     ---       4  REAL4       dummy           FE       COR                             
     104       4  REAL4       local           FE       D                               
      96       4  REAL4       local           FE       DT                              
      56       4  INT4        local           FE       I                               
      32       4  INT4        local           FE       N2                              
      40       4  INT4        local           FE       NREPS1                          
     ---       4  REAL4       dummy           FE       PSI                             
     ---       4  REAL4       dummy           FE       R                               
     ---       4  REAL4       not-referenced  FE       R1                              
     ---       4  INT4        dummy           FE       REPS                            
      48       4  INT4        local           FE       REPS1                           
      72       4  REAL4       local           FE       RX                              
     ---       4  REAL4       dummy           FE       S                               
     ---       0  NONE        not-referenced  FE       SVCORP5_constants               
     ---       4  REAL4       dummy           FE       T                               
      88       4  REAL4       local           FE       TMP1                            
      80       4  REAL4       local           FE       TMP2                            
     112       4  REAL4       local           FE       U                               
     ---       4  REAL4       dummy           FE       V                               
     ---       4  REAL4       dummy           FE       X                               
     ---       4  REAL4       dummy           FE       XMU                             
      64       4  REAL4       local           FE       XREPS                           
     ---       0  NONE        not-referenced  FE       _svcorp5_pe_code_0              
     ---       0  NONE        global          FE       _svcorp5_pe_code_1              
     ---       0  NONE        global          FE       _svcorp5_pe_code_2              
     ---       0  NONE        global          FE       _svcorp5_pe_code_3              
     ---       0  NONE        global          FE       _svcorp5_pe_code_4              
     ---       0  NONE        global          FE       _svcorp5_pe_code_5              
     ---       0  NONE        global          FE       _svcorp5_pe_code_6              


ARRAYS
  Offset    Size  Type        Block/Class     Home     Name
     ---     ---  REAL4       local-automatic CM       AATMP1                          
     ---     ---  REAL4       local-automatic CM       AATMP2                          
     ---     ---  REAL4       local-automatic CM       DDX                             
       0   32768  INT4        local           CM       INDEX                           
Sun Apr 19 16:06:28 1992CM5 Fortran Version: 1.1.3  SourceRev: f5000	page: 17
Symbol Storage Map   File: /export/home/A/gcheng/finance/enew2.fcm
     ---     ---  REAL4       local-automatic CM       SS1                             
   32768   32768  INT4        local           CM       UD                              
     ---     ---  REAL4       local-automatic CM       UUX                             
     ---     ---  REAL4       local-automatic CM       VV1                             


PARAMETERS (Offset is within Storage Block 'constants')
  Offset  Type    Name                            Value


INTRINSIC PROCEDURES
  Name
  EXP                             
  FLOAT                           
  MOD                             
  SQRT                            
  SUM                             


STATEMENT FUNCTIONS
  Type    Name


EXTERNALS
  Type    Unit_Kind     Name


NAME LISTS
  Name


CONSTRUCT NAMES
  Name



COMMUNICATION ROUTINES
  Name                          Line Number (number of times)
  SUM (into scalar)             319, 314


Sun Apr 19 16:06:28 1992CM5 Fortran Version: 1.1.3  SourceRev: f5000	page: 18
Source Listing File: /export/home/A/gcheng/finance/enew2.fcm
  328   328  1 	      subroutine svcorp6(s,x,r,t,v,psi,xmu,cor,reps,call)
  329   329  1 	      implicit none
  330   330  1 	
  331   331  1 	      real s,x,r,t,v,psi,xmu,cor,call
  332   332  1 	      integer reps
  333   333  1 	
  334   334  1 	      real,array(1:(2**(reps-4)-1),1:32) :: ss1,vv1,uux,ddx,
  335   335  1 	     &                                     aatmp1,aatmp2
  336   336  1 	      real u,d,dt,r1,tmp1,tmp2,rx,xreps
  337   337  1 	      integer i,n,reps1,nreps1
  338   338  1 	
  339   339  1 	cmf$  layout ss1(:serial,:news),vv1(:serial,:news)
  340   340  1 	cmf$  layout uux(:serial,:news),ddx(:serial,:news)
  341   341  1 	cmf$  layout aatmp1(:serial,:news),aatmp2(:serial,:news)
  342   342  1 	
  343   343  1 	CMPF MAP ss1(MEMORY,ALLBITS),vv1(MEMORY,ALLBITS)
  344   344  1 	CMPF MAP uux(MEMORY,ALLBITS),ddx(MEMORY,ALLBITS)
  345   345  1 	CMPF MAP aatmp1(MEMORY,ALLBITS),aatmp2(MEMORY,ALLBITS)
  346   346  1 	
  347   347  1 	      xreps = float(reps)
  348   348  1 	      dt = t/xreps
  349   349  1 	
  350   350  1 	CCCC  SET RX (PERIODIC 1+RF) TO RISK FREE RATE + 1
  351   351  1 	
  352   352  1 	      rx=(r+1.0)**dt
  353   353  1 	
  354   354  1 	      tmp1 = (xmu-0.5*psi*psi)*dt
  355   355  1 	      tmp2 = cor*psi*sqrt(dt) 
  356   356  1 	      u = exp(tmp1+tmp2)
  357   357  1 	      d = exp(tmp1-tmp2)
  358   358  1 	
  359   359  1 	cccc  create stock price lattice (sl)
  360   360  1 	        
  361   361  1 	      vv1(1,:) = 0.0
  362   362  1 	      ss1(1,:) = 0.0
  363   363  1 	
  364   364  1 	      vv1(1,1) = v*v
  365   365  1 	      ss1(1,1) = s
  366   366  1 	      n = 1
  367   367  1 	      do i = 1,5
  368   368  1 	         aatmp1(1,:) = (r-0.5*vv1(1,:))*dt
  369   369  1 	         aatmp2(1,:) = sqrt(vv1(1,:)*dt)
  370   370  1 		 uux(1,:) = exp(aatmp1(1,:)+aatmp2(1,:))
  371   371  1 	         ddx(1,:) = exp(aatmp1(1,:)-aatmp2(1,:))
  372   372  1 	         vv1(1,:) =  u*vv1(1,:) + 
  373   373  1 	     &      eoshift(d*vv1(1,:),dim = 1,shift = -n)
  374   374  1 	         ss1(1,:) = uux(1,:)*ss1(1,:) + 
  375   375  1 	     &      eoshift(ddx(1,:)*ss1(1,:),dim = 1,shift = -n)
  376   376  1 	         n = 2*n
  377   377  1 	      enddo
  378   378  1 	
  379   379  1 	      if (reps.gt.5) then
Sun Apr 19 16:06:28 1992CM5 Fortran Version: 1.1.3  SourceRev: f5000	page: 19
Source Listing File: /export/home/A/gcheng/finance/enew2.fcm
  380   380  1 	         reps1 = reps - 5
  381   381  1 	         nreps1 = 2**(reps1+1) - 1
  382   382  1 	         
  383   383  1 	         do i = 1, nreps1/2
  384   384  1 	           aatmp1(i,:) = (r-0.5*vv1(i,:))*dt
  385   385  1 	           aatmp2(i,:) = sqrt(vv1(i,:)*dt)
  386   386  1 		   uux(i,:) = exp(aatmp1(i,:)+aatmp2(i,:))
  387   387  1 	           ddx(i,:) = exp(aatmp1(i,:)-aatmp2(i,:))
  388   388  1 	           vv1(2*i,:) =  u*vv1(i,:)  
  389   389  1 	           vv1((2*i+1),:) = d*vv1(i,:)
  390   390  1 	           ss1(2*i,:) = uux(i,:)*ss1(i,:)
  391   391  1 	           ss1((2*i+1),:) = ddx(i,:)*ss1(i,:)
  392   392  1 	           ss1(i,:) = 0.0
  393   393  1 	         enddo
  394   394  1 	     
  395   395  1 	         ss1 = ss1 - x  
  396   396  1 	         call =  SUM(ss1,mask=ss1.gt.0.0)/((2*rx)**xreps)
  397   397  1 	      else
  398   398  1 	cccc  calculate call price
  399   399  1 	
  400   400  1 	          ss1 = ss1 - x
  401   401  1 	          call =  SUM(ss1(1,:),mask=ss1(1,:).gt.0.0)/((2*rx)**xreps)  
  402   402  1 	c        where (s1.lt.0.0)  s1 = 0.0
  403   403  1 	c        call = SUM(s1)/((2*rx)**xreps)
  404   404  1 	      endif
  405   405  1 	
  406   406  1 	      return
  407   407  1 	      end
Sun Apr 19 16:06:28 1992CM5 Fortran Version: 1.1.3  SourceRev: f5000	page: 20
Symbol Storage Map   File: /export/home/A/gcheng/finance/enew2.fcm
ENTRY POINTS
  Offset  Type    Name
       0  NONE    SVCORP6                         


STORAGE BLOCKS
    Size  Block
      44  local
     124  constants




VARIABLES
  Offset    Size  Type        Block           Name
     ---       4  REAL4       dummy           FE       CALL                            
     ---       4  REAL4       dummy           FE       COR                             
     104       4  REAL4       local           FE       D                               
      96       4  REAL4       local           FE       DT                              
      56       4  INT4        local           FE       I                               
      48       4  INT4        local           FE       N                               
      32       4  INT4        local           FE       NREPS1                          
     ---       4  REAL4       dummy           FE       PSI                             
     ---       4  REAL4       dummy           FE       R                               
     ---       4  REAL4       not-referenced  FE       R1                              
     ---       4  INT4        dummy           FE       REPS                            
      40       4  INT4        local           FE       REPS1                           
      72       4  REAL4       local           FE       RX                              
     ---       4  REAL4       dummy           FE       S                               
     ---       0  NONE        not-referenced  FE       SVCORP6_constants               
     ---       4  REAL4       dummy           FE       T                               
      88       4  REAL4       local           FE       TMP1                            
      80       4  REAL4       local           FE       TMP2                            
     112       4  REAL4       local           FE       U                               
     ---       4  REAL4       dummy           FE       V                               
     ---       4  REAL4       dummy           FE       X                               
     ---       4  REAL4       dummy           FE       XMU                             
      64       4  REAL4       local           FE       XREPS                           
     ---       0  NONE        not-referenced  FE       _svcorp6_pe_code_0              
     ---       0  NONE        global          FE       _svcorp6_pe_code_1              
     ---       0  NONE        global          FE       _svcorp6_pe_code_2              
     ---       0  NONE        global          FE       _svcorp6_pe_code_3              
     ---       0  NONE        global          FE       _svcorp6_pe_code_4              
     ---       0  NONE        global          FE       _svcorp6_pe_code_5              
     ---       0  NONE        global          FE       _svcorp6_pe_code_6              
     ---       0  NONE        global          FE       _svcorp6_pe_code_7              


ARRAYS
  Offset    Size  Type        Block/Class     Home     Name
     ---     ---  REAL4       local-automatic CM       AATMP1                          
     ---     ---  REAL4       local-automatic CM       AATMP2                          
     ---     ---  REAL4       local-automatic CM       DDX                             
Sun Apr 19 16:06:28 1992CM5 Fortran Version: 1.1.3  SourceRev: f5000	page: 21
Symbol Storage Map   File: /export/home/A/gcheng/finance/enew2.fcm
     ---     ---  REAL4       local-automatic CM       SS1                             
     ---     ---  REAL4       local-automatic CM       UUX                             
     ---     ---  REAL4       local-automatic CM       VV1                             


PARAMETERS (Offset is within Storage Block 'constants')
  Offset  Type    Name                            Value


INTRINSIC PROCEDURES
  Name
  EOSHIFT                         
  EXP                             
  FLOAT                           
  SQRT                            
  SUM                             


STATEMENT FUNCTIONS
  Type    Name


EXTERNALS
  Type    Unit_Kind     Name


NAME LISTS
  Name


CONSTRUCT NAMES
  Name



COMMUNICATION ROUTINES
  Name                          Line Number (number of times)
  SUM (into scalar)             401, 396
  EOSHIFT                       372, 374


Sun Apr 19 16:06:28 1992CM5 Fortran Version: 1.1.3  SourceRev: f5000	page: 22
Source Listing File: /export/home/A/gcheng/finance/enew2.fcm
Sun Apr 19 16:06:28 1992CM5 Fortran Version: 1.1.3  SourceRev: f5000	page: 23
Utility Stats
Input File:	/export/home/A/gcheng/finance/enew2.fcm
Base File:	enew2
COMMAND QUALIFIERS

	-cmdebug -list -safety=0 enew2.fcm 

	analysis_data
	check = (no bounds,overflow,no underflow )
	continuations = 19
	debug
	directives
	f77
	i4
	ifconvert
	level_of_vectorization = 100
	list
	machine_code
	optimize = (local,no global,no code_motion )
	overlap
	show = (no dictionary,no include,no map,no preprocessor,no single )
	standard = (no syntax,no source,no semantic )
	warnings = (no declarations,general,no ultrix,no vaxeln )
	cmdebug
	complex_lower
	skip_garbage
	safety = 0
	pnodes = -1
	trcback
	new_modifies
	const
	transp
	cp_last
	bb_merge
	meoptimize
	mecopypropagate
	memergetemps
	merge
	amode
