Acoustic simulation ofP-wave propagation in a heterogeneous spherical earth: numerical method and application to precursor waves toPKPdf