Flows and budgets of nutrients and potentially toxic elements on four Swedish organic farms using digestate from agricultural residues

Few fertilizers are permitted for organic farming, which is a challenge when securing nutrient availability, particularly of nitrogen (N). Digestate from biogas production could be a valuable fertilizer for increasing crop yields, through its high content of plant-available nitrogen (NH4-N), but is rarely used in practice. This study evaluated how anaerobic digestion of manure and use of digestate affected inflows and outflows of nutrients and potentially toxic elements on four organic farms with different solutions for digestate production. Mass flows and element concentrations were documented 3 years on three dairy farms and one crop farm and used for calculating farm budgets. Nitrogen and phosphorus (P) budgets were also calculated for biogas reactor and storage pits on three farms. Nitrogen surplus exhibited large variation (18–87 kg N ha−1 year−1) at farm level, with purchased digestate or poultry manure giving major N inputs. The risk of process losses was high, with up to 40% of N and P in feedstock entering farm biogas reactors not recovered in digestate. The proportion of NH4-N in total N in digestate was slightly higher (2–9%) or lower (37%) than in feedstocks entering farm biogas reactors. Improved stirring in farm biogas reactors and storage pits to decrease N and P sedimentation, particularly when digesting poultry manure, would directly increase digestate value. Two farms purchasing digestate from central biogas plants received a digestate causing significant cadmium inputs. Keeping records on element flows can help to tailor the use of digestate for organic farms to achieve a sustainable use of nutrients.


