Panama City — On a recent steamy day at Fort Sherman in Panama, Pfc. Julio Hernandez, United States Army, was struggling to cross a rope bridge so that his squad of soldiers could complete a difficult jungle obstacle course together.
A few miles away, a classroom of Salvadorean military cadets at the US Army's School of the Americas at Fort Gulick were learning how to plot artillery range and bearing from a US officer who spoke fluent Spanish. Mindful of the war back home, they asked that their faces not be photographed.
At the same time, across the narrow isthmus in Panama City, political partisans cheered and listened to a band on a flatbed truck while they waited for the results of last week's presidential election. Broken windows in buildings across the street indicated that things had been more tense the night before.
Connecting these events, and quietly underlying all US military activity in Central America, is concern over how US presence in the region will evolve as the Panama Canal Treaty comes into full force. The treaty, signed five years ago , says all US military forces must be out of Panama by the end of 1999. The US has already turned over several important facilities and much of its military training real estate here.
On Capitol Hill this week, Pentagon officials are explaining why the United States wants to build militarily valuable sites and facilities in Honduras. One reason, they say, is uncertainty over the future of US military outpost in Panama and the more than 9,000 American soldiers, sailors, airmen, and marines stationed there.
Since Panama is headquarters for the US Southern Command (charged with carrying out US military policy in all of Latin America), requirements under the Panama Canal Treaty could have great impact on US plans and policies for Central America.
This is especially true with the growing importance of training centers here for US and Latin American military personnel. But it also concerns US treaty obligations, officials concede, and the possibility that circumstances could necessitate direct combat action by US forces.
There may be loopholes in the treaty, having to do with the defense of the canal itself that would permit an extended US military presence here. But whether Uncle Sam will be able to squeeze through depends on the uncertain future of the Panamanian government, officials here say.
''With an unfriendly government here in Panama, we could have problems with the use of our forces,'' a senior US military officer confided. ''And it might be more advantageous to have them somewhere else.''
At the same time, officials point out, US-Panamanian relations remain very good despite uncertainty following the first presidential election in 16 years, a contest that included challenges to the ruling military government.
''It was different during the Falklands (when the US backed Britain against Argentina),'' says one US source here. ''But for the past year or so it's been very, very quiet. All sides have chosen to stay away from issues with the United States.''
Under the Panama Canal Treaty, the United States must follow a timetable in turning over barracks and other facilities. The US Army's 193rd Infantry Brigade (a force of about 7,000 soldiers) has already had its training area cut by nearly 60 percent.
The next milestone occurs this October, when much of Fort Gulick will be relinquished and the US Army School of the Americas there will be restructured under bilateral agreement.
Founded in 1946, the School of the Americas has graduated more than 44,000 students from 20 Latin American countries in various military subjects. Critics have called it ''a school for dictators,'' since many graduates have gone on to become senior officials in various military governments throughout the region.
But US officials see the school as crucial to helping allies in Latin America counter insurgency movements, especially the spread of Soviet- and Cuban-supported Marxism. And they note the progress that has been made in moving away from the rigid class structure behind some military governments.
Col. Nicholas A. Andreacchio, the school's commandant, points out that Honduras recently began allowing noncommissioned officers to take officer candidate instruction at the school. Under the Reagan administration, the number of students annually completing courses here has tripled, and the full student output (as measured in classroom time) has jumped fivefold.
Representatives of the US and Panamanian governments have tentatively agreed to rename the school the ''Pan American Institute of Military Science and National Development.'' In essence, the school will be expanded to include courses in resource-management, medical, and public-works subjects. If the Panamanian government formally agrees, the US Army will still have prime responsibility for military instruction here.
US sources here leave no doubt that they want American military forces to remain in Panama beyond the treaty limits. ''We certainly see the need for a longer presence here,'' one senior military officer said. ''Under the existing situation in the region, I'm sure we wouldn't want to reduce it.''
At the same time, the US is hedging its bets against the day when it might be forced to pull out of Panama.
''As we approach the termination of the Panama Canal Treaty at the end of 1999, we will have to consider alternatives for keeping US forces in the area to protect our interests and carry out treaty obligations,'' Deputy Defense Secretary William H. Taft IV told Congress in a recent report on US military activities in Honduras.
New or upgraded facilities in Honduras include a runway lengthened to accommodate US tactical jet aircraft, storage facilities for fuel and ammunition , and another improved airfield to provide an alternate landing place for jets flying from US aircraft carriers.
Such things might be needed, said Mr. Taft, in the event that US forces had to intervene under the Inter-American Treaty of Reciprocal Assistance (the so-called Rio Pact of 1947). Taft also said the Pentagon plans continuing military exercises in Honduras through 1988.
Meanwhile, US officials wait to see what will happen to the large US military establishment in Panama. Beyond the 9,300 American troops stationed here, 8,000 more are honing their jungle warfare skills each year at the US Army's Jungle Operations Training Center at the Caribbean end of the Panama Canal. Military officers say such training is essential if the armed services are to regain counterinsurgency skills neglected after Vietnam.
They are concerned about the Panama Canal Treaty's impact, but - for the moment, at least - not too worried. Says one officer here: ''More and more on the streets, we're hearing people say, 'Hey, you guys aren't really going to go, are you?''
Next: Growing importance of U.S. military exercises in Latin America.