SWIM

1 The APSIM SWIM Model

The APSIM SWIM3 Model

Neil Huth, Dean Holzworth, Eric Zurcher (CSIRO, Australia)

Rogerio Cichota (Plant and Food Research, New Zealand)

Val Snow (AgResearch, New Zealand)

Acknowledgements

The addition of SWIM3 into APSIM NextGeneration was completed using funding from CSIRO’s internal funding (SIP) and AgResearch’s Strategic Science Investment Fund. We also acknowledge the valuable data and simulations supplied for validation from Laura Buckthought (Auckland Council, New Zealand) and Sotirios Archontoulis (Iowa State University, USA). SWIM3 builds on the work of Peter Ross and Kirsten Verburg (CSIRO).

Introduction

SWIM3 is a model that stores and moves water and chemicals through the soil. It's function is analogous to the SoilWater model (so the two models would never appear in the same zone in a simulation). However, the underlying methods used to calculate water and solute movement are very different in teh two models and those methods give SWIM3 much more flexibility that SoilWater – particularly when needing complex boundary conditions (e.g., tile drained soils).

SWIM3’s origins lie in a standalone model from Peter Ross (CSIRO) developed in the 1980s. The underlying functions are based on Richards’ equation for water movement and the convection-dispersion equation with a Freundlich solute isotherm for the movement of chemicals (nutrients and other species). The model, still as a standalone model, was extensively documented in Verburg, 1996 and that reference remains the source of definitive information about the functioning of the model itself. Since that time there have been changes in the user interface, some changes in the scope of the standalone version model to make it compatible with APSIM (Huth et al., 1996), and more recently the method for supplying the hydraulic parameters for the model (Huth et al., 2012).

Because Verburg, 1996, and also Cichota et al., 2021, document the processes and parameters in detail, this document only covers major differences to those publications and some tricks and tips on using the model.

Special features – why use SWIM3 rather than SoilWater?

SWIM3 is not as easy to use as SoilWater, is slower and will sometimes and frustratingly crash during a simulation with a numerical convergence error (see more below). Given that, why use SWIM3 at all? Essentially these boil down to needing features that SWIM3 can provide that SoilWater cannot. These include:

  • Needing a seepage boundary condition while modelling a lysimeter experiment. Experimentally, the lower boundary is open to atmospheric pressure and that materially affects water and solute movement.
  • Needing to incorporate the effects of tile drainage or a regional water table into the simulation.
  • SWIM3 has a more realistic treatment of solute mobility and adsorption than SoilWater (in which solute are either mobile or immobile) and this may be important depending on the purpose of the simulation.
  • SoilWater requires as relatively thick (15-20 mm) layer at the soil surface and this can be problematic for questions related to surface processes that change quickly with depth in the soil. Here SWIM3’s thinner layers at the soil surface may be a better solution.
  • SWIM3 actually has fewer parameters because evaporative losses and water redistribution within the soil are calculated from soil hydraulic properties rather than requiring extra parameters as in SoilWater (e.g. U, cona, diffusivity slope and constant).

Major differences compared to the Verburg report

SWIM3 was developed from a standalone model. Because it was a standalone model, it included some functionality already provided by crop or other models in APSIM and so that were discarded when ported into APSIM. These included:

  • Initial conditions are given by the UI or other models as volumetric water content rather than soil water potential;
  • The constant potential top boundary condition was not enabled
  • Surface sealing functions were not enabled

For the top boundary conditions and infiltration:

  • No infiltration is achieved by setting a curve number of 100
  • No runoff is handled with a curve number of 0 (except if infiltration is restricted by sub-surface hydraulic properites)
  • The power-law function option is set using the Manager script “SWIMSetSurfaceBC” – that script is found in the Soil folder of the Management toolbox
  • The subsurface downslope runoff function was not enabled

For the lower boundary conditions the Manager script “SWIMSetLowerBC” (in the Soil toolbox) was written:

  • The “given matric potential gradient” boundary condition is enabled as the default with unit gradient (“gradient” in the Manager script)
  • The “given potential” is enabled as “potential” in the Manager. For this boundary condition the value sets a potential relative to the lower depth of the soil. If the soil is 1000 mm deep and a potential of +200 mm is set then a water table will be set at 800 mm deep and water continually added or removed to/from the lowest soil layer to maintain that water table. Setting a value of -1000 mm as the constant potential would continually add or remove water to maintain that matric potential.
  • The “zero flux” boundary condition was not enabled
  • The “seepage” was enabled with a threshold suction of zero to mimic lysimeter conditions.

