You should do some research. The US Navy fielded the Mark 27 passive acoustic homing torpedo in 1943; however it was only used by Pacific theatre submarines. The Kriegsmarine also developed them for u-boat use. HERE are pictures of the Mark 27. Cute little thing, no?
I would still be surprised to find that torps in WWII could vary their depth and do all the things the ones in the movie did.
Walt
I don't recall what the homing torp in U571 did; I wouldn't be surprised if they wildly exaggerated its capabilities. The Mark 27 was a short-range self defense weapon for submarines. It homed on surface ship screw noise, and saw successful use in the Pacific theatre against Japanese ASW ships. I believe it "varied" its depth more or less monotonically from 400 ft up to zero, at which point it went "BANG!" and caused an IJN destroyer captain suddenly to lose interest in that pesky submarine...
AB