next up previous [pdf]

Next: Fast Kirchhoff code Up: HYPERBOLA PROGRAMMING Previous: HYPERBOLA PROGRAMMING

Tutorial Kirchhoff code

Subroutine kirchslow() below is the best tutorial Kirchhoff migration-modeling program I could devise. A nice feature of this program is that it works OK while the edge complications do not clutter it. The program copies information from data space data(it,iy) to model space modl(iz,ix) or vice versa. Notice that of these four axes, three are independent (stated by loops) and the fourth is derived by the circle-hyperbola relation $t^2=\tau^2+x^2/v^2$. Subroutine kirchslow() for adj=0 copies information from model space to data space, i.e. from the hyperbola top to its flanks. For adj=1, data summed over the hyperbola flanks is put at the hyperbola top.

user/gee/kirchslow.c
    for (ix=0; ix < nx; ix++) { 
	for (iy=0; iy < nx; iy++) { 
	    for (iz=0; iz < nt; iz++) { 
		z = t0+dt*iz; /* travel-time depth */
		t = hypotf(z,(ix-iy)*dx / velhalf);
		it = 0.5 + (t-t0) / dt;
		id = it + iy*nt;
		im = iz + ix*nt;
		
		if( it < nt ) {
		    if( adj) modl[im] += data[id];
		    else     data[id] += modl[im];
		}
	    }
	}
    }
Notice how this program has the ability to create a hyperbola given an input impulse in $(x,z)$-space, and a circle given an input impulse in $(x,t)$-space.

The three loops in subroutine kirchslow() may be interchanged at will without changing the result. To emphasize this flexibility, the loops are set at the same indentation level. We tend to think of fixed values of the outer two loops and then describe what happens on the inner loop. For example, if the outer two loops are those of the model space modl(iz,ix), then for adj=1 the program sums data along the hyperbola into the ``fixed'' point of model space. When loops are reordered, we think differently and opportunities arise for speed improvements.


next up previous [pdf]

Next: Fast Kirchhoff code Up: HYPERBOLA PROGRAMMING Previous: HYPERBOLA PROGRAMMING

2009-03-16