BUTTENWIESEN, Germany, July 25 — Surely Heiner Gärtner is one of the only farmers in Germany, if not most of Europe, who greets the dawn of yet another cloudless day with anticipation rather than angst.
As Germany sizzles through what is expected to be its hottest July on record, crops are shriveling and farmers are growing desperate. Some have petitioned the European Union to allow sheep and cattle to graze on land normally off limits, because their own fields are scorched.
Here on Mr. Gärtner’s 200-acre farm, however, the fields are covered with 10,050 solar panels, which soak up the sunshine and convert it into electricity. The ambient hum in the air is not the sound of insects but of transformers carrying a high-voltage current to the villages nearby.
“We’ve had so much sun,” said Mr. Gärtner, 34, a wide-brimmed hat shielding his face from the rays. “It would be better if we could have this much sun with less heat. But you can’t have everything.”
Extreme heat actually reduces the efficiency of the solar panels, he said, pointing to a dial that showed the plant was running at 83 percent of its capacity. On cooler days, the panels operate at full capacity.
Even so, this is shaping up as a thriving summer for Mr. Gärtner — vindicating his decision in 2003 to turn this 150-year-old pig farm into a small-scale electricity plant. Switching from pigs to power saved his family’s enterprise, which was teetering on the edge of economic ruin.
“I couldn’t repair the roof if I only bred pigs,” said Mr. Gärtner, a self-confident fellow with a spiel that is far more entrepreneurial than agricultural. “We have to compete worldwide these days. Pork from Brazil costs half as much as German pork. Our costs are simply too high.”
When Mr. Gärtner took over the farm from his father in 2002, his options seemed few and dismal. He considered selling most of the property and keeping only his family’s stone house — a last vestige of the farm started by his great-grandfather, who kept cattle, chickens and other animals.
But there were few buyers, even for a farm that is fairly large by southern German standards and blessed with broad, flat meadows amid the gently rolling countryside of Bavaria. Farms in eastern Germany and Poland are much larger and therefore more economically viable.
Although the recent collapse in global negotiations over tariffs, farm subsidies and other barriers at the World Trade Organization may protect European farmers awhile longer, Bavaria has long promoted its high-technology industry over agriculture. “Germany is an industrial country, not an agricultural country,” Mr. Gärtner said. “We’re on the wrong end.”
Visiting a classmate in northern Germany after graduating from college with a degree in agricultural engineering, Mr. Gärtner was struck by the windmills that dot the countryside there. His father had already experimented with making biodiesel fuel out of rapeseed — even running a Volkswagen with it — so the concept of renewable energy was not alien to him.
Europe, seeking to reduce its reliance on fossil fuels, has encouraged the development of alternative energy by offering hefty subsidies for people to put up windmills on their property. Germany’s wind-power industry is the world’s largest, yet growth here has slowed as people have begun to protest the proliferation of these giant propellers near their homes.
Bavaria, with its inland location, lacks the coastal breezes that turn windmills. But it gets more sunshine than other parts of Germany. Moreover, the Gärtner farm, which is known as Maierhof, has an especially sunny location, with southern exposure and few hills to block the light.
In 2004, Germany passed a new law that guaranteed people who built solar parks a minimum price for each kilowatt of electricity that was two to three times the market price.
That prompted Mr. Gärtner to investigate the possibility of turning his fields of corn, wheat and barley into rows of photovoltaic panels. With a lack of solar experts in Germany, he and his classmate, Ove Petersen, taught themselves the technology (they are now partners in the venture).
The hardest part, he said, was obtaining loans to finance the roughly $5 million in construction costs. Mr. Gärtner also had to persuade the mayor of Buttenwiesen to allow him to string power lines across the fields. With only a handful of farmers in Germany installing these panels on a large scale, “people really had no idea what we were talking about,” he said.
The project is a family affair. Mr. Gärtner recruited his sister, Annette, who is an architect in the nearby city of Augsburg, to design the complex. His 69-year-old father, Heinrich, provides moral support, keeping an eye on the dials when he is not feeding the fish in his pond.
When his panels run at full capacity, Mr. Gärtner figures the farm could supply power to all 7,000 residents of the village. The utility that buys his electricity, however, uses it to meet demand at peak periods, like during this heat wave, when air-conditioners are running full blast.
Mr. Gärtner makes more than $600,000 a year from the sale of this electricity, which will allow him to pay off his loans in 15 to 16 years. That is good for him, because the government is phasing out the preferential prices over the next decade. The Mercedes parked in his farmyard attests to his success.
As he sees it, his farm is merely adapting to an economic cycle that happens to favor a different sort of energy.
“Animals are energy too; they create food for people,” Mr. Gärtner said. “At the moment, power is more profitable than food. That may not always be the case. You have to be flexible.”
To hedge his bets, Mr. Gärtner has held on to his 1,000 pigs. The other day, they were huddled in a shed, sleeping through the searing heat. With the world’s population expanding, he believes, the price of pork may someday rebound enough to make it a viable business again.
In the meantime, the pigs serve another purpose: Mr. Gärtner uses their waste to fuel a biogas plant, which also generates electricity. “One of the criticisms of solar energy is that it is unpredictable because the sun doesn’t always shine,” he said. “This is completely predictable.”