Other differences

  • In SWIM3 in APSIM NextGeneration there is no water or solute uptake as these functions are handled by the combination of the SoilArbitrator and the crop models
  • “Potential subsurface downslope flow” was not enabled
  • The methods for specifying the conductivity and soil water retention were replaced as described in Huth et al., 2012 to provide greater accessibility for users unfamiliar with the functional forms used in SWIM2
  • Hysteresis was not enabled
  • Because SWIM3 does not perform the soil water or solute uptake, osmotic effects on these processes are of course not enabled
  • Evapotranspiration is not enabled as this is handled by other APSIM models
  • Rainfall is assumed to arrive evenly during the day
  • Irrigation duration is taken from the irrigation command and the start time is taken as midnight
  • Rainfall/irrigation intensity effects on soil surface roughness are not enabled
  • Cultivation effects on soil physical properties are not enabled

Units

Note that Verburg, 1996 and the more interior parts of the SWIM3 code work in units of cm and hours but from the user’s perspective (inputs and outputs when used in APSIM) the standard APSIM units of mm and days are used.

Layering for APSIM and nodes for SWIM3

Numerical solutions for problems such as the Richards’ equation work on the basis of a network (here a one-dimensional array with depth) of nodes. A node is a notional point in space that contain all the mass in the simulation. There are known/set distances between the nodes and calculated resistances to flow of mass between the nodes. This is quite different to the layering approach used in APSIM so a conversion or mapping between the two systems is essential. The conversion in handled in the software so, in most circumstances, the user does not need to understand the mechanism. The exception is when there are numerical convergence issues and then understanding the layering and its effects is important.

Node-based systems require nodes to be placed at each end of the simulated space (ie top and bottom boundary). The remainder are currently placed in the middle of each internal layer. The placement of nodes is diagrammed in Figure 1. Users should take care to extend the base of the soil profile well below the depth of interest (usually the rooting depth). In particular the soil depth should be well below any water table or tile drain depth AND there should be several (more than two) layers placed between the water table depth or tile drain depth and the base of the soil profile.

Understanding the node concept is important when using REPORT, when specifying initial water contents by layer and when trying to align measured soil water to predicted soil water values. For example, when you output SW[1] you get soil water content at node 1 (the surface). Likewise SW[7] will be at the bottom of the profile. The same applies when you specify initial water in the GUI. Internally to SWIM, sw = theta. There are no back calculations to convert from nodes to layers.

Figure 1. Relationship between APSIM layers and SWIM3 nodes

Convergence issues

The numerical solution methods in SWIM3 give the model considerable flexibility in the boundary conditions but come at a cost of increased execution time and the possibility of some simulations failing when the equations do not numerically converge. See Verburg, 1996 for more information on stability but here are some quick tips or approaches:

  • Put more layers (i.e., make them thinner) near the soil surface, at the base of the profile, around the interfaces of soil horizons with sharp changes in hydraulic parameters, and around features such as tile drains. The use of the LayerStructure model is highly recommended. The top layer should not be greater than 10 mm thick and the deepest layer should not be greater than 200 mm thick.
  • Default values of the maximum timestep and maximum water increment are 1440 min and 10 mm. Reducing these, to say 30 min and 2 mm, will fix many convergence problems.
  • There are space weighting factors available on the user interface that can assist with stability but these require careful usage as they can generate a simulation that runs but that gives unreliable results. See Verburg, 1996 for details.
  • If the error message on non-convergence is related to solutes, consider reducing the nonlinearity (i.e., move the value of fip closer to 1.0) of the solute adsorption isotherm.

Issues and further development needs

Much of the inner code of SWIM3 is very old. The original code was in an early version of Fortran (maybe Fortran 66, possibly even some legacy Fortran IV). Because of the complexities of:

  • short variable names (a feature of early Fortran) as well as;
  • complex code to manage memory usage (these days not an issue) and execution time and the known;
  • near impossibility find and fix any introduced errors; each of the four major modifications of the code was done with the lightest touch possible. Thus, while the code is now all in C#, there are substantial important parts of the model that still look Fortran-like. Finding the source of errors is challenging even with a modern debugger because of the code structure. At some point in the future the code will become unsupportable. Addressing this issue would be advisable but would require substantial funding.

In the current state of SWIM3, simulations are quite unstable when the exponent on the Freundlich solute isotherm is much less then about 0.75 (lower values make the isotherm more nonlinear). This is something that should be addressed in the future along with alternative isotherm formulations.

