Mark Piper

and 5 more

Computational models of flood inundation, precipitation-runoff, and groundwater have traditionally been developed within their individual scientific fields. Increasingly, there is a desire and need to couple these models into an integrated system to solve complex problems and aid studies in water resources; for example, the impact of land-use change or climate variability on surface and subsurface flow in watersheds could be simulated by linking a precipitation-runoff model to a groundwater model. In this collaborative project, we factored the U.S. Geological Survey (USGS) Precipitation-Runoff Modeling System (PRMS) into four independent process components: surface, soil, groundwater, and streamflow. Each process component, written in Fortran, has a Basic Model Interface (BMI), which gives the model a standardized set of functions allowing it to be queried, modified, and updated in time. When compiled through Cython, the BMI-equipped components become Python packages, and can then be imported into Python with the Python Modeling Toolkit (pymt), which provides a framework and tools for running and coupling models. The addition of a Python interface for PRMS makes it easier to use, especially for researchers lacking experience in compiling and linking Fortran code, and pymt provides an easy collaboration platform for developing and prototyping complex integrated models. In the next phase of the project, we developed a Python package for a data service to access gridMET climatological data distributed over the web by the University of Idaho. The data service has a BMI, so it can be used directly with pymt for model-data coupling. Finally, using pymt, we coupled the PRMS process components and drove the coupled system with climate data from the gridMET data component. As a simple test, we were able to reproduce the results from running the standalone PRMS model. (The figure shows that outflow for the last stream segment in the coupled model system equals that from standalone PRMS.) This project was a fruitful collaboration between USGS and University of Colorado researchers, showing that research and operational models written in different languages can be wrapped in Python and coupled in an integrated modeling framework, making them more easily accessible for a new generation of researchers.

Mark Piper

and 5 more

The Community Surface Dynamics Modeling System (CSDMS), an international organization of over 1700 members, has a mission to enable model use and development for research in earth surface processes. CSDMS strives to expand the use of quantitative modeling techniques, promotes best practices in coding, and advocates for the use of open-source software. As a service for its members, the CSDMS Integration Facility (IF) maintains a code repository for numerical models. The CSDMS Model Repository, initialized in 2009, currently holds over 300 open source models and tools. To submit code to the Repository, a community member completes an online form, providing metadata for their code and selecting an open source license. In return for the code contribution, CSDMS provides a home for the model on its publicly accessible site. The model page is initially populated with the metadata provided by the author, but it can be edited and expanded to include documentation, examples, references, and graphics. If the code is available on a public repository, such as GitHub, a link to it is provided from the Repository; otherwise, the code is added to the Repository’s GitHub repository. The version of the code submitted to the Repository is assigned a DOI, making it citable. A QR code, suitable for display on a conference poster, is also created. Finally, the CSDMS IF has devised a model h-index, which gives a measure of a model’s visibility through journal citations. By submitting code to the CSDMS Model Repository, a model developer gets visibility, findability, accessibility, storage, and preservation for their model code. CSDMS gets a library of open source models that can be used for research. This can help accelerate science, since it’s often easier to use or modify an existing model than it is to start from scratch. The Repository also helps prevent model codes from going “dark” and being forgotten. Above all, the Repository serves the ethos of community modeling promoted by CSDMS.