3
Vol:. (1234567890) or nitrate N, in organic crop production are often below the optimum level for maximizing yield (Röös et al. 2018). Nutrient management in organic farming is basically reliant on nutrient recycling withinfarm, inputs of nitrogen (N) through biological N fixation, and some nutrient recycling from off-farm waste streams (IFOAM 2019). Many organic farmers are looking for alternative fertilizers containing more plant-available N in order to increase crop yield. This is of particular importance for spring-sown crops in northern Europe, since low spring temperatures slow down soil mineralization of N from commonly applied animal manures and green manures containing N with low plant availability (Dahlin et al. 2005). Due to lack of permitted fertilizers for use on organic farms, those farmers often experience difficulties in fertilizing with adequate amounts of N and other nutrients (Reimer et al. 2020). Adapting N application to crop needs is of particular interest, since N losses can cause environmental impacts such as eutrophication and acidification of water bodies and GHG emissions. Sustainable use of other essential nutrients, such as phosphorus (P), potassium (K), and sulfur (S), is also important, due to limited global reserves and the environmental impact of extraction and fertilizer manufacturing (Goulding et al. 2008). Hence, even on organic farms with a significant on-farm circulation of nutrients, such as dairy production, input of nutrients may be required to ensure farm productivity and sustainable management of nutrients.
Integrating agricultural systems with biogas production and using the digestate as fertilizer could be one way to increase recycling of nutrients from fork to farm, obtain a valuable fertilizer, and produce bioenergy (Koppelmäki et al. 2019). Compared with untreated cattle manure, digested cattle manure can have a higher content of NH 4 -N, which is directly plant-available N (Webb et al. 2013). However, digestate also has high pH, which increases the risk of ammonia (NH 3 -N) emissions at handling, storage, and spreading which also cause nitrous oxide emissions (Amon et al. 2006). Use of digestate could be an option on animal husbandry farms in need of plantavailable N by anaerobic digestion of the manure or co-digesting manure with off-farm substrates to increase the N input. On farms with low access to animal manure, input of digestate made of other substrates than manure may be an option, and such digestate may also be applied on animal husbandry farms. When using digestate as fertilizers, their potentially toxic element (PTE) concentrations must be considered, to avoid crop nutrient deficiency or fertilization with agronomically excessive amounts. Copper (Cu) and zinc (Zn) are of specific interest, as inputs via different types of fertilizers can result in deficient or toxic levels in soils (Giller et al. 1998;Goulding et al. 2008). Another PTE of interest is cadmium (Cd), which is toxic to humans and other living organisms in low concentrations, including soil biota in arable soils (Giller et al. 1998;WHO 2019). The threshold for Cd inputs to organic farmland posed by the Swedish certification body KRAV is 0.45 g ha −1 year −1 in applied purchased fertilizers or soil amendments (KRAV 2021).
A number of on-farm biogas plants have been built in Sweden in the past decade, under a rural development scheme that provides a capital investment subsidy of 40% for farm enterprises where animal manure makes up at least 50% of the feedstock to the biogas reactor (SJVFS 2019:56). There were 48 farm-based biogas plants in Sweden in 2020, some on organic farms, and an additional 23 central co-digestion biogas plants using a mix of feedstocks, including animal manure (Swedish Energy Agency 2020). The farm's own manure commonly constitutes the major feedstock in biogas production on organic livestock farms. However, it is also possible to use as feedstock some substrates that otherwise may not be spread directly on organic arable land according to the current organic farming standards for organic agriculture (KRAV 2021). In such cases, the corresponding amount of dry matter in the substrate (e.g., broiler manure) "imported" to the farm must be "exported" as digestate from the farm. According to this certification scheme, it is also possible to permit a mixture of manure from organic and conventional farming in central co-digestion plants, as a means to promote production of biogas and replace nonrenewable energy sources (KRAV 2021). The use of digestate on organic farmland is small but increasing, and there is a lack of knowledge about how anaerobic digestion of farm manure in biogas production systems affects nutrient cycling on farms (Nowak et al. 2015;SCB 2020). A study by Koppelmäki et al. (2019) highlighted the need for evaluation of on-farm biogas production, as nutrient cycling can be expected to be influenced by type of farm and type of feedstock used. The agronomic value of digestate is also highly dependent on the handling and management practices applied (Nkoa 2014).
A valid tool for investigating the nutrient depletion or surplus in a farming system is to draw up a nutrient budget that includes all nutrient inflows and outflows to a defined system (Bengtsson 2005;Öborn et al. 2005;Reimer et al. 2020). Budgets can also be calculated for PTEs. Farm-gate nutrient budgets consider inputs and outputs at the wholefarm level, typically as flows of purchased and sold products. Tools for calculating nutrient budgets are now widely used by advisors and farmers for planning and monitoring on-farm management of N, P, and K, and also for assessing fulfillment of environmental goals concerning N and P. Nutrient inputs and outputs within a part of the farm can also be calculated, e.g., to identify potential nutrient accumulation or depletion that is not visible in the wholefarm budget, such as potential N losses or nutrient sedimentation during manure handling. To decrease uncertainties when investigating nutrient depletion or surplus, farm-specific concentrations in recently sampled and analyzed manure should be applied instead of standard values recorded in manure some decades ago, as the animal manure handling system in practice changes over time due to developments in animal production (Steineck et al. 1999;Reimer et al. 2020). When taking this into account, the nutrient budget can be used to identify how new fertilizers and new systems for managing different anaerobic digestion feedstocks on organic farms may affect nutrient demand or surplus.
The aim of this study was to evaluate the effects of various systems for anaerobic digestion along a gradient from self-sufficient dairy cow production to arable crop production with no animal production on the farm, and the related use of digestate on existing organic farms, with respect to surpluses or depletions of N and other nutrients and PTEs. The current state of nutrient management on four farms over 3 years was studied by: 3. Assessing opportunities and challenges concerning anaerobic digestion, storage, and handling of digestate on organic farms.
From these activities, we will conclude by providing advice for further development of anaerobic digestion as a fertilizer for organic agriculture in Sweden.

Farms in the survey
Four organic farms situated in regions of Sweden with different conditions for agricultural production and using digestate with different strategies for integrating farming and biogas systems were included in the study during the same 3-year period, 2015, 2016, and 2017. The farms also had different production intensities as regards input of feedstocks. One of the dairy farms was categorized as low input, defined as purchasing small amounts of feed and manure, while the other three farms were categorized as more intensive, since they had higher inputs of feed, substrates, manure, or digestate. Farm characteristics are presented in Table 1. One dairy farm (LOD = LOw-input Dairy farm with biogas plant) has high feed self-sufficiency and a biogas plant fed mainly with manure produced on-farm (Fig. 1). This farm is situated in central Sweden, in a region dominated by forest and characterized by low population density and limited access to local substrates for digestion. A second dairy farm (ID = Intensive Dairy farm with biogas plant) is more intensive and has a biogas plant relying on considerable amounts of purchased substrates (mainly conventional broiler manure) to increase biogas production and improve the nutritional value of the digestate. This farm is situated in southern Sweden, where livestock production is common, providing access to different substrates complementing on-farm manure. A third dairy farm (IDC = Intensive Dairy farm with Central biogas plant) cooperates with a central biogas plant which digests manure from several farms including IDC and applies additional substrates from the food and feed industry . This farm is situated in southern Sweden, in a forest region where milk production is common. The fourth, a crop farm (ICC = Intensive Crop farm with Central biogas plant), purchased manure from laying hens and horses for digestion in 2015. The farm-based biogas plant was closed end of 2015, due to low profitability, so in 2016 and 2017, the farm purchased digestate from a central biogas plant, mainly digesting crops from surrounding farms. In 2017, the farm mainly purchased manure from laying hens for direct fertilization of the crop area, while a minor part of the fertilizer used was purchased digestate. The farm and biogas system were defined here as intensive, due to high input of purchased digestate, manure, and substrates from the local food industry. This farm is situated in the southern plains area of Sweden, where crop production dominates.
All the four farms store the digestate in pits without a cover and with no natural crust on the surface of the digestate. The intensive dairy and crop farm purchasing digestate from a central biogas plant had a digestate input to farm pits regularly over the year.