.NET port of the Fortran SWIM3 model Ported by Eric Zurcher July 2014

2 Validation

2.1 Hudson

The Hudson experiment was conducted in the Liverpool Plains region of New South Wales, Australia (31o 45' S, 150o 45' E) to explore the water balance and productivity of nine different cropping systems including six treatments of continuous cropping of wheat ( Triticum aestivum ), sorghum ( Sorghum bicolor ), mungbeans ( Phaseolus aureus ), and chickpeas ( Cicer arietinum ) with differing cropping frequencies (Paydar et al., 2005). The remaining three treatments involved continuous perennial pastures of lucerne ( Medicago sativa ), grass ( Panicum coloratum ), and a lucerne-grass mixture. Only the continuous wheat cropping has been chosen. The soil profile is classified as an endocalcareous, self-mulching, black vertosol (Isbell, 1996) or Ug5.15 (Northcote, 1979). The soil to around 1 m depth consists of colluvial material with 75% to 80% clay. This overlies >5 m of brown clay with variable amounts of calcium carbonate concretions. Groundwater occurs 15 m below the surface above basalt rock. Further detail on soil properties is provided by [ringrose-voase_deep_2003]. Soil water content to 3.1 m depth was measured with a calibrated neutron moisture meter (CPN 503 DR Hydroprobe moisture gauge, Boart Longyear Co., South Jordan, Utah) at regular intervals from December 1994 until January 2000. Crop and pasture growth and development and soil and crop nitrogen contents were also monitored for the duration of the trial.

Model predictions are compared to measurements of soil water and naturally occurring soil chloride. Comparison of soil water data demonstrates the model's ability to simulate the water balance of two contrasting farming systems, while the soil chloride data provide an inert environmental tracer for testing model predictions of solute transport.

2.2 SeepageLysimeter

These simulations mimic the experimental work of Laura Buckthought done as part of her PhD (Buckthought, 2013) and reported in Buckthought et al., 2015. Differring timings of urine depositions (none, 800 kg N /ha in autumn, 800 kg N /ha in spring) and amounts of fertiliser (0, 200 and 400 kg N /ha /year applied in eight applications) were used in a complete factorial experimnet with four replicates. A ryegrass - white clover pasture was grown in seepage lysimeters that contained intact cores of a Horotiu Silt Loam.

The simulation mimics the experimental set up with standard values and components used. The exception to this was the inclusion of a Manager componed used to address known issues in the simulation of denitrification, mineralisation and nitrification in these high-organic matter allophanic soils in New Zealand's temperate regions. The quality of the C and N simulation is not the target of this test but the excessive denitrification was depressing plant growth so denitrification parameters were adjusted downwards.

The primary results used here include the amount of pasture harvested and the amount of drainage measured from the lysimeters. Data on the leachoing of nitrate is included for reference. Drainage is slightly over-estimated ccompared to the measurements and it is highly likely that this is a result of the underestimation of pasture growth, which again is likely caused by the C and N simulation (leaching of N is too high).

The fourth graph shows the reults of the water mass balance checks. Over the 18 months of the experiment a there was a gain of less than 0.002 mm of water which is considered to be acceptable.

Experiment Name Design (Number of Treatments)
SeepageLysimeterExperiment Fert x Urine (9)

2.3 TileDrainageSpacing

Experiment with a range of tile drainage spacings

Status of the simulation (as at Sept 2022):

  1. Management is 80% - final checking is needed
  2. Cultivars: fixed corn and soy cultivar for all years, to improve that as we convert cultivars from classic to NG

Relevant publications

  1. Pasley et al., 2021
  2. Kladivko et al., 2004
Experiment Name Design (Number of Treatments)
Drain Space (2)

2.4 WaterTableLongTerm

Long term water table measurements from permanent wells. Physical site has a grass crop with reqular cuts but, for now, the simulation uses a maize crop.

2.5 WaterTableMoistureInSeason

Central Iowa experiment with different cropping systems. System_13 refers to a corn-soy and System_14 refers to a soy-corn rotation. Exp data collected from 3-replications. Soil moisture and WT data were collected using Decagon sesnors. WT well depth about 2.5m.

Status of the simulation (as at Sept 2022):

  1. Management 80% final
  2. Cultivars: we used a fixed corn and a fixed soy cultivar for all years
  3. Additional measured data to be added (work in progress)

Relevant publications

Archontoulis et al., 2020

Martinez-Feria et al., 2018

