DES MOINES, Iowa (AP) _ When the Class of '91 enrolled in ag schools, the farm economy was only just beginning to recover from its deepest decline since the Great Depression.

Preparing for a career in agriculture was akin to swimming toward the Titanic.

But the outlook has brightened considerably for those students as they enter the job market this spring, and the future is glowing for undergraduates.

A federal study says that at least through 1995, there won't be enough qualified ag school grads to go around for all the available jobs. Fewer than one in 13 of those jobs will be in farm production, with much of the job growth expected in food processing and in selling seed and chemicals to farmers.

''I never hesitated once going into agriculture. That's exactly what I wanted to do. I had this attitude that people will always have to eat,'' says Cindy Ludwig, who has just been hired out of Iowa State University for $25,000 a year plus benefits by the Cenex-Land O'Lakes cooperatives.

Ms. Ludwig, 22, grew up on her father's grain and livestock farm near Carroll, and earned a degree in agricultural business. After a training program, she'll become a crop specialist working as an agronomy consultant and encouraging farmers to buy from the cooperative.

Teri Troxel, 23, of Waterloo is taking her degree in food technology and science to Downers Grove, Ill., where she will work in the analytical laboratory of Dove International, the Mars candy unit that makes Dove Bars ice cream and other snack foods.

Her salary will be in the mid-$30,000s for checking the quality of raw ingredients as well as monitoring food production.

''From what I've seen, it (the job market) is really good,'' she says.

It is good, especially for graduates who specialized in food processing, food engineering, sales and marketing, says Allan Goecker, assistant dean and associate director of academic programs at the ag school at Purdue.

Graduates with bachelor of science degrees are earning in the mid- to upper $30,000s in such fields, Goecker says.

''Studies of the next five years suggest it's going to continue strong,'' he says.

Goecker was one of the authors of ''Employment Opportunities for College Graduates in Food and Agricultural Science: Agriculture, Natural Resources and Veterinary Medicine,'' published in December by the U.S. Department of Agriculture.

The study projects nearly 48,800 job opportunities each year through 1995, and a supply of 43,500 ag school graduates with bachelors or advanced degrees each year to fill those positions, a shortfall of about 11 percent.

The study says that when ag schools don't fill the bill, employers turn to business schools and liberal arts graduates.

Roger Bruene, the placement coordinator for the College of Agriculture at Iowa State, says half ISU's ag school grads now go into agribusiness - selling goods or services to farmers or working for food processors. That's up from 40 percent in the late 1970s and early 1980s.

Of the other 50 percent, about an equal number go to one of three fields - graduate or professional schools, such as veterinary medicine; government service and farming. Bruene says that 10 to 15 years ago, one out of four graduates would go into farming.

Bruene says the turnabout in the job market reflects what happened to agriculture and ag schools in the 1980s - a decade of stress for farming.

At its peak in 1980, Iowa State turned out 760 graduates with bachelor of science degrees in agriculture. That was before heavy debt, rising interest rates and plunging farmland values deflated the farm boom. These days, Iowa State is turning out a more modest 400 to 425 ag graduates a year.

Enrollment was down as agriculture emerged from its recession and agribusinesses began to worry that retrenchments and hiring freezes had left them without a new generation of trained employees.

''All of a sudden, employers realized there are not as many graduates around,'' Bruene says.