Only the severely deluded will pretend that this film is great art or psychologically penetrating (although there is quite a bit of other penetration going on throughout). It is pure Spanish "Grand Guignol," beautifully photographed, strung out before us like a string of carefully spaced horror-cameo happenings.
The director found a novel that contained all this excrement and he really went ape over the possibilities of cramming it all into one movie. The first sequence involves five young children who witness a guerrilla-style execution during the Spanish Civil War, but only three of them survive the experience. Then the film jumps forward bout 15 years, and those 3 survivors JUST HAPPEN to find themselves in the same TB sanatorium. The 2 men are patients and interact with other supposed patients, all of whom look incredibly buff and healthy.
The shenanigans in the sanatorium have almost nothing to do with the events pictured earlier, but that is not surprising since nothing that happens in this movie has much relation to character or to reality. The gay sub-plots come strictly out of the blue, and aside from some nattering psycho-babble, there is nothing here relating to "the sea."
Having said all that, go ahead and enjoy the movie! It is almost a parody of Spanish melodrama, smartly staged by a wannabe Almodovar.