We consider the capacity optimization of submarine links when including a realistic model of the gain-flattened constant-pump erbium doped fiber amplifiers (EDFA). While Perin et al. [1] numerically attacked this optimization for Constant-Gain (CG) amplified links, we extend the analysis also to more realistic submarine constant power-spectral-density (CPSD) links. As in [1], we concentrate on a single spatial mode of a spatial division multiplexed (SDM) link at low EDFA pump power Pp, and thus consider only the impairments of amplified spontaneous emission noise. Here we adopt a novel semi-analytical approach which consists of fixing the inversion x1 of the first EDFA (the state-variable of the link) and analytically finding capacity C(x1) by searching over the x1-feasible input wavelength division multiplexed (WDM) PSD distributions. Then the optimum inversion x1 that maximizes C(x1) is numerically obtained. This approach enables us to get both approximate (for CG links) and exact (for CPSD links) capacity-maximizing WDM input distributions, which vary inversely with the EDFA gain profile. For CG links the optimal WDM allocation is called the gain-shaped water-filling. Other practical allocations are analyzed, such as the signal to noise ratio equalizing allocation (CSNR), and the constant input power (CIP) allocation which uses a flat WDM distribution. We find that, for typical submarine span attenuations around 10dB and when the link works at the optimal inversion x1, CIP and CSNR achieve essentially the same capacity as the optimal allocation. At sufficiently large pump Pp (>= 30 mW) the optimal inversion x1 is such that the EDFA gain at 1538nm equals the span attenuation, for EDFA emission and absorption as in [1]. When span attenuations increase to 20dB, then we start seeing an advantage of the optimal allocation. Another key finding is that optimized CG and CPSD links behave roughly the same, with a slightly superior capacity for CPSD.