No single element in the Salvadoran war more surely conjures up the ghosts of Vietnam than the small but growing presence of U.S. military advisers here.

According to the U.S. Embassy, there are currently 42 advisers and support personnel. Soon there will be 56, including a contingent of 15 from the Special Forces to instruct Salvadoran infantry units.

These figures do not include more than a dozen Marine guards at the U.S. Embassy or the military attache and his office.

The advisers themselves find fears of another Vietnam difficult to understand. Some believe that the analogy is only being raised as a leftist tactic to weaken American resolve.

"There is simply no comparison between Vietnam and here," said an American veteran of Southeast teaching helicopter maintenance. He said the Salvadoran troops have a level of resolve and ingenuity he never saw among the Vietnamese.

In the field, however, there are parallels that are obvious and are admitted by U.S. officials. The guerrillas are elusive and the Salvadoran armed forces are ill-trained and ill-equipped to fight them. Although the left does not have the popular support to mount a massive insurrection, it has at least enough popular tolerance to continue its war for some time.

At the moment, the Salvadoran troops are trying to establish control of all villages and towns in the country. Essentially these are becoming what used to be called in Vietnam strategic hamlets.

The body counting that became so notorious in Vietnam has already begun here. The Salvadoran Army claims that it has lost only about 150 men while killing 2,200 guerrillas since Jan. 10. Yet in only one village, Aguacayo, north of the capital, soldiers said that five of their 120-man company had been killed in the last 12 days. They said they had also killed "many" guerrillas, but of several soldiers questioned not one had actually seen a guerrilla body.

Asked about all this, one U.S. soldier here said there are basically very few ways to fight a guerrilla war. "We're going to do it better," he said of the effort that would be made here.

Informed Western sources are saying that it may not be possible to defeat the guerrillas militarily. The United States is encouraging the Salvadoran government to continue with reforms and planned elections so the government will "eventually be able to win without destroying the enemy," according to one authoritative source.

But the agrarian reform is constantly undercut by guerrilla attacks and harassment, and it is hard to envision significant elections if the guerrillas can maintain their current level of activity in the countryside, where 60 percent of the Salvadoran population lives.

As one Western source who has studied the fighting closely put it, "This is going to be a long war."

The risk that one or more American advisers will die here grows every day.

They take security precautions but remain obvious targets for political assassins. They vary the route from their quarters to their assignments every day, and when not on duty they carry pistols and dress in civilian clothes.

But some have already had their pictures published, and as they continue their six-month tours here their habits and whereabouts inevitably will become known.

Aside from the threat of assassination, there is a considerable possibility that some advisers will encounter combat despite their orders and intention to avoid it.

Already one member of the U.S. Embassy's Military Group has been under fire. He was visiting the Salvadoran military airfield just outside the capital when it was attacked Jan. 10 at the beginning of the guerrillas' offensive. He remained there through more than an hour of fighting.

There is also a risk of serious accidents in this volatile environment. One adviser was walking out of a San Salvador restaurant earlier this month when his friend dropped a loaded pistol, which went off and shot him through the foot. The injury was not serious, and the man is expected to return to duty this week, according to a U.S. Embassy spokesman.

The advisers try to minimize their significance.

"When you bring in a piece of equipment like a Huey [the American UH1H helicopters now being supplied to the Salvadoran government] you have to bring in the technical assistance. It's just like a nut or a bolt, we're like wrenches . . . if something happens to us it's an industrial accident."

It is slowly dawning on the advisers, however, just how closely and with what concern the people of the United States are watching them, because they hear it reflected in their telephone conversations with their families.

"My wife is pretty concerned," said one veteran mechanic, a Hispanic American with a round, sunburned face. "For some reason she's taken this tour pretty seriously, even more than Vietnam.

My son is 10 years old," he continued. "He's getting very interested in the news, and he's asking lots of questions of my wife that she can't answer because I can't tell her what it's like over the telephone."

"It tells you something," said another adviser, "when your 5-year-old son asks 'Is Daddy going to get dead?'"

So what are these young Americans risking their lives to do here?

Five of them are in the Military Group of the embassy.Here for more than a year, this group basically acts as liaison with the Salvadoran Army and coordinates the U.S. presence as well as gathering military intelligence. The chief of the group, a colonel, is the highest ranking U.S. officer here and commands the rest of the advisers.

Another group of seven advisers deals with overall administration, logistics and command problems, all of which have proved to be serious difficulties for Salvadoran Army.

One informed source said that attempts earlier in the year to sweep guerrillas out of the northern sections of the country were not successful, because the Army attempted to do too much in too large an area with too little command and control.

A group of eight advisers, with two more on the way, is involved with planning specific operations. Some of them were originally brought here for a few months last fall to work out a plan for protecting agricultural production known as Operation Golden Harvest. Now they are dealing with more offensive operations.

There are 19 advisers currently instructing the Salvadorans in the use and maintenance of the six new helicopters and the Salvadoran Navy's handful of patrol boats in the Gulf of Fonseca.

The advisers in closet contact with fighting troops will be the members of three five-man "small unit training teams." Three members of these teams are already here. The remaining 12 are expected within a week.

These are Special Forces personnel, popularly known as Green Berets, scheduled to come here from the U.S. Army School of the Americas at Ft. Gulick in Panama, where about 300 Salvadoran officers and noncommissioned officers have recieved training in the last several months.

According to informed sources, the primary responsibility of the Green Berets will be to train a new paid reaction unit being organized near the town of San Andres south of the capital. The idea is to create a force of 1,000 or more men who can use the U.S. helicopters to move quickly and effectively against concentrations of guerrillas.

There is a lot of work to be done. The Salvadoran armed forces were never trained to fight a large-scale insurgency. They are unfamiliar with the sophisticated equipment.

In one recent action a frightened soldier jumping out of a helicopter grabbed the control stick. When the pilot tried to compensate, the helicopter blade angled down and decapitated two soldiers already on the ground.

In areas of heavy fighting such as Suchitoto, patrols with as many as 30 soldiers often go out loaded on a flatbed truck that is easy prey for guerrilla mines, rockets and machine guns.

Rather than wiping out the guerrillas, the most they expect to accomplish at the moment is to make them use up precious ammunition and hope that the U.S. training, equipment and diplomatic pressure can keep the guerrillas from getting more.