All commanding officers and others in authority in the naval service are required to show in themselves a good example of virtue, honor, patriotism, and subordination; to be vigilant in inspecting the conduct of all persons who are placed under their command; to guard against and suppress all dissolute and immoral practices, and to correct, according to the laws and regulations of the Navy, all persons who are guilty of them; and to take all necessary and proper measures, under the laws, regulations, and customs of the naval service, to promote and safeguard the morale, the physical well-being, and the general welfare of the officers and enlisted persons under their command or charge.