I assume that the submarine producer gives stats like empty weight from which the current weight can be calculated.
However, weight isn’t the important thing in a sub. It’s the weight to volume ratio, or buoyancy.
A sub sinks when buoyancy is negative and rises if the buoyancy is positive.
There are three common ways to achieve the changing buoyancy: the most simple one is a vessel with positive buoyancy adding droppable weights until the buoyancy is negative.
Other ways are a neutral buoyancy vessel that uses it’s engine power to push itself up or down. Or a vessel that can change it’s buoyancy by filling up tanks with water (to reduce buoyancy below neutral) and blow them out with air or other gases lighter than water (to raise buoyancy above neutral). A combination of several methods is also possible.
deleted by creator