Guide and model description

KiwiFlux · element and nitrogen fluxes through a soil profile, month by month

1What KiwiFlux does

KiwiFlux follows a suite of elements and nitrogen through a soil profile under a crop, one month at a time, for as many years as you set. Each month fertiliser and atmospheric deposition enter, the crop takes up what its roots reach, the harvested share leaves the block, rain that the soil cannot hold carries solutes downward, and eroded soil takes its elements with it. At the end of the run every element and the soil nitrogen close a mass balance to within rounding error.

KiwiFlux computes little that the rest of the KiwiScience suite already holds. The site, the monthly climate and the element concentrations come from KiwiMap; partition coefficients (Kd) and bioaccumulation coefficients (BAC) from KiwiChem; the free-ion share of each metal, which scales BAC, from KiwiSpec; the change in soil carbon over the run from KiwiCarbon; and the fertiliser programme from KiwiFert. Each of those apps is loaded from its own folder and run as its authors wrote it. Everything they supply lands in an editable field, and every run uses single values: there is no sampling over parameter ranges.

2A first run

  1. On the Site tab, click your block on the map, or type a latitude and longitude and press Read KiwiMap at this point. KiwiFlux reads the soil order, drainage, topsoil carbon and pH, monthly rainfall and potential evapotranspiration (PET), seasonal temperatures and the total concentration of all 65 elements the national geochemical survey reports. The point becomes the current site for every KiwiScience tool.
  2. On the Elements tab, tick the elements to model. The 16 that KiwiMap’s shared reader treats as the fertiliser suite are ticked for you. Change any concentration you have measured.
  3. On the Crop & fertiliser tab, choose the plant, then the KiwiFert plant type, and press Compute with KiwiFert.
  4. Set the simulation time and the slice thickness in the sidebar and press Run. A 20-year run on 50 slices takes under half a second; the KiwiSpec speciation adds about a second.

3Where each input comes from

InputSourceHow KiwiFlux uses it
Soil order, drainage, topsoil carbon and pHKiwiMap (S-map, NZEnvDS)Choose KiwiCarbon’s horizon set for the order; scale every horizon’s carbon by the mapped topsoil carbon and shift every horizon’s pH by the mapped topsoil pH; set the water table depth from the drainage class
Monthly rainfall and PETKiwiMap (WorldClim 2.1, 1970–2000)Used month by month, repeated each year
Monthly temperatureKiwiMap seasonal meansThe annual harmonic through the four seasonal means (Section 5)
Element concentrationsKiwiMap, national geochemical surveyTotal concentration at the start, applied to every slice
KdKiwiChemThe Kd of the element already in the soil (Allison and Allison 2005) where KiwiChem holds one, otherwise the sorption Kd, pH-specific for the 12 metals in US EPA (1996) Table C-4
BACKiwiChemThe soil-to-plant transfer factor (Kabata-Pendias 2011; IAEA 2010); for the macronutrients, which have none, the reference plant concentration divided by the soil concentration
Free-ion fractionKiwiSpecRatio of the site to a reference solution, multiplying BAC for metal cations
Soil carbon over timeKiwiCarbonA ratio to the starting carbon for each horizon and each year
PlantKiwiCarbon plant libraryProduction, monthly growth share, crop coefficient (Kc), rooting, N content and removal
FertiliserKiwiFertAnnual rate of each element, its monthly calendar from KiwiFert’s application schedule, the nitrogen form, and cadmium at 280 mg Cd/kg P