Data sources
Data for calculating nutrient and trace element flows and budgets were compiled by visiting each farm in each of the three study years for a personal interview with the farmer and receive farm documentation from the previous year and by requesting additional information via phone and email. The types and   Supplementary  Table S1). Volumes of stored and spread manure and digestate were based on yearly farm documentation.
Calculations of flows of nutrients and PTEs in animal manure, digestate, and harvested crops were based on analyzed samples for each farm and year. On each farm, bulk samples (0.5 L) of animal manures and digestate were taken from the spreader tank just before spreading on arable land in spring, summer, and autumn each year, using a procedure described in Steineck et al. (1999). Samples (0.5 L) of mixed fresh digestate were taken in the pump well from the onfarm biogas reactor and the two central biogas reactors delivering digestate to the intensive dairy farm (IDC) and the intensive crop farm (ICC) in the second and third year for analyzing nutrient concentrations before digestate storage. Bulk samples (0.5 L) were also taken of some individual substrates from the food industry that were occasionally purchased for the onfarm biogas reactors (Supplementary Table S2). Total N and NH 4 -N in solid and liquid matter was determined by an automated Kjeldahl procedure (Tecator AB. Höganäs Sweden). Calcium, Cd, Cu, K, Mg, P, S, and Zn were analyzed according to SS 02 81 50-2. Bulk samples (1-2 L) of harvested grain, oilseed, pulses, clover/grass ley, and potatoes were taken after harvest each year from well-filled silos on each farm and sent for analysis according to instructions given by Eurofins (2019) (Supplementary Table S3). The number of samples depended on how frequently the actual crop was grown. The bulk samples were kept frozen until chemical analysis. Raw protein content in silage was analyzed according to the Nordic Feed Evaluation system, where total N was calculated from total raw protein content (Åkerlind et al. 2011). Total N in cereals, oilseed, pulps, straw, and wood chips was determined by an automated Kjeldahl procedure (Tecator AB. Höganäs Sweden). Ca, Cd, Cu, K, Mg, P, S, and Zn were analyzed according to the following standards: ISO 11885 m:2009 for silage, EC No. 152/2009 for cereals, oilseed, pulps, straw, and wood chips, and NMKL (1998) for potatoes. n the calculations, information from the supplier on concentrations of elements in purchased feed concentrates, minerals, and labeled organic fertilizer products was used, as such information is generally declared. Data on estimated Cd concentrations in purchased feed and mineral products and in cattle were taken from Olsson (2002) and in milk from Jorhem et al. (1984). Data on other elements in milk were taken from Gustafson et al. (2007) and in cattle from McDonald et al. (1995), as nutrient and trace element composition in milk and cattle is stable. The model VERA (Swedish Board of Agriculture 2018) was used to document farm-gate flows, which in this study were adjusted based on analyzed samples from each farm. VERA was further used to estimate the amount of symbiotic N fixation by legume crops grown on the farms. VERA uses the empirical model developed by Høgh-Jensen et al. (2004), which in this study was based on farmers' estimates of proportion of clover in clover/grass leys and farmers' documentation of yield per hectare. VERA also provides data on N deposition, based on national monitoring and farm location (Olstrup et al. 2018).

Statistical analysis of nutrients and potential toxic elements in farm flows
Mixed statistical models were used to calculate least square mean values of element concentrations in order to establish current levels in main flows of manures, digestate, substrates, and harvested crops for each farm over the three experimental years (Littell et al. 2006). The least square mean values for each farm flow were used in budget calculations. The models were essentially split-plot models that included year and the year × farm interaction, as random effects. The fixed effects were farm, materials (harvested crops, manures, substrates for digestion, and digestate), and the interaction between these. When there were significant differences within a fixed effect or between two fixed effects, pairwise comparisons were made between them. The assumptions were checked using diagnostic plots. The mixed procedure in the SAS Institute Inc (2014)package was used for the analyses.

