next up previous

15 Non-Reflecting Boundaries     continued...

The left side boundary condition loop is

          do 140 j=2,nzd-1
          u3(1,j) = u2(1,j)+u2(2,j)-u1(2,j)+
     x   cb(1,j)*(u2(2,j)-u2(1,j)-u1(3,j)+u1(2,j))
 140      continue
Code Fragment I

The u3,u2,u1 wave field arrays are for the n+1, n, n-1 time steps respectively. The cb array contains the spatial coefficient, .

The right side boundary condition loop is

          do 160 j=2,nzd-1
          u3(nxd,j) = u2(nxd,j)+u2(nxd-1,j)-u1(nxd-1,j)-
     x    cb(nxd,j)*(u2(nxd,j)-u2(nxd-1,j)-
     x    u1(nxd-1,j)+u1(nxd-2,j))
 160      continue
Code Fragment II