Martinez-Feria et al., 2016

Dietzel et al., 2016

3 Sensibility

3.1 LowerBoundaryConditions

Experiment Name Design (Number of Treatments)
E1 (3)

https://www.apsim.info/documentation/model-documentation/soil-modules-documentation/swimv2-1/

Overview

SWIM3 (Huth et al., 2012) allows three of the four lower boundary conditions described in Verburg, 1996 as described below. The zero flux lower boundary condition has not been enabled.

All references to "SWIM" here refer to the highly detailed documentation by Verburg, 1996 of the standalone model that has morphed over the years into SWIM3. Verburg et al. remains the definitive documentation and should be referred to for detail.

See the "SWIM3_SetLowerBC" Manager script (to be found in both the SWIM3 example and in the Manager toolbox) for examples of how to change lower boundary conditions.

SetLowerBCForGradient(bbcGradient)

A constant gradient in soil water potential with depth is the default lower boundary condition and is applicable to most 'open field' simulations where there is free drainage from the soil. This option is ibbc = 0 in SWIM3. This lower boundary condition setting must be accompanied by the value of that gradient. This is done using a command in a Manager script along the lines of:

SetLowerBCForGradient(bbcGradient);

where bbcGradient is a double (real) variable with the value of the required gradient in soil water potential with depth in the soil. The set value remains in place until the user resets it. Gravity is added to bbcGradient so the most common setting is bbcGradient = 0.0 which means that there is no gradient of soil water potential. In this case, water moves under the influence of gravity alone at the lower boundary. This is the default for SWIM3 and will prevail unless the user intervenes. Other gradients can be set. For example, setting bbcGradient = -1.0 will set the soil water potential gradient to counteract the effect of gravity and will essentially set a no-flow lower boundary (which is likely to result in an unstable simulation).

SetLowerBCForGivenPotential(bbcPotential)

This lower boundary condition sets a constant soil water potential at the lowest node in the simulation. Note that soil water potential is in units of cm (although units of mm are used on the user interface) and is negative in unsaturated soils. This option can be useful for mimicking the effect of a water table at the base of the simulation by setting a positive value equal to the height difference between the water table and the bottom of the simulated soil profile. Note that in this setting, water will be added to the simulation at the lower boundary as needed to maintain the user set soil water potential. See the Manager script "SWIM3_SetLowerBC" for an example:

SetLowerBCForGivenPotential(bbcPotential);

where bbcPotential is the required potential as a double variable in cm. this setting is equivalent to ibbc = 1 in SWIM.

SetLowerBCForSeepage(bbcPotentialSeepage)

A seepage lower boundary is a condition where no drainage can occur until a user-set head of water (i.e., a depth of saturated soil) of bbcPotentialSeepage accumulates at the base of the soil profile. Once that head is reached drainage occurs at the rate allowed by the saturated soil water conductivity under gravity only until the head falls below the user-set value. This lower boundary condition is that of ibbc = 3 in SWIM. A common usage of this boundary condition is when simulating a zero-tension (i.e., free to the atmosphere) lysimeter and in this case bbcPotentialSeepage = 0.0. See an example in "SWIM3_SetLowerBC":

SetLowerBCForSeepage(bbcPotentialSeepage);

where bbcPotentialSeepage is in cm.

Testing

The simulation below runs a simple pasture simulation in an irrigated environment with lower boundary conditions of a unit gradient (“Gradient”), zero-tension seepage as in a lysimeter (“Seepage”), and a set water potential of -500 mm (so wetter than the drained upper limit, “Potential”).

The simulation contains a Manager component to check for preservation of mass in the water balance (“CalculateRollingWaterBalance”). This component calculates daily and cumulative water balances to test for errors and drift. First the component adds up the daily water inputs (rain, irrigation), outputs (drainage, tile drainage, soil water evaporation, runoff, plant water uptake), and change in water storage from the start to the end of the day. Here, storage is both the water in the soil and that in any surface pond. The water balance is the water added, minus water removed, minus the increase in water stored. Note that this water balance component is generic and can be added to any simulation.

Several plots have been produced.

Daily WaterBalance shows that the largest absolute daily error in the water balance is less than 0.0003 mm and that there are more positive errors (water ‘lost’ in the simulation) than negative errors. Following this to the Cumulative WaterBalance shows the effect of the lop-sided daily errors but is reassuring in that the cumulative error is less than 0.02 mm even after six years of simulation.