Calculations of budgets and flows
Flows were calculated at farm-gate level for N, P, K, S, calcium (Ca), Cd, Cu, magnesium (Mg), and Zn. The farm-gate budgets were calculated as the difference between nutrient inputs to, and outputs from the farm via purchased and sold animal and crop products, manure, digestate, and with symbiotic N fixation and atmospheric N deposition also included as farm inputs (Eq. 1). Calculations for Cd in the farm-gate budgets included atmospheric deposition of Cd in Sweden. Due to lack of site-specific data concerning Cd deposition in the regions of Sweden where the farms are situated, the national average, which is estimated to be approximately 100 mg per hectare and year (Olstrup et al. 2018), was used. The amounts of N, P, and K lost as sedimentation and/or ammonia (NH 3 -N) emissions in farm biogas reactors and storage pits were calculated as the difference between flows into the farm biogas reactor and out from farm digestate storage, including purchased manures and substrates, and own farm manure (Eq. 2). The results were expressed as surplus/depletion per hectare of arable land.

Farm-gate budgets for nutrients and potential toxic elements
Results of budget calculations for N, P, K, and Cd are presented in Figs. 2-3, and for Mg, S, Ca, Cu, and Zn in Supplementary Figs. S1-S3. Mass flow data and corresponding least square mean element concentrations were applied in each farm budget calculation for animal manure, substrates, digestate, and harvested crops (Table 2 and Supplementary Tables S1-S3).
The farm-gate N budgets showed a surplus on the four different farms in all 3 years, but the magnitude of the surplus differed between farms (Fig. 2a) Reactor and storage budget for N, P, K = Manure + Substrate − Digestate after storage N to the farm through purchased digestate or manure from laying hens and broilers for digestion, resulting in higher N surplus compared with the low-input dairy farm (LOD). The sales of manure from farm IDC were compensated by large inputs of digestate. The inputs of manure and/or digestate comprised 35-40% of N inputs to each farm. The estimated N input with symbiotic N fixation was considerable on all four farms, but with a wide range (9-98 kg N ha −1 ) (Fig. 2a). On the low-input dairy farm, symbiotic N fixation corresponded to about 50% of total N input. The content of plant-available N in stored digestate varied between farms and was also influenced by type of digested manures and substrate (Table 2 and Supplementary  Table S2). The intensive crop farm had a smaller surplus in its N budget (range 15-38 kg N ha −1 year −1 ) than the intensive dairy farms, while its digestate contained most plant-available N (3.7 kg NH 4 -N per ton digestate). Presenting plant-available N contents per ton is the practice a farmer needs for planning nutrient application. The intensive dairy farms had the largest surplus in N budgets (range 63-118 kg N ha −1 for IDC and 68-86 kg N ha −1 for ID), while the digestate contained 2.8 and 1.9 kg NH 4 -N per ton for IDC and ID. However, the IDC farm purchased a digestate with significantly higher NH 4 -N concentration per kg dry matter, compared to digestate at the other farms (Table 2). Due to low dry matter content in this digestate, the farmer in practice would need to apply larger volumes to fertilize with same N amount per hectare as with digestate at the ICC farm. The N budget on the low-input dairy farm had the smallest surplus (range 8-32 kg N ha −1 ) and the digestate contained 1.5 kg NH 4 -N per ton. For P, the farm-gate budget showed a very even surplus for ID (6 kg P ha −1 each year) and a more variable surplus for ICC (range 2-7 kg P ha −1 ) (Fig. 2b). The farm-gate P budgets were stable and slightly negative for LOD (− 1 kg P ha −1 each year), whereas the P budget was clearly negative and more variable for IDC (range − 1 to − 3 kg P ha −1 ). Although the P amounts in digestate into farm (about 8 kg P ha −1 ) were larger than P amounts in manure delivered to the central biogas plant (about 7 kg P ha −1 ), it was not enough to compensate for total P flows out from farm. The P concentration in digestate was higher than in liquid cattle manure for IDC and purchasing extra digestate could be a way to increase P input to farm ( Table 2).
The farm-gate K budget on the LOD farm was very near a balance, and on average slightly positive (Fig. 2c). The ID farm had a much higher surplus (range 0-22 kg K ha −1 ), but again quite variable over years. The IDC farm had a negative K budget in two of 3 years, although the average K input with purchased digestate across all years was larger (54 kg ha −1 year −1 ) than the K output with sold manure (46 kg ha −1 year −1 ). The ICC farm showed the largest variation between years (range 49 to − 6 kg K ha −1 ), reflecting how much the K budget may vary over time depending on how accurately purchased inputs match sold crop products.
Imports of substrates, digestate, and manure to the farms also affected other nutrients and PTEs. The farm-gate budgets for Mg (range − 1 to 7 kg ha −1 ) and S (range 0 to 8 kg ha −1 ) showed an average surplus, where purchased poultry manure contributed a considerable input (Supplementary Fig. S1). The farmgate budgets for Mg and S were near balance for the LOD and IDC farms while the ID farm had a high surplus and the ICC farm budgets varied between years. The farm-gate Ca budgets were on average slightly negative (range 0 to − 5 kg ha −1 ) on the three dairy farms, due to considerable exports in sold animal products (Supplementary Fig. S2).
The farm-gate budgets for Cu and Zn showed a surplus on all four farms in all years ( Supplementary  Fig. S3), but the range varied significantly between the farms. The LOD farm had a very low surplus of both Cu and Zn, on average 13 and 57 g ha −1 year −1 , whereas the ICC farm again had quite variable  Animal products include feed, milk, animals, and bedding. Crop products include crops and seed budgets ranging from − 3 to 27 g ha −1 year −1 for Cu and ranging from 69 to 235 g ha −1 year −1 for Zn. The two intensive dairy farms had significant surpluses of both elements ranging from 138 to 209 g ha −1 year −1 for Cu and from 196 to 537 g ha −1 year −1 for Zn. Major inputs of Cu and Zn were from purchased substrates (poultry manure) or digestate, which also had high concentrations of Cu and Zn (Table 2). The consequence for the IDC farm was much more Cu and Zn input with digestate than output with manure. In year two, the ICC farm had a slightly negative Cu budget due to less input with purchased manure and digestate than output with sold crop products ( Supplementary Fig. S3).
For Cd, the calculated farm-gate budgets showed a surplus for all farms (Fig. 3). For the dairy farms, the range was 95-275 mg Cd ha −1 , and the magnitude of the surplus differed between farms. The LOD farm had the lowest average surplus per hectare, where the major input was Cd deposition (Fig. 3). The intensive dairy farms ID and IDC received their main inputs of Cd with purchased poultry manure or digestate, corresponding to 135 mg Cd ha −1 year −1 and 278 mg Cd ha −1 year −1 . The intensive crop farm had a Cd surplus with the range of 62-149 mg Cd ha −1 . In this case, the Cd output with sold crops was on the same level (217 mg Cd ha −1 year −1 ) as the input with purchased manure, substrate, or digestate (214 mg Cd ha −1 year −1 ), showing that Cd deposition contributed to the surplus on the ICC farm. The LOD farm had on average significantly lower Cd concentrations in stored digestate (0.069 mg Cd kg −1 dry matter) compared with the IDC farm and the ICC farm (0.334 and 0.354 mg Cd kg −1 dry matter) ( Table 2).  Biogas reactor and digestate storage budgets for assessment of ammonia emissions and nutrient sedimentation The N, P, and K budgets for the combined farm biogas reactor and storage tank of digestate were calculated for the farms with on-farm biogas reactors running in all 3 years (the LOD and ID) and for 1 year for the ICC farm. Average values are shown in the unit kg nutrients per ha and year to facilitate comparisons between farms having biogas reactor and storage tanks of different size and volumes. The total N budgets on the LOD and ICC farms were near balance due to almost equal amounts entering the biogas reactor and leaving the storage pits, indicating small sedimentation of total N ( Table 3). The amounts of NH 4 -N in digestate leaving the storage tanks were larger than the amounts in manures and substrates entering the biogas reactor. The digestate at the LOD and ICC farms had 5% and 9% higher proportions of NH 4 -N compared with manures and substrates entering the biogas reactor. Also, NH 4 -N concentrations in digestate after storage were higher than in digested manures and substrates for these two farms (Table 2). Thus, these two farms seemed to have low NH 3 emission during digestion in the biogas reactor and storage of digestate. On the ID farm, with imported poultry manure, the total N amount in digestate after storage was about 40% lower than in manures and substrates entering the biogas reactor (Table 3). The proportion of NH 4 -N in total N in the manures and substrates was about 60%, decreasing to 52% in digestate after storage. The fresh digestate in the biogas reactor had higher NH 4 -N concentration (39.7 g kg −1 dry matter) than the digestate available for spreading after storage (32.6 g kg −1 dry matter) ( Table 2). This indicated considerable sedimentation of total N in the bottom of biogas reactor and storage pits, and/or potential NH 3 emissions.
On the LOD farm, the amount of P in digestate at spreading was 91% of the amount in manure entering the biogas reactor, indicating that most of the P originally found in cattle manure was recovered in digestate (Table 3). However, for a self-sufficient farm, sedimentation of almost 10% of the P may need awareness to avoid future difficulties to meet crop needs of P. On the ID farm and the ICC farm, the average P amount found in digestate at spreading corresponded to 64% and 54% of the amount in manures and substrates entering the biogas reactor, demonstrating substantial sedimentation of P in the biogas reactor and storage pit. The amount of P detected in digestate at spreading not only is influenced by type of substrate and manure but also represents what is captured in the sample of digestate taken after mixing in farm storage pits. On the ID and ICC farms, the P concentration in digestate after storage was lower compared with P concentration in cattle and poultry manures for digestion, which also indicated P sedimentation ( Table 2). The amount of K found in sampled digestate at spreading was almost 100% of the amount in manures and substrates entering the biogas reactor (Table 3), which shows that the farmers' volume documentations are reasonable. Since K has high water solubility, it is fairly equally distributed in digestate. The recovery of almost the full amount of K indicated good accuracy in documentation and sampling of mass flows on farm through the biogas reactor and the storage pits.

