More than energy transformations: a historical transition from organic to industrialized farm systems in a Mediterranean village (Les Oluges, Catalonia, 1860–1959–1999)

ABSTRACT The analysis of energy efficiency of agroecosystems from a sociometabolic perspective is a useful way to assess the sustainability of farm systems. In this paper we examine the transition of a Mediterranean agroecosystem from an organic farm system in the mid nineteenth century to an industrialized one at the end of the twentieth century by means of the technologies and ideology of the Green Revolution. Given that many of the world’s agricultural systems have experienced, or are currently experiencing this transformation, our results are relevant for building more sustainable agricultural systems in future. Our results highlight the relevance of livestock density, and the flows of biomass reused and unharvested biomass as key elements affecting the sustainability of the agroecosystem not only from a socioeconomic perspective, but also from an agroecological point of view. Additionally, from a biocultural perspective our investigation sustains the relevance of the study of traditional farm systems for the development of a sustainable agriculture.


Introduction
The need to build more sustainable agricultural systems, able to feed a growing population in an era of climate change and biodiversity depletion, is a major concern (Pretty et al., 2010). Current industrial agriculture heavily depends on fossil energy and does not seem adequate for achieving this goal in the long term. Conversely, there is a growing interest in agroecology and innovative ways to update and develop the biocultural knowledge embedded in traditional organic farm systems in order to search for a more sustainable agriculture (Altieri, 2004;Altieri & Nicholls, 2005;Gliessman, 2015; International Assessment of Agricultural Knowledge, Science and Technology for Development [IAASTD], 2009;Koohafkan, Altieri, & Gimenez, 2012;Schutter, 2010;Toledo & Barrera-Bassols, 2008;UNCTAD, 2013;Vandermeer, Smith, Perfecto & Quintero, 2009;Wezel et al., 2014).
This paper seeks to add some knowledge about the basic features of sustainable farm systems by adopting a historical approach based on a sociometabolic analysis of agroecosystems (Fischer-Kowalski & Haberl, 2007;González de Molina & Toledo, 2014;Haberl, Fischer-Kowalski, Krausmann, Martínez-Alier & Winiwarter 2009). Many of the world's agricultural systems have experienced, or are currently experiencing similar transformations, by means of the technologies and ideology of the Green Revolution, that our historical case study underwent from the mid-twentieth century onwards. Traditional peasant management of agroecosystems relied on the use of local resources and remained within its biophysical constraints. They performed multiple uses and combinations of land covers, developed complex associations of crops and polycultures, recycled many by-products, and kept the use of external inputs at low levels (Gliessman, Engles & Krieger, 1998;Plieninger, Höchtl & Spek, 2006). All these components of integrated management of agroecosystems were substituted throughout the industrialisation of agriculture by the expansion of monocultures, and a high dependence on fossil-based external inputs. A much more single-minded management that was mainly focused on the target of increasing labour productivity, maximising land yields and generating short-term profits, replaced past organic traditional management of agroecosystems that kept an integrated management among living funds (population, land, livestock and farm-associated biodiversity). The spread of monocultures and mechanization, the extensive use of chemical fertilizers and biocides, and the increase of livestock density based on purchased feedstuff in modern industrial agriculture and animal farming have been linked to ecological problems of pollution and unsustainability, such as the degradation of soil quality, water eutrophication, greenhouse gasses emissions, increased dependence on non-renewable resources and fossil fuels, and loss of genetic diversity, resilience and ecosystem services provision (Altieri & Nicholls, 2005;Conway & Pretty, 2009;Foley et al., 2005;Gliessman, 2015). Furthermore, industrial farming systems and food production are also associated with global economic inequality and human health problems (Horrigan, Lawrence, & Walker, 2002;Johns & Eyzaguirre, 2006;Patel, 2012;Schutter, 2010;Tilman & Clark, 2014).
In this paper we analyse the socio-ecological transition of the farm system of Les Oluges, a village located in the inland semiarid plain of Catalonia (Spain), from the midnineteenth century to the end of the twentieth century. This time span focuses on the transformation from an organic traditional farm system before the arrival of the Green Revolution in the mid-20 th century to an industrialised agriculture by the end of the century, when this industrialisation was completed and reached its zenith. Our analysis reflects that the full industrialisation of the agroecosystem undermined its sustainability due to its lower energy efficiency, its greater dependence on external inputs and fossil fuels, and its reduced capacity to host associated biodiversity. The beginning of the 21 st century would have inaugurate a new land-use regime characterized by an increased globalisation of sociometabolic flows (Guzmán et al., 2018;Soto et al., 2016), a greater efficiency of external inputs (Pellegrini & Fernández, 2018), as well as an spread of environmental awareness (Jepsen et al., 2015) that should be further studied.
In the following section we introduce our sociometabolic methodological approach applied at the farm community level on a municipal scale that helps us to understand agroecosystems as cultural landscapes (Antrop, 2005) shaped by human knowledge and labour. This approach allows us to analyse agroecosystem changes not only from a purely biophysical standpoint, but also looking at the social traits that fostered the transition towards increasingly unsustainable farm systems. Then, we outline the features of the case study and the sources used. In the second section we present the results, mainly looking at the changing structure of energy fund-flow patterns of these agroecosystems, and their ensuing energy returns on investment at three different points of time (1860, 1959 and 1999). In the third section we discuss our results by comparing them with another case study in Catalonia (Spain) so as to highlight some key features and determinants of the sustainability of these farm systems. To conclude we emphasise the importance of livestock management, the dependence on external inputs, and local adaptation to biogeographical natural resource endowments for the agroecological efficiency of farm systems.

