The two equations can be solved consecutively in an efficient manner by 

 Inversion of tridiagonal matrices in the x direction (x-sweep) and y direction 

 (y-sweep). Furthermore, only two variables need to be solved during each 

 sweep thus resulting in significant saving than solving the original equation 

 (3.1). The main advantage of this implicit method is that much larger time 

 step can be used. Courant number based on the maximum propagation speed of 

 the surface gravity wave, (gH^gx) ' ^t/Ax, may now be as large as 100, 

 compared to the limit of 1 for explicit method. The maximum time step is now 

 governed by the advection speed in the system: 



Min 

 x,y 



Ax. Ay 



« At < Min 



x.y 



U ^ _V_ 

 Fax Fzy 



(3.5) 



The traditional ADI method when applied to (3.1) uses a different 

 factorization than the present method (3.3) and (3.4). It was found that the 

 present method is more stable than the traditional ADI method (Butler and 

 Sheng, 1982). At very high Courant number, however, the present method may 

 have a stability problem when waves are propagating along the diagonals of the 

 grid. A rule of thumb is to stay within a Courant number of 10. 

 Alternatively, one can derive a Poisson equation for c from Eqs. (2.36) to 

 (2.38) and solve it with iterative or direct methods. 



3.2 Internal Mode Algorithm 



Treating the internal mode equations (2.42) and (2.43) with a two-level 

 scheme and a vertically implicit scheme, one obtains the following finite 

 difference equations: 



jf+l n+1 n / D \ At a f a / n+1 n+1 , _ n+l, n\ 



6) 



■n+1 



,n+l n 

 V =v + At 



^.-^)^^if^^(H""'■""'""-""43.7, 



45 