Discussion
Farm-gate budgets are commonly used in agricultural extension work in Sweden to identify risks of accumulation, depletion, and losses of N, P, and K (Swedish Board of Agriculture 2018). One of the aims is to identify measures for more sustainable nutrient management on-farm. Organic dairy farms typically have lower N and P surpluses than conventional dairy farms, but there is large variation between farms (Wivstad et al. 2009; Einarsson Table 3 Average flows of total nitrogen (total N) ammonia N (NH4-N), phosphorus (P), and potassium (K) into the on-farm biogas reactor and out from digestate storage on the low-input and intensive dairy farms (LOD and ID) over 3 years and on the intensive crop farm (ICC) for the first year of the study

Farms
Total N NH 4 -N P K kg ha −1 year −1 LOD  In  35  15  6  40  Out  35  20  5  40  ID  In  185  90  27  120  Out  105  55  17  119  ICC  In  40  15  12  21  Out  35  20  7  20 et al. 2018). In a study from Europe, dairy farms were found to have on average higher N surpluses (77 kg N ha −1 year −1 ) than farms with crop production (19 kg N ha −1 year −1 ), illustrating some principal differences between farm types (Reimer et al. 2020). The average N surplus on Swedish organic dairy farms is reported to be on the same level as on European farms (72 kg N ha −1 year −1 ) (Einarsson et al. 2018). The three dairy farms in this study showed large variations, both across the three study years and between farms. The LOD farm had the lowest average N surplus (18 kg N ha −1 year −1 ), while the IDC farm exchanging manure for digestate with a co-digesting central biogas plant had the highest average N surplus (87 kg ha −1 year −1 ). The N surplus on the ID farm with its own biogas reactor was of the same magnitude as the Swedish average. However, it was striking that the input of N through biological N fixation on two of the farms studied was considerably lower than the Swedish average for organic dairy farms (54 kg ha −1 year −1 ) (Einarsson et al. 2018). On average, N fixation contributed 19, 32, and 70 kg per hectare and year for the LOD and ID farms with on-farm biogas plant and the IDC farm co-operating with a central co-digestion plant, respectively. However, estimation of N fixation is associated with large uncertainty, as fixation rates are known to vary widely between years, with ley age, and between and within fields (Carlsson and Huss-Danell 2003). That makes it difficult to draw conclusions from the few farms and years in this study. There is also a general suggestion that increasing soil mineral N by fertilizing with animal manure or green manure in organic farming can have an inhibitory effect on biological N fixation (Hatch et al. 2007). The extent to which biological N fixation by growing legumes is affected by increased N application with digestate on organic farms would be an interesting topic to explore in future studies. Most organic dairy farms in Sweden do not use external manure originating from other farms. On average, only 3 kg N per ha and year are imported to Swedish organic dairy farms, according to a compilation by Einarsson et al. (2018). In the present study, the ID farm with on-farm biogas reactor received considerably more N from external manure (42 kg N ha −1 year −1 ), originating from conventional broiler manure. Boosting the N content of the digestate on organic farms is possible, since co-digestion of manure from organic and conventional farms is promoted in Sweden as a means to improve flexibility and profitability in biogas production systems (KRAV 2021).
In this study, the LOD farm and the IDC farm co-operating with an intensive co-digesting plant both ended up with slightly negative farm P budgets, although the magnitude of P flows into the farms differed (Fig. 2b). The IDC farm was not able to compensate for total P output with digestate P input, although this was the major P inflow. On-farm P deficiency is a concern, since long-term soil P delivery capacity risks being affected (Niggli et al. 2016). Similar concerns arise regarding K on the LOD and ID farms with on-farm biogas plant (Fig. 2c). However, as regards P, most Swedish agricultural soils have considerable amounts of readily soluble P stored in the soil (Eriksson et al. 2010), implying that minor depletions can be acceptable in a short-term perspective. Under regulations set by KRAV, applying surplus P is normally not allowed when sufficient amounts of readily soluble P are present in the soil (KRAV 2021). In practice, surpluses might thus be more problematic than minor depletions. Soil delivery of K, on the other hand, is strongly related to the clay content (Eriksson et al. 2010). The IDC farm cooperating with a central biogas plant chose to keep one-third of its cattle slurry, as a strategy to decrease the net output of K. Keeping track of the nutrient flows in co-digestion plants based on manure from different farm types is thus important to avoid unintentional accumulation or demands.
The farms in this study were seeking to increase the plant-availability of N in manure and substrates through anaerobic digestion. However, the proportion of NH 4 -N in total N in farm digestate at spreading was on average only 2-9% higher than in manure and substrates entering the farm biogas reactor on the LOD farm and ICC farm, and 37% lower on the ID farm. The actual N fertilizer value was thus lower than expected by the farmers. This was most likely due to the impact of several interacting factors, such as feedstock characteristics, the technique used for stirring, and on-farm methods used for storage, handling, and spreading digestate (Nkoa, 2013). Farmers must therefore take measures to prevent sedimentation and enable efficient use of the nutrients in digestate, including using a functional stirring technique in the biogas reactor and in the storage pit before emptying. It is also important to prevent gaseous NH 3 emissions in order to reduce N losses and maintain the potentially higher N fertilizer value achieved after digestion, using measures such as efficient covering of digestate during storage (Amon et al. 2006).
By tracking the flows into the on-farm biogas reactor and the flows out from digestate storage on farms using purchased substrates and manures for digestion, this study uncovered a considerable risk of NH 3 -N emissions and sedimentation of nutrients. On the ID farm and the ICC farm, about 40% of P in manures and substrates entering the farm biogas reactor were not found in digestate at spreading, but ended up as sediments in the biogas reactor and in storage pits. Earlier studies have found that about 20-25% of the storage volume can be occupied by sediment with 85% dry matter content containing most of the P and N in solid fractions (Sommer and Hansen 2005;Deng et al. 2014). Manures have a natural separation efficiency which varies depending on type of animal, diet, bedding material, and treatment such as anaerobic digestion (Møller et al. 2002). In this study, poultry manure formed a considerable part of digested substrates in the on-farm biogas plants on the ID farm and the ICC farm. Poultry manure is attractive on such farms due to its high biogas potential and high N content (Nasir et al. 2012). However, poultry manure and pig manure also have higher separation efficiency than cattle manure (Deng et al. 2014). Farms digesting poultry manure should therefore expect more sedimentation in their biogas reactor and storage pit than dairy farms digesting only cattle manure. It has been shown that it is difficult to bring larger particles into suspension in storage pits with the mixers used in practice (Møller et al. 2002). Inappropriate equipment for mixing digestate within the biogas reactor and in the storage pit was one likely cause of the lower than expected N and P content in digestate after storage seen in this study.
Mass flow calculations can give information on how inputs and outputs affect PTE accumulation or depletion (Bengtsson 2005). The organic certification scheme commonly applied in Sweden limits the maximum application of Cu and Zn with purchased fertilizers in organic crop production to 300 g Cu and 600 g Zn ha −1 year −1 (KRAV 2021). In this study, all four farms had a net input of Cu and Zn below the permitted threshold. The ID farm with on-farm biogas reactor had the highest Cu and Zn inputs (210 g Cu and 466 g Zn ha −1 year −1 , respectively).
The source of this Cu and Zn was purchased conventional broiler manure, which can have a high content of Cu and Zn compared with cattle slurry (Salomon and Rodhe 2006). The Cu and Zn inputs with digestate on the IDC farm co-operating with a central biogas reactor were likely an effect of co-digesting with conventional pig manure in the central biogas reactor Nkoa 2014).
Under KRAV standards, application of Cd to arable land via purchased fertilizer and soil amendments must not exceed 0.45 g ha −1 year −1 over 5 years (KRAV, 2021). In this study, the IDC farm receiving digestate from a central biogas plant had the highest input of Cd in all 3 years, due to Cd in purchased digestate. The Cd input was close to the permitted threshold (Fig. 3).
Previous studies have suggested that biogas production can enable recycling of nutrients from local society and redistribute them between farms, thereby improving the reuse of nutrients (Koppelmäki et al. 2019). In the present study, the IDC farm cooperating with a central co-digesting biogas plant gained about 20 kg N per hectare by replacing manure with digestate, while the amounts of P and K stayed the same. Nine other organic dairy farms in Sweden co-operating with a central biogas reactor have also been reported to receive more N, but less P and K, with digestate than they export with farm cattle manure (Johansson 2018). Thus, a central biogas plant co-digesting manures from different farm animals together with substrates from the food industry will result in redistribution of nutrients between different livestock farms and nutrient export to crop farms purchasing digestate. To adjust for imbalances between farms over time, co-digestion plants involving different farms need to keep a record of nutrient distribution to their collaborating farms. Such records can be an important tool on-farm for adjusting unwanted accumulation/depletions and for assessing the long-term sustainability of local nutrient cycles in agriculture.
The ICC farm in this study purchased various local manures, food residues, and digestate, which contributed inputs of P and other nutrients, resulting in a farm P surplus of between 3 and 7 kg P per hectare. This is similar to the average farm surplus of 6 kg P per hectare and year reported for 76 organic crop farms in Sweden (Wivstad et al. 2009). The ICC farm was able to pursue this nutrient management strategy due to its location in a region dominated by animal farms and food processing industry. Access to digestate from a central biogas plant improved the potential to balance the farm's need for nutrients in a way that was not possible when the farm had its own biogas production. Hence, access to digestate from the neighboring biogas plant increased the flexibility and the possibilities for the organic crop farm to achieve higher yields and less nutritional surplus by better tailoring the nutrient supply to crop requirements.

