a submarine does not go out of trim on its own , but as a result of a loss of buoyancy reserve when the end compartments or ballast tanks fill up ; in this case the submarine 's longitudinal stability also decreases regardless of the design of the main ballast tanks and the sea state .