Code modernization and modularization of APEX and SWAT watershed simulation models
DOI:
https://doi.org/10.25165/ijabe.v8i3.1081Keywords:
code modernization, modularization, object-oriented programming, Fortran 2008, landscape-scale models, APEX, EPIC, SWATAbstract
SWAT (Soil and Water Assessment Tool) and APEX (Agricultural Policy/Environmental eXtender) are respectively large and small watershed simulation models derived from EPIC (Environmental Policy Integrated Climate), a field-scale agroecology simulation model. All three models are coded in Fortran and have evolved over several decades. They are widely used to analyze anthropogenic influences on soil and water quality and quantity. Much of the original Fortran code has been retained even though Fortran has been through several cycles of development. Fortran now provides functionality originally restricted to languages like C, designed to communicate directly with the operating system and hardware. One can now use an object-oriented style of programming in Fortran, including inheritance, run-time polymorphism and overloading. In order to enhance their utility in research and policy-making, the models are undergoing a major revision to use some of the new Fortran features. With these new programming paradigms the developers of SWAT, APEX, and EPIC are working to make communication between the two models seamless. This paper describes the ongoing revision of these models that will make them easier to use, maintain, modify and document. It is intended that they will converge as they continue to evolution, while maintaining their distinctive features, capabilities and identities. Keywords: code modernization, modularization, object-oriented programming, Fortran 2008, landscape-scale models, APEX, EPIC, SWAT DOI: 10.3965/j.ijabe.20150803.1081 Online first on [2015-03-03] Citation: Taylor R A J, Jeong J, White M, Arnold J G. Code modernization and modularization of APEX and SWAT watershed simulation models. Int J Agric & Biol Eng, 2015; 8(3): 81-94.References
Chapmann S J. Fortran 90/95 for Scientists and Engineers, 2nd Ed, McGraw-Hill Higher Education. 2004.
Williams J R, Jones C A, Dyke P T. A modeling approach to determining the relationship between erosion and soil productivity. Transactions of the ASAE, 1984; 27: 129–144.
Williams J R. The erosion productivity impact calculator (EPIC) model: A case history. Philosophical Transactions of the Royal Society of London. Series B: Biological Sciences, 1990; 329: 421–428.
Williams J R. The EPIC model. pp. 909-1000 in Computer Models of Watershed Hydrology, (Singh VP, ed.). Water Resources Publications, Highlands Ranch, CO, USA. 1995.
Williams J R, Nearing M, Nicks A, Skidmore E, Valentin C, King K, et al. Using soil erosion models for global change studies. Journal of Soil and Water Conservation, 1996; 51: 381–385.
Williams J R, Arnold J G, Kiniry J R, Gassman P W, Green C H. History of model development at Temple, Texas. Hydrological sciences journal, 2008; 53: 948–960.
Williams J R, Izaurralde R C, Steglich E M. Agricultural Policy/Environmental eXtender Model: Theoretical Documentation, Version 0604. BREC Report 2008-17. Temple, Tex.: Texas AgriLife Blackland Research and Extension Center. 2008. Available at: http://epicapex.tamu.edu/downloads/user-manuals/. Accessed on [2014-08-17].
Izaurralde R C, Williams J R, McGill W B, Rosenberg N J. Simulating soil C dynamics with EPIC: Model description and testing against long-term data. Ecological Modelling, 2006; 192: 362–384.
Gassman P W, Williams J R, Wang X, Saleh A, Osei E, Hauck L M, et al. The Agricultural Policy/Environmental Extender (APEX. model: An emerging tool for landscape and watershed environmental analyses. Transactions of the ASABE, 2010; 53: 711–740.
Arnold J G, Srinivasan R, Muttiah R S, Williams J R. Large area hydrologic modeling and assessment, Part I: Model development. Journal of the American Water Resources Association, 1998; 34: 73–89.
Arnold J G, Moriasi D N, Gassman P W, Abbaspour K C, White M J, Srinivasan R, et al. SWAT: Model use, calibration, and validation. Transactions of the ASABE, 2012; 55: 1491–1508.
Gassman P W, Williams J R, Benson V W, Izaurralde R C, Hauck L M, Jones C A, et al. Historical development and applications of the EPIC and APEX models. ASAE/CSAE Meeting Paper No. 042097. ASAE, St. Joseph, MI. 2004.
Gassman P W, Reyes M R, Green C H, Arnold J G. The Soil and Water Assessment Tool: historical development, applications, and future research directions. Transactions of the ASABE, 2007; 50: 1211–1250.
Wang X, Williams J R, Gassman P W, Baffaut C, Izaurralde R C, Jeong J, et al. EPIC and APEX: Model use, calibration, and validation. Transactions of the ASABE, 2012; 55: 1447–1462.
Duriancik L F, Bucks D, Dobrowolski J P, Drewes T, Eckles S D, Jolley L, et al. The first five years of the Conservation Effects Assessment Project. Journal of Soil and Water Conservation, 2008; 63: 185A–197A.
Wang X, Kannan N, Santhi C, Potter S R, Williams J R, Arnold J G. Integrating APEX output for cultivated cropland with SWAT simulation for regional modeling. Transactions of the ASABE, 2011; 54: 1281–1298.
Jeong J, Kannan N, Arnold J G, Glick R, Gosselink L, Srinivasan R. Development and integration of sub-hourly rainfall–runoff modeling capability within a watershed model. Water Resources Management, 2010; 24: 4505–4527.
Jeong J, Kannan N, Arnold J G, Glick R, Gosselink L, Srinivasan R, et al. Development of sub-daily erosion and sediment transport algorithms for SWAT. Transactions of the ASABE, 2011; 54: 1685–1691.
Jones J W, Keating B A, Porter C H. Approaches to modular model development. Agricultural Systems, 2001; 70: 421–443.
Jones J W, Hoogenboom G, Porter C H, Boote K J, Batchelor W D, Hunt L A, et al. The DSSAT cropping system model. European Journal of Agronomy, 2003; 18: 235–265.
Harbaugh A W. MODFLOW-2005, The U.S. Geological Survey Modular Ground-Water Model—the Ground-Water Flow Process. Techniques and Methods 6–A16. U.S. Geological Survey, Washington, DC, USA. 2005.
Ascough J C, David O, Krause P, Fink M, Kralisch S, Kipka H, et al. Integrated agricultural system modeling using OMS 3: Component driven stream flow and nutrient dynamics simulations. 2010 International Congress on Environmental Modelling and Software Modelling for Environment’s Sake. Swayne D A, Yang W, Voinov A A, Rizzoli A, Filatova T, eds. International Environmental Modelling and Software Society, Ottawa, Canada. 2010.
van Kraalingen D W G. The FSE System for Crop Simulation: Version 2.1 (Quantitative Approaches in Systems Analysis Report No. 1). C.T. de Wit Graduate School for Production Ecology, Wageningen University, Wageningen, Netherlands. 1995.
Metcalf M, Reid J, Cohen M. Modern Fortran Explained. Oxford University Press, Oxford, UK. 2011.
Markus A. Modern Fortran in Practice. Cambridege University Press, Cambridge, UK. 2012.
Olivera F, Valenzuela M, Srinivasan R, Choi J, Chou H, Koka S, et al. ArcGIS-SWAT: A Geodata Model and GIS Interface for SWAT. Journal of the American Water Resources Association, 2006; 42: 295–309.
Tuppad P, Winchell M F, Wang X, Srinivasan R, Williams J R. ArcAPEX: ArcGIS interface for Agricultural Policy Environmental eXtender (APEX) hydrology/water quality model. International Agricultural Engineering Journal, 2009; 18: 59–71.
Arnold J G, Srinivasan R, Engel B A. Flexible watershed configurations for simulating models. Hydrological Science and Technology, 1994; 10: 5–14.
Williams J R, Arnold J G. A system of erosion-sediment yield models. Soil Technology, 1997; 11(1): 43–55.
Arnold J G, Kiniry J R, Srinivasan R, Williams J R, Haney E B, Neitsch S L. Soil and Water Assessment Tool Input/Output File Documentation: Version 2009. U.S. Department of Agriculture – Agricultural Research Service, Grassland, Soil and Water Research Laboratory, Temple, TX and Blackland Research and Extension Center, Texas AgriLife Research, Temple, TX. Texas Water Resources Institute Technical Report No. 365, Texas A&M University System, College Station, TX. 2011. Available at http://swat.tamu.edu/documentation. Accessed on [2014-08-17].
Weltz M A, Jolley L, Goodrich D, Boykin K, Nearing M, Stone J, et al. Techniques for assessing the environmental outcomes of conservation practices applied to rangeland watersheds. Journal of Soil and Water Conservation, 2011, 66: 154A-162A.
Downloads
Published
How to Cite
Issue
Section
License
IJABE is an international peer reviewed, open access journal, adopting Creative Commons Copyright Notices as follows.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).