President Carter came unexpectedly to the White House fence last night to praise demonstrators gathered outside for their concern for the Vietnamese boat people and to tell them Navy ships and planes would be allowed to find and pick up the refugees.

Near the close of one of the most dramatic days of his term, Carter, tieless and in shirtsleeves, climbed on to the fence near the northwest gate to tell delighted demonstrators that "your spirit of caring for other people is exactly what we need all over this nation."

"The kind of concern that you have I think represents what our nation ought to be," the presidnet told the excited and surprised demonstrators assembled on the sidewalk outside the gate. Before and after his brief remarks, the president reached through the black bars of the White House fence to grasp and shake the hands of the animated group outside.

Numbering about 150, they were remnants of about 1,000 persons who had marched earlier to Lafayette Square from the Lincoln Memorial, where about 10,000 persons had heard singer Joan Baez plead for the refugees.

Carrying candles in the darkness, demonstrators in the park across from the executive mansion sang the hymn "Amazing Grace" and "Jimmy Row the Boat Ashore," an adaptation of a folksong.

Press Secretary Jody Powell said he was at a nearby tavern when the president called and said he would change clothes and go outside. It was 10:30 p.m. when Powell reached the White House a few minutes later, and Carter, in a light blue opennecked shirt, was already outside.

Spotting the president as he walked from the mansion, some of the demonstrators began crossing to the White House sidewalk.

The president pulled himself up on the iron fence. Quieting the shouts and cheers, he told the demonstrators that "we are doing all we can to help the boat people."

He said that he was sending Vice President Walter Mondale today to an international conference in Geneva "to work with...other nations on earth to try and save all the boat people."

Asserting that the United States is now bringing in 14,000 refugees a month, he said "I'm also going to let...Navy ships and planes find and pick up the boat people."

After lauding the demonstrators for their concern for those fleeing Indochina, the president said that "together we will let everybody on earth know we have a big heart."

And then, ending a day of stunning surprises, in which the president fired two cabinet secretaries while more cabinet changes were reported imminent, the president shook a few more hands and walked back into the White House, the applause of the demonstrators behind him. CAPTION: Picture, President Carter perches on the White House fence during his talk with demonstrators about Asian refugees. By Charles A. Pereira for The Washington Post. Copyright (c) 1979.