In this paper, power allocation is examined for the coexistence of a radar and a communication system that employ multicarrier waveforms. We propose two designs for the considered spectrum sharing problem by maximizing the output signal-to-interference-plus-noise ratio (SINR) at the radar receiver while maintaining certain communication throughput and power constraints. The first is a joint design where the subchannel powers of both the radar and communication systems are jointly optimized. Since the resulting problem is highly nonconvex, we introduce a reformulation by combining the power variables of both systems into a single stacked variable, which allows us to bypass a conventional computationally intensive alternating optimization procedure. The resulting problem is then solved via a quadratic transform method along with a sequential convex programming (SCP) technique. The second is a unilateral design which optimizes the radar transmission power with fixed communication power. The unilateral design is suitable for cases where the communication system pre-exists while the radar occasionally joins the channel as a secondary user. The problem is solved by a Taylor expansion based iterative SCP procedure. Numerical results are presented to demonstrate the effectiveness of the proposed joint and unilateral designs in comparison with a subcarrier allocation based method.