This is the regression test suite for ATS.
The full set of these runs should always work, and should always be run and, if necessary, updated prior to issuing a pull request.
A basic python environment is needed -- for full details see the ATS python environment installation in the ATS Users Guide (work in progress, link coming!). In the near term, a python3 installation that includes numpy, matplotlib, and h5py is likely sufficient.
To run the complete set of tests:
python regression_tests.py .
See also:
python regression_tests.py --help
Developers should strive to include at least one new or modified test for each new process capability added to the code.
Each test should be kept to under a minute of total runtime, and should prefer to be on a single core. If tests add a new parallelization aspect, this should be tested with a single (or as few as possible) test(s) on multiple cores. Recognize that many users develop on laptops with at most two physical cores, so parallel tests should try to stay small and short. It is preferable to run two tests -- one parallel and extremely short (2-3 timesteps even) and a second longer but serial to test -- to one long, parallel test.
Note that new tests are often fragile. Floating point roundoff issues, compiler differences, and (especially) blas/lapack implementation differences often result in machine-precision level changes in answers. These changes often cause drift in the final answer, especially if timestepping is adaptive (some timestep takes one more nonlinear iteration, which results in different timestep size records and different answers). Try to run new tests on multiple machines to ensure that tolerances are reasonable (David Moulton and Ethan Coon can help with this if you do not have access to multiple machines).
The test harness is built in python3, and requires the h5py package (to load checkpoint files) and numpy, along with a few other built-in packages. It is distributed as a part of ATS (in tools/testing/. The driving script is distributed in the regression test repository. Tests can be run in two ways, via ctest and the standard Amanzi build system, or directly in python.
Typically the test harness assumes that the user has set the environmental variables:
export AMANZI_SRC_DIR=/path/to/amanzi
export ATS_SRC_DIR=${AMANZI_SRC_DIR}/src/physics/ats
Note that the ats-regression-tests repo is also a submodule of the ATS repo, which itself is a submodule of the Amanzi repo. Therefore, you get this the first time you install Amanzi via bootstrap, located at:
$AMANZI_SRC_DIR/src/physics/ats/testing/ats-regression-tests
Alternatively, you can clone it directly:
git clone https://github.com/amanzi/ats-regression-tests.git
The test suite can be run in two ways. The first is simply using standard ctest -- the tests are added via cmake in standard Amanzi-ATS configuration. So after Amanzi-ATS is configured and built via bootstrap, one can simply:
cd $AMANZI_BUILD_DIR
make test
Alternatively, the test suite can be run manually in python. Note that the ats-regression-tests suite is copied into the build directory so that all things are done "out of source." The result of this is that running through make test and running directly in the source directory run different copies of the test suite. After bootstrap is run, the tests exist both at $AMANZI_BUILD_DIR/src/physics/ats/testing/ats-regression-tests and $AMANZI_SRC_DIR/src/physics/ats/testing/ats-regression-tests.
To run the test manually:
cd $AMANZI_SRC_DIR/src/physics/ats/testing/ats-regression-tests
python regression_tests.py .
Or to run a single test or suite of tests:
python regression_tests.py 02_richards -t infiltration_fv
- Create and
git addthe xml file to the repo. - Add the name of the test to a .cfg file in the test's directory, e.g.
02_richards/richards.cfg - Make sure that checkpoints are being written at sane times, and add the option, "checkpoint=True" to xml files on evaluators whose results you wish to compare (e.g. saturation_liquid, etc).
- Run the test.
- If the test is sensitive to timestep size history (e.g. it is a variable timestep history problem) then use the strategy:
python regression_tests.py -n --save-dt-history 0X_category/catagory.cfg -t my_test_name. This runs your test twice -- once to get a sane timestep size history, then parses that, saves it to disk, writes a new input file that uses that exact sequence of step sizes, and runs a second time ensure that the results work with that timestep size history. This is a huge help for reproducibility and removing false negatives -- the solution can be quite sensitive to timestep size history, but rarely do we want to flag when a non-bitwise repeatable change randomly causes a solver to take one more timestep, thereby changing the answer. - If the test can be a fixed timestep size run, then just
python regression_tests.py -n 0X_category/category.cfg -t my_test_nameis sufficient. - Finally, after you've added the test, run once more via
python regression_tests.py 0X_category/category.cfg -t my_test_name(no-nthis timie) to ensure that tolerances are good and the tests pass with what should be a bitwise identical run.
- If the test is sensitive to timestep size history (e.g. it is a variable timestep history problem) then use the strategy:
- Clean out the resulting gold directory:
./clean_gold.sh 0X_category/my_test_name.regression.goldto make sure that only the checkpoint files and the ats_version.txt files are left. - Commit and push.
- Update xml files, etc
- run the update: `python regression_tests.py -u 0X_category/category.cfg -t "my_test_name"
- clean out the resulting gold directory:
./clean_gold.sh 0X_category/my_test_name.regression.goldto make sure that only the checkpoint files and the ats_version.txt files are left. - commit and push
Note that any non-bitwise reproducible result should likely get updated. It is extremely useful to be able to rely on bitwise reproducibility (when it is available). So, if changes result in bitwise changes in the solution, prefer to first verify that the tests pass (bitwise deltas should still pass!) and only then update the tests using the above procedure. This way, if someone else makes a change that shouldn't affect bitwise reproducibility, they can assume safely that they should have it.
Obviously any changes that cause a test to fail should be checked extensively, confirmed that the change is acceptible (or better), and the document carefully in a commit message why the solution changed.
Note that missing links mean the test does not yet exist. Please feel free to help!
These tests solve Richards equation in steadystate form.
fvA 1D column using finite volumes.mfdThe same problem using mimetic finite differences.mfd-schurThe same problem using MFD and a Schur complement preconditioner.
Transient Richards equation tests. In particular BCs, including seepage face BCs, cause trouble.
infiltration_fvA 1D column infiltration problem, using finite volumes.infiltration_mfdA 1D column infiltration problem using mimetic finite differences.seepage_infiltration_fvInfiltrate with a seepage face.seepage_infiltration_mfdSame as above but with MFD.seepage_drawdown_fvA 1D column with a flux out the bottom.seepage_drawdown_mfdSame as above but with MFD.seepage_drawdown_diag_tensor_fvA 1D column with a flux out the bottom with a diagonal, non-isotropic tensor.seepage_drawdown_diag_tensor_mfdSame as above with MFD.seepage_drawdown_full_tensor_fvA 1D column with a flux out the bottom with a full tensor permeability.seepage_drawdown_full_tensor_mfdSame as above with MFD.seepage_exfiltration_fvA 1D column exfiltration problem, using finite volumes.seepage_exfiltration_mfdA 1D column exfiltration problem using mimetic finite differences.infiltration_then_seepage_fvA 1D column that infiltrates, then a seepage face turns on.infiltration_then_seepage_mfdSame as above with MFD.
Solve some form of diffusion wave equation. In particular BCs, including the plethora of outflow options, cause trouble.
rainfall_fvA simple rainfall problem, with finite volumes.rainfall_fv_jacThe same problem, with Jacobian terms.rainfall_fv_simplifiedThe same problem, but with constant, non-temperature-based densities and viscosities.bc_critical_depthTests the critical depth boundary condition with an injection problem.bc_max_headTests the max head boundary condition with an injection problem.bc_zero_gradientTests the zero gradient boundary condition with an injection problem.uphill_headPart of a series of problems dealing with transient BCs and flow causality causing difficulties in upwinding.uphill_piecewise_headPart of a series of problems dealing with transient BCs and flow causality causing difficulties in upwinding.downhill_headPart of a series of problems dealing with transient BCs and flow causality causing difficulties in upwinding.downhill_piecewise_headPart of a series of problems dealing with transient BCs and flow causality causing difficulties in upwinding.subgrid_microtopographyAn example of the model for representing subgrid microtopography in surface flow.
Coupled flow on the surface and subsurface
column_infiltration2A 1D column, initially unsaturated, rained on. Very similar to column_sat. Second iteration of this test.column_exfiltrationA 1D column, initially unsaturated, with a flux in from the bottom until water expresses at the surface.column_drainageA 1D column, initially saturated with surface water, with a flux out of the bottom until the surface is dry.column_satA 1D column, saturation limited runoff generation.column_infA 1D column, infiltration limited runoff generation.hillslope_satA 2D hillslope, saturation limited runoff generation.hillslope_infA 2D hillslope, infiltration limited runoff generation.hillslope_sat-np2A 2D hillslope, saturation limited runoff generation, on two cores.hillslope_inf-np2A 2D hillslope, infiltration limited runoff generation, on two cores.
Surface energy balance equations that somehow calculate evaporation or transpiration or both.
generalA very simple balance ODE, solving exponential decay, to test general surface balance PKs and time integration.lingzhangA simple test of the Ling & Zhang based surface energy balance model used in Arctic/Ecohydrology runs.priestly_taylorA simple test of the Priestly-Taylor potential ET model.
Surface and subsurface transport of nonreactive species.
surface_tracerA single tracer in a 1D reachsurface_tracer_logicalA single tracer on a logical meshsubsurface_tracerA single tracer in a 2D transect.column_infiltrationIntegrated transport on a single column of cells; an infiltration problem where the new water includes the tracer.column_exfiltrationIntegrated transport on a single column of cells; an exfiltration problem where water pushes up, making sure tracer ends up in the surface water.column_drainageIntegrated transport on a single column of cells; a drainage problem where the water table draws down.column_infiltration_hotSame as above, but with a higher order transport discretization.column_exfiltration_hotSame as above, but with a higher order transport discretization.column_drainage_hotSame as above, but with a higher order transport discretization.
Surface and subsurface reactive transport
surface_decay_ingrowthA two-species system where the first species decays into the second (daughter) species. A radioactive decay problem.surface_decay_ingrowth_logicalThe same problem on a logical mesh.subsurface_decay_ingrowthThe same problem on a 2D transect.integrated_decay_ingrowthThe same problem on surface + subsurface.integrated_decay_ingrowth_coupledThe same integrated system but with a coupled flow solution.surface_denitrificationDual-monod kinetics reaction system for aerobic respiration and DOM denitrification. 6 primary species and reactions.surface_denitrification_logicalThe same problem on a logical mesh.subsurface_denitrificationThe same problem on a 2D transect.integrated_denitrificationThe same problem on surface + subsurface.integrated_denitrification_coupledThe same integrated system but with a coupled flow solution.subsurface_sorptionA single species subsurface transport with equilibrium sorption in a generated meshsubsurface_sorption_logicalReactive transport (first order transformation taking place only in the aqueous phase) in subsurface where parent and daughter species have different sorption propertiesdilution_testA single tracer injection using "water_source" and geochemical condition (PFLOTRAN) to test units of effective solute injection ratecolumn_infiltration_alquimia_tracerIntegrated transport in a single column of cells; same infiltration problem ascolumn_infiltrationwhere the infiltrating water contains a tracer, the concentration of which is set in a pflotran input file, hence testing the alquimia-pflotran coupling as well as the surface-subsurface concentration coupling, and the geochemical source term for concentrations.column_infiltration_alquimia_crunch_tracerSame ascolumn_infiltration_alquimia_tracerbut using CrunchFlow as geochemical engine.column_infiltration_alquimia_calciteSame ascolumn_infiltration_alquimia_crunch_tracerbut with a geochemical problem that involves calcite dissolution in the subsurface domain. So water infiltrates with rain water concentrations causing initial concentrations to decrease. However, calcite dissolution compensates in part for reactants. When infiltration stops, concentrations start to rebound. The geochemical uses CrunchFlow as engine. Tests mineral reaction capabilities.
A set of energy equations building toward freeze-thaw problems.
surface_waterA sheet of ice gets thawed on the surface.freezeupFreezes a column of water from below.permafrostA typical full permafrost problem.snow_distributionSome form of 2D snow distribution test.
A hodgepodge of subgrid models, including column-based 2.5D problems and more.
columnar_permafrostFour-column example of 1D subsurface columns + 2D surface system on an energy+flow system.columnar_permafrost_subgridFour-column example of 1D subsruface columns + 2D subgrid surface system on an energy+flow system with seb subgrid (soil, water, ice) model.stream_hyporheic_conservative_tracer_reachSingle reach conservative tracer example of the ADELS model using Alquimia.stream_hyporheic_sorptionSingle reach tracer undergoing sorption in the sub-surface represented at subgrid level (ADELS model + Alquimia).stream_hyporheic_denitrification_reachSingle reach denitrification example (ADELS model + Alquimia) with single-subgrid hyporheic zone.stream_hyporheic_denitrification_reach_multisubgridSingle reach denitrification example (ADELS model + Alquimia) with multisubgrid hyporheic zones.stream_hyporheic_denitrification_watershedWatershed scale denitrification example (ADELS model + Alquimia) with single-subgrid hyporheic zones.