President Carter, speaking to the NAACP's 71st annual convention here tonight, warned that Ronald Reagan's election could mean a conservative overhaul of the Supreme Court and profound changes in the federal judiciary.

Carter's admonition had a sobering effect on NAACP members, enthusiastic about the uncertain presidential ambitions of Sen. Edward M. Kennedy (D-Mass) and deeply dissatisfied with the president's refusal to launch major new federal aid programs to end the recession.

Amid mostly stony stares from his audience, Carter reiterated pledges to continue with policies of fiscal austerity to combat inflation.

"Inflation has been eating up the dollars needed to create the jobs, but most of all, inflation has been robbing the poor, the elderly, the young and others who already suffer from discrimination, who have to trade at the corner grocery store where the prices are probably twice as high as they are at a supermarket out near the beltway," Carter said.

The president flew here from a town hall meeting at Merced College in California, where he vowed to continue his partial grain embargo against the Soviets.

Against a backdrop of American flags and the strains of patriotic music, Carter took issue with the claims of his Republican opposition that the partial grain embargo has hurt American farmers without damaging the Soviets.

The Soviets are suffering a grain shortage of 10 million to 11 million tons, Carter said, "which in my opinion impresses upon every Soviet citizen . . . that they are not producing as much poultry and red meat as they would otherwise."

The statement, taking advantage of an expected question at a town meeting in the nation's richest agricultural region, was Carter's way of replying to a call by Reagan and Sen. Bob Dole (Kan.), a GOP agricultural spokesman, that he call off the grain embargo.

"It has failed," Reagan said of the embargo in a statement issued Thursday. "Not only has it been ineffectual in dealing with the Russians, it also has severely hurt America's farmers."

Reagan said the grain embargo has cost taxpayers $1 billion that could have been used for military defense and vowed "when elected" to end the embargo.

Carter said today that there is little that the United States can do about the invasion of Afghanistan "short of actual war" but added that the grain embargo and the U.S. boycott of the summer Olympic Games in Moscow are the best possible response.

"I think we ought to punish the Soviet Union for their invasion and convince them that aggression in this world does not pay," Carter said, "and I would like to remind you that everything we have done against the Soviets is effective but it's peaceful in nature."

The friendly crowd and Carter seemed amused by an exchange between the president and Les McCabe, dean of instructional services at the college and a part-time farmer.

McCabe questioned the Carter policy of putting up a fence on the U.S. border to keep out Mexican immigrants while the nation was welcoming Cuban refugees who arrived by boat.

"We once had a bracero program (of legal Mexican farm labor immigration) that made it easy to get workers during harvest time," McCabe said. "Your immigration service has taken my picking crew several times."

"I understand," Carter replied, "Well, okay, I might say it is your immigration service too, right?"

"I will tell them (immigration agents) to leave next time," McCabe said dryly to laughter from the audience.

A few moments later, objecting to what he thought was a slur by McCabe on the work habits of Cubans and Vietnamese regugees, Carter said: "There are loafers in my own family -- I hate to admit it. Maybe even in yours. Maybe even in your family."

"I don't talk about my in-laws," McCabe said.

Except for this exchange, it was a serious day for Carter, who repeatedly envoked patriotic and historical themes.

Carter gave a lengthy, emotional response when a young Merced questioner, John Sells, asked him when the American hostages in Iran would be released.

Without giving a timetable, Carter said the plight of the hostages "literally never leaves my mind," and added, "I have probably put more time and prayer on that one subject than any other than I have faced as president."

Carter said that in the last several hours he had been in touch with the State Department "and with others that I can't name publicly in trying to have an avenue to the Iranian leaders to get our hostages released."

This seemed to presage developments in the hostage situation, but Carter downplayed the idea of any new initiative when reporters cornered him after the town meeting.

"We're trying different things -- nothing special," Carter said. "I can't predict any breakthrough. We're just trying all the time different things."

Carter took a quick helicopter trip from Merced to Modesto, 38 miles to the north, where he spoke at a $500-a-person outdoor fund-raiser. The event was at the home of Frank Damrell Jr., a former Washington lobbyist for wealthy California landowners who are seeking reclamation law changes that will enable them to keep their federa water subsidies.

But the turnout at the fund-raiser was disappointing, according to one major contributor who attended. At least 250 paying guests had been expected, but fewer than 200 showed up for the "creative omelette" brunch and the wine of Democratic contributors Ernestine and Julio Gallo.

Arriving in Miami tonight, Carter walked past about 200 shouting, placard-waving black demonstrators who gathered across the street from the hotel where the NAACP was meeting. Carter, whose motorcade had been pelted with rocks and bottles thrown by angry blacks in Miami's riot-wracked Liberty City less than a month ago, turned his back on the demonstrators tonight.

The protesters said they wanted Carter to know that $71 million in federal aid for riot recovery for Miami was not enough.

As Carter walked on to the stage for his address, a NAACP youth gospel choir chorused, "Mr. President, we want jobs."

The NAACP members gave Carter a warmer reception when he reminded them of his appointment of minorities to the federal bench. The president said a Reagan presidency might not only reverse the trend but also bring a far more conservative judiciary and Supreme Court.

"I have only served 3 1/2 years as president, but I have already appointed more blacks, more women, and more Hispanics to the federal bench as judges than all other presidents in the 200-year history of this country. And I'm not through yet," he said. "These federal judges serve for life. They will be interpreting your rights, the rights of our children and the rights of our children's children in the next century."

NAACP members had given Kennedy a far more enthusiatic reception when he spoke on Wednesday. Kennedy had sharply criticized Carter for compromising traditional Democratic policies and bending to the rightward drift of the nation.

But if NAACP members' hearts were with Kennedy, their heads seem to be with Carter, most believing that Kennedy stands little chance of cutting Carter's majority of delegates to the Democratic National Convention.

"I think black people are willing to overlook some of the frustrations that they have had with Carter," said NAACP member Elmer H. Blackburne of Jamaica, N.Y. "I think we'll take another chance."

NAACP director Benjamin Hooks, clearly dissatisfied with Carter's message of fiscal restraint, said nevertheless, "I've got to compare him not with an idea I have in mind but with Ronald Reagan."

Carter's reminder of the changes Reagan could make in the Supreme Court and federal judiciary was a sobering note," Hooks said. "Maybe we don't want to deal with it, but it's something we have to deal with."

After his appearance at the convention, Carter flew to Plains, Ga., his first trip home in nine months. His schedule calls for him to remain there until Tuesday, when he flies to Japan after a stop in Detroit.