The Americans had an instrument that did this by measuring the water temp outside the hull.
http://en.wikipedia.org/wiki/Bathythermograph
It was included in SH1, but I forget if it was in SH4 or not. No word in the article if German subs had a similar instrument, but I doubt it.