Asset Publisher

MODFLOW 6 Application Programming Interface (API)

During 2020-2021 Deltares, together with USGS, worked on implementing an Application Programming Interface (API) for MODFLOW 6 for simulation control and software interoperability. 
The paper on that work has been accepted and is available online. Read the article in Environmental Modelling and Software 148 (2022) 105257 on ScienseDirect.

The software is available as part of the main MODFLOW 6 release and if you’re interested, more information can be found here: https://github.com/MODFLOW-USGS/modflow6.

 

Highlights

  • The MODFLOW API allows other programs to control MODFLOW without modifying MODFLOW.
  • The MODFLOW API is based on the Basic Model Interface and the eXtended Model Interface.
  • The MODFLOW API can be used to develop custom packages without modifying MODFLOW.
     

Abstract

The MODFLOW API allows other programs to control MODFLOW and interactively change variables without having to modify the source code. The MODFLOW API is based on the Basic Model Interface (BMI), which is a set of conventions that define how to initialize a simulation, update the model state by advancing in time, and finalize the run. For many existing MODFLOW coupling applications, the information provided to MODFLOW must be updated multiple times in a time step. As this capability to modify variables within a time step is not defined by the BMI, an extension to BMI was developed. This eXtended Model Interface is part of the MODFLOW API and allows such a tight coupling to other models. Examples are included for a variety of use cases, including new flexibility for users to develop custom packages without modifying the MODFLOW source code and coupling MODFLOW with other models and optimization libraries. 
 

Fig. 1. Overview of software components and applications in relation to the MODFLOW API. The Core contains all simulation code and can be compiled with a driver program into the MODFLOW executable (mf6. exe) and with the API into a shared library (libmf6. dll). An interoperability layer sits between MODFLOW and possible software applications. The interaction from Python is facilitated with the modflowapi package which extends the bindings for the XMI available in xmipy. As potential developments, the API can be exposed to C#.NET (mfapi.NET) or connected to the PyMT framework. The Apps layer shows external simulation programs that can interact with the MODFLOW API. 

 

Authors: 
Joseph D. Hughes, jdhughes@usgs.gov (U.S. Geological Survey)
Martijn J. Russcher, Martijn.Russcher@deltares.nl (Deltares
Christian D. Langevin, langevin@usgs.gov (U.S. Geological Survey)
Eric D. Morway, emorway@usgs.gov (U.S. Geological Survey)
Richard R. McDonald, rmcd@usgs.gov (U.S. Geological Survey)
 

Keywords:
MODFLOW 6, MODFLOW API, Basic model interface, MetaSWAP, PRMS, MODSIM

Asset Publisher

Read more >
Read more >
Read more >
Read more >