HORNBROOK, Calif. — On a frigid morning in a small metal-sided building, a team of specialists prepared to orchestrate an elaborate breeding routine. The work would be wet and messy, so they wore waders. Their tools included egg trays and a rubber mallet, which they used to brain a fertile female coho salmon, now hanging dead on a hook.

Diana Chesney, a biologist, studied a piece of paper with a matrix of numbers, each one denoting a male salmon and potential match for the female coho.

“This is the bible,” she said of the matrix. “It’s what Carlos says.”

John Carlos Garza, a geneticist based a day’s drive south in Santa Cruz, has become a key figure in California’s effort to preserve its decimated salmon stocks. Using the latest genetic techniques, he and his team decide which individual fish should be bred together. At several major state conservation hatcheries, like the coho program here at Iron Gate, no two salmon are spawned until after Dr. Garza gives counsel — a “salmon mating service,” he jokingly calls it.

His painstaking work is the latest man-made solution to help fix a man-made problem that is about 150 years old: Dams, logging, mining, farming, fishing and other industries have so fractured and polluted the river system that salmon can no longer migrate and thrive. In fact, today, owing to the battered habitat, virtually all salmon in California are raised in hatcheries.