To simulate the complex accident phenomena of a marine reactor, the thermal-hydraulic system code RELAP5 is modified to perform the analysis under ocean conditions. An integrated reactor with a passive residual heat removal system (PRHRS) is modeled by the improved code, and the effects of different ocean motions under a total loss-of-flow accident (LOFA) and a loss-of-heat-sink (LOHS) accident are analyzed with respect to safety characteristics. The results indicate that for LOFA, the primary loop can form an effective natural circulation to cool the core, and for LOHS, the PRHRS can effectively remove the residual heat from the core to ensure the core safety. The results also show that heaving motion accelerates the drop of the first-loop temperature and enhances the heat transfer capacity of the PRHRS. Inclining motion reduces the natural circulation flow in the core. A rolling condition causes fluctuations in the mass flow rate, the variations of which are not strictly sinusoidal, and increasing the rolling period also improves the heat exchange capacity of the PRHRS.