WaterStored shows the amount of water stored in the soil (none of these simulations included ponding conditions). As expected, the Potential simulation has the highest water storage because the lower boundary potential of -500 mm is wetter than the drained upper limit and water is regularly being added into the simulation to maintain that water potential. The Seepage simulation holds slightly more water in the soil than the Gradient simulation because in Seepage drainage cannot occur until the lower boundary soil water potential rises to zero. That need to the water potential to rise to zero before draining means that some water must accumulate at the base of the soil while the potential is rising and so it allows more time for plants to access the water before it eventually drains. The outcome is that there will generally be somewhat less drainage when a seepage lower boundary condition is set compared to the default unit gradient boundary condition.

PsiOfLowestLayer shows the time series of soil water potential in the lower layer. In Potential it is the prescribed -50 cm (note that SWIM3’s outputs of psi are in cm rather than mm – something that might be fixed in the future perhaps). Seepage maintains a higher value of Psi than Gradient for most of the simulation as expected.

Gradient, Seepage and Potential detail the time series of soil water potential in the lowest layer against drainage for each boundary condition type. Close examination of Seepage shows that drainage is only present when the potential is zero. Note that the drainage is the sum of that during the day while the potential is that at the end of the day so it is possible that there was some drainage during the day but a slightly negative potential at the end of the day. One feature of this boundary condition is the absence of the almost-daily small (< 1mm /day) drainage amounts that are seen in Gradient. The negative drainage in Potential is the result of inflow to maintain the -500 mm soil water potential at the lower boundary. Drainage and CumulativeDrainage show the effects of the boundary conditions more clearly.

In these simulations there is no difference in WaterUptake across the boundary conditions (because the simulations are well irrigated). In the absence of irrigation it would be expected that their would be higher water uptake in the seepage and potential (given a value of -500 mm) boundary conditions as they hold more water in the soil (see WaterStored) for the bulk of the simulation duration.

Only the constant potential boundary condition resulted in any Runoff (the simulations are in a relatively dry environment with a highly permeable soil). The irrigation setting for the simulations was based on soil water deficit. Therefore, as might be expected, Irrigation (see also ** CumulativeIrrigation**) commenced later in each season for the constant potential boundary condition and less irrigation was applied. Also as expected, slightly more irrigation was applied to the constant gradient simulation than the seepage simulation.

3.2 PotentialLowerBoundaryCondition

Experiment Name Design (Number of Treatments)
E2 (4)

This series of simulations tests/demonstrates the setting of different potentials of the constant potential lower boundary condition. Values of 0, -1000 (drained upper limit), -10,000 and -100,000 mm were set. No irrigation was applied.

The first two plots show that the water balance was acceptable. WaterStored shows the expected changes with varying lower boundary condition. WaterUptake and its cumulative show no effect of the two wetter lower boundary conditions that were pumping considerable amounts of water (see Drainage) into the bottom of the soil profile but water uptake was reduced in the drier two boundary conditions.

3.3 SurfaceBoundaryConditions

Experiment Name Design (Number of Treatments)
E3 (4)

See the "SetSurfaceBoundaryCondition" manager script for examples of how to change the surface boundary conditions.

SetSurfaceBoundaryCondition(CurveNumber)

The curve number approach for calculating runoff is the default surface boundary condition and is applicable to most 'open field' simulations. This option is ISBC = 0 in SWIM. This surface boundary condition relies on the value of bare soil runoff curve number in the SWIM3 component. Setting this surface boundary condition is done using a command in a Manager script:

SetSurfaceBCForCurveNumber();

NOTE: If bare soil runoff curve number is set to zero then SWIM will enable ponding and excess water at the surface will go into a pond instead of runoff. This is equivalent to ISBC = 1 in SWIM.

SetSurfaceBoundaryCondition(PowerFunction)

A simple power-law function for calculating runoff can be defined. This option is ISBC = 2 in the SWIM manual. This function requires 6 arguments to be specified. The first three arguments define the minimum, maximum and initial size of the pond (mm). The last three arguments define the parameters (hrc, roff0, roff1) to the runoff equation as defined in the SWIM manual Verburg, 1996.

Setting this surface boundary condition is done using a command in a Manager script:

swim.SetSurfaceBCForPowerFunction(minimumSurfaceStorage: 10, maximumSurfaceStorage: 20, initialSurfaceStorage: 15, precipitationConstant: 50, runoffRateFactor: 0.2, runoffRatePower: 2);

Testing

