The USN went to war with only five grades of Commissioned officer:
Flag officer
Captain
Commander (formerly Master Commandant)
Lieutenant
Master (from 1883, Lt, JG)
---
Passed Midshipman (not Commissioned)
In July 1862 by Act of Congress a
new rank structure was established. It allowed only one grade of admiral (RAdm) and created the ranks of Commodore, Lieutenant-Commander and Ensign. Commodores, Captains, Commanders and Lieutenant-Commanders were to command ships, based upon their rating (so a Commodore would command a frigate). The rank of Ensign was to Commission Passed Midshipman and allow them to command in the absence of a Commissioned officer.
The same act defined the Army-Navy equivalencies:
RAdm = MG
Commodore = BG
Captain = Col
Cmdr = Lt Col
Lt Cmdr = Maj
Lt = Capt
Master = Lt
Ensign = 2Lt
Staff officers (surgeons, paymasters etc.) were not included as there was no need of them. In 1863
equivalancies for social purposes etc. were defined, but no staff officer had any power to command outside of his branch in any circumstances whatsoever.