The Navy selected General Dynamics Corp. and McDonnell Douglas Corp. yesterday to develop and build jointly a ground attack bomber for the 21st century, the Advanced Tactical Aircraft.

More than 500 ATAs, light carrier-based bombers, are planned to be built at an ultimate cost of more than $35 billion.

The Navy said a full-scale development contract will be awarded after a Pentagon review and, in the meantime, a $241,000 interim contract had been given to the team.

General Dynamics builds planes in Fort Worth, Tex.; McDonnell Douglas in St. Louis.

The contract marks the first time in more than 50 years that Grumman Corp. of Bethpage, N.Y., the Navy's traditional warplane manfacturer and an ATA competitor allied with Northrop Corp., will not be designing and building a new plane for the Navy. Members of New York's congressional delegation, including Sens. Daniel Patrick Moynihan, a Democrat, and Alfonse M. D'Amato, a Republican, sent Defense Sercretary Frank C. Carlucci a letter earlier this month saying Grumman would be forced out of the aircraft business if it failed to get the ATA contract.

The ATA will replace the aging fleet of Grumman-built A6 Intruders, which have been the fleet's mainstay all-weather, around-the-clock bomber since the early 1960s. About 600 A6s have been built, and the Reagan administration and Congress are now debating whether to fund Grumman development and production of a final A6F version.

Grumman also builds the Navy's F14 fighter, but production is winding down.

Portions of the new ATA will be highly secret because they will incorporate "stealth" technology that uses nonmetallic structures to make an aircraft difficult for enemy radar to detect. U.S. stealth development is believed to be far ahead of Soviet research.

Northrop of Hawthorne, Calif., is developing the B2 stealth bomber for the Air Force and is a leader in stealth work.

Partly for this reason, the Grumman-Northrop team at one time was favored to win the ATA award. But, the big price difference in the bids gave the award to their competitors, sources said.