In Professor Sung Lee's graduate course on "finite elements" at the University of Maryland, half of the 30 engineering students last semester were from foreign countries. The same was true in his "structural dynamics" course.

When Jean-Pierre Meyer, chairman of the mathematics department at Johns Hopkins University, looks down the roll of his 34 graduate students, he sees 14 Americans listed; the rest are foreigners.

Next door in the Hopkins physics department, nearly a third of the 86 graduate students last year were foreign, half from the People's Republic of China.

Surveys by the National Science Foundation show that these universities are not unusual: Across the country, the number of foreign graduate students enrolled in all fields of science has grown dramatically. In engineering, mathematics and computer sciences, more than 40 percent of graduate school enrollment is foreign.

At the same time, enrollment of American students in the sciences is declining or increasing slightly. For the past two years, foreign students have accounted for nearly two-thirds of the growth in graduate science and engineering enrollment.

For Meyer and Lee, who came to this country as a graduate student from Korea, there are two perspectives on the changing profile of America's scientists.

Like other educators, they are proud that American universities can draw students from around the world. They welcome the diversity and the impressive academic credentials brought by foreign students.

But in light of other factors -- an aging work force in the sciences and the fact that many foreign students leave the country after completing their studies -- they worry that the United States is heading toward a shortage of scientists.

"We don't have too many foreign students. We have too few American students," said F. Karl Willenbrock, executive director of the American Society for Engineering Education. "This is a signal -- we're not attracting enough U.S. students into faculty, academic careers and graduate school."

"We don't really care who does the research," Meyer said. But, he added: "It's a very dangerous situation . . . we don't have enough American graduates to staff American graduate departments in the near future."

At Iowa State University, foreign students make up 43 percent of graduate enrollment in science and engineering. Administrators there wonder aloud whether in the future new faculty will have to come predominantly from abroad and what that would mean for the foreign scientists' countries.

"If engineering depends significantly on citizens of other countries . . . you're participating in a brain drain," said George G. Karas, associate dean of the Iowa State graduate school.

Other educators ask whether American universities are depending too heavily on foreign students to fill seats, setting themselves up for problems if international enrollment drops due to economic or political changes.

Foreign student enrollment is particularly high in engineering, with half of the doctorate degrees granted last year going to foreign students and with foreign professors making up half of the newly appointed faculty, according to Willenbrock. And in mathematics, close to half of the untenured faculty last year was foreign, according to a survey of 35 major institutions conducted for the Conference Board of Mathematical Sciences.

The Conference Board study of graduate mathematics enrollment warned that a high concentration of older mathematicians combined with declining numbers of new American students in mathematics is "not healthy in a field in which research accomplishments are dominated by the young . . . continued American leadership in the mathematical sciences is central to the long-term prosperity of the nation."

The changing enrollment also underscores concern in Washington and corporate boardrooms over the nation's relative position in the global market, much of which hinges on scientific and technological prowess. Contributing to the worry are clear patterns among American students -- undergraduates are bypassing graduate school to accept lucrative jobs in industry, and even high schools appear unable to stimulate much interest in the hard sciences.

Willenbrock pointed to problems that could result from increased number of foreign-born engineers. Foreign students often opt for theoretical rather than applied research. And noncitizens often have difficulty gaining security clearance to work on classified defense contracts, which make up a large part of engineering work in the country today.

The increase in foreign graduate students -- many of whom teach undergraduate classes -- has led to other changes. On many campuses, including George Washington University, complaints that language problems make foreign teaching assistants difficult to understand have led to requirements that teaching assistants demonstrate English proficiency.

Syracuse University is in the midst of a two-week training program for its 300 new teaching assistants, a third of whom are foreign. The new program includes courses like "American Slang" and "Characteristics of American Students."

The University of Maryland was one of the first institutions to take its new teaching assistants through a week-long training and evaluation program, in which graduate students are tested for English proficiency and asked to teach simulated classes.

"A lot of our American students aren't receptive to an accent -- we are parochial," said Valerie Woolston, director of international education services at College Park. "Sometimes the academic background is very different, sometimes it's pedagogy . . . . All of us believe if we can cure some of these ills, everybody is better off."

Massachusetts recently passed a law requiring foreign students at public colleges to pay the "true cost" of their education, imposing large tuition increases over "out-of-state" rates. Supporters of the law objected to subsidization of foreign students and argued that most could afford to pay more tuition.

Despite the signs of antiforeign sentiment on some campuses, most academic specialists who interpreted the enrollment trends said their concerns are tied not to the increasing number of foreigners but to decreasing American enrollment.

"The United States is still viewed as the place to come study in the sciences; it attracts people worldwide," said John F. Reichard, executive vice president of the National Association for Foreign Student Affairs. "It begins to become a problem if it grows much larger, if the United States is simply not producing a significant pool of candidates."

He estimated that foreign students bring $2 billion into the U.S. economy each year, in addition to cultural and academic contributions.

Last year the number of American students enrolled in the sciences -- engineering, physical, life and social sciences -- increased only 2 percent, while the number of foreign students increased 10 percent, according to the National Science Foundation (NSF), which annually surveys graduate enrollment.

And in 1985, the number of Americans fell in each of these fields except math, computer sciences and engineering, while the number of foreign students increased in all of them, jumping from 15 percent of total graduate enrollment in 1977 to 26 percent in 1985.

The largest numbers of foreign students come from Asian and Mideast nations, including China, Korea, Japan, India, Iran and Iraq. Of the 5,000 foreign students granted doctoral degrees in the sciences last year, 57 percent of those who had firm plans said they would remain in this country, according to NSF.

While concern about the brain drain from these countries is real, there are many in the scientific community who choose to emphasize what the United States stands to gain.

"We've done very well with the people we got from other countries," said Peter Renz, administrative officer of the Conference Board, a consortium of mathematics organizations. "They include Albert Einstein and Enrico Fermi."