I am pretty sure that this is a movie, not a TV show, but I don't want to rule it out. I really don't remember much, but I vividly remember a scene where there is a prisoner/someone who is captured (I think he may have spoke a different language) on a submarine and bangs on some pipes or something on the sub in morse code, trying to communicate with his people/country/whatever. I want to say he was morsing SOS, but am not positive. Someone on the crew eventually picks up on what he is doing and they go stop him (can't remember if they knock him out or kill him or anything like that).
I am also fairly certain there is another scene in the movie where they are dropping depth charges on the submarine to try and locate it. I think the sub goes very very low but eventually loses power and needs to come up otherwise it may sink.
I can't quite remember a year this movie could be from, but I'm 99% sure it wasn't 2000s.