There is only a passing similarity to the book. There are a number of individual scenes in the movie that are found in the book, but the main plot thread is radically different.
Relevant to this thead, the entire first quarter(?) of the book dealing with the main character's assignment to an S-class boat is not in the movie.
Overall the movie is not bad, but for those who like the book it will be a disappointment.
BTW: the operational history of the real S-25 (subject of the upcoming model) served as the basis for Ed Beach's S-16 in the novel and has something unique to it. Can anyone tell me what it is?