Section 141(2) in The Naval Ceremonial, Conditions Of Service And Miscellaneous Regulations, 1964
(2)Where the Flag or the Senior Officer considers it expedient in the interest of public service to change an officer from the command of one ship to the command of another, he may do so with the consent of the two officers concerned.