An experiment has been set up to show the impacts of using these two methods for setting the surface boundary condition. The first three experiment factors use the curve number approach with 3 different curve numbers (0, 50 and 90). The fouth factor uses the power-rate function.

The graphs show the following characteristics:

  • When curve number is zero there is no runoff. Instead ponding occurs at serveral points during the simulation. The lack of runoff results in more water stored in the profile.
  • Using the power function (with the above arguments) results in the lowest rate of runoff.
  • As expected, using a curve number of 90 results in the highest rate of runoff.
  • Mass balance is maintained for all options.

3.4 TileDrainage

Subsurface drainage

Subsurface drainage in APSIM's SWIM3 is implemented using the Hooghoudt equation. The tests below examine the sensibility of the responses in subsurface and vertical (i.e., normal) drainage as well as test for mass balance in water.

Experiment Name Design (Number of Treatments)
E4_1 DepthToImperm (3)
E4_2 DrainSpacing (10)
E4_3 DrainDepth (5)

Depth to the impermeable layer

When the vertical distance between the subsurface drains and the impermeable layer decreases, the drains become more effective. The reader is referred to the scientific/engineering literature on drainage to understand the details but in casual terms, when that distance is small the flow lines are compressed and the drains are more effective.

The simulations below show that as the depth to the impermeable layer increases from 750 to 950 mm, the subsurface flow decreases and drainage increases. This is as expected. Water balance is within tolerance (less than 0.03 mm when the simulation was extended to six years).

Drain spacing

A the spacing between subsurface drains decreases, subsurface drain flow can be expected to increase under conditions of high flow (when the hydraulics of the drains would otherwise be limiting).

The simulations below show that as drain spacing is decreased from 10 m to 1 m, the subsurface flow increases and vertical drainage decreases. This is as expected. Water balance is within tolerance (less than 0.03 mm when the simulation was extended to six years).

Depth to the drains

Shallower subsurface drains are less effective than deeper drains because they can only drain water stored in the soil layers shallower than the drains themselves.

The simulations below show that as drain depth increases from 300 to 700 mm, the subsurface flow increases and drainage decreases. This is as expected. Water balance is within tolerance (less than 0.03 mm when the simulation was extended to six years).

3.5 SoluteMassBalanceTesting

Experiment Name Design (Number of Treatments)
E5_tracer Exco0 x Exco0_5 x Exco1 x Exco1_5 x Exco3 x Exco10 (6)
E5_2_nonlinear NoAdsorb x Linear x NonlinearFIP09 x NonlinearFIP08 x NonlinearFIP075 (5)

Mass balance was tested using chloride as a tracer. Several simulations were run with a linear (FIP=1) isotherm. The simulation was set up with a bare soil, no crops, no evaporation, and 10 mm /day of rainfall. Cl was added to the top 10 mm of soil on the first day (see the AddSoluteToSoil manager) and mass balance was calculated on a daily basis. Using Factors, “exco” of the Cl was changed between 0.0 and 10. When exco = 0 the Cl is not adsorbed (no attraction to the soil surfaces). When exco = 1 the concentration on the soil surfaces in g solute / Mg soil is numerically equal to the concentration in the soil water in g solute / m3 soil water. When exco is 10 the concentration on the soil surfaces will be ten times of that in the soil water (noting the difference in units of course) and the solute is only minimally mobile.

The mass balance error was less than 0.05 kg (of 100 kg) of solute across all simulations and it did not worsen with duration of simulation. The worst mass balance was in the no-adsorption simulation and coincided with peak leaching rate when changes in concentration were relatively steep. Given this, part of the mass balance error may be due to recalculating solute amounts from the node basis of SWIM’s numerical solution onto the layer basis that APSIM uses. Regardless, the error was minimal and within the tolerance for APSIM’s purposes.

Solutes with non-linear isotherms show properties of haveing a greater proportion of the solute in solution than adsorbed on the soil surfaces as total concentration rises. SWIM allows only the Freundlich isotherm as a representation of this.

There are numerical stability issues (i.e., simulations crash) in SWIM as the isotherm becomes more non-linear (i.e. the power on the Freundlich isotherm, FIP, departs further below a value of 1). This is somethign that would merit consideration in the future.

3.6 InitialConditions

https://www.apsim.info/documentation/model-documentation/soil-modules-documentation/swimv2-1/

Overview

SWIM3 (Huth2012SWIM3) allows three of the four lower boundary conditions described in Verburg, 1996 as described below. The zero flux lower boundary condition has not been enabled.