Methodology
The methodology applied in this study has been thoroughly explained in previous works published by the international research project on Sustainable Farm Systems (SFS) Gingrich et al., 2018;Guzmán & González de Molina, 2015;Guzmán, González de Molina, Soto Fernández, Infante-Amate, & Aguilera, 2017;Tello et al., 2016;Tello et al., 2015), which has been applied to different case studies around the world on various spatiotemporal scales. The basic modelling follows Georgescu-Roegen's distinction between funds and flows (1971), and establishes a way of accounting for the energy transformation and circulation that characterises the structure and functioning of farm systems from an agroecological perspective. Funds are defined by their capacity to transform biophysical flows and provide goods and services useful to farmers and society. Funds can only transform energy flows at a given rate, and need an energy investment if they are meant to keep their capacity and functioning over time (Giampietro, Cerretelli, & Pimentel, 1992). Different flows of energy are absorbed and provided by these funds, which opens a choice of either interconnecting them through an increasingly complex and integrated energy network or, on the contrary, keeping them separate into ever simpler and linear bioconversion chains. Here lies the most important feature that shapes the organic or industrial character of farming ( Figure 1). The energy fund-flow pattern adopted determines the agroecosystem functioning, the ensuing landscape patterns and processes as the territorialized metabolic imprint, and the ecosystem services provided (Baró et al., 2016;Millenium Ecosystem Assessment, 2005) The main living funds of an agroecosystem are: farmland, livestock, farming community and farm-associated biodiversity. They provide the basic structure of the agroecosystem from which different flows of energy carriers can be distinguished depending on their use, their aim, and their origin. In this regard, we understand the agroecosystem as an ecosystem that requires human labour, as information-as-structure in order to set up a purpose-oriented pattern of energy flows (Font et al., n.d.). Funds provide an output, but must not be degraded to maintain its productive capacity and stability over time (Gliessman et al., 1998). Thus, the farming community is not only a fund but a free agent with a will that plays a fundamental role in the agroecosystem structure and functioning. As our model adopts the point of view of this farming community, we place it outside the agroecosystem boundaries together with the rest of society. The rationale behind this analytical decision is based on the fact that the farming community devises and manages the agroecosystem, introducing a set of External Inputs (EI), and receiving the useful flow we name Final Produce (FP). The labour provided by this farming community is also considered an External Input that takes into account the amount of embodied energy of the diet eaten by farm operators that is metabolised while working in the agroecosystem (Marco, Padró, Cattaneo, Caravaca, & Tello, 2018;Tello et al., 2015). Hence, setting the agroecosystem's boundaries in this way allows us to differentiate the energy fluxes that loop inside the agroecosystem as Biomass Reused (BR) from those that flow outside (FP), and those fluxes that come from outside the agroecosystem (EI). The sum of FP and BR equals the Total Produce (TP) obtained from the available farmland and livestock, i.e. the amount of energy that the agroecosystem generates and is either reinvested for the maintenance of its funds (BR) or diverted to meet human needs (FP). In some situations, a part of the TP does not perform any role as BR or FP; in such case, we consider this part as Waste (W). These are the main funds and flows considered from a socioeconomic perspective.
Additionally, in order to delve into the ecological dimension of agroecosystems other flows are taken into account. The actual Net Primary Productivity (NPPact) considers the whole phytomass biologically produced by the existing land covers within the agroecosystem and throughout the year studied (Krausmann et al., 2013;Vitousek, Ehrlich, Ehrlich, & Matson, 1986) . It includes the biomass harvested, as well as the Unharvested Phytomass (UhP), which is the above-and below-ground biomass that remains in the agroecosystem independently of human aims. UhP is a valuable resource for maintaining farm-associated biodiversity and the provision of ecosystem services. Such a complex pattern of farming funds and flows cannot be assessed in energy terms by a single input/output ratio. Several interrelated EROIs (Energy Return on Investment ratios) are calculated in order to analyse the energy performance of agroecosystems. This multi-EROI approach considers the maintenance of the agroecosystem funds as the grounding requirement for a sustainable functioning of farm systems. Two different groups of EROIs are considered (Table 1). On the one hand, economic EROIs analyse the agroecosystem from an anthropocentric or socioeconomic perspective, linking the energy carriers produced by the agroecosystem that are available for human consumption with the energy purposely invested in it by the farming community and the society it belongs to. On the other hand, given that agroecosystems are not fully human-colonised ecosystems and depend to some extent on ecosystem services, a set of agroecological EROIs are also calculated. These consider the whole photosynthetic productivity of the agroecosystem (NPPact) beyond the biomass appropriated by humans in order to measure the space left to associated biodiversity and the provision of ecosystem services. From an agroecological perspective, NPPactEROI assesses the whole energy return of the agroecosystem beyond a human provision perspective, which is in turn considered by the Agroecological Final EROI (AFEROI). The difference between AFEROI and FEROI is the consideration that the agroecosystem's capacity to provide flows of energy available for human use does not depend only on the human intervention and investment of energy inputs, but also on the unharvested biomass left in the agroecosystem without human intervention. The ratio AFEROI/FEROI provides a measure of human colonisation of the agroecosystem photosynthetic produce, so that when it equals 0 indicates that there is no human detraction at all, and it means a total human colonisation when it reaches a value of 1. Similarly, Human Appropriation of NPP (HANPP) measures the share of NPPact that is controlled by humans for their own purposes (TP/NPPact).
Finally, Biodiversity EROI gives a measure of the agroecosystem's capacity to maintain farm-associated biodiversity through the availability of biomass flows not appropriated by humans per unit of the total energy carriers flowing through the agroecosystem as inputs for all heterotrophic non-domesticated living beings.

