AGUIRÓ, Spain — During the summer months, Josep Jordana, a 56-year-old sheep farmer, moves his flock from this hamlet of just a dozen residents, perched on the Catalan side of the Pyrenees, up a dirt track to graze at higher altitudes.
He spends his days walking up and down the slopes in search of the lushest pastures, generally trying to keep his 1,300 sheep close together but occasionally needing to isolate a maimed animal or a newborn lamb and its mother.
Shepherding is a tough and solitary job that mountain farmers have passed on for as long as anybody here can remember — "at least seven or eight generations" in the case of Jordana's family, he said.
But steadily, as rural communities like this one are slowly depleted, that tradition is changing.
For the past four months, Jordana, who has no children, has been teaching sheep farming to Laura Madrid, 28, an unlikely shepherd, perhaps, if ever there was one.
With a master's degree in biology, Madrid had originally planned to pursue a doctorate in her home city, Barcelona — until she decided to apply to Catalonia's school of shepherds.
Jordana said he was still coming to terms with the idea that shepherding could be taught in a school and rewarded with a certificate delivered by the regional ministry of agriculture. "It used to be just something that you learn from your dad," he said.
Still, he acknowledged that without the arrival of people like Madrid from the cities there would soon be nobody willing to take over the ancestral shepherd's crook, as well as to maintain rural traditions and remote communities like Aguiró.
"The survival of sheep isn't at risk — because there will always be a sheep farming industry — but the values and traditions of the shepherds certainly are," Jordana said.
From 1982 to 2009, the number of sheep farms in Catalonia almost halved, from 3,964 to 2,085, according to the most recent census. There are no official statistics for the number of shepherds, but fewer than a dozen now work in the mountains of Catalonia, and most of them are nearing retirement age, according to the Catalan school of shepherds.
"We're trying to maintain a generational handover that otherwise would probably no longer take place," said Vanesa Freixa, director of the school, which opened in 2009 and is one of four such schools across Spain.
Madrid is among 14 students who this month will complete a five-month course run by the school.
The course starts with a month of classroom instruction, covering topics like nutrition and animal diseases. The students are then sent across the region to spend four months working alongside a veteran shepherd.
Freixa said the intake of students had been kept deliberately low to keep the school "at a human scale," even if the number of applicants was now more than double the available spots.
She argued that the school's popularity was not so much due to Spain's near-record unemployment as it was to people's desire for an alternative to the hustle and bustle of urban life. Half of her applicants already have a university degree, she said.
"There is a whole new generation that wants to live differently — and these are the candidates we really target, rather than those just seeking a job," Freixa said. "More people believe in understanding and producing their own food, so becoming a shepherd is a choice that is courageous but also makes perfect sense for them."
Some shepherds certainly seem to enjoy the recognition that their profession is getting, albeit belatedly.
"Until recently, the shepherd was often the idiot or the cripple in the family, the one who couldn't do the most important farming work, but this is now a job for which you get respect," said Armand Flaujat, who tends sheep for seven farmers during the summer months, high up in the meadows of Catalonia's largest nature park, which are covered with snow the rest of the year.
Flaujat, however, also stressed that the survival of his job was closely linked to that of the brown bear, which was reintroduced in the Pyrenees two decades ago, using bears from Slovenia, as part of a multimillion-euro European Union environmental program called Life.
The reintroduction of the bears caused tensions with local farmers, who demanded money from the European Union to protect their livestock from the bears, and wolves, and to add mountain shepherds to safeguard their sheep.
The subsidies mean that mountain shepherds in Catalonia can earn almost 3,000 euros, about $3330, a month; the national minimum monthly wage in Spain is 756 euros.
"If it weren't for the return of the bear, the mountain shepherd would have disappeared from many places by now," Flaujat said.
Similarly, the shepherd school relies on European and regional subsidies for about 70 percent of its annual budget of 67,000 euros. It charges students 500 euros for the course, and the students receive food and lodging from their instructing shepherd in exchange for working for free.
Freixa said that three-quarters of those who had completed the course had found a farming job, although not necessarily as a shepherd.
One, Xevi Crosas, 35, said his training as a shepherd was "a catalyst to have the courage to start my own farming business."
Together with his girlfriend and another friend, he now produces mató, a Catalan cheese, as well as yogurt and meat from 120 sheep kept on a property that he leased in 2010. Almost half of the startup investment of 110,000 euros came from European and other farming subsidies.
Crosas previously worked in museums. His decision to train as a shepherd initially shocked his parents, particularly his father, who worked in construction but came from a family of farmers.
"My dad's idea was that making progress was precisely to leave the farm, get an education and end up in an office," Crosas said. "But now he often comes to the farm and helps out."
Madrid, the former biology student, said that working alongside Jordana had helped reshape her views on education.
"There are different types of knowledge, but it's as important to know how to work in a lab as how to manage a plot of land," she said. "I might know the name of a plant that he doesn't know, but he clearly knows whether his sheep should eat that plant or not."
After the training with Jordana, Madrid said she hoped to start tending sheep in another remote mountain town in October.
"I guess I also enjoy the loneliness," she said.