All references to "SWIM" here refer to the highly detailed documentation by Verburg, 1996 of the standalone model that has morphed over the years into SWIM3. Verburg et al. remains the definitive documentation and should be referred to for detail.

This test ensures that the code to initialise psi from initial values of theta is providing a close enough estimate.

Experiment Name Design (Number of Treatments)
E6 SoilType (3)

3.7 Irrigation

https://www.apsim.info/documentation/model-documentation/soil-modules-documentation/swimv2-1/

Overview

SWIM3 (Huth2012SWIM3) allows irrigation to be applied with daily duration (as for soilwat model also in APSIM) or for a sub-daily duration.

Experiment Name Design (Number of Treatments)
E7 Irrigation (10)

4 CriticalTesting

Experiment Name Design (Number of Treatments)
PoreInteractionIndex Value (2)

SWIM should always find a unique relationship between soil water potential (Psi) and volumetric water content (SW). During some of the early testing an error was found where SWIM would solve to multiple values or Psi for any value of SW. This simulation tests in case that behaviour re-emerges. The Manager component “CheckPSI_SW” looks for Psi values when SW is in the rage 0.182 to 0.200 and if Psi varies by more than 25000 cm then an exception is thrown. The errors found earlier were well in excess of this range and were immediately obvious in the plot included in the simulation.

5 Interface

5.1 Swim

Parameters (Inputs)

Name Description Units Type Value
Salb 0-1 double 0.13
CN2Bare double 0
CNRed double 20
CNCov double 0.8
KDul mm/d double 1
PSIDul cm double -100
VC boolean True
DTMin min double 0
DTMax min double 1440
MaxWaterIncrement mm double 10
SpaceWeightingFactor double 0
SoluteSpaceWeightingFactor double 0
Dis (cm^2/h)/(cm/h)^p double 0
Disp double 0
A double 0
DTHC double 0
DTHP double 0
vcon1 double 7.28E-09
vcon2 double 7.26E-07
eo_time String 06:00
eo_durn double 720
default_rain_time String 00:00
default_rain_duration double 720
Diagnostics boolean False

Properties (Outputs)

Name Description Units Type Settable?
Structure IStructure True
Theta cm3/cm3 double True
SW mm/mm double True
SWmm mm double False
PAW mm/mm double False
PAWmm mm double False
ESW mm double False
PrecipitationInterception double True
PSI cm double True
K cm/h double False
PoreInteractionIndex - double True
Runoff mm double False
CoverSurfaceRunoff 0-1 double False
Infiltration mm double False
Es mm double False
Eos mm double False
Drainage mm double False
Eo mm double True
Flow kg/ha double False
Pond mm double False
SubsurfaceDrain mm double False
WaterTable mm double True
PotentialInfiltration double True
Thickness double False
LateralOutflow double False
SubsurfaceDrainNO3 double False
SubsurfaceDrainNH4 double False
SubsurfaceDrainUrea double False
SubsurfaceDrainCL double False
LeachNO3 double False
LeachNH4 double False
LeachUrea double False
LeachCl double False
ConcWaterNO3 double False
ConcWaterNH4 double False
ConcWaterUrea double False
ConcWaterCl double False
Flux double False

Links (Dependencies)

Name Type IsOptional?
clock IClock False
summary ISummary False
physical IPhysical False
water Water False
solutes ISolute False
surfaceOrganicMatter ISurfaceOrganicMatter False
canopies ICanopy False
subsurfaceDrain SwimSubsurfaceDrain True

Methods (callable from manager)

Name Description
SetSurfaceBCForCurveNumber void SetSurfaceBCForCurveNumber()
SetSurfaceBCForPowerFunction void SetSurfaceBCForPowerFunction(double minimumSurfaceStorage, double maximumSurfaceStorage, double initialSurfaceStorage, double precipitationConstant, double runoffRateFactor, double runoffRatePower)Runoff calculated by a power function.
SetLowerBCForGradient void SetLowerBCForGradient(double bbcGradient)Set the lower boundary condition for gradient.
SetLowerBCForGivenPotential void SetLowerBCForGivenPotential(double bbcPotential)Set the constant potential bottom boundary.
SetLowerBCForSeepage void SetLowerBCForSeepage(double bbcPotentialSeepage)Set the constant potential bottom boundary.
SetTopBCForInfiniteSurfaceConductance void SetTopBCForInfiniteSurfaceConductance()
SetTopBCForConstantPotential void SetTopBCForConstantPotential()
SetTopBCForConductanceFunction void SetTopBCForConductanceFunction(double minimumConductance, double maximumConductance, double initialConductance, double precipitationConstant)Set the top boundary condition for conductance function.
Reset void Reset()
Tillage void Tillage(TillageType Tillage)Perform tillage
Sum_Report void Sum_Report()
RemoveWater void RemoveWater(double dlt_sw_dep)Remove water from the profile
SetWaterTable void SetWaterTable(double InitialDepth)Sets the water table.
Tillage void Tillage(String tillageType)Perform tillage