The village of Les Oluges in the inland dry plain of Catalonia
Les Oluges is a small village located at 490-650 m.a.s.l. in the Segarra County, in the province of Lleida (Catalonia, Spain) ( Figure 2). It belongs to the so called Poor and Dry Catalonia, an area characterised by its aridity and its concentrated settlement pattern in contrast to the Rich and Wet Catalonia where average rainfall is higher and population was settled in a more scattered pattern (Burgueño, 2014;Garrabou, Planas, & Saguer, 2001;Vilá Valentí & Vila, 1973  The Segarra County had always had an agriculture mainly dedicated to cereals, but vineyards had also traditionally been grown to some extent (Vilá Valentí & Vila, 1973). From the eighteenth century vineyards grew in response to a regional commercial network in which liquors were sold abroad in order to import certain basic products that were needed to complement the frequently scarce yield from cereal lands (Tello, 1986).
During the second half of the nineteenth century vine cultivation expanded in the area at the expense of forests in order to take advantage of the favourable market conditions when the Phylloxera plague began destroying all the vines in France (Pujadas i Rúbies, , 1980). The vineyard boom lasted until 1894, when the Phylloxera plague reached the Segarra County.
In the first decades of the twentieth century, as a result of the end of the turn-ofthe-century agrarian crisis, there was an increased specialisation toward cereal cultivation in the arid plains of Lleida province. Mineral fertilisers started to be used, together with new machinery powered by horses or mules (ploughs, reapers and threshers) and tractors.
The creation of peasant unions and cooperatives helped the rapid spread of these new farm implements and industrial inputs 1 (Ramon Muñoz, 1999). This process was framed in a context of great political, social and economic changes in Catalonia and Spain. It was a period of industrialisation and rural exodus, in which agriculture was definitely changing its mainly subsistence and organic character by adopting a mixed organicindustrial one within a greater market orientation. Another important feature of this period was the beginning of livestock specialisation in some areas of Catalonia for which cerealgrowing territories such as the Segarra County provided grain for feed (García Pascual, 1993;Pujadas i Rúbies et al., 1980;Pujol, 2002) From the 1950s onwards the Green Revolution spread in Catalonia and Spain, agriculture became a completely industrialised activity, and rural population decreased steadily. Under the new technological package, cooperatives became increasingly concentrated and expanded an agribusiness scheme of contract farming and vertical integration (García Pascual, 1993). Following the specialisation trend in Catalonia and Spain, by the end of the 20 th century the weight of livestock production also increased, becoming more dependent on feed imports (Soto et al., 2016). Furthermore, the inputs of nutrients from synthetic fertilizers in the Spanish territory reached their maximum in the 1 In the Segarra County the use of chemical and mineral fertilisers increased from 9.7 kg/ha of sown cropland in 1907 to 256.7 kg/ha in 1934 (Ramon Muñoz, 1999). New industrial machinery powered by mules was spread from 1920s onwards. However, according to the municipal agricultural surveys consulted, the first tractor was introduced in Les Oluges in 1957; ten years later there were 27 tractors registered in the village.
decades of 1990 and 2000 (Guzmán et al., 2018). These trends can be appreciated in Les Oluges in 1999, a moment that could be characterised as a culmination of the Green Revolution.

Sources
In year studied that, nevertheless, will only reflect a short moment in this process of sociometabolic transformation of the agroecosystem.
For the balance of 1999 data was taken from the 1999 agricultural census. It was only possible to obtain municipal data for characterising the size and composition of the local funds (farmland, livestock heads and agrarian population), and the rest of the flows were estimated from provincial data.

Farming community and labour
From 1857 Les Oluges experienced a progressive process of depopulation that accelerated during the second half of the twentieth century (Fig. 2). In the three time points studied the highest population density was registered in 1860, with 42 inhabitants/km 2 . The number of Annual Working Units (AWU) needed in this period was significantly lower than the total population. However, this figure does not take into account the seasonality of agrarian work. Real labour demand would peak in the summer, corresponding to the period of cereal harvest.  1900 1905 1910 1915 1920 1925 1930 1935 1940 1945 1950 1955 1960 1965 1970 1975 1980 1985 1990 1995 2000 2005 Horsepower Inhabitants Population Machinery more than 45 ha in 1999. Consequently, population density decreased to a minimum of 10 inhabitants/km 2 .  In 1860 traditional organic farming involved a close integration among land uses that included cropland, woodland and pastureland. The most widespread crop system was the association of extensive grain growing with a relatively intensive vineyard cultivation ( Fig. 3a). This alley-cropping system mainly consisted of growing cereals in the land strips between rows of trees or vines, by sowing one and leaving another fallow alternatively. This associated crop pattern characterised the traditional cultural landscape of Les Oluges until the second half of the last century.

Farmland
Cropland productivity was low because of the low yields (Table 1; Appendix 1), but also due to the widespread need for biennial fallow which left uncultivated one half of the cropland destined to cereals. This low productivity of cropland required, in turn, an intensive use of woodland for obtaining feed and organic fertilisers.
There was a fragile balance between cultivated and uncropped land that was broken by cropland expansion and intensification in the mid-twentieth century.  Fig. 4b) that augmented the possibilities of the agroecosystem, even though water scarcity made it still necessary to keep 34% of the cereal cropland in fallow. Throughout the second half of the twentieth century pastureland disappeared while livestock density soared (Table 2). In 1999 livestock was confined into feedlots.
Chemical fertilisers became an essential form of fertilisation along with manure, and tractors substituted for animal power. As a result, a great part of the internal flows of the agroecosystem was removed, largely simplifying the cultural landscape: 93% of cropland was devoted to grains in an almost complete homogenous cropland (Fig. 4c), three fourths of which dedicated to barley.
Livestock Figure 5. The changing livestock composition in Les Oluges, before and after the Green Revolution (1860-1959-1999). Source: Our own, from the sources detailed in the text.
In 1860 Les Oluges had a relatively low livestock density of 8 livestock units of a standardised weight of 500 kg (LU500) per km 2 of farmland (Table 2) with a third of the livestock weight corresponding to donkeys (Fig.5). Donkeys were appropriate for a semiarid agroecosystem like Les Oluges in which feed was not abundant: they were less powerful animals than mules or horses, but also less demanding for their maintenance. In 1959 availability of synthetic fertilisers made it possible to partially overcome the previous limitations of natural resources. They allowed a significant cropland expansion and land-use intensification, whereas livestock density was reduced from 8 to 7 LU500/km 2 , and donkeys were largely replaced by mules -a change required to power the new machinery used to carry out the crop expansion with a 49% decrease in the farming population. Given that pigs were mainly raised for domestic consumption, their number decreased with the decline in population. The increase of cropland productivity provided enough resources to feed the barnyard animals, and the use of woodland and pastureland decreased. The considerable increase in poultry and rabbits marks the beginning of a process of specialisation on fowl raising that the Segarra County has gone through from the mid-twentieth century onwards.
In 1999 livestock density skyrocketed to 163 LU500/km 2 (Table 2) largely due to the greater number of pigs and poultry, whose fattening in feedlots became completely industrialised. Draft animals disappeared, and sheep and goats slightly increased but had a testimonial role among livestock. From 1860 to 1959 and 1999 the agroecosystem became more productive in energy terms (Table 3). However, the composition of its energy fluxes changed significantly. In 1860 most of this produce came from woodland, while in the following years there was a process of 'agriculturalisation' (Guzmán & González de Molina, 2015) of farmland by which cropland increased its surface and became the main source of biomass production.

