[ A sub powered by a closed loop Thorium Salt reactor with the ability to on site process its nuclear fule could theoretically stay submerged for DECADES!
Especially if you loaded it up with enough thorium fuel...
Yeah, but the crew would eventually get tired of thorium salad sandwiches. ]
You would have to have some sort of “greenhouse” to grow food, freshwater would be abundant as it is easily distilled from the sea water...
A military crew of only vegans?