Bernard C. Byrnes, 56, retired director of the developmental surveys division and inshore projects division of the U.S. Naval Oceanographic Office, died of a heart attack Monday at his home in District Heights.

He came to Washington in 1948 to work for the U.S. Coast and Geodetic Survey, participating in the first airborne surveys of the earth's magnetic field in flight operations over the Arctic.

Mr. Byrnes later transferred to the Naval Oceanographic Office, where he organized the task group for the Navy's airborne geomagnetic survey program.

He then headed the geomagnetics branch of the navigational science division and directed the AGOR division responsible for the design, construction and scientific operation of two new classes of oceanographic survey ships. He received the Navy's Meritorious Civilian Service Award.

Mr. Byrnes was born in Barnesboro, Pa. After graduating from high school, he became an apprentice surveyor in the soft coal mines of western Pennsylvania.

He entered the Navy in World War Ii and served as a bomber and fighter pilot. He remained in the Naval Reserves after the war, retiring in 1959.

He also earned degrees in physics and mathematics from St. Francis College in Loretto, Pa., after the war.

Mr. Byrnes had worked as a volunteer for the Heart Association of Southern Maryland since 1970.

He is survived by his wife, Helen J., of District Heights; two sons, William H., of Norwalk, Conn., and James B., of Pass Christian, Miss.; a daughter, Patricia A., a student at the University of Maryland; his partents, Mr. and Mrs. William H. Byrnes, and a sister, Anna Marie McCormick, all of Barnesboro; another sister, Rita Johns of Greensburg, Pa., and two brothers, William Richard, of West Lafayette, Ind., and John E., of Cleveland.