Flows and EROIs
The increase in cropland produce in 1959 was mainly due to cropland expansion, whereas in 1999 it was largely the result of the increase in cereal yields.
The TP appropriated was increasingly diverted to FP throughout the period studied. The back of that coin was the decrease of the biomass reinvested into the agroecosystem (BR) as feed and fertiliser. Between 1860 and 1959 in spite of the increase in the FP extracted, the flow of BR decreased in absolute terms in this same period. BR increased again in 1999, but only because of the rise of livestock density. The abandonment of the BR effort kept in traditional organic agroecosystems was only possible due to its replacement with EI. In 1860, EI came exclusively from the agrarian community, while in 1959 further EI were introduced from the rest of society in the shape of machinery and mineral fertilisers.
Yet in 1959, the replacement of BR by EI was still in its infancy, and the absolute and relative amount of EI remained small. This explains that the FEROI (Table 4) increased between 1860 and 1959, since the unavoidable reduction in the return to EI (EFEROI) was offset by the IFEROI increase due to the simultaneous reduction of BR.
This balance could be kept only as long as the agroecosystem maintained a mixed organic-industrial functioning. The replacement of BR by EI, became almost complete in 1999. From 1959 to 1999, FP increased threefold, but at the cost of an amount of EI forty times higher. Additionally, although most of the FP came from cropland ,EI and BR flows were mainly directed to feed the livestock. As a result, the total energy spent doubled the energy content of the FP provided to society.
The great increase in livestock density and the replacement of BR by EI had an adverse outcome apart from the loss of energy efficiency. A new flow appeared: waste.
This flux refers to resources which under a traditional organic management used to be recycled in the agroecosystem as organic matter stored in the soil, but now have no use or are produced in excess (i.e. surplus manure and crop by-products). The size of this flow is strongly determined by the assumptions made (see Appendix 1) given the lack of statistics on the pace at which reuse of by-products was given up; but ultimately its significance goes beyond its volume, since it denotes a significant eco-inefficiency of farm management.
Another relatively small flow in all three points in time that has a key importance is labour. Its relevance lies on being the main force that manages the agroecosystem, providing information and knowledge for its functioning in order to satisfy human needs.
Labour productivity expressed by the Final EROI on Labour soared in 1999 as a result of the mechanisation of agriculture and industrialisation of livestock production. However, despite Les Oluges produced much more biomass energy in 1999 than in 1860, and with a greater labour productivity, its energy efficiency was lower. Only the IFEROI was higher in 1999 than in previous times, but this entailed the abandonment of an energy flow essential for the sustainable reproduction of agroecosystems: the BR aimed at maintaining soil living organisms and fertility, and integrating land uses.
The clearance of woodland area lessened the most important biological source of high-concentrated energy carriers, but the increase in cropland productivity balanced out this effect in total NPPact. Yet NPPactEROI highlights that the increase in the total biomass photosynthesised was attained at the cost of a massive unsustainable consumption of fossil-fuelled EI, which also decreased the energy efficiency of the agroecosystem. Higher yields at the expense of EI are also behind the evolution of AFEROI. The fact that it reaches a higher value in 1999 than in 1860 should be read carefully. Like the greater IFEROI of 1999, a higher AFEROI does not mean better 'efficiency' but rather the fact of extracting a FP six times larger from the farmland, while recirculating in it only 15% more UhP and BR than in 1860. The internal energy flows looped into the agroecosystem were greater than the energy content of the biomass extracted from it in 1860, but these internal flows were reduced in 1959 and 1999.
Conversely, the lower AFEROI in 1860 reveals the great reinvestment of biomass flows needed to sustain the energy productivity under an organic farm management.

