Don't get me started, the whole thing is goofy. When I examine files I find many many that are not used at all in the game - they're leftovers from Silent Hunter III. Another example of oversimplified programming is layers - as former subhunters, you and I understand the nature of thermal layers and all the reflection/refraction/reverberation stuff. In game the thermal layer works like another surface layer, line of "sight" from sonar. If you're on or above the surface or any part of the sub or periscope sticks up, the enemy can see you. If you're completely under the surface you're "invisible".
Layers work the same way, the bathythermograph sensor is on the keel, so when the stage whisper comes "PASSING THERMAL LAYER!", only the KEEL has passed the thermal layer, so if you stop there sonar can still "see" you. Note the depth when the whisper comes, go down 60 feet deeper than that, now the whole sub is "submerged" under the layer and can't be detected at all. Come up 20 feet so the periscope shears are above the layer, and you will always be detected at the same range that you would be visually if the shears were sticking above the actual surface.
In other words the thermal layer in the game is a kind of "virtual surface" for sound, simply a flat plane you're either above or hidden below. I know real layers are nothing like that unless there's a seriously sharp difference in temp and/or salinity, but I take advantage of them anyway - the enemy cheats so why shouldn't I?
In fact when there's time I make a deep submergence before the target arrives so I can note the depth if there's a thermal layer, add 60 feet and make a mental note of where I'll go after the attack - usually I avoid being depth charged at all that way. Fire all tubes, observe hits if there's time, then kick out a decoy, go to flank speed, head for 60 feet below the layer, then slow down to avoid wasting battery juice. I don't even order silent running, let the crew clang and bang while reloading tubes, if I'm under the layer they won't hear it.