Can you replicate the sound by reving the engine against the brakes with the transmission in D? Don't do this for more than 5 seconds at a time and let it idle for a minute between tries. Otherwise you'll cook your transmission fluid.
If so, it might be rod knock. Not a good thing in any circumstance.
Could also be noisy lash adjusters or nailing. Do a search on these key words. Maybe try lifters in place of lash adjusters. You can focus on the Diesel Discussion forum.