Absorbing boundary conditions for 3-D acoustic and elastic finite-difference calculations