When are submarines visible?

Officially:

[a submarine] is invisible to most units - except for destroyers and other Submarines - until it attacks.

However, I've noticed that other naval units can see non-attacking submarines if they are adjacent to them, even if said units are just embarked workers. I also noticed I can sometimes see submarines if they're adjacent to my borders. What is the full list of situations in which a submarine is revealed?

Also, what does "until it attacks" mean? If a submarine attacks, is it visible until the beginning of the next turn, or until it moves again? What if it has the logistics promotion and it moves away immediately after its attack, is it still visible?


A partial answer:

  • Submarines are visible to any adjacent unit, whether naval or land based.
  • Submarines are visible to cities. According to the civfanatics forum this is a confirmed bug.
  • Destroyers and submarines can spot submarines within their max sight radius.

See civfanatics forum post and screenshots.