Where a sister app cannot be reached, its tab says why and the run proceeds on the values already in the form. Opened straight off the disk (file://), the browser blocks the other folders; start the site with Open KiwiScience.command.

4The profile and its slices

The profile runs from the surface to the depth set in the sidebar (100 cm by default) and is cut into slices of the set thickness (2 cm by default). Bulk density, field capacity, wilting point, organic carbon, C:N and pH vary linearly between the mid-depths of the horizons, and are those of the top or bottom horizon above its mid-depth or below the deepest one. Horizons in a profile grade into one another, and a property that stepped at a boundary would step Kd there, and with it the profile of every element. KiwiChem’s pH factor and KiwiCarbon’s carbon trajectory are blended the same way. A slice’s soil mass per hectare is

(1)m = ρb × Δz × 105  kg/ha

with bulk density ρb in g/cm³ of fine earth and slice thickness Δz in cm.

The slices are a numerical device, not a property of the soil: once they are no thicker than twice the soil’s dispersivity (Section 6), the results do not depend on them. For a dairy pasture over 30 years with a dispersivity of 5 cm, slices of 0.5, 1 and 2 cm give the same nitrate leaching (16.2 kg N/ha/yr), the same Cd in the top 7.5 cm (0.320 mg/kg) and the same tracer breakthrough. Slices of 10 cm give 18 kg N/ha/yr, and one cell per horizon (about 25 cm) gives 23 kg N/ha/yr and 0.21 mg Cd/kg, because a thick cell mixes fertiliser cadmium through its whole depth and spreads a front further than the soil does. At the default of 2 cm a 30-year run of 16 elements takes about 0.4 s in the browser, plus the KiwiSpec speciation; the sidebar warns when the slices are too thick for the dispersivity.

5Water

Each month rain and irrigation enter the top slice. Working downward, each slice keeps water up to field capacity and passes the excess to the slice below; a slice below the water table keeps water up to saturation. What leaves the bottom slice is drainage. The crop then draws Kc × PET from the rooted slices in proportion to their root share, never below wilting point, and the ratio of actual to demanded evapotranspiration is the month’s water stress. One year of water alone is run before the start, so the profile begins with the water content the climate keeps in that month.

KiwiMap holds temperature as four seasonal means. KiwiFlux places each at its middle month (January, April, July, October) and fits the annual harmonic

(2)T(m) = a + b cos(πm/6) + c sin(πm/6)

with a the annual mean, so the monthly values keep the mapped annual mean exactly.

A monthly step underestimates drainage where rain falls in a few large events, because a whole month’s rain arrives at once against a whole month’s evapotranspiration. At Lincoln (Canterbury), with 650 mm of rain and 960 mm of PET a year, the dryland pasture drains 91 mm/yr.

6Partitioning and transport

Each element in each slice is two pools. The labile pool partitions between solid and solution, leaches, and supplies the plant. The rest is held in mineral lattices and moves only with eroded soil. The labile fraction defaults to an indicative value per element, from 0.6 for Cd to 0.01 for K and Fe, and the Elements tab shows the porewater concentration it implies so a poor choice is visible before a run.

Kd varies with carbon and pH from slice to slice and month to month:

(3)Kd = Kd,ref × fpH × (foc / foc,ref)β

Kd,ref is KiwiChem’s value at the topsoil carbon and pH; fpH is the ratio of KiwiChem’s pH-specific sorption Kd at the horizon’s pH to that at the topsoil pH (1 where none is tabulated); foc is the slice’s organic carbon fraction this month and foc,ref the topsoil’s at the start. β is 0.5 for metal cations, which bind to organic matter, and 0 for oxyanions and halides.

A Kd with a total basis relates the total soil concentration to the porewater. On the labile pool it becomes Kd × L, where L is the labile fraction, which gives the same porewater. A sorption Kd applies to the labile pool as it stands.

Solutes move by advection with the drainage and spread by dispersion. A slice holding W mm of water has a capacity for a solute, in mm of water-equivalent, of

(4)cap = W + Kdm / 104

so a sorbing solute moves more slowly than the water by the factor cap/W, its retardation.

Advection is an explicit upwind scheme. Each month is divided into as many sub-steps as it takes for no slice to pass more than its own capacity in one, and in each sub-step every slice sends the share q/(n cap) of what it holds to the slice below, where q is the month’s drainage across its lower face and n the number of sub-steps. Without dispersivity a non-sorbing tracer moves exactly the plug-flow distance, q/(10θ) cm in a month.

The upwind scheme spreads a front as if the soil had a dispersivity of Δz/2 × (1 − Cr), where Cr is the sub-step’s Courant number. Dispersion supplies the rest of the soil’s dispersivity α (5 cm by default; Vanderborght and Vereecken 2007 review measured values) as an exchange of water across each face,

(5)E = max[0, α − Δz/2 (1 − Cr)] × q / Δz

applied once a month and implicitly, on the solution concentration. The implicit step is stable for any exchange, conserves mass exactly and adds the variance 2α × (distance travelled) that dispersion should. In the test suite a tracer moved by 120 mm of drainage spreads by 17.9 to 18.1 cm (standard deviation) for slices of 0.5 to 5 cm, against 19.7 cm from theory; the difference is the surface boundary, which the pulse starts against. Nothing disperses out of the base of the profile.

Soil itself moves too. Earthworms and roots mix it continuously, and KiwiFlux represents this bioturbation as a diffusion of both pools of every element, and of the residue nitrogen, with a coefficient Db of 2 cm2/yr at the surface that falls with depth as root density does (βrz). Kaste et al. (2007) measured 1 to 2 cm2/yr on bioturbated grassland. It is applied each month by the same implicit step as dispersion, on concentration per kilogram of soil, and spreads a surface pulse by exactly 2Dbt. An annual crop is also cultivated once a year (20 cm in spring by default), which mixes everything above that depth to one concentration. Fertiliser, deposition and returned plant material go onto the top slice; bioturbation and cultivation carry them down.

The run starts from a profile in equilibrium. The concentration entered is that of the top 10 cm, which is what a soil sample and the geochemical survey measure. The lattice-bound share is uniform with depth, as parent material is; the labile share is in equilibrium with one soil-solution concentration, so it falls with depth where Kd does. Without fertiliser, water or mixing, that profile does not change. Started uniform instead, every change in Kd down the profile would be a disequilibrium the run spends years relaxing, which shows as steps and bulges at horizon boundaries. After 30 years of superphosphate at 40 kg P/ha/yr, Cd falls steadily from 0.33 mg/kg at the surface, three times its starting 0.11 mg/kg; the enrichment is 35 % at 19 cm, 6 % at 31 cm and gone by 65 cm. The top 10 cm reads 0.29 mg/kg whether the slices are 1 or 2 cm thick.

7Plant uptake and speciation

Monthly growth is the plant’s annual above-ground production times its share for the month times the water stress. Roots follow Gale and Grigal (1987): the share of roots above depth d cm is 1 − βrd, truncated at the maximum rooting depth. Uptake of each element is

(6)U = BAC × S × Croot × DM

Croot is the root-weighted total soil concentration (mg/kg), DM the month’s dry matter (kg/ha) and S the free-ion ratio. Uptake comes from the labile pool of the rooted slices, at most half of any slice in a month. The harvested share leaves the block; the rest returns to the mixing depth.

KiwiSpec solves the soil solution twice with NICA-Donnan binding to dissolved organic matter (Milne et al. 2003): at the topsoil pH and dissolved organic carbon (DOC), and in a reference solution at pH 6.0 and 10 mg/L DOC that stands for the conditions behind published transfer factors. Both use KiwiSpec’s temperate pasture solution, with each modelled element at the porewater concentration its Kd implies, CO2 at 10−2 atm and the mean annual temperature.

(7)S = (free / total)site / (free / total)ref

The free-ion activity model describes metal cations, so S applies to them alone. Oxyanions and neutral species keep their BAC, as do Cr(III) and Hg(II), which KiwiSpec does not bind to organic matter, and Fe and Al, which KiwiSpec precipitates as ferrihydrite and Al(OH)3 in an oxic solution. S is bounded to between 0.1 and 10 by default.

With yearly recomputation on, DOC at the site follows the topsoil carbon ratio and KiwiSpec re-solves the site solution whenever DOC has moved by more than 10 %. In the Lincoln example, topsoil carbon falls over 30 years and the free-ion ratio of Cd rises from 0.51 to 0.74.

8Soil carbon

Before each run KiwiFlux builds a KiwiCarbon scenario for the same block: the same monthly climate, the same horizons, the same plant with its removal, and the nitrogen, phosphorus, potassium and sulphur rates of the fertiliser programme. KiwiCarbon runs once, without its uncertainty band. It reports the profile total every year and each horizon at the start and end, so each horizon h follows the profile’s time course scaled to its own end point:

(8)rh(y) = 1 + (Rh − 1) × [S(y) − S0] / [Send − S0]

Rh is the horizon’s end-to-start carbon ratio and S the profile’s soil carbon. Months are interpolated between years.

Soil carbon then moves Kd (Equation 3), DOC (Section 7) and soil organic nitrogen (Section 9). The Carbon & nitrogen tab offers two alternatives: carbon held constant, or a linear change in percent of the start per year. KiwiFlux holds pH at the measured value, so lime adds calcium but does not move Kd.

9Nitrogen

Each slice has ammonium, nitrate and a residue pool. Soil organic nitrogen is not a separate state: it is soil organic carbon divided by the horizon’s C:N, so it follows the carbon trajectory exactly. Each month, in each slice,

(9)SOM release = −ΔCorg / (C:N)

is mineralised to ammonium when carbon falls. When carbon rises, the organic N it would hold is taken from the ammonium and nitrate in the slice, and only as far as they go: KiwiFlux never creates nitrogen to match a carbon gain. Any shortfall widens the C:N of the new organic matter, and the Results tab reports it in kg N/ha.

Fertiliser N enters as ammonium or nitrate according to its form; urea hydrolyses within the month. Ammonia volatilisation takes 10 % of urea N by default, about half that with a urease inhibitor, 3 % of ammonium salts and 1.5 % of calcium ammonium nitrate. Deposition adds 2 kg N/ha/yr, half as each ion. Biological fixation supplies the plant directly, up to its demand.

The plant’s N demand is its dry matter times its N content. What fixation does not meet comes from the ammonium and nitrate of the rooted slices, at most 90 % of a slice in a month. Of the plant N that is not harvested, a share returns as mineral N (urine, 0.5 by default) and loses 10 % as ammonia; the rest enters the residue pool, which mineralises first order at 2 per year at 10 °C.

Rates scale with temperature by Q10 = 2 about 10 °C and with relative water content. Nitrification converts ammonium at 3 per month, slowed below pH 6 and above 80 % water-filled pore space (WFPS). Denitrification removes nitrate at

(10)k = kden × fT × [(WFPS − 0.45) / 0.55]1.5 × foc / foc,ref

with kden = 1 per month. N2O is 0.2 % of nitrified N. Nitrate does not sorb; ammonium sorbs with Kd = 2 L/kg.

The share of denitrified N that leaves as N2O follows Del Grosso et al. (2000), as implemented in DayCent. Denitrifiers short of carbon to reduce N2O to N2 release more of it, and wetter soil traps it until it is reduced, so the N2:N2O ratio is

(11)R = max[0.1, Fr(NO3/CO2) × Fr(WFPS) × adj]
(12)Fr(NO3/CO2) = max[0.16 k1, k1 exp(−0.8 NO3/CO2)],   k1 = max(1.7, 38.4 − 350 DFC)
(13)Fr(WFPS) = max(0.1, 1.5 WFPS − 0.32)

and N2O = denitrification / (1 + R). NO3 is the slice’s nitrate in µg N/g soil and CO2 its heterotrophic respiration in µg C/g soil per day. KiwiCarbon supplies the profile’s respiration for each year; KiwiFlux shares it out over the months by temperature (Q10) and down the slices in proportion to soil carbon. DFC is the relative gas diffusivity at field capacity, from the slice’s porosity and field capacity by Millington and Quirk (1961), and adj is DayCent’s site adjustment (1). With little nitrate per unit of respiration the share is near 10 %; where nitrate is plentiful relative to the carbon supply, as in a subsoil fed by a falling carbon stock, it approaches 20 to 30 %. When soil carbon is not from KiwiCarbon there is no respiration, and the share follows Equation 13 alone, set to 10 % at 60 % WFPS.

In the test suite a well-drained silt loam under dryland dairy pasture with 150 kg fertiliser N/ha/yr and constant carbon leaches 16 kg N/ha/yr and denitrifies 2.9 kg N/ha/yr; a water table at 30 cm raises denitrification to 9.7 kg N/ha/yr and lowers leaching to 6.6 kg N/ha/yr.

The nitrogen forms, their ammonia loss, the rate functions above and the carbon-nitrogen check come from the site’s shared nitrogen library, ../ks-nitrogen.js. KiwiCarbon uses the same forms and the same reading of KiwiFert’s nitrogen text, and reports on its Results tab how much nitrogen its carbon trajectory locks up or releases at each horizon’s C:N, against the nitrogen the block receives.

10Erosion and the mass balance

Erosion removes soil from the top slice, the year’s loss shared among months in proportion to rain, with its labile and lattice-bound elements and its nitrogen. The top slice is refilled from the slice below, so the profile keeps its geometry.

For each element, start + fertiliser + deposition − offtake − leached − eroded − end is the residual; returned uptake stays inside the block. For nitrogen the same holds for the soil’s mineral and residue pools, with SOM release as an input, and the Results tab also gives the farm-gate budget: fertiliser, deposition and fixation in; offtake, ammonia, denitrification, leaching and erosion out; against the change in organic, residue and mineral N. Residuals are of order 10−15 of the throughput.

11Reading the results

The summary table gives each element’s concentration in the top 10 cm at the start and end (mass-weighted, so it does not depend on the slice thickness) and its mean annual fluxes, in g/ha/yr or, for the macronutrients, kg/ha/yr. Leachate is the flux-weighted concentration in the water leaving the profile. Click a row for four charts: concentration in the top slice and the root zone, cumulative fluxes, the depth profile at the start, middle and end, and the leachate by month.

Where nitrogen released from soil organic matter exceeds a quarter of the mineral N entering the soil, the Results tab says so. A measured topsoil carbon above what KiwiCarbon expects for the climate and land use declines towards its equilibrium, and its nitrogen then dominates the soil’s nitrogen budget. In the Lincoln example, the mapped topsoil carbon is 7.0 %, soil carbon to 100 cm falls 18 % over 30 years, and the released nitrogen supplies 132 kg N/ha/yr. With 90 mm/yr of drainage, 11 kg N/ha/yr of it leaches and 123 kg N/ha/yr is denitrified, most of it in the saturated subsoil below the 60 cm water table of this imperfectly drained Gley Soil. Comparing that run with one at constant carbon separates the effect of the carbon trajectory from that of management.

The yearly CSV holds each element’s topsoil concentration and fluxes, the nitrogen budget, the water balance and soil carbon; Open in KiwiStat sends the same table to KiwiStat with its units.

12Scope and next steps

KiwiFlux describes equilibrium sorption with a linear isotherm. Fresh fertiliser metal and native metal share one Kd per element; separating them, with ageing between the two, is the next step for cadmium. Crop rotations enter as a single plant; KiwiFert’s rotation phases, with a plant per phase, would follow from its schedule data. pH is held constant, so the acidity of nitrogen fertiliser and the correction by lime are left to KiwiFert and KiwiCarbon; coupling KiwiCarbon’s pH drift to Kd would close that loop. Phosphorus is treated like the other elements, with a linear Kd. KiwiCarbon reports respiration for the whole profile by year, so KiwiFlux shares it by temperature and soil carbon rather than taking it horizon by horizon and month by month, and leaves out DayCent’s small upward correction to respiration near saturation; carrying KiwiCarbon’s respiration by horizon and month would remove both approximations.

13Files and tests

FileRole
index.html, app.cssThe application: seven tabs and the run block in the sidebar
js/model.jsThe engine, with no DOM; runs in Node
../ks-nitrogen.jsThe shared nitrogen library: fertiliser N forms, the KiwiFert matcher, the rate functions and the carbon-nitrogen check, used by KiwiFlux and KiwiCarbon
js/links.jsThe links to KiwiMap, KiwiChem, KiwiSpec, KiwiCarbon and KiwiFert
js/charts.jsSVG charts
js/app.jsThe interface
test/kiwiflux.test.js56 engine checks: mass balance for every element and nitrogen, water closure, magnitudes, transport against plug flow and the dispersion variance, convergence with slice thickness, smooth profiles with no steps at horizon boundaries, an equilibrium start, bioturbation against theory, cultivation, the carbon link (including a carbon gain larger than the nitrogen supply), the free-ion correction, the N2O share against nitrate, respiration and water-filled pore space, and the degenerate cases. Run node test/kiwiflux.test.js from this folder.
test/links.test.js24 checks of the links against the sister apps’ own files, ending in a fully coupled run and a check that KiwiFlux, KiwiCarbon and the shared nitrogen library use one set of nitrogen forms. Run node test/links.test.js.

The files beginning rhizoflux and the archive folder are the single-contaminant Monte Carlo model of August 2026, which KiwiFlux replaces; no page loads them.

References: Allison, J.D. and Allison, T.L. (2005) Partition coefficients for metals in surface water, soil and waste. US EPA/600/R-05/074. Gale, M.R. and Grigal, D.F. (1987) Vertical root distributions of northern tree species in relation to successional status. Canadian Journal of Forest Research 17, 829–834. IAEA (2010) Handbook of parameter values for the prediction of radionuclide transfer in terrestrial and freshwater environments. Technical Reports Series 472. Kabata-Pendias, A. (2011) Trace Elements in Soils and Plants, 4th edn. CRC Press. Milne, C.J. et al. (2003) Generic NICA-Donnan model parameters for metal-ion binding by humic substances. Environmental Science & Technology 37, 958–971. Millington, R.J. and Quirk, J.P. (1961) Permeability of porous solids. Transactions of the Faraday Society 57, 1200–1207. Del Grosso, S.J., Parton, W.J., Mosier, A.R., Ojima, D.S., Kulmala, A.E. and Phongpan, S. (2000) General model for N2O and N2 gas emissions from soils due to denitrification. Global Biogeochemical Cycles 14, 1045–1060. Kaste, J.M., Heimsath, A.M. and Bostick, B.C. (2007) Short-term soil mixing quantified with fallout radionuclides. Geology 35, 243–246. US EPA (1996) Soil Screening Guidance: User’s Guide. EPA/540/R-96/018. Vanderborght, J. and Vereecken, H. (2007) Review of dispersivities for transport modeling in soils. Vadose Zone Journal 6, 29–52.

↑ Back to top