Conclusions
A strategy of purchasing digestate or poultry manure for anaerobic digestion on intensive organic dairy farms contributed to considerable N imports, which tended to exceed the N inputs via biological N fixation. Thus contributions from these N sources must be tailored in order to achieve resource-efficient N use on organic farms.
The actual N fertilizer value of digestate on organic farms with on-farm biogas reactor and storage pits was considerably lower than expected. The proportion of plant-available N (NH 4 -N) in total N in digestate increased slightly or decreased markedly compared with that in purchased manure and on-farm manure entering the biogas reactor. A high risk of sedimentation in farm biogas plants digesting poultry manure was identified. Improved handling by, e.g., appropriate stirring techniques in biogas reactors and storage pits would directly contribute to higher fertilizer value in digestate. Such measures would incur investment costs, but these could be compensated for by higher digestate value.
On an intensive farm purchasing digestate from a central co-digesting biogas plant, the digestate had a high content of plant-available N compared with manure, while amounts of P, K, and other nutrients were on the same level. Thus, purchasing digestate increased that farm's possibilities to tailor nutrient supply to crop requirements. On the other hand, purchasing digestate also brought major Cd, Cu, and Zn inputs to the farm. This shows the importance of keeping records on PTE flows and using the data in budget calculations to help identify trends, so that farmers can avoid unwanted accumulation or depletion of elements over time.
Author contribution All authors contributed to the study conception and design. Material preparation, data collection, and analysis were performed by ES and SBN. The first draft of the manuscript was written by ES and all authors commented on previous versions of the manuscript. All authors read and approved the final manuscript.
Funding Open access funding provided by RISE Research Institutes of Sweden. Open Access funding provided by RISE research institutes of Sweden. The study was financed by Formas, the Swedish government research council for sustainable development.

Data availability
The data set is available in the supplementary material.

Consent for publication
The farmers involved approved publication of farm data in an agreement made before the start of the study.

Conflict of interest The authors declare no competing interests.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http:// creat iveco mmons. org/ licen ses/ by/4. 0/.