6 Science Documentation

View science documentation here

7 References

Archontoulis, S. V., Castellano, M. J., Licht, M. A., Nichols, V., Baum, M., Huber, I., Martinez-Feria, R., Puntel, L., Ordóñez, R. A., Iqbal, J., Wright, E. E., Dietzel, R. N., Helmers, M., Vanloocke, A., Liebman, M., Hatfield, J. L., Herzmann, D., Córdova, S. C., Edmonds, P., Togliatti, K., Kessler, A., Danalatos, G., Pasley, H., Pederson, C., Lamkey, K. R., 2020. Predicting crop yields and soil-plant nitrogen dynamics in the US Corn Belt. Crop Science 60 (2), 721-738.

Buckthought, L. E., Clough, T. J., Cameron, K. C., Di, H. J., Shepherd, M. A., 2015. Urine patch and fertiliser N interaction: Effects of fertiliser rate and season of urine application on nitrate leaching and pasture N uptake. Agriculture, Ecosystems and Environment 203, 19-28.

Buckthought, Laura E., 2013. The interactive effects of nitrogen fertiliser and animal urine on nitrogen efficiency and losses in New Zealand dairy farming systems..

Cichota, Rogerio, Vogeler, Iris, Sharp, Joanna, Verburg, Kirsten, Huth, Neil, Holzworth, Dean, Dalgliesh, Neal, Snow, Val, 2021. A protocol to build soil descriptions for APSIM simulations. MethodsX 8, 101566.

Dietzel, Ranae, Liebman, Matt, Ewing, Robert, Helmers, Matt, Horton, Robert, Jarchow, Meghann, Archontoulis, Sotirios, 2016. How efficiently do corn- and soybean-based cropping systems use water? A systems modeling analysis. Global Change Biology 22 (2), 666-681.

Huth, N, Keating, B.A., Bristow, Keith L., Verburg, K., 1996. SWIMV2 in APSIM: an integrated plant, soil water and solute modelling framework., 667.

Huth, N.I., Bristow, K.L., Verburg, K., 2012. SWIM3: Model use, calibration, and validation. Transactions of the ASABE 55 (4), 1303-1313.

Kladivko, E. J., Frankenberger, J. R., Jaynes, D. B., Meek, D. W., Jenkinson, B. J., Fausey, N. R., 2004. Nitrate Leaching to Subsurface Drains as Affected by Drain Spacing and Changes in Crop Production System. Journal of Environmental Quality 33 (5), 1803-1813.

Martinez-Feria, Rafael A., Castellano, Michael J., Dietzel, Ranae N., Helmers, Matt J., Liebman, Matt, Huber, Isaiah, Archontoulis, Sotirios V., 2018. Linking crop- and soil-based approaches to evaluate system nitrogen-use efficiency and tradeoffs. Agriculture, Ecosystems and Environment 256, 131-143.

Martinez-Feria, Rafael A., Dietzel, Ranae, Liebman, Matt, Helmers, Matthew J., Archontoulis, Sotirios V., 2016. Rye cover crop effects on maize: A system-level analysis. Field Crops Research 196, 145-159.

Pasley, Heather, Nichols, Virginia, Castellano, Michael, Baum, Mitchell, Kladivko, Eileen, Helmers, Matthew, Archontoulis, Sotirios, 2021. Rotating maize reduces the risk and rate of nitrate leaching. Environmental Research Letters 16 (6), 064063.

Paydar, Z., Huth, N., Ringrose-Voase, A., Young, R., Bernardi, T., Keating, B., Cresswell, H., 2005. Deep drainage and land use systems. Model verification and systems comparison. Australian Journal of Agricultural Research 56 (9), 995-1007.

Verburg, K., 1996. Methodology in soil water and solute balance modelling: an evaluation of the APSIM-Soil Wat and SWIMv2 models. Report of an APSRU/CSIRO Division of Soils workshop held in Brisbane, Australia, 16-18 May 1995.. Divisional Report - CSIRO Division of Soils (131), 88 pp.-88 pp..