Wow, that’s cool. Completely makes sense but not something I’d thought about…
Would the temperature differences need to be very large for this effect to occur?
As sound travels through a water layer where the speed through which it travels varies with depth, the sound will tend to refract towards where it is the slowest.
A layer where temperature decreases as depth increases will refract sound downwards. A layer that has the inverse temperature properties will do the opposite. A layer that is isothermal (where the temperature remains constant as depth changes), will still tend to refract sound upwards because the increase in pressure also increases velocity, although not as strongly as temperature does, which is why temperature differences can easily overcome this effect where the water is not isothermal.
If you have a layer that refracts sound downwards on top of a layer that refracts sound upwards, you just created a sound channel, which acts as a wave guide in which sound will remain trapped and travel far longer distances horizontally before dissipating.
Ultimately you can’t really put a number on the required temperature differences because there are many other factors to take into account like how steeply the speed of sound changes, how tall the layer(s) are, what is the frequency of the sound, or how much of it you want to remain “trapped” in the sound channel.
“The SOFAR channel (short for sound fixing and ranging channel) … is a horizontal layer of water in the ocean at which depth the speed of sound is at its minimum” …
“The SOFAR channel acts as a waveguide for sound, and low frequency sound waves within the channel may travel thousands of miles before dissipating.” …
https://en.m.wikipedia.org/wiki/SOFAR_channel