The energy transformations of Les Oluges
The results obtained in Les Oluges in 1860 show an agroecosystem in which farmers were, as in any traditional organic agroecosystem, closely tied to their territory and constrained by its ecological features, to which they had developed biocultural adaptation strategies based on an integrated and (to some extent) extensive use of land (Pujol, 2001).
Since aridity was the most important limitation and irrigation was not available for most of the land -or when available, it was only occasional-, agriculture needed to adapt to water scarcity. The widespread use of biennial fallow was the main response to this limitation. This dry-farming management allowed the soil to recover nutrients and to increase the amount of water stored in it (Garrabou, Naredo & Ávila Cano, 1999). Aridity also prevented land-use intensification by the introduction of legumes or fodder crops in formerly fallow land (Garrabou, 1978). This reduced the possibilities of feeding more livestock that could provide enough manure to fertilise more intensive crop rotations.
Livestock density was similar or even a bit larger than in coastal Catalonia (Marco et al., 2018), but far from the 25 LU500/km 2 of Austria or some parts of the United States in the nineteenth century (Cunfer & Krausmann, 2009. Its composition was also an adaptation to the local ecological conditions. The difficulty in sustaining a sufficient livestock density made it necessary to draw upon woodland not only for providing enough feed, but also for supplementing the scarcity of manure by the traditional technique of formiguers -e.g. burning forest biomass in a set of small kilns, and ploughing the charcoal into cultivated soils (Olarieta, Padró, Masip, Rodríguez-Ochoa & Tello, 2011). The energy flows of 1860 show that forestland was an essential resource for the functioning and maintenance of the agroecosystem, providing soil nutrients, animal feed, wood, firewood and other by-products for domestic use (Iriarte Goñi, 2003). Livestock played a key role in integrating this agro-ecological mixed farming (Krausmann, 2004).
The intercropping system developed in Les Oluges was also a traditional adaptation to aridity. This association of perennial and annual crops was not only a diversification response to the risk of frequent harvest failures from the perspective of economic rationality, nor merely a way to take advantage of market conditions. This intercrop can be regarded as a wise management of the natural resource endowment that sought to attain greater agroecosystem stability by taking advantage of the agroecological synergies set among different land covers and plant root systems to improve yield stability, resistance to pests, and resilience to cope with adverse climate events. The greater complexity and heterogeneity of cropland also benefited farm-associated biodiversity (Alam et al., 2014;Altieri & Nicholls, 2002Palma et al., 2007;Rigueiro-Rodríuez, McAdam & Mosquera-Losada, 2009). The relatively high population density of Les Oluges in 1860 (42 inhabitants/ km 2 ) is the midpoint between traditional intensive organic agricultures with a strong vineyard specialisation (60 inhabitants/km 2 or above) and the densities found in extensive cereal-growing regions of inner Spain (25 inhabitants/km 2 or below) at that time (Badia-Miró & Tello, 2014;Garrabou, Tello & Cussó, 2008).
The introduction of fertilisers, machinery, and new crops and seeds changed the agroecosystem of Les Oluges in 1959. They allowed for a partial substitution of BR by replacing the traditional labour-intensive techniques of fertilisation (the formiguers) and supplementing manure and fallow. In addition, tractors started to replace animal draught power. Thus, the agroecosystem was able to increase its cultivated area, to raise cropland yields and to provide more energy resources for human consumption (FP). But mechanisation also involved the removal of many dry-stone walls (Olarieta & Padró, 2016) as the old terraces were too narrow for the new machinery. The investment in these operations and the costs to the agroecosystem in terms of increased soil erosion and organic matter and nutrient losses still needs to be assessed.
The slight decrease of livestock density did not tame the increase in yields because the lower need for pasture was coupled with increased housing of animals and manure availability, and the agroecosystem started a process of increasing emancipation from the land (Mayumi, 1991) through a greater dependence on EI. Neither the lower population density was an impediment for the enlargement of cropland. Mechanisation increased productivity of labour and the maintenance of the intercropping system prevented the increase of seasonality, a clever Chayanovian improvement (Chayanov, 1966 Oluges acquired the main features of a modern industrial agroecosystem: monoculture, mechanisation, dependence on external inputs and low labour requirements. In addition, livestock density soared, becoming a key element in the unsustainability of the agroecosystem (Soto et al., 2016). Traditionally farm animals had played an important role in agroecosystems as providers of multiple services and products (Krausmann, 2004).
Paradoxically, while their weight in the agroecosystem's structure has vastly increased at present, triggered by the human dietary transition towards unhealthy levels of meat consumption (Smil, 2002;Soto et al., 2016;Tilman & Clark, 2014), their former integrating agroecological role has been lost. Furthermore, despite providing only 17% of the FP in 1999, most of the energy introduced and reinvested in the agroecosystem was aimed to feeding livestock, becoming a key determinant of the overall energy efficiency of the farm system.
Crop diversification was replaced by a cereal monoculture; the application of synthetic fertilisers boosted despite the greater availability of manure; livestock feeding in feedlots was decoupled from cropland; and the consumption of agrochemicals soared in order to tackle with the growing imbalances of this simplified agroecosystem that lost a great deal of the self-regulation capacity provided by its farm-associated biodiversity.
Through these changes, the agroecosystem of Les Oluges became a net consumer of energy from the society with an EFEROI below one, while in 1860 and 1959 it had been a net producer of energy for the society.
Finally, the decrease of Unharvested Phytomass can be linked to a reduction of the agroecosystem's capacity to host biodiversity either belowground, in the soil food chains, or aboveground in the land cover diversity and species richness (Marull et al., 2017). A nature-based agroecosystem has been replaced by an industrial farming system relying on fossil fuel depletion.

Les Oluges in a comparative view
Previous studies carried out with this same methodology Guzmán & González de Molina, 2015;Guzmán et al., 2017;Marco et al., 2018) allow us to compare the results obtained in Les Oluges, and better understand some of the determinants of the sustainability of agroecosystems. Here we will mainly focus on the contrast between Les Oluges and another Catalan case study: four townships in the Vallés county with an approximate total area of 120 km 2 (Sentmenat, Caldes de Montbui, Castellar del Vallès and Polinyà) ( Figure 2). Vallès has been widely studied from a historical sociometabolic perspective (Badia-Miró, Tello, Valls & Garrabou, 2010;Cussó, Garrabou & Tello, 2006;Galán et al., 2016Marco et al., 2018Padró, Marco, Cattaneo, Caravaca, & Tello, 2017).
It belongs to the wetter and wealthier part of Catalonia, and provides a particularly relevant contrast to compare with our semiarid case study.
Under organic farming conditions in mid-nineteenth century, Vallès was favoured by its climate conditions and proximity to Barcelona. Higher rainfall allowed for a more intensive land use, substituting fallow with crop rotations including leguminous crops (Garrabou & Planas, 1998). These provided soil fertilisation, feed for livestock, and more resources available for human use. Additionally, its proximity to Barcelona and its port In 1999 the energy efficiency of both agroecosystems dropped. The lower energy efficiency of Vallès (with a FEROI of 0.22) was mainly due to its greater specialisation in livestock (with a livestock density of 241LU500/km 2 , mostly swines). The expansion of forests on abandoned agricultural land in Vallès did not compensate for the homogenisation of land covers, polarised into urban (22% of total area), woodland (57%) and grain-growing monocultures (18%) (Marull, Pino, & Tello, 2008;Olarieta, Rodríguez-Valle, & Tello, 2008). The unbalanced livestock density in relation to cropland area led to a problem of an excess of manure produced.
Land uses also reflect the different socioeconomic structure of Vallès and Les Oluges. In Vallès population grew over the 20 th century, and even though agriculturally active-population decreased, other economic sectors, such as industry and services, developed in the area. Conversely, Les Oluges remained based on agriculture and its population constantly decreased during the last century.
Despite the more adverse natural resource endowment and after a rather similar historical evolution in energy terms, Les Oluges reached a relatively greater energy efficiency than Vallès in 1999 mainly due to a lower livestock density.
These results are in line with the ones obtained at the state scale (Guzmán et al., 2017;Soto et al., 2016). Spanish agriculture has experienced large increases in livestock numbers, woodland area, and cropland productivity. However, the higher amount of BR and EI needed to feed livestock are among the main causes of the loss of farming energy efficiency throughout the twentieth century. Despite the abandonment of woodland and pastureland, UhP declined because of the higher proportion of biomass appropriated for human consumption (AFEROI), rendering a declining Biodiversity EROI.

More than energy transformations
The transformation of the agroecosystem of Les Oluges, and its comparative view with other case studies, bring to light three main ideas. Firstly, the importance of livestock density for the energy performance of agroecosystems stands out. The low energy efficiency of animals as bio-converters (Gliessman et al., 1998) imposes a considerable burden on any farm system, not only in energy terms but also regarding competition with land uses for human food (Guzmán & González de Molina, 2009). Past organic farm systems managed to override this burden by taking advantage of the use of animals as bio-converters of farm by-products or domestic residues that would otherwise be disposed of. Animals would also be fed from the less productive soils, such as grazing natural pastures in mountainous areas or shrub land, increasing the production obtained from these lands. This integration of livestock feeding into complex agroecosystems maintained a high land cover diversity able to host farm-associated biodiversity that enhanced the provision of regulatory and sustenance ecosystem services (Haberl, 2015;Marull, Font, Padró, Tello, & Panazzolo, 2016). Secondly, the intensive production of barley and deforestation in Les Oluges can be linked, at least from a theoretical perspective, to the very high levels of livestock density in Vallès, where feedlots rely on large feed imports and more than half of the land has been abandoned and spontaneously reforested. Contrary to the positive views of this transition, made possible in Vallès by the land sparing effect of intensive feed graingrowing in Les Oluges or similar areas, the crude fact is that biodiversity has been degraded in the former-a result that supports the alternative claims for a land sharing approach to nature conservation (Barthel, Crumley, & Svedin, 2013;Bennett, 2017;Fischer et al., 2008). It is not only wild habitats that are important for the maintenance of biodiversity, but also the degree of human appropriation of photosynthetic capacity and the spatial disturbance patterns that take place in agroecosystems, which in turn give rise to diversification, heterogeneity and complexity of landscapes (Marull et al., , 2018 Thirdly, we found that mixed organic- Use of relatively small amounts of synthetic fertilisers and machinery reduced the dependence on a limited amount of manure and animal draught force, overriding the LACAS (Guzmán & González de Molina, 2009;Guzmán et al., 2011). True, the introduction of inputs based on fossil fuels and non-renewable resources started an unsustainable path which would eventually lead to an extreme simplification of farmland and livestock processes as seen in 1999. However, in the mid-twentieth century the agroecosystem still retained important elements of its organic functioning. One of these was fallow. Even though this practice has long been deemed as a signal of backwardness in agrarian systems, it is still a convenient dry-farming practice in arid areas (Garrabou et al., 1999;Garrabou, Naredo, & Balboa, 1996). Additionally fallow land can be used as pasture or, when it is not used by livestock, it is made available for the associated biodiversity that provides important ecosystem services. Another important traditional feature of Les Oluges in 1959 was the maintenance and increased diversity of farming systems that intercropped vines, olives and almond trees with cereals. The reasons behind the maintenance and advance of this intercropping system need to be further studied (Vandermeer, 1989).
Fallowing and intercropping were two long-lasting traits of site-specific peasant knowledge in Les Oluges, and the whole Segarra County (Tello, 1986), that remained as sources of significant agro-ecological awareness until the dawn of the Green Revolution.
The local impact of the European-wide agricultural crisis at the end of the nineteenth century gave rise to a growing presence of farmer unions, cooperatives and local public institutions. These organisations played an important role in making available new fertilisers and machinery to smallholders, and conducting research and experimentation on improved cereal seeds and animal breeds adapted to the local environment (Ramon Muñoz, 1998Muñoz, , 1999. However, after the Spanish Civil War (1936)(1937)(1938)(1939)  agroecosystem. This clearly contrasts with a traditional peasant knowledge that has been developed through generations and adapted to local conditions, which is knowledgeinstead of input-intensive, and usually aimed at maintaining the productivity of the agroecosystem in the long run (Altieri, 2004;Patel, 2012;Pujol, 2001;Shiva, Rojas Rosales, & Guyer, 2007;Toledo & Barrera-Bassols, 2008). This cultural, technological, social and ecological transformation left its footprint on the landscape. The traditional intercropping system that depicted a landscape pattern in stripes disappeared together with at least part of its traditional biocultural heritage.

Conclusions
What, then, can be learned about the sustainability of future farm systems from this case study? The historical sociometabolic analysis of agroecosystems provides valuable insights into the elements that can enhance or degrade the sustainability of agroecosystems. Our case study of Les Oluges directs attention to three aspects. First, the increase of livestock density and the industrialised livestock management functionally disconnected with farming is an important driver for the loss of energy efficiency of modern agroecosystems. In order to build more efficient agroecosystems in energy terms, it is necessary to reduce livestock density and re-integrate its feeding sources with farming into more complex agroecosystems. Second, the harming consequences of substituting internal biomass reuse flows by external inputs, especially when these external inputs are based on non-renewable and pollutant sources like fossil fuels. The biomass recycled into the agroecosystems (both the reused and the unharvested biomass) is important for sustaining the productive capacity of their fund elements, and for the provision of ecosystem services that increase their resilience. This leads us to a third aspect: sustainable farm systems need to be locally adapted to their ecological conditions.
In this regard, it would be worthwhile studying the biocultural memory (Toledo & Barrera-Bassols, 2008)