MADRID -- The United States is beginning to accept the unhappy fact that it will have to withdraw all of the 72 F16 fighter-bombers it has based in Spain, as Prime Minister Felipe Gonzalez has been demanding for the past 18 months. Washington must now decide whether to pick up its planes and go quietly or slam the door on the way out.

Slam-the-door advocates argue that the United States cannot afford to simply shrug off a unilateral decision of this kind by an ally. They want some china broken as a warning to others, especially since the United States is opening a series of bases negotations around the world.

But the restraint that U.S. Ambassador Reginald Bartholomew has been successfully urging on Washington is likely to continue to prevail in this difficult end-game phase. He rightly argues that preserving the American stake in three other vital installations here outweighs the pleasures and advantages to be gained from Felipe-bashing at this point.

The talks over the future of the 401st Tactical Air Force Wing based at Torrejon have routinely been described as negotiations. But as the end of this process rapidly approaches, it becomes clear that the two sides have not been negotiating at all in any classical sense.

They have been talking past each other, with Spain speaking of history, the future, current politics and nationalism, while the United States has stressed its problems in managing a global alliance, coping militarily with the Soviet menace and other geopolitical dramas.

Bartholomew appears to have aimed from the beginning to fashion a negotiator's compromise of splitting the difference. His last effort in November was to offer to withdraw one-third of the F16s in return for letting the others stay in ambiguous circumstances.

But each bargain he proposed met with an unvarying, unyielding, one-word reply: No. The Spanish refused to budge from what was not a demand but a decision on the complete withdrawal of the F16s.

"This was not the kind of negotiation that Americans can understand very well," a Spanish official said. "It was not like talking to the Philippines about a little bit more of this or a little bit less of that, and judging when to cut the best deal. Spain was the imperial power in the Philippines a century ago, and we have to establish that we are not just another Philippines or Greece, looking for a deal."

The two nations also talked past each other on the crucial question of "substitution," in negotiating jargon. American officials felt Spain had committed its armed forces to take up the missions carried out by the 401st Tactical Wing as part of a withdrawal. Given the sensitive nature of the mission of the F16s, it is doubtful that there was ever full understanding on this and Americans gain nothing by making it a point of dispute now.

In the event of war, the F16s would be redeployed from Spain to northern Italy and Turkey, where they would pick up nuclear bombs that are stored in those countries.

Neither the Spanish nor the Americans talk about what would happen then. But the F16s would undoubtedly stage nuclear strikes along the Soviet-Turkish frontier -- a task the Spanish Air Force could never undertake. What Washington would have expected Spain to do in the way of substitution in this key segment of NATO's "flexible response" strategy remains a mystery.

Whether the aftermath of the F16 nonnegotiations will be manageable or will turn into a bitter and divisive experience for the Atlantic alliance, as France's withdrawal from NATO did in 1966, now depends on both Washington and Madrid. Spain would prefer to portray it as totally an American decision, but this is to invite serious trouble.

Until now, the Spanish have shown little interest in what the United States does with the aircraft. Officials complain that Spain has been little more than a parking lot for the F16s, and argue that it should be easy to relocate them closer to their targets.

But that attitude ignores that the American military presence in Europe is becoming a focal point for a variety of budgetary and political pressures, as the Intermediate Nuclear Forces treaty heads for Senate debate, the Warsaw Pact focuses in arms control proposals on aircraft like the F16 that can carry both nuclear and conventional bombs and Western Europe remains uneasy about President Reagan's dealings with Mikhail Gorbachev.

Gonzalez has made a credible case for asking the United States to reduce its presence here. It is now up to him and his aides to understand that they must help the United States limit the damage that his decision could still cause.